harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r478817 - /harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/ObjectInputStream.java
Date Fri, 24 Nov 2006 09:44:04 GMT
Author: tellison
Date: Fri Nov 24 01:44:03 2006
New Revision: 478817

URL: http://svn.apache.org/viewvc?view=rev&rev=478817
Log:
Fix logic mistake reported by findbugs.

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/ObjectInputStream.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=478817&r1=478816&r2=478817
==============================================================================
--- 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
Fri Nov 24 01:44:03 2006
@@ -1849,18 +1849,20 @@
                 // one that implements Serializable so that slots that were not
                 // dumped can be initialized properly
                 while (constructorClass != null
-                        & ObjectStreamClass.isSerializable(constructorClass)) {
+                        && ObjectStreamClass.isSerializable(constructorClass)) {
                     constructorClass = constructorClass.getSuperclass();
                 }
             }
 
-            // Fetch the empty constructor
-            Constructor<?> constructor;
-            try {
-                constructor = constructorClass
-                        .getDeclaredConstructor(ObjectStreamClass.EMPTY_CONSTRUCTOR_PARAM_TYPES);
-            } catch (NoSuchMethodException nsmEx) {
-                constructor = null;
+            // Fetch the empty constructor, or null if none.
+            Constructor<?> constructor = null;
+            if (constructorClass != null) {
+                try {
+                    constructor = constructorClass
+                            .getDeclaredConstructor(ObjectStreamClass.EMPTY_CONSTRUCTOR_PARAM_TYPES);
+                } catch (NoSuchMethodException nsmEx) {
+                    // Ignored
+                }
             }
 
             // Has to have an empty constructor



Mime
View raw message