RFR (M) JDK-8169559: Add class loader names to relevant VM messages

Lois Foltan lois.foltan at oracle.com
Thu Jun 21 00:34:20 UTC 2018

Please review this change to introduce a new utility method 
Klass::class_in_module_of_loader() to uniformly provide a way to add a 
class' module name and class loader's name_and_id to error messages and 
potentially logging.

The primary focus of this change was to remove the former method 
Klass::class_loader_and_module_name() and change any error messages 
currently using that functionality since it followed the 
format which is intended for stack traces not for use within error 
messages.  This change also includes a change to one IllegalAccessError 
message to demonstrate how an IAE would be formatted with the additional 
module and class loader information. This may conflict with the current 
review of JDK-8199940: Print more information about class loaders in 

open webrev at http://cr.openjdk.java.net/~lfoltan/bug_jdk8169559/webrev/
bug link at https://bugs.openjdk.java.net/browse/JDK-8169559

JDK-8166633 outlines a new proposal where error messages follow a format 
of ERRROR: PROBLEM (REASON) where the PROBLEM is aggressively simple 
(and definitely avoids arbitrary-length loader names) so the REASON 
bears all the cost of explaining the PROBLEM with more specifics.  See 
the proposal in more detail at 
https://bugs.openjdk.java.net/browse/JDK-8166633. The new utility method 
Klass::class_in_module_of_loader() implements the proposed format.

Testing: hs-tier(1-2), jdk-tier(1-2) complete
                hs-tier(3-5) in progress
                JCK vm, lang in progress


More information about the hotspot-dev mailing list