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

Function get_field_method

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

Source from the content-addressed store, hash-verified

1290}
1291
1292pub(crate) unsafe fn get_field_method() -> errors::Result<jmethodID> {
1293 get_cached!(
1294 FIELD_METHOD,
1295 {
1296 let env = get_thread_local_env()?;
1297
1298 let field_method_signature = format!("(Ljava/lang/String;)L{};", INVO_IFACE_NAME);
1299 let cstr1 = utils::to_c_string("field");
1300 let cstr2 = utils::to_c_string(field_method_signature.as_ref());
1301 // Get the method ID for the `Instance.field`
1302 let j = unsafe {
1303 (opt_to_res(get_jni_get_method_id())?)(
1304 env,
1305 get_java_instance_class()?,
1306 cstr1,
1307 cstr2,
1308 )
1309 };
1310 utils::drop_c_string(cstr1);
1311 utils::drop_c_string(cstr2);
1312
1313 j
1314 },
1315 set_field_method
1316 )
1317}
1318
1319pub(crate) fn set_clone_static_method(j: jmethodID) {
1320 debug("Called set_clone_static_method");

Callers 1

fieldMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected