harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r528364 - in /harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io: ObjectInputStream.java ObjectOutputStream.java
Date Fri, 13 Apr 2007 05:49:25 GMT
Author: ndbeyer
Date: Thu Apr 12 22:49:24 2007
New Revision: 528364

URL: http://svn.apache.org/viewvc?view=rev&rev=528364
Log:
Change empty string literal to length check; replace redundant null assignments with assertions

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/ObjectInputStream.java
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/ObjectOutputStream.java

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/ObjectInputStream.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/ObjectInputStream.java?view=diff&rev=528364&r1=528363&r2=528364
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/ObjectInputStream.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/ObjectInputStream.java
Thu Apr 12 22:49:24 2007
@@ -1758,16 +1758,18 @@
 
         ObjectStreamClass newClassDesc = new ObjectStreamClass();
         String name = input.readUTF();
-        if ("".equals(name)) {
+        if (name.length() == 0) {
             throw new IOException("The stream is corrupted.");
         }
         newClassDesc.setName(name);
         newClassDesc.setSerialVersionUID(input.readLong());
         newClassDesc.setFlags(input.readByte());
 
-        // We must register the class descriptor before reading field
-        // descriptors.
-        // if called outside of readObject, the descriptorHandle might be null
+        /*
+         * We must register the class descriptor before reading field
+         * descriptors. If called outside of readObject, the descriptorHandle
+         * might be null.
+         */
         descriptorHandle = (null == descriptorHandle ? Integer
                 .valueOf(nextHandle()) : descriptorHandle);
         registerObjectRead(newClassDesc, descriptorHandle, false);
@@ -1974,7 +1976,8 @@
                             .methodReadResolve(objectClass);
                     if (readResolve == null) {
                         readResolveCache.put(objectClass, this);
-                        readResolveMethod = null;
+                        // readResolveMethod must be null here
+                        assert readResolveMethod == null;
                     } else {
                         // Has replacement method
                         AccessController.doPrivileged(new PriviAction<Object>(

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/ObjectOutputStream.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/ObjectOutputStream.java?view=diff&rev=528364&r1=528363&r2=528364
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/ObjectOutputStream.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/ObjectOutputStream.java
Thu Apr 12 22:49:24 2007
@@ -1860,7 +1860,8 @@
                                 .methodWriteReplace(objClass);
                         if (writeReplace == null) {
                             writeReplaceCache.put(objClass, this);
-                            writeReplaceMethod = null;
+                            // writeReplaceMethod must be null here
+                            assert writeReplaceMethod == null;
                         } else {
                             // Has replacement method
                             AccessController



Mime
View raw message