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

kabir.khan@jboss.com do-not-reply at jboss.com
Mon Oct 6 09:28:57 EDT 2008


I'd rather do

  |       ClassLoader loader;
  |       if (cl != null)
  |       {
  |          loader = cl;         
  |       }
  |       else if (annotation != null)
  |       {
  |          loader = annotation.getClassLoader();
  |       }
  |       if (loader == null)
  |       {
  |          loader = Thread.currentThread().getContextClassLoader();
  |       }
  | 
Since if the annotation class is loaded by the bootstrap classloader, annotation.getClassLoader() might be null.

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

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



More information about the jboss-dev-forums mailing list