[jboss-user] [JBoss Microcontainer Development] - AnnotatedElementMetaDataLoader and bridge methods

Kabir Khan do-not-reply at jboss.com
Tue Apr 20 10:43:59 EDT 2010


Kabir Khan [http://community.jboss.org/people/kabir.khan%40jboss.com] replied to the discussion

"AnnotatedElementMetaDataLoader and bridge methods"

To view the discussion, visit: http://community.jboss.org/message/538525#538525

--------------------------------------------------------------
I've made AnnotatedElementMetaDataLoader attempt to find a matching method. If it cannot be found, a null element loader is returned (or maybe I should throw an exception instead?)

Just so I remember in case I need to come back to it, this simple test

public class BridgeMethodTest
{
   static class BaseGenerics<T>
   {
      T getThing(T t)
      {
         return t;
      }
   }

   static class ChildGenerics extends BaseGenerics<String>
   {
      String getThing(String s)
      {
         return s;
      }
   }

   public static void main(String[] args)
   {
      for (Method m : ChildGenerics.class.getDeclaredMethods())
         System.out.println(m + " - " + m.isBridge());
   }
}




gives

java.lang.String org.jboss.test.benchmark.BridgeMethodTest$ChildGenerics.getThing(java.lang.String) - false
java.lang.Object org.jboss.test.benchmark.BridgeMethodTest$ChildGenerics.getThing(java.lang.Object) - true

 

--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/538525#538525]

Start a new discussion in JBoss Microcontainer Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2115]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100420/46684aff/attachment.html 


More information about the jboss-user mailing list