Details
-
Improvement
-
Status: Closed
-
Trivial
-
Resolution: Not A Problem
-
None
-
None
-
None
Description
The findSetter method doesn't currently return the most specific
setter. If you were for instance to try inject a String field called
"myString", and you have 2 methods:
void setMyString(Object)
and
void setMyString(String)
OpenEJB would use the first it finds, instead of the most specific.
This path adds the most specific injector functionality. It will prefer the exact class, and if not available prefer the class lowest down (closest to) the property to be injected's class.
So if you were to inject an IllegalArgumentException, the preference would be as follows: IllegalArgumentException, RuntimeException, Exception, Throwable, Serializable, Object, but NumberFormatException won't be chosen.