RFR: 8236987: Remove call to System.out.println from ImageIcon.loadImage [v5]

Phil Race prr at openjdk.java.net
Thu Mar 24 19:22:21 UTC 2022


On Wed, 23 Mar 2022 18:15:54 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:

>> Tejesh R has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Updated based on review comments
>
> src/java.desktop/share/classes/javax/swing/ImageIcon.java line 338:
> 
>> 336:             mTracker.removeImage(image, id);
>> 337: 
>> 338:             if (interrupted && ((loadStatus & MediaTracker.LOADING )!= 0)) {
> 
> Suggestion:
> 
>             if (interrupted && ((loadStatus & MediaTracker.LOADING ) != 0)) {
> 
> There should be one space on either side of a binary operator.

It seems to me that as I mentioned there's at least a possibility that the image actually is loaded. This thread being interrupted doesn't stop the Media loading threads.

Since there's only one image for this id, LOADING and COMPLETE ought to be
mutually exclusive. In fact I'd expect only one of the flags to be set.

So I can I suppose see the logic that this API returning ABORTED instead of LOADING
makes sense, but that is because this method removes it from the tracker ..

So I guess I can live with it .. especially since I think this an unlikely scenario.

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

PR: https://git.openjdk.java.net/jdk/pull/7754



More information about the client-libs-dev mailing list