From 88cdfab64566e7e24cdbbe397e3d76cd115b8d58 Mon Sep 17 00:00:00 2001 From: Zac Sweers Date: Tue, 20 Aug 2019 16:29:57 -0400 Subject: [PATCH] Spotless --- gradle/dependencies.gradle | 2 +- .../rxdogtag/DogTagCompletableObserver.java | 8 ++-- .../uber/rxdogtag/DogTagMaybeObserver.java | 8 ++-- .../com/uber/rxdogtag/DogTagObserver.java | 8 ++-- .../uber/rxdogtag/DogTagSingleObserver.java | 8 ++-- .../com/uber/rxdogtag/DogTagSubscriber.java | 8 ++-- .../main/java/com/uber/rxdogtag/RxDogTag.java | 15 ++++---- .../RxDogTagTaggedExceptionReceiver.java | 37 +++++++++++++------ 8 files changed, 54 insertions(+), 40 deletions(-) diff --git a/gradle/dependencies.gradle b/gradle/dependencies.gradle index 9e1bb89..0a72e47 100755 --- a/gradle/dependencies.gradle +++ b/gradle/dependencies.gradle @@ -23,7 +23,7 @@ def versions = [ jmhPlugin: '0.4.8', nullawayPlugin: '0.1', dokka: '0.9.18', - spotless: '3.21.1' + spotless: '3.24.2' ] def build = [ diff --git a/rxdogtag/src/main/java/com/uber/rxdogtag/DogTagCompletableObserver.java b/rxdogtag/src/main/java/com/uber/rxdogtag/DogTagCompletableObserver.java index 664d0e7..0942e6b 100644 --- a/rxdogtag/src/main/java/com/uber/rxdogtag/DogTagCompletableObserver.java +++ b/rxdogtag/src/main/java/com/uber/rxdogtag/DogTagCompletableObserver.java @@ -15,15 +15,15 @@ */ package com.uber.rxdogtag; +import static com.uber.rxdogtag.RxDogTag.createException; +import static com.uber.rxdogtag.RxDogTag.guardedDelegateCall; +import static com.uber.rxdogtag.RxDogTag.reportError; + import io.reactivex.CompletableObserver; import io.reactivex.disposables.Disposable; import io.reactivex.exceptions.OnErrorNotImplementedException; import io.reactivex.observers.LambdaConsumerIntrospection; -import static com.uber.rxdogtag.RxDogTag.createException; -import static com.uber.rxdogtag.RxDogTag.guardedDelegateCall; -import static com.uber.rxdogtag.RxDogTag.reportError; - /** * A delegating {@link CompletableObserver} that throws {@link OnErrorNotImplementedException} with * stack element tagging to indicate the exact line number that was subscribed. diff --git a/rxdogtag/src/main/java/com/uber/rxdogtag/DogTagMaybeObserver.java b/rxdogtag/src/main/java/com/uber/rxdogtag/DogTagMaybeObserver.java index 5b81b68..eb0e68c 100644 --- a/rxdogtag/src/main/java/com/uber/rxdogtag/DogTagMaybeObserver.java +++ b/rxdogtag/src/main/java/com/uber/rxdogtag/DogTagMaybeObserver.java @@ -15,15 +15,15 @@ */ package com.uber.rxdogtag; +import static com.uber.rxdogtag.RxDogTag.createException; +import static com.uber.rxdogtag.RxDogTag.guardedDelegateCall; +import static com.uber.rxdogtag.RxDogTag.reportError; + import io.reactivex.MaybeObserver; import io.reactivex.disposables.Disposable; import io.reactivex.exceptions.OnErrorNotImplementedException; import io.reactivex.observers.LambdaConsumerIntrospection; -import static com.uber.rxdogtag.RxDogTag.createException; -import static com.uber.rxdogtag.RxDogTag.guardedDelegateCall; -import static com.uber.rxdogtag.RxDogTag.reportError; - /** * A delegating {@link MaybeObserver} that throws {@link OnErrorNotImplementedException} with stack * element tagging to indicate the exact line number that was subscribed. diff --git a/rxdogtag/src/main/java/com/uber/rxdogtag/DogTagObserver.java b/rxdogtag/src/main/java/com/uber/rxdogtag/DogTagObserver.java index 829af7b..658c5a8 100644 --- a/rxdogtag/src/main/java/com/uber/rxdogtag/DogTagObserver.java +++ b/rxdogtag/src/main/java/com/uber/rxdogtag/DogTagObserver.java @@ -15,15 +15,15 @@ */ package com.uber.rxdogtag; +import static com.uber.rxdogtag.RxDogTag.createException; +import static com.uber.rxdogtag.RxDogTag.guardedDelegateCall; +import static com.uber.rxdogtag.RxDogTag.reportError; + import io.reactivex.Observer; import io.reactivex.disposables.Disposable; import io.reactivex.exceptions.OnErrorNotImplementedException; import io.reactivex.observers.LambdaConsumerIntrospection; -import static com.uber.rxdogtag.RxDogTag.createException; -import static com.uber.rxdogtag.RxDogTag.guardedDelegateCall; -import static com.uber.rxdogtag.RxDogTag.reportError; - /** * A delegating {@link Observer} that throws {@link OnErrorNotImplementedException} with stack * element tagging to indicate the exact line number that was subscribed. diff --git a/rxdogtag/src/main/java/com/uber/rxdogtag/DogTagSingleObserver.java b/rxdogtag/src/main/java/com/uber/rxdogtag/DogTagSingleObserver.java index d54265b..8ad63dd 100644 --- a/rxdogtag/src/main/java/com/uber/rxdogtag/DogTagSingleObserver.java +++ b/rxdogtag/src/main/java/com/uber/rxdogtag/DogTagSingleObserver.java @@ -15,15 +15,15 @@ */ package com.uber.rxdogtag; +import static com.uber.rxdogtag.RxDogTag.createException; +import static com.uber.rxdogtag.RxDogTag.guardedDelegateCall; +import static com.uber.rxdogtag.RxDogTag.reportError; + import io.reactivex.SingleObserver; import io.reactivex.disposables.Disposable; import io.reactivex.exceptions.OnErrorNotImplementedException; import io.reactivex.observers.LambdaConsumerIntrospection; -import static com.uber.rxdogtag.RxDogTag.createException; -import static com.uber.rxdogtag.RxDogTag.guardedDelegateCall; -import static com.uber.rxdogtag.RxDogTag.reportError; - /** * A delegating {@link SingleObserver} that throws {@link OnErrorNotImplementedException} with stack * element tagging to indicate the exact line number that was subscribed. diff --git a/rxdogtag/src/main/java/com/uber/rxdogtag/DogTagSubscriber.java b/rxdogtag/src/main/java/com/uber/rxdogtag/DogTagSubscriber.java index 69428b7..0845607 100644 --- a/rxdogtag/src/main/java/com/uber/rxdogtag/DogTagSubscriber.java +++ b/rxdogtag/src/main/java/com/uber/rxdogtag/DogTagSubscriber.java @@ -15,16 +15,16 @@ */ package com.uber.rxdogtag; +import static com.uber.rxdogtag.RxDogTag.createException; +import static com.uber.rxdogtag.RxDogTag.guardedDelegateCall; +import static com.uber.rxdogtag.RxDogTag.reportError; + import io.reactivex.FlowableSubscriber; import io.reactivex.exceptions.OnErrorNotImplementedException; import io.reactivex.observers.LambdaConsumerIntrospection; import org.reactivestreams.Subscriber; import org.reactivestreams.Subscription; -import static com.uber.rxdogtag.RxDogTag.createException; -import static com.uber.rxdogtag.RxDogTag.guardedDelegateCall; -import static com.uber.rxdogtag.RxDogTag.reportError; - /** * A delegating {@link Subscriber} that throws {@link OnErrorNotImplementedException} with stack * element tagging to indicate the exact line number that was subscribed. diff --git a/rxdogtag/src/main/java/com/uber/rxdogtag/RxDogTag.java b/rxdogtag/src/main/java/com/uber/rxdogtag/RxDogTag.java index 9ce2495..e7a7f56 100644 --- a/rxdogtag/src/main/java/com/uber/rxdogtag/RxDogTag.java +++ b/rxdogtag/src/main/java/com/uber/rxdogtag/RxDogTag.java @@ -15,6 +15,10 @@ */ package com.uber.rxdogtag; +import static java.util.Arrays.asList; +import static java.util.Collections.unmodifiableList; +import static java.util.Collections.unmodifiableSet; + import io.reactivex.CompletableObserver; import io.reactivex.MaybeObserver; import io.reactivex.Observable; @@ -34,10 +38,6 @@ import java.util.Set; import org.reactivestreams.Subscriber; -import static java.util.Arrays.asList; -import static java.util.Collections.unmodifiableList; -import static java.util.Collections.unmodifiableSet; - /** * RxDogTag is a mechanism to automatically detect RxJava observers with no error handling and wrap * them in {@code DogTagObserver}s that attempt to deduce the line number that {@code subscribe()} @@ -224,7 +224,8 @@ static void guardedDelegateCall(NonCheckingConsumer errorConsumer, Ru } finally { Thread.currentThread().setUncaughtExceptionHandler(h); } - }/** + } + /** * Creates a new {@link OnErrorNotImplementedException} instance with an empty stacktrace and its * cause with a modified stacktrace. If the original cause is not an instance of * OnErrorNotImplementedException, a new one is created with the cause as its original cause. The @@ -312,8 +313,8 @@ static OnErrorNotImplementedException createException( } /** - * Shorthand for {@link #createException(Configuration, Throwable, Throwable, String)} + - * {@link RxJavaPlugins#onError(Throwable)}. + * Shorthand for {@link #createException(Configuration, Throwable, Throwable, String)} + {@link + * RxJavaPlugins#onError(Throwable)}. * * @param stackSource the source throwable to extract a stack element tag from. * @param originalCause the cause of the original error. diff --git a/rxdogtag/src/main/java/com/uber/rxdogtag/RxDogTagTaggedExceptionReceiver.java b/rxdogtag/src/main/java/com/uber/rxdogtag/RxDogTagTaggedExceptionReceiver.java index e13989a..c6e3d8b 100644 --- a/rxdogtag/src/main/java/com/uber/rxdogtag/RxDogTagTaggedExceptionReceiver.java +++ b/rxdogtag/src/main/java/com/uber/rxdogtag/RxDogTagTaggedExceptionReceiver.java @@ -1,19 +1,32 @@ +/* + * Copyright (C) 2019. Uber Technologies + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.uber.rxdogtag; import io.reactivex.exceptions.OnErrorNotImplementedException; /** - * A marker type to indicate that RxDogTag's should pass the decorated stacktrace to - * {@link #onError(Throwable)}. Note that this will always be tried directly, and no guarded - * delegate behavior will be attempted even if - * {@link RxDogTag.Builder#guardObserverCallbacks(boolean)} is enabled in configuration. + * A marker type to indicate that RxDogTag's should pass the decorated stacktrace to {@link + * #onError(Throwable)}. Note that this will always be tried directly, and no guarded delegate + * behavior will be attempted even if {@link RxDogTag.Builder#guardObserverCallbacks(boolean)} is + * enabled in configuration. * - *

NOTE: RxDogTag exceptions are always - * {@link OnErrorNotImplementedException OnErrorNotImplementedExceptions}, as these have special - * behavior as an escape hatch in RxJava internals. This exception will have no "cause" property if - * the original exception was not already an {@link OnErrorNotImplementedException}. If it was, - * which is unusual, it is reused with its original cause (if any) and has its stacktrace modified. + *

NOTE: RxDogTag exceptions are always {@link OnErrorNotImplementedException + * OnErrorNotImplementedExceptions}, as these have special behavior as an escape hatch in RxJava + * internals. This exception will have no "cause" property if the original exception was not already + * an {@link OnErrorNotImplementedException}. If it was, which is unusual, it is reused with its + * original cause (if any) and has its stacktrace modified. */ -public interface RxDogTagTaggedExceptionReceiver extends RxDogTagErrorReceiver { - -} +public interface RxDogTagTaggedExceptionReceiver extends RxDogTagErrorReceiver {}