This content has been marked as final.
Show 5 replies
-
1. Re: ClassLoader usage in AnnotationCreator::createAnnotation
kabirkhan Oct 6, 2008 9:05 AM (in response to alesj)Good point, let's go with that
-
2. Re: ClassLoader usage in AnnotationCreator::createAnnotation
alesj Oct 6, 2008 9:06 AM (in response to alesj)"alesj" wrote:
My question is, why don't we rather take loader from annotation class if it's not null, then use TCCL?ClassLoader loader; if (cl != null) { loader = cl; } else if (annotation != null) { loader = annotation.getClassLoader(); } else { loader = Thread.currentThread().getContextClassLoader(); }
-
3. Re: ClassLoader usage in AnnotationCreator::createAnnotation
kabirkhan Oct 6, 2008 9:28 AM (in response to alesj)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. -
4. Re: ClassLoader usage in AnnotationCreator::createAnnotation
adrian.brock Oct 6, 2008 11:10 AM (in response to alesj)I'd rather throw an error if there is no classloader provided.
Using the annotation's classloader fails if you have something like:@JMX(interface=some.thing.from.an.Application.class)
-
5. Re: ClassLoader usage in AnnotationCreator::createAnnotation
alesj Oct 6, 2008 3:05 PM (in response to alesj)I'll leave it as it was and add a WARN log.
I don't wanna break all sorts of things just before we go 2.0.0.GA.
If it eventually proves that we don't get any warnings,
I'll change it for 2.0.0.GA - throwing an exception.
Sounds reasonable?