--- /home/cpdev/src/classpath/java/io/ObjectOutputStream.java	2005-07-11 05:32:32.000000000 +0000
+++ java/io/ObjectOutputStream.java	2005-06-30 05:34:35.000000000 +0000
@@ -1,5 +1,5 @@
 /* ObjectOutputStream.java -- Class used to write serialized objects
-   Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+   Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004
    Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
@@ -146,7 +146,7 @@
     useSubclassMethod = false;
     writeStreamHeader();
 
-    if (DEBUG)
+    if (Configuration.DEBUG)
       {
 	String val = System.getProperty("gcj.dumpobjects");
 	if (val != null && !val.equals(""))
@@ -378,7 +378,7 @@
 	setBlockDataMode(false);
 	try
 	  {
-	    if (DEBUG)
+	    if (Configuration.DEBUG)
 	      {
 		e.printStackTrace(System.out);
 	      }
@@ -389,7 +389,7 @@
 	    StreamCorruptedException ex = 
 	      new StreamCorruptedException
 	      (ioe + " thrown while exception was being written to stream.");
-	    if (DEBUG)
+	    if (Configuration.DEBUG)
 	      {
 		ex.printStackTrace(System.out);
 	      }
@@ -1486,16 +1486,10 @@
 	Field f = getField (klass, field_name);
 	ObjectStreamField of = new ObjectStreamField(f.getName(), f.getType());
 
-	/* if of is primitive something went wrong
-	 * in the check for primitive classes in writeFields.
-	 */
-	if (of.isPrimitive())
+	if (of.getTypeString() == null ||
+	    !of.getTypeString().equals(type_code))
 	  throw new InvalidClassException
-	    ("invalid type code for " + field_name + " in class " + klass.getName() + " : object stream field is primitive");
-
-	if (!of.getTypeString().equals(type_code))
-	    throw new InvalidClassException
-		("invalid type code for " + field_name + " in class " + klass.getName() + " : object stream field " + of + " has type string " + of.getTypeString() + " instead of " + type_code);
+	    ("invalid type code for " + field_name + " in class " + klass.getName());
 
 	Object o = f.get (obj);
 	// FIXME: We should check the type_code here
@@ -1566,8 +1560,6 @@
   // Set if we're generating debugging dumps
   private boolean dump = false;
 
-  private static final boolean DEBUG = false;
-
   static
   {
     if (Configuration.INIT_LOAD_LIBRARY)
