You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openwebbeans.apache.org by "Mark Struberg (Updated) (JIRA)" <ji...@apache.org> on 2012/04/04 22:00:18 UTC

[jira] [Updated] (OWB-642) Method WebBeansUtil.configureProducerMethodSpecializations is unreliable

     [ https://issues.apache.org/jira/browse/OWB-642?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mark Struberg updated OWB-642:
------------------------------

    Fix Version/s: 1.1.4
    
> Method WebBeansUtil.configureProducerMethodSpecializations is unreliable
> ------------------------------------------------------------------------
>
>                 Key: OWB-642
>                 URL: https://issues.apache.org/jira/browse/OWB-642
>             Project: OpenWebBeans
>          Issue Type: Bug
>          Components: Inheritance, Specialization
>    Affects Versions: 1.1.3
>         Environment: OWB trunk
>            Reporter: Martin Kočí
>            Assignee: Martin Kočí
>             Fix For: 1.1.4
>
>         Attachments: OWB-642-reproducibleTest.patch
>
>
> I have specialized producer method like this:
> @Produces @Specializes @MyConfigValue @Named
> public Boolean getProducerMethod() {....}
> Problem is that @Named is also at parent method -> exception "Specialized method  getProducerMethod may not define @Named annotation"
> but this happens *randomly* once per 10 container starts or so.
> I tracked it down to:
>                         if (superMethod != null && superMethod.equals(pb.getCreatorMethod()))
>                         {
>                             producerBeanListHelper.add(pb);
>                             pLeft = (pb.isSpecializedBean()) ? pb : null;
>                         }
>                         else
>                         {
>                             pLeft = null;
>                         }
> When I comment out the  pLeft = null;  line OWB detect problem with @Named every time
> I guess that there are two or more problems together:
> 1) client problem in my code : @Named at specialized method
> 2) configureProducerMethodSpecializations is based on loop over BeanManagerImpl().getBeans(), which is set  -> random order of ProducerMethodBean procesing
> 3) bug in pLeft/pRight algorithm that clears pLeft with first unsuccessful method match, but pLeft/pRight are used for class equality, not method equality

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira