Author: sebb
Date: Tue Jul 28 18:07:52 2009
New Revision: 798628

URL: http://svn.apache.org/viewvc?rev=798628&view=rev
Log:
Throw the generated Exception
new Byte => Byte.valueOf

Modified:
    
commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/Interpreter.java

Modified: 
commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/Interpreter.java
URL: 
http://svn.apache.org/viewvc/commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/Interpreter.java?rev=798628&r1=798627&r2=798628&view=diff
==============================================================================
--- 
commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/Interpreter.java
 (original)
+++ 
commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/Interpreter.java
 Tue Jul 28 18:07:52 2009
@@ -978,10 +978,10 @@
         Object val = valNode.jjtAccept(this, data);
         if (val instanceof Byte) {
             byte valueAsByte = ((Byte) val).byteValue();
-            return new Byte((byte) -valueAsByte);
+            return Byte.valueOf((byte) -valueAsByte);
         } else if (val instanceof Short) {
             short valueAsShort = ((Short) val).shortValue();
-            return new Short((short) -valueAsShort);
+            return Short.valueOf((short) -valueAsShort);
         } else if (val instanceof Integer) {
             int valueAsInt = ((Integer) val).intValue();
             return new Integer(-valueAsInt);
@@ -1008,7 +1008,7 @@
     public Object visit(ASTWhileStatement node, Object data) {
         Object result = null;
         /* first objectNode is the expression */
-        Node expressionNode = (Node) node.jjtGetChild(0);
+        Node expressionNode = node.jjtGetChild(0);
         while (arithmetic.toBoolean(expressionNode.jjtAccept(this, data))) {
             // execute statement
             result = node.jjtGetChild(1).jjtAccept(this, data);
@@ -1197,7 +1197,7 @@
             return;
         }
         if (node == null) {
-            new UnsupportedOperationException("unable to set object property, "
+            throw new UnsupportedOperationException("unable to set object 
property, "
                             + "object:" + object + ", property: " + attribute);
         }
         throw new JexlException(node, "unable to set bean property", null);


Reply via email to