From 6091b415053e5bd8f50ea282e6dddc67ac3c2c12 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Thu, 12 Jun 2008 22:17:01 +0000 Subject: VSPrefs.restrictions gets now serialized. --- sources/prefs/VSPrefs.java | 4 +++- sources/prefs/VSPrefsRestriction.java | 16 ++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/sources/prefs/VSPrefs.java b/sources/prefs/VSPrefs.java index 15f8874..be50a76 100644 --- a/sources/prefs/VSPrefs.java +++ b/sources/prefs/VSPrefs.java @@ -959,6 +959,7 @@ public class VSPrefs implements VSSerializable { objectOutputStream.writeObject(stringPrefs); objectOutputStream.writeObject(units); objectOutputStream.writeObject(vectorPrefs); + objectOutputStream.writeObject(restrictions); /** For later backwards compatibility, to add more stuff */ objectOutputStream.writeObject(new Boolean(false)); @@ -989,13 +990,14 @@ public class VSPrefs implements VSSerializable { objectInputStream.readObject(); longPrefs = (HashMap) objectInputStream.readObject(); - restrictions = new HashMap(); stringPrefs = (HashMap) objectInputStream.readObject(); units = (HashMap) objectInputStream.readObject(); vectorPrefs = (HashMap>) objectInputStream.readObject(); + restrictions = (HashMap) + objectInputStream.readObject(); /** For later backwards compatibility, to add more stuff */ objectInputStream.readObject(); diff --git a/sources/prefs/VSPrefsRestriction.java b/sources/prefs/VSPrefsRestriction.java index 0709713..32ab213 100644 --- a/sources/prefs/VSPrefsRestriction.java +++ b/sources/prefs/VSPrefsRestriction.java @@ -77,8 +77,8 @@ abstract public class VSPrefsRestriction implements Serializable { */ public void writeObject(ObjectOutputStream out) throws IOException { - out.writeObject(new Integer(minValue)); - out.writeObject(new Integer(maxValue)); + out.writeObject(new Integer(minValue)); + out.writeObject(new Integer(maxValue)); } /* (non-Javadoc) @@ -86,8 +86,8 @@ abstract public class VSPrefsRestriction implements Serializable { */ public void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { - minValue = ((Integer) in.readObject()).intValue(); - maxValue = ((Integer) in.readObject()).intValue(); + minValue = ((Integer) in.readObject()).intValue(); + maxValue = ((Integer) in.readObject()).intValue(); } } @@ -126,17 +126,17 @@ abstract public class VSPrefsRestriction implements Serializable { */ public void writeObject(ObjectOutputStream out) throws IOException { - out.writeObject(possibleSelections); + out.writeObject(possibleSelections); } /* (non-Javadoc) * @see prefs.VSPrefsRestriction#readObject(java.io.ObjectInputStream) */ - @SuppressWarnings("unchecked") + @SuppressWarnings("unchecked") public void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { - possibleSelections = (Vector) in.readObject(); - } + possibleSelections = (Vector) in.readObject(); + } } /** -- cgit v1.2.3