You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by he...@apache.org on 2011/07/14 12:39:35 UTC

svn commit: r1146637 - /commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/Interpreter.java

Author: henrib
Date: Thu Jul 14 10:39:32 2011
New Revision: 1146637

URL: http://svn.apache.org/viewvc?rev=1146637&view=rev
Log:
Removed useless casts

Modified:
    commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/Interpreter.java

Modified: commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/Interpreter.java
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/Interpreter.java?rev=1146637&r1=1146636&r2=1146637&view=diff
==============================================================================
--- commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/Interpreter.java (original)
+++ commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/Interpreter.java Thu Jul 14 10:39:32 2011
@@ -359,7 +359,7 @@ public class Interpreter implements Pars
             try {
                 JexlNode op = node.jjtGetChild(c - 1);
                 if (op instanceof ASTAdditiveOperator) {
-                    String which = ((ASTAdditiveOperator) op).image;
+                    String which = op.image;
                     if ("+".equals(which)) {
                         left = arithmetic.add(left, right);
                         continue;
@@ -899,7 +899,7 @@ public class Interpreter implements Pars
             }
         }
         // objectNode 0 is the identifier (method name), the others are parameters.
-        String methodName = ((ASTIdentifier) node.jjtGetChild(0)).image;
+        String methodName = node.jjtGetChild(0).image;
 
         // get our arguments
         int argc = node.jjtGetNumChildren() - 1;
@@ -991,10 +991,10 @@ public class Interpreter implements Pars
             throw new JexlException.Cancel(node);
         }
         // objectNode 0 is the prefix
-        String prefix = ((ASTIdentifier) node.jjtGetChild(0)).image;
+        String prefix = node.jjtGetChild(0).image;
         Object namespace = resolveNamespace(prefix, node);
         // objectNode 1 is the identifier , the others are parameters.
-        String function = ((ASTIdentifier) node.jjtGetChild(1)).image;
+        String function = node.jjtGetChild(1).image;
 
         // get our args
         int argc = node.jjtGetNumChildren() - 2;
@@ -1209,11 +1209,9 @@ public class Interpreter implements Pars
     /** {@inheritDoc} */
     public Object visit(ASTSizeFunction node, Object data) {
         Object val = node.jjtGetChild(0).jjtAccept(this, data);
-
         if (val == null) {
             throw new JexlException(node, "size() : argument is null", null);
         }
-
         return Integer.valueOf(sizeOf(node, val));
     }