You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomee.apache.org by David Blevins <da...@visi.com> on 2009/09/29 03:00:10 UTC

Re: OpenEJB Injection's findSetter Method

On Sep 28, 2009, at 3:37 AM, Quintin Beukes wrote:

> Hey,
>
> Re the class ./server/openejb-client/src/main/java/org/apache/ 
> openejb/client/ClientInjectionProcessor.java
> and method public Method findSetter(Class typeClass, String
> propertyName, Object propertyValue);
>
> I have 2 questions.
> 1. In which cases would the following match:
> (Modifier.isAbstract(method.getModifiers()))
> I would think it's never necessary to inject into an Abstract class,
> as you can't get a container created instance? or does it so happen
> that you inject into static variables of an non-instantiated abstract
> class?

That code actually skips abstract methods.

> 2. 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.
>
> I used this code in the junit-runner and modified it to find the more
> specific setter.

Cool.  If you can send that in patch form for the  
ClientInjectionProcessor I'll be a lot easier to get the change in.

-David