2.x: Workaround for Objects.requireNonNull inserted by javac #5966
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.
For some reason, when compiling RxJava with Java 9 or 10 and target 8, there is an implicit
Objects.requireNonNull
added by the compiler tous.new X
which makes AnimalSniffer detect a non-Java 6 API usage. Interestingly, this does not happen with:or AnimalSniffer doesn't detect it for non-8 targets somehow. I know that the latest AnimalSniffer doesn't work with (some?) Java 9 class files, but it doesn't explain why the fully supported Java 8 target 8 does not trigger this error but Java 9 target 8 does.
I have reported this anomaly as a potential javac bug.
The build matrices and outcomes for RxJava 2 can be found here: https://travis-ci.org/akarnokd/RxJava2_9/builds