JDK-6272952 : PIT: Pressing LEFT ARROW on a popup menu throws NullPointerException, XToolkit
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 6
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: solaris_10
  • CPU: sparc
  • Submitted: 2005-05-19
  • Updated: 2006-04-06
  • Resolved: 2005-07-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 6
6 b43Fixed
Related Reports
Relates :  
Description
Run the attached test on XToolkit. You would see a frame with a choice and a button. Right click inside the choice. A popup menu will open. Click on the 'FILE' submenu. The corresponding sub-menu will open. Now keep pressing 'LEFT ARROW'. During first press, the submenu will dis-appear. Press it again. You will get the following exception:

java.lang.NullPointerException
at sun.awt.X11.XBaseMenuWindow.doHandleJavaKeyEvent(XBaseMenuWindow.java:1077)
at sun.awt.X11.XPopupMenuPeer.handleEvent(XPopupMenuPeer.java:219)
at sun.awt.X11.XBaseMenuWindow$3.run(XBaseMenuWindow.java:895)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:590)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:270)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:198)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:171)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:166)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:158)        
at java.awt.EventDispatchThread.run(EventDispatchThread.java:119)

Here is the PIT build:
java version "1.6.0-awt.pit-int-awt-blade"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.6.0-awt.pit-int-awt-blade-dm97671_17_May_2005_14_27-b00)
Java HotSpot(TM) Server VM (build 1.6.0-ea-b36, mixed mode)

This is not reproducible on other platforms. I reproduced it SolSparc10-JDS. Looks like 6266513 is not fixed completely.
###@###.### 2005-05-19 10:22:48 GMT

Comments
EVALUATION There is no check if current menu window is popup menu ###@###.### 2005-05-19 12:26:30 GMT
19-05-2005

SUGGESTED FIX ------- XBaseMenuWindow.java ------- *** 1074,1080 **** //hide leaf moving focus to its parent //(equvivalent of pressing ESC) XBaseMenuWindow pwnd = cwnd.getParentMenuWindow(); ! pwnd.selectItem(pwnd.getSelectedItem(), false); } break; case KeyEvent.VK_RIGHT: --- 1074,1082 ---- //hide leaf moving focus to its parent //(equvivalent of pressing ESC) XBaseMenuWindow pwnd = cwnd.getParentMenuWindow(); ! if (pwnd != null) { ! pwnd.selectItem(pwnd.getSelectedItem(), false); ! } } break; case KeyEvent.VK_RIGHT: ###@###.### 2005-05-19 12:26:30 GMT
19-05-2005