MCPcopy Create free account
hub / github.com/astonbitecode/j4rs / get_clone_static_method

Function get_clone_static_method

rust/src/cache.rs:1326–1351  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1324}
1325
1326pub(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
1353pub(crate) fn set_cast_static_method(j: jmethodID) {
1354 debug("Called set_cast_static_method");

Callers 1

clone_instanceMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected