You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by mc...@apache.org on 2011/05/18 00:25:23 UTC

svn commit: r1104604 - /incubator/ognl/trunk/src/main/java/org/apache/commons/ognl/OgnlRuntime.java

Author: mcucchiara
Date: Tue May 17 22:25:22 2011
New Revision: 1104604

URL: http://svn.apache.org/viewvc?rev=1104604&view=rev
Log:
Cleaned code

Modified:
    incubator/ognl/trunk/src/main/java/org/apache/commons/ognl/OgnlRuntime.java

Modified: incubator/ognl/trunk/src/main/java/org/apache/commons/ognl/OgnlRuntime.java
URL: http://svn.apache.org/viewvc/incubator/ognl/trunk/src/main/java/org/apache/commons/ognl/OgnlRuntime.java?rev=1104604&r1=1104603&r2=1104604&view=diff
==============================================================================
--- incubator/ognl/trunk/src/main/java/org/apache/commons/ognl/OgnlRuntime.java (original)
+++ incubator/ognl/trunk/src/main/java/org/apache/commons/ognl/OgnlRuntime.java Tue May 17 22:25:22 2011
@@ -2737,11 +2737,13 @@ public class OgnlRuntime
 
                 String methodName = method.getName();
                 String lowerMethodName = methodName.toLowerCase();
+                int methodParamLen = method.getMethod().getParameterTypes().length;
+
                 if ( ( methodName.equalsIgnoreCase( name ) || lowerMethodName.equals( "get" + name )
                     || lowerMethodName.equals( "has" + name ) || lowerMethodName.equals( "is" + name ) )
                     && !methodName.startsWith( "set" ) )
                 {
-                    if ( numParms > 0 && method.getMethod().getParameterTypes().length == numParms )
+                    if ( numParms > 0 && methodParamLen == numParms )
                     {
                         return method.getMethod();
                     }
@@ -2751,8 +2753,7 @@ public class OgnlRuntime
                         {
                             return method.getMethod();
                         }
-                        else if ( m == null ||
-                            ( m != null && m.getParameterTypes().length > method.getMethod().getParameterTypes().length ) )
+                        else if ( m == null || ( m != null && m.getParameterTypes().length > methodParamLen ) )
                         {
                             m = method.getMethod();
                         }