commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1582296 - in /commons/proper/proxy/trunk/core/src: main/java/org/apache/commons/proxy2/ProxyUtils.java test/java/org/apache/commons/proxy2/ProxyUtilsTest.java
Date Thu, 27 Mar 2014 13:27:49 GMT
Author: sebb
Date: Thu Mar 27 13:27:48 2014
New Revision: 1582296

URL: http://svn.apache.org/r1582296
Log:
Explicit boxing needed here

Modified:
    commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/ProxyUtils.java
    commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/ProxyUtilsTest.java

Modified: commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/ProxyUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/ProxyUtils.java?rev=1582296&r1=1582295&r2=1582296&view=diff
==============================================================================
--- commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/ProxyUtils.java
(original)
+++ commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/ProxyUtils.java
Thu Mar 27 13:27:48 2014
@@ -58,13 +58,13 @@ public final class ProxyUtils
 
     static
     {
-        NULL_VALUE_MAP.put(Integer.TYPE, 0);
-        NULL_VALUE_MAP.put(Long.TYPE, (long) 0);
-        NULL_VALUE_MAP.put(Short.TYPE, (short) 0);
-        NULL_VALUE_MAP.put(Byte.TYPE, (byte) 0);
-        NULL_VALUE_MAP.put(Float.TYPE, 0.0f);
-        NULL_VALUE_MAP.put(Double.TYPE, 0.0);
-        NULL_VALUE_MAP.put(Character.TYPE, (char) 0);
+        NULL_VALUE_MAP.put(Integer.TYPE, Integer.valueOf(0));
+        NULL_VALUE_MAP.put(Long.TYPE, Long.valueOf(0));
+        NULL_VALUE_MAP.put(Short.TYPE, Short.valueOf((short) 0));
+        NULL_VALUE_MAP.put(Byte.TYPE, Byte.valueOf((byte) 0));
+        NULL_VALUE_MAP.put(Float.TYPE, Float.valueOf(0.0f));
+        NULL_VALUE_MAP.put(Double.TYPE, Double.valueOf(0.0));
+        NULL_VALUE_MAP.put(Character.TYPE, Character.valueOf((char) 0));
         NULL_VALUE_MAP.put(Boolean.TYPE, Boolean.FALSE);
     }
 

Modified: commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/ProxyUtilsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/ProxyUtilsTest.java?rev=1582296&r1=1582295&r2=1582296&view=diff
==============================================================================
--- commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/ProxyUtilsTest.java
(original)
+++ commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/ProxyUtilsTest.java
Thu Mar 27 13:27:48 2014
@@ -60,15 +60,16 @@ public class ProxyUtilsTest extends Abst
     @Test
     public void testNullValue()
     {
+        // expecting objects so test against explicit objects rather than using autoboxing
         assertNullValue(null, String.class);
-        assertNullValue((char) 0, Character.TYPE);
-        assertNullValue(0, Integer.TYPE);
-        assertNullValue((long) 0, Long.TYPE);
-        assertNullValue((short) 0, Short.TYPE);
-        assertNullValue((double) 0, Double.TYPE);
-        assertNullValue((float) 0, Float.TYPE);
-        assertNullValue(false, Boolean.TYPE);
-        assertNullValue((byte) 0, Byte.TYPE);
+        assertNullValue(Character.valueOf((char) 0), Character.TYPE);
+        assertNullValue(Integer.valueOf(0), Integer.TYPE);
+        assertNullValue(Long.valueOf(0), Long.TYPE);
+        assertNullValue(Short.valueOf((short) 0), Short.TYPE);
+        assertNullValue(Double.valueOf(0), Double.TYPE);
+        assertNullValue(Float.valueOf(0), Float.TYPE);
+        assertNullValue(Boolean.FALSE, Boolean.TYPE);
+        assertNullValue(Byte.valueOf((byte) 0), Byte.TYPE);
     }
 
     private void assertNullValue(Object expected, Class<?> type)



Mime
View raw message