Skip to content

Commit

Permalink
Removes the Options around the function pointers
Browse files Browse the repository at this point in the history
None of the JNI 1.1 function pointers were optional, and neither
are any of the function pointers in later versions of the spec.

Having the `Option` implies that null pointer checks are required
but, more notably, they also suggest that null pointer checks could
be used for JNI >= 1.2 pointers, which could be a dangerous mistake
since these are effectively extending beyond the table of pointers
that was defined for JNI 1.1 and should be assumed to be invalid
pointers that mustn't be touched.

It's also notable that we sometimes have to call `GetVersion` to
determine the full set of pointers that are valid.

Recently the use of `Option` also raised some questions about our
ability to, infallibly, handle Rust panics when we want to map
a panic to a Java exception via JNI:

jni-rs/jni-rs#432 (comment)
  • Loading branch information
rib committed Jun 21, 2023
1 parent 802ac85 commit 5fb8742
Showing 1 changed file with 1,074 additions and 1,230 deletions.

0 comments on commit 5fb8742

Please sign in to comment.