commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcucchi...@apache.org
Subject svn commit: r1546797 - /commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/reflect/FieldUtilsTest.java
Date Sun, 01 Dec 2013 10:08:18 GMT
Author: mcucchiara
Date: Sun Dec  1 10:08:18 2013
New Revision: 1546797

URL: http://svn.apache.org/r1546797
Log:
Restored explicit boxes (see http://goo.gl/uN6xQl)

Modified:
    commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/reflect/FieldUtilsTest.java

Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/reflect/FieldUtilsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/reflect/FieldUtilsTest.java?rev=1546797&r1=1546796&r2=1546797&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/reflect/FieldUtilsTest.java
(original)
+++ commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/reflect/FieldUtilsTest.java
Sun Dec  1 10:08:18 2013
@@ -38,10 +38,10 @@ import static org.junit.Assume.assumeNot
  */
 public class FieldUtilsTest {
 
-    static final Integer I0 = 0;
-    static final Integer I1 = 1;
-    static final Double D0 = 0.0;
-    static final Double D1 = 1.0;
+    static final Integer I0 = Integer.valueOf(0);
+    static final Integer I1 = Integer.valueOf(1);
+    static final Double D0 = Double.valueOf(0.0);
+    static final Double D1 = Double.valueOf(1.0);
 
     private PublicChild publicChild;
     private PubliclyShadowedChild publiclyShadowedChild;
@@ -1028,13 +1028,13 @@ public class FieldUtilsTest {
         }
         field = parentClass.getDeclaredField("i");
         try {
-            FieldUtils.writeField(field, publicChild, Integer.MAX_VALUE);
+            FieldUtils.writeField(field, publicChild, Integer.valueOf(Integer.MAX_VALUE));
         } catch (final IllegalAccessException e) {
             // pass
         }
         field = parentClass.getDeclaredField("d");
         try {
-            FieldUtils.writeField(field, publicChild, Double.MAX_VALUE);
+            FieldUtils.writeField(field, publicChild, Double.valueOf(Double.MAX_VALUE));
         } catch (final IllegalAccessException e) {
             // pass
         }
@@ -1049,11 +1049,11 @@ public class FieldUtilsTest {
         FieldUtils.writeField(field, publicChild, Boolean.TRUE, true);
         assertEquals(Boolean.TRUE, field.get(publicChild));
         field = parentClass.getDeclaredField("i");
-        FieldUtils.writeField(field, publicChild, Integer.MAX_VALUE, true);
-        assertEquals(Integer.MAX_VALUE, field.get(publicChild));
+        FieldUtils.writeField(field, publicChild, Integer.valueOf(Integer.MAX_VALUE), true);
+        assertEquals(Integer.valueOf(Integer.MAX_VALUE), field.get(publicChild));
         field = parentClass.getDeclaredField("d");
-        FieldUtils.writeField(field, publicChild, Double.MAX_VALUE, true);
-        assertEquals(Double.MAX_VALUE, field.get(publicChild));
+        FieldUtils.writeField(field, publicChild, Double.valueOf(Double.MAX_VALUE), true);
+        assertEquals(Double.valueOf(Double.MAX_VALUE), field.get(publicChild));
     }
 
     @Test
@@ -1067,13 +1067,13 @@ public class FieldUtilsTest {
             // pass
         }
         try {
-            FieldUtils.writeField(publicChild, "i", 1);
+            FieldUtils.writeField(publicChild, "i", Integer.valueOf(1));
             fail("Expected IllegalArgumentException");
         } catch (final IllegalArgumentException e) {
             // pass
         }
         try {
-            FieldUtils.writeField(publicChild, "d", 1.0);
+            FieldUtils.writeField(publicChild, "d", Double.valueOf(1.0));
             fail("Expected IllegalArgumentException");
         } catch (final IllegalArgumentException e) {
             // pass
@@ -1083,10 +1083,10 @@ public class FieldUtilsTest {
         assertEquals("S", FieldUtils.readField(publiclyShadowedChild, "s"));
         FieldUtils.writeField(publiclyShadowedChild, "b", Boolean.FALSE);
         assertEquals(Boolean.FALSE, FieldUtils.readField(publiclyShadowedChild, "b"));
-        FieldUtils.writeField(publiclyShadowedChild, "i", 0);
-        assertEquals(0, FieldUtils.readField(publiclyShadowedChild, "i"));
-        FieldUtils.writeField(publiclyShadowedChild, "d", 0.0);
-        assertEquals(0.0, FieldUtils.readField(publiclyShadowedChild, "d"));
+        FieldUtils.writeField(publiclyShadowedChild, "i", Integer.valueOf(0));
+        assertEquals(Integer.valueOf(0), FieldUtils.readField(publiclyShadowedChild, "i"));
+        FieldUtils.writeField(publiclyShadowedChild, "d", Double.valueOf(0.0));
+        assertEquals(Double.valueOf(0.0), FieldUtils.readField(publiclyShadowedChild, "d"));
 
         FieldUtils.writeField(privatelyShadowedChild, "s", "S");
         assertEquals("S", FieldUtils.readField(privatelyShadowedChild, "s"));
@@ -1097,13 +1097,13 @@ public class FieldUtilsTest {
             // pass
         }
         try {
-            FieldUtils.writeField(privatelyShadowedChild, "i", 1);
+            FieldUtils.writeField(privatelyShadowedChild, "i", Integer.valueOf(1));
             fail("Expected IllegalArgumentException");
         } catch (final IllegalArgumentException e) {
             // pass
         }
         try {
-            FieldUtils.writeField(privatelyShadowedChild, "d", 1.0);
+            FieldUtils.writeField(privatelyShadowedChild, "d", Double.valueOf(1.0));
             fail("Expected IllegalArgumentException");
         } catch (final IllegalArgumentException e) {
             // pass
@@ -1116,28 +1116,28 @@ public class FieldUtilsTest {
         assertEquals("S", FieldUtils.readField(publicChild, "s", true));
         FieldUtils.writeField(publicChild, "b", Boolean.TRUE, true);
         assertEquals(Boolean.TRUE, FieldUtils.readField(publicChild, "b", true));
-        FieldUtils.writeField(publicChild, "i", 1, true);
-        assertEquals(1, FieldUtils.readField(publicChild, "i", true));
-        FieldUtils.writeField(publicChild, "d", 1.0, true);
-        assertEquals(1.0, FieldUtils.readField(publicChild, "d", true));
+        FieldUtils.writeField(publicChild, "i", Integer.valueOf(1), true);
+        assertEquals(Integer.valueOf(1), FieldUtils.readField(publicChild, "i", true));
+        FieldUtils.writeField(publicChild, "d", Double.valueOf(1.0), true);
+        assertEquals(Double.valueOf(1.0), FieldUtils.readField(publicChild, "d", true));
 
         FieldUtils.writeField(publiclyShadowedChild, "s", "S", true);
         assertEquals("S", FieldUtils.readField(publiclyShadowedChild, "s", true));
         FieldUtils.writeField(publiclyShadowedChild, "b", Boolean.FALSE, true);
         assertEquals(Boolean.FALSE, FieldUtils.readField(publiclyShadowedChild, "b", true));
-        FieldUtils.writeField(publiclyShadowedChild, "i", 0, true);
-        assertEquals(0, FieldUtils.readField(publiclyShadowedChild, "i", true));
-        FieldUtils.writeField(publiclyShadowedChild, "d", 0.0, true);
-        assertEquals(0.0, FieldUtils.readField(publiclyShadowedChild, "d", true));
+        FieldUtils.writeField(publiclyShadowedChild, "i", Integer.valueOf(0), true);
+        assertEquals(Integer.valueOf(0), FieldUtils.readField(publiclyShadowedChild, "i",
true));
+        FieldUtils.writeField(publiclyShadowedChild, "d", Double.valueOf(0.0), true);
+        assertEquals(Double.valueOf(0.0), FieldUtils.readField(publiclyShadowedChild, "d",
true));
 
         FieldUtils.writeField(privatelyShadowedChild, "s", "S", true);
         assertEquals("S", FieldUtils.readField(privatelyShadowedChild, "s", true));
         FieldUtils.writeField(privatelyShadowedChild, "b", Boolean.FALSE, true);
         assertEquals(Boolean.FALSE, FieldUtils.readField(privatelyShadowedChild, "b", true));
-        FieldUtils.writeField(privatelyShadowedChild, "i", 0, true);
-        assertEquals(0, FieldUtils.readField(privatelyShadowedChild, "i", true));
-        FieldUtils.writeField(privatelyShadowedChild, "d", 0.0, true);
-        assertEquals(0.0, FieldUtils.readField(privatelyShadowedChild, "d", true));
+        FieldUtils.writeField(privatelyShadowedChild, "i", Integer.valueOf(0), true);
+        assertEquals(Integer.valueOf(0), FieldUtils.readField(privatelyShadowedChild, "i",
true));
+        FieldUtils.writeField(privatelyShadowedChild, "d", Double.valueOf(0.0), true);
+        assertEquals(Double.valueOf(0.0), FieldUtils.readField(privatelyShadowedChild, "d",
true));
     }
 
     @Test
@@ -1155,13 +1155,13 @@ public class FieldUtilsTest {
             // pass
         }
         try {
-            FieldUtils.writeDeclaredField(publicChild, "i", 1);
+            FieldUtils.writeDeclaredField(publicChild, "i", Integer.valueOf(1));
             fail("Expected IllegalArgumentException");
         } catch (final IllegalArgumentException e) {
             // pass
         }
         try {
-            FieldUtils.writeDeclaredField(publicChild, "d", 1.0);
+            FieldUtils.writeDeclaredField(publicChild, "d", Double.valueOf(1.0));
             fail("Expected IllegalArgumentException");
         } catch (final IllegalArgumentException e) {
             // pass
@@ -1171,10 +1171,10 @@ public class FieldUtilsTest {
         assertEquals("S", FieldUtils.readDeclaredField(publiclyShadowedChild, "s"));
         FieldUtils.writeDeclaredField(publiclyShadowedChild, "b", Boolean.FALSE);
         assertEquals(Boolean.FALSE, FieldUtils.readDeclaredField(publiclyShadowedChild, "b"));
-        FieldUtils.writeDeclaredField(publiclyShadowedChild, "i", 0);
-        assertEquals(0, FieldUtils.readDeclaredField(publiclyShadowedChild, "i"));
-        FieldUtils.writeDeclaredField(publiclyShadowedChild, "d", 0.0);
-        assertEquals(0.0, FieldUtils.readDeclaredField(publiclyShadowedChild, "d"));
+        FieldUtils.writeDeclaredField(publiclyShadowedChild, "i", Integer.valueOf(0));
+        assertEquals(Integer.valueOf(0), FieldUtils.readDeclaredField(publiclyShadowedChild,
"i"));
+        FieldUtils.writeDeclaredField(publiclyShadowedChild, "d", Double.valueOf(0.0));
+        assertEquals(Double.valueOf(0.0), FieldUtils.readDeclaredField(publiclyShadowedChild,
"d"));
 
         try {
             FieldUtils.writeDeclaredField(privatelyShadowedChild, "s", "S");
@@ -1189,13 +1189,13 @@ public class FieldUtilsTest {
             // pass
         }
         try {
-            FieldUtils.writeDeclaredField(privatelyShadowedChild, "i", 1);
+            FieldUtils.writeDeclaredField(privatelyShadowedChild, "i", Integer.valueOf(1));
             fail("Expected IllegalArgumentException");
         } catch (final IllegalArgumentException e) {
             // pass
         }
         try {
-            FieldUtils.writeDeclaredField(privatelyShadowedChild, "d", 1.0);
+            FieldUtils.writeDeclaredField(privatelyShadowedChild, "d", Double.valueOf(1.0));
             fail("Expected IllegalArgumentException");
         } catch (final IllegalArgumentException e) {
             // pass
@@ -1217,13 +1217,13 @@ public class FieldUtilsTest {
             // pass
         }
         try {
-            FieldUtils.writeDeclaredField(publicChild, "i", 1, true);
+            FieldUtils.writeDeclaredField(publicChild, "i", Integer.valueOf(1), true);
             fail("Expected IllegalArgumentException");
         } catch (final IllegalArgumentException e) {
             // pass
         }
         try {
-            FieldUtils.writeDeclaredField(publicChild, "d", 1.0, true);
+            FieldUtils.writeDeclaredField(publicChild, "d", Double.valueOf(1.0), true);
             fail("Expected IllegalArgumentException");
         } catch (final IllegalArgumentException e) {
             // pass
@@ -1233,19 +1233,19 @@ public class FieldUtilsTest {
         assertEquals("S", FieldUtils.readDeclaredField(publiclyShadowedChild, "s", true));
         FieldUtils.writeDeclaredField(publiclyShadowedChild, "b", Boolean.FALSE, true);
         assertEquals(Boolean.FALSE, FieldUtils.readDeclaredField(publiclyShadowedChild, "b",
true));
-        FieldUtils.writeDeclaredField(publiclyShadowedChild, "i", 0, true);
-        assertEquals(0, FieldUtils.readDeclaredField(publiclyShadowedChild, "i", true));
-        FieldUtils.writeDeclaredField(publiclyShadowedChild, "d", 0.0, true);
-        assertEquals(0.0, FieldUtils.readDeclaredField(publiclyShadowedChild, "d", true));
+        FieldUtils.writeDeclaredField(publiclyShadowedChild, "i", Integer.valueOf(0), true);
+        assertEquals(Integer.valueOf(0), FieldUtils.readDeclaredField(publiclyShadowedChild,
"i", true));
+        FieldUtils.writeDeclaredField(publiclyShadowedChild, "d", Double.valueOf(0.0), true);
+        assertEquals(Double.valueOf(0.0), FieldUtils.readDeclaredField(publiclyShadowedChild,
"d", true));
 
         FieldUtils.writeDeclaredField(privatelyShadowedChild, "s", "S", true);
         assertEquals("S", FieldUtils.readDeclaredField(privatelyShadowedChild, "s", true));
         FieldUtils.writeDeclaredField(privatelyShadowedChild, "b", Boolean.FALSE, true);
         assertEquals(Boolean.FALSE, FieldUtils.readDeclaredField(privatelyShadowedChild,
"b", true));
-        FieldUtils.writeDeclaredField(privatelyShadowedChild, "i", 0, true);
-        assertEquals(0, FieldUtils.readDeclaredField(privatelyShadowedChild, "i", true));
-        FieldUtils.writeDeclaredField(privatelyShadowedChild, "d", 0.0, true);
-        assertEquals(0.0, FieldUtils.readDeclaredField(privatelyShadowedChild, "d", true));
+        FieldUtils.writeDeclaredField(privatelyShadowedChild, "i", Integer.valueOf(0), true);
+        assertEquals(Integer.valueOf(0), FieldUtils.readDeclaredField(privatelyShadowedChild,
"i", true));
+        FieldUtils.writeDeclaredField(privatelyShadowedChild, "d", Double.valueOf(0.0), true);
+        assertEquals(Double.valueOf(0.0), FieldUtils.readDeclaredField(privatelyShadowedChild,
"d", true));
     }
 
     @Test(expected = IllegalArgumentException.class)



Mime
View raw message