Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4966173

JSeparator not serializable in GTK L&F

XMLWordPrintable

    • Fix Understood
    • generic
    • generic

      JSeparator is not serializable in GTK while it can be serialized in other L&F's
      Steps to reproduce:
      1) Run the attached test TestSerializeSeparator
      2) Change L&F to GTK using Menu "Look And Feel"
      3) Click on button "Serialize Separator"
      4) It will throw Exception in console
      5) Now try serializing in someother look and feel it will
         give message "Successfully serialized Separator" on console
      Tested on Tiger b30
      Following is the exception message when serializing JSeparator under GTK
      ----------------------------------------------

      Failed serializing javax.swing.JSeparator
      java.io.NotSerializableException: javax.swing.plaf.synth.SynthSeparatorUI
      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.JComponent.writeObject(JComponent.java:5191)
      at sun.reflect.GeneratedMethodAccessor40.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)

            peterz Peter Zhelezniakov
            hsinghsunw Hemant Singh (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: