The following issues were found
src/main/java/io/reactivex/rxjava3/internal/operators/mixed/ObservableConcatMapCompletable.java
30 issues
Line: 36
*/
public final class ObservableConcatMapCompletable<T> extends Completable {
final Observable<T> source;
final Function<? super T, ? extends CompletableSource> mapper;
final ErrorMode errorMode;
Reported by PMD.
Line: 38
final Observable<T> source;
final Function<? super T, ? extends CompletableSource> mapper;
final ErrorMode errorMode;
final int prefetch;
Reported by PMD.
Line: 40
final Function<? super T, ? extends CompletableSource> mapper;
final ErrorMode errorMode;
final int prefetch;
public ObservableConcatMapCompletable(Observable<T> source,
Function<? super T, ? extends CompletableSource> mapper,
Reported by PMD.
Line: 42
final ErrorMode errorMode;
final int prefetch;
public ObservableConcatMapCompletable(Observable<T> source,
Function<? super T, ? extends CompletableSource> mapper,
ErrorMode errorMode,
int prefetch) {
Reported by PMD.
Line: 61
}
}
static final class ConcatMapCompletableObserver<T>
extends ConcatMapXMainObserver<T> {
private static final long serialVersionUID = 3610901111000061034L;
final CompletableObserver downstream;
Reported by PMD.
Line: 61
}
}
static final class ConcatMapCompletableObserver<T>
extends ConcatMapXMainObserver<T> {
private static final long serialVersionUID = 3610901111000061034L;
final CompletableObserver downstream;
Reported by PMD.
Line: 66
private static final long serialVersionUID = 3610901111000061034L;
final CompletableObserver downstream;
final Function<? super T, ? extends CompletableSource> mapper;
final ConcatMapInnerObserver inner;
Reported by PMD.
Line: 68
final CompletableObserver downstream;
final Function<? super T, ? extends CompletableSource> mapper;
final ConcatMapInnerObserver inner;
volatile boolean active;
Reported by PMD.
Line: 70
final Function<? super T, ? extends CompletableSource> mapper;
final ConcatMapInnerObserver inner;
volatile boolean active;
ConcatMapCompletableObserver(CompletableObserver downstream,
Function<? super T, ? extends CompletableSource> mapper,
Reported by PMD.
Line: 72
final ConcatMapInnerObserver inner;
volatile boolean active;
ConcatMapCompletableObserver(CompletableObserver downstream,
Function<? super T, ? extends CompletableSource> mapper,
ErrorMode errorMode, int prefetch) {
super(prefetch, errorMode);
Reported by PMD.
src/test/java/io/reactivex/rxjava3/maybe/MaybeRetryTest.java
30 issues
Line: 39
numberOfSubscribeCalls.incrementAndGet();
if (atomicInteger.decrementAndGet() != 0) {
throw new RuntimeException();
}
throw new IllegalArgumentException();
}
})
Reported by PMD.
Line: 66
numberOfSubscribeCalls.incrementAndGet();
if (atomicInteger.decrementAndGet() != 0) {
throw new RuntimeException();
}
return true;
}
})
Reported by PMD.
Line: 89
numberOfSubscribeCalls.incrementAndGet();
if (atomicInteger.decrementAndGet() != 0) {
throw new RuntimeException();
}
return true;
}
})
Reported by PMD.
Line: 112
numberOfSubscribeCalls.incrementAndGet();
if (atomicInteger.decrementAndGet() != 0) {
throw new RuntimeException();
}
return true;
}
})
Reported by PMD.
Line: 53
.test()
.assertFailure(IllegalArgumentException.class);
assertEquals(3, numberOfSubscribeCalls.get());
}
@Test
public void retryTimesPredicateWithMatchingRetryAmount() {
final AtomicInteger atomicInteger = new AtomicInteger(3);
Reported by PMD.
Line: 76
.test()
.assertResult(true);
assertEquals(3, numberOfSubscribeCalls.get());
}
@Test
public void retryTimesPredicateWithNotMatchingRetryAmount() {
final AtomicInteger atomicInteger = new AtomicInteger(3);
Reported by PMD.
Line: 99
.test()
.assertFailure(RuntimeException.class);
assertEquals(2, numberOfSubscribeCalls.get());
}
@Test
public void retryTimesPredicateWithZeroRetries() {
final AtomicInteger atomicInteger = new AtomicInteger(2);
Reported by PMD.
Line: 122
.test()
.assertFailure(RuntimeException.class);
assertEquals(1, numberOfSubscribeCalls.get());
}
@Test
public void untilTrueJust() {
Maybe.just(1)
Reported by PMD.
Line: 126
}
@Test
public void untilTrueJust() {
Maybe.just(1)
.retryUntil(() -> true)
.test()
.assertResult(1);
}
Reported by PMD.
Line: 127
@Test
public void untilTrueJust() {
Maybe.just(1)
.retryUntil(() -> true)
.test()
.assertResult(1);
}
Reported by PMD.
src/main/java/io/reactivex/rxjava3/plugins/RxJavaPlugins.java
30 issues
Line: 365
* @see #setErrorHandler(Consumer)
* @see <a href="https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0#error-handling">Error handling Wiki</a>
*/
public static void onError(@NonNull Throwable error) {
Consumer<? super Throwable> f = errorHandler;
if (error == null) {
error = ExceptionHelper.createNullPointerException("onError called with a null Throwable.");
} else {
Reported by PMD.
Line: 365
* @see #setErrorHandler(Consumer)
* @see <a href="https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0#error-handling">Error handling Wiki</a>
*/
public static void onError(@NonNull Throwable error) {
Consumer<? super Throwable> f = errorHandler;
if (error == null) {
error = ExceptionHelper.createNullPointerException("onError called with a null Throwable.");
} else {
Reported by PMD.
Line: 14
* the License for the specific language governing permissions and limitations under the License.
*/
package io.reactivex.rxjava3.plugins;
import java.lang.Thread.UncaughtExceptionHandler;
import java.util.Objects;
import java.util.concurrent.*;
Reported by PMD.
Line: 14
* the License for the specific language governing permissions and limitations under the License.
*/
package io.reactivex.rxjava3.plugins;
import java.lang.Thread.UncaughtExceptionHandler;
import java.util.Objects;
import java.util.concurrent.*;
Reported by PMD.
Line: 35
/**
* Utility class to inject handlers to certain standard RxJava operations.
*/
public final class RxJavaPlugins {
@Nullable
static volatile Consumer<? super Throwable> errorHandler;
@Nullable
static volatile Function<? super Runnable, ? extends Runnable> onScheduleHandler;
Reported by PMD.
Line: 35
/**
* Utility class to inject handlers to certain standard RxJava operations.
*/
public final class RxJavaPlugins {
@Nullable
static volatile Consumer<? super Throwable> errorHandler;
@Nullable
static volatile Function<? super Runnable, ? extends Runnable> onScheduleHandler;
Reported by PMD.
Line: 35
/**
* Utility class to inject handlers to certain standard RxJava operations.
*/
public final class RxJavaPlugins {
@Nullable
static volatile Consumer<? super Throwable> errorHandler;
@Nullable
static volatile Function<? super Runnable, ? extends Runnable> onScheduleHandler;
Reported by PMD.
Line: 35
/**
* Utility class to inject handlers to certain standard RxJava operations.
*/
public final class RxJavaPlugins {
@Nullable
static volatile Consumer<? super Throwable> errorHandler;
@Nullable
static volatile Function<? super Runnable, ? extends Runnable> onScheduleHandler;
Reported by PMD.
Line: 35
/**
* Utility class to inject handlers to certain standard RxJava operations.
*/
public final class RxJavaPlugins {
@Nullable
static volatile Consumer<? super Throwable> errorHandler;
@Nullable
static volatile Function<? super Runnable, ? extends Runnable> onScheduleHandler;
Reported by PMD.
Line: 66
@Nullable
static volatile Function<? super Scheduler, ? extends Scheduler> onNewThreadHandler;
@SuppressWarnings("rawtypes")
@Nullable
static volatile Function<? super Flowable, ? extends Flowable> onFlowableAssembly;
@SuppressWarnings("rawtypes")
@Nullable
Reported by PMD.
src/main/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableAmb.java
30 issues
Line: 26
import io.reactivex.rxjava3.plugins.RxJavaPlugins;
public final class FlowableAmb<T> extends Flowable<T> {
final Publisher<? extends T>[] sources;
final Iterable<? extends Publisher<? extends T>> sourcesIterable;
public FlowableAmb(Publisher<? extends T>[] sources, Iterable<? extends Publisher<? extends T>> sourcesIterable) {
this.sources = sources;
this.sourcesIterable = sourcesIterable;
Reported by PMD.
Line: 27
public final class FlowableAmb<T> extends Flowable<T> {
final Publisher<? extends T>[] sources;
final Iterable<? extends Publisher<? extends T>> sourcesIterable;
public FlowableAmb(Publisher<? extends T>[] sources, Iterable<? extends Publisher<? extends T>> sourcesIterable) {
this.sources = sources;
this.sourcesIterable = sourcesIterable;
}
Reported by PMD.
Line: 29
final Publisher<? extends T>[] sources;
final Iterable<? extends Publisher<? extends T>> sourcesIterable;
public FlowableAmb(Publisher<? extends T>[] sources, Iterable<? extends Publisher<? extends T>> sourcesIterable) {
this.sources = sources;
this.sourcesIterable = sourcesIterable;
}
@Override
Reported by PMD.
Line: 44
try {
for (Publisher<? extends T> p : sourcesIterable) {
if (p == null) {
EmptySubscription.error(new NullPointerException("One of the sources is null"), s);
return;
}
if (count == sources.length) {
Publisher<? extends T>[] b = new Publisher[count + (count >> 2)];
System.arraycopy(sources, 0, b, 0, count);
Reported by PMD.
Line: 48
return;
}
if (count == sources.length) {
Publisher<? extends T>[] b = new Publisher[count + (count >> 2)];
System.arraycopy(sources, 0, b, 0, count);
sources = b;
}
sources[count++] = p;
}
Reported by PMD.
Line: 54
}
sources[count++] = p;
}
} catch (Throwable e) {
Exceptions.throwIfFatal(e);
EmptySubscription.error(e, s);
return;
}
} else {
Reported by PMD.
Line: 67
EmptySubscription.complete(s);
return;
} else
if (count == 1) {
sources[0].subscribe(s);
return;
}
AmbCoordinator<T> ac = new AmbCoordinator<>(s, count);
Reported by PMD.
Line: 77
}
static final class AmbCoordinator<T> implements Subscription {
final Subscriber<? super T> downstream;
final AmbInnerSubscriber<T>[] subscribers;
final AtomicInteger winner = new AtomicInteger();
@SuppressWarnings("unchecked")
Reported by PMD.
Line: 78
static final class AmbCoordinator<T> implements Subscription {
final Subscriber<? super T> downstream;
final AmbInnerSubscriber<T>[] subscribers;
final AtomicInteger winner = new AtomicInteger();
@SuppressWarnings("unchecked")
AmbCoordinator(Subscriber<? super T> actual, int count) {
Reported by PMD.
Line: 80
final Subscriber<? super T> downstream;
final AmbInnerSubscriber<T>[] subscribers;
final AtomicInteger winner = new AtomicInteger();
@SuppressWarnings("unchecked")
AmbCoordinator(Subscriber<? super T> actual, int count) {
this.downstream = actual;
this.subscribers = new AmbInnerSubscriber[count];
Reported by PMD.
src/test/java/io/reactivex/rxjava3/internal/operators/single/SingleUnsubscribeOnTest.java
30 issues
Line: 33
public class SingleUnsubscribeOnTest extends RxJavaTest {
@Test
public void normal() throws Exception {
PublishProcessor<Integer> pp = PublishProcessor.create();
final String[] name = { null };
final CountDownLatch cdl = new CountDownLatch(1);
Reported by PMD.
Line: 33
public class SingleUnsubscribeOnTest extends RxJavaTest {
@Test
public void normal() throws Exception {
PublishProcessor<Integer> pp = PublishProcessor.create();
final String[] name = { null };
final CountDownLatch cdl = new CountDownLatch(1);
Reported by PMD.
Line: 43
pp.doOnCancel(new Action() {
@Override
public void run() throws Exception {
name[0] = Thread.currentThread().getName();
cdl.countDown();
}
})
.single(-99)
.unsubscribeOn(Schedulers.single())
Reported by PMD.
Line: 52
.test(true)
;
assertTrue(cdl.await(5, TimeUnit.SECONDS));
int times = 10;
while (times-- > 0 && pp.hasSubscribers()) {
Thread.sleep(100);
Reported by PMD.
Line: 56
int times = 10;
while (times-- > 0 && pp.hasSubscribers()) {
Thread.sleep(100);
}
assertFalse(pp.hasSubscribers());
Reported by PMD.
Line: 56
int times = 10;
while (times-- > 0 && pp.hasSubscribers()) {
Thread.sleep(100);
}
assertFalse(pp.hasSubscribers());
Reported by PMD.
Line: 60
Thread.sleep(100);
}
assertFalse(pp.hasSubscribers());
assertNotEquals(Thread.currentThread().getName(), name[0]);
}
@Test
Reported by PMD.
Line: 60
Thread.sleep(100);
}
assertFalse(pp.hasSubscribers());
assertNotEquals(Thread.currentThread().getName(), name[0]);
}
@Test
Reported by PMD.
Line: 62
assertFalse(pp.hasSubscribers());
assertNotEquals(Thread.currentThread().getName(), name[0]);
}
@Test
public void just() {
Single.just(1)
Reported by PMD.
Line: 66
}
@Test
public void just() {
Single.just(1)
.unsubscribeOn(Schedulers.single())
.test()
.assertResult(1);
}
Reported by PMD.
src/test/java/io/reactivex/rxjava3/subscribers/DisposableSubscriberTest.java
30 issues
Line: 32
static final class TestDisposableSubscriber<T> extends DisposableSubscriber<T> {
int start;
final List<T> values = new ArrayList<>();
final List<Throwable> errors = new ArrayList<>();
Reported by PMD.
Line: 34
int start;
final List<T> values = new ArrayList<>();
final List<Throwable> errors = new ArrayList<>();
int completions;
Reported by PMD.
Line: 36
final List<T> values = new ArrayList<>();
final List<Throwable> errors = new ArrayList<>();
int completions;
@Override
protected void onStart() {
Reported by PMD.
Line: 38
final List<Throwable> errors = new ArrayList<>();
int completions;
@Override
protected void onStart() {
request(1);
Reported by PMD.
Line: 64
}
@Test
public void normal() {
TestDisposableSubscriber<Integer> tc = new TestDisposableSubscriber<>();
assertFalse(tc.isDisposed());
assertEquals(0, tc.start);
assertTrue(tc.values.isEmpty());
Reported by PMD.
Line: 67
public void normal() {
TestDisposableSubscriber<Integer> tc = new TestDisposableSubscriber<>();
assertFalse(tc.isDisposed());
assertEquals(0, tc.start);
assertTrue(tc.values.isEmpty());
assertTrue(tc.errors.isEmpty());
Flowable.just(1).subscribe(tc);
Reported by PMD.
Line: 68
TestDisposableSubscriber<Integer> tc = new TestDisposableSubscriber<>();
assertFalse(tc.isDisposed());
assertEquals(0, tc.start);
assertTrue(tc.values.isEmpty());
assertTrue(tc.errors.isEmpty());
Flowable.just(1).subscribe(tc);
Reported by PMD.
Line: 69
assertFalse(tc.isDisposed());
assertEquals(0, tc.start);
assertTrue(tc.values.isEmpty());
assertTrue(tc.errors.isEmpty());
Flowable.just(1).subscribe(tc);
assertFalse(tc.isDisposed());
Reported by PMD.
Line: 69
assertFalse(tc.isDisposed());
assertEquals(0, tc.start);
assertTrue(tc.values.isEmpty());
assertTrue(tc.errors.isEmpty());
Flowable.just(1).subscribe(tc);
assertFalse(tc.isDisposed());
Reported by PMD.
Line: 70
assertFalse(tc.isDisposed());
assertEquals(0, tc.start);
assertTrue(tc.values.isEmpty());
assertTrue(tc.errors.isEmpty());
Flowable.just(1).subscribe(tc);
assertFalse(tc.isDisposed());
assertEquals(1, tc.start);
Reported by PMD.
src/test/java/io/reactivex/rxjava3/internal/operators/observable/BlockingObservableToIteratorTest.java
30 issues
Line: 35
public class BlockingObservableToIteratorTest extends RxJavaTest {
@Test
public void toIterator() {
Observable<String> obs = Observable.just("one", "two", "three");
Iterator<String> it = obs.blockingIterable().iterator();
assertTrue(it.hasNext());
Reported by PMD.
Line: 36
@Test
public void toIterator() {
Observable<String> obs = Observable.just("one", "two", "three");
Iterator<String> it = obs.blockingIterable().iterator();
assertTrue(it.hasNext());
assertEquals("one", it.next());
Reported by PMD.
Line: 38
public void toIterator() {
Observable<String> obs = Observable.just("one", "two", "three");
Iterator<String> it = obs.blockingIterable().iterator();
assertTrue(it.hasNext());
assertEquals("one", it.next());
assertTrue(it.hasNext());
Reported by PMD.
Line: 38
public void toIterator() {
Observable<String> obs = Observable.just("one", "two", "three");
Iterator<String> it = obs.blockingIterable().iterator();
assertTrue(it.hasNext());
assertEquals("one", it.next());
assertTrue(it.hasNext());
Reported by PMD.
Line: 40
Iterator<String> it = obs.blockingIterable().iterator();
assertTrue(it.hasNext());
assertEquals("one", it.next());
assertTrue(it.hasNext());
assertEquals("two", it.next());
Reported by PMD.
Line: 41
Iterator<String> it = obs.blockingIterable().iterator();
assertTrue(it.hasNext());
assertEquals("one", it.next());
assertTrue(it.hasNext());
assertEquals("two", it.next());
assertTrue(it.hasNext());
Reported by PMD.
Line: 43
assertTrue(it.hasNext());
assertEquals("one", it.next());
assertTrue(it.hasNext());
assertEquals("two", it.next());
assertTrue(it.hasNext());
assertEquals("three", it.next());
Reported by PMD.
Line: 44
assertEquals("one", it.next());
assertTrue(it.hasNext());
assertEquals("two", it.next());
assertTrue(it.hasNext());
assertEquals("three", it.next());
assertFalse(it.hasNext());
Reported by PMD.
Line: 46
assertTrue(it.hasNext());
assertEquals("two", it.next());
assertTrue(it.hasNext());
assertEquals("three", it.next());
assertFalse(it.hasNext());
}
Reported by PMD.
Line: 47
assertEquals("two", it.next());
assertTrue(it.hasNext());
assertEquals("three", it.next());
assertFalse(it.hasNext());
}
Reported by PMD.
src/main/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableTimeout.java
30 issues
Line: 32
import io.reactivex.rxjava3.plugins.RxJavaPlugins;
public final class FlowableTimeout<T, U, V> extends AbstractFlowableWithUpstream<T, T> {
final Publisher<U> firstTimeoutIndicator;
final Function<? super T, ? extends Publisher<V>> itemTimeoutIndicator;
final Publisher<? extends T> other;
public FlowableTimeout(
Flowable<T> source,
Reported by PMD.
Line: 33
public final class FlowableTimeout<T, U, V> extends AbstractFlowableWithUpstream<T, T> {
final Publisher<U> firstTimeoutIndicator;
final Function<? super T, ? extends Publisher<V>> itemTimeoutIndicator;
final Publisher<? extends T> other;
public FlowableTimeout(
Flowable<T> source,
Publisher<U> firstTimeoutIndicator,
Reported by PMD.
Line: 34
public final class FlowableTimeout<T, U, V> extends AbstractFlowableWithUpstream<T, T> {
final Publisher<U> firstTimeoutIndicator;
final Function<? super T, ? extends Publisher<V>> itemTimeoutIndicator;
final Publisher<? extends T> other;
public FlowableTimeout(
Flowable<T> source,
Publisher<U> firstTimeoutIndicator,
Function<? super T, ? extends Publisher<V>> itemTimeoutIndicator,
Reported by PMD.
Line: 71
private static final long serialVersionUID = 3764492702657003550L;
final Subscriber<? super T> downstream;
final Function<? super T, ? extends Publisher<?>> itemTimeoutIndicator;
final SequentialDisposable task;
Reported by PMD.
Line: 73
final Subscriber<? super T> downstream;
final Function<? super T, ? extends Publisher<?>> itemTimeoutIndicator;
final SequentialDisposable task;
final AtomicReference<Subscription> upstream;
Reported by PMD.
Line: 75
final Function<? super T, ? extends Publisher<?>> itemTimeoutIndicator;
final SequentialDisposable task;
final AtomicReference<Subscription> upstream;
final AtomicLong requested;
Reported by PMD.
Line: 77
final SequentialDisposable task;
final AtomicReference<Subscription> upstream;
final AtomicLong requested;
TimeoutSubscriber(Subscriber<? super T> actual, Function<? super T, ? extends Publisher<?>> itemTimeoutIndicator) {
this.downstream = actual;
Reported by PMD.
Line: 79
final AtomicReference<Subscription> upstream;
final AtomicLong requested;
TimeoutSubscriber(Subscriber<? super T> actual, Function<? super T, ? extends Publisher<?>> itemTimeoutIndicator) {
this.downstream = actual;
this.itemTimeoutIndicator = itemTimeoutIndicator;
this.task = new SequentialDisposable();
Reported by PMD.
Line: 114
itemTimeoutPublisher = Objects.requireNonNull(
itemTimeoutIndicator.apply(t),
"The itemTimeoutIndicator returned a null Publisher.");
} catch (Throwable ex) {
Exceptions.throwIfFatal(ex);
upstream.get().cancel();
getAndSet(Long.MAX_VALUE);
downstream.onError(ex);
return;
Reported by PMD.
Line: 116
"The itemTimeoutIndicator returned a null Publisher.");
} catch (Throwable ex) {
Exceptions.throwIfFatal(ex);
upstream.get().cancel();
getAndSet(Long.MAX_VALUE);
downstream.onError(ex);
return;
}
Reported by PMD.
src/test/java/io/reactivex/rxjava3/internal/operators/maybe/MaybeFromFutureTest.java
30 issues
Line: 31
public class MaybeFromFutureTest extends RxJavaTest {
@Test
public void cancelImmediately() {
FutureTask<Integer> ft = new FutureTask<>(Functions.justCallable(1));
Maybe.fromFuture(ft).test(true)
.assertEmpty();
}
Reported by PMD.
Line: 34
public void cancelImmediately() {
FutureTask<Integer> ft = new FutureTask<>(Functions.justCallable(1));
Maybe.fromFuture(ft).test(true)
.assertEmpty();
}
@Test
public void timeout() {
Reported by PMD.
Line: 34
public void cancelImmediately() {
FutureTask<Integer> ft = new FutureTask<>(Functions.justCallable(1));
Maybe.fromFuture(ft).test(true)
.assertEmpty();
}
@Test
public void timeout() {
Reported by PMD.
Line: 39
}
@Test
public void timeout() {
FutureTask<Integer> ft = new FutureTask<>(Functions.justCallable(1));
Maybe.fromFuture(ft, 1, TimeUnit.MILLISECONDS).test()
.awaitDone(5, TimeUnit.SECONDS)
.assertFailure(TimeoutException.class);
Reported by PMD.
Line: 42
public void timeout() {
FutureTask<Integer> ft = new FutureTask<>(Functions.justCallable(1));
Maybe.fromFuture(ft, 1, TimeUnit.MILLISECONDS).test()
.awaitDone(5, TimeUnit.SECONDS)
.assertFailure(TimeoutException.class);
}
@Test
Reported by PMD.
Line: 42
public void timeout() {
FutureTask<Integer> ft = new FutureTask<>(Functions.justCallable(1));
Maybe.fromFuture(ft, 1, TimeUnit.MILLISECONDS).test()
.awaitDone(5, TimeUnit.SECONDS)
.assertFailure(TimeoutException.class);
}
@Test
Reported by PMD.
Line: 42
public void timeout() {
FutureTask<Integer> ft = new FutureTask<>(Functions.justCallable(1));
Maybe.fromFuture(ft, 1, TimeUnit.MILLISECONDS).test()
.awaitDone(5, TimeUnit.SECONDS)
.assertFailure(TimeoutException.class);
}
@Test
Reported by PMD.
Line: 48
}
@Test
public void timedWait() {
FutureTask<Integer> ft = new FutureTask<>(Functions.justCallable(1));
ft.run();
Maybe.fromFuture(ft, 1, TimeUnit.MILLISECONDS).test()
.awaitDone(5, TimeUnit.SECONDS)
Reported by PMD.
Line: 52
FutureTask<Integer> ft = new FutureTask<>(Functions.justCallable(1));
ft.run();
Maybe.fromFuture(ft, 1, TimeUnit.MILLISECONDS).test()
.awaitDone(5, TimeUnit.SECONDS)
.assertResult(1);
}
@Test
Reported by PMD.
Line: 52
FutureTask<Integer> ft = new FutureTask<>(Functions.justCallable(1));
ft.run();
Maybe.fromFuture(ft, 1, TimeUnit.MILLISECONDS).test()
.awaitDone(5, TimeUnit.SECONDS)
.assertResult(1);
}
@Test
Reported by PMD.
src/test/java/io/reactivex/rxjava3/internal/operators/maybe/MaybeFromActionTest.java
30 issues
Line: 46
.test()
.assertResult();
assertEquals(1, atomicInteger.get());
}
@Test
public void fromActionTwice() {
final AtomicInteger atomicInteger = new AtomicInteger();
Reported by PMD.
Line: 50
}
@Test
public void fromActionTwice() {
final AtomicInteger atomicInteger = new AtomicInteger();
Action run = new Action() {
@Override
public void run() throws Exception {
Reported by PMD.
Line: 60
}
};
Maybe.fromAction(run)
.test()
.assertResult();
assertEquals(1, atomicInteger.get());
Reported by PMD.
Line: 60
}
};
Maybe.fromAction(run)
.test()
.assertResult();
assertEquals(1, atomicInteger.get());
Reported by PMD.
Line: 64
.test()
.assertResult();
assertEquals(1, atomicInteger.get());
Maybe.fromAction(run)
.test()
.assertResult();
Reported by PMD.
Line: 66
assertEquals(1, atomicInteger.get());
Maybe.fromAction(run)
.test()
.assertResult();
assertEquals(2, atomicInteger.get());
}
Reported by PMD.
Line: 66
assertEquals(1, atomicInteger.get());
Maybe.fromAction(run)
.test()
.assertResult();
assertEquals(2, atomicInteger.get());
}
Reported by PMD.
Line: 70
.test()
.assertResult();
assertEquals(2, atomicInteger.get());
}
@Test
public void fromActionInvokesLazy() {
final AtomicInteger atomicInteger = new AtomicInteger();
Reported by PMD.
Line: 74
}
@Test
public void fromActionInvokesLazy() {
final AtomicInteger atomicInteger = new AtomicInteger();
Maybe<Object> maybe = Maybe.fromAction(new Action() {
@Override
public void run() throws Exception {
Reported by PMD.
Line: 84
}
});
assertEquals(0, atomicInteger.get());
maybe
.test()
.assertResult();
Reported by PMD.