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: Cleaunp - rename fields to upstream and downstream #6129

Merged
merged 2 commits into from
Aug 5, 2018

Conversation

akarnokd
Copy link
Member

@akarnokd akarnokd commented Aug 2, 2018

This PR cleans up the field namings and some local variable namings:

  • Use upstream for the connection Disposable or Subscription instead of d, s, etc., including AtomicReference<*> declarations.
  • Use downstream for the consumer field name in operators instead of actual for example.
  • Fix one-two letter abbreviated naming to match the type, such as Disposable s -> Disposable d, etc.

The CheckLocalVariablesInTests has been extended with the relevant regexp checks.

@akarnokd akarnokd added this to the 2.2 backlog milestone Aug 2, 2018
@codecov
Copy link

codecov bot commented Aug 2, 2018

Codecov Report

Merging #6129 into 2.x will decrease coverage by 0.02%.
The diff coverage is 98.37%.

Impacted file tree graph

@@             Coverage Diff              @@
##                2.x    #6129      +/-   ##
============================================
- Coverage     98.23%   98.21%   -0.03%     
- Complexity     6194     6197       +3     
============================================
  Files           667      667              
  Lines         44853    44853              
  Branches       6213     6213              
============================================
- Hits          44063    44054       -9     
  Misses          245      245              
- Partials        545      554       +9
Impacted Files Coverage Δ Complexity Δ
src/main/java/io/reactivex/Observable.java 100% <ø> (ø) 539 <0> (ø) ⬇️
...rnal/operators/observable/ObservableObserveOn.java 100% <ø> (ø) 3 <0> (ø) ⬇️
src/main/java/io/reactivex/Completable.java 100% <ø> (ø) 117 <0> (ø) ⬇️
...ors/observable/ObservableMergeWithCompletable.java 100% <ø> (ø) 2 <0> (ø) ⬇️
src/main/java/io/reactivex/Maybe.java 100% <ø> (ø) 171 <0> (ø) ⬇️
src/main/java/io/reactivex/Flowable.java 100% <ø> (ø) 564 <0> (ø) ⬇️
...operators/observable/ObservableMergeWithMaybe.java 99.1% <ø> (-0.9%) 2 <0> (ø)
src/main/java/io/reactivex/Single.java 100% <ø> (ø) 146 <0> (ø) ⬇️
...perators/observable/ObservableMapNotification.java 100% <ø> (ø) 2 <0> (ø) ⬇️
...perators/observable/ObservableMergeWithSingle.java 99.06% <ø> (-0.94%) 2 <0> (ø)
... and 324 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 2274c42...1b2d776. Read the comment docs.

@@ -68,14 +68,14 @@

/**
* Sets a Disposable on this emitter; any previous Disposable
* or Cancellation will be unsubscribed/cancelled.
* @param s the disposable, null is allowed
* or Cancellable will be disposed/cancelled.
Copy link
Contributor

Choose a reason for hiding this comment

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

{@link?

Copy link
Contributor

@artem-zinnatullin artem-zinnatullin left a comment

Choose a reason for hiding this comment

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

Very welcomed change, thanks

@@ -26,11 +26,21 @@
* <li>{@code TestObserver} named as {@code ts*}</li>
* <li>{@code PublishProcessor} named as {@code ps*}</li>
* <li>{@code PublishSubject} named as {@code pp*}</li>
* <li>{@code Subscription} with single letter name such as "s" or "d"</li>
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@akarnokd
Copy link
Member Author

akarnokd commented Aug 5, 2018

Thanks @artem-zinnatullin for your diligent review of this PR.

@akarnokd akarnokd merged commit 579e90d into ReactiveX:2.x Aug 5, 2018
@akarnokd akarnokd deleted the UpstreamDownstreamFix branch August 5, 2018 19:14
Copy link
Collaborator

@vanniktech vanniktech left a comment

Choose a reason for hiding this comment

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

Very nice 👍

@davidmoten
Copy link
Collaborator

👍 very helpful thanks

@@ -28,13 +28,13 @@
public abstract class BasicFuseableObserver<T, R> implements Observer<T>, QueueDisposable<R> {

/** The downstream subscriber. */
protected final Observer<? super R> actual;

Choose a reason for hiding this comment

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

fyi these are protected fields so will break folks. We'll try and work around this, just saying. cc @kojilin

Copy link
Member Author

Choose a reason for hiding this comment

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

@codefromthecrypt
Copy link

codefromthecrypt commented Oct 16, 2018 via email

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.

5 participants