6887853: javadoc for java.lang.Classloader should be more clear
Summary: Updated the relevant javadoc description of java.lang.ClassLoader class w/ additional clarification.
Reviewed-by: mullan
--- a/jdk/src/share/classes/java/lang/ClassLoader.java Tue Oct 12 12:20:44 2010 -0700
+++ b/jdk/src/share/classes/java/lang/ClassLoader.java Tue Oct 12 17:05:28 2010 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1994, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -100,8 +100,11 @@
* themselves at their class initialization time by invoking the
* {@link
* #registerAsParallelCapable <tt>ClassLoader.registerAsParallelCapable</tt>}
- * method. In environments in which the delegation model is not strictly
- * hierarchical, class loaders need to be parallel capable, otherise class
+ * method. Note that the <tt>ClassLoader</tt> class is registered as parallel
+ * capable by default. However, its subclasses still need to register themselves
+ * if they are parallel capable. <br>
+ * In environments in which the delegation model is not strictly
+ * hierarchical, class loaders need to be parallel capable, otherwise class
* loading can lead to deadlocks because the loader lock is held for the
* duration of the class loading process (see {@link #loadClass
* <tt>loadClass</tt>} methods).
@@ -1218,14 +1221,14 @@
private static native Class<? extends ClassLoader> getCaller(int index);
/**
- * Registers the caller class loader as parallel capable.
- * In order for the registration to succeed, all super classes
- * of the caller class loader must also be registered as
- * parallel capable when this method is called. </p>
- * Note that once a class loader is registered as
- * parallel capable, there is no way to change it back.
- * In addition, registration should be done statically before
- * any instance of the caller classloader being constructed. </p>
+ * Registers the caller as parallel capable.</p>
+ * The registration succeeds if and only if all of the following
+ * conditions are met: <br>
+ * 1. no instance of the caller has been created</p>
+ * 2. all of the super classes (except class Object) of the caller are
+ * registered as parallel capable</p>
+ * Note that once a class loader is registered as parallel capable, there
+ * is no way to change it back. </p>
*
* @return true if the caller is successfully registered as
* parallel capable and false if otherwise.