On Tue, 16 Nov 2021 02:45:13 GMT, Leonid Mesnik <lmes...@openjdk.org> wrote:

>> The nsk.share.jdi.TestClass1 is used via reflection. The reflective call 
>> creates MethodHandle and one more reference to TestClass1.  So the number of 
>> expected references should be incremented.  Thanks to @plummercj and 
>> @mlchung for the investigation.
>> This fix also prints references to inspected class.
>
> Leonid Mesnik has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   updated

I think the test calls `Class::newInstance` to create an instance of 
`TestClass1`.

The old implementation has one reference from `Constructor::clazz` field to 
`TestClass1`.  The new implementation should have 2 new references: 
`MethodHandle::member` whose `MemberName::clazz` field references it and 
`MethodHandle::type` as the signature is `()TestClass1`.   I would expect 2 
additional references but not 1. 

@lmesnik does the debugger show MemberName::clazz?

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

PR: https://git.openjdk.java.net/jdk/pull/6402

Reply via email to