GoogleCodeArchive / piccolo2d

Automatically exported from code.google.com/p/piccolo2d
0 stars 0 forks source link

PSwing is not serializeable #214

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Trying to serialize a PSwing, I get the following stacktrace:

Exception in thread "main" java.io.NotSerializableException: 
java.awt.BasicStroke
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1164)
    at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
    at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
    at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)
    at edu.umd.cs.piccolo.util.PObjectOutputStream.recordUnconditionallyWritten(PObjectOutputStream.java:168)
    at edu.umd.cs.piccolo.util.PObjectOutputStream.writeObjectTree(PObjectOutputStream.java:110)

Note that it's b/c the BasicStroke instance on PSwing is not serializeable. 
This field was once marked transient but in Revision 863 the transient keyword 
was dropped. It's not obvious why. It may have been to guarantee that it's 
non-null but perhaps we missed that we were breaking serialization.

We should clarify our serialization requirements and ensure that PSwing and 
other PNodes are in compliance.

Original issue reported on code.google.com by atdi...@gmail.com on 30 Mar 2011 at 12:20

GoogleCodeExporter commented 9 years ago
I agree.  Does this happen with the workarounds for Stroke and Path as 
implemented in PUtil?  I don't remember how those are used.

Original comment by heue...@gmail.com on 26 Oct 2011 at 3:06

GoogleCodeExporter commented 9 years ago

Original comment by heue...@gmail.com on 1 Nov 2011 at 7:40

GoogleCodeExporter commented 9 years ago

Original comment by heue...@gmail.com on 26 Nov 2013 at 5:41