On Tue, 23 Sep 2025 15:48:43 GMT, Alan Bateman <[email protected]> wrote:

>> src/hotspot/share/prims/jni.cpp line 1873:
>> 
>>> 1871:   if (log_is_enabled(Debug, jni)) {
>>> 1872:     fieldDescriptor fd;
>>> 1873:     bool found = 
>>> InstanceKlass::cast(klass)->find_field_from_offset(offset, true, &fd);
>> 
>> If you are assuming/expecting an `InstanceKlass` then that should be the 
>> type of the parameter. (The existing code needs a cleanup in this area too 
>> but that is outside the scope of this PR.)
>
> Okay, but it will mean a cast in the jni_SetXXField callers, I don't think we 
> avoid that before more changes to the existing code.

Yes there has to be a cast somewhere - but only instance classes can have 
fields so this is a top-level thing.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25115#discussion_r2373549329

Reply via email to