Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the need for javac to generate synthetic methods. #3587

Merged
merged 1 commit into from
Dec 27, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/java/rx/Observable.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ protected Observable(OnSubscribe<T> 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
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/rx/Single.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ private Single(final Observable.OnSubscribe<T> 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
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/rx/functions/Actions.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ private static final class EmptyAction<T0, T1, T2, T3, T4, T5, T6, T7, T8> imple
Action8<T0, T1, T2, T3, T4, T5, T6, T7>,
Action9<T0, T1, T2, T3, T4, T5, T6, T7, T8>,
ActionN {
EmptyAction() {
}

@Override
public void call() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ public Iterator<T> iterator() {
private static final class MostRecentObserver<T> extends Subscriber<T> {
final NotificationLite<T> nl = NotificationLite.instance();
volatile Object value;
private MostRecentObserver(T value) {

MostRecentObserver(T value) {
this.value = nl.next(value);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public Iterator<T> iterator() {
private Throwable error = null;
private boolean started = false;

private NextIterator(Observable<? extends T> items, NextObserver<T> observer) {
NextIterator(Observable<? extends T> items, NextObserver<T> observer) {
this.items = items;
this.observer = observer;
}
Expand Down Expand Up @@ -149,6 +149,9 @@ private static class NextObserver<T> extends Subscriber<Notification<? extends T
private final BlockingQueue<Notification<? extends T>> buf = new ArrayBlockingQueue<Notification<? extends T>>(1);
final AtomicInteger waiting = new AtomicInteger();

NextObserver() {
}

@Override
public void onCompleted() {
// ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/rx/internal/operators/NotificationLite.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/rx/internal/operators/OnSubscribeAmb.java
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ private static final class AmbSubscriber<T> extends Subscriber<T> {
private final Selection<T> selection;
private boolean chosen;

private AmbSubscriber(long requested, Subscriber<? super T> subscriber, Selection<T> selection) {
AmbSubscriber(long requested, Subscriber<? super T> subscriber, Selection<T> selection) {
this.subscriber = subscriber;
this.selection = selection;
// initial request
Expand Down Expand Up @@ -434,7 +434,7 @@ public void request(long n) {
});
}

private static <T> void unsubscribeAmbSubscribers(Collection<AmbSubscriber<T>> ambSubscribers) {
static <T> void unsubscribeAmbSubscribers(Collection<AmbSubscriber<T>> ambSubscribers) {
if(!ambSubscribers.isEmpty()) {
for (AmbSubscriber<T> other : ambSubscribers) {
other.unsubscribe();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ private static final class IterableProducer<T> extends AtomicLong implements Pro
private final Subscriber<? super T> o;
private final Iterator<? extends T> it;

private IterableProducer(Subscriber<? super T> o, Iterator<? extends T> it) {
IterableProducer(Subscriber<? super T> o, Iterator<? extends T> it) {
this.o = o;
this.it = it;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/rx/internal/operators/OnSubscribeRange.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ private static final class RangeProducer extends AtomicLong implements Producer
private final int end;
private long index;

private RangeProducer(Subscriber<? super Integer> o, int start, int end) {
RangeProducer(Subscriber<? super Integer> o, int start, int end) {
this.o = o;
this.index = start;
this.end = end;
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/rx/internal/operators/OnSubscribeRedo.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public Notification<?> call(Notification<?> terminal) {
};

public static final class RedoFinite implements Func1<Observable<? extends Notification<?>>, Observable<?>> {
private final long count;
final long count;

public RedoFinite(long count) {
this.count = count;
Expand Down Expand Up @@ -98,7 +98,7 @@ public Notification<?> call(Notification<?> terminalNotification) {
}

public static final class RetryWithPredicate implements Func1<Observable<? extends Notification<?>>, Observable<? extends Notification<?>>> {
private final Func2<Integer, Throwable, Boolean> predicate;
final Func2<Integer, Throwable, Boolean> predicate;

public RetryWithPredicate(Func2<Integer, Throwable, Boolean> predicate) {
this.predicate = predicate;
Expand Down Expand Up @@ -173,10 +173,10 @@ public static <T> Observable<T> redo(Observable<T> source, Func1<? super Observa
return create(new OnSubscribeRedo<T>(source, notificationHandler, false, false, scheduler));
}

private final Observable<T> source;
final Observable<T> source;
private final Func1<? super Observable<? extends Notification<?>>, ? extends Observable<?>> controlHandlerFunction;
private final boolean stopOnComplete;
private final boolean stopOnError;
final boolean stopOnComplete;
final boolean stopOnError;
private final Scheduler scheduler;

private OnSubscribeRedo(Observable<T> source, Func1<? super Observable<? extends Notification<?>>, ? extends Observable<?>> f, boolean stopOnComplete, boolean stopOnError,
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/rx/internal/operators/OnSubscribeRefCount.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@
public final class OnSubscribeRefCount<T> implements OnSubscribe<T> {

private final ConnectableObservable<? extends T> 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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ private OnSubscribeToObservableFuture() {
}

/* package accessible for unit tests */static class ToObservableFuture<T> implements OnSubscribe<T> {
private final Future<? extends T> that;
final Future<? extends T> that;
private final long time;
private final TimeUnit unit;

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/rx/internal/operators/OnSubscribeUsing.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ private static final class DisposeAction<Resource> extends AtomicBoolean impleme
private Action1<? super Resource> dispose;
private Resource resource;

private DisposeAction(Action1<? super Resource> dispose, Resource resource) {
DisposeAction(Action1<? super Resource> dispose, Resource resource) {
this.dispose = dispose;
this.resource = resource;
lazySet(false); // StoreStore barrier
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/rx/internal/operators/OperatorAll.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* <img width="640" src="https://github.com/ReactiveX/RxJava/wiki/images/rx-operators/all.png" alt="">
*/
public final class OperatorAll<T> implements Operator<Boolean, T> {
private final Func1<? super T, Boolean> predicate;
final Func1<? super T, Boolean> predicate;

public OperatorAll(Func1<? super T, Boolean> predicate) {
this.predicate = predicate;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/rx/internal/operators/OperatorAny.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
* an observable sequence satisfies a condition, otherwise <code>false</code>.
*/
public final class OperatorAny<T> implements Operator<Boolean, T> {
private final Func1<? super T, Boolean> predicate;
private final boolean returnOnEmpty;
final Func1<? super T, Boolean> predicate;
final boolean returnOnEmpty;

public OperatorAny(Func1<? super T, Boolean> predicate, boolean returnOnEmpty) {
this.predicate = predicate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ private static final class Holder {
public static <T> OperatorAsObservable<T> instance() {
return (OperatorAsObservable<T>)Holder.INSTANCE;
}
private OperatorAsObservable() { }
OperatorAsObservable() { }
@Override
public Subscriber<? super T> call(Subscriber<? super T> s) {
return s;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/rx/internal/operators/OperatorCast.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*/
public class OperatorCast<T, R> implements Operator<R, T> {

private final Class<R> castClass;
final Class<R> castClass;

public OperatorCast(Class<R> castClass) {
this.castClass = castClass;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/rx/internal/operators/OperatorConcat.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ private static final class Holder {
public static <T> OperatorConcat<T> instance() {
return (OperatorConcat<T>)Holder.INSTANCE;
}
private OperatorConcat() { }
OperatorConcat() { }
@Override
public Subscriber<? super Observable<? extends T>> call(final Subscriber<? super T> child) {
final SerializedSubscriber<T> s = new SerializedSubscriber<T>(child);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<? super Notification<T>> call(final Subscriber<? super T> child) {
return new Subscriber<Notification<T>>(child) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/rx/internal/operators/OperatorDoOnEach.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* Converts the elements of an observable sequence to the specified type.
*/
public class OperatorDoOnEach<T> implements Operator<T, T> {
private final Observer<? super T> doOnEachObserver;
final Observer<? super T> doOnEachObserver;

public OperatorDoOnEach(Observer<? super T> doOnEachObserver) {
this.doOnEachObserver = doOnEachObserver;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/rx/internal/operators/OperatorDoOnRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
*/
public class OperatorDoOnRequest<T> implements Operator<T, T> {

private final Action1<Long> request;
final Action1<Long> request;

public OperatorDoOnRequest(Action1<Long> request) {
this.request = request;
Expand All @@ -55,7 +55,7 @@ public void request(long n) {
private static final class ParentSubscriber<T> extends Subscriber<T> {
private final Subscriber<? super T> child;

private ParentSubscriber(Subscriber<? super T> child) {
ParentSubscriber(Subscriber<? super T> child) {
this.child = child;
}

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/rx/internal/operators/OperatorElementAt.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
*/
public final class OperatorElementAt<T> implements Operator<T, T> {

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);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/rx/internal/operators/OperatorFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
*/
public final class OperatorFilter<T> implements Operator<T, T> {

private final Func1<? super T, Boolean> predicate;
final Func1<? super T, Boolean> predicate;

public OperatorFilter(Func1<? super T, Boolean> predicate) {
this.predicate = predicate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public static <T> OperatorIgnoreElements<T> instance() {
return (OperatorIgnoreElements<T>) Holder.INSTANCE;
}

private OperatorIgnoreElements() {
OperatorIgnoreElements() {

}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/rx/internal/operators/OperatorMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
*/
public final class OperatorMap<T, R> implements Operator<R, T> {

private final Func1<? super T, ? extends R> transformer;
final Func1<? super T, ? extends R> transformer;

public OperatorMap(Func1<? super T, ? extends R> transformer) {
this.transformer = transformer;
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/rx/internal/operators/OperatorMapNotification.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
*/
public final class OperatorMapNotification<T, R> implements Operator<R, T> {

private final Func1<? super T, ? extends R> onNext;
private final Func1<? super Throwable, ? extends R> onError;
private final Func0<? extends R> onCompleted;
final Func1<? super T, ? extends R> onNext;
final Func1<? super Throwable, ? extends R> onError;
final Func0<? extends R> onCompleted;

public OperatorMapNotification(Func1<? super T, ? extends R> onNext, Func1<? super Throwable, ? extends R> onError, Func0<? extends R> onCompleted) {
this.onNext = onNext;
Expand All @@ -58,8 +58,8 @@ final class MapNotificationSubscriber extends Subscriber<T> {
private final Subscriber<? super R> o;
private final ProducerArbiter pa;
final SingleEmitter<R> emitter;
private MapNotificationSubscriber(ProducerArbiter pa, Subscriber<? super R> o) {

MapNotificationSubscriber(ProducerArbiter pa, Subscriber<? super R> o) {
this.pa = pa;
this.o = o;
this.emitter = new SingleEmitter<R>(o, pa, this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public static <T> OperatorMaterialize<T> instance() {
return (OperatorMaterialize<T>) Holder.INSTANCE;
}

private OperatorMaterialize() {
OperatorMaterialize() {
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/rx/internal/operators/OperatorMerge.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public static <T> OperatorMerge<T> 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;
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/rx/internal/operators/OperatorMulticast.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ public final class OperatorMulticast<T, R> extends ConnectableObservable<R> {
final List<Subscriber<? super R>> waitingForConnect;

/** Guarded by guard. */
private Subscriber<T> subscription;
Subscriber<T> subscription;
// wraps subscription above for unsubscription using guard
private Subscription guardedSubscription;
Subscription guardedSubscription;

public OperatorMulticast(Observable<? extends T> source, final Func0<? extends Subject<? super T, ? extends R>> subjectFactory) {
this(new Object(), new AtomicReference<Subject<? super T, ? extends R>>(), new ArrayList<Subscriber<? super R>>(), source, subjectFactory);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ private static class Holder {
public static <T> OperatorOnBackpressureBuffer<T> instance() {
return (OperatorOnBackpressureBuffer<T>) Holder.INSTANCE;
}
private OperatorOnBackpressureBuffer() {

OperatorOnBackpressureBuffer() {
this.capacity = null;
this.onOverflow = null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ public static <T> OperatorOnBackpressureDrop<T> instance() {
return (OperatorOnBackpressureDrop<T>)Holder.INSTANCE;
}

private final Action1<? super T> onDrop;
final Action1<? super T> onDrop;

private OperatorOnBackpressureDrop() {
OperatorOnBackpressureDrop() {
this(null);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ void emit() {
static final class LatestSubscriber<T> extends Subscriber<T> {
private final LatestEmitter<T> producer;

private LatestSubscriber(LatestEmitter<T> producer) {
LatestSubscriber(LatestEmitter<T> producer) {
this.producer = producer;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
*/
public final class OperatorOnErrorResumeNextViaFunction<T> implements Operator<T, T> {

private final Func1<Throwable, ? extends Observable<? extends T>> resumeFunction;
final Func1<Throwable, ? extends Observable<? extends T>> resumeFunction;

public OperatorOnErrorResumeNextViaFunction(Func1<Throwable, ? extends Observable<? extends T>> f) {
this.resumeFunction = f;
Expand Down
Loading