[OpenJDK 2D-Dev]  Fix for JDK-8160421 : Regression: JDK-8139192 causes NPE in java.awt.Toolkit.createCustomCursor()
philip.race at oracle.com
Thu Jul 7 23:15:18 UTC 2016
On 7/6/16, 9:52 PM, Ajit Ghaisas wrote:
> Thanks for the review.
> I have corrected the test case name as per suggestion.
> Here is the updated webrev.
> Yes, the test captures the redirected contents of stderr correctly when run using jtreg - both with or without othervm specified.
> -----Original Message-----
> From: Phil Race
> Sent: Wednesday, July 06, 2016 12:48 AM
> To: Ajit Ghaisas
> Cc: Jim Graham; Sergey Bylokhov; 2d-dev
> Subject: Re: [OpenJDK 2D-Dev]  Fix for JDK-8160421 : Regression: JDK-8139192 causes NPE in java.awt.Toolkit.createCustomCursor()
> I prefer meaningful test names .. the bug id is already in the @bug tag and a test can later be updated to test> 1 bug.
> Did you verify that you are in fact capturing stderr - even in othervm mode - when running the test under jtreg ?
> Even when setting up a new VM jtreg may capture this for you.
> On 07/05/2016 04:42 AM, Ajit Ghaisas wrote:
>> Thanks Jim for suggesting test should have its own VM. I agree with it.
>> Here is the updated webrev :
>> Phil, can you please review it?
>> -----Original Message-----
>> From: Jim Graham
>> Sent: Friday, July 01, 2016 5:13 AM
>> To: Ajit Ghaisas; Philip Race; Sergey Bylokhov; 2d-dev
>> Subject: Re: [OpenJDK 2D-Dev]  Fix for JDK-8160421 : Regression:
>> JDK-8139192 causes NPE in java.awt.Toolkit.createCustomCursor()
>> The solution looks fine to me.
>> I didn't run the test case, but about the only issue I can see with it is whether it should have a flag to run it in its own VM because of its interaction with System.err. Phil?
>> On 06/30/2016 06:41 AM, Ajit Ghaisas wrote:
>>> Bug :
>>> This is regarding a NPE getting printed as stacktrace in java.awt.Toolkit.createCustomCursor() method.
>>> The bug is described at :
>>> Root Cause :
>>> Fix of bug JDK-8139192 : Custom ImageFilters return blank images in Java 8(.45) while working in 7.
>>> The above fix added a RuntimeException catch& log mechanism to support a ImageFilter which was broken due to the second imageComplete() call in OffScreenImageSource.produce() method.
>>> Without the fix of JDK-8139192, java.awt.Toolkit.createCustomCursor() call results in
>>> NullPointerException when imageComplete(ImageConsumer.STATICIMAGEDONE) call is made - but, it gets consumed silently.
>>> Cathing RuntimeException() out of imageComplete(ImageConsumer.STATICIMAGEDONE) was added to fix JDK-8160421.
>>> This started catching& logging the exception in case 'theConsumer' has unregistered itself as a result of call
>>> This log is undesirable as this mechanism is used in java.awt.Toolkit.createCustomCursor() and may be in other places.
>>> Fix :
>>> Make the call to imageComplete(ImageConsumer.STATICIMAGEDONE) only if 'theConsumer' has not been unregistered.
>>> Request you to review.
More information about the 2d-dev