I'm not quite sure how I got into this situation, but somehow I get a null ClassLoader from Thread.getContextClassLoader. After a little reading (there is not much information in the documents or in google) I got the impression that there really is a null class loader for the current thread, and the calls to getContextClassLoader should be checked for a null reference.
This is quite surprising since I saw a couple of open source projects that were not tested on getContextClassLoader (which allowed me to check this first). Specifically, this line in codemodel : line JCodeModel.java 358
(I just checked that log4j doesn't check either)
So, do I need to call getContextClassLoader to check for a null reference, or is something messed up with my threads?
source
share