[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: MDR doesn't work on annotated privates

wolfc do-not-reply at jboss.com
Fri Aug 15 07:06:50 EDT 2008


"adrian at jboss.org" wrote : How's it supposed to know whether addAnnotation(Method, Annotation)
  | should be a MethodSignature or DeclaredMethodSignature?
That's always a declared method, because else you won't be able to follow the Java rules for annotations on methods.
"adrian at jboss.org" wrote : A general metadata loader (in this case the memory loader for storing the xml) 
  | doesn't even know what the class is so it can't even search to see whether
  | it is a private Method that is masked by a different method in that class or one
  | of its super classes.
      <session>
  |          <ejb-name>SameMethodNameBean</ejb-name>
  |          <post-construct>
  |             <lifecycle-callback-class>SameMethodNameSuper</lifecycle-callback-class>
  |             <lifecycle-callback-method>postConstructInSuper</lifecycle-callback-method>
  |          </post-construct>
  |       </session>
I can see that this should translate to a DeclaredMethodSignature, while
      <session>
  |          <ejb-name>SameMethodNameBean</ejb-name>
  |          <post-construct>
  |             <lifecycle-callback-method>postConstructInSuper</lifecycle-callback-method>
  |          </post-construct>
  |       </session>
this could be a MethodSignature.

It's just that somewhere the overloading rules for methods must be obeyed, so that in the second xml SameMethodNameSuper.postConstructInSuper doesn't get the PostConstruct annotation.

Right now MethodSignature semantics is horribly broken as AnnotatedElementLoaderNotPublicUnitTestCase.testSameName shows.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4170725#4170725

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4170725



More information about the jboss-dev-forums mailing list