On Tue, 10 Jun 2025 13:12:20 GMT, Alexey Ivanov <aiva...@openjdk.org> wrote:

> I think a better solution is to create a new `MediaTracker`, and start anew 
> with id of zero.
> 
> The `TRACKER_KEY` is used only by `ImageIcon`, so it shouldn't break any apps.

If we create a new MediaTracker in ImageIcon and start anew with id of zero, 
then if application is having its own MediaTracker to track then when it calls 
for tracker.checkID(0) or tracker.statusID(0) then it will be confusing to 
which image it is referring to,
so I guess this current PR is more simpler in the sense it will notify ABORTED 
status for all images which overflows so that application can start anew with 
new ImageIcon and then use their MediaTracker to track this new ImageIcon.

Other thing that can be done is to modify "int" to "long" for all ids to 
further the overflow goalpost whereby `MediaTracker.checkID,addImage, statusID` 
signature will be changed..I dont think it will break any application but it 
will require CSR and since this issue is earmarked as Enhancement, maybe 
submitter also wanted that but I am not sure of going that route unless there 
is consensus on it..

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

PR Comment: https://git.openjdk.org/jdk/pull/25666#issuecomment-2961114635

Reply via email to