On Fri, 1 Aug 2025 18:46:53 GMT, ExE Boss <d...@openjdk.org> wrote:

>> Chen Liang has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   Test update advised by volkan
>
> src/java.base/share/classes/jdk/internal/misc/Unsafe.java line 1093:
> 
>> 1091:      * startup.  This should not be used to find fields in non-trusted 
>> code.
>> 1092:      * Use the {@link #objectFieldOffset(Field) Field}-accepting 
>> version for
>> 1093:      * arbitrary fields instead.
> 
> It’s also used to obtain offsets of fields in classes which have their fields 
> filtered from reflection using `Reflection​::registerFieldsToFilter(…)`, such 
> as fields in `java.lang.ClassLoader` or `java.lang.Module`.

I don't think this is ever the intention of 
[JDK-8182487](https://bugs.openjdk.org/browse/JDK-8182487) 
(928ca49c21d7e571e88dd27cf47033bf88d2dc71) - it is a side effect, and you can 
always query the VM for a Field object if you are determined, or 
java.lang.invoke.MemberName can be used to obtain an offset for filtered fields 
too.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25945#discussion_r2248804132

Reply via email to