Skip to content

Comments

Bump jni from 0.21.1 to 0.22.1 in /divviup/rust#490

Open
dependabot[bot] wants to merge 1 commit intomainfrom
dependabot/cargo/divviup/rust/main/jni-0.22.1
Open

Bump jni from 0.21.1 to 0.22.1 in /divviup/rust#490
dependabot[bot] wants to merge 1 commit intomainfrom
dependabot/cargo/divviup/rust/main/jni-0.22.1

Conversation

@dependabot
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Feb 24, 2026

Bumps jni from 0.21.1 to 0.22.1.

Release notes

Sourced from jni's releases.

Release JNI 0.22.1

This release fixes several issues found shortly after releasing 0.22.0 which unfortunately required a few breaking changes.

Instead of bumping to 0.23 though, the assumption 🤞 is that no one will yet be depending on the recently-released 0.22.0 and so we can yank that and have this represent the first 0.22.x release.

In particular this addresses the following issues:

Added

  • Env::exception_catch provides a convenient way of catching pending Java exceptions and mapping them to Error::CaughtJavaException (#736)
  • AttachGuard::detach_with_catch lets you explicitly detach/drop a guard (like ::detach()) and catch any pending Java exception as a Error::CaughtJavaException (#736).
  • JClass::get_name lets you query the binary name for a class, such as java.lang.String (#736)

Changed

The following APIs have had to be made fallible again, in order to safely check for pending exceptions before calling JNI functions that are not documented as being safe to call with a pending exception:

  • Env::get_java_vm (GetJavaVM is not exception safe)
  • Env::version (GetVersion is not exception safe)
  • Env::is_same_object (IsSameObject is not exception safe)
  • Weak::is_garbage_collected (based on Env::is_same_object)
  • Weak::is_same_object (deprecated) and (based on Env::is_same_object)
  • Weak::is_weak_ref_to_same_object (deprecated) (based on Env::is_same_object)

Note: These are a breaking change.

Fixed in #733

  • JavaVM::attach_current_thread* APIs all finish by calling AttachGuard::detach_with_catch to clear pending Java exceptions - mapping to Error::CaughtJavaException (#736)
  • Env::throw* APIs now return Error::JavaException after throwing and creating a pending exception that must be handled before using JNI further (#738)

Release JNI 0.22.0

The 0.22 release significantly improves safety and ergonomics through changes to thread attachment, environment handling, and the addition of compile-time macros for JNI strings, signatures as well as full Java type bindings.

Please see the jni 0.22 Migration Guide for guidance on how to update from jni 0.21

Added

JavaVM / Thread Attachment APIs

  • JavaVM::singleton() lets you acquire the JavaVM for the process when you know that the JavaVM singleton has been initialized (#595)
  • JavaVM::is_thread_attached can query whether the current thread is attached to the Java VM (#570)
  • AttachGuard::from_unowned added as a low-level (unsafe) way to represent a thread attachment with a raw jni_sys::Env pointer (#570)

... (truncated)

Changelog

Sourced from jni's changelog.

[0.22.1] — 2026-02-20

Note: This release fixes several issues found in 0.22.0 which unfortunately required a few breaking changes. Instead of bumping to 0.23 though, the assumption is that no one will yet be depending on the recently-released 0.22.0 and so we can yank that and have this represent the first 0.22.x release.

Added

  • Env::exception_catch provides a convenient way of catching pending Java exceptions and mapping them to Error::CaughtJavaException (#736)
  • AttachGuard::detach_with_catch lets you explicitly detach/drop a guard (like ::detach()) and catch any pending Java exception as a Error::CaughtJavaException (#736).
  • JClass::get_name lets you query the binary name for a class, such as java.lang.String (#736)

Changed

The following APIs have had to be made fallible again, in order to safely check for pending exceptions before calling JNI functions that are not documented as being safe to call with a pending exception:

  • Env::get_java_vm (GetJavaVM is not exception safe)
  • Env::version (GetVersion is not exception safe)
  • Env::is_same_object (IsSameObject is not exception safe)
  • Weak::is_garbage_collected (based on Env::is_same_object)
  • Weak::is_same_object (deprecated) and (based on Env::is_same_object)
  • Weak::is_weak_ref_to_same_object (deprecated) (based on Env::is_same_object)

Note: These are a breaking change.

Fixed in #733

  • JavaVM::attach_current_thread* APIs all finish by calling AttachGuard::detach_with_catch to clear pending Java exceptions - mapping to Error::CaughtJavaException (#736)
  • Env::throw* APIs now return Error::JavaException after throwing and creating a pending exception that must be handled before using JNI further (#738)

[0.22.0] — 2026-02-17 (YANKED)

Added

JavaVM / Thread Attachment APIs

  • JavaVM::singleton() lets you acquire the JavaVM for the process when you know that the JavaVM singleton has been initialized (#595)
  • JavaVM::is_thread_attached can query whether the current thread is attached to the Java VM (#570)
  • AttachGuard::from_unowned added as a low-level (unsafe) way to represent a thread attachment with a raw jni_sys::Env pointer (#570)
  • AttachConfig exposes fine-grained control over thread attachment including Thread name, ThreadGroup and whether scoped or permanent. (#606)
  • JavaVM::attach_current_thread_guard is a low-level (unsafe) building block for attaching threads that exposes the AttachGuard and AttachConfig control. (#606)
  • JavaVM::attach_current_thread_with_config is a safe building block for attaching threads that hides the AttachGuard but exposes AttachConfig control. (#606)
  • JavaVM::with_local_frame added as method to borrow a Env that is already attached to the current thread, after pushing a new JNI stack frame (#570, #673)
  • JavaVM::with_top_local_frame_frame added to borrow a Env for the top JNI stack frame (i.e. without pushing a new JNI stack frame) (#570, #673)

Reference Type APIs

... (truncated)

Commits
  • 568568e Release 0.22.1 (take 2)
  • c73ab97 Release jni 0.22.1
  • 078a9d4 Have Env::throw* APIs return Error::JavaException
  • 655e2f4 Catch exceptions after running attachment closures
  • c4c025d Call ExceptionCheck before any non-exception-safe JNI calls
  • 9290db2 Fix crates/jni/mylib-example
  • 779a9b4 Release jni 0.22
  • 7801d19 Inline assert_top checks
  • 023aa58 cargo publish --dry-run fixes
  • 71875ba env: fix load_class example
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

@dependabot dependabot bot added dependencies Pull requests that update a dependency file rust Pull requests that update Rust code labels Feb 24, 2026
@dependabot dependabot bot requested a review from a team as a code owner February 24, 2026 00:26
@dependabot dependabot bot added dependencies Pull requests that update a dependency file rust Pull requests that update Rust code labels Feb 24, 2026
Copy link

@divviup-github-automation divviup-github-automation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto-approving dependabot PR.

Bumps [jni](https://github.com/jni-rs/jni-rs) from 0.21.1 to 0.22.1.
- [Release notes](https://github.com/jni-rs/jni-rs/releases)
- [Changelog](https://github.com/jni-rs/jni-rs/blob/master/CHANGELOG.md)
- [Commits](jni-rs/jni-rs@v0.21.1...v0.22.1)

---
updated-dependencies:
- dependency-name: jni
  dependency-version: 0.22.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot force-pushed the dependabot/cargo/divviup/rust/main/jni-0.22.1 branch from 454c8a0 to b68f97a Compare February 24, 2026 00:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file rust Pull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant