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

Harold David Seigel harold.seigel at oracle.com
Thu Jun 21 20:07:31 UTC 2018

Hi Lois,

The change looks good.  I just have a couple of comments about the tests.

It looks like there are <tab> characters in the c1.jasm and c2.jasm files.

Also, in ExpQualToM1PrivateMethodIAE.java, I think you want "||" not 
"&&" operators here:

      108             if (!message.contains("IllegalAccessError") &&
      109                 !message.contains("tried to access method p2.c2.method2()V from class p1.c1 (p2.c2 is in module m2x of loader myloaders.MySameClassLoader @") &&
      110                 !message.contains("; p1.c1 is in module m1x of loader myloaders.MySameClassLoader @")) {

I don't need a new webrev.

Thanks, Harold

On 6/20/2018 8:34 PM, Lois Foltan wrote:
> 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 
> StackTraceElement 
> (https://docs.oracle.com/javase/9/docs/api/java/lang/StackTraceElement.html#toString--) 
> 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 IllegalAccessErrors.
> 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
> Thanks,
> Lois

More information about the hotspot-dev mailing list