commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r800809 - in /commons/proper/jexl/branches/2.0/src/main/java/org/apache/commons/jexl: JexlArithmetic.java util/ListGetExecutor.java util/ListSetExecutor.java
Date Tue, 04 Aug 2009 14:12:15 GMT
Author: sebb
Date: Tue Aug  4 14:12:15 2009
New Revision: 800809

URL: http://svn.apache.org/viewvc?rev=800809&view=rev
Log:
Tidy some Eclipse warnings

Modified:
    commons/proper/jexl/branches/2.0/src/main/java/org/apache/commons/jexl/JexlArithmetic.java
    commons/proper/jexl/branches/2.0/src/main/java/org/apache/commons/jexl/util/ListGetExecutor.java
    commons/proper/jexl/branches/2.0/src/main/java/org/apache/commons/jexl/util/ListSetExecutor.java

Modified: commons/proper/jexl/branches/2.0/src/main/java/org/apache/commons/jexl/JexlArithmetic.java
URL: http://svn.apache.org/viewvc/commons/proper/jexl/branches/2.0/src/main/java/org/apache/commons/jexl/JexlArithmetic.java?rev=800809&r1=800808&r2=800809&view=diff
==============================================================================
--- commons/proper/jexl/branches/2.0/src/main/java/org/apache/commons/jexl/JexlArithmetic.java
(original)
+++ commons/proper/jexl/branches/2.0/src/main/java/org/apache/commons/jexl/JexlArithmetic.java
Tue Aug  4 14:12:15 2009
@@ -390,9 +390,13 @@
 
             return leftString.compareTo(rightString) < 0;
         } else if (left instanceof Comparable<?>) {
-            return ((Comparable<Object>) left).compareTo(right) < 0;
+            @SuppressWarnings("unchecked")
+            final Comparable<Object> comparable = (Comparable<Object>) left;
+            return comparable.compareTo(right) < 0;
         } else if (right instanceof Comparable<?>) {
-            return ((Comparable<Object>) right).compareTo(left) > 0;
+            @SuppressWarnings("unchecked")
+            final Comparable<Object> comparable = (Comparable<Object>) right;
+            return comparable.compareTo(left) > 0;
         }
 
         throw new IllegalArgumentException("Invalid comparison : comparing cardinality for
left: " + left

Modified: commons/proper/jexl/branches/2.0/src/main/java/org/apache/commons/jexl/util/ListGetExecutor.java
URL: http://svn.apache.org/viewvc/commons/proper/jexl/branches/2.0/src/main/java/org/apache/commons/jexl/util/ListGetExecutor.java?rev=800809&r1=800808&r2=800809&view=diff
==============================================================================
--- commons/proper/jexl/branches/2.0/src/main/java/org/apache/commons/jexl/util/ListGetExecutor.java
(original)
+++ commons/proper/jexl/branches/2.0/src/main/java/org/apache/commons/jexl/util/ListGetExecutor.java
Tue Aug  4 14:12:15 2009
@@ -50,9 +50,9 @@
     @Override
     public Object execute(final Object list) {
         if (method == ARRAY_GET) {
-            return java.lang.reflect.Array.get(list, property);
+            return java.lang.reflect.Array.get(list, property.intValue());
         } else {
-            return ((List<?>) list).get(property);
+            return ((List<?>) list).get(property.intValue());
         }
     }
 
@@ -63,9 +63,9 @@
             && objectClass.equals(list.getClass())
             && index instanceof Integer) {
             if (method == ARRAY_GET) {
-                return java.lang.reflect.Array.get(list, property);
+                return java.lang.reflect.Array.get(list, property.intValue());
             } else {
-                return ((List<?>) list).get(property);
+                return ((List<?>) list).get(property.intValue());
             }
         }
         return TRY_FAILED;

Modified: commons/proper/jexl/branches/2.0/src/main/java/org/apache/commons/jexl/util/ListSetExecutor.java
URL: http://svn.apache.org/viewvc/commons/proper/jexl/branches/2.0/src/main/java/org/apache/commons/jexl/util/ListSetExecutor.java?rev=800809&r1=800808&r2=800809&view=diff
==============================================================================
--- commons/proper/jexl/branches/2.0/src/main/java/org/apache/commons/jexl/util/ListSetExecutor.java
(original)
+++ commons/proper/jexl/branches/2.0/src/main/java/org/apache/commons/jexl/util/ListSetExecutor.java
Tue Aug  4 14:12:15 2009
@@ -47,9 +47,11 @@
     @Override
     public Object execute(final Object list, Object arg) {
         if (method == ARRAY_SET) {
-            java.lang.reflect.Array.set(list, property, arg);
+            java.lang.reflect.Array.set(list, property.intValue(), arg);
         } else {
-            ((List<Object>) list).set(property, arg);
+            @SuppressWarnings("unchecked")
+            final List<Object> asList = (List<Object>) list;
+            asList.set(property.intValue(), arg);
         }
         return arg;
     }
@@ -62,9 +64,11 @@
             && index instanceof Integer) {
             Integer idx = (Integer) index;
         if (method == ARRAY_SET) {
-            java.lang.reflect.Array.set(list, idx, arg);
+            java.lang.reflect.Array.set(list, idx.intValue(), arg);
         } else {
-            ((List<Object>) list).set(idx, arg);
+            @SuppressWarnings("unchecked")
+            final List<Object> asList = (List<Object>) list;
+            asList.set(idx.intValue(), arg);
         }
         }
         return TRY_FAILED;



Mime
View raw message