On Tue, 8 Sep 2026 23:06:42 GMT, Serguei Spitsyn <[email protected]> wrote:

> The same should apply to the JVMTI [Follow 
> References](https://docs.oracle.com/en/java/javase/25/docs/specs/jvmti.html#FollowReferences).
>  It has to report the references from ClassLoader to its loaded classes. It 
> is better to report the same way as it was before. The removed 
> ClassLoader.classes is just an implementation detail. It was used because it 
> was convenient to use.

This contradicts the FollowReferences spec which explicitly says "This function 
reports a Java programming language view of object references, not a virtual 
machine implementation view."  If there is no Java programming language 
reference (ie: Classloader.classes is removed), then we should not report such 
references.  

> The removed ClassLoader.classes is just an implementation detail.

Exactly.  If there was an expectation for a Classloader->Class mapping, then 
why isn't there an appropriate `JVMTI_HEAP_REFERENCE_XXXXX` type that we can 
use here?

If we're going to require a synthetic connection, then we should create a new 
`JVMTI_HEAP_REFERENCE_CLASS_LOADER_CLASS` type to manage the Classloader->Class 
mapping.  Otherwise, we're just specing our implementation

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

PR Comment: https://git.openjdk.org/jdk/pull/32519#issuecomment-5593352659

Reply via email to