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

Function get_utils_exception_to_string_method

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

Source from the content-addressed store, hash-verified

826}
827
828pub(crate) unsafe fn get_utils_exception_to_string_method() -> errors::Result<jmethodID> {
829 get_cached!(
830 UTILS_THROWABLE_TO_STRING_METHOD,
831 {
832 let env = get_thread_local_env()?;
833 let throwable_to_string_method_signature = "(Ljava/lang/Throwable;)Ljava/lang/String;".to_string();
834 let cstr1 = utils::to_c_string("throwableToString");
835 let cstr2 = utils::to_c_string(&throwable_to_string_method_signature);
836 let j = unsafe {
837 (opt_to_res(get_jni_get_static_method_id())?)(
838 env,
839 get_utils_class()?,
840 cstr1,
841 cstr2,
842 )
843 };
844 utils::drop_c_string(cstr1);
845 utils::drop_c_string(cstr2);
846
847 j
848 },
849 set_utils_exception_to_string_method
850 )
851}
852
853pub(crate) fn set_invocation_arg_class(j: jclass) {
854 debug("Called set_invocation_arg_class");

Callers 1

get_throwable_stringMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected