JDK-8042672 : JAB throw NPE when trying to do reference increment on a NULL object
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.accessibility
  • Affected Version: 2.0.4
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2014-05-07
  • Updated: 2014-10-15
  • Resolved: 2014-05-08
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.
Other JDK 7 JDK 8 JDK 9
2.0.5Fixed 7u76Fixed 8u20Fixed 9Fixed
Description
When testing SwingSet2.jar with JAB, found below NPE:
Exception in thread "Thread-3" java.lang.NullPointerException
        at java.util.concurrent.ConcurrentHashMap.containsKey(ConcurrentHashMap.
java:782)
        at com.sun.java.accessibility.AccessBridge$ObjectReferences.increment(Ac
cessBridge.java:4739)
        at com.sun.java.accessibility.AccessBridge.getVirtualAccessibleNameFromC
ontext(AccessBridge.java:875)
        at com.sun.java.accessibility.AccessBridge.run(Native Method)
        at java.lang.Thread.run(Thread.java:682)
Exception in thread "Thread-3" java.lang.NullPointerException
        at java.util.concurrent.ConcurrentHashMap.containsKey(ConcurrentHashMap.
java:782)
        at com.sun.java.accessibility.AccessBridge$ObjectReferences.increment(Ac
cessBridge.java:4739)
        at com.sun.java.accessibility.AccessBridge.getVirtualAccessibleNameFromC
ontext(AccessBridge.java:875)
        at com.sun.java.accessibility.AccessBridge.run(Native Method)
        at java.lang.Thread.run(Thread.java:682) 
Comments
================Email Review==================================== Looks good Vivi. On 5/7/14 9:04 PM, Vivi An wrote: > Hello Pete, > > Attached is webrev for JDK-8042672. Would you please help to review? > > Thanks > > Vivi
15-05-2014

Changeset: http://closedjdk.us.oracle.com/accessbridge/2.0.5/rev/ec2359d3d5e4
08-05-2014

Or we need to add gard in increment function to filter null object out.
07-05-2014

We need to add guard before we try to increase the reference count. String iconDescription = InvocationUtils.invokeAndWait(new Callable<String>() { @Override public String call() throws Exception { return ai[0].getAccessibleIconDescription(); } }, ac); if (iconDescription != null) { debugString ("bk -- The Virtual Accessible Name was obtained from the description of the first Accessible Icon found in the LABEL object."); references.increment (iconDescription); return iconDescription; }
07-05-2014