Skip to content

Use t instead of value to allow for IDE naming#4907

Merged
akarnokd merged 1 commit intoReactiveX:2.xfrom
Jawnnypoo:named-values
Dec 7, 2016
Merged

Use t instead of value to allow for IDE naming#4907
akarnokd merged 1 commit intoReactiveX:2.xfrom
Jawnnypoo:named-values

Conversation

@Jawnnypoo
Copy link
Contributor

Naming the value t instead of value allows the IntelliJ to intelligently name the variable based on the type when autocompleting.

Before:

Single.just(new Dog()).subscribe(new SingleObserver<String>() {
            @Override
            public void onSubscribe(Disposable d) {
                
            }

            @Override
            public void onSuccess(Dog value) {

            }

            @Override
            public void onError(Throwable e) {

            }
        });

After:

Single.just(new Dog()).subscribe(new SingleObserver<String>() {
            @Override
            public void onSubscribe(Disposable d) {

            }

            @Override
            public void onSuccess(Dog dog) {

            }

            @Override
            public void onError(Throwable e) {

            }
        });

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.

Awesome. Does 2.x need this?

@Jawnnypoo
Copy link
Contributor Author

This is for 2.X. Did I make a mistake? I could add this to 1.X also if desired.

@JakeWharton
Copy link
Contributor

Hah, yeah I meant 1.x. Off-by-one error.

@Jawnnypoo
Copy link
Contributor Author

#4908 Surprisingly it was already done a lot more in 1.x, so there were only a few cases I found.

@codecov-io
Copy link

Current coverage is 95.70% (diff: 100%)

Merging #4907 into 2.x will increase coverage by 0.02%

@@                2.x      #4907   diff @@
==========================================
  Files           586        586          
  Lines         37410      37410          
  Methods           0          0          
  Messages          0          0          
  Branches       5628       5628          
==========================================
+ Hits          35792      35803    +11   
+ Misses          673        665     -8   
+ Partials        945        942     -3   

Powered by Codecov. Last update 9f24df9...d6ee834

@akarnokd akarnokd added this to the 2.0 backlog milestone Dec 7, 2016
@akarnokd akarnokd merged commit 5b6d1f8 into ReactiveX:2.x Dec 7, 2016
@Jawnnypoo Jawnnypoo deleted the named-values branch December 16, 2016 15:00
mariusc83 pushed a commit to mariusc83/RxJava that referenced this pull request Mar 17, 2017
mariusc83 pushed a commit to mariusc83/RxJava that referenced this pull request Mar 23, 2017
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.

4 participants