RFR: 8055461: getNextID in ImageIcon class can lead to overflow [v2]

Prasanta Sadhukhan psadhukhan at openjdk.org
Fri Jun 13 05:06:28 UTC 2025


On Wed, 11 Jun 2025 15:04:21 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:

>> ImageIcon.getNextID uses `mediaTrackerID ` which do not detect overflow.
>> 
>> Theoretically there is a possibility that there can be overflow in the long time run or for large number of created "imageIcon"
>> 
>> Made sure there is no overflow and treat that loadImage as ABORTED
>> 
>> No regression testcase as it addresses theoretical possibility..
>
> Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Reset mediaTrackerID if it overflows

But if the fix doesnt hamper anything and still fixes the problem of overflow (even if overflow itself doesn't apparently cause any issue) maybe we should consider it..

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

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


More information about the client-libs-dev mailing list