JDK-8159696 : java.beans.MethodRef#get throws NullPointerException
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.beans
  • Affected Version: 8u92
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux
  • CPU: x86_64
  • Submitted: 2016-06-09
  • Updated: 2017-11-29
  • Resolved: 2016-08-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 8 JDK 9
8u152Fixed 9 b133Fixed
Description
FULL PRODUCT VERSION :
java version "1.8.0_92"
Java(TM) SE Runtime Environment (build 1.8.0_92-b14)
Java HotSpot(TM) Server VM (build 25.92-b14, mixed mode)

ADDITIONAL OS VERSION INFORMATION :
Linux jokimi1-vdm 3.13.0-35-generic #62-Ubuntu SMP Fri Aug 15 01:58:42 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

A DESCRIPTION OF THE PROBLEM :
When this line is reached...

  "return isPackageAccessible(method.getDeclaringClass()) ? method : null;"

... "method" can be null.


ERROR MESSAGES/STACK TRACES THAT OCCUR :
Caused by: java.lang.NullPointerException
	at java.beans.MethodRef.get(MethodRef.java:72) ~[?:1.8.0_92]
	at java.beans.PropertyDescriptor.getWriteMethod(PropertyDescriptor.java:271) ~[?:1.8.0_92]
	at java.beans.Introspector.addPropertyDescriptor(Introspector.java:588) ~[?:1.8.0_92]
	at java.beans.Introspector.addPropertyDescriptors(Introspector.java:614) ~[?:1.8.0_92]
	at java.beans.Introspector.getTargetPropertyInfo(Introspector.java:467) ~[?:1.8.0_92]
	at java.beans.Introspector.getBeanInfo(Introspector.java:428) ~[?:1.8.0_92]
	at java.beans.Introspector.getBeanInfo(Introspector.java:173) ~[?:1.8.0_92]

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
I was unable to reproduce it outside the application. I think it might be dependent on memory/GC pressure. When this happens, there is a lot of object allocation.
---------- END SOURCE ----------