Skip to content

Commit

Permalink
Upgrade to RxJava 3.0.0-RC7
Browse files Browse the repository at this point in the history
  • Loading branch information
akarnokd committed Jan 1, 2020
1 parent 98a9774 commit 2c80686
Show file tree
Hide file tree
Showing 19 changed files with 82 additions and 83 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Library to convert between RxJava 1.x and 3.x reactive types.

```
dependencies {
compile "com.github.akarnokd:rxjava3-interop:3.0.0-RC6"
compile "com.github.akarnokd:rxjava3-interop:3.0.0-RC7"
}
```

Expand Down
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ apply plugin: 'jacoco'
apply plugin: 'ru.vyarus.animalsniffer'
apply plugin: "com.github.hierynomus.license"

sourceCompatibility = '1.6'
targetCompatibility = '1.6'
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

group = "com.github.akarnokd"
ext.githubProjectName = 'rxjava3-interop'
Expand All @@ -44,11 +44,11 @@ repositories {
}

dependencies {
signature 'org.codehaus.mojo.signature:java16:1.1@signature'
signature 'org.codehaus.mojo.signature:java18:1.0@signature'

compile "org.reactivestreams:reactive-streams:1.0.3"
compile "io.reactivex:rxjava:1.3.8"
compile "io.reactivex.rxjava3:rxjava:3.0.0-RC6"
compile "io.reactivex.rxjava3:rxjava:3.0.0-RC7"

testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile 'org.mockito:mockito-core:3.2.4'
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
GROUP=com.github.akarnokd
VERSION_NAME=3.0.0-RC6
version=3.0.0-RC6
VERSION_NAME=3.0.0-RC7
version=3.0.0-RC7

POM_ARTIFACT_ID=rxjava3-interop
POM_NAME=Interop library between RxJava 1.x and 3.x
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ final class FlowableV3ToObservableV1<T> implements rx.Observable.OnSubscribe<T>

@Override
public void call(rx.Subscriber<? super T> t) {
SourceSubscriber<T> parent = new SourceSubscriber<T>(t);
SourceSubscriber<T> parent = new SourceSubscriber<>(t);

t.add(parent);
t.setProducer(parent);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ final class MaybeV3ToCompletableV1<T> implements rx.Completable.OnSubscribe {

@Override
public void call(rx.CompletableSubscriber t) {
MaybeV3Observer<T> parent = new MaybeV3Observer<T>(t);
MaybeV3Observer<T> parent = new MaybeV3Observer<>(t);
t.onSubscribe(parent);
source.subscribe(parent);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ final class MaybeV3ToSingleV1<T> implements rx.Single.OnSubscribe<T> {

@Override
public void call(rx.SingleSubscriber<? super T> t) {
MaybeV3Observer<T> parent = new MaybeV3Observer<T>(t);
MaybeV3Observer<T> parent = new MaybeV3Observer<>(t);
t.add(parent);
source.subscribe(parent);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ final class ObservableV1ToFlowableV3<T> extends io.reactivex.rxjava3.core.Flowab

@Override
protected void subscribeActual(org.reactivestreams.Subscriber<? super T> s) {
ObservableSubscriber<T> parent = new ObservableSubscriber<T>(s);
ObservableSubscriber<T> parent = new ObservableSubscriber<>(s);
ObservableSubscriberSubscription parentSubscription = new ObservableSubscriberSubscription(parent);
s.onSubscribe(parentSubscription);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ final class ObservableV1ToObservableV3<T> extends io.reactivex.rxjava3.core.Obse

@Override
protected void subscribeActual(io.reactivex.rxjava3.core.Observer<? super T> s) {
ObservableSubscriber<T> parent = new ObservableSubscriber<T>(s);
ObservableSubscriber<T> parent = new ObservableSubscriber<>(s);
s.onSubscribe(parent);

source.unsafeSubscribe(parent);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
final class ProcessorV3ToSubjectV1<T> extends rx.subjects.Subject<T, T> {

static <T> rx.subjects.Subject<T, T> createWith(io.reactivex.rxjava3.processors.FlowableProcessor<T> processor) {
State<T> state = new State<T>(processor);
return new ProcessorV3ToSubjectV1<T>(state);
State<T> state = new State<>(processor);
return new ProcessorV3ToSubjectV1<>(state);
}

final State<T> state;
Expand Down Expand Up @@ -67,7 +67,7 @@ static final class State<T>
@Override
public void call(rx.Subscriber<? super T> t) {
hu.akarnokd.rxjava3.interop.FlowableV3ToObservableV1.SourceSubscriber<T> parent =
new hu.akarnokd.rxjava3.interop.FlowableV3ToObservableV1.SourceSubscriber<T>(t);
new hu.akarnokd.rxjava3.interop.FlowableV3ToObservableV1.SourceSubscriber<>(t);

t.add(parent);
t.setProducer(parent);
Expand Down
96 changes: 48 additions & 48 deletions src/main/java/hu/akarnokd/rxjava3/interop/RxJavaInterop.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ static final class RunnableToV1Action0 implements rx.functions.Action0 {
final Runnable source;

RunnableToV1Action0(Runnable source) {
io.reactivex.rxjava3.internal.functions.ObjectHelper.requireNonNull(source, "Source 3.x Runnable is null");
java.util.Objects.requireNonNull(source, "Source 3.x Runnable is null");
this.source = source;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ static final class Action0V1ToRunnable implements Runnable {
final rx.functions.Action0 source;

Action0V1ToRunnable(rx.functions.Action0 source) {
io.reactivex.rxjava3.internal.functions.ObjectHelper.requireNonNull(source, "Source 1.x Action0 is null");
java.util.Objects.requireNonNull(source, "Source 1.x Action0 is null");
this.source = source;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ final class SingleV1ToMaybeV3<T> extends io.reactivex.rxjava3.core.Maybe<T> {

@Override
protected void subscribeActual(io.reactivex.rxjava3.core.MaybeObserver<? super T> observer) {
SourceSingleSubscriber<T> parent = new SourceSingleSubscriber<T>(observer);
SourceSingleSubscriber<T> parent = new SourceSingleSubscriber<>(observer);
observer.onSubscribe(parent);
source.subscribe(parent);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ final class SingleV1ToSingleV3<T> extends io.reactivex.rxjava3.core.Single<T> {

@Override
protected void subscribeActual(io.reactivex.rxjava3.core.SingleObserver<? super T> observer) {
SourceSingleSubscriber<T> parent = new SourceSingleSubscriber<T>(observer);
SourceSingleSubscriber<T> parent = new SourceSingleSubscriber<>(observer);
observer.onSubscribe(parent);
source.subscribe(parent);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ final class SingleV3ToSingleV1<T> implements rx.Single.OnSubscribe<T> {

@Override
public void call(rx.SingleSubscriber<? super T> t) {
SourceSingleObserver<T> parent = new SourceSingleObserver<T>(t);
SourceSingleObserver<T> parent = new SourceSingleObserver<>(t);
t.add(parent);
source.subscribe(parent);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public void onComplete() {
@Override
protected void subscribeActual(org.reactivestreams.Subscriber<? super T> s) {
hu.akarnokd.rxjava3.interop.ObservableV1ToFlowableV3.ObservableSubscriber<T> parent =
new hu.akarnokd.rxjava3.interop.ObservableV1ToFlowableV3.ObservableSubscriber<T>(s);
new hu.akarnokd.rxjava3.interop.ObservableV1ToFlowableV3.ObservableSubscriber<>(s);
hu.akarnokd.rxjava3.interop.ObservableV1ToFlowableV3.ObservableSubscriberSubscription parentSubscription =
new hu.akarnokd.rxjava3.interop.ObservableV1ToFlowableV3.ObservableSubscriberSubscription(parent);
s.onSubscribe(parentSubscription);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public void onComplete() {
@Override
protected void subscribeActual(io.reactivex.rxjava3.core.Observer<? super T> observer) {
hu.akarnokd.rxjava3.interop.ObservableV1ToObservableV3.ObservableSubscriber<T> parent =
new hu.akarnokd.rxjava3.interop.ObservableV1ToObservableV3.ObservableSubscriber<T>(observer);
new hu.akarnokd.rxjava3.interop.ObservableV1ToObservableV3.ObservableSubscriber<>(observer);
observer.onSubscribe(parent);

source.unsafeSubscribe(parent);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
final class SubjectV3ToSubjectV1<T> extends rx.subjects.Subject<T, T> {

static <T> rx.subjects.Subject<T, T> createWith(io.reactivex.rxjava3.subjects.Subject<T> subject) {
State<T> state = new State<T>(subject);
return new SubjectV3ToSubjectV1<T>(state);
State<T> state = new State<>(subject);
return new SubjectV3ToSubjectV1<>(state);
}

final State<T> state;
Expand Down Expand Up @@ -68,7 +68,7 @@ static final class State<T>

@Override
public void call(rx.Subscriber<? super T> t) {
SourceObserver<T> parent = new SourceObserver<T>(t);
SourceObserver<T> parent = new SourceObserver<>(t);

t.add(parent);
t.setProducer(parent);
Expand Down
19 changes: 9 additions & 10 deletions src/test/java/hu/akarnokd/rxjava3/interop/RxJavaInteropTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ public void o1f3Empty() {
.assertResult();
}

@SuppressWarnings("unchecked")
static void assertFailureAndMessage(BaseTestConsumer<?, ?> testConsumer, Class<? extends Throwable> errorClass, final String message) {
testConsumer
.assertFailure(errorClass)
Expand Down Expand Up @@ -512,13 +511,13 @@ public void onError(Throwable e) {
// ----------------------------------------------------------

static <T> rx.observers.TestSubscriber<T> test1(rx.Observable<T> s) {
rx.observers.TestSubscriber<T> ts = new rx.observers.TestSubscriber<T>();
rx.observers.TestSubscriber<T> ts = new rx.observers.TestSubscriber<>();
s.subscribe(ts);
return ts;
}

static <T> rx.observers.TestSubscriber<T> test1(rx.Observable<T> s, long initialRequest) {
rx.observers.TestSubscriber<T> ts = new rx.observers.TestSubscriber<T>(initialRequest);
rx.observers.TestSubscriber<T> ts = new rx.observers.TestSubscriber<>(initialRequest);
s.subscribe(ts);
return ts;
}
Expand Down Expand Up @@ -626,7 +625,7 @@ public void o3o1Error() {
// ----------------------------------------------------------

static <T> rx.observers.TestSubscriber<T> test1(rx.Single<T> s) {
rx.observers.TestSubscriber<T> ts = new rx.observers.TestSubscriber<T>();
rx.observers.TestSubscriber<T> ts = new rx.observers.TestSubscriber<>();
s.subscribe(ts);
return ts;
}
Expand Down Expand Up @@ -667,7 +666,7 @@ public void s3s1Error() {
// ----------------------------------------------------------

static <T> rx.observers.TestSubscriber<T> test1(rx.Completable s) {
rx.observers.TestSubscriber<T> ts = new rx.observers.TestSubscriber<T>();
rx.observers.TestSubscriber<T> ts = new rx.observers.TestSubscriber<>();
s.subscribe(ts);
return ts;
}
Expand Down Expand Up @@ -881,7 +880,7 @@ public void sj1ToSj3Lifecycle() {
assertFalse(sj3.hasThrowable());
assertNull(sj3.getThrowable());

Disposable d1 = Disposables.empty();
Disposable d1 = Disposable.empty();
sj3.onSubscribe(d1);

assertFalse(d1.isDisposed());
Expand All @@ -893,7 +892,7 @@ public void sj1ToSj3Lifecycle() {
sj3.onError(new IOException());
sj3.onNext(3);

Disposable d3 = Disposables.empty();
Disposable d3 = Disposable.empty();
sj3.onSubscribe(d3);

assertFalse(d1.isDisposed());
Expand Down Expand Up @@ -1596,12 +1595,12 @@ public void toV1SubscriptionNullDisposable() {

@Test
public void toV1SubscriptionIsUnsubscribedTrue() {
assertTrue(RxJavaInterop.toV1Subscription(Disposables.disposed()).isUnsubscribed());
assertTrue(RxJavaInterop.toV1Subscription(Disposable.disposed()).isUnsubscribed());
}

@Test
public void toV1SubscriptionIsUnsubscribedFalse() {
assertFalse(RxJavaInterop.toV1Subscription(Disposables.empty()).isUnsubscribed());
assertFalse(RxJavaInterop.toV1Subscription(Disposable.empty()).isUnsubscribed());
}

@Test
Expand Down Expand Up @@ -1666,7 +1665,7 @@ public void v1ObservableIsUnsubscribedOnCompletion2() {

@Test
public void flowableV3toObservableV1SourceUnsubscribed() {
rx.Subscription s = new FlowableV3ToObservableV1.SourceSubscriber<Integer>(
rx.Subscription s = new FlowableV3ToObservableV1.SourceSubscriber<>(
new rx.observers.TestSubscriber<Integer>());

assertFalse(s.isUnsubscribed());
Expand Down

0 comments on commit 2c80686

Please sign in to comment.