(jni_env: *mut JNIEnv,
_cls: jclass,
thread: jthread
| 344 | #[no_mangle] |
| 345 | #[allow(non_snake_case)] |
| 346 | pub 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 | |
| 371 | unsafe fn get_params_as_object_array(jni_env: *mut JNIEnv, |
| 372 | thread: jthread, |
nothing calls this directly
no test coverage detected