1 Reply Latest reply on Jul 25, 2010 5:34 AM by swd847

    Odd behaviour with weld-extensions on the classpath

    avrecko

      Hi,


      while making a custom extension for Weld/CDI there is something odd when weld-extensions.jar is on the classpath:


      public <T> void processAnotated(@Observes ProcessAnnotatedType<T> event, BeanManager manager) {
         System.out.println("processAnnotated: " + event.getAnnotatedType().getClass());
      



      Sometimes all annotated types are of type AnnotatedTypeImpl while on other runs of the program they are of WeldClassImpl.


      I can't help but think there is something bad lurking in the background.


      If using alpha3 version - when WeldClassImpl is chosen Weld cannot see changes set via event.setAnnotatedType() while if AnnotatedTypeImpl it works. Weld can see changes in the latest build of weld-extensions but still sometimes I see WeldClassImpl other times AnnotatedTypeImpl.


      Just wanted to point this out. Gives me the creeps.


      Cheers
      Alen

        • 1. Re: Odd behaviour with weld-extensions on the classpath
          swd847

          weld-extensions overwriting your changes was a bug in CoreExtension that is fixed in the latest (unreleased) version.


          In general you can't rely on the type being of WeldClassImpl, or any other type. The order that portable extensions receive events is undefined, so what you see will depend on the order that the events get delivered.