Bug 53180 - DefaultInstanceManager#populateAnnotationsCache - incomplete check is used when validating for a setter method
Summary: DefaultInstanceManager#populateAnnotationsCache - incomplete check is used wh...
Alias: None
Product: Tomcat 7
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 7.0.27
Hardware: All All
: P2 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
Depends on:
Reported: 2012-05-02 20:27 UTC by Violeta Georgieva
Modified: 2012-05-29 20:20 UTC (History)
0 users

Patch proposal (1.09 KB, patch)
2012-05-02 20:27 UTC, Violeta Georgieva
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Violeta Georgieva 2012-05-02 20:27:25 UTC
Created attachment 28711 [details]
Patch proposal


In org.apache.catalina.core.DefaultInstanceManager#populateAnnotationsCache, when iterating over methods in a given class, in one of the cases (when injection-target is specified) you validate whether the method is a valid setter method. In my opinion the check that is used for that validation is not complete.
I would like to propose a patch (attached) that introduces additional checks in order to guarantee that the corresponding method is really suitable to be an injection target.

I'm looking forward to your commends.

Best Regards
Violeta Georgieva
Comment 1 Mark Thomas 2012-05-29 13:38:25 UTC
Patch looks good to me. Applied to trunk and 7.0.x and will be included in 7.0.28 onwards.
Comment 2 Violeta Georgieva 2012-05-29 20:20:39 UTC