jni-rs v0.11.0 Release Notes
Release Date: 2019-02-21 // about 5 years ago-
Highlights
๐ This release brings various improvements and fixes, outlined below. The most notable changes are:
- ๐ฑ โ ๏ธ
null
is no longer represented as anErr
with error kindNullPtr
if it is a value of some
nullable Java reference (not an indication of an error). Related issues: #136, #148, #163. unsafe
methods, providing a low-level API similar to JNI, has been marked safe and renamed
to have_unchecked
suffix. Such methods can be used to implement caching of class references
๐ and method IDs to improve performance in loops and frequently called Java callbacks.
๐ If you have such, check out the docs and one of early usages
of this feature.
โ Added
- ๐ Invocation API support on Windows and AppVeyor CI (#149)
๐ Changed
push_local_frame
,delete_global_ref
andrelease_string_utf_chars
๐ป no longer check for exceptions as they are safe
๐ป to call if there is a pending exception (#124):push_local_frame
will now work in case of pending exceptions โ as
the spec requires; and fail in case of allocation errorsdelete_global_ref
andrelease_string_utf_chars
won't print incorrect
๐ฒ log messages
๐ Rename some macros to better express their intent (see #123):
- Rename
jni_call
tojni_non_null_call
as it checks the return value
to be non-null.
- Rename
jni_non_null_call
(which may return nulls) tojni_non_void_call
.A lot of public methods of
JNIEnv
have been marked as safe, all unsafe code
๐ has been isolated inside internal macros. Methods with_unsafe
suffixes have
๐ been renamed and now have_unchecked
suffixes (#140)from_str
method of theJavaType
has been replaced by theFromStr
implementation๐ Implemented Sync for GlobalRef (#102).
๐ Improvements in macro usage for JNI methods calls (#136):
call_static_method_unchecked
andget_static_field_unchecked
methods are
๐ allowed to return NULL object- Added checking for pending exception to the
call_static_method_unchecked
โ method (eliminated WARNING messages in log)
Further improvements in macro usage for JNI method calls (#150):
- The new_global_ref() and new_local_ref() functions are allowed to work with NULL objects according to specification.
- Fixed the family of functions new_direct_byte_buffer(), get_direct_buffer_address() and get_direct_buffer_capacity()
by adding checking for null and error codes.
- Increased tests coverage for JNIEnv functions.
๐ฏ Implemented Clone for JNIEnv (#147).
The get_superclass(), get_field_unchecked() and get_object_array_element() are allowed to return NULL object according
to the specification (#163).๐ Fixed
- The issue with early detaching of a thread by nested AttachGuard. (#139)
- ๐ฑ โ ๏ธ