The following issues were found
src/test/java/io/reactivex/rxjava3/internal/operators/maybe/MaybeConcatMapCompletableTest.java
4 issues
Line: 26
public class MaybeConcatMapCompletableTest extends RxJavaTest {
@Test
public void dispose() {
TestHelper.checkDisposed(Maybe.just(1).concatMapCompletable(new Function<Integer, Completable>() {
@Override
public Completable apply(Integer v) throws Exception {
return Completable.complete();
}
Reported by PMD.
Line: 36
}
@Test
public void mapperThrows() {
Maybe.just(1)
.concatMapCompletable(new Function<Integer, Completable>() {
@Override
public Completable apply(Integer v) throws Exception {
throw new TestException();
Reported by PMD.
Line: 49
}
@Test
public void mapperReturnsNull() {
Maybe.just(1)
.concatMapCompletable(new Function<Integer, Completable>() {
@Override
public Completable apply(Integer v) throws Exception {
return null;
Reported by PMD.
Line: 18
import org.junit.Test;
import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.exceptions.TestException;
import io.reactivex.rxjava3.functions.Function;
import io.reactivex.rxjava3.testsupport.TestHelper;
public class MaybeConcatMapCompletableTest extends RxJavaTest {
Reported by PMD.
src/main/java/io/reactivex/rxjava3/subscribers/ResourceSubscriber.java
4 issues
Line: 97
*/
public abstract class ResourceSubscriber<T> implements FlowableSubscriber<T>, Disposable {
/** The active subscription. */
private final AtomicReference<Subscription> upstream = new AtomicReference<>();
/** The resource composite, can never be null. */
private final ListCompositeDisposable resources = new ListCompositeDisposable();
/** Remembers the request(n) counts until a subscription arrives. */
Reported by PMD.
Line: 100
private final AtomicReference<Subscription> upstream = new AtomicReference<>();
/** The resource composite, can never be null. */
private final ListCompositeDisposable resources = new ListCompositeDisposable();
/** Remembers the request(n) counts until a subscription arrives. */
private final AtomicLong missedRequested = new AtomicLong();
/**
Reported by PMD.
Line: 103
private final ListCompositeDisposable resources = new ListCompositeDisposable();
/** Remembers the request(n) counts until a subscription arrives. */
private final AtomicLong missedRequested = new AtomicLong();
/**
* Adds a resource to this {@code ResourceSubscriber}.
*
* @param resource the resource to add
Reported by PMD.
Line: 121
public final void onSubscribe(Subscription s) {
if (EndConsumerHelper.setOnce(this.upstream, s, getClass())) {
long r = missedRequested.getAndSet(0L);
if (r != 0L) {
s.request(r);
}
onStart();
}
}
Reported by PMD.
src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableLiftTest.java
4 issues
Line: 39
})
.test();
fail("Should have thrown");
} catch (NullPointerException ex) {
assertTrue(ex.toString(), ex.getCause() instanceof TestException);
}
}
}
Reported by PMD.
Line: 39
})
.test();
fail("Should have thrown");
} catch (NullPointerException ex) {
assertTrue(ex.toString(), ex.getCause() instanceof TestException);
}
}
}
Reported by PMD.
Line: 16
package io.reactivex.rxjava3.internal.operators.observable;
import static org.junit.Assert.*;
import org.junit.Test;
import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.exceptions.TestException;
Reported by PMD.
Line: 20
import org.junit.Test;
import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.exceptions.TestException;
import io.reactivex.rxjava3.testsupport.SuppressUndeliverable;
public class ObservableLiftTest extends RxJavaTest {
Reported by PMD.
src/test/java/io/reactivex/rxjava3/internal/operators/maybe/MaybeFlatMapCompletableTest.java
4 issues
Line: 26
public class MaybeFlatMapCompletableTest extends RxJavaTest {
@Test
public void dispose() {
TestHelper.checkDisposed(Maybe.just(1).flatMapCompletable(new Function<Integer, Completable>() {
@Override
public Completable apply(Integer v) throws Exception {
return Completable.complete();
}
Reported by PMD.
Line: 36
}
@Test
public void mapperThrows() {
Maybe.just(1)
.flatMapCompletable(new Function<Integer, Completable>() {
@Override
public Completable apply(Integer v) throws Exception {
throw new TestException();
Reported by PMD.
Line: 49
}
@Test
public void mapperReturnsNull() {
Maybe.just(1)
.flatMapCompletable(new Function<Integer, Completable>() {
@Override
public Completable apply(Integer v) throws Exception {
return null;
Reported by PMD.
Line: 18
import org.junit.Test;
import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.exceptions.TestException;
import io.reactivex.rxjava3.functions.Function;
import io.reactivex.rxjava3.testsupport.TestHelper;
public class MaybeFlatMapCompletableTest extends RxJavaTest {
Reported by PMD.
src/test/java/io/reactivex/rxjava3/internal/operators/completable/CompletableLiftTest.java
4 issues
Line: 28
public class CompletableLiftTest extends RxJavaTest {
@Test
public void callbackThrows() {
List<Throwable> errors = TestHelper.trackPluginErrors();
try {
Completable.complete()
.lift(new CompletableOperator() {
@Override
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 CompletableLiftTest extends RxJavaTest {
Reported by PMD.
Line: 29
@Test
public void callbackThrows() {
List<Throwable> errors = TestHelper.trackPluginErrors();
try {
Completable.complete()
.lift(new CompletableOperator() {
@Override
public CompletableObserver apply(CompletableObserver o) throws Exception {
Reported by PMD.
Line: 29
@Test
public void callbackThrows() {
List<Throwable> errors = TestHelper.trackPluginErrors();
try {
Completable.complete()
.lift(new CompletableOperator() {
@Override
public CompletableObserver apply(CompletableObserver o) throws Exception {
Reported by PMD.
src/test/java/io/reactivex/rxjava3/internal/operators/completable/CompletableObserveOnTest.java
4 issues
Line: 26
public class CompletableObserveOnTest extends RxJavaTest {
@Test
public void dispose() {
TestHelper.checkDisposed(Completable.complete().observeOn(Schedulers.single()));
}
@Test
public void doubleOnSubscribe() {
Reported by PMD.
Line: 27
@Test
public void dispose() {
TestHelper.checkDisposed(Completable.complete().observeOn(Schedulers.single()));
}
@Test
public void doubleOnSubscribe() {
TestHelper.checkDoubleOnSubscribeCompletable(new Function<Completable, CompletableSource>() {
Reported by PMD.
Line: 31
}
@Test
public void doubleOnSubscribe() {
TestHelper.checkDoubleOnSubscribeCompletable(new Function<Completable, CompletableSource>() {
@Override
public CompletableSource apply(Completable c) throws Exception {
return c.observeOn(Schedulers.single());
}
Reported by PMD.
Line: 18
import org.junit.Test;
import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.functions.Function;
import io.reactivex.rxjava3.schedulers.Schedulers;
import io.reactivex.rxjava3.testsupport.TestHelper;
public class CompletableObserveOnTest extends RxJavaTest {
Reported by PMD.
src/test/java/io/reactivex/rxjava3/tck/PublishProcessorAsPublisherTckTest.java
4 issues
Line: 44
return;
}
if (System.currentTimeMillis() - start > 200) {
return;
}
}
for (int i = 0; i < elements; i++) {
Reported by PMD.
Line: 52
for (int i = 0; i < elements; i++) {
while (!pp.offer(i)) {
Thread.yield();
if (System.currentTimeMillis() - start > 1000) {
return;
}
}
}
pp.onComplete();
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/observable/ObservableScanTests.java
4 issues
Line: 41
.blockingForEach(new Consumer<HashMap<String, String>>() {
@Override
public void accept(HashMap<String, String> pv) {
System.out.println(pv);
}
});
Thread.sleep(200); // make sure the event streams receive their interrupt
}
Reported by PMD.
Line: 27
public class ObservableScanTests extends RxJavaTest {
@Test
public void unsubscribeScan() throws Exception {
ObservableEventStream.getEventStream("HTTP-ClusterB", 20)
.scan(new HashMap<>(), new BiFunction<HashMap<String, String>, Event, HashMap<String, String>>() {
@Override
public HashMap<String, String> apply(HashMap<String, String> accum, Event perInstanceEvent) {
Reported by PMD.
Line: 27
public class ObservableScanTests extends RxJavaTest {
@Test
public void unsubscribeScan() throws Exception {
ObservableEventStream.getEventStream("HTTP-ClusterB", 20)
.scan(new HashMap<>(), new BiFunction<HashMap<String, String>, Event, HashMap<String, String>>() {
@Override
public HashMap<String, String> apply(HashMap<String, String> accum, Event perInstanceEvent) {
Reported by PMD.
Line: 21
import org.junit.Test;
import io.reactivex.rxjava3.core.RxJavaTest;
import io.reactivex.rxjava3.functions.*;
import io.reactivex.rxjava3.observable.ObservableEventStream.Event;
public class ObservableScanTests extends RxJavaTest {
@Test
Reported by PMD.
src/test/java/io/reactivex/rxjava3/validators/ParameterNamesInClassesTest.java
4 issues
Line: 25
}
@Test
public void javacParametersEnabled() throws Exception {
assertEquals("Please enable saving parameter names via the -parameters javac argument",
"paramName",
getClass()
.getDeclaredMethod("method", Integer.TYPE)
.getParameters()[0].getName());
Reported by PMD.
Line: 28
public void javacParametersEnabled() throws Exception {
assertEquals("Please enable saving parameter names via the -parameters javac argument",
"paramName",
getClass()
.getDeclaredMethod("method", Integer.TYPE)
.getParameters()[0].getName());
}
}
Reported by PMD.
Line: 28
public void javacParametersEnabled() throws Exception {
assertEquals("Please enable saving parameter names via the -parameters javac argument",
"paramName",
getClass()
.getDeclaredMethod("method", Integer.TYPE)
.getParameters()[0].getName());
}
}
Reported by PMD.
Line: 28
public void javacParametersEnabled() throws Exception {
assertEquals("Please enable saving parameter names via the -parameters javac argument",
"paramName",
getClass()
.getDeclaredMethod("method", Integer.TYPE)
.getParameters()[0].getName());
}
}
Reported by PMD.
src/test/java/io/reactivex/rxjava3/internal/subscriptions/QueueSubscriptionTest.java
4 issues
Line: 100
}
@Test
public void noOfferBasic() {
TestHelper.assertNoOffer(new EmptyQS());
}
@Test
public void noOfferBasicInt() {
Reported by PMD.
Line: 105
}
@Test
public void noOfferBasicInt() {
TestHelper.assertNoOffer(new EmptyIntQS());
}
@Test
public void empty() {
Reported by PMD.
Line: 113
public void empty() {
TestHelper.checkEnum(EmptySubscription.class);
assertEquals("EmptySubscription", EmptySubscription.INSTANCE.toString());
TestHelper.assertNoOffer(EmptySubscription.INSTANCE);
}
}
Reported by PMD.
Line: 113
public void empty() {
TestHelper.checkEnum(EmptySubscription.class);
assertEquals("EmptySubscription", EmptySubscription.INSTANCE.toString());
TestHelper.assertNoOffer(EmptySubscription.INSTANCE);
}
}
Reported by PMD.