Bug 27522 - NPE with full-screen JFrame
Summary: NPE with full-screen JFrame
Status: RESOLVED FIXED
Alias: None
Product: classpath
Classification: Unclassified
Component: swing (show other bugs)
Version: unspecified
: P3 normal
Target Milestone: 0.92
Assignee: Roman Kennke
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-09 18:16 UTC by Yvan Norsa
Modified: 2006-06-06 13:15 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
Test-case (258 bytes, text/x-java)
2006-05-09 18:17 UTC, Yvan Norsa
Details
Patch (336 bytes, patch)
2006-05-09 18:26 UTC, Yvan Norsa
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yvan Norsa 2006-05-09 18:16:30 UTC
A full-screen JFrame with a JMenuBar, which has a JButton inside, will throw a NPE when visible.
Comment 1 Yvan Norsa 2006-05-09 18:17:10 UTC
Created attachment 11423 [details]
Test-case

Corresponding stacktrace :
Exception during event dispatch:
java.lang.NullPointerException
   at javax.swing.JMenuBar.processKeyBindingHelper(JMenuBar.java:532)
   at javax.swing.JMenuBar.processKeyBinding(JMenuBar.java:503)
   at javax.swing.JComponent.processKeyEvent(JComponent.java:2529)
   at java.awt.Component.processEvent(Component.java:2967)
   at java.awt.Container.processEvent(Container.java:914)
   at java.awt.Component.dispatchEventImpl(Component.java:5033)
   at java.awt.Container.dispatchEventImpl(Container.java:1741)
   at java.awt.Component.dispatchEvent(Component.java:2322)
   at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1111)
   at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:280)
   at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:253)
   at java.awt.EventDispatchThread.run(EventDispatchThread.java:74)
   at java.lang.VMThread.run(VMThread.java:135)
Comment 2 Yvan Norsa 2006-05-09 18:26:21 UTC
Created attachment 11424 [details]
Patch

This patch checks for a null menuElement in JMenuBar.processKeyBindingHelper()
Comment 3 cvs-commit@developer.classpath.org 2006-06-06 12:55:18 UTC
Subject: Bug 27522

CVSROOT:	/cvsroot/classpath
Module name:	classpath
Changes by:	Roman Kennke <rabbit78>	06/06/06 12:54:39

Modified files:
	javax/swing    : JMenuBar.java 
	.              : ChangeLog 

Log message:
	2006-06-06  Roman Kennke  <kennke@aicas.com>
	
		PR 27522
		* javax/swing/JMenuBar.java
		(processKeyBindingHelper): Added null check to prevent NPE.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/classpath/javax/swing/JMenuBar.java?cvsroot=classpath&r1=1.23&r2=1.24
http://cvs.savannah.gnu.org/viewcvs/classpath/ChangeLog?cvsroot=classpath&r1=1.7673&r2=1.7674

Patches:

Index: ChangeLog
===================================================================
RCS file: /cvsroot/classpath/classpath/ChangeLog,v
retrieving revision 1.7673
retrieving revision 1.7674
diff -u -b -r1.7673 -r1.7674
--- ChangeLog	6 Jun 2006 12:21:21 -0000	1.7673
+++ ChangeLog	6 Jun 2006 12:54:37 -0000	1.7674
@@ -1,5 +1,11 @@
 2006-06-06  Roman Kennke  <kennke@aicas.com>
 
+	PR 27522
+	* javax/swing/JMenuBar.java
+	(processKeyBindingHelper): Added null check to prevent NPE.
+
+2006-06-06  Roman Kennke  <kennke@aicas.com>
+
 	* javax/swing/plaf/basic/BasicInternalFrameUI.java
 	(ShowSystemMenuAction): New class.
 	(installKeyboardActions): Implemented.



Comment 4 Roman Kennke 2006-06-06 13:15:44 UTC
Fixed in CVS.