commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scolebou...@apache.org
Subject svn commit: r219117 - in /jakarta/commons/proper/lang/trunk: project.xml src/java/org/apache/commons/lang/ClassUtils.java src/test/org/apache/commons/lang/ClassUtilsTest.java
Date Thu, 14 Jul 2005 22:08:10 GMT
Author: scolebourne
Date: Thu Jul 14 15:08:08 2005
New Revision: 219117

URL: http://svn.apache.org/viewcvs?rev=219117&view=rev
Log:
Fix ClassUtils.primitiveToWrapper() to handle Void.TYPE
bug 34327, from Alban Peignier

Modified:
    jakarta/commons/proper/lang/trunk/project.xml
    jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/ClassUtils.java
    jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/ClassUtilsTest.java

Modified: jakarta/commons/proper/lang/trunk/project.xml
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/project.xml?rev=219117&r1=219116&r2=219117&view=diff
==============================================================================
--- jakarta/commons/proper/lang/trunk/project.xml (original)
+++ jakarta/commons/proper/lang/trunk/project.xml Thu Jul 14 15:08:08 2005
@@ -274,6 +274,9 @@
       <name>Andrew C. Oliver</name>
     </contributor>
     <contributor>
+      <name>Alban Peignier</name>
+    </contributor>
+    <contributor>
       <name>Moritz Petersen</name>
     </contributor>
     <contributor>

Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/ClassUtils.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/ClassUtils.java?rev=219117&r1=219116&r2=219117&view=diff
==============================================================================
--- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/ClassUtils.java (original)
+++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/ClassUtils.java Thu
Jul 14 15:08:08 2005
@@ -30,6 +30,7 @@
  * @author Stephen Colebourne
  * @author Gary Gregory
  * @author Norm Deane
+ * @author Alban Peignier
  * @since 2.0
  * @version $Id$
  */
@@ -68,6 +69,7 @@
          primitiveWrapperMap.put(Long.TYPE, Long.class);
          primitiveWrapperMap.put(Double.TYPE, Double.class);
          primitiveWrapperMap.put(Float.TYPE, Float.class);
+         primitiveWrapperMap.put(Void.TYPE, Void.TYPE);
     }
     
     /**
@@ -442,6 +444,9 @@
     /**
      * <p>Converts the specified primitive Class object to its corresponding
      * wrapper Class object.</p>
+     * 
+     * <p>NOTE: From v2.2, this method handles <code>Void.TYPE</code>,
+     * returning <code>Void.TYPE</code>.</p>
      *
      * @param cls  the class to convert, may be null
      * @return the wrapper class for <code>cls</code> or <code>cls</code>
if

Modified: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/ClassUtilsTest.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/ClassUtilsTest.java?rev=219117&r1=219116&r2=219117&view=diff
==============================================================================
--- jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/ClassUtilsTest.java
(original)
+++ jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/ClassUtilsTest.java
Thu Jul 14 15:08:08 2005
@@ -352,6 +352,8 @@
         assertEquals("ClassUtils.class -> ClassUtils.class",
             org.apache.commons.lang.ClassUtils.class, 
             ClassUtils.primitiveToWrapper(org.apache.commons.lang.ClassUtils.class));
+        assertEquals("Void.TYPE -> Void.TYPE",
+            Void.TYPE, ClassUtils.primitiveToWrapper(Void.TYPE));
             
         // test null     
         assertNull("null -> null",
@@ -384,7 +386,7 @@
 
         // test an array of no primitive classes
         final Class[] noPrimitives = new Class[] {
-                String.class, ClassUtils.class
+                String.class, ClassUtils.class, Void.TYPE
         };
         // This used to return the exact same array, but no longer does.
         assertNotSame("unmodified", noPrimitives, ClassUtils.primitivesToWrappers(noPrimitives));



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message