Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.x: Workaround for Objects.requireNonNull inserted by javac #5966

Merged
merged 1 commit into from
Apr 20, 2018

Conversation

akarnokd
Copy link
Member

For some reason, when compiling RxJava with Java 9 or 10 and target 8, there is an implicit Objects.requireNonNull added by the compiler to us.new X which makes AnimalSniffer detect a non-Java 6 API usage. Interestingly, this does not happen with:

  • Java 8 target 6,
  • Java 8 target 8,
  • Java 9 target 6,
  • Java 9 target 9,
  • Java 10 target 6,
  • Java 10 target 9,
  • Java 10 target 10

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

@akarnokd akarnokd added this to the 2.2 milestone Apr 20, 2018
Copy link
Contributor

@JakeWharton JakeWharton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remember this problem occurring because of Error Prone a while back.

@codecov
Copy link

codecov bot commented Apr 20, 2018

Codecov Report

Merging #5966 into 2.x will increase coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##                2.x   #5966      +/-   ##
===========================================
+ Coverage     98.27%   98.3%   +0.02%     
  Complexity     6018    6018              
===========================================
  Files           656     656              
  Lines         44037   44037              
  Branches       6100    6100              
===========================================
+ Hits          43278   43289      +11     
+ Misses          225     220       -5     
+ Partials        534     528       -6
Impacted Files Coverage Δ Complexity Δ
...tivex/internal/observers/FutureSingleObserver.java 94.33% <0%> (-3.78%) 24% <0%> (-1%)
...ternal/operators/observable/ObservablePublish.java 96.46% <0%> (-3.54%) 11% <0%> (ø)
...nternal/operators/observable/ObservableWindow.java 98% <0%> (-2%) 3% <0%> (ø)
...rnal/operators/observable/ObservableSwitchMap.java 93.61% <0%> (-1.07%) 3% <0%> (ø)
...perators/observable/ObservableMergeWithSingle.java 99.06% <0%> (-0.94%) 2% <0%> (ø)
...rnal/operators/mixed/ObservableConcatMapMaybe.java 99.18% <0%> (-0.82%) 3% <0%> (ø)
...al/operators/observable/ObservableWindowTimed.java 90.73% <0%> (-0.82%) 4% <0%> (ø)
...nternal/operators/observable/ObservableReplay.java 98.08% <0%> (-0.55%) 23% <0%> (ø)
...x/internal/operators/flowable/FlowableFlatMap.java 89.47% <0%> (-0.53%) 4% <0%> (ø)
...ex/internal/operators/flowable/FlowableReplay.java 94.08% <0%> (-0.22%) 23% <0%> (ø)
... and 16 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b5b27d4...feafd78. Read the comment docs.

@akarnokd
Copy link
Member Author

I guess this was that issue: google/error-prone#375

@akarnokd akarnokd merged commit 0072c30 into ReactiveX:2.x Apr 20, 2018
@akarnokd akarnokd deleted the ObjectsRequireNonNullWorkaround branch April 20, 2018 13:04
BrianZ1 pushed a commit to BrianZ1/RxJava that referenced this pull request Apr 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants