commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1468926 - in /commons/proper/io/trunk/src: changes/changes.xml main/java/org/apache/commons/io/input/ClassLoaderObjectInputStream.java
Date Wed, 17 Apr 2013 14:16:15 GMT
Author: sebb
Date: Wed Apr 17 14:16:14 2013
New Revision: 1468926

URL: http://svn.apache.org/r1468926
Log:
IO-368 ClassLoaderObjectInputStream does not handle primitive typed members

Modified:
    commons/proper/io/trunk/src/changes/changes.xml
    commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/ClassLoaderObjectInputStream.java

Modified: commons/proper/io/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/changes/changes.xml?rev=1468926&r1=1468925&r2=1468926&view=diff
==============================================================================
--- commons/proper/io/trunk/src/changes/changes.xml (original)
+++ commons/proper/io/trunk/src/changes/changes.xml Wed Apr 17 14:16:14 2013
@@ -47,6 +47,9 @@ The <action> type attribute can be add,u
   <body>
     <!-- The release date is the date RC is cut -->
     <release version="2.5" date="2013-??-??" description="New features and bug fixes.">
   
+      <action issue="IO-368" dev="sebb" type="fix">
+        ClassLoaderObjectInputStream does not handle primitive typed members
+      </action>            
       <action issue="IO-341" dev="sebb" type="add">
          A constant for holding the BOM character (U+FEFF)
       </action>            

Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/ClassLoaderObjectInputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/ClassLoaderObjectInputStream.java?rev=1468926&r1=1468925&r2=1468926&view=diff
==============================================================================
--- commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/ClassLoaderObjectInputStream.java
(original)
+++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/ClassLoaderObjectInputStream.java
Wed Apr 17 14:16:14 2013
@@ -65,14 +65,11 @@ public class ClassLoaderObjectInputStrea
     protected Class<?> resolveClass(final ObjectStreamClass objectStreamClass)
             throws IOException, ClassNotFoundException {
         
-        final Class<?> clazz = Class.forName(objectStreamClass.getName(), false, classLoader);
-
-        if (clazz != null) {
-            // the classloader knows of the class
-            return clazz;
-        } else {
-            // classloader knows not of class, let the super classloader do it
-            return super.resolveClass(objectStreamClass);
+        try {
+            return Class.forName(objectStreamClass.getName(), false, classLoader);
+        } catch (ClassNotFoundException cnfe) {
+            // delegate to super class loader which can resolve primitives
+            return super.resolveClass(objectStreamClass);            
         }
     }
 



Mime
View raw message