RFR: JDK-8353755 : Add a helper method to Util - findComponent() [v2]

Harshitha Onkar honkar at openjdk.org
Thu Oct 23 21:02:07 UTC 2025


> `findComponent(final Container container, final Predicate<Component> predicate)` is a useful utility method and thus added to` javax/swing/regtesthelpers/Util.java` instead of having redundant code in tests. It can be used to find a component by label name.
> 
> PS: Existing `Util.findSubComponent()` finds component by class name but `findComponent()` can be used to search for a particular component by label name/title when there are multiple subcomponents of same type by applying a predicate logic.

Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision:

  review update

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/27944/files
  - new: https://git.openjdk.org/jdk/pull/27944/files/f8030256..6bc90058

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=27944&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27944&range=00-01

  Stats: 11 lines in 3 files changed: 0 ins; 4 del; 7 mod
  Patch: https://git.openjdk.org/jdk/pull/27944.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/27944/head:pull/27944

PR: https://git.openjdk.org/jdk/pull/27944


More information about the client-libs-dev mailing list