Bug 735472

Summary: NullPointerException at XWindowPeer.restoreTransientFor() using a JOptionPane
Product: [Fedora] Fedora Reporter: Robert Marcano <robert>
Component: java-1.6.0-openjdkAssignee: Deepak Bhole <dbhole>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 15CC: ahughes, dbhole, jon.vanalten, jvanek, lkundrak, mjw, mmatejov, omajid
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-09-06 11:27:49 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Description Flags
Test Case none

Description Robert Marcano 2011-09-02 14:04:15 EDT
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 14:08:51 EDT
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 11:27:49 EDT
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 ***