Request Review: JDK-6479237 (cl) Add support for classloader names

Paul Sandoz paul.sandoz at oracle.com
Wed Oct 26 23:08:11 UTC 2016


Hi,

Looks ok, just some doc suggestions below.

Paul.

ClassLoader

 366      * @param  name
 367      *         Class loader name; can be {@code null}

StackTraceElement

 100      * @param classLoaderName the class loader name if the class loader of
 101      *        the class containing the execution point represented by
 102      *        the stack trace is named; can be {@code null}

URLClassLoader

 214      * @param  name class loader name; can be {@code null}

 245      * @param  name class loader name; can be {@code null}

SecureClassLoader

 118      * @param name class loader name; can be {@code null}.

"; otherwise {@code null} if the class loader is not named.”

?


StackTraceElement

 206      * @return the name of the class loader of the class containing the execution
 207      *         point represented by this stack trace element; {@code null}
 208      *         if the class loader name is not available.

“{@code null} if the class loader is not named.”


 271      *   built-in class loader</a>, or it does not have a name, then

“… or is not named…"


> On 25 Oct 2016, at 16:10, Mandy Chung <mandy.chung at oracle.com> wrote:
> 
> Webrev at:
>   http://cr.openjdk.java.net/~mchung/jdk9/webrevs/6479237/webrev.00/
> 
> Specdiff:
>   http://cr.openjdk.java.net/~mchung/jdk9/webrevs/6479237/specdiff/overview-summary.html
> 
> This is a long-standing RFE for adding support for class
> loader names.  It's #ClassLoaderNames on JSR 376 issue
> list where the proposal [1] has been implemented in jake
> for some time.  This patch brings this change to jdk9.
> 
> A short summary:
> - New constructors are added in ClassLoader, SecureClassLoader
>  and URLClassLoader to specify the class loader name.
> 
> - New ClassLoader::getName and StackTraceElement::getClassLoaderName
>  method
> 
> - StackTraceElement::toString is updated to include the name
>  of the class loader and module of that frame in this format:
>     <loader>/<module>/<fully-qualified-name>(<src>:<line>)
> 
> The detail is in StackTraceElement::buildLoaderModuleClassName
> that compress the output string for cases when the loader
> has no name or the module is unnamed module.  Another thing
> to mention is that VM sets the Class object when filling in
> a stack trace of a Throwable object.  Then the library will
> build a String from the Class object for serialization purpose.
> 
> Mandy
> [1] http://mail.openjdk.java.net/pipermail/jpms-spec-observers/2016-September/000550.html



More information about the hotspot-runtime-dev mailing list