-
Bug
-
Resolution: Fixed
-
P4
-
1.4.0
-
tiger
-
generic
-
generic
Name: bsC130419 Date: 06/14/2001
java version "1.4.0-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta-b65)
Java HotSpot(TM) Client VM (build 1.4.0-beta-b65, mixed mode)
java.awt.Window.dispose() has changed. It used to call java.awt.Window.hide() but now it calls java.awt.Component.setVisible(false) which then calls java.awt.Window.hide(). Unfortunately if a subclass of Window overrides java.awt.Component.setVisible(boolean) the behaviour of the subclass will be
different when dispose() gets called.
In my application I have a subclass of Dialog which overrides setVisible
(boolean) to call dispose() because the dialog was not being disposed of when
the application was minimised. Under jdk1.3 this was fine but under jdk1.4 I
get a stack overflow when the dialog is dismissed because dispose() gets into
an infinite loop. The top part of a stack dump is given below:
java.lang.StackOverflowError
at java.awt.Toolkit.getEventQueue(Toolkit.java:1481)
at java.awt.EventQueue.isDispatchThread(EventQueue.java:564)
at java.awt.Window.dispose(Window.java:518)
at java.awt.Dialog.disposeImpl(Dialog.java:560)
at java.awt.Dialog.dispose(Dialog.java:556)
at com.aspentech.janet.janetscreen.JanetOOBStatus.closedDialog
(JanetOOBStatus.java:156)
at com.aspentech.janet.janetscreen.JanetDialog.setVisible
(JanetDialog.java:93)
at java.awt.Window$1$DisposeAction.run(Window.java:506)
at java.awt.Window.dispose(Window.java:519)
at java.awt.Dialog.disposeImpl(Dialog.java:560)
at java.awt.Dialog.dispose(Dialog.java:556)
at com.aspentech.janet.janetscreen.JanetOOBStatus.closedDialog
(JanetOOBStatus.java:156)
at com.aspentech.janet.janetscreen.JanetDialog.setVisible
(JanetDialog.java:93)
at java.awt.Window$1$DisposeAction.run(Window.java:506)
at java.awt.Window.dispose(Window.java:519)
at java.awt.Dialog.disposeImpl(Dialog.java:560)
at java.awt.Dialog.dispose(Dialog.java:556)
at com.aspentech.janet.janetscreen.JanetOOBStatus.closedDialog
(JanetOOBStatus.java:156)
at com.aspentech.janet.janetscreen.JanetDialog.setVisible
(JanetDialog.java:93)
at java.awt.Window$1$DisposeAction.run(Window.java:506)
at java.awt.Window.dispose(Window.java:519)
..................etc
I don't see any reason for this change; java.awt.Window.hide() has not been deprecated and in
fact the intention is still to call the java.awt.Window.hide() method.
(Review ID: 126600)
======================================================================
- relates to
-
JDK-4828041 java.awt.Component.setVisible() calls deprecated java.awt.Component.show()
-
- Closed
-
-
JDK-6784193 Regression: Window dispose() calls hide() instead of setVisible(false)
-
- Closed
-
-
JDK-4328086 Window dispose() calls hide() instead of setVisible( false )
-
- Closed
-