Skip to content

Commit

Permalink
Migration to jni 0.21.1: Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
uvlad7 committed Mar 30, 2024
1 parent 0d8e74c commit edc9e77
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion robusta-codegen/src/transformation/exported.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ impl<'ctx> Fold for ExternJNIMethodTransformer<'ctx> {

sig.inputs = {
let mut res = Punctuated::new();
res.push(parse_quote!(env: ::robusta_jni::jni::JNIEnv<'env>));
res.push(parse_quote!(mut env: ::robusta_jni::jni::JNIEnv<'env>));

if !is_self_method(&node) {
res.push(parse_quote!(class: ::robusta_jni::jni::objects::JClass));
Expand Down
6 changes: 4 additions & 2 deletions robusta-codegen/src/transformation/imported.rs
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,10 @@ impl<'ctx> Fold for ImportedMethodTransformer<'ctx> {
}
} else {
quote_spanned! { output_type_span =>
::std::convert::TryInto::try_into(::robusta_jni::convert::JValueOwnedWrapper::from(res))
.and_then(|v| ::robusta_jni::convert::TryFromJavaValue::try_from(v, env))
::robusta_jni::convert::TryFromJavaValue::try_from(
::std::convert::TryInto::try_into(::robusta_jni::convert::JValueOwnedWrapper::from(res))?,
env
)
}
}
}
Expand Down

0 comments on commit edc9e77

Please sign in to comment.