| 1324 | } |
| 1325 | |
| 1326 | pub(crate) unsafe fn get_clone_static_method() -> errors::Result<jmethodID> { |
| 1327 | get_cached!( |
| 1328 | CLONE_STATIC_METHOD, |
| 1329 | { |
| 1330 | let env = get_thread_local_env()?; |
| 1331 | |
| 1332 | let clone_method_signature = format!("(L{};)L{};", INVO_IFACE_NAME, INVO_IFACE_NAME); |
| 1333 | let cstr1 = utils::to_c_string("cloneInstance"); |
| 1334 | let cstr2 = utils::to_c_string(clone_method_signature.as_ref()); |
| 1335 | // Get the method ID for the `Instance.clone` |
| 1336 | let j = unsafe { |
| 1337 | (opt_to_res(get_jni_get_static_method_id())?)( |
| 1338 | env, |
| 1339 | get_class_to_invoke_clone_and_cast()?, |
| 1340 | cstr1, |
| 1341 | cstr2, |
| 1342 | ) |
| 1343 | }; |
| 1344 | utils::drop_c_string(cstr1); |
| 1345 | utils::drop_c_string(cstr2); |
| 1346 | |
| 1347 | j |
| 1348 | }, |
| 1349 | set_clone_static_method |
| 1350 | ) |
| 1351 | } |
| 1352 | |
| 1353 | pub(crate) fn set_cast_static_method(j: jmethodID) { |
| 1354 | debug("Called set_cast_static_method"); |