This is an excellent patch.  Thanks Jakob!

We ran into a similar issue discovered by Paul Reder where in
   
org.apache.webbeans.inject.impl.InjectionPointImpl.readObject(ObjectInputStream)

the owner bean filtering
   this.ownerBean = BeanManagerImpl.getManager().getBeans(beanClass,
anns.toArray(new Annotation[0])).iterator().next();

did NOT work.because checkEquality does NOT correctly compare the
owner bean deserialized annotations with the resolvedComponent
qualifiers.

how this patch affects InjectionPointImpl deserialization ...
method hierarchy -->
org.apache.webbeans.util.AnnotationUtil.checkEquality(String, String,
List<String>)
   org.apache.webbeans.util.AnnotationUtil.hasAnnotationMember(Class<?
extends Annotation>, Annotation, Annotation)
       
org.apache.webbeans.container.InjectionResolver.findByQualifier(Set<Bean<?>>,
Annotation...)
          
org.apache.webbeans.container.InjectionResolver.implResolveByType(Type,
Annotation...)
               org.apache.webbeans.container.BeanManagerImpl.getBeans(Type,
Annotation...)

org.apache.webbeans.inject.impl.InjectionPointImpl.readObject(ObjectInputStream)


--Thanks,
Rohit Kelapure

On Tue, Sep 28, 2010 at 5:24 PM, Jakob Korherr (JIRA) <j...@apache.org> wrote:
>
>     [ 
> https://issues.apache.org/jira/browse/OWB-462?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
>  ]
>
> Jakob Korherr updated OWB-462:
> ------------------------------
>
>    Attachment: OWB-462.patch
>
> The patch contains the refactored code and some test cases.
>
>> Refactor AnnotationUtil.hasAnnotationMember()
>> ---------------------------------------------
>>
>>                 Key: OWB-462
>>                 URL: https://issues.apache.org/jira/browse/OWB-462
>>             Project: OpenWebBeans
>>          Issue Type: Task
>>          Components: Core
>>    Affects Versions: 1.0.0-alpha-2
>>            Reporter: Jakob Korherr
>>            Assignee: Gurkan Erdogdu
>>         Attachments: OWB-462.patch
>>
>>
>> We needed a method to compare qualifiers for MyFaces CODI and stumbled upon 
>> AnnotationUtil.hasAnnotationMember().
>> However this method is really messy, because it uses the String 
>> representation of an annotation to compare it and thus fails in various 
>> cases (e.g. when using annotation instances which implement toString() 
>> differently or by using array values in the qualifier). Furthermore it does 
>> not detect @Nonbinding fields correctly, if there is more than one 
>> annotation on the annotation-method.
>> Also it's kinda weird that the method takes the Annotation-Class as an extra 
>> parameter, but it could just get it from one of the Annotation instances. I 
>> checked all usages and found out that this argument can be dropped. In 
>> addition I think it's better to rename the method to isQualifierEqual() - 
>> the usage is just a lot clearer.
>> I implemented a custom solution for MyFaces CODI and I think it should also 
>> be applied here.
>
> --
> 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