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

Mono Kotlin extensions and functions fixes #1475

Merged
merged 8 commits into from
Jan 4, 2019

Conversation

sdeleuze
Copy link
Contributor

  • Polishing
  • Better consistency in term of file naming and functions dispatching
  • Make whenComplete alias working on Publisher<*> not just Publisher<Void>

This commit renames MonoWhenFunctions to MonoFunctions since it also
contains a zip function. This should not break compatibility since
imports are using only package and function name. It also removes some
inconsistent and duplicated tests.
The Kotlin extension and function need to be consistent with their
Java counterparts and should be usable on Publisher<*> not just
Publisher<Void>.
@codecov-io
Copy link

codecov-io commented Dec 24, 2018

Codecov Report

Merging #1475 into master will decrease coverage by 0.05%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1475      +/-   ##
============================================
- Coverage     84.16%   84.11%   -0.06%     
+ Complexity     3907     3896      -11     
============================================
  Files           359      359              
  Lines         29760    29790      +30     
  Branches       5527     5522       -5     
============================================
+ Hits          25048    25057       +9     
- Misses         3083     3096      +13     
- Partials       1629     1637       +8
Impacted Files Coverage Δ Complexity Δ
.../main/java/reactor/core/publisher/MonoBridges.java 66.66% <ø> (ø) 2 <0> (ø) ⬇️
...in/kotlin/reactor/core/publisher/FluxExtensions.kt 88.46% <100%> (ø) 0 <0> (ø) ⬇️
...in/kotlin/reactor/core/publisher/MonoExtensions.kt 84.61% <100%> (+1.28%) 0 <0> (ø) ⬇️
...ain/kotlin/reactor/core/publisher/MonoFunctions.kt 66.66% <100%> (ø) 0 <0> (?)
...e/src/main/java/reactor/core/publisher/Traces.java 66.66% <0%> (-18.85%) 25% <0%> (-15%)
...reactor/core/publisher/ParallelFluxOnAssembly.java 69.23% <0%> (-8.55%) 10% <0%> (-3%)
...in/java/reactor/core/publisher/MonoOnAssembly.java 92.3% <0%> (-2.14%) 7% <0%> (-2%)
...in/java/reactor/core/publisher/FluxWindowWhen.java 80.28% <0%> (-1.45%) 2% <0%> (ø)
...c/main/java/reactor/core/publisher/RingBuffer.java 70.56% <0%> (-0.95%) 24% <0%> (ø)
...main/java/reactor/core/publisher/FluxGenerate.java 69.32% <0%> (-0.62%) 7% <0%> (ø)
... and 10 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 510a0fa...523fb48. Read the comment docs.

@sdeleuze
Copy link
Contributor Author

@bsideup I think I have taken in account all your remarks.

@sdeleuze sdeleuze force-pushed the kotlin-when-complete branch 2 times, most recently from 11a35cc to d3bbe1b Compare December 25, 2018 14:08
@sdeleuze
Copy link
Contributor Author

I have made other changes to preserve backward compatibility with @file:JvmName("MonoWhenFunctionsKt") + moving back extensions where they were. We can't deprecate and put them in the right place because there is a clash in signature, so I suggest doing that for now and fixing the TODO I put in the comments in Reactor Core 3.3.

@@ -162,7 +162,7 @@ class FluxExtensionsTests {
StepVerifier
.create(IOException()
.toFlux<String>()
.onErrorResume(IOException::class, { "foo".toMono() }))
.onErrorResume(IOException::class) { "foo".toMono() })
Copy link
Contributor

Choose a reason for hiding this comment

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

could you please improve the readability of this one as well? (as you did here)

Copy link
Member

@simonbasle simonbasle Jan 4, 2019

Choose a reason for hiding this comment

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

(I did the update)

@simonbasle simonbasle added this to the 3.2.4.RELEASE milestone Jan 4, 2019
@simonbasle simonbasle merged commit 5d74110 into reactor:master Jan 4, 2019
@simonbasle simonbasle deleted the kotlin-when-complete branch January 4, 2019 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants