RFR: 8055461: getNextID in ImageIcon class can lead to overflow
Prasanta Sadhukhan
psadhukhan at openjdk.org
Wed Jun 11 12:33:27 UTC 2025
On Wed, 11 Jun 2025 11:06:10 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:
> Could you elaborate please?
>
> The `mediaTrackerID` is a static field in `ImageIcon`; `MediaTracker` is also a static-like shared instance that's stored in `AppContext`.
>
> This means if `mediaTrackerID` overflows, the application can't use `new ImageIcon` to load any more images — the application can no longer work. The application can do nothing about it.
WHy application cant use new ImageIcon I didnt understand?
I meant if application creates/instantiates a new ImageIcon (seeing the previous ImageIcon is giving ABORTED status for all images), the `mediaTrackerID` will reset from 0, this field will have no bearing from previous ImageIcon instance..am I missing something?
-------------
PR Comment: https://git.openjdk.org/jdk/pull/25666#issuecomment-2962504035
More information about the client-libs-dev
mailing list