JDK-8085799 : CAccessibility throws null pointer at line 626
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.accessibility
  • Affected Version: 8u45,9
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: other
  • CPU: x86
  • Submitted: 2015-05-22
  • Updated: 2018-11-22
  • Resolved: 2018-08-11
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
tbd_majorResolved
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
FULL PRODUCT VERSION :
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)

ADDITIONAL OS VERSION INFORMATION :
Darwin macpro 14.3.0 Darwin Kernel Version 14.3.0: Mon Mar 23 11:59:05 PDT 2015; root:xnu-2782.20.48~5/RELEASE_X86_64 x86_64

A DESCRIPTION OF THE PROBLEM :
CAccessibility in the package sun.lwawt.macosx does not check for null when getting JAVA_AX_VISIBLE_CHILDREN. It does not seem to consider that context.getAccessibleComponent() could return null, so the stack trace and such is getting spammed to the log.
I suspect that this will happen with ac.getAccessibleSelection() as well on line 628

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
No Null pointer exception
ACTUAL -
Null pointer exception

ERROR MESSAGES/STACK TRACES THAT OCCUR :
java.lang.NullPointerException
	at sun.lwawt.macosx.CAccessibility._addChildren(CAccessibility.java:626)
	at sun.lwawt.macosx.CAccessibility.access$000(CAccessibility.java:38)
	at sun.lwawt.macosx.CAccessibility$33.call(CAccessibility.java:571)
	at sun.lwawt.macosx.CAccessibility$33.call(CAccessibility.java:568)
	at sun.lwawt.macosx.LWCToolkit$CallableWrapper.run(LWCToolkit.java:598)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:301)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
	at java.awt.EventQueue.access$500(EventQueue.java:97)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.awt.EventQueue$3.run(EventQueue.java:703)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:86)
	at java.awt.EventQueue$4.run(EventQueue.java:731)
	at java.awt.EventQueue$4.run(EventQueue.java:729)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
	at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:159)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

REPRODUCIBILITY :
This bug can be reproduced always.


Comments
This will be fixed as part of JDK-8160893.
23-09-2016

In CAccessibility._addChildren: if (whichChildren == JAVA_AX_VISIBLE_CHILDREN) { if (!context.getAccessibleComponent().isVisible()) continue; } else if (whichChildren == JAVA_AX_SELECTED_CHILDREN) { if (!ac.getAccessibleSelection().isAccessibleChildSelected(i)) continue; } getAccessibleComponent and getAccessibleSelection are not being tested for returning null.
14-03-2016

Need to test on a MAC Pro based upon response received from the submitter. Checked this on Windows and is not reproducible. ------------------------------------------------------------------------ 1. Open a copy of Netbeans 2. Open the window that shows the ide log 3. Enable Voice-Over After a little while of having Netbeans open and moving focus about inside it, you should see the exception in the log. --------------------------------------------------------------------------------------------------------
19-06-2015