tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kkoli...@apache.org
Subject svn commit: r1173722 - /tomcat/trunk/java/javax/el/BeanELResolver.java
Date Wed, 21 Sep 2011 15:35:48 GMT
Author: kkolinko
Date: Wed Sep 21 15:35:47 2011
New Revision: 1173722

URL: http://svn.apache.org/viewvc?rev=1173722&view=rev
Log:
Followup to r1173630
Simplify code: methodName can be tested once per iteration

Modified:
    tomcat/trunk/java/javax/el/BeanELResolver.java

Modified: tomcat/trunk/java/javax/el/BeanELResolver.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/BeanELResolver.java?rev=1173722&r1=1173721&r2=1173722&view=diff
==============================================================================
--- tomcat/trunk/java/javax/el/BeanELResolver.java (original)
+++ tomcat/trunk/java/javax/el/BeanELResolver.java Wed Sep 21 15:35:47 2011
@@ -414,15 +414,16 @@ public class BeanELResolver extends ELRe
             }
             Method[] methods = clazz.getMethods();
             for (Method m : methods) {
-                if (methodName.equals(m.getName()) && 
-                        m.getParameterTypes().length == paramCount) {
-                    // Same number of parameters - use the first match
-                    matchingMethod = getMethod(clazz, m);
-                    break;
-                }
-                if (m.isVarArgs() && methodName.equals(m.getName()) && 
-                            paramCount > m.getParameterTypes().length - 2 ) {
-                    matchingMethod = getMethod(clazz, m);
+                if (methodName.equals(m.getName())) {
+                    if (m.getParameterTypes().length == paramCount) {
+                        // Same number of parameters - use the first match
+                        matchingMethod = getMethod(clazz, m);
+                        break;
+                    }
+                    if (m.isVarArgs()
+                            && paramCount > m.getParameterTypes().length - 2)
{
+                        matchingMethod = getMethod(clazz, m);
+                    }
                 }
             }
             if (matchingMethod == null) {



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message