JDK-4691646 : REGRESSION: showXXXDialog() of JOptionPane hangs the application
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.4.0
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_nt
  • CPU: x86
  • Submitted: 2002-05-24
  • Updated: 2002-08-22
  • Resolved: 2002-08-22
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.
Other
1.4.2 mantisFixed
Related Reports
Relates :  
Description

Name: gm110360			Date: 05/24/2002


FULL PRODUCT VERSION :
java version "1.4.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)

FULL OPERATING SYSTEM VERSION : Windows NT Version 4.0,
Service pack 6.0


ADDITIONAL OPERATING SYSTEMS : SunOS 5.7



A DESCRIPTION OF THE PROBLEM :
When you try to display any dialog box provided by
JOptionPane from any of the methods (windowClosing,
windowActivated or windowDeactivated) of WindowAdapter
class, the entire application will hang even before the
dialog box is painted.

REGRESSION.  Last worked in version 1.3.1

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1.use any of the showXXXDialog() methods of JOptionPane in
any WindowAdapter method.(I tried showInputDialog &
showConfirmDialog from windowClosing, windowActivated &
windowDeactivated)
2.compile the application & run it.
3.try doing the action which is supposed to display the
dialog & the application will hang.(Ex, try closing the
application if showXXXDialog() method is in windowClosing of
WindowAdapter)

EXPECTED VERSUS ACTUAL BEHAVIOR :
The result should be proper display & working of the dialog
box, instead the application hangs even before the dialog
box is painted.

ERROR MESSAGES/STACK TRACES THAT OCCUR :
I tried to put the showXXXDialog inside a try/catch block but no exception was
caught & no error message was displayed.

This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

public class JOptionPaneBug extends JFrame{


    public JOptionPaneBug(){
	
	setTitle("JOptionPaneBug Test Program");
	
	setSize(300,300);

	JPanel panel = new JPanel();

	JLabel label = new JLabel("Application to show the bug !");
	
	panel.add(label);

	getContentPane().add(panel,BorderLayout.SOUTH);

	//Anonymous inner class to terminate the program

	this.addWindowListener(new WindowAdapter()
			       {
				   public void windowClosing(WindowEvent evt)
				       {
					   JOptionPane.showInputDialog(new
String[] {
"Please enter 0 to exit."});
					   System.exit(0);
				       }
				   
				   public void windowActivated(WindowEvent e) {
				       
		                   }
				   public void windowDeactivated(WindowEvent e)
{
				       JOptionPane.showConfirmDialog(null, new
String[] {
"The window was deactivated.",
"Do you want the application window to lose focus?"});
				   }

			       });
    }
    
    public static void main (String args[]){
	
	JOptionPaneBug test = new JOptionPaneBug();
	test.setVisible(true);
	
    }
    
}


---------- END SOURCE ----------

Release Regression From : 1.3.1_03
The above release value was the last known release where this 
bug was known to work. Since then there has been a regression.

(Review ID: 145615) 
======================================================================

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: mantis FIXED IN: mantis INTEGRATED IN: mantis
24-08-2004

