From: kkolinko Date: Wed, 21 Sep 2011 15:35:47 +0000 (+0000) Subject: Followup to r1173630 X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=1ff8740b1fe85d2abd355c39f1540510731acdb2;p=tomcat7.0 Followup to r1173630 Simplify code: methodName can be tested once per iteration git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1173722 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/javax/el/BeanELResolver.java b/java/javax/el/BeanELResolver.java index dca216f44..307ba620e 100644 --- a/java/javax/el/BeanELResolver.java +++ b/java/javax/el/BeanELResolver.java @@ -414,15 +414,16 @@ public class BeanELResolver extends ELResolver { } 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) {