(jni_env: *mut JNIEnv, to_return: T, message: &str)
| 149 | } |
| 150 | |
| 151 | fn do_return<T>(jni_env: *mut JNIEnv, to_return: T, message: &str) -> errors::Result<T> { |
| 152 | unsafe { |
| 153 | if (opt_to_res(cache::get_jni_exception_check())?)(jni_env) == JNI_TRUE { |
| 154 | (opt_to_res(cache::get_jni_exception_clear())?)(jni_env); |
| 155 | Err(errors::J4RsError::JavaError(format!( |
| 156 | "Class not found {message}" |
| 157 | ))) |
| 158 | } else { |
| 159 | Ok(to_return) |
| 160 | } |
| 161 | } |
| 162 | } |
| 163 | |
| 164 | pub(crate) struct J4rsAndroidJavaVM { |
| 165 | java_vm: *mut JavaVM, |
no test coverage detected