Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify jni_x_call macro names #123

Open
2 of 4 tasks
dmitry-timofeev opened this issue Sep 11, 2018 · 5 comments
Open
2 of 4 tasks

Clarify jni_x_call macro names #123

dmitry-timofeev opened this issue Sep 11, 2018 · 5 comments
Assignees

Comments

@dmitry-timofeev
Copy link
Contributor

dmitry-timofeev commented Sep 11, 2018

Clarify the naming to express behaviour more precisely:

  • jni_non_null_call must probably be jni_non_void_call — as it does not check its return value to be non-null
  • jni_call must be jni_non_null_call — as it works for pointer/references only and checks its return value to be non-null.
  • Consider using a separate macro for exception-safe methods.
  • not_nullnull_to_err, see the discussion: Further improvements of macro usage for JNI calls  #150 (comment)
@dmitry-timofeev dmitry-timofeev self-assigned this Sep 11, 2018
@dmitry-timofeev dmitry-timofeev added the breaking A patch that introduces breaking changes (or an issue requiring such patch) label Sep 14, 2018
@dmitry-timofeev
Copy link
Contributor Author

I assume the macros are now a part of the public API of the crate:

jni-rs/src/lib.rs

Lines 208 to 209 in d4ed1b3

#[macro_use]
mod macros;

Shan't we make it private?

@stanislav-tkach
Copy link
Member

I see no reason to make these specific macros public.

@dmitry-timofeev
Copy link
Contributor Author

I see no reason to make these specific macros public.

Yeah, that's rather an implementation detail — and if some JNI methods are missing, it probably makes sense to add them in this library.

@dmitry-timofeev
Copy link
Contributor Author

Updated the description

@dmitry-timofeev dmitry-timofeev removed the breaking A patch that introduces breaking changes (or an issue requiring such patch) label Sep 24, 2018
@dmitry-timofeev
Copy link
Contributor Author

I've mistaken the definition — these macros aren't actually exported 🙃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants