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

Alexey Ivanov aivanov at openjdk.org
Fri Oct 24 11:30:15 UTC 2025


On Thu, 23 Oct 2025 21:15:02 GMT, Harshitha Onkar <honkar at openjdk.org> wrote:

> If a wrapper is added we might need to check if it is already on EDT thread or not as below:

This is what I said: *“the implementation will run directly or on EDT.”* So if it's already on EDT, call directly; it it's not, use `invokeOnEDT`.

The utility method can then be used in all the contexts without thinking. (The implementation, if you choose this way, should rather be `findComponentImpl` rather than prefixed with an underscore.)

Likely, one still needs to call `findComponent` on EDT because any other operations on the component need to be on EDT. In this case, `findComponent` could throw an exception if it's called not on EDT.

These things will ensure the method can work correctly.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27944#discussion_r2459914938


More information about the client-libs-dev mailing list