summaryrefslogtreecommitdiff
path: root/sources/events/VSAbstractEvent.java
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2008-06-03 16:41:37 +0000
committerPaul Buetow <paul@buetow.org>2008-06-03 16:41:37 +0000
commit11af1c9fa7fe66e10de0a92878311b4e22befb0f (patch)
tree8dfc7af2ec18eb5889327426bc6fdb7379a3feba /sources/events/VSAbstractEvent.java
parentf7bdf8a7f6ebd43bfacc22eeeda3eb52bf50efd7 (diff)
made future serialized class versions backwards compatible.
Diffstat (limited to 'sources/events/VSAbstractEvent.java')
-rw-r--r--sources/events/VSAbstractEvent.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/sources/events/VSAbstractEvent.java b/sources/events/VSAbstractEvent.java
index 0dd814c..0bc5ec8 100644
--- a/sources/events/VSAbstractEvent.java
+++ b/sources/events/VSAbstractEvent.java
@@ -177,9 +177,15 @@ abstract public class VSAbstractEvent extends VSPrefs {
if (VSSerialize.DEBUG)
System.out.println("Serializing: VSAbstractEvent; id="+getID());
+ /** For later backwards compatibility, to add more stuff */
+ objectOutputStream.writeObject(new Boolean(false));
+
objectOutputStream.writeObject(new Integer(super.getID()));
objectOutputStream.writeObject(eventShortname);
objectOutputStream.writeObject(eventClassname);
+
+ /** For later backwards compatibility, to add more stuff */
+ objectOutputStream.writeObject(new Boolean(false));
}
/* (non-Javadoc)
@@ -195,6 +201,9 @@ abstract public class VSAbstractEvent extends VSPrefs {
if (VSSerialize.DEBUG)
System.out.print("Deserializing: VSAbstractEvent ");
+ /** For later backwards compatibility, to add more stuff */
+ objectInputStream.readObject();
+
int id = ((Integer) objectInputStream.readObject()).intValue();
this.eventShortname = (String) objectInputStream.readObject();
this.eventClassname = (String) objectInputStream.readObject();
@@ -203,5 +212,8 @@ abstract public class VSAbstractEvent extends VSPrefs {
System.out.println(eventClassname);
serialize.setObject(id, "event", this);
+
+ /** For later backwards compatibility, to add more stuff */
+ objectInputStream.readObject();
}
}