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

Function get_get_classloader_method

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

Source from the content-addressed store, hash-verified

2299
2300#[cfg(target_os = "android")]
2301pub(crate) unsafe fn get_get_classloader_method() -> errors::Result<jmethodID> {
2302 get_cached!(
2303 GET_CLASSLOADER_METHOD,
2304 {
2305 let env = get_thread_local_env()?;
2306 let cstr1 = utils::to_c_string("getClassLoader");
2307 let cstr2 = utils::to_c_string("()Ljava/lang/ClassLoader;");
2308 let j = unsafe {
2309 (opt_to_res(get_jni_get_method_id())?)(env, get_android_context_wrapper_class()?, cstr1, cstr2)
2310 };
2311 utils::drop_c_string(cstr1);
2312 utils::drop_c_string(cstr2);
2313 j
2314 },
2315 set_get_classloader_method
2316 )
2317}
2318
2319#[cfg(target_os = "android")]
2320pub(crate) fn set_load_class_method(j: jmethodID) {

Callers 1

cache_classloader_ofFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected