You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by "tisonkun (via GitHub)" <gi...@apache.org> on 2025/03/21 05:34:14 UTC

[PR] refactor: tidy binding java code [opendal]

tisonkun opened a new pull request, #5840:
URL: https://github.com/apache/opendal/pull/5840

   cc @Xuanwo @G-XD 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] refactor: tidy binding java code [opendal]

Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on code in PR #5840:
URL: https://github.com/apache/opendal/pull/5840#discussion_r2006890261


##########
bindings/java/src/convert.rs:
##########
@@ -69,29 +69,33 @@ pub(crate) fn string_to_jstring<'a>(
     )
 }
 
-pub(crate) fn get_optional_string_from_object(
+pub(crate) fn read_bool_field(
     env: &mut JNIEnv<'_>,
     obj: &JObject,
-    method: &str,
+    field: &str,
+) -> crate::Result<bool> {
+    Ok(env.get_field(obj, field, "Z")?.z()?)
+}
+
+pub(crate) fn read_string_field(

Review Comment:
   Some perf ideas:
   
   * Filter out null options object (currently we always pass an option object, but can be null to indicate all default anyway)
   * Cache field id and try to use `get_field_unchecked`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] refactor: tidy binding java code [opendal]

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo merged PR #5840:
URL: https://github.com/apache/opendal/pull/5840


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org