-
Bug
-
Resolution: Fixed
-
P4
-
5.0
-
b07
-
generic
-
generic
-
Verified
JFileChooser is not serializable in Motif while it can be serialized in other L&F's
Steps to reproduce:
1) Run the attached test TestSerializeFileChooser
2) Change L&F to Motif using Menu "Look And Feel"
3) Click on button "Serialize FileChooser"
4) It will throw Exception in console
5) Now try serializing in someother look and feel it will
give message ""Successfully serialized FileChooser" on console
Tested on Tiger b30
Following is the exception message when serializing JFileChooser under Motif
----------------------------------------------
Failed serializing javax.swing.JFileChooser
java.io.NotSerializableException: com.sun.java.swing.plaf.motif.MotifFileChooserUI
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1072)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1366)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1338)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1281)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1070)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1366)
at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:380)
at javax.swing.JComboBox.writeObject(JComboBox.java:1484)
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:489)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:902)
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 javax.swing.event.EventListenerList.writeObject(EventListenerList.java:240)
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:489)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:902)
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.defaultWriteFields(ObjectOutputStream.java:1366)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1338)
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 java.beans.PropertyChangeSupport.writeObject(PropertyChangeSupport.java:427)
at sun.reflect.GeneratedMethodAccessor14.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:489)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:902)
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.defaultWriteFields(ObjectOutputStream.java:1366)
at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:380)
at java.awt.Component.writeObject(Component.java:7363)
at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:489)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:902)
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 SerializeTest.serializeObject(SerializeTest.java:152)
at SerializeTest.main(SerializeTest.java:140)
Steps to reproduce:
1) Run the attached test TestSerializeFileChooser
2) Change L&F to Motif using Menu "Look And Feel"
3) Click on button "Serialize FileChooser"
4) It will throw Exception in console
5) Now try serializing in someother look and feel it will
give message ""Successfully serialized FileChooser" on console
Tested on Tiger b30
Following is the exception message when serializing JFileChooser under Motif
----------------------------------------------
Failed serializing javax.swing.JFileChooser
java.io.NotSerializableException: com.sun.java.swing.plaf.motif.MotifFileChooserUI
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1072)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1366)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1338)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1281)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1070)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1366)
at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:380)
at javax.swing.JComboBox.writeObject(JComboBox.java:1484)
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:489)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:902)
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 javax.swing.event.EventListenerList.writeObject(EventListenerList.java:240)
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:489)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:902)
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.defaultWriteFields(ObjectOutputStream.java:1366)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1338)
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 java.beans.PropertyChangeSupport.writeObject(PropertyChangeSupport.java:427)
at sun.reflect.GeneratedMethodAccessor14.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:489)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:902)
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.defaultWriteFields(ObjectOutputStream.java:1366)
at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:380)
at java.awt.Component.writeObject(Component.java:7363)
at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:489)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:902)
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 SerializeTest.serializeObject(SerializeTest.java:152)
at SerializeTest.main(SerializeTest.java:140)