JDK-5009724 : JInternalFrame not serializable in GTK L&F
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 5.0
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2004-03-08
  • Updated: 2004-04-24
  • Resolved: 2004-04-24
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
5.0 beta2Fixed
Related Reports
Relates :  
Description
4966168 reported that JInternalFrames are not serializable in Motif and GTK L&F. The fix to that bug did not resolve the issue with GTK L&F. An exception is still thrown.

Steps to reproduce:
1) Run the attached test TestSerializeInternalFrame
2) Change L&F to GTK using Menu "Look And Feel"
3) Click on button "Serialize InternalFrame"
4) It will throw Exception in console
5) Now try serializing in some other look and feel it will
   give message ""Successfully serialized JInternalFrame" on console

Tested on Tiger b39

Following is the exception message when serializing JInternalFrame under GTK
----------------------------------------------
java.io.NotSerializableException: javax.swing.plaf.basic.BasicInternalFrameUI$Handler
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1072)
	at java.io.ObjectOutputStream.access+100(ObjectOutputStream.java:135)
	at java.io.ObjectOutputStream$PutFieldImpl.writeFields(ObjectOutputStream.java:1509)
	at java.io.ObjectOutputStream.writeFields(ObjectOutputStream.java:418)
	at java.awt.Container.writeObject(Container.java:3452)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:494)
	at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:890)
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1330)
	at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1281)
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1070)
	at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:291)
	at TestSerializeInternalFrame$1.actionPerformed(TestSerializeInternalFrame.java:24)
	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1834)
	at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2152)
	at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
	at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:234)
	at java.awt.Component.processMouseEvent(Component.java:5465)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3078)
	at java.awt.Component.processEvent(Component.java:5230)
	at java.awt.Container.processEvent(Container.java:1961)
	at java.awt.Component.dispatchEventImpl(Component.java:3933)
	at java.awt.Container.dispatchEventImpl(Container.java:2019)
	at java.awt.Component.dispatchEvent(Component.java:3781)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4203)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3883)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3813)
	at java.awt.Container.dispatchEventImpl(Container.java:2005)
	at java.awt.Window.dispatchEventImpl(Window.java:1757)
	at java.awt.Component.dispatchEvent(Component.java:3781)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
	at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

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

EVALUATION Interesting. Why is this an issue with GTK L&F and not the other L&Fs? Incomplete fix to 4966168. Name: azR10139 Date: 03/26/2004 This happens because the Synth L&F does not clean all the links to its inner classes when L&F is being uninstalled. Because of this, classes, that not intended to be serialized (like UI installed Layout) is being serialized in the process of the component serialization. This is not an incomplete fix for 4966168 because bug 4966168 can be reproduced on the simple test case on any L&F. Idea of the fix is to clean all the references that leads to the UI class serialization attempt. ###@###.### 2004-03-26 ====================================================================== Name: sh120115 Date: 03/29/2004 I think the reason this was suggested as an "incomplete fix for 4966168" was that 4966168 mentioned the problem with GTK LAF and it wasn't resolved. ###@###.### 2004-03-29 ======================================================================
29-03-2004

SUGGESTED FIX Name: azR10139 Date: 03/26/2004 http://sa.sfbay.sun.com/projects/swing_data/tiger/5009724.0 ###@###.### 2004-03-26 ======================================================================
26-03-2004