Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 241654

Summary: [Geometry] Precision* classes are not serializable
Product: [Tools] GEF Reporter: Martin Hoefer <thomas.m.hoefer>
Component: GEF-Legacy Draw2dAssignee: Alexander Nyßen <nyssen>
Status: RESOLVED FIXED QA Contact:
Severity: minor    
Priority: P3 CC: ahunter.eclipse, nyssen
Version: 3.4   
Target Milestone: 3.7.1 (Indigo) M5   
Hardware: All   
OS: All   
Whiteboard:

Description Martin Hoefer CLA 2008-07-22 08:55:05 EDT
Build ID: I20080617-2000

Steps To Reproduce:
No serialVersionUID in classes org.eclipse.draw2d.geometry.Precision*

More information:
The precision* classes in the package org.eclipse.draw2d.geometry are not serializable bacause they don't have a serialVersionUID. The problem is, that especially the class PrecisionPoint was changed since version 3.2. So the serialized objects cannot be deserialized with later versions.
Comment 1 Randy Hudson CLA 2008-07-28 15:33:26 EDT
Marking as minor since java serialization isn't really intended for long-term storage.

What kind of fix do you want to see?  Just hard code the UID to 1 like in Point?
Comment 2 Martin Hoefer CLA 2008-07-29 01:51:20 EDT
(In reply to comment #1)
> Marking as minor since java serialization isn't really intended for long-term
> storage.
> 
> What kind of fix do you want to see?  Just hard code the UID to 1 like in
> Point?
> 

I think that's the only solution. Of course, it has no effect on already serialized objects. I don't know, if the UID is used by the XML serialization.

We solved our problem with an overwritten method of the ObjectInputStream, where we ignore the UID, if it is different from the serilized UID.
Comment 3 Anthony Hunter CLA 2009-01-23 16:58:32 EST
There is a platform warning we can turn on for this, but I am wondering if this only applies to Draw2d or GEF also?

Did you still require this support?
Comment 4 Alexander Nyßen CLA 2011-02-02 17:18:06 EST
Added statement "private static final long serialVersionUID = 1L;" to PrecisionPoint, PrecisionDimension, and PrecisionRectangle. Made respective serialVersionUI fields within Dimension, Insets, Point, and Rectangle private (was package).

Committed changes to cvs HEAD (3.7M5). Resolving as fixed.