EVALUATION Here is the backtrace on my solaris box: "Thread-3" prio=5 tid=0x2ae28 nid=0x1 waiting on monitor [0..ffbee358] "AWT-EventQueue-0" prio=6 tid=0x1338b0 nid=0xf waiting on monitor [71fff000..720019c0] at java.lang.Object.wait(Native Method) - waiting on <72806918> (a java.awt.EventQueue) at java.lang.Object.wait(Object.java:426) at java.awt.EventQueue.getNextEvent(EventQueue.java:361) - locked <72806918> (a java.awt.EventQueue) at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:155) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:144) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138) at java.awt.SequencedEvent.dispatch(SequencedEvent.java:72) at java.awt.EventQueue.dispatchEvent(EventQueue.java:443) at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:190) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:144) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:134) at java.awt.Dialog.show(Dialog.java:524) at javax.swing.JOptionPane.showOptionDialog(JOptionPane.java:822) at javax.swing.JOptionPane.showConfirmDialog(JOptionPane.java:750) at javax.swing.JOptionPane.showConfirmDialog(JOptionPane.java:713) at javax.swing.JOptionPane.showConfirmDialog(JOptionPane.java:675) at javax.swing.JOptionPane.showConfirmDialog(JOptionPane.java:647) at JOptionPaneBug$1.windowDeactivated(JOptionPaneBug.java:39) at java.awt.Window.processWindowEvent(Window.java:1098) at javax.swing.JFrame.processWindowEvent(JFrame.java:266) at java.awt.Window.processEvent(Window.java:1042) at java.awt.Component.dispatchEventImpl(Component.java:3526) at java.awt.Container.dispatchEventImpl(Container.java:1437) at java.awt.Window.dispatchEventImpl(Window.java:1566) at java.awt.Component.dispatchEvent(Component.java:3367) at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1700) at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:709) at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:459) at java.awt.Component.dispatchEventImpl(Component.java:3396) at java.awt.Container.dispatchEventImpl(Container.java:1437) at java.awt.Window.dispatchEventImpl(Window.java:1566) at java.awt.Component.dispatchEvent(Component.java:3367) at java.awt.EventQueue.dispatchEvent(EventQueue.java:445) at java.awt.SentEvent.dispatch(SentEvent.java:50) at java.awt.DefaultKeyboardFocusManager$DefaultKeyboardFocusManagerSentEvent.dispatch(DefaultKeyboardFocusManager.java:140) at java.awt.DefaultKeyboardFocusManager.sendMessage(DefaultKeyboardFocusManager.java:164) at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:518) at java.awt.Component.dispatchEventImpl(Component.java:3396) at java.awt.Container.dispatchEventImpl(Container.java:1437) at java.awt.Window.dispatchEventImpl(Window.java:1566) at java.awt.Component.dispatchEvent(Component.java:3367) at java.awt.EventQueue.dispatchEvent(EventQueue.java:445) at java.awt.SequencedEvent.dispatch(SequencedEvent.java:105) at java.awt.EventQueue.dispatchEvent(EventQueue.java:443) at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:190) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:144) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:130) at java.awt.EventDispatchThread.run(EventDispatchThread.java:98) "Thread-1" daemon prio=5 tid=0x1e6ff0 nid=0xe waiting on monitor [72101000..721019c0] at java.lang.Object.wait(Native Method) - waiting on <7286abb0> (a java.util.TaskQueue) at java.util.TimerThread.mainLoop(Timer.java:429) - locked <7286abb0> (a java.util.TaskQueue) at java.util.TimerThread.run(Timer.java:382) "AWT-Shutdown" prio=6 tid=0x1e69a8 nid=0xd waiting on monitor [72301000..723019c0] at java.lang.Object.wait(Native Method) - waiting on <72a15858> (a java.lang.Object) at java.lang.Object.wait(Object.java:426) at sun.awt.AWTAutoShutdown.run(AWTAutoShutdown.java:259) - locked <72a15858> (a java.lang.Object) at java.lang.Thread.run(Thread.java:536) "AWT-Motif" daemon prio=6 tid=0x1da578 nid=0xc runnable [72201000..722019c0] at sun.awt.motif.MToolkit.run(Native Method) at java.lang.Thread.run(Thread.java:536) "Signal Dispatcher" daemon prio=10 tid=0x9e8e0 nid=0x9 runnable [0..0] "Finalizer" daemon prio=8 tid=0x99218 nid=0x6 waiting on monitor [7e781000..7e7819c0] at java.lang.Object.wait(Native Method) - waiting on <72a10138> (a java.lang.ref.ReferenceQueue$Lock) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:111) - locked <72a10138> (a java.lang.ref.ReferenceQueue$Lock) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:127) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159) "Reference Handler" daemon prio=10 tid=0x98820 nid=0x5 waiting on monitor [7ed81000..7ed819c0] at java.lang.Object.wait(Native Method) - waiting on <72a101a0> (a java.lang.ref.Reference$Lock) at java.lang.Object.wait(Object.java:426) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:113) - locked <72a101a0> (a java.lang.ref.Reference$Lock) "VM Thread" prio=5 tid=0x97a78 nid=0x4 runnable "VM Periodic Task Thread" prio=10 tid=0x9bec0 nid=0x7 waiting on monitor "Suspend Checker Thread" prio=10 tid=0x9c020 nid=0x8 runnable ###@###.### 2002-05-24 Commit to fix in mantis (hang). ###@###.### 2002-05-28 Name: osR10079 Date: 08/02/2002 The problem is the same as 4531693 ======================================================================
28-05-2002