diff --git a/src/main/java/rx/Observable.java b/src/main/java/rx/Observable.java index c907d73280..fecad14ae4 100644 --- a/src/main/java/rx/Observable.java +++ b/src/main/java/rx/Observable.java @@ -60,7 +60,7 @@ protected Observable(OnSubscribe f) { this.onSubscribe = f; } - private static final RxJavaObservableExecutionHook hook = RxJavaPlugins.getInstance().getObservableExecutionHook(); + static final RxJavaObservableExecutionHook hook = RxJavaPlugins.getInstance().getObservableExecutionHook(); /** * Returns an Observable that will execute the specified function when a {@link Subscriber} subscribes to diff --git a/src/main/java/rx/Single.java b/src/main/java/rx/Single.java index 60ef33b949..2d332e5de8 100644 --- a/src/main/java/rx/Single.java +++ b/src/main/java/rx/Single.java @@ -111,7 +111,7 @@ private Single(final Observable.OnSubscribe f) { this.onSubscribe = f; } - private static final RxJavaObservableExecutionHook hook = RxJavaPlugins.getInstance().getObservableExecutionHook(); + static final RxJavaObservableExecutionHook hook = RxJavaPlugins.getInstance().getObservableExecutionHook(); /** * Returns a Single that will execute the specified function when a {@link SingleSubscriber} executes it or diff --git a/src/main/java/rx/functions/Actions.java b/src/main/java/rx/functions/Actions.java index 862bba221c..ea18eaed91 100644 --- a/src/main/java/rx/functions/Actions.java +++ b/src/main/java/rx/functions/Actions.java @@ -43,6 +43,9 @@ private static final class EmptyAction imple Action8, Action9, ActionN { + EmptyAction() { + } + @Override public void call() { } diff --git a/src/main/java/rx/internal/operators/BlockingOperatorMostRecent.java b/src/main/java/rx/internal/operators/BlockingOperatorMostRecent.java index 89d236aabb..9b6cf64bf2 100644 --- a/src/main/java/rx/internal/operators/BlockingOperatorMostRecent.java +++ b/src/main/java/rx/internal/operators/BlockingOperatorMostRecent.java @@ -63,8 +63,8 @@ public Iterator iterator() { private static final class MostRecentObserver extends Subscriber { final NotificationLite nl = NotificationLite.instance(); volatile Object value; - - private MostRecentObserver(T value) { + + MostRecentObserver(T value) { this.value = nl.next(value); } diff --git a/src/main/java/rx/internal/operators/BlockingOperatorNext.java b/src/main/java/rx/internal/operators/BlockingOperatorNext.java index f81577f9b3..7a55a663eb 100644 --- a/src/main/java/rx/internal/operators/BlockingOperatorNext.java +++ b/src/main/java/rx/internal/operators/BlockingOperatorNext.java @@ -66,7 +66,7 @@ public Iterator iterator() { private Throwable error = null; private boolean started = false; - private NextIterator(Observable items, NextObserver observer) { + NextIterator(Observable items, NextObserver observer) { this.items = items; this.observer = observer; } @@ -149,6 +149,9 @@ private static class NextObserver extends Subscriber> buf = new ArrayBlockingQueue>(1); final AtomicInteger waiting = new AtomicInteger(); + NextObserver() { + } + @Override public void onCompleted() { // ignore diff --git a/src/main/java/rx/internal/operators/BufferUntilSubscriber.java b/src/main/java/rx/internal/operators/BufferUntilSubscriber.java index f486c397f7..5e794de018 100644 --- a/src/main/java/rx/internal/operators/BufferUntilSubscriber.java +++ b/src/main/java/rx/internal/operators/BufferUntilSubscriber.java @@ -187,7 +187,7 @@ public boolean hasObservers() { } @SuppressWarnings("rawtypes") - private final static Observer EMPTY_OBSERVER = new Observer() { + final static Observer EMPTY_OBSERVER = new Observer() { @Override public void onCompleted() { diff --git a/src/main/java/rx/internal/operators/NotificationLite.java b/src/main/java/rx/internal/operators/NotificationLite.java index cd223e6784..0293beab95 100644 --- a/src/main/java/rx/internal/operators/NotificationLite.java +++ b/src/main/java/rx/internal/operators/NotificationLite.java @@ -71,7 +71,7 @@ public String toString() { private static class OnErrorSentinel implements Serializable { private static final long serialVersionUID = 3; - private final Throwable e; + final Throwable e; public OnErrorSentinel(Throwable e) { this.e = e; diff --git a/src/main/java/rx/internal/operators/OnSubscribeAmb.java b/src/main/java/rx/internal/operators/OnSubscribeAmb.java index 2ddd0dc820..2fe48d812f 100644 --- a/src/main/java/rx/internal/operators/OnSubscribeAmb.java +++ b/src/main/java/rx/internal/operators/OnSubscribeAmb.java @@ -271,7 +271,7 @@ private static final class AmbSubscriber extends Subscriber { private final Selection selection; private boolean chosen; - private AmbSubscriber(long requested, Subscriber subscriber, Selection selection) { + AmbSubscriber(long requested, Subscriber subscriber, Selection selection) { this.subscriber = subscriber; this.selection = selection; // initial request @@ -434,7 +434,7 @@ public void request(long n) { }); } - private static void unsubscribeAmbSubscribers(Collection> ambSubscribers) { + static void unsubscribeAmbSubscribers(Collection> ambSubscribers) { if(!ambSubscribers.isEmpty()) { for (AmbSubscriber other : ambSubscribers) { other.unsubscribe(); diff --git a/src/main/java/rx/internal/operators/OnSubscribeFromIterable.java b/src/main/java/rx/internal/operators/OnSubscribeFromIterable.java index f4790e75bd..b94e35c35c 100644 --- a/src/main/java/rx/internal/operators/OnSubscribeFromIterable.java +++ b/src/main/java/rx/internal/operators/OnSubscribeFromIterable.java @@ -55,7 +55,7 @@ private static final class IterableProducer extends AtomicLong implements Pro private final Subscriber o; private final Iterator it; - private IterableProducer(Subscriber o, Iterator it) { + IterableProducer(Subscriber o, Iterator it) { this.o = o; this.it = it; } diff --git a/src/main/java/rx/internal/operators/OnSubscribeRange.java b/src/main/java/rx/internal/operators/OnSubscribeRange.java index 383d17f28f..c7631b2cb9 100644 --- a/src/main/java/rx/internal/operators/OnSubscribeRange.java +++ b/src/main/java/rx/internal/operators/OnSubscribeRange.java @@ -46,7 +46,7 @@ private static final class RangeProducer extends AtomicLong implements Producer private final int end; private long index; - private RangeProducer(Subscriber o, int start, int end) { + RangeProducer(Subscriber o, int start, int end) { this.o = o; this.index = start; this.end = end; diff --git a/src/main/java/rx/internal/operators/OnSubscribeRedo.java b/src/main/java/rx/internal/operators/OnSubscribeRedo.java index 6420e66451..d30ddc1343 100644 --- a/src/main/java/rx/internal/operators/OnSubscribeRedo.java +++ b/src/main/java/rx/internal/operators/OnSubscribeRedo.java @@ -67,7 +67,7 @@ public Notification call(Notification terminal) { }; public static final class RedoFinite implements Func1>, Observable> { - private final long count; + final long count; public RedoFinite(long count) { this.count = count; @@ -98,7 +98,7 @@ public Notification call(Notification terminalNotification) { } public static final class RetryWithPredicate implements Func1>, Observable>> { - private final Func2 predicate; + final Func2 predicate; public RetryWithPredicate(Func2 predicate) { this.predicate = predicate; @@ -173,10 +173,10 @@ public static Observable redo(Observable source, Func1(source, notificationHandler, false, false, scheduler)); } - private final Observable source; + final Observable source; private final Func1>, ? extends Observable> controlHandlerFunction; - private final boolean stopOnComplete; - private final boolean stopOnError; + final boolean stopOnComplete; + final boolean stopOnError; private final Scheduler scheduler; private OnSubscribeRedo(Observable source, Func1>, ? extends Observable> f, boolean stopOnComplete, boolean stopOnError, diff --git a/src/main/java/rx/internal/operators/OnSubscribeRefCount.java b/src/main/java/rx/internal/operators/OnSubscribeRefCount.java index cc422453f2..82ec0e6c38 100644 --- a/src/main/java/rx/internal/operators/OnSubscribeRefCount.java +++ b/src/main/java/rx/internal/operators/OnSubscribeRefCount.java @@ -38,13 +38,13 @@ public final class OnSubscribeRefCount implements OnSubscribe { private final ConnectableObservable source; - private volatile CompositeSubscription baseSubscription = new CompositeSubscription(); - private final AtomicInteger subscriptionCount = new AtomicInteger(0); + volatile CompositeSubscription baseSubscription = new CompositeSubscription(); + final AtomicInteger subscriptionCount = new AtomicInteger(0); /** * Use this lock for every subscription and disconnect action. */ - private final ReentrantLock lock = new ReentrantLock(); + final ReentrantLock lock = new ReentrantLock(); /** * Constructor. diff --git a/src/main/java/rx/internal/operators/OnSubscribeToObservableFuture.java b/src/main/java/rx/internal/operators/OnSubscribeToObservableFuture.java index 72adcf5d50..0f6e2e3f76 100644 --- a/src/main/java/rx/internal/operators/OnSubscribeToObservableFuture.java +++ b/src/main/java/rx/internal/operators/OnSubscribeToObservableFuture.java @@ -41,7 +41,7 @@ private OnSubscribeToObservableFuture() { } /* package accessible for unit tests */static class ToObservableFuture implements OnSubscribe { - private final Future that; + final Future that; private final long time; private final TimeUnit unit; diff --git a/src/main/java/rx/internal/operators/OnSubscribeUsing.java b/src/main/java/rx/internal/operators/OnSubscribeUsing.java index 4355e78221..4dd483b4cc 100644 --- a/src/main/java/rx/internal/operators/OnSubscribeUsing.java +++ b/src/main/java/rx/internal/operators/OnSubscribeUsing.java @@ -105,7 +105,7 @@ private static final class DisposeAction extends AtomicBoolean impleme private Action1 dispose; private Resource resource; - private DisposeAction(Action1 dispose, Resource resource) { + DisposeAction(Action1 dispose, Resource resource) { this.dispose = dispose; this.resource = resource; lazySet(false); // StoreStore barrier diff --git a/src/main/java/rx/internal/operators/OperatorAll.java b/src/main/java/rx/internal/operators/OperatorAll.java index 00845c7334..91160c048e 100644 --- a/src/main/java/rx/internal/operators/OperatorAll.java +++ b/src/main/java/rx/internal/operators/OperatorAll.java @@ -28,7 +28,7 @@ * */ public final class OperatorAll implements Operator { - private final Func1 predicate; + final Func1 predicate; public OperatorAll(Func1 predicate) { this.predicate = predicate; diff --git a/src/main/java/rx/internal/operators/OperatorAny.java b/src/main/java/rx/internal/operators/OperatorAny.java index ac84ec961f..50934a6513 100644 --- a/src/main/java/rx/internal/operators/OperatorAny.java +++ b/src/main/java/rx/internal/operators/OperatorAny.java @@ -27,8 +27,8 @@ * an observable sequence satisfies a condition, otherwise false. */ public final class OperatorAny implements Operator { - private final Func1 predicate; - private final boolean returnOnEmpty; + final Func1 predicate; + final boolean returnOnEmpty; public OperatorAny(Func1 predicate, boolean returnOnEmpty) { this.predicate = predicate; diff --git a/src/main/java/rx/internal/operators/OperatorAsObservable.java b/src/main/java/rx/internal/operators/OperatorAsObservable.java index 41f2cb3ebc..8efa3e8f6f 100644 --- a/src/main/java/rx/internal/operators/OperatorAsObservable.java +++ b/src/main/java/rx/internal/operators/OperatorAsObservable.java @@ -37,7 +37,7 @@ private static final class Holder { public static OperatorAsObservable instance() { return (OperatorAsObservable)Holder.INSTANCE; } - private OperatorAsObservable() { } + OperatorAsObservable() { } @Override public Subscriber call(Subscriber s) { return s; diff --git a/src/main/java/rx/internal/operators/OperatorCast.java b/src/main/java/rx/internal/operators/OperatorCast.java index 248fcb1970..825847b5ce 100644 --- a/src/main/java/rx/internal/operators/OperatorCast.java +++ b/src/main/java/rx/internal/operators/OperatorCast.java @@ -24,7 +24,7 @@ */ public class OperatorCast implements Operator { - private final Class castClass; + final Class castClass; public OperatorCast(Class castClass) { this.castClass = castClass; diff --git a/src/main/java/rx/internal/operators/OperatorConcat.java b/src/main/java/rx/internal/operators/OperatorConcat.java index c3ab903658..8455cc55b3 100644 --- a/src/main/java/rx/internal/operators/OperatorConcat.java +++ b/src/main/java/rx/internal/operators/OperatorConcat.java @@ -50,7 +50,7 @@ private static final class Holder { public static OperatorConcat instance() { return (OperatorConcat)Holder.INSTANCE; } - private OperatorConcat() { } + OperatorConcat() { } @Override public Subscriber> call(final Subscriber child) { final SerializedSubscriber s = new SerializedSubscriber(child); diff --git a/src/main/java/rx/internal/operators/OperatorDematerialize.java b/src/main/java/rx/internal/operators/OperatorDematerialize.java index d9a154d795..5fd8d7fdfa 100644 --- a/src/main/java/rx/internal/operators/OperatorDematerialize.java +++ b/src/main/java/rx/internal/operators/OperatorDematerialize.java @@ -42,7 +42,7 @@ private static final class Holder { public static OperatorDematerialize instance() { return Holder.INSTANCE; // using raw types because the type inference is not good enough } - private OperatorDematerialize() { } + OperatorDematerialize() { } @Override public Subscriber> call(final Subscriber child) { return new Subscriber>(child) { diff --git a/src/main/java/rx/internal/operators/OperatorDoOnEach.java b/src/main/java/rx/internal/operators/OperatorDoOnEach.java index 1e3a680dac..3e274b17c4 100644 --- a/src/main/java/rx/internal/operators/OperatorDoOnEach.java +++ b/src/main/java/rx/internal/operators/OperatorDoOnEach.java @@ -25,7 +25,7 @@ * Converts the elements of an observable sequence to the specified type. */ public class OperatorDoOnEach implements Operator { - private final Observer doOnEachObserver; + final Observer doOnEachObserver; public OperatorDoOnEach(Observer doOnEachObserver) { this.doOnEachObserver = doOnEachObserver; diff --git a/src/main/java/rx/internal/operators/OperatorDoOnRequest.java b/src/main/java/rx/internal/operators/OperatorDoOnRequest.java index 2c77a584ca..d68c3497aa 100644 --- a/src/main/java/rx/internal/operators/OperatorDoOnRequest.java +++ b/src/main/java/rx/internal/operators/OperatorDoOnRequest.java @@ -28,7 +28,7 @@ */ public class OperatorDoOnRequest implements Operator { - private final Action1 request; + final Action1 request; public OperatorDoOnRequest(Action1 request) { this.request = request; @@ -55,7 +55,7 @@ public void request(long n) { private static final class ParentSubscriber extends Subscriber { private final Subscriber child; - private ParentSubscriber(Subscriber child) { + ParentSubscriber(Subscriber child) { this.child = child; } diff --git a/src/main/java/rx/internal/operators/OperatorElementAt.java b/src/main/java/rx/internal/operators/OperatorElementAt.java index 19a156dfa2..516e73f282 100644 --- a/src/main/java/rx/internal/operators/OperatorElementAt.java +++ b/src/main/java/rx/internal/operators/OperatorElementAt.java @@ -26,9 +26,9 @@ */ public final class OperatorElementAt implements Operator { - private final int index; - private final boolean hasDefault; - private final T defaultValue; + final int index; + final boolean hasDefault; + final T defaultValue; public OperatorElementAt(int index) { this(index, null, false); diff --git a/src/main/java/rx/internal/operators/OperatorFilter.java b/src/main/java/rx/internal/operators/OperatorFilter.java index 2dbd827a94..3704dbc4a3 100644 --- a/src/main/java/rx/internal/operators/OperatorFilter.java +++ b/src/main/java/rx/internal/operators/OperatorFilter.java @@ -27,7 +27,7 @@ */ public final class OperatorFilter implements Operator { - private final Func1 predicate; + final Func1 predicate; public OperatorFilter(Func1 predicate) { this.predicate = predicate; diff --git a/src/main/java/rx/internal/operators/OperatorIgnoreElements.java b/src/main/java/rx/internal/operators/OperatorIgnoreElements.java index 3f38d8e585..00098f85a2 100644 --- a/src/main/java/rx/internal/operators/OperatorIgnoreElements.java +++ b/src/main/java/rx/internal/operators/OperatorIgnoreElements.java @@ -29,7 +29,7 @@ public static OperatorIgnoreElements instance() { return (OperatorIgnoreElements) Holder.INSTANCE; } - private OperatorIgnoreElements() { + OperatorIgnoreElements() { } diff --git a/src/main/java/rx/internal/operators/OperatorMap.java b/src/main/java/rx/internal/operators/OperatorMap.java index 5816887479..90925c2764 100644 --- a/src/main/java/rx/internal/operators/OperatorMap.java +++ b/src/main/java/rx/internal/operators/OperatorMap.java @@ -28,7 +28,7 @@ */ public final class OperatorMap implements Operator { - private final Func1 transformer; + final Func1 transformer; public OperatorMap(Func1 transformer) { this.transformer = transformer; diff --git a/src/main/java/rx/internal/operators/OperatorMapNotification.java b/src/main/java/rx/internal/operators/OperatorMapNotification.java index a0c0994032..8abe7b828e 100644 --- a/src/main/java/rx/internal/operators/OperatorMapNotification.java +++ b/src/main/java/rx/internal/operators/OperatorMapNotification.java @@ -34,9 +34,9 @@ */ public final class OperatorMapNotification implements Operator { - private final Func1 onNext; - private final Func1 onError; - private final Func0 onCompleted; + final Func1 onNext; + final Func1 onError; + final Func0 onCompleted; public OperatorMapNotification(Func1 onNext, Func1 onError, Func0 onCompleted) { this.onNext = onNext; @@ -58,8 +58,8 @@ final class MapNotificationSubscriber extends Subscriber { private final Subscriber o; private final ProducerArbiter pa; final SingleEmitter emitter; - - private MapNotificationSubscriber(ProducerArbiter pa, Subscriber o) { + + MapNotificationSubscriber(ProducerArbiter pa, Subscriber o) { this.pa = pa; this.o = o; this.emitter = new SingleEmitter(o, pa, this); diff --git a/src/main/java/rx/internal/operators/OperatorMaterialize.java b/src/main/java/rx/internal/operators/OperatorMaterialize.java index 32b49c6c77..4a90f1f43f 100644 --- a/src/main/java/rx/internal/operators/OperatorMaterialize.java +++ b/src/main/java/rx/internal/operators/OperatorMaterialize.java @@ -47,7 +47,7 @@ public static OperatorMaterialize instance() { return (OperatorMaterialize) Holder.INSTANCE; } - private OperatorMaterialize() { + OperatorMaterialize() { } @Override diff --git a/src/main/java/rx/internal/operators/OperatorMerge.java b/src/main/java/rx/internal/operators/OperatorMerge.java index 3fd96791a0..56a7058d26 100644 --- a/src/main/java/rx/internal/operators/OperatorMerge.java +++ b/src/main/java/rx/internal/operators/OperatorMerge.java @@ -90,7 +90,7 @@ public static OperatorMerge instance(boolean delayErrors, int maxConcurre final boolean delayErrors; final int maxConcurrent; - private OperatorMerge(boolean delayErrors, int maxConcurrent) { + OperatorMerge(boolean delayErrors, int maxConcurrent) { this.delayErrors = delayErrors; this.maxConcurrent = maxConcurrent; } diff --git a/src/main/java/rx/internal/operators/OperatorMulticast.java b/src/main/java/rx/internal/operators/OperatorMulticast.java index 8ec88140c2..fcdededbed 100644 --- a/src/main/java/rx/internal/operators/OperatorMulticast.java +++ b/src/main/java/rx/internal/operators/OperatorMulticast.java @@ -46,9 +46,9 @@ public final class OperatorMulticast extends ConnectableObservable { final List> waitingForConnect; /** Guarded by guard. */ - private Subscriber subscription; + Subscriber subscription; // wraps subscription above for unsubscription using guard - private Subscription guardedSubscription; + Subscription guardedSubscription; public OperatorMulticast(Observable source, final Func0> subjectFactory) { this(new Object(), new AtomicReference>(), new ArrayList>(), source, subjectFactory); diff --git a/src/main/java/rx/internal/operators/OperatorOnBackpressureBuffer.java b/src/main/java/rx/internal/operators/OperatorOnBackpressureBuffer.java index cb39a53ef7..4aff6fc162 100644 --- a/src/main/java/rx/internal/operators/OperatorOnBackpressureBuffer.java +++ b/src/main/java/rx/internal/operators/OperatorOnBackpressureBuffer.java @@ -39,8 +39,8 @@ private static class Holder { public static OperatorOnBackpressureBuffer instance() { return (OperatorOnBackpressureBuffer) Holder.INSTANCE; } - - private OperatorOnBackpressureBuffer() { + + OperatorOnBackpressureBuffer() { this.capacity = null; this.onOverflow = null; } diff --git a/src/main/java/rx/internal/operators/OperatorOnBackpressureDrop.java b/src/main/java/rx/internal/operators/OperatorOnBackpressureDrop.java index fee6289a4b..a9a8def2d4 100644 --- a/src/main/java/rx/internal/operators/OperatorOnBackpressureDrop.java +++ b/src/main/java/rx/internal/operators/OperatorOnBackpressureDrop.java @@ -38,9 +38,9 @@ public static OperatorOnBackpressureDrop instance() { return (OperatorOnBackpressureDrop)Holder.INSTANCE; } - private final Action1 onDrop; + final Action1 onDrop; - private OperatorOnBackpressureDrop() { + OperatorOnBackpressureDrop() { this(null); } diff --git a/src/main/java/rx/internal/operators/OperatorOnBackpressureLatest.java b/src/main/java/rx/internal/operators/OperatorOnBackpressureLatest.java index 512010515c..2bf909289e 100644 --- a/src/main/java/rx/internal/operators/OperatorOnBackpressureLatest.java +++ b/src/main/java/rx/internal/operators/OperatorOnBackpressureLatest.java @@ -194,7 +194,7 @@ void emit() { static final class LatestSubscriber extends Subscriber { private final LatestEmitter producer; - private LatestSubscriber(LatestEmitter producer) { + LatestSubscriber(LatestEmitter producer) { this.producer = producer; } diff --git a/src/main/java/rx/internal/operators/OperatorOnErrorResumeNextViaFunction.java b/src/main/java/rx/internal/operators/OperatorOnErrorResumeNextViaFunction.java index 5141a0974d..b12c10d391 100644 --- a/src/main/java/rx/internal/operators/OperatorOnErrorResumeNextViaFunction.java +++ b/src/main/java/rx/internal/operators/OperatorOnErrorResumeNextViaFunction.java @@ -43,7 +43,7 @@ */ public final class OperatorOnErrorResumeNextViaFunction implements Operator { - private final Func1> resumeFunction; + final Func1> resumeFunction; public OperatorOnErrorResumeNextViaFunction(Func1> f) { this.resumeFunction = f; diff --git a/src/main/java/rx/internal/operators/OperatorScan.java b/src/main/java/rx/internal/operators/OperatorScan.java index f91d9b28f2..4ce2e4ce4c 100644 --- a/src/main/java/rx/internal/operators/OperatorScan.java +++ b/src/main/java/rx/internal/operators/OperatorScan.java @@ -44,7 +44,7 @@ public final class OperatorScan implements Operator { private final Func0 initialValueFactory; - private final Func2 accumulator; + final Func2 accumulator; // sentinel if we don't receive an initial value private static final Object NO_INITIAL_VALUE = new Object(); diff --git a/src/main/java/rx/internal/operators/OperatorSequenceEqual.java b/src/main/java/rx/internal/operators/OperatorSequenceEqual.java index b03855f63a..06a30edcde 100644 --- a/src/main/java/rx/internal/operators/OperatorSequenceEqual.java +++ b/src/main/java/rx/internal/operators/OperatorSequenceEqual.java @@ -33,7 +33,7 @@ private OperatorSequenceEqual() { } /** NotificationLite doesn't work as zip uses it. */ - private static final Object LOCAL_ONCOMPLETED = new Object(); + static final Object LOCAL_ONCOMPLETED = new Object(); static Observable materializeLite(Observable source) { return concat( source.map(new Func1() { diff --git a/src/main/java/rx/internal/operators/OperatorSerialize.java b/src/main/java/rx/internal/operators/OperatorSerialize.java index 334ddef679..a8d7dd4a47 100644 --- a/src/main/java/rx/internal/operators/OperatorSerialize.java +++ b/src/main/java/rx/internal/operators/OperatorSerialize.java @@ -32,7 +32,7 @@ private static final class Holder { public static OperatorSerialize instance() { return (OperatorSerialize)Holder.INSTANCE; } - private OperatorSerialize() { } + OperatorSerialize() { } @Override public Subscriber call(final Subscriber s) { return new SerializedSubscriber(new Subscriber(s) { diff --git a/src/main/java/rx/internal/operators/OperatorSingle.java b/src/main/java/rx/internal/operators/OperatorSingle.java index 53afca58c8..252b6c4ac3 100644 --- a/src/main/java/rx/internal/operators/OperatorSingle.java +++ b/src/main/java/rx/internal/operators/OperatorSingle.java @@ -46,8 +46,8 @@ private static class Holder { public static OperatorSingle instance() { return (OperatorSingle) Holder.INSTANCE; } - - private OperatorSingle() { + + OperatorSingle() { this(false, null); } diff --git a/src/main/java/rx/internal/operators/OperatorSkipLast.java b/src/main/java/rx/internal/operators/OperatorSkipLast.java index 995e4eb777..be877a6b48 100644 --- a/src/main/java/rx/internal/operators/OperatorSkipLast.java +++ b/src/main/java/rx/internal/operators/OperatorSkipLast.java @@ -26,7 +26,7 @@ */ public class OperatorSkipLast implements Operator { - private final int count; + final int count; public OperatorSkipLast(int count) { if (count < 0) { diff --git a/src/main/java/rx/internal/operators/OperatorSkipLastTimed.java b/src/main/java/rx/internal/operators/OperatorSkipLastTimed.java index 7ea9c774b0..6bc24579ae 100644 --- a/src/main/java/rx/internal/operators/OperatorSkipLastTimed.java +++ b/src/main/java/rx/internal/operators/OperatorSkipLastTimed.java @@ -29,8 +29,8 @@ */ public class OperatorSkipLastTimed implements Operator { - private final long timeInMillis; - private final Scheduler scheduler; + final long timeInMillis; + final Scheduler scheduler; public OperatorSkipLastTimed(long time, TimeUnit unit, Scheduler scheduler) { this.timeInMillis = unit.toMillis(time); diff --git a/src/main/java/rx/internal/operators/OperatorSkipWhile.java b/src/main/java/rx/internal/operators/OperatorSkipWhile.java index 37ff4b498d..7936901a0e 100644 --- a/src/main/java/rx/internal/operators/OperatorSkipWhile.java +++ b/src/main/java/rx/internal/operators/OperatorSkipWhile.java @@ -25,7 +25,7 @@ * as soon as the condition becomes false. */ public final class OperatorSkipWhile implements Operator { - private final Func2 predicate; + final Func2 predicate; public OperatorSkipWhile(Func2 predicate) { this.predicate = predicate; diff --git a/src/main/java/rx/internal/operators/OperatorSwitch.java b/src/main/java/rx/internal/operators/OperatorSwitch.java index cbd02e1b58..5f95f38c3d 100644 --- a/src/main/java/rx/internal/operators/OperatorSwitch.java +++ b/src/main/java/rx/internal/operators/OperatorSwitch.java @@ -47,9 +47,9 @@ private static final class Holder { public static OperatorSwitch instance() { return (OperatorSwitch)Holder.INSTANCE; } - - private OperatorSwitch() { } - + + OperatorSwitch() { } + @Override public Subscriber> call(final Subscriber child) { SwitchSubscriber sws = new SwitchSubscriber(child); diff --git a/src/main/java/rx/internal/operators/OperatorTakeLast.java b/src/main/java/rx/internal/operators/OperatorTakeLast.java index 54c1a0c43a..2812c4e87c 100644 --- a/src/main/java/rx/internal/operators/OperatorTakeLast.java +++ b/src/main/java/rx/internal/operators/OperatorTakeLast.java @@ -28,7 +28,7 @@ */ public final class OperatorTakeLast implements Operator { - private final int count; + final int count; public OperatorTakeLast(int count) { if (count < 0) { diff --git a/src/main/java/rx/internal/operators/OperatorTakeLastOne.java b/src/main/java/rx/internal/operators/OperatorTakeLastOne.java index a7998a1667..6f8bf86259 100644 --- a/src/main/java/rx/internal/operators/OperatorTakeLastOne.java +++ b/src/main/java/rx/internal/operators/OperatorTakeLastOne.java @@ -18,7 +18,7 @@ public static OperatorTakeLastOne instance() { return (OperatorTakeLastOne) Holder.INSTANCE; } - private OperatorTakeLastOne() { + OperatorTakeLastOne() { } diff --git a/src/main/java/rx/internal/operators/OperatorTakeLastTimed.java b/src/main/java/rx/internal/operators/OperatorTakeLastTimed.java index 48544f505c..ec7cc12493 100644 --- a/src/main/java/rx/internal/operators/OperatorTakeLastTimed.java +++ b/src/main/java/rx/internal/operators/OperatorTakeLastTimed.java @@ -30,9 +30,9 @@ */ public final class OperatorTakeLastTimed implements Operator { - private final long ageMillis; - private final Scheduler scheduler; - private final int count; + final long ageMillis; + final Scheduler scheduler; + final int count; public OperatorTakeLastTimed(long time, TimeUnit unit, Scheduler scheduler) { this.ageMillis = unit.toMillis(time); diff --git a/src/main/java/rx/internal/operators/OperatorTakeUntilPredicate.java b/src/main/java/rx/internal/operators/OperatorTakeUntilPredicate.java index c65946bab1..36ce00271b 100644 --- a/src/main/java/rx/internal/operators/OperatorTakeUntilPredicate.java +++ b/src/main/java/rx/internal/operators/OperatorTakeUntilPredicate.java @@ -31,7 +31,7 @@ private final class ParentSubscriber extends Subscriber { private final Subscriber child; private boolean done = false; - private ParentSubscriber(Subscriber child) { + ParentSubscriber(Subscriber child) { this.child = child; } @@ -73,7 +73,7 @@ void downstreamRequest(long n) { } } - private final Func1 stopPredicate; + final Func1 stopPredicate; public OperatorTakeUntilPredicate(final Func1 stopPredicate) { this.stopPredicate = stopPredicate; diff --git a/src/main/java/rx/internal/operators/OperatorTakeWhile.java b/src/main/java/rx/internal/operators/OperatorTakeWhile.java index 0c34df7b6f..e241ace057 100644 --- a/src/main/java/rx/internal/operators/OperatorTakeWhile.java +++ b/src/main/java/rx/internal/operators/OperatorTakeWhile.java @@ -28,7 +28,7 @@ */ public final class OperatorTakeWhile implements Operator { - private final Func2 predicate; + final Func2 predicate; public OperatorTakeWhile(final Func1 underlying) { this(new Func2() { diff --git a/src/main/java/rx/internal/operators/OperatorThrottleFirst.java b/src/main/java/rx/internal/operators/OperatorThrottleFirst.java index 0f14839e47..2bf960931d 100644 --- a/src/main/java/rx/internal/operators/OperatorThrottleFirst.java +++ b/src/main/java/rx/internal/operators/OperatorThrottleFirst.java @@ -25,8 +25,8 @@ */ public final class OperatorThrottleFirst implements Operator { - private final long timeInMilliseconds; - private final Scheduler scheduler; + final long timeInMilliseconds; + final Scheduler scheduler; public OperatorThrottleFirst(long windowDuration, TimeUnit unit, Scheduler scheduler) { this.timeInMilliseconds = unit.toMillis(windowDuration); diff --git a/src/main/java/rx/internal/operators/OperatorTimeInterval.java b/src/main/java/rx/internal/operators/OperatorTimeInterval.java index 4b76ea768d..e73f6fd0d3 100644 --- a/src/main/java/rx/internal/operators/OperatorTimeInterval.java +++ b/src/main/java/rx/internal/operators/OperatorTimeInterval.java @@ -25,7 +25,7 @@ */ public final class OperatorTimeInterval implements Operator, T> { - private final Scheduler scheduler; + final Scheduler scheduler; public OperatorTimeInterval(Scheduler scheduler) { this.scheduler = scheduler; diff --git a/src/main/java/rx/internal/operators/OperatorTimeoutBase.java b/src/main/java/rx/internal/operators/OperatorTimeoutBase.java index 65b940640c..d4700bcb9b 100644 --- a/src/main/java/rx/internal/operators/OperatorTimeoutBase.java +++ b/src/main/java/rx/internal/operators/OperatorTimeoutBase.java @@ -92,8 +92,8 @@ public Subscriber call(Subscriber subscriber) { final AtomicInteger terminated = new AtomicInteger(); final AtomicLong actual = new AtomicLong(); - - private TimeoutSubscriber( + + TimeoutSubscriber( SerializedSubscriber serializedSubscriber, TimeoutStub timeoutStub, SerialSubscription serial, Observable other, diff --git a/src/main/java/rx/internal/operators/OperatorTimestamp.java b/src/main/java/rx/internal/operators/OperatorTimestamp.java index 2e24fbf169..284c0e2124 100644 --- a/src/main/java/rx/internal/operators/OperatorTimestamp.java +++ b/src/main/java/rx/internal/operators/OperatorTimestamp.java @@ -27,7 +27,7 @@ */ public final class OperatorTimestamp implements Operator, T> { - private final Scheduler scheduler; + final Scheduler scheduler; public OperatorTimestamp(Scheduler scheduler) { this.scheduler = scheduler; diff --git a/src/main/java/rx/internal/operators/OperatorToMap.java b/src/main/java/rx/internal/operators/OperatorToMap.java index 5b81e071fb..0a1ea9fcd0 100644 --- a/src/main/java/rx/internal/operators/OperatorToMap.java +++ b/src/main/java/rx/internal/operators/OperatorToMap.java @@ -45,9 +45,9 @@ public Map call() { } - private final Func1 keySelector; + final Func1 keySelector; - private final Func1 valueSelector; + final Func1 valueSelector; private final Func0> mapFactory; diff --git a/src/main/java/rx/internal/operators/OperatorToMultimap.java b/src/main/java/rx/internal/operators/OperatorToMultimap.java index 6b840bed18..1f3423e02c 100644 --- a/src/main/java/rx/internal/operators/OperatorToMultimap.java +++ b/src/main/java/rx/internal/operators/OperatorToMultimap.java @@ -58,10 +58,10 @@ public Collection call(K t1) { } } - private final Func1 keySelector; - private final Func1 valueSelector; + final Func1 keySelector; + final Func1 valueSelector; private final Func0>> mapFactory; - private final Func1> collectionFactory; + final Func1> collectionFactory; /** * ToMultimap with key selector, custom value selector, diff --git a/src/main/java/rx/internal/operators/OperatorToObservableList.java b/src/main/java/rx/internal/operators/OperatorToObservableList.java index d2e9d717f6..66e0bb188a 100644 --- a/src/main/java/rx/internal/operators/OperatorToObservableList.java +++ b/src/main/java/rx/internal/operators/OperatorToObservableList.java @@ -49,7 +49,7 @@ private static final class Holder { public static OperatorToObservableList instance() { return (OperatorToObservableList)Holder.INSTANCE; } - private OperatorToObservableList() { } + OperatorToObservableList() { } @Override public Subscriber call(final Subscriber> o) { final SingleDelayedProducer> producer = new SingleDelayedProducer>(o); diff --git a/src/main/java/rx/internal/operators/OperatorToObservableSortedList.java b/src/main/java/rx/internal/operators/OperatorToObservableSortedList.java index 19246cbe7c..ab74e44f17 100644 --- a/src/main/java/rx/internal/operators/OperatorToObservableSortedList.java +++ b/src/main/java/rx/internal/operators/OperatorToObservableSortedList.java @@ -34,8 +34,8 @@ * the type of the items emitted by the source and the resulting {@code Observable}s */ public final class OperatorToObservableSortedList implements Operator, T> { - private final Comparator sortFunction; - private final int initialCapacity; + final Comparator sortFunction; + final int initialCapacity; @SuppressWarnings("unchecked") public OperatorToObservableSortedList(int initialCapacity) { @@ -105,6 +105,8 @@ public void onNext(T value) { private static Comparator DEFAULT_SORT_FUNCTION = new DefaultComparableFunction(); private static class DefaultComparableFunction implements Comparator { + DefaultComparableFunction() { + } // unchecked because we want to support Object for this default @SuppressWarnings("unchecked") diff --git a/src/main/java/rx/internal/operators/OperatorUnsubscribeOn.java b/src/main/java/rx/internal/operators/OperatorUnsubscribeOn.java index 20957e29f4..327b4d1d24 100644 --- a/src/main/java/rx/internal/operators/OperatorUnsubscribeOn.java +++ b/src/main/java/rx/internal/operators/OperatorUnsubscribeOn.java @@ -27,7 +27,7 @@ */ public class OperatorUnsubscribeOn implements Operator { - private final Scheduler scheduler; + final Scheduler scheduler; public OperatorUnsubscribeOn(Scheduler scheduler) { this.scheduler = scheduler; diff --git a/src/main/java/rx/internal/operators/OperatorZip.java b/src/main/java/rx/internal/operators/OperatorZip.java index 2c17761b14..91fc05f09f 100644 --- a/src/main/java/rx/internal/operators/OperatorZip.java +++ b/src/main/java/rx/internal/operators/OperatorZip.java @@ -178,7 +178,7 @@ public void request(long n) { } private static final class Zip extends AtomicLong { - private final Observer child; + final Observer child; private final FuncN zipFunction; private final CompositeSubscription childSubscription = new CompositeSubscription(); diff --git a/src/main/java/rx/internal/schedulers/EventLoopsScheduler.java b/src/main/java/rx/internal/schedulers/EventLoopsScheduler.java index 76d3f95926..afcf7464ed 100644 --- a/src/main/java/rx/internal/schedulers/EventLoopsScheduler.java +++ b/src/main/java/rx/internal/schedulers/EventLoopsScheduler.java @@ -26,8 +26,8 @@ public class EventLoopsScheduler extends Scheduler implements SchedulerLifecycle { /** Manages a fixed number of workers. */ private static final String THREAD_NAME_PREFIX = "RxComputationThreadPool-"; - private static final RxThreadFactory THREAD_FACTORY = new RxThreadFactory(THREAD_NAME_PREFIX); - /** + static final RxThreadFactory THREAD_FACTORY = new RxThreadFactory(THREAD_NAME_PREFIX); + /** * Key to setting the maximum number of computation scheduler threads. * Zero or less is interpreted as use available. Capped by available. */ @@ -172,8 +172,8 @@ public Subscription schedule(Action0 action, long delayTime, TimeUnit unit) { return poolWorker.scheduleActual(action, delayTime, unit, timed); } } - - private static final class PoolWorker extends NewThreadWorker { + + static final class PoolWorker extends NewThreadWorker { PoolWorker(ThreadFactory threadFactory) { super(threadFactory); } diff --git a/src/main/java/rx/internal/schedulers/ScheduledAction.java b/src/main/java/rx/internal/schedulers/ScheduledAction.java index 8ddd18870b..0f7d145a20 100644 --- a/src/main/java/rx/internal/schedulers/ScheduledAction.java +++ b/src/main/java/rx/internal/schedulers/ScheduledAction.java @@ -131,7 +131,7 @@ public void addParent(SubscriptionList parent) { private final class FutureCompleter implements Subscription { private final Future f; - private FutureCompleter(Future f) { + FutureCompleter(Future f) { this.f = f; } diff --git a/src/main/java/rx/internal/util/IndexedRingBuffer.java b/src/main/java/rx/internal/util/IndexedRingBuffer.java index f2fe163276..4bf941dee1 100644 --- a/src/main/java/rx/internal/util/IndexedRingBuffer.java +++ b/src/main/java/rx/internal/util/IndexedRingBuffer.java @@ -290,7 +290,7 @@ public void unsubscribe() { releaseToPool(); } - private IndexedRingBuffer() { + IndexedRingBuffer() { } /** @@ -483,8 +483,11 @@ private int forEach(Func1 action, int startIndex, int endInd } private static class ElementSection { - private final AtomicReferenceArray array = new AtomicReferenceArray(SIZE); - private final AtomicReference> next = new AtomicReference>(); + final AtomicReferenceArray array = new AtomicReferenceArray(SIZE); + final AtomicReference> next = new AtomicReference>(); + + ElementSection() { + } ElementSection getNext() { if (next.get() != null) { @@ -506,6 +509,9 @@ private static class IndexSection { private final AtomicIntegerArray unsafeArray = new AtomicIntegerArray(SIZE); + IndexSection() { + } + public int getAndSet(int expected, int newValue) { return unsafeArray.getAndSet(expected, newValue); } diff --git a/src/main/java/rx/internal/util/ObjectPool.java b/src/main/java/rx/internal/util/ObjectPool.java index 504c10cad4..0aa005208e 100644 --- a/src/main/java/rx/internal/util/ObjectPool.java +++ b/src/main/java/rx/internal/util/ObjectPool.java @@ -28,9 +28,9 @@ import rx.schedulers.Schedulers; public abstract class ObjectPool implements SchedulerLifecycle { - private Queue pool; - private final int minSize; - private final int maxSize; + Queue pool; + final int minSize; + final int maxSize; private final long validationInterval; private final AtomicReference schedulerWorker; diff --git a/src/main/java/rx/internal/util/ScalarSynchronousObservable.java b/src/main/java/rx/internal/util/ScalarSynchronousObservable.java index 145a67096e..9a1dce56d7 100644 --- a/src/main/java/rx/internal/util/ScalarSynchronousObservable.java +++ b/src/main/java/rx/internal/util/ScalarSynchronousObservable.java @@ -29,7 +29,7 @@ public static final ScalarSynchronousObservable create(T t) { return new ScalarSynchronousObservable(t); } - private final T t; + final T t; protected ScalarSynchronousObservable(final T t) { super(new OnSubscribe() { @@ -103,7 +103,7 @@ static final class ScalarSynchronousAction implements Action0 { private final Subscriber subscriber; private final T value; - private ScalarSynchronousAction(Subscriber subscriber, + ScalarSynchronousAction(Subscriber subscriber, T value) { this.subscriber = subscriber; this.value = value; diff --git a/src/main/java/rx/internal/util/UtilityFunctions.java b/src/main/java/rx/internal/util/UtilityFunctions.java index 2a94cb95f9..2d233a4fb1 100644 --- a/src/main/java/rx/internal/util/UtilityFunctions.java +++ b/src/main/java/rx/internal/util/UtilityFunctions.java @@ -104,6 +104,9 @@ private static final class NullFunction, Func9, FuncN { + NullFunction() { + } + @Override public R call() { return null; diff --git a/src/main/java/rx/observables/AsyncOnSubscribe.java b/src/main/java/rx/observables/AsyncOnSubscribe.java index 61cbe79e7c..d95dc82b9d 100644 --- a/src/main/java/rx/observables/AsyncOnSubscribe.java +++ b/src/main/java/rx/observables/AsyncOnSubscribe.java @@ -264,7 +264,7 @@ private static final class AsyncOnSubscribeImpl extends AsyncOnSubscribe>, ? extends S> next; private final Action1 onUnsubscribe; - private AsyncOnSubscribeImpl(Func0 generator, Func3>, ? extends S> next, Action1 onUnsubscribe) { + AsyncOnSubscribeImpl(Func0 generator, Func3>, ? extends S> next, Action1 onUnsubscribe) { this.generator = generator; this.next = next; this.onUnsubscribe = onUnsubscribe; @@ -355,7 +355,7 @@ static final class AsyncOuterManager implements Producer, Subscription, Ob private final AsyncOnSubscribe parent; private final SerializedObserver> serializedSubscriber; - private final CompositeSubscription subscriptions = new CompositeSubscription(); + final CompositeSubscription subscriptions = new CompositeSubscription(); private boolean hasTerminated; private boolean onNextCalled; @@ -647,7 +647,7 @@ public void onNext(T t) { } static final class State implements OnSubscribe { - private Subscriber subscriber; + Subscriber subscriber; @Override public void call(Subscriber s) { synchronized (this) { diff --git a/src/main/java/rx/observables/BlockingObservable.java b/src/main/java/rx/observables/BlockingObservable.java index c1ded4c217..c5b3588e32 100644 --- a/src/main/java/rx/observables/BlockingObservable.java +++ b/src/main/java/rx/observables/BlockingObservable.java @@ -538,14 +538,14 @@ public void onCompleted() { } /** Constant to indicate the onStart method should be called. */ - private static final Object ON_START = new Object(); - + static final Object ON_START = new Object(); + /** Constant indicating the setProducer method should be called. */ - private static final Object SET_PRODUCER = new Object(); + static final Object SET_PRODUCER = new Object(); /** Indicates an unsubscripton happened */ - private static final Object UNSUBSCRIBE = new Object(); - + static final Object UNSUBSCRIBE = new Object(); + /** * Subscribes to the source and calls the Subscriber methods on the current thread. *

diff --git a/src/main/java/rx/observables/SyncOnSubscribe.java b/src/main/java/rx/observables/SyncOnSubscribe.java index c75173a094..707e047b2a 100644 --- a/src/main/java/rx/observables/SyncOnSubscribe.java +++ b/src/main/java/rx/observables/SyncOnSubscribe.java @@ -271,7 +271,7 @@ private static final class SyncOnSubscribeImpl extends SyncOnSubscribe, ? extends S> next; private final Action1 onUnsubscribe; - private SyncOnSubscribeImpl(Func0 generator, Func2, ? extends S> next, Action1 onUnsubscribe) { + SyncOnSubscribeImpl(Func0 generator, Func2, ? extends S> next, Action1 onUnsubscribe) { this.generator = generator; this.next = next; this.onUnsubscribe = onUnsubscribe; @@ -322,8 +322,8 @@ private static class SubscriptionProducer private boolean hasTerminated; private S state; - - private SubscriptionProducer(final Subscriber subscriber, SyncOnSubscribe parent, S state) { + + SubscriptionProducer(final Subscriber subscriber, SyncOnSubscribe parent, S state) { this.actualSubscriber = subscriber; this.parent = parent; this.state = state; diff --git a/src/main/java/rx/schedulers/CachedThreadScheduler.java b/src/main/java/rx/schedulers/CachedThreadScheduler.java index 6ef56a17cb..31c6f9288f 100644 --- a/src/main/java/rx/schedulers/CachedThreadScheduler.java +++ b/src/main/java/rx/schedulers/CachedThreadScheduler.java @@ -26,11 +26,11 @@ /* package */final class CachedThreadScheduler extends Scheduler implements SchedulerLifecycle { private static final String WORKER_THREAD_NAME_PREFIX = "RxCachedThreadScheduler-"; - private static final RxThreadFactory WORKER_THREAD_FACTORY = + static final RxThreadFactory WORKER_THREAD_FACTORY = new RxThreadFactory(WORKER_THREAD_NAME_PREFIX); private static final String EVICTOR_THREAD_NAME_PREFIX = "RxCachedWorkerPoolEvictor-"; - private static final RxThreadFactory EVICTOR_THREAD_FACTORY = + static final RxThreadFactory EVICTOR_THREAD_FACTORY = new RxThreadFactory(EVICTOR_THREAD_NAME_PREFIX); private static final long KEEP_ALIVE_TIME = 60; diff --git a/src/main/java/rx/schedulers/ImmediateScheduler.java b/src/main/java/rx/schedulers/ImmediateScheduler.java index 4b9c27787f..e480754a58 100644 --- a/src/main/java/rx/schedulers/ImmediateScheduler.java +++ b/src/main/java/rx/schedulers/ImmediateScheduler.java @@ -45,6 +45,9 @@ private class InnerImmediateScheduler extends Scheduler.Worker implements Subscr final BooleanSubscription innerSubscription = new BooleanSubscription(); + InnerImmediateScheduler() { + } + @Override public Subscription schedule(Action0 action, long delayTime, TimeUnit unit) { // since we are executing immediately on this thread we must cause this thread to sleep diff --git a/src/main/java/rx/schedulers/TestScheduler.java b/src/main/java/rx/schedulers/TestScheduler.java index c808a1a366..fec8bbcd75 100644 --- a/src/main/java/rx/schedulers/TestScheduler.java +++ b/src/main/java/rx/schedulers/TestScheduler.java @@ -31,17 +31,17 @@ * advancing the clock at whatever pace you choose. */ public class TestScheduler extends Scheduler { - private final Queue queue = new PriorityQueue(11, new CompareActionsByTime()); - private static long counter = 0; + final Queue queue = new PriorityQueue(11, new CompareActionsByTime()); + static long counter = 0; private static final class TimedAction { - private final long time; - private final Action0 action; - private final Worker scheduler; + final long time; + final Action0 action; + final Worker scheduler; private final long count = counter++; // for differentiating tasks at same time - private TimedAction(Worker scheduler, long time, Action0 action) { + TimedAction(Worker scheduler, long time, Action0 action) { this.time = time; this.action = action; this.scheduler = scheduler; @@ -54,6 +54,9 @@ public String toString() { } private static class CompareActionsByTime implements Comparator { + CompareActionsByTime() { + } + @Override public int compare(TimedAction action1, TimedAction action2) { if (action1.time == action2.time) { @@ -65,7 +68,7 @@ public int compare(TimedAction action1, TimedAction action2) { } // Storing time in nanoseconds internally. - private long time; + long time; @Override public long now() { @@ -132,6 +135,9 @@ private final class InnerTestScheduler extends Worker { private final BooleanSubscription s = new BooleanSubscription(); + InnerTestScheduler() { + } + @Override public void unsubscribe() { s.unsubscribe(); diff --git a/src/main/java/rx/schedulers/TrampolineScheduler.java b/src/main/java/rx/schedulers/TrampolineScheduler.java index 9f7b14eb43..45bb18546c 100644 --- a/src/main/java/rx/schedulers/TrampolineScheduler.java +++ b/src/main/java/rx/schedulers/TrampolineScheduler.java @@ -47,10 +47,13 @@ public Worker createWorker() { private static class InnerCurrentThreadScheduler extends Scheduler.Worker implements Subscription { final AtomicInteger counter = new AtomicInteger(); - private final PriorityBlockingQueue queue = new PriorityBlockingQueue(); + final PriorityBlockingQueue queue = new PriorityBlockingQueue(); private final BooleanSubscription innerSubscription = new BooleanSubscription(); private final AtomicInteger wip = new AtomicInteger(); + InnerCurrentThreadScheduler() { + } + @Override public Subscription schedule(Action0 action) { return enqueue(action, now()); @@ -108,7 +111,7 @@ private static final class TimedAction implements Comparable { final Long execTime; final int count; // In case if time between enqueueing took less than 1ms - private TimedAction(Action0 action, Long execTime, int count) { + TimedAction(Action0 action, Long execTime, int count) { this.action = action; this.execTime = execTime; this.count = count; @@ -125,7 +128,7 @@ public int compareTo(TimedAction that) { } // because I can't use Integer.compare from Java 7 - private static int compare(int x, int y) { + static int compare(int x, int y) { return (x < y) ? -1 : ((x == y) ? 0 : 1); } diff --git a/src/main/java/rx/subjects/TestSubject.java b/src/main/java/rx/subjects/TestSubject.java index 2cc32b007c..f7a0caee2a 100644 --- a/src/main/java/rx/subjects/TestSubject.java +++ b/src/main/java/rx/subjects/TestSubject.java @@ -75,7 +75,7 @@ public void onCompleted() { onCompleted(0); } - private void _onCompleted() { + void _onCompleted() { if (state.active) { for (SubjectObserver bo : state.terminate(NotificationLite.instance().completed())) { bo.onCompleted(); @@ -108,7 +108,7 @@ public void onError(final Throwable e) { onError(e, 0); } - private void _onError(final Throwable e) { + void _onError(final Throwable e) { if (state.active) { for (SubjectObserver bo : state.terminate(NotificationLite.instance().error(e))) { bo.onError(e); @@ -143,7 +143,7 @@ public void onNext(T v) { onNext(v, 0); } - private void _onNext(T v) { + void _onNext(T v) { for (Observer o : state.observers()) { o.onNext(v); } diff --git a/src/main/java/rx/subscriptions/Subscriptions.java b/src/main/java/rx/subscriptions/Subscriptions.java index a86f5ef090..64d941f13d 100644 --- a/src/main/java/rx/subscriptions/Subscriptions.java +++ b/src/main/java/rx/subscriptions/Subscriptions.java @@ -120,7 +120,7 @@ public static CompositeSubscription from(Subscription... subscriptions) { */ private static final Unsubscribed UNSUBSCRIBED = new Unsubscribed(); /** Naming classes helps with debugging. */ - private static final class Unsubscribed implements Subscription { + static final class Unsubscribed implements Subscription { @Override public void unsubscribe() { }