RFR(M): 8165550: Add class loader names to ClassCastException message

Mandy Chung mandy.chung at oracle.com
Thu Nov 17 20:28:10 UTC 2016


Thanks for adding the test.

2898 const char* SystemDictionary::loader_name(const oop loader) {
2904 const char* SystemDictionary::loader_name(const ClassLoaderData* loader_data) {
  
These functions return the type name of the class loader, right?  Would it be better to rename to loader_type_name to avoid confusion?

1957     oop loader = klass->class_loader();
1959       oopDesc* class_loader_oop = java_lang_ClassLoader::name(loader);
I think you mean this be “loader_name_oop”??

Mandy

> On Nov 17, 2016, at 8:36 AM, Rachel Protacio <rachel.protacio at oracle.com> wrote:
> 
> Last one! http://cr.openjdk.java.net/~rprotacio/8165550.03
>    - Thanks to Lois, I've added a new test case for a custom-named class loader with the unnamed module, and also throw an exception in the test if no CCE is thrown.
>    - Thanks to Mandy and Coleen, I've corrected the part of my code getting the Class Loader Name, which ironically, I was doing incorrectly before.
> 
> Rachel



More information about the hotspot-runtime-dev mailing list