The following issues were found

src/test/java/io/reactivex/rxjava3/internal/operators/maybe/MaybeConcatMapCompletableTest.java
4 issues
JUnit tests should include assert() or fail()
Design

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.

JUnit tests should include assert() or fail()
Design

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.

JUnit tests should include assert() or fail()
Design

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.

Avoid unused imports such as 'io.reactivex.rxjava3.core'
Design

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
Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

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.

Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

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.

Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

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.

Avoid using Literals in Conditional Statements
Error

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
Avoid catching NullPointerException; consider removing the cause of the NPE.
Error

Line: 39

                          })
            .test();
            fail("Should have thrown");
        } catch (NullPointerException ex) {
            assertTrue(ex.toString(), ex.getCause() instanceof TestException);
        }
    }
}

            

Reported by PMD.

Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block
Design

Line: 39

                          })
            .test();
            fail("Should have thrown");
        } catch (NullPointerException ex) {
            assertTrue(ex.toString(), ex.getCause() instanceof TestException);
        }
    }
}

            

Reported by PMD.

Avoid unused imports such as 'org.junit.Assert'
Design

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.

Avoid unused imports such as 'io.reactivex.rxjava3.core'
Design

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
JUnit tests should include assert() or fail()
Design

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.

JUnit tests should include assert() or fail()
Design

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.

JUnit tests should include assert() or fail()
Design

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.

Avoid unused imports such as 'io.reactivex.rxjava3.core'
Design

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
JUnit tests should include assert() or fail()
Design

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.

Avoid unused imports such as 'io.reactivex.rxjava3.core'
Design

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.

Found 'DU'-anomaly for variable 'errors' (lines '29'-'44').
Error

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.

Found 'DU'-anomaly for variable 'errors' (lines '29'-'44').
Error

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
JUnit tests should include assert() or fail()
Design

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.

Potential violation of Law of Demeter (method chain calls)
Design

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.

JUnit tests should include assert() or fail()
Design

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.

Avoid unused imports such as 'io.reactivex.rxjava3.core'
Design

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
Avoid using Literals in Conditional Statements
Error

Line: 44

                                      return;
                    }

                    if (System.currentTimeMillis() - start > 200) {
                        return;
                    }
                }

                for (int i = 0; i < elements; i++) {

            

Reported by PMD.

Avoid using Literals in Conditional Statements
Error

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.

Found 'DU'-anomaly for variable 'start' (lines '36'-'61').
Error

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.

Found 'DU'-anomaly for variable 'start' (lines '36'-'61').
Error

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
System.out.println is used
Design

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.

JUnit tests should include assert() or fail()
Design

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.

A method/constructor should not explicitly throw java.lang.Exception
Design

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.

Avoid unused imports such as 'io.reactivex.rxjava3.functions'
Design

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
A method/constructor should not explicitly throw java.lang.Exception
Design

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.

Potential violation of Law of Demeter (method chain calls)
Design

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.

Potential violation of Law of Demeter (method chain calls)
Design

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.

Potential violation of Law of Demeter (method chain calls)
Design

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
JUnit tests should include assert() or fail()
Design

Line: 100

                  }

    @Test
    public void noOfferBasic() {
        TestHelper.assertNoOffer(new EmptyQS());
    }

    @Test
    public void noOfferBasicInt() {

            

Reported by PMD.

JUnit tests should include assert() or fail()
Design

Line: 105

                  }

    @Test
    public void noOfferBasicInt() {
        TestHelper.assertNoOffer(new EmptyIntQS());
    }

    @Test
    public void empty() {

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 113

                  public void empty() {
        TestHelper.checkEnum(EmptySubscription.class);

        assertEquals("EmptySubscription", EmptySubscription.INSTANCE.toString());

        TestHelper.assertNoOffer(EmptySubscription.INSTANCE);
    }
}

            

Reported by PMD.

Potential violation of Law of Demeter (static property access)
Design

Line: 113

                  public void empty() {
        TestHelper.checkEnum(EmptySubscription.class);

        assertEquals("EmptySubscription", EmptySubscription.INSTANCE.toString());

        TestHelper.assertNoOffer(EmptySubscription.INSTANCE);
    }
}

            

Reported by PMD.