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: Gurkan Erdogdu


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


Reply via email to