* java/beans/PropertyChangeEvent.java (serialVersionUID): Added.
* java/beans/PropertyVetoException.java (serialVersionUID): Added.
* java/io/File.java (writeObject): Added.
(readObject): Added.
(serialVersionUID): Added.
* java/io/ObjectOutputStream.java (writeObject): Initialized
fieldsAlreadyWritten before recursion rather than after.
* java/io/ObjectStreamClass.java (serialVersionUID): Added.
* java/io/OptionalDataException.java (serialVersionUID): Added.
(OptionalDataException): Made package private.
* java/io/SyncFailedException.java (SyncFailedException): Removed
default constructor to match spec.
* java/lang/Boolean.java (serialVersionUID): Added.
* java/lang/Byte.java (serialVersionUID): Added.
* java/lang/Character.java (serialVersionUID): Added.
* java/lang/Double.java (serialVersionUID): Added.
* java/lang/Float.java (serialVersionUID): Added.
* java/lang/Integer.java (serialVersionUID): Added.
* java/lang/Long.java (serialVersionUID): Added.
* java/lang/Number.java (serialVersionUID): Added.
* java/lang/Short.java (serialVersionUID): Added.
* java/lang/String.java (serialVersionUID): Added.
* java/lang/ThreadDeath.java (ThreadDeath): Removed constructor
to match spec.
* java/lang/reflect/InvocationTargetException.java
(serialVersionUID): Added.
* java/net/URL.java (handler): Made transient.
(hashCode): Added field for serialization, per spec. and use
cached value if available.
(serialVersionUID): Added.
(URL): Initialize hashCode.
(set): Adjust hashCode.
(readObject): New Method to initialize the protocol handler when
deserializing.
(writeObject): New method.
* java/text/BreakIterator.java: Removed 'implements Serializable'.
* java/text/Collator.java: Removed 'implements Serializable'.
* java/util/GregorianCalendar.java (serialVersionUID): Added.
* java/util/Properties.java (serialVersionUID): Added.
* java/util/Random.java (serialVersionUID): Added.
(seed): Made private.
(nextNextGaussian): Made private.
(haveNextNextGaussian): Made private.
* java/util/Stack.java (serialVersionUID): Added.
* java/util/TimeZone.java (serialVersionUID): Added.
* java/util/Vector.java (serialVersionUID): Added.
Serialization mods.
From-SVN: r36272
+2000-09-08 Warren Levy <warrenl@cygnus.com>
+
+ * java/beans/PropertyChangeEvent.java (serialVersionUID): Added.
+ * java/beans/PropertyVetoException.java (serialVersionUID): Added.
+ * java/io/File.java (writeObject): Added.
+ (readObject): Added.
+ (serialVersionUID): Added.
+ * java/io/ObjectOutputStream.java (writeObject): Initialized
+ fieldsAlreadyWritten before recursion rather than after.
+ * java/io/ObjectStreamClass.java (serialVersionUID): Added.
+ * java/io/OptionalDataException.java (serialVersionUID): Added.
+ (OptionalDataException): Made package private.
+ * java/io/SyncFailedException.java (SyncFailedException): Removed
+ default constructor to match spec.
+ * java/lang/Boolean.java (serialVersionUID): Added.
+ * java/lang/Byte.java (serialVersionUID): Added.
+ * java/lang/Character.java (serialVersionUID): Added.
+ * java/lang/Double.java (serialVersionUID): Added.
+ * java/lang/Float.java (serialVersionUID): Added.
+ * java/lang/Integer.java (serialVersionUID): Added.
+ * java/lang/Long.java (serialVersionUID): Added.
+ * java/lang/Number.java (serialVersionUID): Added.
+ * java/lang/Short.java (serialVersionUID): Added.
+ * java/lang/String.java (serialVersionUID): Added.
+ * java/lang/ThreadDeath.java (ThreadDeath): Removed constructor
+ to match spec.
+ * java/lang/reflect/InvocationTargetException.java
+ (serialVersionUID): Added.
+ * java/net/URL.java (handler): Made transient.
+ (hashCode): Added field for serialization, per spec. and use
+ cached value if available.
+ (serialVersionUID): Added.
+ (URL): Initialize hashCode.
+ (set): Adjust hashCode.
+ (readObject): New Method to initialize the protocol handler when
+ deserializing.
+ (writeObject): New method.
+ * java/text/BreakIterator.java: Removed 'implements Serializable'.
+ * java/text/Collator.java: Removed 'implements Serializable'.
+ * java/util/GregorianCalendar.java (serialVersionUID): Added.
+ * java/util/Properties.java (serialVersionUID): Added.
+ * java/util/Random.java (serialVersionUID): Added.
+ (seed): Made private.
+ (nextNextGaussian): Made private.
+ (haveNextNextGaussian): Made private.
+ * java/util/Stack.java (serialVersionUID): Added.
+ * java/util/TimeZone.java (serialVersionUID): Added.
+ * java/util/Vector.java (serialVersionUID): Added.
+
2000-09-07 Bryce McKinlay <bryce@albatross.co.nz>
* Makefile.am (Thread.h): Don't be friends with native threads
Object newValue;
Object propagationId;
+ private static final long serialVersionUID = 7042693688939648123L;
+
/** Create a new PropertyChangeEvent. Remember that if
** you received a PropertyChangeEvent and are sending
** a new one, you should also set the propagation ID
public class PropertyVetoException extends Exception {
PropertyChangeEvent evt;
+ private static final long serialVersionUID = 129596057694162164L;
+
/** Instantiate this exception with the given message and property change.
** @param msg the reason for the veto.
** @param changeEvent the PropertyChangeEvent that was thrown.
FileDeleter.add (this);
}
+ private void writeObject (ObjectOutputStream oos) throws IOException
+ {
+ oos.defaultWriteObject ();
+ oos.writeChar (separatorChar);
+ }
+
+ private void readObject (ObjectInputStream ois)
+ throws ClassNotFoundException, IOException
+ {
+ ois.defaultReadObject ();
+
+ // If the file was from an OS with a different dir separator,
+ // fixup the path to use the separator on this OS.
+ char oldSeparatorChar = ois.readChar ();
+ if (oldSeparatorChar != separatorChar)
+ path = path.replace (oldSeparatorChar, separatorChar);
+ }
+
// QUERY arguments to access function.
private final static int READ = 0;
private final static int WRITE = 1;
private final native long attr (String p, int query);
private final native boolean access (String p, int query);
private final native boolean stat (String p, int query);
+
+ private static final long serialVersionUID = 301077366599181567L;
}
{
currentObjectStreamClass = hierarchy[i];
+ fieldsAlreadyWritten = false;
has_write = currentObjectStreamClass.hasWriteMethod ();
+
writeFields (obj, currentObjectStreamClass.fields,
has_write);
- fieldsAlreadyWritten = false;
-
if (has_write)
{
drain ();
// these are accessed by ObjectIn/OutputStream
int primFieldSize = -1; // -1 if not yet calculated
int objectFieldCount;
+
+ // This is probably not necessary because this class is special cased already
+ // but it will avoid showing up as a discrepancy when comparing SUIDs.
+ private static final long serialVersionUID = -6120832682080437368L;
}
public boolean eof;
public int length;
- public OptionalDataException()
+ // FIXME: This can probably go away once the right signatures of
+ // these package private constructors is determined.
+ private static final long serialVersionUID = -8011121865681257820L;
+
+ OptionalDataException()
{
super();
}
- public OptionalDataException(String msg)
+ OptionalDataException(String msg)
{
super(msg);
}
public class SyncFailedException extends IOException
{
- public SyncFailedException ()
- {
- super ();
- }
-
public SyncFailedException (String s)
{
super (s);
-/* Copyright (C) 1998, 1999 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000 Free Software Foundation
This file is part of libgcj.
/* The boolean value of the instance. */
private boolean value;
+ private static final long serialVersionUID = -3665804199014368530L;
+
public Boolean(boolean boolVal)
{
value = boolVal;
-/* Copyright (C) 1998, 1999 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000 Free Software Foundation
This file is part of libgcj.
// by javac, and is handled specially by gcc.
public static final Class TYPE = byte.class;
+ private static final long serialVersionUID = -7183698231559129828L;
+
public Byte(byte value)
{
this.value = value;
// Character.java - Character class.
-/* Copyright (C) 1998, 1999 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000 Free Software Foundation
This file is part of libgcj.
public static final byte PRIVATE_USE = 18;
public static final byte SURROGATE = 19;
+ private static final long serialVersionUID = 3786198910865385080L;
public Character (char ch)
{
private double value;
+ private static final long serialVersionUID = -9172774392245257468L;
+
public native static double parseDouble (String s)
throws NumberFormatException;
-/* Copyright (C) 1998, 1999 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000 Free Software Foundation
This file is part of libgcj.
private float value;
+ private static final long serialVersionUID = -2671257302660747028L;
+
public Float (float value)
{
this.value = value;
-/* Copyright (C) 1998, 1999 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000 Free Software Foundation
This file is part of libgcj.
/* The int value of the instance. */
private int value;
+ private static final long serialVersionUID = 1360826667806852920L;
+
public Integer(int val)
{
value = val;
-/* Copyright (C) 1998, 1999 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000 Free Software Foundation
This file is part of libgcj.
/* The long value of the instance. */
private long value;
+ private static final long serialVersionUID = 4290774380558885855L;
+
public Long(long val)
{
value = val;
-/* Copyright (C) 1998, 1999 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000 Free Software Foundation
This file is part of libgcj.
{
return (short) intValue();
}
+
+ private static final long serialVersionUID = -8742448824652078965L;
}
-/* Copyright (C) 1998, 1999 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000 Free Software Foundation
This file is part of libgcj.
// by javac, and is handled specially by gcc.
public static final Class TYPE = short.class;
+ private static final long serialVersionUID = 7515723908773894738L;
+
public Short(short value)
{
this.value = value;
private int boffset; // Note this is a byte offset - don't use in Java code!
private int count;
+ // This is probably not necessary because this class is special cased already
+ // but it will avoid showing up as a discrepancy when comparing SUIDs.
+ private static final long serialVersionUID = -6849794470754667710L;
+
public String ()
{
init();
// ThreadDeath.java - Special exception registering Thread death.
-/* Copyright (C) 1998, 1999 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000 Free Software Foundation
This file is part of libgcj.
{
super ();
}
-
- public ThreadDeath (String message)
- {
- super (message);
- }
}
// InvocationTargetException.java - Wrapper exception for reflection.
-/* Copyright (C) 1998, 1999 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000 Free Software Foundation
This file is part of libgcj.
// The wrapped exception. The name is specified by the
// serialization spec.
private Throwable target;
+
+ private static final long serialVersionUID = 4085088731926701167L;
}
// URL.java - A Uniform Resource Locator.
-/* Copyright (C) 1999 Free Software Foundation
+/* Copyright (C) 1999, 2000 Free Software Foundation
This file is part of libgcj.
private int port = -1; // Initialize for constructor using context.
private String file;
private String ref;
- private URLStreamHandler handler;
+ private int hashCode = 0;
+ transient private URLStreamHandler handler;
private static Hashtable handlers = new Hashtable();
private static URLStreamHandlerFactory factory;
+ private static final long serialVersionUID = -7627629688361524110L;
+
public URL(String protocol, String host, int port, String file)
throws MalformedURLException
{
this.file = file.substring(0, hashAt);
this.ref = file.substring(hashAt + 1);
}
+ hashCode = hashCode(); // Used for serialization.
}
public URL(String spec) throws MalformedURLException
hashAt < 0 ? spec.length() : hashAt);
if (hashAt >= 0)
ref = spec.substring(hashAt + 1);
+
+ hashCode = hashCode(); // Used for serialization.
}
public boolean equals(Object obj)
// (which was reduced to "" with a hashcode of zero). A "" host also
// causes the port number and the two hashcodes to be summed.
- return (protocol.hashCode() + ((host == null) ? 0 : host.hashCode()) +
+ if (hashCode != 0)
+ return hashCode; // Use cached value if available.
+ else
+ return (protocol.hashCode() + ((host == null) ? 0 : host.hashCode()) +
port + file.hashCode());
}
this.host = host;
this.file = file;
this.ref = ref;
+ hashCode = hashCode(); // Used for serialization.
}
public static synchronized void
return handler;
}
+
+ private void readObject(ObjectInputStream ois)
+ throws IOException, ClassNotFoundException
+ {
+ ois.defaultReadObject();
+ this.handler = setURLStreamHandler(protocol);
+ if (this.handler == null)
+ throw new IOException("Handler for protocol " + protocol + " not found");
+ }
+
+ private void writeObject(ObjectOutputStream oos) throws IOException
+ {
+ oos.defaultWriteObject();
+ }
}
package java.text;
-import java.io.Serializable;
import java.util.Locale;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
* Status: Believed complete and correct to 1.1.
*/
-public abstract class BreakIterator implements Cloneable, Serializable
+public abstract class BreakIterator implements Cloneable
{
// The value was discovered by writing a test program.
public static final int DONE = -1;
package java.text;
-import java.io.Serializable;
import java.util.Locale;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
* Status: Mostly complete, but parts stubbed out. Look for FIXME.
*/
-public abstract class Collator implements Cloneable, Serializable
+public abstract class Collator implements Cloneable
{
public static final int NO_DECOMPOSITION = 0;
public static final int CANONICAL_DECOMPOSITION = 1;
3600000 /* DST_OFFSET */
};
+ private static final long serialVersionUID = -8125100834729963327L;
+
public GregorianCalendar ()
{
this(null, null);
{
protected Properties defaults;
+ private static final long serialVersionUID = 4112578634029874840L;
+
public String getProperty (String propName)
{
return getProperty (propName, null);
public class Random implements Serializable
{
/* Used by next() to hold the state of the pseudorandom number generator */
- protected long seed;
+ private long seed;
/* Used by nextGaussian() to hold a precomputed value */
/* to be delivered by that method the next time it is called */
- protected double nextNextGaussian;
+ private double nextNextGaussian;
/* Used by nextGaussian() to keep track of whether it is has precomputed */
/* and stashed away the next value to be delivered by that method */
- protected boolean haveNextNextGaussian = false;
+ private boolean haveNextNextGaussian = false;
+
+ private static final long serialVersionUID = 3905348978240129619L;
public Random()
{
return -1;
}
+
+ private static final long serialVersionUID = 1224463164541339165L;
}
private static TimeZone zoneDefault;
+ private static final long serialVersionUID = 3581463369166924961L;
+
public TimeZone ()
{
}
/* The buffer in which elements of this vector are stored */
protected Object[] elementData;
+ private static final long serialVersionUID = -2767605614048989439L;
+
public Vector()
{
this(10, 0);