From 11af1c9fa7fe66e10de0a92878311b4e22befb0f Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Tue, 3 Jun 2008 16:41:37 +0000 Subject: made future serialized class versions backwards compatible. --- sources/core/VSTask.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'sources/core/VSTask.java') diff --git a/sources/core/VSTask.java b/sources/core/VSTask.java index 1b8f744..c1323e8 100644 --- a/sources/core/VSTask.java +++ b/sources/core/VSTask.java @@ -362,6 +362,9 @@ public class VSTask implements Comparable, VSSerializable { public synchronized void serialize(VSSerialize serialize, ObjectOutputStream objectOutputStream) throws IOException { + /** For later backwards compatibility, to add more stuff */ + objectOutputStream.writeObject(new Boolean(false)); + objectOutputStream.writeObject(new Integer(process.getProcessNum())); objectOutputStream.writeObject(event.getClassname()); objectOutputStream.writeObject(new Integer(event.getID())); @@ -370,6 +373,9 @@ public class VSTask implements Comparable, VSSerializable { objectOutputStream.writeObject(new Long(taskTime)); objectOutputStream.writeObject(new Boolean(isGlobalTimed)); objectOutputStream.writeObject(new Boolean(isProgrammed)); + + /** For later backwards compatibility, to add more stuff */ + objectOutputStream.writeObject(new Boolean(false)); } /* (non-Javadoc) @@ -383,6 +389,9 @@ public class VSTask implements Comparable, VSSerializable { if (VSSerialize.DEBUG) System.out.println("Deserializing: VSTask"); + /** For later backwards compatibility, to add more stuff */ + objectInputStream.readObject(); + int processNum = ((Integer) objectInputStream.readObject()).intValue(); VSProcess process = (VSProcess) serialize.getObject(processNum, "process"); @@ -412,6 +421,9 @@ public class VSTask implements Comparable, VSSerializable { serialize.setObject(taskNum, "task", this); init(taskTime, process, event, !isGlobalTimed.booleanValue()); this.isProgrammed = isProgrammed.booleanValue(); + + /** For later backwards compatibility, to add more stuff */ + objectInputStream.readObject(); } } -- cgit v1.2.3