RFR 8212937: Parent class loader may not have a referred ClassLoaderData instance when obtained in Klass::class_in_module_of_loader

Lois Foltan lois.foltan at oracle.com
Wed Oct 24 20:52:45 UTC 2018


On 10/24/2018 3:58 PM, Martin Balao wrote:

> Hi,
>
> Can I have a review for JDK-8212937 [1]?
>
> Webrev.00:
>
>   * http://cr.openjdk.java.net/~mbalao/webrevs/8212937/8212937.webrev.00/
>   * http://cr.openjdk.java.net/~mbalao/webrevs/8212937/8212937.webrev.00.zip
>
> By obtaining the ClassLoaderData instance through a call to
> SystemDictionary::register_loader, we make sure that either an existing
> instance is obtained or a new one created. This same idiom has already been
> used in other places where there are no guarantees that a previous
> ClassLoaderData instance exists for a given class loader. See futher
> information in JDK-8212937 ticket [1].
>
> Thanks,
> Martin.-
>
> --
> [1] - https://bugs.openjdk.java.net/browse/JDK-8212937
Hi Martin,

I agree that the same idiom is used in other places, but there are also 
a couple of occurrences of java_lang_ClassLoader::parent in 
classfile/classLoaderStats.cpp and 
classfile/classLoaderHierarchyDCmd.cpp that do not.  In order to better 
understand, do you have a test case that demonstrates this issue?

Thanks,
Lois


More information about the hotspot-dev mailing list