MCPcopy Create free account
hub / github.com/PRQL/prql / jstring_to_string

Function jstring_to_string

prqlc/bindings/java/src/lib.rs:74–82  ·  view source on GitHub ↗
(env: &mut JNIEnv, s: &JString, name: &str)

Source from the content-addressed store, hash-verified

72}
73
74fn jstring_to_string(env: &mut JNIEnv, s: &JString, name: &str) -> Option<String> {
75 match env.get_string(s) {
76 Ok(js) => Some(js.into()),
77 Err(e) => {
78 throw_illegal_argument(env, &format!("failed to read {name}: {e}"));
79 None
80 }
81 }
82}
83
84fn throw_illegal_argument(env: &mut JNIEnv, message: &str) {
85 if let Err(e) = env.throw_new("java/lang/IllegalArgumentException", message) {

Calls 1

throw_illegal_argumentFunction · 0.85

Tested by

no test coverage detected