RFR: 4200096: OffScreenImageSource.removeConsumer NullPointerException [v6]

Sergey Bylokhov serb at openjdk.org
Fri Apr 21 21:34:45 UTC 2023


On Fri, 14 Apr 2023 01:54:49 GMT, Jeremy <duke at openjdk.org> wrote:

>> This resolves a 25 year old P4 ticket: a NullPointerException is printed to System.err needlessly.
>> 
>> This resolution involves confirming that an ImageConsumer is still registered before every notification.
>> 
>> I'll understand if this is rejected as unimportant, but I stumbled across this in the real world the other day and thought this was a simple enough bug to practice on.
>
> Jeremy has updated the pull request incrementally with one additional commit since the last revision:
> 
>   4200096: removing whitespace diffs
>   
>   prrace pointed out this branch introduced some pointless whitespace changes.
>   https://github.com/openjdk/jdk/pull/13408#discussion_r1164740594

src/java.desktop/share/classes/sun/awt/image/OffScreenImageSource.java line 208:

> 206:             // ImageConsumer detaches itself from this ImageProducer mid-production.
> 207: 
> 208:             if (theConsumer != null) {

Do we need here and a few lines above save the theConsumer to the local, then check to null, then call imageComplete?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13408#discussion_r1174176182



More information about the client-libs-dev mailing list