MCPcopy Create free account
hub / github.com/cretz/stackparam / method_ref

Function method_ref

src/native.rs:787–798  ·  view source on GitHub ↗
(jni_env: *mut JNIEnv, class_name: &str, method_desc: &str)

Source from the content-addressed store, hash-verified

785 static ONCE: Once = ONCE_INIT;
786 ONCE.call_once(|| {
787 unsafe fn method_ref(jni_env: *mut JNIEnv, class_name: &str, method_desc: &str) -> Result<MethodRef, String> {
788 let class_name_str = CString::new(class_name).unwrap();
789 let class = util::result_or_jni_ex((**jni_env).FindClass.unwrap()(jni_env,
790 class_name_str.as_ptr()), jni_env)?;
791 let meth_name_str = CString::new("valueOf").unwrap();
792 let desc_str = CString::new(method_desc).unwrap();
793 let method = util::result_or_jni_ex((**jni_env).GetStaticMethodID.unwrap()(jni_env,
794 class,
795 meth_name_str.as_ptr(),
796 desc_str.as_ptr()), jni_env)?;
797 return Result::Ok((class, method));
798 }
799 unsafe fn prim_box_meths(jni_env: *mut JNIEnv) -> Result<PrimitiveBoxMethods, String> {
800 return Result::Ok(PrimitiveBoxMethods {
801 boolean: method_ref(jni_env, "java/lang/Boolean", "(Z)Ljava/lang/Boolean;")?,

Callers 1

prim_box_methsFunction · 0.85

Calls 1

result_or_jni_exFunction · 0.85

Tested by

no test coverage detected