From 74aa7e0f7633abb01070c4e820dc4097faf535bd Mon Sep 17 00:00:00 2001 From: Victor Pyankov Date: Mon, 30 Mar 2020 02:37:16 +0600 Subject: [PATCH] The project was adapted to RxJava v3.0.1 --- build.gradle | 2 +- gradle.properties | 4 ++-- .../observables/JavaFxObservable.java | 4 ++-- .../rxjavafx/observers/BindingObserver.java | 12 +++++----- .../rxjavafx/observers/BindingSubscriber.java | 8 +++---- .../rxjavafx/observers/JavaFxObserver.java | 8 +++---- .../rxjavafx/observers/JavaFxSubscriber.java | 8 +++---- .../rxjavafx/schedulers/JavaFxScheduler.java | 9 ++++---- .../rxjavafx/sources/ActionEventSource.java | 4 ++-- .../rxjavafx/sources/DialogSource.java | 4 ++-- .../rxjavafx/sources/NodeEventSource.java | 4 ++-- .../sources/ObservableListSource.java | 6 ++--- .../rxjavafx/sources/ObservableMapSource.java | 6 ++--- .../rxjavafx/sources/ObservableSetSource.java | 6 ++--- .../sources/ObservableValueSource.java | 4 ++-- .../rxjavafx/sources/SceneEventSource.java | 4 ++-- .../rxjavafx/sources/TimerSource.java | 2 +- .../rxjavafx/sources/WindowEventSource.java | 4 ++-- .../subscriptions/CompositeBinding.java | 2 +- .../subscriptions/JavaFxSubscriptions.java | 9 ++++---- .../transformers/FxFlowableTransformers.java | 18 +++++++-------- .../FxObservableTransformers.java | 22 +++++++++---------- src/main/java/module-info.java | 4 ++-- .../io/reactivex/rxjavafx/RxJavaFXTest.java | 6 ++--- .../rxjavafx/operators/OperatorsTest.java | 4 ++-- .../schedulers/JavaFxSchedulerTest.java | 2 +- .../sources/JavaFxObservableTest.java | 6 ++--- .../rxjavafx/subscriptions/BindingTest.java | 8 +++---- 28 files changed, 89 insertions(+), 91 deletions(-) diff --git a/build.gradle b/build.gradle index 7744dfc..2e3b187 100644 --- a/build.gradle +++ b/build.gradle @@ -47,7 +47,7 @@ repositories { } dependencies { - compile 'io.reactivex.rxjava2:rxjava:2.2.4' + compile 'io.reactivex.rxjava3:rxjava:3.0.1' compile "org.openjfx:javafx-base:11:${platform}" compile "org.openjfx:javafx-graphics:11:${platform}" compile "org.openjfx:javafx-controls:11:${platform}" diff --git a/gradle.properties b/gradle.properties index 74069f5..5c8ea03 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ -GROUP=io.reactivex.rxjava2 -VERSION_NAME=2.11.0-RC34 +GROUP=io.reactivex.rxjava3 +VERSION_NAME=3.0.0 POM_NAME=RxJavaFX POM_PACKAGING=jar POM_DESCRIPTION=RxJava extensions for JavaFX diff --git a/src/main/java/io/reactivex/rxjavafx/observables/JavaFxObservable.java b/src/main/java/io/reactivex/rxjavafx/observables/JavaFxObservable.java index 2ec7a9c..37feb70 100644 --- a/src/main/java/io/reactivex/rxjavafx/observables/JavaFxObservable.java +++ b/src/main/java/io/reactivex/rxjavafx/observables/JavaFxObservable.java @@ -16,8 +16,8 @@ package io.reactivex.rxjavafx.observables; -import io.reactivex.Maybe; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Maybe; +import io.reactivex.rxjava3.core.Observable; import io.reactivex.rxjavafx.sources.*; import javafx.beans.value.ObservableValue; import javafx.collections.ObservableList; diff --git a/src/main/java/io/reactivex/rxjavafx/observers/BindingObserver.java b/src/main/java/io/reactivex/rxjavafx/observers/BindingObserver.java index 42b7f10..a890bf3 100755 --- a/src/main/java/io/reactivex/rxjavafx/observers/BindingObserver.java +++ b/src/main/java/io/reactivex/rxjavafx/observers/BindingObserver.java @@ -15,11 +15,11 @@ */ package io.reactivex.rxjavafx.observers; -import io.reactivex.Observer; -import io.reactivex.disposables.Disposable; -import io.reactivex.functions.Consumer; -import io.reactivex.functions.Function; -import io.reactivex.observables.ConnectableObservable; +import io.reactivex.rxjava3.core.Observer; +import io.reactivex.rxjava3.disposables.Disposable; +import io.reactivex.rxjava3.functions.Consumer; +import io.reactivex.rxjava3.functions.Function; +import io.reactivex.rxjava3.observables.ConnectableObservable; import javafx.beans.binding.Binding; import javafx.beans.value.ObservableValue; import javafx.collections.ObservableList; @@ -69,7 +69,7 @@ public void onNext(T t) { try { value = unmaskingFunction.apply(t); fireChange(); - } catch (Exception e) { + } catch (Throwable e) { onError(e); } } diff --git a/src/main/java/io/reactivex/rxjavafx/observers/BindingSubscriber.java b/src/main/java/io/reactivex/rxjavafx/observers/BindingSubscriber.java index 588097c..e6cba2e 100755 --- a/src/main/java/io/reactivex/rxjavafx/observers/BindingSubscriber.java +++ b/src/main/java/io/reactivex/rxjavafx/observers/BindingSubscriber.java @@ -15,9 +15,9 @@ */ package io.reactivex.rxjavafx.observers; -import io.reactivex.flowables.ConnectableFlowable; -import io.reactivex.functions.Consumer; -import io.reactivex.functions.Function; +import io.reactivex.rxjava3.flowables.ConnectableFlowable; +import io.reactivex.rxjava3.functions.Consumer; +import io.reactivex.rxjava3.functions.Function; import javafx.beans.binding.Binding; import javafx.beans.value.ObservableValue; import javafx.collections.ObservableList; @@ -70,7 +70,7 @@ public void onNext(T t) { try { value = unmaskingFunction.apply(t); fireChange(); - } catch (Exception e) { + } catch (Throwable e) { onError(e); } } diff --git a/src/main/java/io/reactivex/rxjavafx/observers/JavaFxObserver.java b/src/main/java/io/reactivex/rxjavafx/observers/JavaFxObserver.java index c44977b..f3e77d5 100755 --- a/src/main/java/io/reactivex/rxjavafx/observers/JavaFxObserver.java +++ b/src/main/java/io/reactivex/rxjavafx/observers/JavaFxObserver.java @@ -17,10 +17,10 @@ import java.util.Optional; -import io.reactivex.Observable; -import io.reactivex.functions.Consumer; -import io.reactivex.observables.ConnectableObservable; -import io.reactivex.plugins.RxJavaPlugins; +import io.reactivex.rxjava3.core.Observable; +import io.reactivex.rxjava3.functions.Consumer; +import io.reactivex.rxjava3.observables.ConnectableObservable; +import io.reactivex.rxjava3.plugins.RxJavaPlugins; import io.reactivex.rxjavafx.observables.JavaFxObservable; import javafx.beans.binding.Binding; import javafx.beans.value.ObservableValue; diff --git a/src/main/java/io/reactivex/rxjavafx/observers/JavaFxSubscriber.java b/src/main/java/io/reactivex/rxjavafx/observers/JavaFxSubscriber.java index 3ca222a..546da18 100755 --- a/src/main/java/io/reactivex/rxjavafx/observers/JavaFxSubscriber.java +++ b/src/main/java/io/reactivex/rxjavafx/observers/JavaFxSubscriber.java @@ -15,10 +15,10 @@ */ package io.reactivex.rxjavafx.observers; -import io.reactivex.Flowable; -import io.reactivex.flowables.ConnectableFlowable; -import io.reactivex.functions.Consumer; -import io.reactivex.plugins.RxJavaPlugins; +import io.reactivex.rxjava3.core.Flowable; +import io.reactivex.rxjava3.flowables.ConnectableFlowable; +import io.reactivex.rxjava3.functions.Consumer; +import io.reactivex.rxjava3.plugins.RxJavaPlugins; import io.reactivex.rxjavafx.observables.JavaFxObservable; import javafx.beans.binding.Binding; import javafx.beans.value.ObservableValue; diff --git a/src/main/java/io/reactivex/rxjavafx/schedulers/JavaFxScheduler.java b/src/main/java/io/reactivex/rxjavafx/schedulers/JavaFxScheduler.java index 3889937..eca8ae9 100644 --- a/src/main/java/io/reactivex/rxjavafx/schedulers/JavaFxScheduler.java +++ b/src/main/java/io/reactivex/rxjavafx/schedulers/JavaFxScheduler.java @@ -15,9 +15,8 @@ */ package io.reactivex.rxjavafx.schedulers; -import io.reactivex.Scheduler; -import io.reactivex.disposables.Disposable; -import io.reactivex.disposables.Disposables; +import io.reactivex.rxjava3.core.Scheduler; +import io.reactivex.rxjava3.disposables.Disposable; import javafx.animation.KeyFrame; import javafx.animation.Timeline; import javafx.application.Platform; @@ -118,7 +117,7 @@ public Disposable schedule(final Runnable action, long delayTime, TimeUnit unit) final Timeline timer = new Timeline(new KeyFrame(Duration.millis(delay), event -> schedule(queuedRunnable))); timer.play(); - return Disposables.fromRunnable(() -> { + return Disposable.fromRunnable(() -> { queuedRunnable.dispose(); timer.stop(); }); @@ -127,7 +126,7 @@ public Disposable schedule(final Runnable action, long delayTime, TimeUnit unit) @Override public Disposable schedule(final Runnable action) { if (isDisposed()) { - return Disposables.disposed(); + return Disposable.disposed(); } final QueuedRunnable queuedRunnable = action instanceof QueuedRunnable ? (QueuedRunnable) action : new QueuedRunnable(action); diff --git a/src/main/java/io/reactivex/rxjavafx/sources/ActionEventSource.java b/src/main/java/io/reactivex/rxjavafx/sources/ActionEventSource.java index 72def9c..e9dec70 100644 --- a/src/main/java/io/reactivex/rxjavafx/sources/ActionEventSource.java +++ b/src/main/java/io/reactivex/rxjavafx/sources/ActionEventSource.java @@ -15,8 +15,8 @@ */ package io.reactivex.rxjavafx.sources; -import io.reactivex.Observable; -import io.reactivex.ObservableEmitter; +import io.reactivex.rxjava3.core.Observable; +import io.reactivex.rxjava3.core.ObservableEmitter; import io.reactivex.rxjavafx.schedulers.JavaFxScheduler; import io.reactivex.rxjavafx.subscriptions.JavaFxSubscriptions; import javafx.event.ActionEvent; diff --git a/src/main/java/io/reactivex/rxjavafx/sources/DialogSource.java b/src/main/java/io/reactivex/rxjavafx/sources/DialogSource.java index 416aaa9..27c8376 100644 --- a/src/main/java/io/reactivex/rxjavafx/sources/DialogSource.java +++ b/src/main/java/io/reactivex/rxjavafx/sources/DialogSource.java @@ -15,8 +15,8 @@ */ package io.reactivex.rxjavafx.sources; -import io.reactivex.Maybe; -import io.reactivex.Single; +import io.reactivex.rxjava3.core.Maybe; +import io.reactivex.rxjava3.core.Single; import io.reactivex.rxjavafx.schedulers.JavaFxScheduler; import javafx.scene.control.Dialog; diff --git a/src/main/java/io/reactivex/rxjavafx/sources/NodeEventSource.java b/src/main/java/io/reactivex/rxjavafx/sources/NodeEventSource.java index a2f13e0..2bebe5b 100644 --- a/src/main/java/io/reactivex/rxjavafx/sources/NodeEventSource.java +++ b/src/main/java/io/reactivex/rxjavafx/sources/NodeEventSource.java @@ -15,8 +15,8 @@ */ package io.reactivex.rxjavafx.sources; -import io.reactivex.Observable; -import io.reactivex.ObservableEmitter; +import io.reactivex.rxjava3.core.Observable; +import io.reactivex.rxjava3.core.ObservableEmitter; import io.reactivex.rxjavafx.schedulers.JavaFxScheduler; import io.reactivex.rxjavafx.subscriptions.JavaFxSubscriptions; import javafx.event.Event; diff --git a/src/main/java/io/reactivex/rxjavafx/sources/ObservableListSource.java b/src/main/java/io/reactivex/rxjavafx/sources/ObservableListSource.java index 53ea5ae..56d3afe 100644 --- a/src/main/java/io/reactivex/rxjavafx/sources/ObservableListSource.java +++ b/src/main/java/io/reactivex/rxjavafx/sources/ObservableListSource.java @@ -15,8 +15,8 @@ */ package io.reactivex.rxjavafx.sources; -import io.reactivex.Observable; -import io.reactivex.ObservableOnSubscribe; +import io.reactivex.rxjava3.core.Observable; +import io.reactivex.rxjava3.core.ObservableOnSubscribe; import io.reactivex.rxjavafx.observables.JavaFxObservable; import io.reactivex.rxjavafx.schedulers.JavaFxScheduler; import io.reactivex.rxjavafx.subscriptions.JavaFxSubscriptions; @@ -42,7 +42,7 @@ public static Observable> fromObservableList(final Observa if (source instanceof ListProperty) { return JavaFxObservable.valuesOf((ListProperty) source); } else { - return mutations.startWith(source); + return mutations.startWithArray(source); } } diff --git a/src/main/java/io/reactivex/rxjavafx/sources/ObservableMapSource.java b/src/main/java/io/reactivex/rxjavafx/sources/ObservableMapSource.java index 13d17f1..a4a32a5 100644 --- a/src/main/java/io/reactivex/rxjavafx/sources/ObservableMapSource.java +++ b/src/main/java/io/reactivex/rxjavafx/sources/ObservableMapSource.java @@ -15,8 +15,8 @@ */ package io.reactivex.rxjavafx.sources; -import io.reactivex.Observable; -import io.reactivex.ObservableOnSubscribe; +import io.reactivex.rxjava3.core.Observable; +import io.reactivex.rxjava3.core.ObservableOnSubscribe; import io.reactivex.rxjavafx.observables.JavaFxObservable; import io.reactivex.rxjavafx.subscriptions.JavaFxSubscriptions; import javafx.beans.property.ListProperty; @@ -43,7 +43,7 @@ public static Observable> fromObservableMap(final Obser if (source instanceof MapProperty) { return JavaFxObservable.valuesOf((MapProperty) source); } else { - return mutations.startWith(source); + return mutations.startWithArray(source); } } diff --git a/src/main/java/io/reactivex/rxjavafx/sources/ObservableSetSource.java b/src/main/java/io/reactivex/rxjavafx/sources/ObservableSetSource.java index acb48e0..7e6c24f 100644 --- a/src/main/java/io/reactivex/rxjavafx/sources/ObservableSetSource.java +++ b/src/main/java/io/reactivex/rxjavafx/sources/ObservableSetSource.java @@ -15,8 +15,8 @@ */ package io.reactivex.rxjavafx.sources; -import io.reactivex.Observable; -import io.reactivex.ObservableOnSubscribe; +import io.reactivex.rxjava3.core.Observable; +import io.reactivex.rxjava3.core.ObservableOnSubscribe; import io.reactivex.rxjavafx.observables.JavaFxObservable; import io.reactivex.rxjavafx.schedulers.JavaFxScheduler; import io.reactivex.rxjavafx.subscriptions.JavaFxSubscriptions; @@ -38,7 +38,7 @@ public static Observable> fromObservableSet(final Observabl if (source instanceof SetProperty) { return JavaFxObservable.valuesOf((SetProperty) source); } else { - return mutations.startWith(source); + return mutations.startWithArray(source); } } diff --git a/src/main/java/io/reactivex/rxjavafx/sources/ObservableValueSource.java b/src/main/java/io/reactivex/rxjavafx/sources/ObservableValueSource.java index a7845e2..36c75f1 100644 --- a/src/main/java/io/reactivex/rxjavafx/sources/ObservableValueSource.java +++ b/src/main/java/io/reactivex/rxjavafx/sources/ObservableValueSource.java @@ -15,8 +15,8 @@ */ package io.reactivex.rxjavafx.sources; -import io.reactivex.Observable; -import io.reactivex.ObservableEmitter; +import io.reactivex.rxjava3.core.Observable; +import io.reactivex.rxjava3.core.ObservableEmitter; import io.reactivex.rxjavafx.subscriptions.JavaFxSubscriptions; import javafx.beans.InvalidationListener; import javafx.beans.value.ChangeListener; diff --git a/src/main/java/io/reactivex/rxjavafx/sources/SceneEventSource.java b/src/main/java/io/reactivex/rxjavafx/sources/SceneEventSource.java index 04a619c..b599c53 100644 --- a/src/main/java/io/reactivex/rxjavafx/sources/SceneEventSource.java +++ b/src/main/java/io/reactivex/rxjavafx/sources/SceneEventSource.java @@ -15,8 +15,8 @@ */ package io.reactivex.rxjavafx.sources; -import io.reactivex.Observable; -import io.reactivex.ObservableOnSubscribe; +import io.reactivex.rxjava3.core.Observable; +import io.reactivex.rxjava3.core.ObservableOnSubscribe; import io.reactivex.rxjavafx.schedulers.JavaFxScheduler; import io.reactivex.rxjavafx.subscriptions.JavaFxSubscriptions; import javafx.event.Event; diff --git a/src/main/java/io/reactivex/rxjavafx/sources/TimerSource.java b/src/main/java/io/reactivex/rxjavafx/sources/TimerSource.java index 5db3b7d..d2a6d06 100644 --- a/src/main/java/io/reactivex/rxjavafx/sources/TimerSource.java +++ b/src/main/java/io/reactivex/rxjavafx/sources/TimerSource.java @@ -15,7 +15,7 @@ */ package io.reactivex.rxjavafx.sources; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Observable; import javafx.animation.Animation; import javafx.animation.KeyFrame; import javafx.animation.Timeline; diff --git a/src/main/java/io/reactivex/rxjavafx/sources/WindowEventSource.java b/src/main/java/io/reactivex/rxjavafx/sources/WindowEventSource.java index a064947..be73bd5 100644 --- a/src/main/java/io/reactivex/rxjavafx/sources/WindowEventSource.java +++ b/src/main/java/io/reactivex/rxjavafx/sources/WindowEventSource.java @@ -15,8 +15,8 @@ */ package io.reactivex.rxjavafx.sources; -import io.reactivex.Observable; -import io.reactivex.ObservableEmitter; +import io.reactivex.rxjava3.core.Observable; +import io.reactivex.rxjava3.core.ObservableEmitter; import io.reactivex.rxjavafx.schedulers.JavaFxScheduler; import io.reactivex.rxjavafx.subscriptions.JavaFxSubscriptions; import javafx.event.EventHandler; diff --git a/src/main/java/io/reactivex/rxjavafx/subscriptions/CompositeBinding.java b/src/main/java/io/reactivex/rxjavafx/subscriptions/CompositeBinding.java index cce6075..3456b57 100644 --- a/src/main/java/io/reactivex/rxjavafx/subscriptions/CompositeBinding.java +++ b/src/main/java/io/reactivex/rxjavafx/subscriptions/CompositeBinding.java @@ -15,7 +15,7 @@ */ package io.reactivex.rxjavafx.subscriptions; -import io.reactivex.exceptions.Exceptions; +import io.reactivex.rxjava3.exceptions.Exceptions; import javafx.beans.binding.Binding; import java.util.*; diff --git a/src/main/java/io/reactivex/rxjavafx/subscriptions/JavaFxSubscriptions.java b/src/main/java/io/reactivex/rxjavafx/subscriptions/JavaFxSubscriptions.java index 0af5dbe..8b401b4 100644 --- a/src/main/java/io/reactivex/rxjavafx/subscriptions/JavaFxSubscriptions.java +++ b/src/main/java/io/reactivex/rxjavafx/subscriptions/JavaFxSubscriptions.java @@ -16,10 +16,9 @@ package io.reactivex.rxjavafx.subscriptions; -import io.reactivex.Scheduler; -import io.reactivex.disposables.Disposable; -import io.reactivex.disposables.Disposables; -import javafx.application.Platform;; +import io.reactivex.rxjava3.core.Scheduler; +import io.reactivex.rxjava3.disposables.Disposable; +import javafx.application.Platform; import io.reactivex.rxjavafx.schedulers.JavaFxScheduler; @@ -36,7 +35,7 @@ private JavaFxSubscriptions() { * @return an Disposable that always runs unsubscribe in the event dispatch thread. */ public static Disposable unsubscribeInEventDispatchThread(final Runnable unsubscribe) { - return Disposables.fromRunnable(() -> { + return Disposable.fromRunnable(() -> { if (Platform.isFxApplicationThread()) { unsubscribe.run(); } else { diff --git a/src/main/java/io/reactivex/rxjavafx/transformers/FxFlowableTransformers.java b/src/main/java/io/reactivex/rxjavafx/transformers/FxFlowableTransformers.java index b0dfdcb..945592b 100644 --- a/src/main/java/io/reactivex/rxjavafx/transformers/FxFlowableTransformers.java +++ b/src/main/java/io/reactivex/rxjavafx/transformers/FxFlowableTransformers.java @@ -15,12 +15,12 @@ */ package io.reactivex.rxjavafx.transformers; -import io.reactivex.FlowableOperator; -import io.reactivex.FlowableTransformer; -import io.reactivex.exceptions.Exceptions; -import io.reactivex.functions.Action; -import io.reactivex.functions.Consumer; -import io.reactivex.subscribers.ResourceSubscriber; +import io.reactivex.rxjava3.core.FlowableOperator; +import io.reactivex.rxjava3.core.FlowableTransformer; +import io.reactivex.rxjava3.exceptions.Exceptions; +import io.reactivex.rxjava3.functions.Action; +import io.reactivex.rxjava3.functions.Consumer; +import io.reactivex.rxjava3.subscribers.ResourceSubscriber; import javafx.application.Platform; import org.reactivestreams.Subscriber; import org.reactivestreams.Subscription; @@ -190,7 +190,7 @@ public void onComplete() { try { if (ctObserver.doOnCompletedCountAction != null) ctObserver.doOnCompletedCountAction.accept(count); - } catch (Exception e) { + } catch (Throwable e) { Exceptions.throwIfFatal(e); onError(e); return; @@ -206,7 +206,7 @@ public void onError(Throwable e) { try { if (ctObserver.doOnErrorCountAction != null) ctObserver.doOnErrorCountAction.accept(count); - } catch(Exception e1) { + } catch(Throwable e1) { Exceptions.throwIfFatal(e1); child.onError(e1); } @@ -220,7 +220,7 @@ public void onNext(T t) { ++count; if (ctObserver.doOnNextCountAction != null) ctObserver.doOnNextCountAction.accept(count); - } catch(Exception e) { + } catch(Throwable e) { Exceptions.throwIfFatal(e); onError(e); return; diff --git a/src/main/java/io/reactivex/rxjavafx/transformers/FxObservableTransformers.java b/src/main/java/io/reactivex/rxjavafx/transformers/FxObservableTransformers.java index ca7e29c..b8d9f8c 100644 --- a/src/main/java/io/reactivex/rxjavafx/transformers/FxObservableTransformers.java +++ b/src/main/java/io/reactivex/rxjavafx/transformers/FxObservableTransformers.java @@ -16,14 +16,14 @@ package io.reactivex.rxjavafx.transformers; -import io.reactivex.ObservableOperator; -import io.reactivex.ObservableTransformer; -import io.reactivex.Observer; -import io.reactivex.disposables.Disposable; -import io.reactivex.exceptions.Exceptions; -import io.reactivex.functions.Action; -import io.reactivex.functions.Consumer; -import io.reactivex.observers.ResourceObserver; +import io.reactivex.rxjava3.core.ObservableOperator; +import io.reactivex.rxjava3.core.ObservableTransformer; +import io.reactivex.rxjava3.core.Observer; +import io.reactivex.rxjava3.disposables.Disposable; +import io.reactivex.rxjava3.exceptions.Exceptions; +import io.reactivex.rxjava3.functions.Action; +import io.reactivex.rxjava3.functions.Consumer; +import io.reactivex.rxjava3.observers.ResourceObserver; import javafx.application.Platform; @@ -183,7 +183,7 @@ public void onComplete() { try { if (ctObserver.doOnCompletedCountAction != null) ctObserver.doOnCompletedCountAction.accept(count); - } catch (Exception e) { + } catch (Throwable e) { Exceptions.throwIfFatal(e); onError(e); return; @@ -199,7 +199,7 @@ public void onError(Throwable e) { try { if (ctObserver.doOnErrorCountAction != null) ctObserver.doOnErrorCountAction.accept(count); - } catch(Exception e1) { + } catch(Throwable e1) { Exceptions.throwIfFatal(e1); child.onError(e1); } @@ -213,7 +213,7 @@ public void onNext(T t) { ++count; if (ctObserver.doOnNextCountAction != null) ctObserver.doOnNextCountAction.accept(count); - } catch(Exception e) { + } catch(Throwable e) { Exceptions.throwIfFatal(e); onError(e); return; diff --git a/src/main/java/module-info.java b/src/main/java/module-info.java index c6a423c..235c21d 100644 --- a/src/main/java/module-info.java +++ b/src/main/java/module-info.java @@ -1,5 +1,5 @@ module rxjavafx { - requires io.reactivex.rxjava2; + requires io.reactivex.rxjava3; requires javafx.base; requires javafx.graphics; requires javafx.controls; @@ -10,5 +10,5 @@ exports io.reactivex.rxjavafx.schedulers; exports io.reactivex.rxjavafx.sources; exports io.reactivex.rxjavafx.subscriptions; - exports io.reactivex.rxjavafx.transformers; + exports io.reactivex.rxjavafx.transformers; } diff --git a/src/test/java/io/reactivex/rxjavafx/RxJavaFXTest.java b/src/test/java/io/reactivex/rxjavafx/RxJavaFXTest.java index 6fd24ed..b31f285 100644 --- a/src/test/java/io/reactivex/rxjavafx/RxJavaFXTest.java +++ b/src/test/java/io/reactivex/rxjavafx/RxJavaFXTest.java @@ -1,11 +1,11 @@ package io.reactivex.rxjavafx; -import io.reactivex.Observable; -import io.reactivex.disposables.Disposable; +import io.reactivex.rxjava3.core.Observable; +import io.reactivex.rxjava3.disposables.Disposable; import io.reactivex.rxjavafx.observables.JavaFxObservable; import io.reactivex.rxjavafx.observers.JavaFxObserver; import io.reactivex.rxjavafx.schedulers.JavaFxScheduler; -import io.reactivex.schedulers.Schedulers; +import io.reactivex.rxjava3.schedulers.Schedulers; import javafx.application.Application; import javafx.beans.binding.Binding; import javafx.event.ActionEvent; diff --git a/src/test/java/io/reactivex/rxjavafx/operators/OperatorsTest.java b/src/test/java/io/reactivex/rxjavafx/operators/OperatorsTest.java index 780c36a..2fced24 100644 --- a/src/test/java/io/reactivex/rxjavafx/operators/OperatorsTest.java +++ b/src/test/java/io/reactivex/rxjavafx/operators/OperatorsTest.java @@ -1,7 +1,7 @@ package io.reactivex.rxjavafx.operators; -import io.reactivex.Flowable; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Flowable; +import io.reactivex.rxjava3.core.Observable; import io.reactivex.rxjavafx.transformers.FxFlowableTransformers; import io.reactivex.rxjavafx.transformers.FxObservableTransformers; import org.junit.Assert; diff --git a/src/test/java/io/reactivex/rxjavafx/schedulers/JavaFxSchedulerTest.java b/src/test/java/io/reactivex/rxjavafx/schedulers/JavaFxSchedulerTest.java index 3aa12c2..eec4813 100644 --- a/src/test/java/io/reactivex/rxjavafx/schedulers/JavaFxSchedulerTest.java +++ b/src/test/java/io/reactivex/rxjavafx/schedulers/JavaFxSchedulerTest.java @@ -15,7 +15,7 @@ */ package io.reactivex.rxjavafx.schedulers; -import io.reactivex.Scheduler; +import io.reactivex.rxjava3.core.Scheduler; import javafx.application.Application; import javafx.application.Platform; import javafx.stage.Stage; diff --git a/src/test/java/io/reactivex/rxjavafx/sources/JavaFxObservableTest.java b/src/test/java/io/reactivex/rxjavafx/sources/JavaFxObservableTest.java index 1ede5f0..48515b1 100644 --- a/src/test/java/io/reactivex/rxjavafx/sources/JavaFxObservableTest.java +++ b/src/test/java/io/reactivex/rxjavafx/sources/JavaFxObservableTest.java @@ -15,11 +15,11 @@ */ package io.reactivex.rxjavafx.sources; -import io.reactivex.Observable; -import io.reactivex.observers.TestObserver; +import io.reactivex.rxjava3.core.Observable; +import io.reactivex.rxjava3.observers.TestObserver; import io.reactivex.rxjavafx.observables.JavaFxObservable; import io.reactivex.rxjavafx.schedulers.JavaFxScheduler; -import io.reactivex.schedulers.Schedulers; +import io.reactivex.rxjava3.schedulers.Schedulers; import javafx.application.Platform; import javafx.beans.property.*; import javafx.collections.FXCollections; diff --git a/src/test/java/io/reactivex/rxjavafx/subscriptions/BindingTest.java b/src/test/java/io/reactivex/rxjavafx/subscriptions/BindingTest.java index 603da60..3b78478 100755 --- a/src/test/java/io/reactivex/rxjavafx/subscriptions/BindingTest.java +++ b/src/test/java/io/reactivex/rxjavafx/subscriptions/BindingTest.java @@ -15,13 +15,13 @@ */ package io.reactivex.rxjavafx.subscriptions; -import io.reactivex.Flowable; -import io.reactivex.Observable; -import io.reactivex.processors.PublishProcessor; +import io.reactivex.rxjava3.core.Flowable; +import io.reactivex.rxjava3.core.Observable; +import io.reactivex.rxjava3.processors.PublishProcessor; import io.reactivex.rxjavafx.observers.JavaFxObserver; import io.reactivex.rxjavafx.observers.JavaFxSubscriber; import io.reactivex.rxjavafx.schedulers.JavaFxScheduler; -import io.reactivex.subjects.PublishSubject; +import io.reactivex.rxjava3.subjects.PublishSubject; import javafx.application.Platform; import javafx.beans.binding.Binding; import org.junit.Test;