Skip to content

Commit 9840ce8

Browse files
committed
Fixing the generics for merge and lift
1 parent 2ac254c commit 9840ce8

4 files changed

Lines changed: 23 additions & 127 deletions

File tree

‎src/main/java/rx/operators/DebugSubscriber.java‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ public final class DebugSubscriber<T> extends Subscriber<T> {
1111
private final Func1<T, T> onNextHook;
1212
final Action1<DebugNotification> events;
1313
final Observer<? super T> o;
14-
Operator<T, ?> from = null;
15-
Operator<?, T> to = null;
14+
Operator<? extends T, ?> from = null;
15+
Operator<?, ? super T> to = null;
1616

1717
public DebugSubscriber(
1818
Func1<T, T> onNextHook,
1919
Action1<DebugNotification> _events,
2020
Subscriber<? super T> _o,
21-
Operator<T, ?> _out,
22-
Operator<?, T> _in) {
21+
Operator<? extends T, ?> _out,
22+
Operator<?, ? super T> _in) {
2323
super(_o);
2424
this.events = _events;
2525
this.o = _o;
@@ -47,19 +47,19 @@ public void onNext(T t) {
4747
o.onNext(onNextHook.call(t));
4848
}
4949

50-
public Operator<T, ?> getFrom() {
50+
public Operator<? extends T, ?> getFrom() {
5151
return from;
5252
}
5353

54-
public void setFrom(Operator<T, ?> op) {
55-
this.from = op;
54+
public void setFrom(Operator<? extends T, ?> bind) {
55+
this.from = bind;
5656
}
5757

58-
public Operator<?, T> getTo() {
58+
public Operator<?, ? super T> getTo() {
5959
return to;
6060
}
6161

62-
public void setTo(Operator<?, T> op) {
62+
public void setTo(Operator<?, ? super T> op) {
6363
this.to = op;
6464
}
6565

‎src/main/java/rx/plugins/DebugHook.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public void call(Subscriber<? super T> o) {
6363
}
6464

6565
@Override
66-
public <T, R> Operator<R, T> onLift(final Operator<R, T> bind) {
66+
public <T, R> Operator<? extends R, ? super T> onLift(final Operator<? extends R, ? super T> bind) {
6767
return new Operator<R, T>() {
6868
@Override
6969
public Subscriber<? super T> call(final Subscriber<? super R> o) {
@@ -78,7 +78,7 @@ public <T> Subscription onAdd(Subscriber<T> subscriber, Subscription s) {
7878
}
7979

8080
@SuppressWarnings("unchecked")
81-
private <R> Subscriber<? super R> wrapOutbound(Operator<R, ?> bind, Subscriber<? super R> o) {
81+
private <R> Subscriber<? super R> wrapOutbound(Operator<? extends R, ?> bind, Subscriber<? super R> o) {
8282
if (o instanceof DebugSubscriber) {
8383
if (bind != null)
8484
((DebugSubscriber<R>) o).setFrom(bind);
@@ -88,7 +88,7 @@ private <R> Subscriber<? super R> wrapOutbound(Operator<R, ?> bind, Subscriber<?
8888
}
8989

9090
@SuppressWarnings("unchecked")
91-
private <T> Subscriber<? super T> wrapInbound(Operator<?, T> bind, Subscriber<? super T> o) {
91+
private <T> Subscriber<? super T> wrapInbound(Operator<?, ? super T> bind, Subscriber<? super T> o) {
9292
if (o instanceof DebugSubscriber) {
9393
if (bind != null)
9494
((DebugSubscriber<T>) o).setTo(bind);

‎src/main/java/rx/plugins/DebugNotification.java‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@ public static enum Kind {
1313
}
1414

1515
private final OnSubscribe<T> source;
16-
private final Operator<T, ?> from;
16+
private final Operator<? extends T, ?> from;
1717
private final Kind kind;
1818
private final Notification<T> notification;
19-
private final Operator<?, T> to;
19+
private final Operator<?, ? super T> to;
2020
private final long nanoTime;
2121
private final long threadId;
2222
private Observer o;
2323

2424
public static <T> DebugNotification<T> createSubscribe(Observer<? super T> o, OnSubscribe<T> source) {
25-
Operator<?, T> to = null;
26-
Operator<T, ?> from = null;
25+
Operator<?, ? super T> to = null;
26+
Operator<? extends T, ?> from = null;
2727
if (o instanceof DebugSubscriber) {
2828
to = ((DebugSubscriber<T>) o).getTo();
2929
from = ((DebugSubscriber<T>) o).getFrom();
@@ -32,23 +32,23 @@ public static <T> DebugNotification<T> createSubscribe(Observer<? super T> o, On
3232
return new DebugNotification<T>(o, from, Kind.Subscribe, null, to, source);
3333
}
3434

35-
public static <T> DebugNotification<T> createOnNext(Observer<? super T> o, Operator<T, ?> from, T t, Operator<?, T> to) {
35+
public static <T> DebugNotification<T> createOnNext(Observer<? super T> o, Operator<? extends T, ?> from, T t, Operator<?, ? super T> to) {
3636
return new DebugNotification<T>(o, from, Kind.OnNext, Notification.createOnNext(t), to, null);
3737
}
3838

39-
public static <T> DebugNotification<T> createOnError(Observer<? super T> o, Operator<T, ?> from, Throwable e, Operator<?, T> to) {
39+
public static <T> DebugNotification<T> createOnError(Observer<? super T> o, Operator<? extends T, ?> from, Throwable e, Operator<?, ? super T> to) {
4040
return new DebugNotification<T>(o, from, Kind.OnError, Notification.<T> createOnError(e), to, null);
4141
}
4242

43-
public static <T> DebugNotification<T> createOnCompleted(Observer<? super T> o, Operator<T, ?> from, Operator<?, T> to) {
43+
public static <T> DebugNotification<T> createOnCompleted(Observer<? super T> o, Operator<? extends T, ?> from, Operator<?, ? super T> to) {
4444
return new DebugNotification<T>(o, from, Kind.OnCompleted, Notification.<T> createOnCompleted(), to, null);
4545
}
4646

47-
public static <T> DebugNotification<T> createUnsubscribe(Observer<? super T> o, Operator<T, ?> from, Operator<?, T> to) {
47+
public static <T> DebugNotification<T> createUnsubscribe(Observer<? super T> o, Operator<? extends T, ?> from, Operator<?, ? super T> to) {
4848
return new DebugNotification<T>(o, from, Kind.Unsubscribe, null, to, null);
4949
}
5050

51-
private DebugNotification(Observer o, Operator<T, ?> from, Kind kind, Notification<T> notification, Operator<?, T> to, OnSubscribe<T> source) {
51+
private DebugNotification(Observer o, Operator<? extends T, ?> from, Kind kind, Notification<T> notification, Operator<?, ? super T> to, OnSubscribe<T> source) {
5252
this.o = (o instanceof SafeSubscriber) ? ((SafeSubscriber) o).getActual() : o;
5353
this.from = from;
5454
this.kind = kind;
@@ -59,15 +59,15 @@ private DebugNotification(Observer o, Operator<T, ?> from, Kind kind, Notificati
5959
this.threadId = Thread.currentThread().getId();
6060
}
6161

62-
public Operator<T, ?> getFrom() {
62+
public Operator<? extends T, ?> getFrom() {
6363
return from;
6464
}
6565

6666
public Notification<T> getNotification() {
6767
return notification;
6868
}
6969

70-
public Operator<?, T> getTo() {
70+
public Operator<?, ? super T> getTo() {
7171
return to;
7272
}
7373

‎src/main/java/rx/plugins/NotificationEvent.java‎

Lines changed: 0 additions & 104 deletions
This file was deleted.

0 commit comments

Comments
 (0)