All Versions
18
Latest Version
Avg Release Cycle
102 days
Latest Release
883 days ago

Changelog History
Page 1

  • v0.20.0 Changes

    October 17, 2022

    โž• Added

    • 0๏ธโƒฃ Default trait implemented for JObject, JString, JClass, and JByteBuffer (#199)
    • ๐Ÿš€ Debug trait implemented for JavaVM, GlobalRef, GlobalRefGuard, JStaticMethodID and ReleaseMode (#345)
    • ReturnType for specifying object return types without a String allocation. (#329)

    ๐Ÿ”„ Changed

    • The release_string_utf_chars function has been marked as unsafe. (#334)
    • Mark JNIEnv::new_direct_byte_buffer as unsafe (#320)
    • JNIEnv::new_direct_byte_buffer now takes a raw pointer and size instead of a slice (#351 and #364)
    • JNIEnv::direct_buffer_address returns a raw pointer instead of a slice (#364)
    • The lifetime of AutoArray is no longer tied to the lifetime of a particular JNIEnv reference. (#302)
    • Relaxed lifetime restrictions on JNIEnv::new_local_ref. Now it can be used to create a local reference from a global reference. (#301 / #319)
    • ๐Ÿ”€ JMethodID and JStaticMethodID implement Send + Sync and no longer has a lifetime parameter, making method IDs cacheable (with a documented 'Safety' note about ensuring they remain valid). (#346)
    • ๐Ÿ”€ JFieldID and JStaticFieldID implement Send + Sync and no longer has a lifetime parameter, making field IDs cacheable (with a documented 'Safety' note about ensuring they remain valid). (#346)
    • The call_*_method_unchecked functions now take jni:sys::jvalue arguments to avoid allocating a Vec on each call to map + collect JValues as sys:jvalues (#329)
    • ๐Ÿ‘ท The From trait implementations converting jni_sys types like jobject to JObject have been replaced with unsafe ::from_raw functions and corresponding ::into_raw methods. Existing ::into_inner APIs were renamed ::into_raw for symmetry. (#197)
    • The APIs JNIEnv::set_rust_field, JNIEnv::get_rust_field and JNIEnv::take_rust_field have been marked as unsafe (#219)
  • v0.19.0 Changes

    January 24, 2021

    โž• Added

    • AutoArray and generic get_array_elements(), along with get_<type>_array_elements helpers. (#287)
    • size() method to AutoArray and AutoPrimitiveArray. (#278 / #287)
    • discard() method to AutoArray and AutoPrimitiveArray. (#275 / #287)

    ๐Ÿ”„ Changed

    • โœ‚ Removed AutoPrimitiveArray::commit(). (#290)
    • AutoByte/PrimitiveArray.commit() now returns Result. (#275)
    • Removed methods get/release/commit_byte/primitive_array_{elements|critical}. (#281)
    • Renamed methods get_auto_byte/long/primitive_array_{elements|critical} to get_byte/long/primitive_array_{elements|critical}. (#281)
  • v0.18.0 Changes

    September 23, 2020

    โž• Added

    • JNIEnv#define_unnamed_class function that allows loading a class without
      specifying its name. The name is inferred from the class data. (#246)
    • SetStatic<type>Field. (#248)
    • TryFrom<JValue> for types inside JValue variants (#264).
    • Implemented Copy for JNIEnv (#255).
    • repr(transparent) attribute to JavaVM struct (#259)

    ๐Ÿ”„ Changed

    • ๐Ÿฑ โš ๏ธ Switch from error-chain to thiserror, making all errors Send. Also, support all JNI errors
      in the jni_error_code_to_result function and add more information to the InvalidArgList
      error. (#242)
  • v0.17.0 Changes

    June 30, 2020

    โž• Added

    • ๐Ÿš‘ Get/ReleaseByteArrayElements, and Get/ReleasePrimitiveArrayCritical. (#237)
  • v0.16.0 Changes

    February 28, 2020

    ๐Ÿ›  Fixed

    • ๐ŸŽ Java VM instantiation with some MacOS configurations. (#220, #229, #230).
  • v0.15.0 Changes

    February 28, 2020

    โž• Added

    • ๐Ÿ‘ท Ability to pass object wrappers that are convertible to JObject as arguments to the majority of JNIEnv methods without explicit conversion. (#213)
    • JNIEnv#is_same_object implementation. (#213)
    • JNIEnv#register_native_methods. (#214)
    • ๐Ÿ‘ท Conversion from Into<JObject> to JValue::Object.

    ๐Ÿ›  Fixed

    • Passing null as class loader to define_class method now allowed according to the JNI specification. (#225)
  • v0.14.0 Changes

    October 31, 2019

    ๐Ÿ”„ Changed

    • ๐Ÿ˜Œ 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)
  • v0.13.1 Changes

    August 22, 2019

    ๐Ÿ”„ Changed

    • ๐Ÿ“š Various documentation improvements.
  • v0.13.0 Changes

    July 05, 2019

    0.13 brings major improvements in thread management, allowing to attach the native threads
    permanently and safely; Executor for 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!

    โž• Added

    • JavaVM::attach_current_thread_permanently method, which attaches the current
      thread and detaches it when the thread finishes. Daemon threads attached
      with JavaVM::attach_current_thread_as_daemon also automatically detach themselves
      when finished. The number of currently attached threads may be acquired using
      JavaVM::threads_attached method. (#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)

    ๐Ÿ”„ Changed

    • 0๏ธโƒฃ The default JNI API version in InitArgsBuilder from V1 to V8. (#178)
    • Extended the lifetimes of AutoLocal to make it more flexible. (#190)
    • 0๏ธโƒฃ Default exception type from checked java.lang.Exception to unchecked java.lang.RuntimeException.
      ๐Ÿ‘ป It is used implicitly when JNIEnv#throw is invoked with exception message:
      ๐Ÿ‘ป env.throw("Exception message"); however, for efficiency reasons, it is recommended
      to specify the exception type explicitly and use throw_new:
      ๐Ÿ†• env.throw_new(exception_type, "Exception message"). (#194)

    ๐Ÿ›  Fixed

    • Native threads attached with JavaVM::attach_current_thread_as_daemon now automatically detach
      themselves on exit, preventing Java Thread leaks. (#179)
    • Local reference leaks in JList, JMap and JMapIter. (#190, #191)
  • v0.12.3 Changes

    May 24, 2019

    โž• Added

    • From<jboolean> implementation for JValue (#173)
    • Debug trait for InitArgsBuilder. (#175)
    • InitArgsBuilder#options returning the collected JVM options. (#177)