(obj: jobject)
| 69 | } |
| 70 | |
| 71 | pub fn from_jobject_with_global_ref(obj: jobject) -> errors::Result<Instance> { |
| 72 | let _jvm = cache::get_thread_local_env().map_err(|_| Jvm::attach_thread()); |
| 73 | |
| 74 | let global = |
| 75 | jni_utils::create_global_ref_from_local_ref(obj, cache::get_thread_local_env()?)?; |
| 76 | Ok(Instance { |
| 77 | jinstance: global, |
| 78 | class_name: cache::UNKNOWN_FOR_RUST.to_string(), |
| 79 | skip_deleting_jobject: false, |
| 80 | }) |
| 81 | } |
| 82 | |
| 83 | /// Creates a weak reference of this Instance. |
| 84 | fn _weak_ref(&self) -> errors::Result<Instance> { |
nothing calls this directly
no test coverage detected