The following issues were found
src/main/java/io/reactivex/rxjava3/internal/operators/observable/BlockingObservableLatest.java
11 issues
Line: 33
*/
public final class BlockingObservableLatest<T> implements Iterable<T> {
final ObservableSource<T> source;
public BlockingObservableLatest(ObservableSource<T> source) {
this.source = source;
}
Reported by PMD.
Line: 43
public Iterator<T> iterator() {
BlockingObservableLatestIterator<T> lio = new BlockingObservableLatestIterator<>();
Observable<Notification<T>> materialized = Observable.wrap(source).materialize();
materialized.subscribe(lio);
return lio;
}
Reported by PMD.
Line: 45
Observable<Notification<T>> materialized = Observable.wrap(source).materialize();
materialized.subscribe(lio);
return lio;
}
static final class BlockingObservableLatestIterator<T> extends DisposableObserver<Notification<T>> implements Iterator<T> {
// iterator's notification
Reported by PMD.
Line: 51
static final class BlockingObservableLatestIterator<T> extends DisposableObserver<Notification<T>> implements Iterator<T> {
// iterator's notification
Notification<T> iteratorNotification;
final Semaphore notify = new Semaphore(0);
// observer's notification
final AtomicReference<Notification<T>> value = new AtomicReference<>();
Reported by PMD.
Line: 53
// iterator's notification
Notification<T> iteratorNotification;
final Semaphore notify = new Semaphore(0);
// observer's notification
final AtomicReference<Notification<T>> value = new AtomicReference<>();
@Override
public void onNext(Notification<T> args) {
Reported by PMD.
Line: 55
final Semaphore notify = new Semaphore(0);
// observer's notification
final AtomicReference<Notification<T>> value = new AtomicReference<>();
@Override
public void onNext(Notification<T> args) {
boolean wasNotAvailable = value.getAndSet(args) == null;
if (wasNotAvailable) {
Reported by PMD.
Line: 92
Notification<T> n = value.getAndSet(null);
iteratorNotification = n;
if (n.isOnError()) {
throw ExceptionHelper.wrapOrThrow(n.getError());
}
}
return iteratorNotification.isOnNext();
}
Reported by PMD.
Line: 93
Notification<T> n = value.getAndSet(null);
iteratorNotification = n;
if (n.isOnError()) {
throw ExceptionHelper.wrapOrThrow(n.getError());
}
}
return iteratorNotification.isOnNext();
}
Reported by PMD.
Line: 103
public T next() {
if (hasNext()) {
T v = iteratorNotification.getValue();
iteratorNotification = null;
return v;
}
throw new NoSuchElementException();
}
Reported by PMD.
Line: 20
import java.util.concurrent.Semaphore;
import java.util.concurrent.atomic.AtomicReference;
import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.core.Observable;
import io.reactivex.rxjava3.internal.util.*;
import io.reactivex.rxjava3.observers.DisposableObserver;
import io.reactivex.rxjava3.plugins.RxJavaPlugins;
Reported by PMD.
src/main/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableRepeat.java
11 issues
Line: 24
import io.reactivex.rxjava3.internal.subscriptions.SubscriptionArbiter;
public final class FlowableRepeat<T> extends AbstractFlowableWithUpstream<T, T> {
final long count;
public FlowableRepeat(Flowable<T> source, long count) {
super(source);
this.count = count;
}
Reported by PMD.
Line: 43
private static final long serialVersionUID = -7098360935104053232L;
final Subscriber<? super T> downstream;
final SubscriptionArbiter sa;
final Publisher<? extends T> source;
long remaining;
long produced;
Reported by PMD.
Line: 44
private static final long serialVersionUID = -7098360935104053232L;
final Subscriber<? super T> downstream;
final SubscriptionArbiter sa;
final Publisher<? extends T> source;
long remaining;
long produced;
Reported by PMD.
Line: 45
final Subscriber<? super T> downstream;
final SubscriptionArbiter sa;
final Publisher<? extends T> source;
long remaining;
long produced;
RepeatSubscriber(Subscriber<? super T> actual, long count, SubscriptionArbiter sa, Publisher<? extends T> source) {
Reported by PMD.
Line: 46
final Subscriber<? super T> downstream;
final SubscriptionArbiter sa;
final Publisher<? extends T> source;
long remaining;
long produced;
RepeatSubscriber(Subscriber<? super T> actual, long count, SubscriptionArbiter sa, Publisher<? extends T> source) {
this.downstream = actual;
Reported by PMD.
Line: 48
final Publisher<? extends T> source;
long remaining;
long produced;
RepeatSubscriber(Subscriber<? super T> actual, long count, SubscriptionArbiter sa, Publisher<? extends T> source) {
this.downstream = actual;
this.sa = sa;
this.source = source;
Reported by PMD.
Line: 79
if (r != Long.MAX_VALUE) {
remaining = r - 1;
}
if (r != 0L) {
subscribeNext();
} else {
downstream.onComplete();
}
}
Reported by PMD.
Line: 97
return;
}
long p = produced;
if (p != 0L) {
produced = 0L;
sa.produced(p);
}
source.subscribe(this);
Reported by PMD.
Line: 18
import java.util.concurrent.atomic.AtomicInteger;
import org.reactivestreams.*;
import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.internal.subscriptions.SubscriptionArbiter;
public final class FlowableRepeat<T> extends AbstractFlowableWithUpstream<T, T> {
Reported by PMD.
Line: 20
import org.reactivestreams.*;
import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.internal.subscriptions.SubscriptionArbiter;
public final class FlowableRepeat<T> extends AbstractFlowableWithUpstream<T, T> {
final long count;
public FlowableRepeat(Flowable<T> source, long count) {
Reported by PMD.
src/main/java/io/reactivex/rxjava3/internal/operators/mixed/ConcatMapXMainObserver.java
11 issues
Line: 36
private static final long serialVersionUID = -3214213361171757852L;
final AtomicThrowable errors;
final int prefetch;
final ErrorMode errorMode;
Reported by PMD.
Line: 38
final AtomicThrowable errors;
final int prefetch;
final ErrorMode errorMode;
SimpleQueue<T> queue;
Reported by PMD.
Line: 40
final int prefetch;
final ErrorMode errorMode;
SimpleQueue<T> queue;
Disposable upstream;
Reported by PMD.
Line: 42
final ErrorMode errorMode;
SimpleQueue<T> queue;
Disposable upstream;
volatile boolean done;
Reported by PMD.
Line: 44
SimpleQueue<T> queue;
Disposable upstream;
volatile boolean done;
volatile boolean disposed;
Reported by PMD.
Line: 46
Disposable upstream;
volatile boolean done;
volatile boolean disposed;
public ConcatMapXMainObserver(int prefetch, ErrorMode errorMode) {
this.errorMode = errorMode;
Reported by PMD.
Line: 48
volatile boolean done;
volatile boolean disposed;
public ConcatMapXMainObserver(int prefetch, ErrorMode errorMode) {
this.errorMode = errorMode;
this.errors = new AtomicThrowable();
this.prefetch = prefetch;
Reported by PMD.
Line: 63
if (d instanceof QueueDisposable) {
@SuppressWarnings("unchecked")
QueueDisposable<T> qd = (QueueDisposable<T>)d;
int mode = qd.requestFusion(QueueFuseable.ANY | QueueFuseable.BOUNDARY);
if (mode == QueueFuseable.SYNC) {
queue = qd;
done = true;
onSubscribeDownstream();
Reported by PMD.
Line: 73
drain();
return;
}
else if (mode == QueueFuseable.ASYNC) {
queue = qd;
onSubscribeDownstream();
return;
Reported by PMD.
Line: 21
import io.reactivex.rxjava3.core.Observer;
import io.reactivex.rxjava3.disposables.Disposable;
import io.reactivex.rxjava3.internal.disposables.DisposableHelper;
import io.reactivex.rxjava3.internal.fuseable.*;
import io.reactivex.rxjava3.internal.queue.SpscLinkedArrayQueue;
import io.reactivex.rxjava3.internal.util.*;
/**
* Base class for implementing concatMapX main observers.
Reported by PMD.
src/test/java/io/reactivex/rxjava3/internal/util/BlockingHelperTest.java
11 issues
Line: 30
public class BlockingHelperTest extends RxJavaTest {
@Test
public void emptyEnum() {
TestHelper.checkUtilityClass(BlockingHelper.class);
}
@Test
public void interrupted() {
Reported by PMD.
Line: 35
}
@Test
public void interrupted() {
CountDownLatch cdl = new CountDownLatch(1);
Disposable d = Disposable.empty();
Thread.currentThread().interrupt();
Reported by PMD.
Line: 39
CountDownLatch cdl = new CountDownLatch(1);
Disposable d = Disposable.empty();
Thread.currentThread().interrupt();
try {
BlockingHelper.awaitForComplete(cdl, d);
} catch (IllegalStateException ex) {
// expected
Reported by PMD.
Line: 43
try {
BlockingHelper.awaitForComplete(cdl, d);
} catch (IllegalStateException ex) {
// expected
}
assertTrue(d.isDisposed());
assertTrue(Thread.interrupted());
}
Reported by PMD.
Line: 46
} catch (IllegalStateException ex) {
// expected
}
assertTrue(d.isDisposed());
assertTrue(Thread.interrupted());
}
@Test
public void unblock() {
Reported by PMD.
Line: 46
} catch (IllegalStateException ex) {
// expected
}
assertTrue(d.isDisposed());
assertTrue(Thread.interrupted());
}
@Test
public void unblock() {
Reported by PMD.
Line: 47
// expected
}
assertTrue(d.isDisposed());
assertTrue(Thread.interrupted());
}
@Test
public void unblock() {
final CountDownLatch cdl = new CountDownLatch(1);
Reported by PMD.
Line: 64
BlockingHelper.awaitForComplete(cdl, d);
assertFalse(d.isDisposed());
}
}
Reported by PMD.
Line: 64
BlockingHelper.awaitForComplete(cdl, d);
assertFalse(d.isDisposed());
}
}
Reported by PMD.
Line: 16
package io.reactivex.rxjava3.internal.util;
import static org.junit.Assert.*;
import java.util.concurrent.*;
import org.junit.Test;
Reported by PMD.
src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableCastTest.java
11 issues
Line: 29
@Test
public void cast() {
Observable<?> source = Observable.just(1, 2);
Observable<Integer> observable = source.cast(Integer.class);
Observer<Integer> observer = TestHelper.mockObserver();
observable.subscribe(observer);
Reported by PMD.
Line: 33
Observer<Integer> observer = TestHelper.mockObserver();
observable.subscribe(observer);
verify(observer, times(1)).onNext(1);
verify(observer, times(1)).onNext(1);
verify(observer, never()).onError(
any(Throwable.class));
Reported by PMD.
Line: 35
observable.subscribe(observer);
verify(observer, times(1)).onNext(1);
verify(observer, times(1)).onNext(1);
verify(observer, never()).onError(
any(Throwable.class));
verify(observer, times(1)).onComplete();
}
Reported by PMD.
Line: 36
observable.subscribe(observer);
verify(observer, times(1)).onNext(1);
verify(observer, times(1)).onNext(1);
verify(observer, never()).onError(
any(Throwable.class));
verify(observer, times(1)).onComplete();
}
Reported by PMD.
Line: 37
verify(observer, times(1)).onNext(1);
verify(observer, times(1)).onNext(1);
verify(observer, never()).onError(
any(Throwable.class));
verify(observer, times(1)).onComplete();
}
@Test
Reported by PMD.
Line: 39
verify(observer, times(1)).onNext(1);
verify(observer, never()).onError(
any(Throwable.class));
verify(observer, times(1)).onComplete();
}
@Test
public void castWithWrongType() {
Observable<?> source = Observable.just(1, 2);
Reported by PMD.
Line: 45
@Test
public void castWithWrongType() {
Observable<?> source = Observable.just(1, 2);
Observable<Boolean> observable = source.cast(Boolean.class);
Observer<Boolean> observer = TestHelper.mockObserver();
observable.subscribe(observer);
Reported by PMD.
Line: 49
Observer<Boolean> observer = TestHelper.mockObserver();
observable.subscribe(observer);
verify(observer, times(1)).onError(
any(ClassCastException.class));
}
}
Reported by PMD.
Line: 51
observable.subscribe(observer);
verify(observer, times(1)).onError(
any(ClassCastException.class));
}
}
Reported by PMD.
Line: 17
package io.reactivex.rxjava3.internal.operators.observable;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.*;
import org.junit.Test;
import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.testsupport.TestHelper;
Reported by PMD.
src/test/java/io/reactivex/rxjava3/internal/operators/maybe/MaybeToSingleTest.java
11 issues
Line: 29
public class MaybeToSingleTest extends RxJavaTest {
@Test
public void source() {
Maybe<Integer> m = Maybe.just(1);
Single<Integer> s = m.toSingle();
assertTrue(s.getClass().toString(), s instanceof HasUpstreamMaybeSource);
Reported by PMD.
Line: 31
@Test
public void source() {
Maybe<Integer> m = Maybe.just(1);
Single<Integer> s = m.toSingle();
assertTrue(s.getClass().toString(), s instanceof HasUpstreamMaybeSource);
assertSame(m, (((HasUpstreamMaybeSource<?>)s).source()));
}
Reported by PMD.
Line: 33
Maybe<Integer> m = Maybe.just(1);
Single<Integer> s = m.toSingle();
assertTrue(s.getClass().toString(), s instanceof HasUpstreamMaybeSource);
assertSame(m, (((HasUpstreamMaybeSource<?>)s).source()));
}
@Test
Reported by PMD.
Line: 33
Maybe<Integer> m = Maybe.just(1);
Single<Integer> s = m.toSingle();
assertTrue(s.getClass().toString(), s instanceof HasUpstreamMaybeSource);
assertSame(m, (((HasUpstreamMaybeSource<?>)s).source()));
}
@Test
Reported by PMD.
Line: 35
assertTrue(s.getClass().toString(), s instanceof HasUpstreamMaybeSource);
assertSame(m, (((HasUpstreamMaybeSource<?>)s).source()));
}
@Test
public void dispose() {
TestHelper.checkDisposed(PublishProcessor.create().singleElement().toSingle());
Reported by PMD.
Line: 39
}
@Test
public void dispose() {
TestHelper.checkDisposed(PublishProcessor.create().singleElement().toSingle());
}
@Test
public void doubleOnSubscribe() {
Reported by PMD.
Line: 40
@Test
public void dispose() {
TestHelper.checkDisposed(PublishProcessor.create().singleElement().toSingle());
}
@Test
public void doubleOnSubscribe() {
TestHelper.checkDoubleOnSubscribeMaybeToSingle(new Function<Maybe<Object>, SingleSource<Object>>() {
Reported by PMD.
Line: 40
@Test
public void dispose() {
TestHelper.checkDisposed(PublishProcessor.create().singleElement().toSingle());
}
@Test
public void doubleOnSubscribe() {
TestHelper.checkDoubleOnSubscribeMaybeToSingle(new Function<Maybe<Object>, SingleSource<Object>>() {
Reported by PMD.
Line: 44
}
@Test
public void doubleOnSubscribe() {
TestHelper.checkDoubleOnSubscribeMaybeToSingle(new Function<Maybe<Object>, SingleSource<Object>>() {
@Override
public SingleSource<Object> apply(Maybe<Object> m) throws Exception {
return m.toSingle();
}
Reported by PMD.
Line: 16
package io.reactivex.rxjava3.internal.operators.maybe;
import static org.junit.Assert.*;
import org.junit.Test;
import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.functions.Function;
Reported by PMD.
src/test/java/io/reactivex/rxjava3/internal/operators/single/SingleEqualsTest.java
10 issues
Line: 28
public class SingleEqualsTest extends RxJavaTest {
@Test
public void bothSucceedEqual() {
Single.sequenceEqual(Single.just(1), Single.just(1))
.test()
.assertResult(true);
}
Reported by PMD.
Line: 29
@Test
public void bothSucceedEqual() {
Single.sequenceEqual(Single.just(1), Single.just(1))
.test()
.assertResult(true);
}
@Test
Reported by PMD.
Line: 29
@Test
public void bothSucceedEqual() {
Single.sequenceEqual(Single.just(1), Single.just(1))
.test()
.assertResult(true);
}
@Test
Reported by PMD.
Line: 35
}
@Test
public void bothSucceedNotEqual() {
Single.sequenceEqual(Single.just(1), Single.just(2))
.test()
.assertResult(false);
}
Reported by PMD.
Line: 36
@Test
public void bothSucceedNotEqual() {
Single.sequenceEqual(Single.just(1), Single.just(2))
.test()
.assertResult(false);
}
@Test
Reported by PMD.
Line: 36
@Test
public void bothSucceedNotEqual() {
Single.sequenceEqual(Single.just(1), Single.just(2))
.test()
.assertResult(false);
}
@Test
Reported by PMD.
Line: 42
}
@Test
public void firstSucceedOtherError() {
Single.sequenceEqual(Single.just(1), Single.error(new TestException()))
.test()
.assertFailure(TestException.class);
}
Reported by PMD.
Line: 49
}
@Test
public void firstErrorOtherSucceed() {
Single.sequenceEqual(Single.error(new TestException()), Single.just(1))
.test()
.assertFailure(TestException.class);
}
Reported by PMD.
Line: 56
}
@Test
public void bothError() {
List<Throwable> errors = TestHelper.trackPluginErrors();
try {
Single.sequenceEqual(Single.error(new TestException("One")), Single.error(new TestException("Two")))
.to(TestHelper.<Boolean>testConsumer())
.assertFailureAndMessage(TestException.class, "One");
Reported by PMD.
Line: 20
import org.junit.Test;
import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.exceptions.TestException;
import io.reactivex.rxjava3.plugins.RxJavaPlugins;
import io.reactivex.rxjava3.testsupport.TestHelper;
public class SingleEqualsTest extends RxJavaTest {
Reported by PMD.
src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableMapNotificationTest.java
10 issues
Line: 29
public class ObservableMapNotificationTest extends RxJavaTest {
@Test
public void just() {
TestObserver<Object> to = new TestObserver<>();
Observable.just(1)
.flatMap(
new Function<Integer, Observable<Object>>() {
@Override
Reported by PMD.
Line: 59
}
@Test
public void dispose() {
TestHelper.checkDisposed(new Observable<Integer>() {
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
protected void subscribeActual(Observer<? super Integer> observer) {
MapNotificationObserver mn = new MapNotificationObserver(
Reported by PMD.
Line: 76
}
@Test
public void doubleOnSubscribe() {
TestHelper.checkDoubleOnSubscribeObservable(new Function<Observable<Object>, ObservableSource<Integer>>() {
@Override
public ObservableSource<Integer> apply(Observable<Object> o) throws Exception {
return o.flatMap(
Functions.justFunction(Observable.just(1)),
Reported by PMD.
Line: 90
}
@Test
public void onErrorCrash() {
TestObserverEx<Integer> to = Observable.<Integer>error(new TestException("Outer"))
.flatMap(Functions.justFunction(Observable.just(1)),
new Function<Throwable, Observable<Integer>>() {
@Override
public Observable<Integer> apply(Throwable t) throws Exception {
Reported by PMD.
Line: 19
import io.reactivex.rxjava3.disposables.Disposable;
import org.junit.Test;
import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.exceptions.*;
import io.reactivex.rxjava3.functions.*;
import io.reactivex.rxjava3.internal.functions.Functions;
import io.reactivex.rxjava3.internal.operators.observable.ObservableMapNotification.MapNotificationObserver;
import io.reactivex.rxjava3.observers.TestObserver;
Reported by PMD.
Line: 20
import org.junit.Test;
import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.exceptions.*;
import io.reactivex.rxjava3.functions.*;
import io.reactivex.rxjava3.internal.functions.Functions;
import io.reactivex.rxjava3.internal.operators.observable.ObservableMapNotification.MapNotificationObserver;
import io.reactivex.rxjava3.observers.TestObserver;
import io.reactivex.rxjava3.testsupport.*;
Reported by PMD.
Line: 21
import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.exceptions.*;
import io.reactivex.rxjava3.functions.*;
import io.reactivex.rxjava3.internal.functions.Functions;
import io.reactivex.rxjava3.internal.operators.observable.ObservableMapNotification.MapNotificationObserver;
import io.reactivex.rxjava3.observers.TestObserver;
import io.reactivex.rxjava3.testsupport.*;
Reported by PMD.
Line: 25
import io.reactivex.rxjava3.internal.functions.Functions;
import io.reactivex.rxjava3.internal.operators.observable.ObservableMapNotification.MapNotificationObserver;
import io.reactivex.rxjava3.observers.TestObserver;
import io.reactivex.rxjava3.testsupport.*;
public class ObservableMapNotificationTest extends RxJavaTest {
@Test
public void just() {
TestObserver<Object> to = new TestObserver<>();
Reported by PMD.
Line: 91
@Test
public void onErrorCrash() {
TestObserverEx<Integer> to = Observable.<Integer>error(new TestException("Outer"))
.flatMap(Functions.justFunction(Observable.just(1)),
new Function<Throwable, Observable<Integer>>() {
@Override
public Observable<Integer> apply(Throwable t) throws Exception {
throw new TestException("Inner");
Reported by PMD.
Line: 91
@Test
public void onErrorCrash() {
TestObserverEx<Integer> to = Observable.<Integer>error(new TestException("Outer"))
.flatMap(Functions.justFunction(Observable.just(1)),
new Function<Throwable, Observable<Integer>>() {
@Override
public Observable<Integer> apply(Throwable t) throws Exception {
throw new TestException("Inner");
Reported by PMD.
src/test/java/io/reactivex/rxjava3/internal/operators/maybe/MaybeIgnoreElementTest.java
10 issues
Line: 26
public class MaybeIgnoreElementTest extends RxJavaTest {
@Test
public void dispose() {
PublishProcessor<Integer> pp = PublishProcessor.create();
TestHelper.checkDisposed(pp.singleElement().ignoreElement().toMaybe());
}
Reported by PMD.
Line: 29
public void dispose() {
PublishProcessor<Integer> pp = PublishProcessor.create();
TestHelper.checkDisposed(pp.singleElement().ignoreElement().toMaybe());
}
@Test
public void dispose2() {
PublishProcessor<Integer> pp = PublishProcessor.create();
Reported by PMD.
Line: 29
public void dispose() {
PublishProcessor<Integer> pp = PublishProcessor.create();
TestHelper.checkDisposed(pp.singleElement().ignoreElement().toMaybe());
}
@Test
public void dispose2() {
PublishProcessor<Integer> pp = PublishProcessor.create();
Reported by PMD.
Line: 29
public void dispose() {
PublishProcessor<Integer> pp = PublishProcessor.create();
TestHelper.checkDisposed(pp.singleElement().ignoreElement().toMaybe());
}
@Test
public void dispose2() {
PublishProcessor<Integer> pp = PublishProcessor.create();
Reported by PMD.
Line: 33
}
@Test
public void dispose2() {
PublishProcessor<Integer> pp = PublishProcessor.create();
TestHelper.checkDisposed(pp.singleElement().ignoreElement());
}
Reported by PMD.
Line: 36
public void dispose2() {
PublishProcessor<Integer> pp = PublishProcessor.create();
TestHelper.checkDisposed(pp.singleElement().ignoreElement());
}
@Test
public void doubleOnSubscribe() {
TestHelper.checkDoubleOnSubscribeMaybe(new Function<Maybe<Object>, MaybeSource<Object>>() {
Reported by PMD.
Line: 36
public void dispose2() {
PublishProcessor<Integer> pp = PublishProcessor.create();
TestHelper.checkDisposed(pp.singleElement().ignoreElement());
}
@Test
public void doubleOnSubscribe() {
TestHelper.checkDoubleOnSubscribeMaybe(new Function<Maybe<Object>, MaybeSource<Object>>() {
Reported by PMD.
Line: 40
}
@Test
public void doubleOnSubscribe() {
TestHelper.checkDoubleOnSubscribeMaybe(new Function<Maybe<Object>, MaybeSource<Object>>() {
@Override
public MaybeSource<Object> apply(Maybe<Object> v) throws Exception {
return v.ignoreElement().toMaybe();
}
Reported by PMD.
Line: 44
TestHelper.checkDoubleOnSubscribeMaybe(new Function<Maybe<Object>, MaybeSource<Object>>() {
@Override
public MaybeSource<Object> apply(Maybe<Object> v) throws Exception {
return v.ignoreElement().toMaybe();
}
});
}
}
Reported by PMD.
Line: 18
import org.junit.Test;
import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.functions.Function;
import io.reactivex.rxjava3.processors.PublishProcessor;
import io.reactivex.rxjava3.testsupport.TestHelper;
public class MaybeIgnoreElementTest extends RxJavaTest {
Reported by PMD.
src/test/java/io/reactivex/rxjava3/internal/operators/completable/CompletableFromPublisherTest.java
10 issues
Line: 24
public class CompletableFromPublisherTest extends RxJavaTest {
@Test
public void fromPublisher() {
Completable.fromPublisher(Flowable.just(1))
.test()
.assertResult();
}
Reported by PMD.
Line: 25
public class CompletableFromPublisherTest extends RxJavaTest {
@Test
public void fromPublisher() {
Completable.fromPublisher(Flowable.just(1))
.test()
.assertResult();
}
@Test
Reported by PMD.
Line: 25
public class CompletableFromPublisherTest extends RxJavaTest {
@Test
public void fromPublisher() {
Completable.fromPublisher(Flowable.just(1))
.test()
.assertResult();
}
@Test
Reported by PMD.
Line: 31
}
@Test
public void fromPublisherEmpty() {
Completable.fromPublisher(Flowable.empty())
.test()
.assertResult();
}
Reported by PMD.
Line: 32
@Test
public void fromPublisherEmpty() {
Completable.fromPublisher(Flowable.empty())
.test()
.assertResult();
}
@Test
Reported by PMD.
Line: 32
@Test
public void fromPublisherEmpty() {
Completable.fromPublisher(Flowable.empty())
.test()
.assertResult();
}
@Test
Reported by PMD.
Line: 38
}
@Test
public void fromPublisherThrows() {
Completable.fromPublisher(Flowable.error(new UnsupportedOperationException()))
.test()
.assertFailure(UnsupportedOperationException.class);
}
Reported by PMD.
Line: 45
}
@Test
public void dispose() {
TestHelper.checkDisposed(Completable.fromPublisher(Flowable.just(1)));
}
@Test
public void doubleOnSubscribe() {
Reported by PMD.
Line: 50
}
@Test
public void doubleOnSubscribe() {
TestHelper.checkDoubleOnSubscribeFlowableToCompletable(new Function<Flowable<Object>, Completable>() {
@Override
public Completable apply(Flowable<Object> f) throws Exception {
return Completable.fromPublisher(f);
}
Reported by PMD.
Line: 18
import org.junit.Test;
import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.functions.Function;
import io.reactivex.rxjava3.testsupport.TestHelper;
public class CompletableFromPublisherTest extends RxJavaTest {
@Test
Reported by PMD.