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

+1
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

+36-5
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

+2-2
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

+2-2
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

+7-7
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

+2-2
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

+2-2
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

+2-2
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

+1-1
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

+1-1
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) {

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
* A Disposable container that cancels a Future instance.
1919
*/
2020
final class FutureDisposable extends ReferenceDisposable<Future<?>> {
21-
/** */
21+
2222
private static final long serialVersionUID = 6545242830671168775L;
2323

2424
private final boolean allowInterrupt;

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
* @param <T> the type contained
2525
*/
2626
abstract class ReferenceDisposable<T> extends AtomicReference<T> implements Disposable {
27-
/** */
27+
2828
private static final long serialVersionUID = 6537757548749041217L;
2929

3030
ReferenceDisposable(T value) {

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* A disposable container that manages a Runnable instance.
1717
*/
1818
final class RunnableDisposable extends ReferenceDisposable<Runnable> {
19-
/** */
19+
2020
private static final long serialVersionUID = -8219729196779211169L;
2121

2222
RunnableDisposable(Runnable value) {

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
* A Disposable container that handles a {@link Subscription}.
1919
*/
2020
final class SubscriptionDisposable extends ReferenceDisposable<Subscription> {
21-
/** */
21+
2222
private static final long serialVersionUID = -707001650852963139L;
2323

2424
SubscriptionDisposable(Subscription value) {

src/main/java/io/reactivex/exceptions/CompositeException.java

+7-7
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public CompositeException(Iterable<? extends Throwable> errors) {
9696
}
9797

9898
/**
99-
* Retrieves the list of exceptions that make up the {@code CompositeException}
99+
* Retrieves the list of exceptions that make up the {@code CompositeException}.
100100
*
101101
* @return the exceptions that make up the {@code CompositeException}, as a {@link List} of {@link Throwable}s
102102
*/
@@ -137,7 +137,7 @@ public synchronized Throwable getCause() { // NOPMD
137137

138138
List<Throwable> listOfCauses = getListOfCauses(e);
139139
// check if any of them have been seen before
140-
for(Throwable child : listOfCauses) {
140+
for (Throwable child : listOfCauses) {
141141
if (seenCauses.contains(child)) {
142142
// already seen this outer Throwable so skip
143143
e = new RuntimeException("Duplicate found in causal chain so cropping to prevent loop ...");
@@ -220,12 +220,12 @@ private void appendStackTrace(StringBuilder b, Throwable ex, String prefix) {
220220
}
221221

222222
abstract static class PrintStreamOrWriter {
223-
/** Prints the specified string as a line on this StreamOrWriter */
223+
/** Prints the specified string as a line on this StreamOrWriter. */
224224
abstract void println(Object o);
225225
}
226226

227227
/**
228-
* Same abstraction and implementation as in JDK to allow PrintStream and PrintWriter to share implementation
228+
* Same abstraction and implementation as in JDK to allow PrintStream and PrintWriter to share implementation.
229229
*/
230230
static final class WrappedPrintStream extends PrintStreamOrWriter {
231231
private final PrintStream printStream;
@@ -253,7 +253,7 @@ void println(Object o) {
253253
}
254254
}
255255

256-
final static class CompositeExceptionCausalChain extends RuntimeException {
256+
static final class CompositeExceptionCausalChain extends RuntimeException {
257257
private static final long serialVersionUID = 3875212506787802066L;
258258
/* package-private */static final String MESSAGE = "Chain of Causes for CompositeException In Order Received =>";
259259

@@ -269,7 +269,7 @@ private List<Throwable> getListOfCauses(Throwable ex) {
269269
if (root == null) {
270270
return list;
271271
} else {
272-
while(true) {
272+
while (true) {
273273
list.add(root);
274274
if (root.getCause() == null) {
275275
return list;
@@ -309,7 +309,7 @@ private Throwable getRootCause(Throwable e) {
309309
if (root == null /* || cause == root */) { // case might not be possible
310310
return e;
311311
}
312-
while(true) {
312+
while (true) {
313313
Throwable cause = root.getCause();
314314
if (cause == null /* || cause == root */) { // case might not be possible
315315
return root;

src/main/java/io/reactivex/exceptions/MissingBackpressureException.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* Indicates that an operator attempted to emit a value but the downstream wasn't ready for it.
1818
*/
1919
public final class MissingBackpressureException extends RuntimeException {
20-
/** */
20+
2121
private static final long serialVersionUID = 8517344746016032542L;
2222

2323
/**

src/main/java/io/reactivex/flowables/GroupedFlowable.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ protected GroupedFlowable(K key) {
4242
}
4343

4444
/**
45-
* Returns the key that identifies the group of items emitted by this {@code GroupedObservable}
45+
* Returns the key that identifies the group of items emitted by this {@code GroupedObservable}.
4646
*
4747
* @return the key that the items emitted by this {@code GroupedObservable} were grouped by
4848
*/

src/main/java/io/reactivex/functions/Action.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919
public interface Action {
2020
/**
21-
* Runs the action and optionally throws a checked exception
21+
* Runs the action and optionally throws a checked exception.
2222
* @throws Exception if the implementation wishes to throw a checked exception
2323
*/
2424
void run() throws Exception;

src/main/java/io/reactivex/internal/disposables/ArrayCompositeDisposable.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
* and should be used by internal means only.
2626
*/
2727
public final class ArrayCompositeDisposable extends AtomicReferenceArray<Disposable> implements Disposable {
28-
/** */
28+
2929
private static final long serialVersionUID = 2746389416410565408L;
3030

3131
public ArrayCompositeDisposable(int capacity) {

src/main/java/io/reactivex/internal/disposables/CancellableDisposable.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
public final class CancellableDisposable extends AtomicReference<Cancellable>
2929
implements Disposable {
3030

31-
/** */
31+
3232
private static final long serialVersionUID = 5718521705281392066L;
3333

3434
public CancellableDisposable(Cancellable cancellable) {

src/main/java/io/reactivex/internal/disposables/DisposableHelper.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@
2424
*/
2525
public enum DisposableHelper implements Disposable {
2626
/**
27-
* The singleton instance representing a terminal, disposed state;
28-
* Don't leak it!
27+
* The singleton instance representing a terminal, disposed state, don't leak it.
2928
*/
3029
DISPOSED
3130
;
@@ -115,7 +114,7 @@ public static boolean dispose(AtomicReference<Disposable> field) {
115114

116115
/**
117116
* Verifies that current is null, next is not null, otherwise signals errors
118-
* to the RxJavaPlugins and returns false
117+
* to the RxJavaPlugins and returns false.
119118
* @param current the current Disposable, expected to be null
120119
* @param next the next Disposable, expected to be non-null
121120
* @return true if the validation succeeded

src/main/java/io/reactivex/internal/disposables/SequentialDisposable.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public final class SequentialDisposable
2828
extends AtomicReference<Disposable>
2929
implements Disposable {
3030

31-
/** */
31+
3232
private static final long serialVersionUID = -754898800686245608L;
3333

3434
/**

0 commit comments

Comments
 (0)