Skip to content

Commit 04be9ee

Browse files
committed
Remove the need for javac to generate synthetic methods.
Outer classes accessing inner class private fields and methods (and vise versa) causes javac to generate package-scoped trampolines. These bloat the class files and for Android create needless method that eat away at our fixed limit of methods in an application. By simply promoting the private interactions to package scope directly, the synthetic methods do not need generated.
1 parent 8d3a0c5 commit 04be9ee

File tree

72 files changed

+157
-128
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+157
-128
lines changed

src/main/java/rx/Observable.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ protected Observable(OnSubscribe<T> f) {
6060
this.onSubscribe = f;
6161
}
6262

63-
private static final RxJavaObservableExecutionHook hook = RxJavaPlugins.getInstance().getObservableExecutionHook();
63+
static final RxJavaObservableExecutionHook hook = RxJavaPlugins.getInstance().getObservableExecutionHook();
6464

6565
/**
6666
* Returns an Observable that will execute the specified function when a {@link Subscriber} subscribes to

src/main/java/rx/Single.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ private Single(final Observable.OnSubscribe<T> f) {
111111
this.onSubscribe = f;
112112
}
113113

114-
private static final RxJavaObservableExecutionHook hook = RxJavaPlugins.getInstance().getObservableExecutionHook();
114+
static final RxJavaObservableExecutionHook hook = RxJavaPlugins.getInstance().getObservableExecutionHook();
115115

116116
/**
117117
* Returns a Single that will execute the specified function when a {@link SingleSubscriber} executes it or

src/main/java/rx/functions/Actions.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ private static final class EmptyAction<T0, T1, T2, T3, T4, T5, T6, T7, T8> imple
4343
Action8<T0, T1, T2, T3, T4, T5, T6, T7>,
4444
Action9<T0, T1, T2, T3, T4, T5, T6, T7, T8>,
4545
ActionN {
46+
EmptyAction() {
47+
}
48+
4649
@Override
4750
public void call() {
4851
}

src/main/java/rx/internal/operators/BlockingOperatorMostRecent.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ public Iterator<T> iterator() {
6363
private static final class MostRecentObserver<T> extends Subscriber<T> {
6464
final NotificationLite<T> nl = NotificationLite.instance();
6565
volatile Object value;
66-
67-
private MostRecentObserver(T value) {
66+
67+
MostRecentObserver(T value) {
6868
this.value = nl.next(value);
6969
}
7070

src/main/java/rx/internal/operators/BlockingOperatorNext.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public Iterator<T> iterator() {
6666
private Throwable error = null;
6767
private boolean started = false;
6868

69-
private NextIterator(Observable<? extends T> items, NextObserver<T> observer) {
69+
NextIterator(Observable<? extends T> items, NextObserver<T> observer) {
7070
this.items = items;
7171
this.observer = observer;
7272
}
@@ -149,6 +149,9 @@ private static class NextObserver<T> extends Subscriber<Notification<? extends T
149149
private final BlockingQueue<Notification<? extends T>> buf = new ArrayBlockingQueue<Notification<? extends T>>(1);
150150
final AtomicInteger waiting = new AtomicInteger();
151151

152+
NextObserver() {
153+
}
154+
152155
@Override
153156
public void onCompleted() {
154157
// ignore

src/main/java/rx/internal/operators/BufferUntilSubscriber.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ public boolean hasObservers() {
187187
}
188188

189189
@SuppressWarnings("rawtypes")
190-
private final static Observer EMPTY_OBSERVER = new Observer() {
190+
final static Observer EMPTY_OBSERVER = new Observer() {
191191

192192
@Override
193193
public void onCompleted() {

src/main/java/rx/internal/operators/NotificationLite.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public String toString() {
7171

7272
private static class OnErrorSentinel implements Serializable {
7373
private static final long serialVersionUID = 3;
74-
private final Throwable e;
74+
final Throwable e;
7575

7676
public OnErrorSentinel(Throwable e) {
7777
this.e = e;

src/main/java/rx/internal/operators/OnSubscribeAmb.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ private static final class AmbSubscriber<T> extends Subscriber<T> {
271271
private final Selection<T> selection;
272272
private boolean chosen;
273273

274-
private AmbSubscriber(long requested, Subscriber<? super T> subscriber, Selection<T> selection) {
274+
AmbSubscriber(long requested, Subscriber<? super T> subscriber, Selection<T> selection) {
275275
this.subscriber = subscriber;
276276
this.selection = selection;
277277
// initial request
@@ -434,7 +434,7 @@ public void request(long n) {
434434
});
435435
}
436436

437-
private static <T> void unsubscribeAmbSubscribers(Collection<AmbSubscriber<T>> ambSubscribers) {
437+
static <T> void unsubscribeAmbSubscribers(Collection<AmbSubscriber<T>> ambSubscribers) {
438438
if(!ambSubscribers.isEmpty()) {
439439
for (AmbSubscriber<T> other : ambSubscribers) {
440440
other.unsubscribe();

src/main/java/rx/internal/operators/OnSubscribeFromIterable.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ private static final class IterableProducer<T> extends AtomicLong implements Pro
5555
private final Subscriber<? super T> o;
5656
private final Iterator<? extends T> it;
5757

58-
private IterableProducer(Subscriber<? super T> o, Iterator<? extends T> it) {
58+
IterableProducer(Subscriber<? super T> o, Iterator<? extends T> it) {
5959
this.o = o;
6060
this.it = it;
6161
}

src/main/java/rx/internal/operators/OnSubscribeRange.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ private static final class RangeProducer extends AtomicLong implements Producer
4646
private final int end;
4747
private long index;
4848

49-
private RangeProducer(Subscriber<? super Integer> o, int start, int end) {
49+
RangeProducer(Subscriber<? super Integer> o, int start, int end) {
5050
this.o = o;
5151
this.index = start;
5252
this.end = end;

0 commit comments

Comments
 (0)