Uploaded image for project: 'Weld'
  1. Weld
  2. WELD-2420

Qualifiers with binding members should have toString() methods that show the member values

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Won't Do
    • Major
    • None
    • 2.4.3.Final
    • Resolution
    • None

    Description

      If one is using qualifiers that make use of binding members, a resolution error message like the following fails to adequately describe which qualifiers are involved:

      Caused by: org.jboss.weld.exceptions.AmbiguousResolutionException: WELD-001318: Cannot resolve an ambiguous dependency between:

      • Producer Method [Optional] with qualifiers [@Claim @Claim @Claim] declared as [[UnbackedAnnotatedMethod] @Claim @Dependent @Produces org.eclipse.microprofile.jwt.wfswarm.cdi.CustomClaimProducer.genericOptionalClaimProducer(InjectionPoint)],
      • Producer Method [Object] with qualifiers [@Claim @Claim @Claim] declared as [[UnbackedAnnotatedMethod] @Claim @Dependent @Produces org.eclipse.microprofile.jwt.wfswarm.cdi.CustomClaimProducer.genericClaimProducer(InjectionPoint)]

      where Claim is:

      @Qualifier
      @Retention(RetentionPolicy.RUNTIME)
      @Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER})
      public @interface Claim {
          /**
           * The value specifies the id name the claim to inject
           * @return the claim name
           * @see JsonWebToken#getClaim(String)
           */
          String value() default "";
      
          /**
           * An alternate way of specifying a claim name using the {@linkplain Claims}
           * enum
           * @return the claim enum
           */
          Claims standard() default Claims.UNKNOWN;
      
      }
      

      In general, it would be good if the messages involving qualifiers that have binding members would print out the binding members to help with identifying the context that is involved.

      Attachments

        Activity

          People

            Unassigned Unassigned
            starksm64 Scott Stark (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: