forked from java-native-access/jna
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changing Class<T> to Class<T extends Library> for Native.loadLibrary
It was possible to pass a non-library class into this method and get a runtime exception, when the same check can be done at compile-time, so this fix changes it to be done at compile-time. After erasure, with this change the return type changes from `Object` to `Library`. So as far as backwards compatibility: 1. If you were assigning the result to `Object`, that will still work 2. If you were passing something that wasn't a `Class<? extends Library>`, your code will now not compile, instead of failing at runtime. 3. I can't remember the rules for binary compatibility. Fixes java-native-access#822.
- Loading branch information
Showing
2 changed files
with
6 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters