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/events/internal/VSProtocolEvent.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'sources/events/internal/VSProtocolEvent.java') diff --git a/sources/events/internal/VSProtocolEvent.java b/sources/events/internal/VSProtocolEvent.java index 5f5ceb4..8d6b2dd 100644 --- a/sources/events/internal/VSProtocolEvent.java +++ b/sources/events/internal/VSProtocolEvent.java @@ -27,7 +27,7 @@ import java.io.*; import events.*; import protocols.VSAbstractProtocol; -import serialize.*; +import serialize.VSSerialize; /** * The class VSProtocolEvent. This event is used if a protocol (server or @@ -144,9 +144,16 @@ public class VSProtocolEvent extends VSAbstractEvent { ObjectOutputStream objectOutputStream) throws IOException { super.serialize(serialize, objectOutputStream); + + /** For later backwards compatibility, to add more stuff */ + objectOutputStream.writeObject(new Boolean(false)); + objectOutputStream.writeObject(protocolClassname); objectOutputStream.writeObject(new Boolean(isClientProtocol)); objectOutputStream.writeObject(new Boolean(isProtocolActivation)); + + /** For later backwards compatibility, to add more stuff */ + objectOutputStream.writeObject(new Boolean(false)); } /* (non-Javadoc) @@ -162,10 +169,17 @@ public class VSProtocolEvent extends VSAbstractEvent { if (VSSerialize.DEBUG) System.out.println("Deserializing: VSProtocolEvent"); + /** For later backwards compatibility, to add more stuff */ + objectInputStream.readObject(); + protocolClassname = (String) objectInputStream.readObject(); isClientProtocol = ((Boolean) objectInputStream.readObject()).booleanValue();; isProtocolActivation = ((Boolean) objectInputStream.readObject()).booleanValue();; + + /** For later backwards compatibility, to add more stuff */ + objectInputStream.readObject(); + } } -- cgit v1.2.3