You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by "Quintin Beukes (JIRA)" <ji...@apache.org> on 2009/10/09 17:56:31 UTC

[jira] Created: (OPENEJB-1081) Find most specific setter in ClientInjectionProcessor.findSetter

Find most specific setter in ClientInjectionProcessor.findSetter
----------------------------------------------------------------

                 Key: OPENEJB-1081
                 URL: https://issues.apache.org/jira/browse/OPENEJB-1081
             Project: OpenEJB
          Issue Type: Improvement
            Reporter: Quintin Beukes
            Priority: Trivial
             Fix For: (trunk/openejb3)


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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OPENEJB-1081) Find most specific setter in ClientInjectionProcessor.findSetter

Posted by "Quintin Beukes (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENEJB-1081?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Quintin Beukes updated OPENEJB-1081:
------------------------------------

    Attachment: findSetter.patch

Attached the findSetter patch, as made from the root of the following checkout:
URL: http://svn.apache.org/repos/asf/openejb/trunk/openejb3
Revision: 823520


> Find most specific setter in ClientInjectionProcessor.findSetter
> ----------------------------------------------------------------
>
>                 Key: OPENEJB-1081
>                 URL: https://issues.apache.org/jira/browse/OPENEJB-1081
>             Project: OpenEJB
>          Issue Type: Improvement
>            Reporter: Quintin Beukes
>            Priority: Trivial
>             Fix For: (trunk/openejb3)
>
>         Attachments: findSetter.patch
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.