RFR: 8376420: Remove AppContext from javax/swing/ImageIcon.java [v2]
Sergey Bylokhov
serb at openjdk.org
Fri Jan 30 20:53:00 UTC 2026
On Thu, 29 Jan 2026 17:36:04 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:
>>> Does an app need direct access to the `MediaTracker` that's used to download the image? Probably not, therefore a private member is better.
>>
>> The application will have this access via getter already, the problematic part here is access to the Component which is mutable so we cannot use it via final field.
>
>> > Does an app need direct access to the `MediaTracker` that's used to download the image? Probably not, therefore a private member is better.
>>
>> The application will have this access via getter already
>
> I'm confused… Where's a getter in `ImageIcon` that an app can use to get a `MediaTracker` instance?
>
> The `getTracker` method is *private*.
>
>> the problematic part here is access to the Component which is mutable so we cannot use it via final field.
>
> The `component` field is *final*.
The field yes, but the component itself is not a constant.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/29433#discussion_r2747942137
More information about the client-libs-dev
mailing list