RFR: 8376420: Remove AppContext from javax/swing/ImageIcon.java [v2]

Alexey Ivanov aivanov at openjdk.org
Mon Feb 9 21:38:21 UTC 2026


On Fri, 30 Jan 2026 20:50:14 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:

> The field yes, but the component itself is not a constant.

Does it matter? The component is needed to create the `MediaTracker` instance. Then, media tracker uses `checkImage` and `prepareImage` which delegate to the `Toolkit`.

Can the application change anything in the `Component` instance which would prevent the `checkImage` and `prepareImage` method from working correctly? *Unlikely*.

Either way, I'm for using a different component to create the `MediaTracker` instance instead of re-using the long-deprecated `component` field. It's cleaner and safer, isn't it?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/29433#discussion_r2782658010


More information about the client-libs-dev mailing list