[ 
https://issues.apache.org/jira/browse/OWB-289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12839861#action_12839861
 ] 

YING WANG commented on OWB-289:
-------------------------------

I would presume the exact being-extended method in the super class, which has:
1. same method name
2. same parameters
3. the same return type (exactly equals or be assignable, I am not sure on 
this. )

The current getClassMethodWithTypes just returns one of the methods which 
satisfy 1 and 2. And I feel that both of our proposed fixes might miss some 
overloaded method scenarios and skip some valid bean from specialization 
configuration. 

Since pb.getCreatorMethod( ) already returns the producer method associated 
with the bean, how about changing the 2 lines to:

                   Method superMethod = pb.getCreatorMethod();
                   if (superMethod.getName().equals(method.getName()) &&
                        
superMethod.getParameterTypes().equals(method.getParameterTypes()) &&
                        
superMethod.getReturnType().equals(method.getReturnType())) 
                   {
                                   producerBeanListHelper.add(pb); 


comments?

> Owb return 2 beans for Indirect specialized producer beans
> ----------------------------------------------------------
>
>                 Key: OWB-289
>                 URL: https://issues.apache.org/jira/browse/OWB-289
>             Project: OpenWebBeans
>          Issue Type: Bug
>          Components: Injection and Lookup
>    Affects Versions: M3
>            Reporter: YING WANG
>            Assignee: Mark Struberg
>            Priority: Minor
>             Fix For: M4
>
>         Attachments: owb289.patch, owb289.test.jar
>
>
> The problem might be similar to 279 managed bean bug. 
> I have "@QualifierSpecialized IPen" bean being generated by 3 producers:
> DefaultPenProducer <-(extends/specialized producer) AdvancedPenProducer 
> <-(extends/specialized producer) PremiumPenProducer 
> While query the bean "@QualifierSpecialized IPen", owb returns both beans 
> generated in AdvancePenProducer and PremiumPenProducer class. (While we 
> expected only bean generated by PremiumPenProducer should be returned)
> configureProducerSpecialization( ) might need some change to disable the 
> override specialized producer bean.
> (testcase/patch will be uploaded later)

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

Reply via email to