RFR: 8327246: Add a jcmd diagnostic command to list the jar files loaded by a process [v2]

David Holmes dholmes at openjdk.org
Tue Jan 13 05:42:18 UTC 2026


On Fri, 9 Jan 2026 17:22:58 GMT, Larry Cable <duke at openjdk.org> wrote:

>> src/hotspot/share/oops/instanceKlass.cpp line 2386:
>> 
>>> 2384:     oop pd = java_lang_Class::protection_domain(k->java_mirror());
>>> 2385: 
>>> 2386:     if (pd != nullptr && (ik = pd->klass()->is_instance_klass() ? InstanceKlass::cast(pd->klass()) : nullptr) != nullptr) {
>> 
>> Is a non-instance-class possible here??
>
> good question, but I think defensive coding is warranted, and this is not a performance sensitive code path IMO,

Here the assertion should replace the runtime check.  The (non-null) protection-domain object has to be an instance of `ProtectionDomain` which is an `InstanceKlass`.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/29048#discussion_r2684901184


More information about the serviceability-dev mailing list