5 Replies Latest reply on Oct 6, 2008 3:05 PM by Ales Justin

    ClassLoader usage in AnnotationCreator::createAnnotation

    Ales Justin Master

      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?