Summary
Update the description of the JNI Invocation API methods to clarify their function, and to align descriptions and terminology with the JLS, JVMS and java.lang.Runtime
specifications. Fix two behavioural aspects.
Problem
There are some updates pending to the JVMS, JLS, and the specification of java.lang.Runtime in the Java SE API that clarify the JDK shutdown sequence, JVM halt, and program exit. The JNI Specification needs some updates to align with these changes. Mostly these are just non-normative changes to the prose but there are two actual specification changes:
The fact it is an error to detach a thread with active Java frames was only mentioned in the overview section, not in the actual
DetachCurrentThread
specification.We need to make it an error to call
DestroyJavaVM
from an attached thread with active Java frames (as this can't work for the same reason we disallowDetachCurrentThread
). This also requires an implementation change in Hotspot.
Solution
Update the JNI Invocation API specification so that descriptions and terminology are consistent with those of the other specifications: JLS, JVMS, java.lang.Runtime
.
Define JNI_VERSION_20
as the latest JNI version due to the changed API semantics.
Specification
See attached spec-diff or https://cr.openjdk.java.net/~dholmes/8290482/8290482-jni-spec/diff.html
- csr of
-
JDK-8290482 Update JNI Specification of DestroyJavaVM for better alignment with JLS, JVMS, and Java SE API Specifications
-
- Resolved
-