fix a couple of code paths where exceptions weren't checked for #205
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
(at least before the next JNI call, which is what generates a warning)
This was discovered with -Xcheck:jni, leading to warnings like these
I think what is happening in the two
ObjectMethod
cases is that while the application code is checking the exception state, javabridge is making some followup JNI calls before that can happen, leading to the warnings.I can gather further evidence for that if you feel it's needed.
I was initially hesitant to put this one up, because javabridge performing (and ignoring) the exception check risks silencing the warnings in the case that they are valid - i.e. an incorrectly written application that does not check the exception itself. However, I think one can argue that since it's impossible to fix these warnings by making the application correct, the warnings become not particularly useful and silencing them is the lesser of two evils.
Certainly open to other suggestions on how to silence these, though.