Uploaded image for project: 'OpenWebBeans'
  1. OpenWebBeans
  2. OWB-462

Refactor AnnotationUtil.hasAnnotationMember()

    XMLWordPrintableJSON

Details

    • Task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0.0-alpha-2
    • 1.0.0
    • Core
    • None

    Description

      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.

      Attachments

        1. OWB-462.patch
          40 kB
          Jakob Korherr

        Activity

          People

            gerdogdu Gurkan Erdogdu
            jakobkorherr Jakob Korherr
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: