commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcucchi...@apache.org
Subject svn commit: r1197009 - /commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/ASTChain.java
Date Thu, 03 Nov 2011 09:18:01 GMT
Author: mcucchiara
Date: Thu Nov  3 09:18:01 2011
New Revision: 1197009

URL: http://svn.apache.org/viewvc?rev=1197009&view=rev
Log:
OGNL-37 - Remove int boxing, lets rely on autoboxing.

Modified:
    commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/ASTChain.java

Modified: commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/ASTChain.java
URL: http://svn.apache.org/viewvc/commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/ASTChain.java?rev=1197009&r1=1197008&r2=1197009&view=diff
==============================================================================
--- commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/ASTChain.java (original)
+++ commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/ASTChain.java Thu Nov
 3 09:18:01 2011
@@ -109,15 +109,16 @@ public class ASTChain
                                             i++;
                                             break;
                                         case DynamicSubscript.FIRST:
-                                            index = new Integer( ( len > 0 ) ? 0 : -1
);
+                                            index = ( len > 0 ) ? 0 : -1;
                                             break;
                                         case DynamicSubscript.MID:
-                                            index = new Integer( ( len > 0 ) ? ( len /
2 ) : -1 );
+                                            index = ( len > 0 ) ? ( len / 2 ) : -1;
                                             break;
                                         case DynamicSubscript.LAST:
-                                            index = new Integer( ( len > 0 ) ? ( len -
1 ) : -1 );
+                                            index = ( len > 0 ) ? ( len - 1 ) : -1;
+                                            break;
+                                        default:
                                             break;
-                                        default: break;    
                                     }
                                 }
                                 else
@@ -190,15 +191,16 @@ public class ASTChain
                                             i++;
                                             break;
                                         case DynamicSubscript.FIRST:
-                                            index = new Integer( ( len > 0 ) ? 0 : -1
);
+                                            index = ( len > 0 ) ? 0 : -1;
                                             break;
                                         case DynamicSubscript.MID:
-                                            index = new Integer( ( len > 0 ) ? ( len /
2 ) : -1 );
+                                            index = ( len > 0 ) ? ( len / 2 ) : -1;
                                             break;
                                         case DynamicSubscript.LAST:
-                                            index = new Integer( ( len > 0 ) ? ( len -
1 ) : -1 );
+                                            index = ( len > 0 ) ? ( len - 1 ) : -1;
+                                            break;
+                                        default:
                                             break;
-                                        default: break;
                                     }
                                 }
                                 else



Mime
View raw message