On Wed, 10 Sep 2025 22:46:00 GMT, Ioi Lam <[email protected]> wrote: >> The purpose of this PR is to simplify JNI code and also to avoid unnecessary >> `InstanceKlass::cast()` calls by adding a new function: >> >> >> static InstanceKlass* java_lang_Class::as_InstanceKlass(oop java_class); >> >> >> This PR is intended to be a strict clean-up that preserves existing >> behaviors. > > Ioi Lam has updated the pull request incrementally with one additional commit > since the last revision: > > Removed the (jobject) version of as_Klass/as_InstanceKlass
I didn't realize that my attempt to remove the `JNIHandles::resolve()` boilerplate can be conversional. I can't put a helper function in jni.cpp because this pattern is used in several files. I've reverted to the old code that makes the explicit calls to `JNIHandles::resolve()`. I updated the JBS issue text as this PR is now only for reducing the number of InstanceKlass::cast() calls. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27158#issuecomment-3276767203
