On 04/10/12 09:14, David Holmes wrote:
...
The point is that returning null in itself has no direct significance.
I am not sure i agree. The TCCL can be set to null and that has
significance as per the JavaDoc:
* @param cl
* the context ClassLoader for this Thread, or null
indicating the
* system class loader (or, failing that, the bootstrap
class loader)
*
* @throws SecurityException
* if the current thread cannot set the context ClassLoader
*
* @since 1.2
*/
public void setContextClassLoader(ClassLoader cl) {
Sorry but that is just the dual incorrect statement of what is in
getContextClassLoader. It is not a meaningful description, in fact it is
incorrect because null only ever means the bootstrap loader, never the
system class loader - and the null can't mean two different things. And
what is "or failing that" supposed to mean?
These parts of the javadoc for get/setContextClassLoader are simply wrong.
They should be non-normative statements in the method description to
give general guidance as to the interpretation of null.
I can file a new bug for this.
-Chris.
David
-----
Paul.
The issue here is how ServiceLoader should attempt to load something
if there is no CCL set for the thread.