commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcucchi...@apache.org
Subject svn commit: r1197034 - /commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/enhance/ExpressionCompiler.java
Date Thu, 03 Nov 2011 09:55:41 GMT
Author: mcucchiara
Date: Thu Nov  3 09:55:41 2011
New Revision: 1197034

URL: http://svn.apache.org/viewvc?rev=1197034&view=rev
Log:
OGNL-37 - Corrected attempt to remove LocalReference (keys was always of type String).

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

Modified: commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/enhance/ExpressionCompiler.java
URL: http://svn.apache.org/viewvc/commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/enhance/ExpressionCompiler.java?rev=1197034&r1=1197033&r2=1197034&view=diff
==============================================================================
--- commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/enhance/ExpressionCompiler.java
(original)
+++ commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/enhance/ExpressionCompiler.java
Thu Nov  3 09:55:41 2011
@@ -257,17 +257,17 @@ public class ExpressionCompiler
             return clazz.getName();
         }
 
-        Class<?>[] intf = clazz.getInterfaces();
+        Class<?>[] interfaces = clazz.getInterfaces();
 
-        for ( Class<?> anIntf : intf )
+        for ( Class<?> intface : interfaces )
         {
-            if ( anIntf.getName().indexOf( "util.List" ) > 0 )
+            if ( intface.getName().indexOf( "util.List" ) > 0 )
             {
-                return anIntf.getName();
+                return intface.getName();
             }
-            else if ( anIntf.getName().indexOf( "Iterator" ) > 0 )
+            else if ( intface.getName().indexOf( "Iterator" ) > 0 )
             {
-                return anIntf.getName();
+                return intface.getName();
             }
         }
 
@@ -680,8 +680,10 @@ public class ExpressionCompiler
             return;
         }
 
-        for ( LocalReference ref : referenceMap.values() )
+        for ( Map.Entry<String, LocalReference> entry : referenceMap.entrySet() )
         {
+            LocalReference ref = entry.getValue();
+            String key = entry.getKey();
             String widener = ref.getType().isPrimitive() ? " " : " ($w) ";
 
             String body = format( "{ return %s %s; }", widener, ref.getExpression() ).replaceAll(
"\\.\\.", "." );
@@ -694,7 +696,7 @@ public class ExpressionCompiler
             method.setBody( body );
 
             clazz.addMethod( method );
-            referenceMap.remove( ref );
+            referenceMap.remove( key );
         }
     }
 



Mime
View raw message