Hey Guys,<br><br>I&#39;m working on an extension that @Observes ProcessAnnotatedType in order to modify the typing information for fields annotated with a specific Annotation.<br><br>When I use BeanManager to later construct an instance of AnnotatedType for that modified class, however, I am not supplied with the modified AnnotatedType instance, I am given a brand new instance that does not include my extension&#39;s prior modifications.<br>
<br>If this is right, then there needs to be some way to retrieve the previously modified data from the BeanManager, otherwise, the information is effectively lost unless the BeanManager is creating a full contextual instance of the class, not merely providing injection.<br>
<br>So this doesn&#39;t seem right to me. Thoughts?<br><br>Example code below.<br>Thanks,<br>Lincoln<br><br>--------------------------------------------------------------------------------------------------------<br>   public &lt;T&gt; void processAnnotatedType(@Observes final ProcessAnnotatedType&lt;T&gt; event)<br>
   {<br>      AnnotatedTypeBuilder&lt;T&gt; builder = AnnotatedTypeBuilder.newInstance(event.getAnnotatedType());<br>      builder.readAnnotationsFromUnderlyingType();<br>      boolean modifiedType = false;<br><br>      for (AnnotatedField&lt;?&gt; f : event.getAnnotatedType().getFields())<br>
      {<br>         if (f.isAnnotationPresent(InputField.class))<br>         {<br>            builder.overrideFieldType(f.getJavaMember(), Object.class);<br>            modifiedType = true;<br>         }<br>      }<br><br>
      if (modifiedType)<br>      {<br>         AnnotatedType&lt;T&gt; replacement = builder.create();<br>         event.setAnnotatedType(replacement);<br>      }<br>   }<br><br><br>Then later... the AnnotatedType created in the method below not reflect changes 
made to the type in the extension above.<br><br>   public void injectNonContextualInstance(final Object instance)<br>   {<br>      if (instance != null)<br>      {<br>         CreationalContext&lt;Object&gt; creationalContext = manager.createCreationalContext(null);<br>
         InjectionTarget&lt;Object&gt; injectionTarget = (InjectionTarget&lt;Object&gt;) manager.createInjectionTarget(beanManager.createAnnotatedType(instance.getClass()));<br>         injectionTarget.inject(instance, creationalContext);<br>
      }<br>   }<br><br><br clear="all"><br>-- <br>Lincoln Baxter, III<br><a href="http://ocpsoft.com">http://ocpsoft.com</a><br><a href="http://scrumshark.com">http://scrumshark.com</a><br>&quot;Keep it Simple&quot;<br>