The following issues were found
src/main/java/io/reactivex/rxjava3/internal/operators/observable/ObservableDebounceTimed.java
16 issues
Line: 27
import io.reactivex.rxjava3.plugins.RxJavaPlugins;
public final class ObservableDebounceTimed<T> extends AbstractObservableWithUpstream<T, T> {
final long timeout;
final TimeUnit unit;
final Scheduler scheduler;
public ObservableDebounceTimed(ObservableSource<T> source, long timeout, TimeUnit unit, Scheduler scheduler) {
super(source);
Reported by PMD.
Line: 28
public final class ObservableDebounceTimed<T> extends AbstractObservableWithUpstream<T, T> {
final long timeout;
final TimeUnit unit;
final Scheduler scheduler;
public ObservableDebounceTimed(ObservableSource<T> source, long timeout, TimeUnit unit, Scheduler scheduler) {
super(source);
this.timeout = timeout;
Reported by PMD.
Line: 29
public final class ObservableDebounceTimed<T> extends AbstractObservableWithUpstream<T, T> {
final long timeout;
final TimeUnit unit;
final Scheduler scheduler;
public ObservableDebounceTimed(ObservableSource<T> source, long timeout, TimeUnit unit, Scheduler scheduler) {
super(source);
this.timeout = timeout;
this.unit = unit;
Reported by PMD.
Line: 47
static final class DebounceTimedObserver<T>
implements Observer<T>, Disposable {
final Observer<? super T> downstream;
final long timeout;
final TimeUnit unit;
final Scheduler.Worker worker;
Disposable upstream;
Reported by PMD.
Line: 48
static final class DebounceTimedObserver<T>
implements Observer<T>, Disposable {
final Observer<? super T> downstream;
final long timeout;
final TimeUnit unit;
final Scheduler.Worker worker;
Disposable upstream;
Reported by PMD.
Line: 49
implements Observer<T>, Disposable {
final Observer<? super T> downstream;
final long timeout;
final TimeUnit unit;
final Scheduler.Worker worker;
Disposable upstream;
Disposable timer;
Reported by PMD.
Line: 50
final Observer<? super T> downstream;
final long timeout;
final TimeUnit unit;
final Scheduler.Worker worker;
Disposable upstream;
Disposable timer;
Reported by PMD.
Line: 52
final TimeUnit unit;
final Scheduler.Worker worker;
Disposable upstream;
Disposable timer;
volatile long index;
Reported by PMD.
Line: 54
Disposable upstream;
Disposable timer;
volatile long index;
boolean done;
Reported by PMD.
Line: 56
Disposable timer;
volatile long index;
boolean done;
DebounceTimedObserver(Observer<? super T> actual, long timeout, TimeUnit unit, Worker worker) {
this.downstream = actual;
Reported by PMD.
src/main/java/io/reactivex/rxjava3/internal/queue/SpscLinkedArrayQueue.java
16 issues
Line: 69
@Override
public boolean offer(final T e) {
if (null == e) {
throw new NullPointerException("Null is not a valid element");
}
// local load of field to avoid repeated loads after volatile reads
final AtomicReferenceArray<Object> buffer = producerBuffer;
final long index = lpProducerIndex();
final int mask = producerMask;
Reported by PMD.
Line: 32
* than the producer.
* @param <T> the contained value type
*/
public final class SpscLinkedArrayQueue<T> implements SimplePlainQueue<T> {
static final int MAX_LOOK_AHEAD_STEP = Integer.getInteger("jctools.spsc.max.lookahead.step", 4096);
final AtomicLong producerIndex = new AtomicLong();
int producerLookAheadStep;
long producerLookAhead;
Reported by PMD.
Line: 34
*/
public final class SpscLinkedArrayQueue<T> implements SimplePlainQueue<T> {
static final int MAX_LOOK_AHEAD_STEP = Integer.getInteger("jctools.spsc.max.lookahead.step", 4096);
final AtomicLong producerIndex = new AtomicLong();
int producerLookAheadStep;
long producerLookAhead;
final int producerMask;
Reported by PMD.
Line: 36
static final int MAX_LOOK_AHEAD_STEP = Integer.getInteger("jctools.spsc.max.lookahead.step", 4096);
final AtomicLong producerIndex = new AtomicLong();
int producerLookAheadStep;
long producerLookAhead;
final int producerMask;
AtomicReferenceArray<Object> producerBuffer;
Reported by PMD.
Line: 37
final AtomicLong producerIndex = new AtomicLong();
int producerLookAheadStep;
long producerLookAhead;
final int producerMask;
AtomicReferenceArray<Object> producerBuffer;
final int consumerMask;
Reported by PMD.
Line: 39
int producerLookAheadStep;
long producerLookAhead;
final int producerMask;
AtomicReferenceArray<Object> producerBuffer;
final int consumerMask;
AtomicReferenceArray<Object> consumerBuffer;
final AtomicLong consumerIndex = new AtomicLong();
Reported by PMD.
Line: 41
final int producerMask;
AtomicReferenceArray<Object> producerBuffer;
final int consumerMask;
AtomicReferenceArray<Object> consumerBuffer;
final AtomicLong consumerIndex = new AtomicLong();
private static final Object HAS_NEXT = new Object();
Reported by PMD.
Line: 42
final int producerMask;
AtomicReferenceArray<Object> producerBuffer;
final int consumerMask;
AtomicReferenceArray<Object> consumerBuffer;
final AtomicLong consumerIndex = new AtomicLong();
private static final Object HAS_NEXT = new Object();
Reported by PMD.
Line: 43
AtomicReferenceArray<Object> producerBuffer;
final int consumerMask;
AtomicReferenceArray<Object> consumerBuffer;
final AtomicLong consumerIndex = new AtomicLong();
private static final Object HAS_NEXT = new Object();
public SpscLinkedArrayQueue(final int bufferSize) {
Reported by PMD.
Line: 44
AtomicReferenceArray<Object> producerBuffer;
final int consumerMask;
AtomicReferenceArray<Object> consumerBuffer;
final AtomicLong consumerIndex = new AtomicLong();
private static final Object HAS_NEXT = new Object();
public SpscLinkedArrayQueue(final int bufferSize) {
int p2capacity = Pow2.roundToPowerOfTwo(Math.max(8, bufferSize));
Reported by PMD.
src/main/java/io/reactivex/rxjava3/internal/schedulers/AbstractDirectTask.java
16 issues
Line: 33
private static final long serialVersionUID = 1811839108042568751L;
protected final Runnable runnable;
protected final boolean interruptOnCancel;
protected Thread runner;
Reported by PMD.
Line: 35
protected final Runnable runnable;
protected final boolean interruptOnCancel;
protected Thread runner;
protected static final FutureTask<Void> FINISHED = new FutureTask<>(Functions.EMPTY_RUNNABLE, null);
Reported by PMD.
Line: 37
protected final boolean interruptOnCancel;
protected Thread runner;
protected static final FutureTask<Void> FINISHED = new FutureTask<>(Functions.EMPTY_RUNNABLE, null);
protected static final FutureTask<Void> DISPOSED = new FutureTask<>(Functions.EMPTY_RUNNABLE, null);
Reported by PMD.
Line: 51
@Override
public final void dispose() {
Future<?> f = get();
if (f != FINISHED && f != DISPOSED) {
if (compareAndSet(f, DISPOSED)) {
if (f != null) {
cancelFuture(f);
}
}
Reported by PMD.
Line: 51
@Override
public final void dispose() {
Future<?> f = get();
if (f != FINISHED && f != DISPOSED) {
if (compareAndSet(f, DISPOSED)) {
if (f != null) {
cancelFuture(f);
}
}
Reported by PMD.
Line: 52
public final void dispose() {
Future<?> f = get();
if (f != FINISHED && f != DISPOSED) {
if (compareAndSet(f, DISPOSED)) {
if (f != null) {
cancelFuture(f);
}
}
}
Reported by PMD.
Line: 53
Future<?> f = get();
if (f != FINISHED && f != DISPOSED) {
if (compareAndSet(f, DISPOSED)) {
if (f != null) {
cancelFuture(f);
}
}
}
}
Reported by PMD.
Line: 53
Future<?> f = get();
if (f != FINISHED && f != DISPOSED) {
if (compareAndSet(f, DISPOSED)) {
if (f != null) {
cancelFuture(f);
}
}
}
}
Reported by PMD.
Line: 63
@Override
public final boolean isDisposed() {
Future<?> f = get();
return f == FINISHED || f == DISPOSED;
}
public final void setFuture(Future<?> future) {
for (;;) {
Future<?> f = get();
Reported by PMD.
Line: 63
@Override
public final boolean isDisposed() {
Future<?> f = get();
return f == FINISHED || f == DISPOSED;
}
public final void setFuture(Future<?> future) {
for (;;) {
Future<?> f = get();
Reported by PMD.
src/main/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableDoOnLifecycle.java
16 issues
Line: 25
import io.reactivex.rxjava3.plugins.RxJavaPlugins;
public final class FlowableDoOnLifecycle<T> extends AbstractFlowableWithUpstream<T, T> {
private final Consumer<? super Subscription> onSubscribe;
private final LongConsumer onRequest;
private final Action onCancel;
public FlowableDoOnLifecycle(Flowable<T> source, Consumer<? super Subscription> onSubscribe,
LongConsumer onRequest, Action onCancel) {
Reported by PMD.
Line: 26
public final class FlowableDoOnLifecycle<T> extends AbstractFlowableWithUpstream<T, T> {
private final Consumer<? super Subscription> onSubscribe;
private final LongConsumer onRequest;
private final Action onCancel;
public FlowableDoOnLifecycle(Flowable<T> source, Consumer<? super Subscription> onSubscribe,
LongConsumer onRequest, Action onCancel) {
super(source);
Reported by PMD.
Line: 27
public final class FlowableDoOnLifecycle<T> extends AbstractFlowableWithUpstream<T, T> {
private final Consumer<? super Subscription> onSubscribe;
private final LongConsumer onRequest;
private final Action onCancel;
public FlowableDoOnLifecycle(Flowable<T> source, Consumer<? super Subscription> onSubscribe,
LongConsumer onRequest, Action onCancel) {
super(source);
this.onSubscribe = onSubscribe;
Reported by PMD.
Line: 43
}
static final class SubscriptionLambdaSubscriber<T> implements FlowableSubscriber<T>, Subscription {
final Subscriber<? super T> downstream;
final Consumer<? super Subscription> onSubscribe;
final LongConsumer onRequest;
final Action onCancel;
Subscription upstream;
Reported by PMD.
Line: 44
static final class SubscriptionLambdaSubscriber<T> implements FlowableSubscriber<T>, Subscription {
final Subscriber<? super T> downstream;
final Consumer<? super Subscription> onSubscribe;
final LongConsumer onRequest;
final Action onCancel;
Subscription upstream;
Reported by PMD.
Line: 44
static final class SubscriptionLambdaSubscriber<T> implements FlowableSubscriber<T>, Subscription {
final Subscriber<? super T> downstream;
final Consumer<? super Subscription> onSubscribe;
final LongConsumer onRequest;
final Action onCancel;
Subscription upstream;
Reported by PMD.
Line: 45
static final class SubscriptionLambdaSubscriber<T> implements FlowableSubscriber<T>, Subscription {
final Subscriber<? super T> downstream;
final Consumer<? super Subscription> onSubscribe;
final LongConsumer onRequest;
final Action onCancel;
Subscription upstream;
SubscriptionLambdaSubscriber(Subscriber<? super T> actual,
Reported by PMD.
Line: 46
final Subscriber<? super T> downstream;
final Consumer<? super Subscription> onSubscribe;
final LongConsumer onRequest;
final Action onCancel;
Subscription upstream;
SubscriptionLambdaSubscriber(Subscriber<? super T> actual,
Consumer<? super Subscription> onSubscribe,
Reported by PMD.
Line: 48
final LongConsumer onRequest;
final Action onCancel;
Subscription upstream;
SubscriptionLambdaSubscriber(Subscriber<? super T> actual,
Consumer<? super Subscription> onSubscribe,
LongConsumer onRequest,
Action onCancel) {
Reported by PMD.
Line: 65
// this way, multiple calls to onSubscribe can show up in tests that use doOnSubscribe to validate behavior
try {
onSubscribe.accept(s);
} catch (Throwable e) {
Exceptions.throwIfFatal(e);
s.cancel();
this.upstream = SubscriptionHelper.CANCELLED;
EmptySubscription.error(e, downstream);
return;
Reported by PMD.
src/jmh/java/io/reactivex/rxjava3/core/RangePerf.java
16 issues
Line: 32
@State(Scope.Thread)
public class RangePerf {
@Param({ "1", "1000", "1000000" })
public int times;
Flowable<Integer> range;
Flowable<Integer> rangeAsync;
Reported by PMD.
Line: 34
@Param({ "1", "1000", "1000000" })
public int times;
Flowable<Integer> range;
Flowable<Integer> rangeAsync;
Flowable<Integer> rangeAsyncPipeline;
Reported by PMD.
Line: 36
Flowable<Integer> range;
Flowable<Integer> rangeAsync;
Flowable<Integer> rangeAsyncPipeline;
@Setup
public void setup() {
Reported by PMD.
Line: 36
Flowable<Integer> range;
Flowable<Integer> rangeAsync;
Flowable<Integer> rangeAsyncPipeline;
@Setup
public void setup() {
Reported by PMD.
Line: 38
Flowable<Integer> rangeAsync;
Flowable<Integer> rangeAsyncPipeline;
@Setup
public void setup() {
range = Flowable.range(1, times);
Reported by PMD.
Line: 59
}
// @Benchmark
public void rangeAsync(Blackhole bh) throws Exception {
PerfSubscriber lo = new PerfSubscriber(bh);
rangeAsync.subscribe(lo);
if (times == 1) {
Reported by PMD.
Line: 64
rangeAsync.subscribe(lo);
if (times == 1) {
while (lo.latch.getCount() != 0) { }
} else {
lo.latch.await();
}
}
Reported by PMD.
Line: 65
rangeAsync.subscribe(lo);
if (times == 1) {
while (lo.latch.getCount() != 0) { }
} else {
lo.latch.await();
}
}
Reported by PMD.
Line: 65
rangeAsync.subscribe(lo);
if (times == 1) {
while (lo.latch.getCount() != 0) { }
} else {
lo.latch.await();
}
}
Reported by PMD.
Line: 67
if (times == 1) {
while (lo.latch.getCount() != 0) { }
} else {
lo.latch.await();
}
}
// @Benchmark
public void rangePipeline(Blackhole bh) throws Exception {
Reported by PMD.
src/main/java/io/reactivex/rxjava3/internal/schedulers/IoScheduler.java
16 issues
Line: 42
private static final TimeUnit KEEP_ALIVE_UNIT = TimeUnit.SECONDS;
static final ThreadWorker SHUTDOWN_THREAD_WORKER;
final ThreadFactory threadFactory;
final AtomicReference<CachedWorkerPool> pool;
/** The name of the system property for setting the thread priority for this Scheduler. */
private static final String KEY_IO_PRIORITY = "rx3.io-priority";
Reported by PMD.
Line: 43
static final ThreadWorker SHUTDOWN_THREAD_WORKER;
final ThreadFactory threadFactory;
final AtomicReference<CachedWorkerPool> pool;
/** The name of the system property for setting the thread priority for this Scheduler. */
private static final String KEY_IO_PRIORITY = "rx3.io-priority";
/** The name of the system property for setting the release behaviour for this Scheduler. */
Reported by PMD.
Line: 74
}
static final class CachedWorkerPool implements Runnable {
private final long keepAliveTime;
private final ConcurrentLinkedQueue<ThreadWorker> expiringWorkerQueue;
final CompositeDisposable allWorkers;
private final ScheduledExecutorService evictorService;
private final Future<?> evictorTask;
private final ThreadFactory threadFactory;
Reported by PMD.
Line: 75
static final class CachedWorkerPool implements Runnable {
private final long keepAliveTime;
private final ConcurrentLinkedQueue<ThreadWorker> expiringWorkerQueue;
final CompositeDisposable allWorkers;
private final ScheduledExecutorService evictorService;
private final Future<?> evictorTask;
private final ThreadFactory threadFactory;
Reported by PMD.
Line: 76
static final class CachedWorkerPool implements Runnable {
private final long keepAliveTime;
private final ConcurrentLinkedQueue<ThreadWorker> expiringWorkerQueue;
final CompositeDisposable allWorkers;
private final ScheduledExecutorService evictorService;
private final Future<?> evictorTask;
private final ThreadFactory threadFactory;
CachedWorkerPool(long keepAliveTime, TimeUnit unit, ThreadFactory threadFactory) {
Reported by PMD.
Line: 77
private final long keepAliveTime;
private final ConcurrentLinkedQueue<ThreadWorker> expiringWorkerQueue;
final CompositeDisposable allWorkers;
private final ScheduledExecutorService evictorService;
private final Future<?> evictorTask;
private final ThreadFactory threadFactory;
CachedWorkerPool(long keepAliveTime, TimeUnit unit, ThreadFactory threadFactory) {
this.keepAliveTime = unit != null ? unit.toNanos(keepAliveTime) : 0L;
Reported by PMD.
Line: 78
private final ConcurrentLinkedQueue<ThreadWorker> expiringWorkerQueue;
final CompositeDisposable allWorkers;
private final ScheduledExecutorService evictorService;
private final Future<?> evictorTask;
private final ThreadFactory threadFactory;
CachedWorkerPool(long keepAliveTime, TimeUnit unit, ThreadFactory threadFactory) {
this.keepAliveTime = unit != null ? unit.toNanos(keepAliveTime) : 0L;
this.expiringWorkerQueue = new ConcurrentLinkedQueue<>();
Reported by PMD.
Line: 79
final CompositeDisposable allWorkers;
private final ScheduledExecutorService evictorService;
private final Future<?> evictorTask;
private final ThreadFactory threadFactory;
CachedWorkerPool(long keepAliveTime, TimeUnit unit, ThreadFactory threadFactory) {
this.keepAliveTime = unit != null ? unit.toNanos(keepAliveTime) : 0L;
this.expiringWorkerQueue = new ConcurrentLinkedQueue<>();
this.allWorkers = new CompositeDisposable();
Reported by PMD.
Line: 197
}
public int size() {
return pool.get().allWorkers.size();
}
static final class EventLoopWorker extends Scheduler.Worker implements Runnable {
private final CompositeDisposable tasks;
private final CachedWorkerPool pool;
Reported by PMD.
Line: 197
}
public int size() {
return pool.get().allWorkers.size();
}
static final class EventLoopWorker extends Scheduler.Worker implements Runnable {
private final CompositeDisposable tasks;
private final CachedWorkerPool pool;
Reported by PMD.
src/test/java/io/reactivex/rxjava3/internal/subscribers/BasicFuseableSubscriberTest.java
16 issues
Line: 29
public class BasicFuseableSubscriberTest extends RxJavaTest {
@Test
public void offerThrows() {
BasicFuseableSubscriber<Integer, Integer> fcs = new BasicFuseableSubscriber<Integer, Integer>(new TestSubscriber<>(0L)) {
@Override
public void onNext(Integer t) {
}
Reported by PMD.
Line: 52
TestHelper.assertNoOffer(fcs);
assertFalse(fcs.isEmpty());
fcs.clear();
assertTrue(fcs.isEmpty());
}
@Test
Reported by PMD.
Line: 54
assertFalse(fcs.isEmpty());
fcs.clear();
assertTrue(fcs.isEmpty());
}
@Test
public void implementationStopsOnSubscribe() {
TestSubscriber<Integer> ts = new TestSubscriber<>();
Reported by PMD.
Line: 86
bfs.onSubscribe(new BooleanSubscription());
assertFalse(ts.hasSubscription());
}
}
Reported by PMD.
Line: 16
package io.reactivex.rxjava3.internal.subscribers;
import static org.junit.Assert.*;
import org.junit.Test;
import io.reactivex.rxjava3.annotations.*;
import io.reactivex.rxjava3.core.RxJavaTest;
Reported by PMD.
Line: 20
import org.junit.Test;
import io.reactivex.rxjava3.annotations.*;
import io.reactivex.rxjava3.core.RxJavaTest;
import io.reactivex.rxjava3.internal.subscriptions.*;
import io.reactivex.rxjava3.subscribers.TestSubscriber;
import io.reactivex.rxjava3.testsupport.TestHelper;
Reported by PMD.
Line: 22
import io.reactivex.rxjava3.annotations.*;
import io.reactivex.rxjava3.core.RxJavaTest;
import io.reactivex.rxjava3.internal.subscriptions.*;
import io.reactivex.rxjava3.subscribers.TestSubscriber;
import io.reactivex.rxjava3.testsupport.TestHelper;
public class BasicFuseableSubscriberTest extends RxJavaTest {
Reported by PMD.
Line: 30
@Test
public void offerThrows() {
BasicFuseableSubscriber<Integer, Integer> fcs = new BasicFuseableSubscriber<Integer, Integer>(new TestSubscriber<>(0L)) {
@Override
public void onNext(Integer t) {
}
Reported by PMD.
Line: 30
@Test
public void offerThrows() {
BasicFuseableSubscriber<Integer, Integer> fcs = new BasicFuseableSubscriber<Integer, Integer>(new TestSubscriber<>(0L)) {
@Override
public void onNext(Integer t) {
}
Reported by PMD.
Line: 30
@Test
public void offerThrows() {
BasicFuseableSubscriber<Integer, Integer> fcs = new BasicFuseableSubscriber<Integer, Integer>(new TestSubscriber<>(0L)) {
@Override
public void onNext(Integer t) {
}
Reported by PMD.
src/test/java/io/reactivex/rxjava3/internal/subscribers/EmptyComponentTest.java
16 issues
Line: 33
public class EmptyComponentTest extends RxJavaTest {
@Test
public void normal() {
List<Throwable> errors = TestHelper.trackPluginErrors();
try {
TestHelper.checkEnum(EmptyComponent.class);
Reported by PMD.
Line: 41
EmptyComponent c = EmptyComponent.INSTANCE;
assertTrue(c.isDisposed());
c.request(10);
c.request(-10);
Reported by PMD.
Line: 41
EmptyComponent c = EmptyComponent.INSTANCE;
assertTrue(c.isDisposed());
c.request(10);
c.request(-10);
Reported by PMD.
Line: 43
assertTrue(c.isDisposed());
c.request(10);
c.request(-10);
Disposable d = Disposable.empty();
Reported by PMD.
Line: 45
c.request(10);
c.request(-10);
Disposable d = Disposable.empty();
c.onSubscribe(d);
Reported by PMD.
Line: 49
Disposable d = Disposable.empty();
c.onSubscribe(d);
assertTrue(d.isDisposed());
BooleanSubscription s = new BooleanSubscription();
Reported by PMD.
Line: 51
c.onSubscribe(d);
assertTrue(d.isDisposed());
BooleanSubscription s = new BooleanSubscription();
c.onSubscribe(s);
Reported by PMD.
Line: 51
c.onSubscribe(d);
assertTrue(d.isDisposed());
BooleanSubscription s = new BooleanSubscription();
c.onSubscribe(s);
Reported by PMD.
Line: 55
BooleanSubscription s = new BooleanSubscription();
c.onSubscribe(s);
assertTrue(s.isCancelled());
c.onNext(null);
Reported by PMD.
Line: 57
c.onSubscribe(s);
assertTrue(s.isCancelled());
c.onNext(null);
c.onNext(1);
Reported by PMD.
src/test/java/io/reactivex/rxjava3/internal/schedulers/SchedulerPoolFactoryTest.java
15 issues
Line: 28
public class SchedulerPoolFactoryTest extends RxJavaTest {
@Test
public void utilityClass() {
TestHelper.checkUtilityClass(SchedulerPoolFactory.class);
}
@Test
public void boolPropertiesDisabledReturnsDefaultDisabled() throws Throwable {
Reported by PMD.
Line: 33
}
@Test
public void boolPropertiesDisabledReturnsDefaultDisabled() throws Throwable {
assertTrue(SchedulerPoolFactory.getBooleanProperty(false, "key", false, true, failingPropertiesAccessor));
assertFalse(SchedulerPoolFactory.getBooleanProperty(false, "key", true, false, failingPropertiesAccessor));
}
@Test
Reported by PMD.
Line: 34
@Test
public void boolPropertiesDisabledReturnsDefaultDisabled() throws Throwable {
assertTrue(SchedulerPoolFactory.getBooleanProperty(false, "key", false, true, failingPropertiesAccessor));
assertFalse(SchedulerPoolFactory.getBooleanProperty(false, "key", true, false, failingPropertiesAccessor));
}
@Test
public void boolPropertiesEnabledMissingReturnsDefaultMissing() throws Throwable {
Reported by PMD.
Line: 34
@Test
public void boolPropertiesDisabledReturnsDefaultDisabled() throws Throwable {
assertTrue(SchedulerPoolFactory.getBooleanProperty(false, "key", false, true, failingPropertiesAccessor));
assertFalse(SchedulerPoolFactory.getBooleanProperty(false, "key", true, false, failingPropertiesAccessor));
}
@Test
public void boolPropertiesEnabledMissingReturnsDefaultMissing() throws Throwable {
Reported by PMD.
Line: 35
@Test
public void boolPropertiesDisabledReturnsDefaultDisabled() throws Throwable {
assertTrue(SchedulerPoolFactory.getBooleanProperty(false, "key", false, true, failingPropertiesAccessor));
assertFalse(SchedulerPoolFactory.getBooleanProperty(false, "key", true, false, failingPropertiesAccessor));
}
@Test
public void boolPropertiesEnabledMissingReturnsDefaultMissing() throws Throwable {
assertTrue(SchedulerPoolFactory.getBooleanProperty(true, "key", true, false, missingPropertiesAccessor));
Reported by PMD.
Line: 39
}
@Test
public void boolPropertiesEnabledMissingReturnsDefaultMissing() throws Throwable {
assertTrue(SchedulerPoolFactory.getBooleanProperty(true, "key", true, false, missingPropertiesAccessor));
assertFalse(SchedulerPoolFactory.getBooleanProperty(true, "key", false, true, missingPropertiesAccessor));
}
@Test
Reported by PMD.
Line: 40
@Test
public void boolPropertiesEnabledMissingReturnsDefaultMissing() throws Throwable {
assertTrue(SchedulerPoolFactory.getBooleanProperty(true, "key", true, false, missingPropertiesAccessor));
assertFalse(SchedulerPoolFactory.getBooleanProperty(true, "key", false, true, missingPropertiesAccessor));
}
@Test
public void boolPropertiesFailureReturnsDefaultMissing() throws Throwable {
Reported by PMD.
Line: 41
@Test
public void boolPropertiesEnabledMissingReturnsDefaultMissing() throws Throwable {
assertTrue(SchedulerPoolFactory.getBooleanProperty(true, "key", true, false, missingPropertiesAccessor));
assertFalse(SchedulerPoolFactory.getBooleanProperty(true, "key", false, true, missingPropertiesAccessor));
}
@Test
public void boolPropertiesFailureReturnsDefaultMissing() throws Throwable {
assertTrue(SchedulerPoolFactory.getBooleanProperty(true, "key", true, false, failingPropertiesAccessor));
Reported by PMD.
Line: 45
}
@Test
public void boolPropertiesFailureReturnsDefaultMissing() throws Throwable {
assertTrue(SchedulerPoolFactory.getBooleanProperty(true, "key", true, false, failingPropertiesAccessor));
assertFalse(SchedulerPoolFactory.getBooleanProperty(true, "key", false, true, failingPropertiesAccessor));
}
@Test
Reported by PMD.
Line: 46
@Test
public void boolPropertiesFailureReturnsDefaultMissing() throws Throwable {
assertTrue(SchedulerPoolFactory.getBooleanProperty(true, "key", true, false, failingPropertiesAccessor));
assertFalse(SchedulerPoolFactory.getBooleanProperty(true, "key", false, true, failingPropertiesAccessor));
}
@Test
public void boolPropertiesReturnsValue() throws Throwable {
Reported by PMD.
src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableDefaultIfEmptyTest.java
15 issues
Line: 29
@Test
public void defaultIfEmpty() {
Observable<Integer> source = Observable.just(1, 2, 3);
Observable<Integer> observable = source.defaultIfEmpty(10);
Observer<Integer> observer = TestHelper.mockObserver();
observable.subscribe(observer);
Reported by PMD.
Line: 33
Observer<Integer> observer = TestHelper.mockObserver();
observable.subscribe(observer);
verify(observer, never()).onNext(10);
verify(observer).onNext(1);
verify(observer).onNext(2);
verify(observer).onNext(3);
Reported by PMD.
Line: 35
observable.subscribe(observer);
verify(observer, never()).onNext(10);
verify(observer).onNext(1);
verify(observer).onNext(2);
verify(observer).onNext(3);
verify(observer).onComplete();
verify(observer, never()).onError(any(Throwable.class));
Reported by PMD.
Line: 36
observable.subscribe(observer);
verify(observer, never()).onNext(10);
verify(observer).onNext(1);
verify(observer).onNext(2);
verify(observer).onNext(3);
verify(observer).onComplete();
verify(observer, never()).onError(any(Throwable.class));
}
Reported by PMD.
Line: 37
verify(observer, never()).onNext(10);
verify(observer).onNext(1);
verify(observer).onNext(2);
verify(observer).onNext(3);
verify(observer).onComplete();
verify(observer, never()).onError(any(Throwable.class));
}
Reported by PMD.
Line: 38
verify(observer, never()).onNext(10);
verify(observer).onNext(1);
verify(observer).onNext(2);
verify(observer).onNext(3);
verify(observer).onComplete();
verify(observer, never()).onError(any(Throwable.class));
}
@Test
Reported by PMD.
Line: 39
verify(observer).onNext(1);
verify(observer).onNext(2);
verify(observer).onNext(3);
verify(observer).onComplete();
verify(observer, never()).onError(any(Throwable.class));
}
@Test
public void defaultIfEmptyWithEmpty() {
Reported by PMD.
Line: 40
verify(observer).onNext(2);
verify(observer).onNext(3);
verify(observer).onComplete();
verify(observer, never()).onError(any(Throwable.class));
}
@Test
public void defaultIfEmptyWithEmpty() {
Observable<Integer> source = Observable.empty();
Reported by PMD.
Line: 46
@Test
public void defaultIfEmptyWithEmpty() {
Observable<Integer> source = Observable.empty();
Observable<Integer> observable = source.defaultIfEmpty(10);
Observer<Integer> observer = TestHelper.mockObserver();
observable.subscribe(observer);
Reported by PMD.
Line: 50
Observer<Integer> observer = TestHelper.mockObserver();
observable.subscribe(observer);
verify(observer).onNext(10);
verify(observer).onComplete();
verify(observer, never()).onError(any(Throwable.class));
}
Reported by PMD.