The following issues were found
src/test/java/io/reactivex/rxjava3/tck/AsyncProcessorAsPublisherTckTest.java
3 issues
Line: 44
return;
}
if (System.currentTimeMillis() - start > 200) {
return;
}
}
for (int i = 0; i < elements; i++) {
Reported by PMD.
Line: 36
Schedulers.io().scheduleDirect(new Runnable() {
@Override
public void run() {
long start = System.currentTimeMillis();
while (!pp.hasSubscribers()) {
try {
Thread.sleep(1);
} catch (InterruptedException ex) {
return;
Reported by PMD.
Line: 36
Schedulers.io().scheduleDirect(new Runnable() {
@Override
public void run() {
long start = System.currentTimeMillis();
while (!pp.hasSubscribers()) {
try {
Thread.sleep(1);
} catch (InterruptedException ex) {
return;
Reported by PMD.
src/test/java/io/reactivex/rxjava3/tck/GenerateTckTest.java
3 issues
Line: 32
Flowable.generate(Functions.justSupplier(0L),
new BiFunction<Long, Emitter<Long>, Long>() {
@Override
public Long apply(Long s, Emitter<Long> e) throws Exception {
e.onNext(s);
if (++s == elements) {
e.onComplete();
}
return s;
Reported by PMD.
Line: 34
@Override
public Long apply(Long s, Emitter<Long> e) throws Exception {
e.onNext(s);
if (++s == elements) {
e.onComplete();
}
return s;
}
}, Functions.<Long>emptyConsumer())
Reported by PMD.
Line: 19
import org.reactivestreams.Publisher;
import org.testng.annotations.Test;
import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.functions.BiFunction;
import io.reactivex.rxjava3.internal.functions.Functions;
@Test
public class GenerateTckTest extends BaseTck<Long> {
Reported by PMD.
src/test/java/io/reactivex/rxjava3/testsupport/SuppressUndeliverableRule.java
3 issues
Line: 32
public class SuppressUndeliverableRule implements TestRule {
static final class SuppressUndeliverableRuleStatement extends Statement {
private Statement base;
SuppressUndeliverableRuleStatement(Statement base) {
this.base = base;
}
Reported by PMD.
Line: 32
public class SuppressUndeliverableRule implements TestRule {
static final class SuppressUndeliverableRuleStatement extends Statement {
private Statement base;
SuppressUndeliverableRuleStatement(Statement base) {
this.base = base;
}
Reported by PMD.
Line: 43
try {
RxJavaPlugins.setErrorHandler(throwable -> {
if (!(throwable instanceof UndeliverableException)) {
throwable.printStackTrace();
Thread currentThread = Thread.currentThread();
currentThread.getUncaughtExceptionHandler().uncaughtException(currentThread, throwable);
}
});
base.evaluate();
Reported by PMD.
src/test/java/io/reactivex/rxjava3/tck/BufferBoundaryTckTest.java
3 issues
Line: 29
@Override
public Publisher<List<Long>> createPublisher(long elements) {
return
Flowable.fromIterable(iterate(elements))
.buffer(Flowable.just(1).concatWith(Flowable.<Integer>never()))
.onBackpressureLatest()
;
}
Reported by PMD.
Line: 29
@Override
public Publisher<List<Long>> createPublisher(long elements) {
return
Flowable.fromIterable(iterate(elements))
.buffer(Flowable.just(1).concatWith(Flowable.<Integer>never()))
.onBackpressureLatest()
;
}
Reported by PMD.
Line: 30
public Publisher<List<Long>> createPublisher(long elements) {
return
Flowable.fromIterable(iterate(elements))
.buffer(Flowable.just(1).concatWith(Flowable.<Integer>never()))
.onBackpressureLatest()
;
}
@Override
Reported by PMD.
src/test/java/io/reactivex/rxjava3/internal/schedulers/BooleanRunnableTest.java
3 issues
Line: 40
try {
task.run();
fail("Should have thrown!");
} catch (TestException expected) {
// expected
}
TestHelper.assertUndeliverable(errors, 0, TestException.class);
Reported by PMD.
Line: 32
@Test
public void runnableThrows() {
List<Throwable> errors = TestHelper.trackPluginErrors();
try {
BooleanRunnable task = new BooleanRunnable(() -> {
throw new TestException();
});
Reported by PMD.
Line: 34
public void runnableThrows() {
List<Throwable> errors = TestHelper.trackPluginErrors();
try {
BooleanRunnable task = new BooleanRunnable(() -> {
throw new TestException();
});
try {
task.run();
Reported by PMD.
src/test/java/io/reactivex/rxjava3/internal/schedulers/ExecutorSchedulerDelayedRunnableTest.java
3 issues
Line: 56
dl.run();
assertEquals(0, count.get());
}
}
Reported by PMD.
Line: 32
@Test(expected = TestException.class)
@SuppressUndeliverable
public void delayedRunnableCrash() {
DelayedRunnable dl = new DelayedRunnable(new Runnable() {
@Override
public void run() {
throw new TestException();
}
});
Reported by PMD.
Line: 32
@Test(expected = TestException.class)
@SuppressUndeliverable
public void delayedRunnableCrash() {
DelayedRunnable dl = new DelayedRunnable(new Runnable() {
@Override
public void run() {
throw new TestException();
}
});
Reported by PMD.
src/test/java/io/reactivex/rxjava3/tck/MulticastProcessorRefCountedTckTest.java
3 issues
Line: 41
@Override
public Publisher<Integer> createFailedPublisher() {
MulticastProcessor<Integer> mp = MulticastProcessor.create();
mp.start();
mp.onError(new TestException());
return mp;
}
@Override
Reported by PMD.
Line: 18
import java.util.concurrent.*;
import org.reactivestreams.*;
import org.reactivestreams.tck.*;
import org.testng.annotations.Test;
import io.reactivex.rxjava3.exceptions.TestException;
import io.reactivex.rxjava3.processors.MulticastProcessor;
Reported by PMD.
Line: 19
import java.util.concurrent.*;
import org.reactivestreams.*;
import org.reactivestreams.tck.*;
import org.testng.annotations.Test;
import io.reactivex.rxjava3.exceptions.TestException;
import io.reactivex.rxjava3.processors.MulticastProcessor;
Reported by PMD.
src/test/java/io/reactivex/rxjava3/tck/MulticastProcessorTckTest.java
3 issues
Line: 41
@Override
public Publisher<Integer> createFailedPublisher() {
MulticastProcessor<Integer> mp = MulticastProcessor.create();
mp.start();
mp.onError(new TestException());
return mp;
}
@Override
Reported by PMD.
Line: 18
import java.util.concurrent.*;
import org.reactivestreams.*;
import org.reactivestreams.tck.*;
import org.testng.annotations.Test;
import io.reactivex.rxjava3.exceptions.TestException;
import io.reactivex.rxjava3.processors.MulticastProcessor;
Reported by PMD.
Line: 19
import java.util.concurrent.*;
import org.reactivestreams.*;
import org.reactivestreams.tck.*;
import org.testng.annotations.Test;
import io.reactivex.rxjava3.exceptions.TestException;
import io.reactivex.rxjava3.processors.MulticastProcessor;
Reported by PMD.
src/test/java/io/reactivex/rxjava3/tck/UnicastProcessorAsPublisherTckTest.java
3 issues
Line: 44
return;
}
if (System.currentTimeMillis() - start > 200) {
return;
}
}
for (int i = 0; i < elements; i++) {
Reported by PMD.
Line: 36
Schedulers.io().scheduleDirect(new Runnable() {
@Override
public void run() {
long start = System.currentTimeMillis();
while (!pp.hasSubscribers()) {
try {
Thread.sleep(1);
} catch (InterruptedException ex) {
return;
Reported by PMD.
Line: 36
Schedulers.io().scheduleDirect(new Runnable() {
@Override
public void run() {
long start = System.currentTimeMillis();
while (!pp.hasSubscribers()) {
try {
Thread.sleep(1);
} catch (InterruptedException ex) {
return;
Reported by PMD.
src/test/java/io/reactivex/rxjava3/tck/ReplayProcessorSizeBoundAsPublisherTckTest.java
3 issues
Line: 44
return;
}
if (System.currentTimeMillis() - start > 200) {
return;
}
}
for (int i = 0; i < elements; i++) {
Reported by PMD.
Line: 36
Schedulers.io().scheduleDirect(new Runnable() {
@Override
public void run() {
long start = System.currentTimeMillis();
while (!pp.hasSubscribers()) {
try {
Thread.sleep(1);
} catch (InterruptedException ex) {
return;
Reported by PMD.
Line: 36
Schedulers.io().scheduleDirect(new Runnable() {
@Override
public void run() {
long start = System.currentTimeMillis();
while (!pp.hasSubscribers()) {
try {
Thread.sleep(1);
} catch (InterruptedException ex) {
return;
Reported by PMD.