JDK-8203456 : ClassLoaderData::loader_name() should show consistent values
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2018-05-20
  • Updated: 2018-05-24
  • Resolved: 2018-05-21
Related Reports
Duplicate :  
Relates :  
Description
If unloading, ClassLoaderData::loader_name() will show loader name if set, otherwise loader class name.

If not unloading, ClassLoaderData::loader_name() will just show the loader class name.

This should be consistent.

Also, I would prefer if we had separate accessors to each thing, so:

ClassloaderData::loader_name() 
  - return cached loader name if unloading, otherwise loader_oop->name

ClassloaderData::loader_class_name() 
  - return cached loader class name if unloading, otherwise loader_oop->klass->name

And then, if even necessary, a compound version of this:
ClassloaderData::loader_name_and_class_name() 
which outputs something like "<name> (instance of <classname>)".
to replace the current existing users of the current loader_name().

The change looks easy but to ensure that no existing caller of ClasslaoderData::loader_name() trips over the changed output may vbe the real problem.







Comments
I think this is a duplicate of this bug, or should be.
20-05-2018