- 😌 Relaxed some lifetime restrictions in JNIEnv to support the case when method, field ids; and global references to classes have a different (larger) lifetime than JNIEnv (#209)
- 📚 Various documentation improvements.
0.13 brings major improvements in thread management, allowing to attach the native threads
permanently and safely;
Executorfor extra convenience and safety; and other
👌 improvements and fixes.
📚 ⚠️ If your code attaches native threads — make sure to check the updated documentation
📄 of JavaVM to learn about the new features!
JavaVM::attach_current_thread_permanentlymethod, which attaches the current
thread and detaches it when the thread finishes. Daemon threads attached
JavaVM::attach_current_thread_as_daemonalso automatically detach themselves
when finished. The number of currently attached threads may be acquired using
JavaVM::threads_attachedmethod. (#179, #180)
Executor— a simple thread attachment manager which helps to safely
🆓 execute a closure in attached thread context and to automatically free
created local references at closure exit. (#186)
- 0️⃣ The default JNI API version in
InitArgsBuilderfrom V1 to V8. (#178)
- Extended the lifetimes of
AutoLocalto make it more flexible. (#190)
- 0️⃣ Default exception type from checked
👻 It is used implicitly when
JNIEnv#throwis invoked with exception message:
env.throw("Exception message"); however, for efficiency reasons, it is recommended
to specify the exception type explicitly and use
env.throw_new(exception_type, "Exception message"). (#194)
🚀 This release does not bring code changes.
- 📚 Updated project documentation.
JavaStrand their respective iterators now require an extra lifetime so that they can now work with
&'b JNIEnv<'a>, where
🚀 This release brings various improvements and fixes, outlined below. The most notable changes are:
- 🍱 ⚠️
nullis no longer represented as an
Errwith error kind
NullPtrif it is a value of some
nullable Java reference (not an indication of an error). Related issues: #136, #148, #163.
unsafemethods, providing a low-level API similar to JNI, has been marked safe and renamed
_uncheckedsuffix. 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.
- 🏁 Invocation API support on Windows and AppVeyor CI (#149)
push_local_framewill now work in case of pending exceptions — as
the spec requires; and fail in case of allocation errors
release_string_utf_charswon't print incorrect
🌲 log messages
👀 Rename some macros to better express their intent (see #123):
jni_non_null_callas it checks the return value
to be non-null.
jni_non_null_call(which may return nulls) to
A lot of public methods of
JNIEnvhave been marked as safe, all unsafe code
🛠 has been isolated inside internal macros. Methods with
🛠 been renamed and now have
from_strmethod of the
JavaTypehas been replaced by the
🔀 Implemented Sync for GlobalRef (#102).
👌 Improvements in macro usage for JNI methods calls (#136):
👍 allowed to return NULL object
- Added checking for pending exception to the
⚠ 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).
- The issue with early detaching of a thread by nested AttachGuard. (#139)
- 🍱 ⚠️
JavaVM#get_java_vm_pointerto retrieve a JavaVM pointer (#98)
- This changelog and other project documents (#106)
- 🚚 The project is moved to an organization (#104)
- ⚡️ Updated versions of dependencies (#105)
- 👌 Improved project documents (#107)
- Crate type of a shared library with native methods
- 🚀 No changes has been made to the Changelog until this release.
🚀 [Unreleased]: https://github.com/jni-rs/jni-rs/compare/v0.14.0...HEAD