Ignore default methods when scanning interfaces #66
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.
Namely so that default methods can be used to emulate macros defined in
header files we're often replacing when doing ffi work.
We must use reflection to call Method.isDefault as it's only available
as of Java SE 8 (as are default methods).
Implementing a library's API's macros next to the rest of the ffi declarations seems like a sensible thing to do. Currently, a default method's implementation will be ignored and a link error will result on trying to call the method (if it is indeed only a macro and not an exported symbol). Issues could arise if someone is relying on this behavior, although that would strike me as odd. This could be mitigated with a
@Ignoreannotation on default methods (which would similarly cause the interface scanner to ignore the method), which I'm happy to implement if there's concern.