Author: markt Date: Tue May 29 13:33:40 2012 New Revision: 1343718 URL: http://svn.apache.org/viewvc?rev=1343718&view=rev Log: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=53180 Add additional checks when looking for a setter method. Patch provided by Violeta Georgieva.
Modified: tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java Modified: tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java?rev=1343718&r1=1343717&r2=1343718&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java (original) +++ tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java Tue May 29 13:33:40 2012 @@ -356,7 +356,10 @@ public class DefaultInstanceManager impl String methodName = method.getName(); if (context != null) { // Resource injection only if JNDI is enabled - if (injections != null && methodName.startsWith("set") && methodName.length() > 3) { + if (injections != null && methodName.startsWith("set") + && methodName.length() > 3 + && method.getParameterTypes().length == 1 + && method.getReturnType().getName().equals("void")) { String fieldName = Character.toLowerCase(methodName.charAt(3)) + methodName.substring(4); if (injections.containsKey(fieldName)) { annotations.add(new AnnotationCacheEntry( --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org