The following issues were found

src/test/java/io/reactivex/rxjava3/internal/operators/observable/BlockingObservableToFutureTest.java
33 issues
The String literal 'one' appears 6 times in this file; the first occurrence is on line 32
Error

Line: 32

              public class BlockingObservableToFutureTest extends RxJavaTest {
    @Test
    public void toFuture() throws InterruptedException, ExecutionException {
        Observable<String> obs = Observable.just("one");
        Future<String> f = obs.toFuture();
        assertEquals("one", f.get());
    }

    @Test

            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 33

                  @Test
    public void toFuture() throws InterruptedException, ExecutionException {
        Observable<String> obs = Observable.just("one");
        Future<String> f = obs.toFuture();
        assertEquals("one", f.get());
    }

    @Test
    public void toFutureList() throws InterruptedException, ExecutionException {

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 34

                  public void toFuture() throws InterruptedException, ExecutionException {
        Observable<String> obs = Observable.just("one");
        Future<String> f = obs.toFuture();
        assertEquals("one", f.get());
    }

    @Test
    public void toFutureList() throws InterruptedException, ExecutionException {
        Observable<String> obs = Observable.just("one", "two", "three");

            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 34

                  public void toFuture() throws InterruptedException, ExecutionException {
        Observable<String> obs = Observable.just("one");
        Future<String> f = obs.toFuture();
        assertEquals("one", f.get());
    }

    @Test
    public void toFutureList() throws InterruptedException, ExecutionException {
        Observable<String> obs = Observable.just("one", "two", "three");

            

Reported by PMD.

Unit tests should not contain more than 1 assert(s).
Design

Line: 38

                  }

    @Test
    public void toFutureList() throws InterruptedException, ExecutionException {
        Observable<String> obs = Observable.just("one", "two", "three");
        Future<List<String>> f = obs.toList().toFuture();
        assertEquals("one", f.get().get(0));
        assertEquals("two", f.get().get(1));
        assertEquals("three", f.get().get(2));

            

Reported by PMD.

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

Line: 40

                  @Test
    public void toFutureList() throws InterruptedException, ExecutionException {
        Observable<String> obs = Observable.just("one", "two", "three");
        Future<List<String>> f = obs.toList().toFuture();
        assertEquals("one", f.get().get(0));
        assertEquals("two", f.get().get(1));
        assertEquals("three", f.get().get(2));
    }


            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 40

                  @Test
    public void toFutureList() throws InterruptedException, ExecutionException {
        Observable<String> obs = Observable.just("one", "two", "three");
        Future<List<String>> f = obs.toList().toFuture();
        assertEquals("one", f.get().get(0));
        assertEquals("two", f.get().get(1));
        assertEquals("three", f.get().get(2));
    }


            

Reported by PMD.

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

Line: 41

                  public void toFutureList() throws InterruptedException, ExecutionException {
        Observable<String> obs = Observable.just("one", "two", "three");
        Future<List<String>> f = obs.toList().toFuture();
        assertEquals("one", f.get().get(0));
        assertEquals("two", f.get().get(1));
        assertEquals("three", f.get().get(2));
    }

    @Test(expected = IndexOutOfBoundsException.class)

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 41

                  public void toFutureList() throws InterruptedException, ExecutionException {
        Observable<String> obs = Observable.just("one", "two", "three");
        Future<List<String>> f = obs.toList().toFuture();
        assertEquals("one", f.get().get(0));
        assertEquals("two", f.get().get(1));
        assertEquals("three", f.get().get(2));
    }

    @Test(expected = IndexOutOfBoundsException.class)

            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 41

                  public void toFutureList() throws InterruptedException, ExecutionException {
        Observable<String> obs = Observable.just("one", "two", "three");
        Future<List<String>> f = obs.toList().toFuture();
        assertEquals("one", f.get().get(0));
        assertEquals("two", f.get().get(1));
        assertEquals("three", f.get().get(2));
    }

    @Test(expected = IndexOutOfBoundsException.class)

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/disposables/ArrayCompositeDisposableTest.java
33 issues
Unit tests should not contain more than 1 assert(s).
Design

Line: 27

              public class ArrayCompositeDisposableTest extends RxJavaTest {

    @Test
    public void normal() {
        ArrayCompositeDisposable acd = new ArrayCompositeDisposable(2);

        Disposable d1 = Disposable.empty();
        Disposable d2 = Disposable.empty();


            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 33

                      Disposable d1 = Disposable.empty();
        Disposable d2 = Disposable.empty();

        assertTrue(acd.setResource(0, d1));
        assertTrue(acd.setResource(1, d2));

        Disposable d3 = Disposable.empty();
        Disposable d4 = Disposable.empty();


            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 34

                      Disposable d2 = Disposable.empty();

        assertTrue(acd.setResource(0, d1));
        assertTrue(acd.setResource(1, d2));

        Disposable d3 = Disposable.empty();
        Disposable d4 = Disposable.empty();

        acd.replaceResource(0, d3);

            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 42

                      acd.replaceResource(0, d3);
        acd.replaceResource(1, d4);

        assertFalse(d1.isDisposed());
        assertFalse(d2.isDisposed());

        acd.setResource(0, d1);
        acd.setResource(1, d2);


            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 42

                      acd.replaceResource(0, d3);
        acd.replaceResource(1, d4);

        assertFalse(d1.isDisposed());
        assertFalse(d2.isDisposed());

        acd.setResource(0, d1);
        acd.setResource(1, d2);


            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 43

                      acd.replaceResource(1, d4);

        assertFalse(d1.isDisposed());
        assertFalse(d2.isDisposed());

        acd.setResource(0, d1);
        acd.setResource(1, d2);

        assertTrue(d3.isDisposed());

            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 43

                      acd.replaceResource(1, d4);

        assertFalse(d1.isDisposed());
        assertFalse(d2.isDisposed());

        acd.setResource(0, d1);
        acd.setResource(1, d2);

        assertTrue(d3.isDisposed());

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 48

                      acd.setResource(0, d1);
        acd.setResource(1, d2);

        assertTrue(d3.isDisposed());
        assertTrue(d4.isDisposed());

        assertFalse(acd.isDisposed());

        acd.dispose();

            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 48

                      acd.setResource(0, d1);
        acd.setResource(1, d2);

        assertTrue(d3.isDisposed());
        assertTrue(d4.isDisposed());

        assertFalse(acd.isDisposed());

        acd.dispose();

            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 49

                      acd.setResource(1, d2);

        assertTrue(d3.isDisposed());
        assertTrue(d4.isDisposed());

        assertFalse(acd.isDisposed());

        acd.dispose();
        acd.dispose();

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/flowable/BlockingFlowableToFutureTest.java
33 issues
The String literal 'one' appears 6 times in this file; the first occurrence is on line 32
Error

Line: 32

              
    @Test
    public void toFuture() throws InterruptedException, ExecutionException {
        Flowable<String> obs = Flowable.just("one");
        Future<String> f = obs.toFuture();
        assertEquals("one", f.get());
    }

    @Test

            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 33

                  @Test
    public void toFuture() throws InterruptedException, ExecutionException {
        Flowable<String> obs = Flowable.just("one");
        Future<String> f = obs.toFuture();
        assertEquals("one", f.get());
    }

    @Test
    public void toFutureList() throws InterruptedException, ExecutionException {

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 34

                  public void toFuture() throws InterruptedException, ExecutionException {
        Flowable<String> obs = Flowable.just("one");
        Future<String> f = obs.toFuture();
        assertEquals("one", f.get());
    }

    @Test
    public void toFutureList() throws InterruptedException, ExecutionException {
        Flowable<String> obs = Flowable.just("one", "two", "three");

            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 34

                  public void toFuture() throws InterruptedException, ExecutionException {
        Flowable<String> obs = Flowable.just("one");
        Future<String> f = obs.toFuture();
        assertEquals("one", f.get());
    }

    @Test
    public void toFutureList() throws InterruptedException, ExecutionException {
        Flowable<String> obs = Flowable.just("one", "two", "three");

            

Reported by PMD.

Unit tests should not contain more than 1 assert(s).
Design

Line: 38

                  }

    @Test
    public void toFutureList() throws InterruptedException, ExecutionException {
        Flowable<String> obs = Flowable.just("one", "two", "three");
        Future<List<String>> f = obs.toList().toFuture();
        assertEquals("one", f.get().get(0));
        assertEquals("two", f.get().get(1));
        assertEquals("three", f.get().get(2));

            

Reported by PMD.

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

Line: 40

                  @Test
    public void toFutureList() throws InterruptedException, ExecutionException {
        Flowable<String> obs = Flowable.just("one", "two", "three");
        Future<List<String>> f = obs.toList().toFuture();
        assertEquals("one", f.get().get(0));
        assertEquals("two", f.get().get(1));
        assertEquals("three", f.get().get(2));
    }


            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 40

                  @Test
    public void toFutureList() throws InterruptedException, ExecutionException {
        Flowable<String> obs = Flowable.just("one", "two", "three");
        Future<List<String>> f = obs.toList().toFuture();
        assertEquals("one", f.get().get(0));
        assertEquals("two", f.get().get(1));
        assertEquals("three", f.get().get(2));
    }


            

Reported by PMD.

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

Line: 41

                  public void toFutureList() throws InterruptedException, ExecutionException {
        Flowable<String> obs = Flowable.just("one", "two", "three");
        Future<List<String>> f = obs.toList().toFuture();
        assertEquals("one", f.get().get(0));
        assertEquals("two", f.get().get(1));
        assertEquals("three", f.get().get(2));
    }

    @Test(expected = IndexOutOfBoundsException.class)

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 41

                  public void toFutureList() throws InterruptedException, ExecutionException {
        Flowable<String> obs = Flowable.just("one", "two", "three");
        Future<List<String>> f = obs.toList().toFuture();
        assertEquals("one", f.get().get(0));
        assertEquals("two", f.get().get(1));
        assertEquals("three", f.get().get(2));
    }

    @Test(expected = IndexOutOfBoundsException.class)

            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 41

                  public void toFutureList() throws InterruptedException, ExecutionException {
        Flowable<String> obs = Flowable.just("one", "two", "three");
        Future<List<String>> f = obs.toList().toFuture();
        assertEquals("one", f.get().get(0));
        assertEquals("two", f.get().get(1));
        assertEquals("three", f.get().get(2));
    }

    @Test(expected = IndexOutOfBoundsException.class)

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/single/SingleTimeIntervalTest.java
33 issues
JUnit tests should include assert() or fail()
Design

Line: 30

              public class SingleTimeIntervalTest {

    @Test
    public void just() {
        Single.just(1)
        .timestamp()
        .test()
        .assertValueCount(1)
        .assertNoErrors()

            

Reported by PMD.

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

Line: 31

              
    @Test
    public void just() {
        Single.just(1)
        .timestamp()
        .test()
        .assertValueCount(1)
        .assertNoErrors()
        .assertComplete();

            

Reported by PMD.

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

Line: 31

              
    @Test
    public void just() {
        Single.just(1)
        .timestamp()
        .test()
        .assertValueCount(1)
        .assertNoErrors()
        .assertComplete();

            

Reported by PMD.

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

Line: 31

              
    @Test
    public void just() {
        Single.just(1)
        .timestamp()
        .test()
        .assertValueCount(1)
        .assertNoErrors()
        .assertComplete();

            

Reported by PMD.

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

Line: 31

              
    @Test
    public void just() {
        Single.just(1)
        .timestamp()
        .test()
        .assertValueCount(1)
        .assertNoErrors()
        .assertComplete();

            

Reported by PMD.

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

Line: 31

              
    @Test
    public void just() {
        Single.just(1)
        .timestamp()
        .test()
        .assertValueCount(1)
        .assertNoErrors()
        .assertComplete();

            

Reported by PMD.

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

Line: 40

                  }

    @Test
    public void error() {
        Single.error(new TestException())
        .timestamp()
        .test()
        .assertFailure(TestException.class);
    }

            

Reported by PMD.

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

Line: 48

                  }

    @Test
    public void justSeconds() {
        Single.just(1)
        .timestamp(TimeUnit.SECONDS)
        .test()
        .assertValueCount(1)
        .assertNoErrors()

            

Reported by PMD.

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

Line: 49

              
    @Test
    public void justSeconds() {
        Single.just(1)
        .timestamp(TimeUnit.SECONDS)
        .test()
        .assertValueCount(1)
        .assertNoErrors()
        .assertComplete();

            

Reported by PMD.

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

Line: 49

              
    @Test
    public void justSeconds() {
        Single.just(1)
        .timestamp(TimeUnit.SECONDS)
        .test()
        .assertValueCount(1)
        .assertNoErrors()
        .assertComplete();

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/util/MiscUtilTest.java
33 issues
This class has too many methods, consider refactoring it.
Design

Line: 27

              import io.reactivex.rxjava3.internal.util.AppendOnlyLinkedArrayList.NonThrowingPredicate;
import io.reactivex.rxjava3.testsupport.TestHelper;

public class MiscUtilTest extends RxJavaTest {
    @Test
    public void pow2UtilityClass() {
        TestHelper.checkUtilityClass(Pow2.class);
    }


            

Reported by PMD.

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

Line: 29

              
public class MiscUtilTest extends RxJavaTest {
    @Test
    public void pow2UtilityClass() {
        TestHelper.checkUtilityClass(Pow2.class);
    }

    @Test
    public void isPowerOf2() {

            

Reported by PMD.

Unit tests should not contain more than 1 assert(s).
Design

Line: 34

                  }

    @Test
    public void isPowerOf2() {
        for (int i = 1; i > 0; i *= 2) {
            assertTrue(Pow2.isPowerOfTwo(i));
        }

        assertFalse(Pow2.isPowerOfTwo(3));

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 36

                  @Test
    public void isPowerOf2() {
        for (int i = 1; i > 0; i *= 2) {
            assertTrue(Pow2.isPowerOfTwo(i));
        }

        assertFalse(Pow2.isPowerOfTwo(3));
        assertFalse(Pow2.isPowerOfTwo(5));
        assertFalse(Pow2.isPowerOfTwo(6));

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 39

                          assertTrue(Pow2.isPowerOfTwo(i));
        }

        assertFalse(Pow2.isPowerOfTwo(3));
        assertFalse(Pow2.isPowerOfTwo(5));
        assertFalse(Pow2.isPowerOfTwo(6));
        assertFalse(Pow2.isPowerOfTwo(7));
    }


            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 40

                      }

        assertFalse(Pow2.isPowerOfTwo(3));
        assertFalse(Pow2.isPowerOfTwo(5));
        assertFalse(Pow2.isPowerOfTwo(6));
        assertFalse(Pow2.isPowerOfTwo(7));
    }

    @Test

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 41

              
        assertFalse(Pow2.isPowerOfTwo(3));
        assertFalse(Pow2.isPowerOfTwo(5));
        assertFalse(Pow2.isPowerOfTwo(6));
        assertFalse(Pow2.isPowerOfTwo(7));
    }

    @Test
    public void hashMapSupplier() {

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 42

                      assertFalse(Pow2.isPowerOfTwo(3));
        assertFalse(Pow2.isPowerOfTwo(5));
        assertFalse(Pow2.isPowerOfTwo(6));
        assertFalse(Pow2.isPowerOfTwo(7));
    }

    @Test
    public void hashMapSupplier() {
        TestHelper.checkEnum(HashMapSupplier.class);

            

Reported by PMD.

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

Line: 46

                  }

    @Test
    public void hashMapSupplier() {
        TestHelper.checkEnum(HashMapSupplier.class);
    }

    @Test
    public void arrayListSupplier() {

            

Reported by PMD.

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

Line: 51

                  }

    @Test
    public void arrayListSupplier() {
        TestHelper.checkEnum(ArrayListSupplier.class);
    }

    @Test
    public void errorModeEnum() {

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/mixed/CompletableAndThenPublisherTest.java
32 issues
Unit tests should not contain more than 1 assert(s).
Design

Line: 31

              public class CompletableAndThenPublisherTest extends RxJavaTest {

    @Test
    public void cancelMain() {
        CompletableSubject cs = CompletableSubject.create();
        PublishProcessor<Integer> pp = PublishProcessor.create();

        TestSubscriber<Integer> ts = cs.andThen(pp)
                .test();

            

Reported by PMD.

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

Line: 35

                      CompletableSubject cs = CompletableSubject.create();
        PublishProcessor<Integer> pp = PublishProcessor.create();

        TestSubscriber<Integer> ts = cs.andThen(pp)
                .test();

        assertTrue(cs.hasObservers());
        assertFalse(pp.hasSubscribers());


            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 35

                      CompletableSubject cs = CompletableSubject.create();
        PublishProcessor<Integer> pp = PublishProcessor.create();

        TestSubscriber<Integer> ts = cs.andThen(pp)
                .test();

        assertTrue(cs.hasObservers());
        assertFalse(pp.hasSubscribers());


            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 38

                      TestSubscriber<Integer> ts = cs.andThen(pp)
                .test();

        assertTrue(cs.hasObservers());
        assertFalse(pp.hasSubscribers());

        ts.cancel();

        assertFalse(cs.hasObservers());

            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 38

                      TestSubscriber<Integer> ts = cs.andThen(pp)
                .test();

        assertTrue(cs.hasObservers());
        assertFalse(pp.hasSubscribers());

        ts.cancel();

        assertFalse(cs.hasObservers());

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 39

                              .test();

        assertTrue(cs.hasObservers());
        assertFalse(pp.hasSubscribers());

        ts.cancel();

        assertFalse(cs.hasObservers());
        assertFalse(pp.hasSubscribers());

            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 39

                              .test();

        assertTrue(cs.hasObservers());
        assertFalse(pp.hasSubscribers());

        ts.cancel();

        assertFalse(cs.hasObservers());
        assertFalse(pp.hasSubscribers());

            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 41

                      assertTrue(cs.hasObservers());
        assertFalse(pp.hasSubscribers());

        ts.cancel();

        assertFalse(cs.hasObservers());
        assertFalse(pp.hasSubscribers());
    }


            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 43

              
        ts.cancel();

        assertFalse(cs.hasObservers());
        assertFalse(pp.hasSubscribers());
    }

    @Test
    public void cancelOther() {

            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 43

              
        ts.cancel();

        assertFalse(cs.hasObservers());
        assertFalse(pp.hasSubscribers());
    }

    @Test
    public void cancelOther() {

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/completable/CompletableDoOnLifecycleTest.java
32 issues
The String literal 'unchecked' appears 5 times in this file; the first occurrence is on line 34
Error

Line: 34

              
    @Test
    public void empty() throws Throwable {
        @SuppressWarnings("unchecked")
        Consumer<? super Disposable> onSubscribe = mock(Consumer.class);
        Action onDispose = mock(Action.class);

        Completable.complete()
        .doOnLifecycle(onSubscribe, onDispose)

            

Reported by PMD.

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

Line: 38

                      Consumer<? super Disposable> onSubscribe = mock(Consumer.class);
        Action onDispose = mock(Action.class);

        Completable.complete()
        .doOnLifecycle(onSubscribe, onDispose)
        .test()
        .assertResult();

        verify(onSubscribe).accept(any());

            

Reported by PMD.

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

Line: 38

                      Consumer<? super Disposable> onSubscribe = mock(Consumer.class);
        Action onDispose = mock(Action.class);

        Completable.complete()
        .doOnLifecycle(onSubscribe, onDispose)
        .test()
        .assertResult();

        verify(onSubscribe).accept(any());

            

Reported by PMD.

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

Line: 38

                      Consumer<? super Disposable> onSubscribe = mock(Consumer.class);
        Action onDispose = mock(Action.class);

        Completable.complete()
        .doOnLifecycle(onSubscribe, onDispose)
        .test()
        .assertResult();

        verify(onSubscribe).accept(any());

            

Reported by PMD.

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

Line: 43

                      .test()
        .assertResult();

        verify(onSubscribe).accept(any());
        verify(onDispose, never()).run();
    }

    @Test
    public void error() throws Throwable {

            

Reported by PMD.

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

Line: 44

                      .assertResult();

        verify(onSubscribe).accept(any());
        verify(onDispose, never()).run();
    }

    @Test
    public void error() throws Throwable {
        @SuppressWarnings("unchecked")

            

Reported by PMD.

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

Line: 58

                      .test()
        .assertFailure(TestException.class);

        verify(onSubscribe).accept(any());
        verify(onDispose, never()).run();
    }

    @Test
    public void onSubscribeCrash() throws Throwable {

            

Reported by PMD.

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

Line: 59

                      .assertFailure(TestException.class);

        verify(onSubscribe).accept(any());
        verify(onDispose, never()).run();
    }

    @Test
    public void onSubscribeCrash() throws Throwable {
        TestHelper.withErrorTracking(errors -> {

            

Reported by PMD.

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

Line: 63

                  }

    @Test
    public void onSubscribeCrash() throws Throwable {
        TestHelper.withErrorTracking(errors -> {
            @SuppressWarnings("unchecked")
            Consumer<? super Disposable> onSubscribe = mock(Consumer.class);
            Action onDispose = mock(Action.class);


            

Reported by PMD.

The String literal 'First' appears 4 times in this file; the first occurrence is on line 69
Error

Line: 69

                          Consumer<? super Disposable> onSubscribe = mock(Consumer.class);
            Action onDispose = mock(Action.class);

            doThrow(new TestException("First")).when(onSubscribe).accept(any());

            Disposable bs = Disposable.empty();

            new Completable() {
                @Override

            

Reported by PMD.

src/main/java/io/reactivex/rxjava3/internal/jdk8/MaybeFlattenStreamAsObservable.java
32 issues
Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 39

               */
public final class MaybeFlattenStreamAsObservable<T, R> extends Observable<R> {

    final Maybe<T> source;

    final Function<? super T, ? extends Stream<? extends R>> mapper;

    public MaybeFlattenStreamAsObservable(Maybe<T> source, Function<? super T, ? extends Stream<? extends R>> mapper) {
        this.source = source;

            

Reported by PMD.

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

Line: 41

              
    final Maybe<T> source;

    final Function<? super T, ? extends Stream<? extends R>> mapper;

    public MaybeFlattenStreamAsObservable(Maybe<T> source, Function<? super T, ? extends Stream<? extends R>> mapper) {
        this.source = source;
        this.mapper = mapper;
    }

            

Reported by PMD.

The class 'FlattenStreamMultiObserver' has a Standard Cyclomatic Complexity of 3 (Highest = 12).
Design

Line: 53

                      source.subscribe(new FlattenStreamMultiObserver<>(s, mapper));
    }

    static final class FlattenStreamMultiObserver<T, R>
    extends BasicIntQueueDisposable<R>
    implements MaybeObserver<T>, SingleObserver<T> {

        private static final long serialVersionUID = 7363336003027148283L;


            

Reported by PMD.

The class 'FlattenStreamMultiObserver' has a Modified Cyclomatic Complexity of 3 (Highest = 12).
Design

Line: 53

                      source.subscribe(new FlattenStreamMultiObserver<>(s, mapper));
    }

    static final class FlattenStreamMultiObserver<T, R>
    extends BasicIntQueueDisposable<R>
    implements MaybeObserver<T>, SingleObserver<T> {

        private static final long serialVersionUID = 7363336003027148283L;


            

Reported by PMD.

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

Line: 59

              
        private static final long serialVersionUID = 7363336003027148283L;

        final Observer<? super R> downstream;

        final Function<? super T, ? extends Stream<? extends R>> mapper;

        Disposable upstream;


            

Reported by PMD.

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

Line: 61

              
        final Observer<? super R> downstream;

        final Function<? super T, ? extends Stream<? extends R>> mapper;

        Disposable upstream;

        volatile Iterator<? extends R> iterator;


            

Reported by PMD.

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

Line: 63

              
        final Function<? super T, ? extends Stream<? extends R>> mapper;

        Disposable upstream;

        volatile Iterator<? extends R> iterator;

        AutoCloseable close;


            

Reported by PMD.

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

Line: 65

              
        Disposable upstream;

        volatile Iterator<? extends R> iterator;

        AutoCloseable close;

        boolean once;


            

Reported by PMD.

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

Line: 67

              
        volatile Iterator<? extends R> iterator;

        AutoCloseable close;

        boolean once;

        volatile boolean disposed;


            

Reported by PMD.

Field close has the same name as a method
Error

Line: 67

              
        volatile Iterator<? extends R> iterator;

        AutoCloseable close;

        boolean once;

        volatile boolean disposed;


            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/completable/CompletableDetachTest.java
32 issues
Do not explicitly trigger a garbage collection.
Error

Line: 83

              
        to.dispose();

        System.gc();
        Thread.sleep(200);

        to.assertEmpty();

        assertNull(wr.get());

            

Reported by PMD.

Do not explicitly trigger a garbage collection.
Error

Line: 109

              
        d = null;

        System.gc();
        Thread.sleep(200);

        to.assertResult();

        assertNull(wr.get());

            

Reported by PMD.

Do not explicitly trigger a garbage collection.
Error

Line: 135

              
        d = null;

        System.gc();
        Thread.sleep(200);

        to.assertFailure(TestException.class);

        assertNull(wr.get());

            

Reported by PMD.

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

Line: 34

              public class CompletableDetachTest extends RxJavaTest {

    @Test
    public void doubleSubscribe() {

        TestHelper.checkDoubleOnSubscribeCompletable(new Function<Completable, CompletableSource>() {
            @Override
            public CompletableSource apply(Completable m) throws Exception {
                return m.onTerminateDetach();

            

Reported by PMD.

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

Line: 45

                  }

    @Test
    public void dispose() {
        TestHelper.checkDisposed(PublishProcessor.create().ignoreElements().onTerminateDetach());
    }

    @Test
    public void onError() {

            

Reported by PMD.

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

Line: 46

              
    @Test
    public void dispose() {
        TestHelper.checkDisposed(PublishProcessor.create().ignoreElements().onTerminateDetach());
    }

    @Test
    public void onError() {
        Completable.error(new TestException())

            

Reported by PMD.

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

Line: 46

              
    @Test
    public void dispose() {
        TestHelper.checkDisposed(PublishProcessor.create().ignoreElements().onTerminateDetach());
    }

    @Test
    public void onError() {
        Completable.error(new TestException())

            

Reported by PMD.

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

Line: 50

                  }

    @Test
    public void onError() {
        Completable.error(new TestException())
        .onTerminateDetach()
        .test()
        .assertFailure(TestException.class);
    }

            

Reported by PMD.

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

Line: 58

                  }

    @Test
    public void onComplete() {
        Completable.complete()
        .onTerminateDetach()
        .test()
        .assertResult();
    }

            

Reported by PMD.

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

Line: 59

              
    @Test
    public void onComplete() {
        Completable.complete()
        .onTerminateDetach()
        .test()
        .assertResult();
    }


            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/single/SingleDoOnLifecycleTest.java
32 issues
The String literal 'unchecked' appears 5 times in this file; the first occurrence is on line 33
Error

Line: 33

              
    @Test
    public void success() throws Throwable {
        @SuppressWarnings("unchecked")
        Consumer<? super Disposable> onSubscribe = mock(Consumer.class);
        Action onDispose = mock(Action.class);

        Single.just(1)
        .doOnLifecycle(onSubscribe, onDispose)

            

Reported by PMD.

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

Line: 37

                      Consumer<? super Disposable> onSubscribe = mock(Consumer.class);
        Action onDispose = mock(Action.class);

        Single.just(1)
        .doOnLifecycle(onSubscribe, onDispose)
        .test()
        .assertResult(1);

        verify(onSubscribe).accept(any());

            

Reported by PMD.

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

Line: 37

                      Consumer<? super Disposable> onSubscribe = mock(Consumer.class);
        Action onDispose = mock(Action.class);

        Single.just(1)
        .doOnLifecycle(onSubscribe, onDispose)
        .test()
        .assertResult(1);

        verify(onSubscribe).accept(any());

            

Reported by PMD.

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

Line: 37

                      Consumer<? super Disposable> onSubscribe = mock(Consumer.class);
        Action onDispose = mock(Action.class);

        Single.just(1)
        .doOnLifecycle(onSubscribe, onDispose)
        .test()
        .assertResult(1);

        verify(onSubscribe).accept(any());

            

Reported by PMD.

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

Line: 42

                      .test()
        .assertResult(1);

        verify(onSubscribe).accept(any());
        verify(onDispose, never()).run();
    }

    @Test
    public void error() throws Throwable {

            

Reported by PMD.

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

Line: 43

                      .assertResult(1);

        verify(onSubscribe).accept(any());
        verify(onDispose, never()).run();
    }

    @Test
    public void error() throws Throwable {
        @SuppressWarnings("unchecked")

            

Reported by PMD.

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

Line: 57

                      .test()
        .assertFailure(TestException.class);

        verify(onSubscribe).accept(any());
        verify(onDispose, never()).run();
    }

    @Test
    public void onSubscribeCrash() throws Throwable {

            

Reported by PMD.

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

Line: 58

                      .assertFailure(TestException.class);

        verify(onSubscribe).accept(any());
        verify(onDispose, never()).run();
    }

    @Test
    public void onSubscribeCrash() throws Throwable {
        TestHelper.withErrorTracking(errors -> {

            

Reported by PMD.

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

Line: 62

                  }

    @Test
    public void onSubscribeCrash() throws Throwable {
        TestHelper.withErrorTracking(errors -> {
            @SuppressWarnings("unchecked")
            Consumer<? super Disposable> onSubscribe = mock(Consumer.class);
            Action onDispose = mock(Action.class);


            

Reported by PMD.

The String literal 'First' appears 4 times in this file; the first occurrence is on line 68
Error

Line: 68

                          Consumer<? super Disposable> onSubscribe = mock(Consumer.class);
            Action onDispose = mock(Action.class);

            doThrow(new TestException("First")).when(onSubscribe).accept(any());

            Disposable bs = Disposable.empty();

            new Single<Integer>() {
                @Override

            

Reported by PMD.