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

Coleen Phillimore coleen.phillimore at oracle.com
Thu Nov 17 21:46:56 UTC 2016


I noticed something small from this code review:

This should be oop, not oopDesc*.  We don't use this type like this 
except coming into the runtime code from Java.

+ oopDesc* class_loader_oop = java_lang_ClassLoader::name(loader);

In the context that class loaders now have names, a new name for 
loader_name() function makes sense, but not for now.

Can you fix oopDesc* before committing?


On 11/17/16 3:28 PM, Mandy Chung wrote:
> 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