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

Specialized bean gets @Default qualifier even if the parent class already has a different qualifier

    Details

      Description

      I have the following code. Please note that @Microservice annotation is my own extension to weld-se. It is recognized as a CDI bean.

         public interface SpecializationMicro {
            String hello();
         }
      
         @Sharp
         @Microservice
         public static class SpecializationMicroBean implements SpecializationMicro {
      
            @Override
            public String hello() {
               return "normal";
            }
         }
      
         @Specializes
         public static class MockSpecializationMicroBean extends SpecializationMicroBean {
      
            @Override
            public String hello() {
               return "special";
            }
         }
      
         @Qualifier
         @Target({ ElementType.TYPE, ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER })
         @Retention(RetentionPolicy.RUNTIME)
         public @interface Sharp {
         }
      
      @Retention(RetentionPolicy.RUNTIME)
      @Documented
      @Inherited
      @Named
      @MicroserviceScoped
      @Stereotype
      @Target(ElementType.TYPE)
      public @interface Microservice {
         String value() default "";
      }
      

      When I delete MockSpecializationMicroBean, the original bean SpecializationMicroBean is registered with qualifiers @Sharp and @Any.
      However, the MockSpecializationMicroBean is registered with qualifiers @Sharp @Default and @Any. I believe the @Default qualifier whould not be there.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                mkouba Martin Kouba
                Reporter:
                mvecera Martin Vecera
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: