[jboss-dev-forums] [Design the new POJO MicroContainer] - ClassLoader usage in AnnotationCreator::createAnnotation

alesj do-not-reply at jboss.com
Mon Oct 6 09:04:02 EDT 2008


While fixing JBMDR-45, I saw this usage (MDR / AnnotationCreator):

  |    public static Object createAnnotation(ASTAnnotation node, Class<?> annotation, ClassLoader cl) throws Exception
  |    {
  |       HashMap<String, Object> map = new HashMap<String, Object>();
  |       ClassLoader loader = (cl != null) ? cl : Thread.currentThread().getContextClassLoader();
  |       if (annotation == null)
  |       {
  |          annotation = loader.loadClass(node.getIdentifier());
  |       }
  | 

My question is, why don't we rather take loader from annotation class if it's not null, then use TCCL?


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

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



More information about the jboss-dev-forums mailing list