提交 6a632e54 编写于 作者: V valeriep

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
上级 35899836
/* /*
* 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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -100,8 +100,11 @@ import sun.security.util.SecurityConstants; ...@@ -100,8 +100,11 @@ import sun.security.util.SecurityConstants;
* themselves at their class initialization time by invoking the * themselves at their class initialization time by invoking the
* {@link * {@link
* #registerAsParallelCapable <tt>ClassLoader.registerAsParallelCapable</tt>} * #registerAsParallelCapable <tt>ClassLoader.registerAsParallelCapable</tt>}
* method. In environments in which the delegation model is not strictly * method. Note that the <tt>ClassLoader</tt> class is registered as parallel
* hierarchical, class loaders need to be parallel capable, otherise class * 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 * loading can lead to deadlocks because the loader lock is held for the
* duration of the class loading process (see {@link #loadClass * duration of the class loading process (see {@link #loadClass
* <tt>loadClass</tt>} methods). * <tt>loadClass</tt>} methods).
...@@ -1218,14 +1221,14 @@ public abstract class ClassLoader { ...@@ -1218,14 +1221,14 @@ public abstract class ClassLoader {
private static native Class<? extends ClassLoader> getCaller(int index); private static native Class<? extends ClassLoader> getCaller(int index);
/** /**
* Registers the caller class loader as parallel capable. * Registers the caller as parallel capable.</p>
* In order for the registration to succeed, all super classes * The registration succeeds if and only if all of the following
* of the caller class loader must also be registered as * conditions are met: <br>
* parallel capable when this method is called. </p> * 1. no instance of the caller has been created</p>
* Note that once a class loader is registered as * 2. all of the super classes (except class Object) of the caller are
* parallel capable, there is no way to change it back. * registered as parallel capable</p>
* In addition, registration should be done statically before * Note that once a class loader is registered as parallel capable, there
* any instance of the caller classloader being constructed. </p> * is no way to change it back. </p>
* *
* @return true if the caller is successfully registered as * @return true if the caller is successfully registered as
* parallel capable and false if otherwise. * parallel capable and false if otherwise.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册