JDK-8188083 : NullPointerExcpn-java.awt.image.FilteredImageSource.startProduction JDK-8079607
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 7u71,8u112,10
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2017-09-28
  • Updated: 2019-01-14
  • Resolved: 2017-12-12
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 10 JDK 8
10 b36Fixed 8u192Fixed
Related Reports
CSR :  
Relates :  
Comments
Additional Information: . Here is the stack trace information (shared by submitter) leading to Null Pointer Exception java.lang.NullPointerException at java.awt.image.FilteredImageSource.startProduction(FilteredImageSource.java:181) at java.awt.image.FilteredImageSource.startProduction(FilteredImageSource.java:183) at sun.awt.image.ImageRepresentation.startProduction(ImageRepresentation.java:732) at sun.awt.image.ToolkitImage.addWatcher(ToolkitImage.java:221) . I was able to reproduce the exception at FilteredImageSource.java: 181. . Refer to the attached image- Indicates the exception occurrence with JDK9. . The image also shows the test passing with JDK10 local build containing the fix.
26-10-2017

Image: Indicating exception occurrence & the fix
26-10-2017

Fix In-progress: http://cr.openjdk.java.net/~pnarayanan/8188083/webrev.00
26-10-2017

Inferences from inspection are as follows: . FilteredImageSource implements ImageProducer (interface). . As documented by ImageProducer (interface), the FilteredImageSource.startProduction method checks whether the given ImageConsumer in argument is a registered consumer, & updates the "proxies" object (a HashTable<ImageConsumer, ImageFilter>) but does not do so in a proper way. . First, The method could utilize existing "synchronized" method- addConsumer to update "proxies" object & thus register the current consumer rather than doing it internally duplicating the code. . Second, To guarantee safe execution, any getter or setter method working on common data (invoked from multiple threads) should be synchronized. Thus the method requires "synchronized" keyword in the signature or a synchronized(this) { ... } block within startProduction method that gives a similar result. I shall arrive at a fix for this issue but without a test-case because it 's hard to generate a failure in this particular scenario.
26-10-2017

Does it affect 9? 10?
04-10-2017