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: Improve coverage and fix small mistakes/untaken paths in operators #5883

Merged

Conversation

akarnokd
Copy link
Member

@akarnokd akarnokd commented Mar 3, 2018

This PR improves the coverage of RxJava while adjusting some code paths and fixing other types of smaller bugs.

  • Fix Maybe.merge(Publisher) to define a 1 element buffer only.
  • Fix Maybe.mergeDelayError(Publisher) to use the dedicated FlowableFlatMapPublisher similar to the plain merge().
  • In Flowable.flatMap, checking for empty or cancelled arrays in removeInner() can be replaced with a length check.
  • Make sure in Flowable.reduce(seed, f) the terminal events can't be called a second time if the reducer crashes.
  • Turn the FlowableReplay.MultiCastPublisher into a Flowable and rename it to MulticastFlowable.
  • Fix FlowableWindowBoundary not cancelling the upstream on a missing backpressure case, causing NullPointerException.
  • Remove unused override of accept() in FlowableWindowBoundary.
  • Remove the ineffective done flag from OperatorWindowBoundaryOpenSubscriber.
  • Replace the timer CASs with the replace() call in FlowableWindowTimed.
  • Remove the unused RepeatWhen, ErrorMapperFilter and RetryWhen components from ObservableInternalHelper.
  • Make sure the value is cleared at most once in ObservableReduceSeedSingle.
  • Simplify ObservableWindowBoundarySelector's inner consumer's onNext handling.
  • Simplify FlowableWindowBoundarySelector's inner consumer's onNext handling.
  • Inline the finally actions in InstantPeriodicTask.call().
  • Fix InstantPeriodicTask.setFirst and setRest to return from the loop when the task has been cancelled to prevent excess looping and overwriting the CANCELLED indicator.
  • Inline the finally actions in ScheduledDirectPeriodicTask.call().
  • Slight adjustment of crash propagation in the SchedulerWhen constructor.
  • In BehaviorProcessor, checking for empty or cancelled arrays in remove() can be replaced with a length check.
  • In BehaviorSubject, checking for empty or cancelled arrays in remove() can be replaced with a length check.

@codecov
Copy link

codecov bot commented Mar 3, 2018

Codecov Report

Merging #5883 into 2.x will increase coverage by 0.78%.
The diff coverage is 98.07%.

Impacted file tree graph

@@             Coverage Diff              @@
##                2.x    #5883      +/-   ##
============================================
+ Coverage     96.61%   97.39%   +0.78%     
- Complexity     5921     5978      +57     
============================================
  Files           657      657              
  Lines         43986    43960      -26     
  Branches       6132     6128       -4     
============================================
+ Hits          42497    42817     +320     
+ Misses          582      352     -230     
+ Partials        907      791     -116
Impacted Files Coverage Δ Complexity Δ
...ators/flowable/FlowableWindowBoundarySupplier.java 91.5% <ø> (+12.41%) 2 <0> (ø) ⬇️
...s/observable/ObservableWindowBoundarySupplier.java 89.62% <ø> (+8.14%) 2 <0> (ø) ⬇️
...operators/observable/ObservableInternalHelper.java 100% <ø> (+13.04%) 15 <0> (ø) ⬇️
...ava/io/reactivex/processors/BehaviorProcessor.java 96.86% <100%> (+5.82%) 60 <0> (ø) ⬇️
...s/observable/ObservableWindowBoundarySelector.java 90.79% <100%> (+5.85%) 2 <0> (ø) ⬇️
...in/java/io/reactivex/subjects/BehaviorSubject.java 98.41% <100%> (+12.16%) 54 <0> (ø) ⬇️
...ators/flowable/FlowableWindowBoundarySelector.java 86.78% <100%> (+8.28%) 2 <0> (ø) ⬇️
...ex/internal/operators/flowable/FlowableReplay.java 91.75% <100%> (+0.84%) 22 <1> (ø) ⬇️
...erators/observable/ObservableReduceSeedSingle.java 100% <100%> (+15.38%) 2 <0> (ø) ⬇️
src/main/java/io/reactivex/Maybe.java 100% <100%> (ø) 171 <2> (ø) ⬇️
... and 69 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 f6f6d82...6304c01. Read the comment docs.

@akarnokd akarnokd merged commit 0ea2c95 into ReactiveX:2.x Mar 4, 2018
@akarnokd akarnokd deleted the ObservableCoverageImprovements0303 branch March 4, 2018 11:39
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