JDK-8076249 : NPE in AccessBridge while editing JList model
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.accessibility
  • Affected Version: 8,9
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2015-03-30
  • Updated: 2018-02-08
  • Resolved: 2017-04-14
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 JDK 9
10Fixed 8u121Fixed 9 b167Fixed
Related Reports
Relates :  
Description
Thiere's NPE in AccessBridge while editing JList model:

java.lang.RuntimeException: java.lang.NullPointerException
	at com.sun.java.accessibility.AccessBridge$InvocationUtils.invokeAndWait(AccessBridge.java:7206)
	at com.sun.java.accessibility.AccessBridge$InvocationUtils.invokeAndWait(AccessBridge.java:7181)
	at com.sun.java.accessibility.AccessBridge.getAccessibleActionFromContext(AccessBridge.java:1782)
	at com.sun.java.accessibility.AccessBridge.runDLL(Native Method)
	at com.sun.java.accessibility.AccessBridge.access$300(AccessBridge.java:57)
	at com.sun.java.accessibility.AccessBridge$dllRunner.run(AccessBridge.java:141)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
	at javax.swing.JList$AccessibleJList$AccessibleJListChild.getAccessibleAction(JList.java:3374)
	at com.sun.java.accessibility.AccessBridge$70.call(AccessBridge.java:1785)
	at com.sun.java.accessibility.AccessBridge$70.call(AccessBridge.java:1782)
	at com.sun.java.accessibility.AccessBridge$InvocationUtils$CallableWrapper.run(AccessBridge.java:7262)
	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$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
	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)

The attached testcase can be used to reproduce the issue:

1. jabswitch.exe -enable
2. run JAWS
3. launch test case
4. select by arrow key last element in list
5. move focus by tap to "remove first" btn and press space
6. press shift+tap to return focus back to list
7.press key up, the exception should occure
Comments
Fix Request : Screen readers can't read values of JList or JCombobox in some cases. AccessBridge works in separate thread,so if we modify JList model, AccessBridge can request information about removed AccessibleJListChild or element that changed position and this can lead to NPE. Almost all methods of AccessibleJListChild have checks for null, except those three where I added those checks. Webrev: http://cr.openjdk.java.net/~mcherkas/8177450/9/webrev/ The fix is reviewed by Phil Race.
13-04-2017

Fix is on review: http://mail.openjdk.java.net/pipermail/swing-dev/2017-April/007294.html http://cr.openjdk.java.net/~mcherkas/8076249/9/webrev.01/
13-04-2017