RFR: 4200096: OffScreenImageSource.removeConsumer NullPointerException
Sergey Bylokhov
serb at openjdk.org
Tue Apr 11 00:13:34 UTC 2023
On Mon, 10 Apr 2023 16:16:32 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.
test/jdk/sun/awt/image/OffScreenImageSource/bug4200096.java line 49:
> 47: super.println(x);
> 48: if (x instanceof Throwable)
> 49: System.exit(1);
The tests should not use the System.exit() as it might affect the execution of other tests. It is better to set some flag and check it at the end.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/13408#discussion_r1162182212
More information about the client-libs-dev
mailing list