You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JavaVM::get_env now requires the caller to determine that the JavaVM
supports at least JNI 1.4 since there are two notable difficulties
with trying to check the version internally:
1. There is a chicken and egg problem with trying to use `GetEnv`
to get a `JNIEnv` from a `JavaVM` without knowing that it supports JNI
1.2
2. We require 1.4 as the minimum supported version but can't call
`GetVersion` to validate a returned `JNIEnv` while there may be exceptions
pending (since GetVersion is not in the list of JNI functions that are safe
to call with pending exceptions).
This also documents how `::get_env()` must not be used to materialize
a (mutable) JNIEnv with a lifetime that doesn't correspond to the top JNI
stack frame for local object references.
Ref: #436 (reply in thread)Fixes: #500
HotSpot seems to return the same
JNIEnv
regardless of requested version (as long as that version is supported), but other JVMs could in theory return a differentJNIEnv
depending on which version you ask for.Originally posted by @argv-minus-one in #478 (comment)
The text was updated successfully, but these errors were encountered: