unsafe fn throw_new_runtime_exception(raw_env: *mut jni_sys::JNIEnv, message: impl AsRef<str>) {
    let message = to_java_string_null_terminated(message.as_ref());
    let class_name = to_java_string_null_terminated("java/lang/RuntimeException\0");
    let find_class = (**raw_env).FindClass.unwrap();
    let class = find_class(raw_env, class_name.as_ptr() as *const i8);
    if class == ptr::null_mut() {
        #[cold]
        panic!(
            "Could not find the java.lang.RuntimeException class on panic, aborting the program."
        );
    } else {
        let throw_new_fn = (**raw_env).ThrowNew.unwrap();
        let error = JniError::from_raw(throw_new_fn(raw_env, class, message.as_ptr() as *const i8));
        if error.is_some() {
            panic!("Could not throw a new runtime exception on panic, status {:?}, aborting the program.", error.unwrap());
        }
    }
}
/// Unsafe because an incorrect pointer can be passed as an argument.
Unsafe because an incorrect pointer can be passed as an argument.
Unsafe because an incorrect pointer can be passed as an argument .
unsafe fn throw_new_runtime_exception(raw_env: *mut jni_sys::JNIEnv, message: impl AsRef<str>) {
    let message = to_java_string_null_terminated(message.as_ref());
    let class_name = to_java_string_null_terminated("java/lang/RuntimeException\0");
    let find_class = (**raw_env).FindClass.unwrap();
    let class = find_class(raw_env, class_name.as_ptr() as *const i8);
    if class == ptr::null_mut() {
        #[cold]
        panic!(
            "Could not find the java.lang.RuntimeException class on panic, aborting the program."
        );
    } else {
        let throw_new_fn = (**raw_env).ThrowNew.unwrap();
        let error = JniError::from_raw(throw_new_fn(raw_env, class, message.as_ptr() as *const i8));
        if error.is_some() {
            panic!("Could not throw a new runtime exception on panic, status {:?}, aborting the program.", error.unwrap());
        }
    }
}
unsafe fn throw_new_runtime_exception ( raw_env : * mut jni_sys :: JNIEnv , message : impl AsRef < str > ) { let message = to_java_string_null_terminated ( message . as_ref ( ) ) ; let class_name = to_java_string_null_terminated ( " \0 " ) ; let find_class = ( * * raw_env ) . FindClass . unwrap ( ) ; let class = find_class ( raw_env , class_name . as_ptr ( ) as * const i8 ) ; if class == ptr :: null_mut ( ) { # [ cold ] panic ! ( " " ) ; } else { let throw_new_fn = ( * * raw_env ) . ThrowNew . unwrap ( ) ; let error = JniError :: from_raw ( throw_new_fn ( raw_env , class , message . as_ptr ( ) as * const i8 ) ) ; if error . is_some ( ) { panic ! ( " " error unwrap ( ) ) ; } } }
Unsafe because an incorrect pointer can be passed as an argument.
Unsafe because an incorrect pointer can be passed as an argument .
raw_env
*mut jni_sys::JNIEnv
message
impl AsRef<str>
raw_env
*mut jni_sys::JNIEnv
message
impl AsRef<str>