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

Function get_cast_static_method

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

Source from the content-addressed store, hash-verified

1358}
1359
1360pub(crate) unsafe fn get_cast_static_method() -> errors::Result<jmethodID> {
1361 get_cached!(
1362 CAST_STATIC_METHOD,
1363 {
1364 let env = get_thread_local_env()?;
1365
1366 let cast_method_signature = format!(
1367 "(L{};Ljava/lang/String;)L{};",
1368 INVO_IFACE_NAME, INVO_IFACE_NAME
1369 );
1370 let cstr1 = utils::to_c_string("cast");
1371 let cstr2 = utils::to_c_string(cast_method_signature.as_ref());
1372
1373 // Get the method ID for the `Instance.cast`
1374 let j = unsafe {
1375 (opt_to_res(get_jni_get_static_method_id())?)(
1376 env,
1377 get_class_to_invoke_clone_and_cast()?,
1378 cstr1,
1379 cstr2,
1380 )
1381 };
1382 utils::drop_c_string(cstr1);
1383 utils::drop_c_string(cstr2);
1384
1385 j
1386 },
1387 set_cast_static_method
1388 )
1389}
1390
1391pub(crate) fn set_get_json_method(j: jmethodID) {
1392 debug("Called set_get_json_method");

Callers 1

castMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected