Bug 53322

Summary: Odd decapitalization when inferring JavaBean property from setter name for an injection target
Product: Tomcat 7 Reporter: Konstantin Kolinko <knst.kolinko>
Component: CatalinaAssignee: Tomcat Developers Mailing List <dev>
Severity: normal    
Priority: P2    
Version: 7.0.27   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   

Description Konstantin Kolinko 2012-05-30 01:22:25 UTC
There is code in DefaultInstanceManager class that converts a setter method name into JavaBean property name.

The code is wrong: it removes "set" prefix and then converts the first character into lowercase. That is a wrong way to get JavaBeans property name.

The correct way would be to follow JavaBeans specification 1.01 ch.8.8 [1] and use java.beans.Introspector#decapitalize(String) method.

E.g. for method setURL(..) the correct property name would be "URL", not "uRL".

[1] http://www.oracle.com/technetwork/java/javase/documentation/spec-136004.html
Comment 1 Konstantin Kolinko 2012-05-30 01:24:50 UTC
Corrected Summary. There are several places in the code where this conversion is used.
Comment 2 Konstantin Kolinko 2012-05-30 01:42:44 UTC
Fixed in trunk and 7.0 by r1344068 and r1344071 and will be in 7.0.28.