Bug 53322 - Odd decapitalization when inferring JavaBean property from setter name for an injection target
Odd decapitalization when inferring JavaBean property from setter name for an...
Status: RESOLVED FIXED
Product: Tomcat 7
Classification: Unclassified
Component: Catalina
7.0.27
PC Windows XP
: P2 normal (vote)
: ---
Assigned To: Tomcat Developers Mailing List
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2012-05-30 01:22 UTC by Konstantin Kolinko
Modified: 2012-05-30 01:42 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.