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: Java 9 compatibility fixes (March 3) #5153

Merged
merged 1 commit into from
Mar 3, 2017

Conversation

akarnokd
Copy link
Member

@akarnokd akarnokd commented Mar 3, 2017

Java 9 has changed its overload resolution algorithm and things that resolved unambiguously in Java 8 no longer resolve:

Flowable<? extends T> source = ...

source.subscribe(new FlowableSubscriber<T>() { ... });

With the code above, javac 8, Eclipse and IntelliJ 2017 EAP picks Flowable.subscribe(FlowableSubscriber<? super T> s) as expected. However, javac 9 finds it ambiguous with Flowable.subscribe(Subscriber<? super T> s) despite IntelliJ 2017 EAP not indicating any error and still jumping to the right method via CTRL+Click.

The problem may come from the ? extends T part of the declaration. Having just Flowable<T> compiles properly with javac9.

Luckily, we don't need ? extends T and this PR changes the internal signatures of the affected components.

@akarnokd akarnokd added this to the 2.0 backlog milestone Mar 3, 2017
@codecov
Copy link

codecov bot commented Mar 3, 2017

Codecov Report

Merging #5153 into 2.x will increase coverage by 0.13%.
The diff coverage is 100%.

@@             Coverage Diff              @@
##                2.x    #5153      +/-   ##
============================================
+ Coverage     95.85%   95.99%   +0.13%     
- Complexity     5603     5608       +5     
============================================
  Files           620      620              
  Lines         39856    39856              
  Branches       5604     5604              
============================================
+ Hits          38205    38258      +53     
+ Misses          660      633      -27     
+ Partials        991      965      -26
Impacted Files Coverage Δ Complexity Δ
.../internal/operators/flowable/FlowableRefCount.java 98.5% <ø> (ø) 7 <0> (ø)
...vex/internal/operators/flowable/FlowableCache.java 94% <ø> (ø) 7 <0> (ø)
...operators/flowable/BlockingFlowableMostRecent.java 100% <100%> (ø) 2 <1> (ø)
...l/operators/flowable/BlockingFlowableIterable.java 98.57% <100%> (ø) 2 <1> (ø)
...a/io/reactivex/internal/util/QueueDrainHelper.java 60.28% <0%> (-4.26%) 32% <0%> (-3%)
.../internal/operators/maybe/MaybeTakeUntilMaybe.java 95.91% <0%> (-4.09%) 2% <0%> (ø)
...internal/operators/completable/CompletableAmb.java 94.44% <0%> (-3.71%) 10% <0%> (-1%)
...al/operators/observable/ObservableSampleTimed.java 88.33% <0%> (-3.34%) 3% <0%> (ø)
...activex/internal/operators/single/SingleCache.java 97.05% <0%> (-2.95%) 23% <0%> (-1%)
...x/internal/operators/maybe/MaybeSwitchIfEmpty.java 97.22% <0%> (-2.78%) 2% <0%> (ø)
... and 40 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 19ba993...e7ba017. Read the comment docs.

@JakeWharton
Copy link
Contributor

Hopefully Travis adds early JDK 9 builds soon.

@akarnokd
Copy link
Member Author

akarnokd commented Mar 3, 2017

If you need only JDK 9, that's possible with some experimental setup. The bigger problem is that Gradle 3.x doesn't work on Jigsaw enabled Jdk 9 builds such as 154+.

@akarnokd akarnokd merged commit 26eff79 into ReactiveX:2.x Mar 3, 2017
@akarnokd akarnokd deleted the Jdk9CompatFix0303 branch March 3, 2017 22:57
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.

2 participants