This is the mail archive of the java-patches@sources.redhat.com mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Patch: Another trivial serialization fix


This is a pretty easy one.  The Mauve serialization tests run much better
with it and it matches the JDK spec & behavior (NotSerializableException
is supposed to only be called with the class name).
--warrenl

2000-07-28  Warren Levy  <warrenl@cygnus.com>

	* java/io/ObjectOutputStream.java (writeObject): Per spec, call
	NotSerializableException with just the class name.


Index: java/io/ObjectOutputStream.java
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/io/ObjectOutputStream.java,v
retrieving revision 1.3
diff -u -p -r1.3 ObjectOutputStream.java
--- ObjectOutputStream.java	2000/07/27 23:57:06	1.3
+++ ObjectOutputStream.java	2000/07/28 23:42:53
@@ -267,9 +267,7 @@ public class ObjectOutputStream extends 
 	Class clazz = obj.getClass ();
 	ObjectStreamClass osc = ObjectStreamClass.lookup (clazz);
 	if (osc == null)
-	  throw new NotSerializableException ("The class "
-					      + clazz.getName ()
-					      + " is not Serializable");
+	  throw new NotSerializableException (clazz.getName ());
 
 	if (clazz.isArray ())
 	{
@@ -334,9 +332,7 @@ public class ObjectOutputStream extends 
 	  break;
 	}
 
-	throw new NotSerializableException ("Instances of the class "
-					    + clazz.getName ()
-					    + " are not Serializable");
+	throw new NotSerializableException (clazz.getName ());
       } // end pseudo-loop
     }
     catch (IOException e)




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]