-
Notifications
You must be signed in to change notification settings - Fork 7.6k
1.x: apply fixes based on PMD suggestions #4091
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
1affb2e
1.x: apply fixes based on PMD suggestions
akarnokd fa9b5d2
InternalError(Throwable cause) is not available
akarnokd 80e8f40
Remove private from inner (static) classes, add final where needed
akarnokd 52b026d
Remove by akarnokd, update rules
akarnokd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -619,7 +619,7 @@ public static <T> Single<T> fromCallable(final Callable<? extends T> func) { | |
| return create(new OnSubscribe<T>() { | ||
| @Override | ||
| public void call(SingleSubscriber<? super T> singleSubscriber) { | ||
| final T value; | ||
| T value; | ||
|
|
||
| try { | ||
| value = func.call(); | ||
|
|
@@ -1719,7 +1719,7 @@ public final Subscription unsafeSubscribe(Subscriber<? super T> subscriber) { | |
| // TODO could the hook be the cause of the error in the on error handling. | ||
| RxJavaHooks.onSingleError(r); | ||
| // TODO why aren't we throwing the hook's return value. | ||
| throw r; | ||
| throw r; // NOPMD | ||
| } | ||
| return Subscriptions.unsubscribed(); | ||
| } | ||
|
|
@@ -1829,7 +1829,7 @@ public final Subscription subscribe(Subscriber<? super T> subscriber) { | |
| // TODO could the hook be the cause of the error in the on error handling. | ||
| RxJavaHooks.onSingleError(r); | ||
| // TODO why aren't we throwing the hook's return value. | ||
| throw r; | ||
| throw r; // NOPMD | ||
| } | ||
| return Subscriptions.empty(); | ||
| } | ||
|
|
@@ -1875,7 +1875,7 @@ public final Subscription subscribe(final SingleSubscriber<? super T> te) { | |
|
|
||
| @Override | ||
| public void onCompleted() { | ||
|
|
||
| // deliberately ignored | ||
| } | ||
|
|
||
| @Override | ||
|
|
@@ -2376,6 +2376,7 @@ public final Single<T> doOnError(final Action1<Throwable> onError) { | |
| Observer<T> observer = new Observer<T>() { | ||
| @Override | ||
| public void onCompleted() { | ||
| // deliberately ignored | ||
| } | ||
|
|
||
| @Override | ||
|
|
@@ -2385,6 +2386,7 @@ public void onError(Throwable e) { | |
|
|
||
| @Override | ||
| public void onNext(T t) { | ||
| // deliberately ignored | ||
| } | ||
| }; | ||
|
|
||
|
|
@@ -2410,10 +2412,12 @@ public final Single<T> doOnSuccess(final Action1<? super T> onSuccess) { | |
| Observer<T> observer = new Observer<T>() { | ||
| @Override | ||
| public void onCompleted() { | ||
| // deliberately ignored | ||
| } | ||
|
|
||
| @Override | ||
| public void onError(Throwable e) { | ||
| // deliberately ignored | ||
| } | ||
|
|
||
| @Override | ||
|
|
@@ -2589,7 +2593,7 @@ public final Single<T> doAfterTerminate(Action0 action) { | |
| */ | ||
| @SuppressWarnings("unchecked") | ||
| static <T> Single<? extends T>[] iterableToArray(final Iterable<? extends Single<? extends T>> singlesIterable) { | ||
| final Single<? extends T>[] singlesArray; | ||
| Single<? extends T>[] singlesArray; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. PMD complained about final variable? |
||
| int count; | ||
|
|
||
| if (singlesIterable instanceof Collection) { | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this is covered in PMD, but usually like to also name the param
ignored. Same for the others. I suppose it's kind of orthogonal to the comment here though, which is that the method itself is deliberately unimplemented. I'd recommend specifying that it's unimplemented rather than "ignored", since "ignored" usually is in reference to the param(s)