diff --git a/app/src/main/java/acr/browser/lightning/react/Observable.java b/app/src/main/java/acr/browser/lightning/react/Observable.java index 8169625..89dbef5 100644 --- a/app/src/main/java/acr/browser/lightning/react/Observable.java +++ b/app/src/main/java/acr/browser/lightning/react/Observable.java @@ -21,12 +21,12 @@ public class Observable { private static final String TAG = Observable.class.getSimpleName(); - @NonNull private Action mAction; + @NonNull private final Action mAction; @Nullable private Executor mSubscriber; @Nullable private Executor mObserver; @NonNull private final Executor mDefault; - public Observable(@NonNull Action action) { + private Observable(@NonNull Action action) { mAction = action; Looper looper = Looper.myLooper(); Preconditions.checkNonNull(looper); @@ -111,7 +111,7 @@ public class Observable { public void onComplete() { if (!mOnCompleteExecuted) { mOnCompleteExecuted = true; - executeOnObserverThread(new OnCompleteRunnable(subscription)); + executeOnObserverThread(new OnCompleteRunnable<>(subscription)); } else { Log.e(TAG, "onComplete called more than once"); throw new RuntimeException("onComplete called more than once"); @@ -121,7 +121,7 @@ public class Observable { @Override public void onNext(final T item) { if (!mOnCompleteExecuted) { - executeOnObserverThread(new OnNextRunnable(subscription, item)); + executeOnObserverThread(new OnNextRunnable<>(subscription, item)); } else { Log.e(TAG, "onComplete has been already called, onNext should not be called"); throw new RuntimeException("onNext should not be called after onComplete has been called"); @@ -149,10 +149,10 @@ public class Observable { } } - private static class OnCompleteRunnable implements Runnable { - private final Subscription subscription; + private static class OnCompleteRunnable implements Runnable { + private final Subscription subscription; - public OnCompleteRunnable(Subscription subscription) {this.subscription = subscription;} + public OnCompleteRunnable(Subscription subscription) {this.subscription = subscription;} @Override public void run() { @@ -160,7 +160,7 @@ public class Observable { } } - private class OnNextRunnable implements Runnable { + private static class OnNextRunnable implements Runnable { private final Subscription subscription; private final T item; diff --git a/build.gradle b/build.gradle index 19694a3..eccee5b 100644 --- a/build.gradle +++ b/build.gradle @@ -12,8 +12,6 @@ buildscript { allprojects { repositories { jcenter() - maven { - url 'https://oss.sonatype.org/content/repositories/snapshots/' - } + mavenCentral() } }