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

Daniel Fuchs daniel.fuchs at oracle.com
Fri Nov 11 11:13:38 UTC 2016


Hi,

On 10/11/16 23:24, David Holmes wrote:
> Hi Rachel,
>
> On 11/11/2016 8:31 AM, Rachel Protacio wrote:
>> Ah yes, my apologies - I should have provided more context. This is the
>> VM corollary of Mandy's change
>> http://hg.openjdk.java.net/jdk9/dev/hotspot/rev/48fce55afe71 which
>> implements the new classloader name scheme and uses it in Stack Traces.
>> In the fullest instance, it could look like
>>     MyClassLoader/module1 at 9.0/package1.class1
>> The class loader is not listed if it is built-in, the module is not
>> listed if it is unnamed, the version is not listed if it is a "non-jdk"
>> module.
>
> Ah I see. Though not at all clear why we would care about showing the
> JDK module version ??

Mandy will correct me if I'm wrong, but AFAIU, for JDK modules,
the version is displayed only if the module is an upgradeable
module. The relevant algorithm [1] that does that can be seen in
StackTraceElement::toLoaderModuleClassName(Class<?>):


[1] 
http://hg.openjdk.java.net/jdk9/dev/jdk/file/5b6b8e24a20b/src/java.base/share/classes/java/lang/StackTraceElement.java#l414

best regards,

-- daniel




More information about the hotspot-runtime-dev mailing list