Skip to content

Commit 73ae0f3

Browse files
committed
Fallout from renames in the Rx package.
1 parent 87130df commit 73ae0f3

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

Diff for: src/com/diffplug/common/swt/SwtExec.java

+12-11
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import com.diffplug.common.primitives.Ints;
3838
import com.diffplug.common.rx.*;
3939
import com.diffplug.common.util.concurrent.ListenableFuture;
40+
import com.diffplug.common.util.concurrent.MoreExecutors;
4041
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
4142

4243
/**
@@ -65,7 +66,7 @@
6566
* In the rare scenario where you need higher performance, it is possible to get similar behavior as {@link #immediate()} but with
6667
* less overhead (and safety) in {@link #swtOnly()} and {@link SwtExec#sameThread()}. It is very rarely worth this sacrifice.
6768
*/
68-
public class SwtExec extends AbstractExecutorService implements ScheduledExecutorService, Rx.HasRxExecutor {
69+
public class SwtExec extends AbstractExecutorService implements ScheduledExecutorService, RxExecutor.Has {
6970
private static Display display;
7071
private static Thread swtThread;
7172

@@ -269,17 +270,17 @@ private Runnable guardedRunnable(Runnable toGuard) {
269270
}
270271

271272
@Override
272-
public <T> Subscription subscribe(Observable<? extends T> observable, Rx<T> listener) {
273+
public <T> Subscription subscribe(Observable<? extends T> observable, RxListener<T> listener) {
273274
return subscribe(() -> parent.rxExecutor.subscribe(observable, listener));
274275
}
275276

276277
@Override
277-
public <T> Subscription subscribe(ListenableFuture<? extends T> future, Rx<T> listener) {
278+
public <T> Subscription subscribe(ListenableFuture<? extends T> future, RxListener<T> listener) {
278279
return subscribe(() -> parent.rxExecutor.subscribe(future, listener));
279280
}
280281

281282
@Override
282-
public <T> Subscription subscribe(CompletionStage<? extends T> future, Rx<T> listener) {
283+
public <T> Subscription subscribe(CompletionStage<? extends T> future, RxListener<T> listener) {
283284
return subscribe(() -> parent.rxExecutor.subscribe(future, listener));
284285
}
285286

@@ -300,19 +301,19 @@ private Subscription subscribe(Supplier<Subscription> subscriber) {
300301
}
301302
}
302303

303-
protected final Rx.RxExecutor rxExecutor;
304+
protected final RxExecutor rxExecutor;
304305

305-
/** Returns an instance of {@link com.diffplug.common.rx.Rx.RxExecutor}. */
306+
/** Returns an instance of {@link com.diffplug.common.rx.RxExecutor}. */
306307
@Override
307-
public Rx.RxExecutor getRxExecutor() {
308+
public RxExecutor getRxExecutor() {
308309
return rxExecutor;
309310
}
310311

311312
SwtExec() {
312-
this(exec -> Rx.on(exec, new SwtScheduler(exec)));
313+
this(exec -> Rx.callbackOn(exec, new SwtScheduler(exec)));
313314
}
314315

315-
SwtExec(Function<SwtExec, Rx.RxExecutor> rxExecutorCreator) {
316+
SwtExec(Function<SwtExec, RxExecutor> rxExecutorCreator) {
316317
initSwtThreads();
317318
this.rxExecutor = rxExecutorCreator.apply(this);
318319
}
@@ -821,7 +822,7 @@ void cancel() {
821822
@SuppressFBWarnings(value = "LI_LAZY_INIT_STATIC", justification = "This race condition is fine, see comment in SwtExec.blocking()")
822823
public static SwtExec swtOnly() {
823824
if (swtOnly == null) {
824-
swtOnly = new SwtExec(exec -> Rx.on(exec, new SwtOnlyScheduler())) {
825+
swtOnly = new SwtExec(exec -> Rx.callbackOn(exec, new SwtOnlyScheduler())) {
825826
@Override
826827
public void execute(Runnable runnable) {
827828
requireNonNull(runnable);
@@ -884,7 +885,7 @@ public boolean isUnsubscribed() {
884885
}
885886
}
886887

887-
private static final SwtExec sameThread = new SwtExec(exec -> Rx.on(exec, Schedulers.immediate())) {
888+
private static final SwtExec sameThread = new SwtExec(exec -> Rx.callbackOn(MoreExecutors.directExecutor(), Schedulers.immediate())) {
888889
@Override
889890
public void execute(Runnable runnable) {
890891
requireNonNull(runnable);

0 commit comments

Comments
 (0)