Skip to content

Commit 6ff866a

Browse files
authored
2.x: cleanup of style and other minor things, 9/14-1 (#4552)
* 2.x: cleanup of style and other minor things, 9/14-1 * Disable the other checks
1 parent 8e9c935 commit 6ff866a

File tree

511 files changed

+1847
-1720
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

511 files changed

+1847
-1720
lines changed

build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ build.dependsOn jacocoTestReport
133133
checkstyle {
134134
configFile file('checkstyle.xml')
135135
ignoreFailures = true
136+
toolVersion ="6.19"
136137
}
137138

138139
/*

checkstyle.xml

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,41 @@
33
"-//Puppy Crawl//DTD Check Configuration 1.2//EN"
44
"http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
55
<module name="Checker">
6-
<module name="TreeWalker">
7-
<module name="RegexpSinglelineJava">
8-
<property name="format" value="^(?!\s+\* $).*?\s+$"/>
9-
<property name="message" value="Line has trailing spaces."/>
10-
</module>
6+
<property name="severity" value="warning"/>
7+
<module name="TreeWalker">
8+
<module name="RegexpSinglelineJava">
9+
<property name="severity" value="warning"/>
10+
<property name="format" value="^(?!\s+\* $).*?\s+$"/>
11+
<property name="message" value="Line has trailing spaces."/>
1112
</module>
13+
<!--
14+
<module name="ExplicitInitialization"/>
15+
<module name="SummaryJavadoc"/>
16+
<module name="ModifierOrder"/>
17+
<module name="RedundantModifier"/>
18+
<module name="NeedBraces"/>
19+
<module name="EqualsHashCode"/>
20+
<module name="FallThrough"/>
21+
<module name="MultipleVariableDeclarations">
22+
<property name="severity" value="ignore"/>
23+
<metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="inherit"/>
24+
</module>
25+
<module name="PackageDeclaration"/>
26+
<module name="FinalClass"/>
27+
<module name="HideUtilityClassConstructor"/>
28+
<module name="WhitespaceAround">
29+
<property name="tokens" value="ASSIGN,BAND,BAND_ASSIGN,BOR,BOR_ASSIGN,BSR,BSR_ASSIGN,BXOR,BXOR_ASSIGN,COLON,DIV,DIV_ASSIGN,DO_WHILE,EQUAL,GE,GT,LAMBDA,LAND,LCURLY,LE,LITERAL_ASSERT,LITERAL_CATCH,LITERAL_DO,LITERAL_ELSE,LITERAL_FINALLY,LITERAL_FOR,LITERAL_IF,LITERAL_RETURN,LITERAL_SYNCHRONIZED,LITERAL_TRY,LITERAL_WHILE,LOR,LT,MINUS,MINUS_ASSIGN,MOD,MOD_ASSIGN,NOT_EQUAL,PLUS,PLUS_ASSIGN,QUESTION,SL,SLIST,SL_ASSIGN,SR,SR_ASSIGN,STAR,STAR_ASSIGN,TYPE_EXTENSION_AND"/>
30+
</module>
31+
-->
32+
</module>
33+
<!--
34+
<module name="JavadocPackage">
35+
<property name="severity" value="ignore"/>
36+
<metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="inherit"/>
37+
</module>
38+
<module name="FileTabCharacter">
39+
<property name="eachLine" value="true"/>
40+
<property name="fileExtensions" value=".java"/>
41+
</module>
42+
-->
1243
</module>

src/main/java/io/reactivex/Completable.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ public static Completable fromAction(final Action run) {
307307

308308
/**
309309
* Returns a Completable which when subscribed, executes the callable function, ignores its
310-
* normal result and emits onError or onCompleted only.
310+
* normal result and emits onError or onComplete only.
311311
* <dl>
312312
* <dt><b>Scheduler:</b></dt>
313313
* <dd>{@code fromCallable} does not operate by default on a particular {@link Scheduler}.</dd>
@@ -1478,7 +1478,7 @@ public final void subscribe(CompletableObserver s) {
14781478
* CompletableObserver as is.
14791479
* <p>Usage example:
14801480
* <pre><code>
1481-
* Completable<Integer> source = Completable.complete().delay(1, TimeUnit.SECONDS);
1481+
* Completable source = Completable.complete().delay(1, TimeUnit.SECONDS);
14821482
* CompositeDisposable composite = new CompositeDisposable();
14831483
*
14841484
* class ResourceCompletableObserver implements CompletableObserver, Disposable {

src/main/java/io/reactivex/Flowable.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11591,7 +11591,7 @@ public final Flowable<T> skipWhile(Predicate<? super T> predicate) {
1159111591
*/
1159211592
@BackpressureSupport(BackpressureKind.FULL)
1159311593
@SchedulerSupport(SchedulerSupport.NONE)
11594-
public final Flowable<T> sorted(){
11594+
public final Flowable<T> sorted() {
1159511595
return toSortedList().flatMapIterable(Functions.<List<T>>identity());
1159611596
}
1159711597

@@ -11932,7 +11932,7 @@ public final void subscribe(Subscriber<? super T> s) {
1193211932
* Subscriber as is.
1193311933
* <p>Usage example:
1193411934
* <pre><code>
11935-
* Flowable<Integer> source = Flowable.range(1, 10);
11935+
* Flowable&lt;Integer> source = Flowable.range(1, 10);
1193611936
* CompositeDisposable composite = new CompositeDisposable();
1193711937
*
1193811938
* ResourceSubscriber&lt;Integer> rs = new ResourceSubscriber&lt;>() {

src/main/java/io/reactivex/Maybe.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,7 +1222,7 @@ public static <T> Single<Boolean> sequenceEqual(MaybeSource<? extends T> source1
12221222
@SchedulerSupport(SchedulerSupport.NONE)
12231223
public static <T> Single<Boolean> sequenceEqual(MaybeSource<? extends T> source1, MaybeSource<? extends T> source2,
12241224
BiPredicate<? super T, ? super T> isEqual) {
1225-
return RxJavaPlugins.onAssembly(new SingleMaybeEqual<T>(source1, source2, isEqual));
1225+
return RxJavaPlugins.onAssembly(new MaybeEqualSingle<T>(source1, source2, isEqual));
12261226
}
12271227

12281228
/**
@@ -2288,7 +2288,7 @@ public final Maybe<T> doOnDispose(Action onDispose) {
22882288
}
22892289

22902290
/**
2291-
* Modifies the source Maybe so that it invokes an action when it calls {@code onCompleted}.
2291+
* Modifies the source Maybe so that it invokes an action when it calls {@code onComplete}.
22922292
* <p>
22932293
* <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/doOnComplete.png" alt="">
22942294
* <dl>
@@ -2297,7 +2297,7 @@ public final Maybe<T> doOnDispose(Action onDispose) {
22972297
* </dl>
22982298
*
22992299
* @param onComplete
2300-
* the action to invoke when the source Maybe calls {@code onCompleted}
2300+
* the action to invoke when the source Maybe calls {@code onComplete}
23012301
* @return the new Maybe with the side-effecting behavior applied
23022302
* @see <a href="http://reactivex.io/documentation/operators/do.html">ReactiveX operators documentation: Do</a>
23032303
*/
@@ -2458,11 +2458,11 @@ public final <R> Maybe<R> flatMap(Function<? super T, ? extends MaybeSource<? ex
24582458
* @param <R>
24592459
* the result type
24602460
* @param onSuccessMapper
2461-
* a function that returns a MaybeSource to merge for the success item emitted by this Maybe
2461+
* a function that returns a MaybeSource to merge for the onSuccess item emitted by this Maybe
24622462
* @param onErrorMapper
24632463
* a function that returns a MaybeSource to merge for an onError notification from this Maybe
24642464
* @param onCompleteSupplier
2465-
* a function that returns a MaybeSource to merge for an onCompleted notification this Maybe
2465+
* a function that returns a MaybeSource to merge for an onComplete notification this Maybe
24662466
* @return the new Maybe instance
24672467
* @see <a href="http://reactivex.io/documentation/operators/flatmap.html">ReactiveX operators documentation: FlatMap</a>
24682468
*/
@@ -2589,7 +2589,7 @@ public final Maybe<T> hide() {
25892589
}
25902590

25912591
/**
2592-
* Ignores the item emitted by the source Maybe and only calls {@code onCompleted} or {@code onError}.
2592+
* Ignores the item emitted by the source Maybe and only calls {@code onComplete} or {@code onError}.
25932593
* <p>
25942594
* <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/ignoreElements.png" alt="">
25952595
* <dl>
@@ -3437,7 +3437,7 @@ public final Maybe<T> subscribeOn(Scheduler scheduler) {
34373437
* MaybeObserver as is.
34383438
* <p>Usage example:
34393439
* <pre><code>
3440-
* Maybe<Integer> source = Maybe.just(1);
3440+
* Maybe&lt;Integer> source = Maybe.just(1);
34413441
* CompositeDisposable composite = new CompositeDisposable();
34423442
*
34433443
* MaybeObserver&lt;Integer> ms = new MaybeObserver&lt;>() {

src/main/java/io/reactivex/Observable.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9680,7 +9680,7 @@ public final Observable<T> skipWhile(Predicate<? super T> predicate) {
96809680
* @return an Observable that emits the items emitted by the source ObservableSource in sorted order
96819681
*/
96829682
@SchedulerSupport(SchedulerSupport.NONE)
9683-
public final Observable<T> sorted(){
9683+
public final Observable<T> sorted() {
96849684
return toSortedList().flatMapIterable(Functions.<List<T>>identity());
96859685
}
96869686

@@ -9974,7 +9974,7 @@ public final void subscribe(Observer<? super T> observer) {
99749974
* Observer as is.
99759975
* <p>Usage example:
99769976
* <pre><code>
9977-
* Observable<Integer> source = Observable.range(1, 10);
9977+
* Observable&lt;Integer> source = Observable.range(1, 10);
99789978
* CompositeDisposable composite = new CompositeDisposable();
99799979
*
99809980
* ResourceObserver&lt;Integer> rs = new ResourceObserver&lt;>() {

src/main/java/io/reactivex/Scheduler.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ public Disposable schedulePeriodicallyDirect(Runnable run, long initialDelay, lo
173173
* <p>
174174
* Unsubscribing the {@link Worker} cancels all outstanding work and allows resource cleanup.
175175
*/
176-
public static abstract class Worker implements Disposable {
176+
public abstract static class Worker implements Disposable {
177177
/**
178178
* Schedules a Runnable for execution without delay.
179179
*
@@ -310,7 +310,7 @@ static class PeriodicDirectTask
310310

311311
volatile boolean disposed;
312312

313-
public PeriodicDirectTask(Runnable run, Worker worker) {
313+
PeriodicDirectTask(Runnable run, Worker worker) {
314314
this.run = run;
315315
this.worker = worker;
316316
}

src/main/java/io/reactivex/Single.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2446,7 +2446,7 @@ public final void subscribe(SingleObserver<? super T> subscriber) {
24462446
* SingleObserver as is.
24472447
* <p>Usage example:
24482448
* <pre><code>
2449-
* Single<Integer> source = Single.just(1);
2449+
* Single&lt;Integer> source = Single.just(1);
24502450
* CompositeDisposable composite = new CompositeDisposable();
24512451
*
24522452
* class ResourceSingleObserver implements SingleObserver&lt;Integer>, Disposable {
@@ -2685,7 +2685,7 @@ public final <R> R to(Function<? super Single<T>, R> convert) {
26852685
* <dd>{@code toCompletable} does not operate by default on a particular {@link Scheduler}.</dd>
26862686
* </dl>
26872687
*
2688-
* @return a {@link Completable} that calls {@code onCompleted} on it's subscriber when the source {@link Single}
2688+
* @return a {@link Completable} that calls {@code onComplete} on it's subscriber when the source {@link Single}
26892689
* calls {@code onSuccess}.
26902690
* @see <a href="http://reactivex.io/documentation/completable.html">ReactiveX documentation: Completable</a>
26912691
* @since 2.0

src/main/java/io/reactivex/annotations/BackpressureKind.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919
public enum BackpressureKind {
2020
/**
21-
* The backpressure-related requests pass through this operator without change
21+
* The backpressure-related requests pass through this operator without change.
2222
*/
2323
PASS_THROUGH,
2424
/**

src/main/java/io/reactivex/disposables/ActionDisposable.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import io.reactivex.internal.util.ExceptionHelper;
1717

1818
final class ActionDisposable extends ReferenceDisposable<Action> {
19-
/** */
19+
2020
private static final long serialVersionUID = -8219729196779211169L;
2121

2222
ActionDisposable(Action value) {

0 commit comments

Comments
 (0)