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

Function Java_stackparam_StackParamNative_loadStackParams

src/native.rs:346–369  ·  view source on GitHub ↗
(jni_env: *mut JNIEnv,
                                                                          _cls: jclass,
                                                                          thread: jthread

Source from the content-addressed store, hash-verified

344#[no_mangle]
345#[allow(non_snake_case)]
346pub unsafe extern "C" fn Java_stackparam_StackParamNative_loadStackParams(jni_env: *mut JNIEnv,
347 _cls: jclass,
348 thread: jthread,
349 max_depth: jint) -> jobject {
350 if thread.is_null() {
351 let _ = throw_ex_with_msg(jni_env, "java/lang/NullPointerException", "Thread is null");
352 return ptr::null_mut();
353 }
354 if max_depth < 0 {
355 let _ = throw_ex_with_msg(jni_env, "java/lang/IllegalArgumentException", "Max depth < 0");
356 return ptr::null_mut();
357 }
358 // TODO
359 return match get_params_as_object_array(jni_env, thread, max_depth, 0) {
360 Result::Err(err_str) => {
361 debug!("Stack param err: {}", err_str);
362 let _ = throw_ex_with_msg(jni_env,
363 "java/lang/RuntimeException",
364 format!("Unexpected stack param err: {}", err_str).as_ref());
365 ptr::null_mut()
366 },
367 Result::Ok(methods) => methods
368 };
369}
370
371unsafe fn get_params_as_object_array(jni_env: *mut JNIEnv,
372 thread: jthread,

Callers

nothing calls this directly

Calls 2

throw_ex_with_msgFunction · 0.85

Tested by

no test coverage detected