According to JDK1.2RC1 java.io.ObjectOutputStream/ObjectInputStream...
"The method does not need to concern itself with the state belonging
to the object's superclasses or subclasses."
Method here refers to readObject and writeObject. Hence I've written
ExceptionInInitializerError like this (tell me if this is right):
package java.lang;
import java.io.ObjectOutputStream;
import java.io.ObjectInputStream;
import java.io.IOException;
/**
* A <code>ExceptionInInitializerError</code> is thrown when an
* unexpected exception has occurred in a static initializer or the
* initializer for a static variable.
*
* @since JDK 1.1
*
* @author Brian Jones
*/
public class ExceptionInInitializerError extends LinkageError
{
static final long serialVersionUID = 1521711792217232256L;
private Throwable t = null;
/**
* Create an error without a message.
*/
public ExceptionInInitializerError()
{
super();
}
/**
* Create an error with a message.
*/
public ExceptionInInitializerError(String s)
{
super(s);
}
/**
* Creates an error an saves a reference to the <code>Throwable</code>
* object.
*
* @param t the exception thrown
*/
public ExceptionInInitializerError(Throwable t)
{
super();
this.t = t;
}
/**
* Serialize the object in a manner binary compatible with the JDK 1.2
*/
private void writeObject(java.io.ObjectOutputStream s)
throws IOException
{
ObjectOutputStream.PutField oFields;
oFields = s.putFields();
oFields.put("exception", this.t);
s.writeFields();
}
/**
* Deserialize the object in a manner binary compatible with the JDK 1.2
*/
private void readObject(java.io.ObjectInputStream s)
throws IOException, ClassNotFoundException
{
ObjectInputStream.GetField oFields;
oFields = s.readFields();
this.t = oFields.get("exception", (Throwable)null);
}
}
--
|-------------------------------|Software Engineer
|Brian Jones |[EMAIL PROTECTED]
|[EMAIL PROTECTED] |http://www.nortel.net
|http://www.classpath.org/ |------------------------------