On Thu, 18 Nov 2021 06:43:01 GMT, Kim Barrett <kbarr...@openjdk.org> wrote:
>> Pretty much what it says. The new option controls a static member in >> InstanceKlass that's consulted to determine whether the finalization >> machinery is activated for instances when a class is loaded. A new native >> method is added so that this state can be queried from Java. This is used to >> control whether a finalizer thread is created and to disable the `System` >> and `Runtime::runFinalization` methods. Includes tests for the above. > > src/hotspot/share/prims/jvm.cpp line 694: > >> 692: >> 693: JVM_ENTRY(jboolean, JVM_IsFinalizationEnabled(JNIEnv * env)) >> 694: return InstanceKlass::finalization_enabled() ? JNI_TRUE : JNI_FALSE; > > missing indentation I think this could just be `return InstanceKlass::finalization_enabled();`. There is lots of code in this file and elsewhere that assumes C++ `bool` converts to `jboolean` appropriately. ------------- PR: https://git.openjdk.java.net/jdk/pull/6442