commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r832504 - in /commons/proper/jexl/trunk/src: main/java/org/apache/commons/jexl/util/ test/java/org/apache/commons/jexl/ test/java/org/apache/commons/jexl/util/introspection/
Date Tue, 03 Nov 2009 18:46:38 GMT
Author: sebb
Date: Tue Nov  3 18:46:37 2009
New Revision: 832504

URL: http://svn.apache.org/viewvc?rev=832504&view=rev
Log:
Remove autoboxing

Modified:
    commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl/util/ListGetExecutor.java
    commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl/util/ListSetExecutor.java
    commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl/BitwiseOperatorTest.java
    commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl/util/introspection/DiscoveryTest.java

Modified: commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl/util/ListGetExecutor.java
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl/util/ListGetExecutor.java?rev=832504&r1=832503&r2=832504&view=diff
==============================================================================
--- commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl/util/ListGetExecutor.java
(original)
+++ commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl/util/ListGetExecutor.java
Tue Nov  3 18:46:37 2009
@@ -70,9 +70,9 @@
             && objectClass.equals(obj.getClass())
             && key instanceof Integer) {
             if (method == ARRAY_GET) {
-                return java.lang.reflect.Array.get(obj, (Integer) key);
+                return java.lang.reflect.Array.get(obj, ((Integer) key).intValue());
             } else {
-                return ((List<?>) obj).get((Integer) key);
+                return ((List<?>) obj).get(((Integer) key).intValue());
             }
         }
         return TRY_FAILED;

Modified: commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl/util/ListSetExecutor.java
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl/util/ListSetExecutor.java?rev=832504&r1=832503&r2=832504&view=diff
==============================================================================
--- commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl/util/ListSetExecutor.java
(original)
+++ commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl/util/ListSetExecutor.java
Tue Nov  3 18:46:37 2009
@@ -71,10 +71,10 @@
             && objectClass.equals(obj.getClass())
             && key instanceof Integer) {
             if (method == ARRAY_SET) {
-                Array.set(obj, (Integer) key, value);
+                Array.set(obj, ((Integer) key).intValue(), value);
             } else {
                 final List<Object> list = (List<Object>) obj;
-                list.set((Integer) key, value);
+                list.set(((Integer) key).intValue(), value);
             }
             return value;
         }

Modified: commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl/BitwiseOperatorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl/BitwiseOperatorTest.java?rev=832504&r1=832503&r2=832504&view=diff
==============================================================================
--- commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl/BitwiseOperatorTest.java
(original)
+++ commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl/BitwiseOperatorTest.java
Tue Nov  3 18:46:37 2009
@@ -142,8 +142,8 @@
     }
 
     public void testParenthesized() throws Exception {
-        asserter.assertExpression("(2 | 1) & 3", 3L);
-        asserter.assertExpression("(2 & 1) | 3", 3L);
+        asserter.assertExpression("(2 | 1) & 3", Long.valueOf(3L));
+        asserter.assertExpression("(2 & 1) | 3", Long.valueOf(3L));
         asserter.assertExpression("~(120 | 42)", new Long( ~(120 | 42) ));
     }
 

Modified: commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl/util/introspection/DiscoveryTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl/util/introspection/DiscoveryTest.java?rev=832504&r1=832503&r2=832504&view=diff
==============================================================================
--- commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl/util/introspection/DiscoveryTest.java
(original)
+++ commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl/util/introspection/DiscoveryTest.java
Tue Nov  3 18:46:37 2009
@@ -135,7 +135,7 @@
         assertTrue("duck property getter", get instanceof DuckGetExecutor);
         assertTrue("duck property setter", set instanceof DuckSetExecutor);
         // introspector and uberspect should return same result
-        assertEquals(get, (AbstractExecutor) uber.getPropertyGet(duck, "value", null));
+        assertEquals(get, uber.getPropertyGet(duck, "value", null));
         assertEquals(set, uber.getPropertySet(duck, "value", "foo", null));
         // different property should return different setter/getter
         assertFalse(get.equals(intro.getGetExecutor(duck, "eulav")));
@@ -160,23 +160,23 @@
         list.add("LIST");
         list.add("TSIL");
 
-        AbstractExecutor.Get get = intro.getGetExecutor(list, 1);
-        AbstractExecutor.Set set  = intro.getSetExecutor(list, 1, "foo");
+        AbstractExecutor.Get get = intro.getGetExecutor(list, Integer.valueOf(1));
+        AbstractExecutor.Set set  = intro.getSetExecutor(list, Integer.valueOf(1), "foo");
         assertTrue("list property getter", get instanceof ListGetExecutor);
         assertTrue("list property setter", set instanceof ListSetExecutor);
         // introspector and uberspect should return same result
-        assertEquals(get, uber.getPropertyGet(list, 1, null));
-        assertEquals(set, uber.getPropertySet(list, 1, "foo", null));
+        assertEquals(get, uber.getPropertyGet(list, Integer.valueOf(1), null));
+        assertEquals(set, uber.getPropertySet(list, Integer.valueOf(1), "foo", null));
         // different property should return different setter/getter
-        assertFalse(get.equals(intro.getGetExecutor(list, 0)));
-        assertFalse(get.equals(intro.getSetExecutor(list, 0, "foo")));
+        assertFalse(get.equals(intro.getGetExecutor(list, Integer.valueOf(0))));
+        assertFalse(get.equals(intro.getSetExecutor(list, Integer.valueOf(0), "foo")));
         // setter returns argument
         Object bar = set.execute(list, "bar");
         assertEquals("bar", bar);
         // getter should return last value
         assertEquals("bar", get.execute(list));
         // tryExecute should succeed on integer property
-        Object quux = set.tryExecute(list, 1, "quux");
+        Object quux = set.tryExecute(list, Integer.valueOf(1), "quux");
         assertEquals("quux", quux);
         // getter should return last value
         assertEquals("quux", get.execute(list));
@@ -212,7 +212,7 @@
         // getter should return last value
         assertEquals("quux", get.execute(map));
         // tryExecute should fail on different property class
-        assertEquals(AbstractExecutor.TRY_FAILED, set.tryExecute(map, 1, "nope"));
+        assertEquals(AbstractExecutor.TRY_FAILED, set.tryExecute(map, Integer.valueOf(1),
"nope"));
     }
 
 }



Mime
View raw message