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

Alexey Ivanov aivanov at openjdk.org
Wed Jan 28 15:57:37 UTC 2026


On Tue, 27 Jan 2026 06:02:15 GMT, Phil Race <prr at openjdk.org> wrote:

>> src/java.desktop/share/classes/javax/swing/ImageIcon.java line 346:
>> 
>>> 344:     }
>>> 345: 
>>> 346:     private static final MediaTracker MEDIA_TRACKER = new MediaTracker(new Component() {});
>> 
>> This actually duplicates an existing declaration:
>> `protected static final MediaTracker tracker = new MediaTracker(component);`
>> I assume it was deprecated in Java 8 because of the AppContext issue? so now we can just uses that one?
>
> Not as far as I can see
> https://hg.openjdk.org/jdk8/jdk8/jdk/rev/54a6e22b749c
> I think that it was visible to apps was the issue.

I agree it's safer not to use the deprecated field *that's visible to apps*.

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

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


More information about the client-libs-dev mailing list