Bug 735472 - NullPointerException at XWindowPeer.restoreTransientFor() using a JOptionPane
Summary: NullPointerException at XWindowPeer.restoreTransientFor() using a JOptionPane
Status: CLOSED DUPLICATE of bug 730015
Alias: None
Product: Fedora
Classification: Fedora
Component: java-1.6.0-openjdk
Version: 15
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Deepak Bhole
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2011-09-02 18:04 UTC by Robert Marcano
Modified: 2011-09-06 15:27 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2011-09-06 15:27:49 UTC
Type: ---

Attachments (Terms of Use)
Test Case (2.16 KB, text/x-java)
2011-09-02 18:04 UTC, Robert Marcano
no flags Details

Description Robert Marcano 2011-09-02 18:04:15 UTC
Created attachment 521270 [details]
Test Case

Description of problem:

When a JOptionPane option (Yes/No) is first selected from a JOptionPane child of a JFrame that is not the first JFrame created in the VM, a NullPointerException is thrown at sun.awt.X11.XWindowPeer.restoreTransientFor(XWindowPeer.java:1681) 

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. Start the test case application, a Window opens
2. Press the button "Option Pane", an Option Pane opens
3. Press Yes or No, The window closes without errors
4. Press the secondary button, a new JFrame opens titled Secondary
5. On that Secondary JFrame, press the button "Option Pane"
6. Select Yes or No
7. An Exception is shown on the console

Actual results:

Exception occurred during event dispatching:
	at sun.awt.X11.XWindowPeer.restoreTransientFor(XWindowPeer.java:1681)
	at sun.awt.X11.XWindowPeer.removeFromTransientFors(XWindowPeer.java:1747)
	at sun.awt.X11.XWindowPeer.setModalBlocked(XWindowPeer.java:1469)
	at sun.awt.X11.XWindowPeer.setModalBlocked(XWindowPeer.java:1440)
	at java.awt.Window.setModalBlocked(Window.java:1359)
	at java.awt.Dialog.unblockWindow(Dialog.java:1597)
	at java.awt.Dialog.modalHide(Dialog.java:1483)
	at java.awt.Dialog.hideAndDisposePreHandler(Dialog.java:1215)
	at java.awt.Dialog.hide(Dialog.java:1255)
	at java.awt.Component.show(Component.java:1553)
	at java.awt.Component.setVisible(Component.java:1503)
	at java.awt.Window.setVisible(Window.java:881)
	at java.awt.Dialog.setVisible(Dialog.java:1011)
	at javax.swing.JOptionPane$3.propertyChange(JOptionPane.java:1021)

Expected results:

The Option Pane must close without errors

Additional info:

Reverting to java-1.6.0-openjdk.x86_64 the problem does not happen, the current release fixes bug # 711900 that is related to wrong behavior with model windows, probably the fix introduces this regression since JOptionPane is model too

Test Case attached

Comment 1 Robert Marcano 2011-09-02 18:08:51 UTC
Modal, not model :-(

I am not sure RH people could talk about official Java test suite for licensing issues, but my personal opinion is that it must not have many tests related to AWT/Swing just checking those two bugs I have reported. What can we do to improve this, I do not see tests on icedtea either (probably I am unable to find them but exist). What is the best course of actions to add some tests, do OpenJDK accept tests outside the TCK?

Comment 2 Deepak Bhole 2011-09-06 15:27:49 UTC
Hi, thanks for reporting and the test case! A bug has already been filed for this and it is fixed upstream. It will be in the next java-1.6.0-openjdk update.

*** This bug has been marked as a duplicate of bug 730015 ***

Note You need to log in before you can comment on or make changes to this bug.