The following issues were found

src/test/java/io/reactivex/rxjava3/core/NotificationTest.java
27 issues
Unit tests should not contain more than 1 assert(s).
Design

Line: 25

              public class NotificationTest extends RxJavaTest {

    @Test
    public void valueOfOnErrorIsNull() {
        Notification<Integer> notification = Notification.createOnError(new TestException());

        assertNull(notification.getValue());
        assertTrue(notification.getError().toString(), notification.getError() instanceof TestException);
    }

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 28

                  public void valueOfOnErrorIsNull() {
        Notification<Integer> notification = Notification.createOnError(new TestException());

        assertNull(notification.getValue());
        assertTrue(notification.getError().toString(), notification.getError() instanceof TestException);
    }

    @Test
    public void valueOfOnCompleteIsNull() {

            

Reported by PMD.

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

Line: 29

                      Notification<Integer> notification = Notification.createOnError(new TestException());

        assertNull(notification.getValue());
        assertTrue(notification.getError().toString(), notification.getError() instanceof TestException);
    }

    @Test
    public void valueOfOnCompleteIsNull() {
        Notification<Integer> notification = Notification.createOnComplete();

            

Reported by PMD.

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

Line: 33

                  }

    @Test
    public void valueOfOnCompleteIsNull() {
        Notification<Integer> notification = Notification.createOnComplete();

        assertNull(notification.getValue());
        assertNull(notification.getError());
        assertTrue(notification.isOnComplete());

            

Reported by PMD.

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

Line: 36

                  public void valueOfOnCompleteIsNull() {
        Notification<Integer> notification = Notification.createOnComplete();

        assertNull(notification.getValue());
        assertNull(notification.getError());
        assertTrue(notification.isOnComplete());
    }

    @Test

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 36

                  public void valueOfOnCompleteIsNull() {
        Notification<Integer> notification = Notification.createOnComplete();

        assertNull(notification.getValue());
        assertNull(notification.getError());
        assertTrue(notification.isOnComplete());
    }

    @Test

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 37

                      Notification<Integer> notification = Notification.createOnComplete();

        assertNull(notification.getValue());
        assertNull(notification.getError());
        assertTrue(notification.isOnComplete());
    }

    @Test
    public void notEqualsToObject() {

            

Reported by PMD.

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

Line: 37

                      Notification<Integer> notification = Notification.createOnComplete();

        assertNull(notification.getValue());
        assertNull(notification.getError());
        assertTrue(notification.isOnComplete());
    }

    @Test
    public void notEqualsToObject() {

            

Reported by PMD.

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

Line: 38

              
        assertNull(notification.getValue());
        assertNull(notification.getError());
        assertTrue(notification.isOnComplete());
    }

    @Test
    public void notEqualsToObject() {
        Notification<Integer> n1 = Notification.createOnNext(0);

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 38

              
        assertNull(notification.getValue());
        assertNull(notification.getError());
        assertTrue(notification.isOnComplete());
    }

    @Test
    public void notEqualsToObject() {
        Notification<Integer> n1 = Notification.createOnNext(0);

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableConcatWithCompletableTest.java
27 issues
JUnit tests should include assert() or fail()
Design

Line: 30

              public class ObservableConcatWithCompletableTest extends RxJavaTest {

    @Test
    public void normal() {
        final TestObserver<Integer> to = new TestObserver<>();

        Observable.range(1, 5)
        .concatWith(Completable.fromAction(new Action() {
            @Override

            

Reported by PMD.

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

Line: 46

                  }

    @Test
    public void mainError() {
        final TestObserver<Integer> to = new TestObserver<>();

        Observable.<Integer>error(new TestException())
        .concatWith(Completable.fromAction(new Action() {
            @Override

            

Reported by PMD.

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

Line: 62

                  }

    @Test
    public void otherError() {
        final TestObserver<Integer> to = new TestObserver<>();

        Observable.range(1, 5)
        .concatWith(Completable.error(new TestException()))
        .subscribe(to);

            

Reported by PMD.

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

Line: 73

                  }

    @Test
    public void takeMain() {
        final TestObserver<Integer> to = new TestObserver<>();

        Observable.range(1, 5)
        .concatWith(Completable.fromAction(new Action() {
            @Override

            

Reported by PMD.

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

Line: 90

                  }

    @Test
    public void cancelOther() {
        CompletableSubject other = CompletableSubject.create();

        TestObserver<Object> to = Observable.empty()
                .concatWith(other)
                .test();

            

Reported by PMD.

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

Line: 93

                  public void cancelOther() {
        CompletableSubject other = CompletableSubject.create();

        TestObserver<Object> to = Observable.empty()
                .concatWith(other)
                .test();

        assertTrue(other.hasObservers());


            

Reported by PMD.

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

Line: 93

                  public void cancelOther() {
        CompletableSubject other = CompletableSubject.create();

        TestObserver<Object> to = Observable.empty()
                .concatWith(other)
                .test();

        assertTrue(other.hasObservers());


            

Reported by PMD.

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

Line: 97

                              .concatWith(other)
                .test();

        assertTrue(other.hasObservers());

        to.dispose();

        assertFalse(other.hasObservers());
    }

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 97

                              .concatWith(other)
                .test();

        assertTrue(other.hasObservers());

        to.dispose();

        assertFalse(other.hasObservers());
    }

            

Reported by PMD.

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

Line: 99

              
        assertTrue(other.hasObservers());

        to.dispose();

        assertFalse(other.hasObservers());
    }

    @Test

            

Reported by PMD.

src/main/java/io/reactivex/rxjava3/internal/operators/mixed/ObservableSwitchMapSingle.java
27 issues
Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 38

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

    final Observable<T> source;

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

    final boolean delayErrors;


            

Reported by PMD.

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

Line: 40

              
    final Observable<T> source;

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

    final boolean delayErrors;

    public ObservableSwitchMapSingle(Observable<T> source,
            Function<? super T, ? extends SingleSource<? extends R>> mapper,

            

Reported by PMD.

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

Line: 42

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

    final boolean delayErrors;

    public ObservableSwitchMapSingle(Observable<T> source,
            Function<? super T, ? extends SingleSource<? extends R>> mapper,
            boolean delayErrors) {
        this.source = source;

            

Reported by PMD.

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

Line: 59

                      }
    }

    static final class SwitchMapSingleMainObserver<T, R> extends AtomicInteger
    implements Observer<T>, Disposable {

        private static final long serialVersionUID = -5402190102429853762L;

        final Observer<? super R> downstream;

            

Reported by PMD.

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

Line: 59

                      }
    }

    static final class SwitchMapSingleMainObserver<T, R> extends AtomicInteger
    implements Observer<T>, Disposable {

        private static final long serialVersionUID = -5402190102429853762L;

        final Observer<? super R> downstream;

            

Reported by PMD.

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

Line: 64

              
        private static final long serialVersionUID = -5402190102429853762L;

        final Observer<? super R> downstream;

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

        final boolean delayErrors;


            

Reported by PMD.

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

Line: 66

              
        final Observer<? super R> downstream;

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

        final boolean delayErrors;

        final AtomicThrowable errors;


            

Reported by PMD.

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

Line: 68

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

        final boolean delayErrors;

        final AtomicThrowable errors;

        final AtomicReference<SwitchMapSingleObserver<R>> inner;


            

Reported by PMD.

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

Line: 70

              
        final boolean delayErrors;

        final AtomicThrowable errors;

        final AtomicReference<SwitchMapSingleObserver<R>> inner;

        static final SwitchMapSingleObserver<Object> INNER_DISPOSED =
                new SwitchMapSingleObserver<>(null);

            

Reported by PMD.

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

Line: 72

              
        final AtomicThrowable errors;

        final AtomicReference<SwitchMapSingleObserver<R>> inner;

        static final SwitchMapSingleObserver<Object> INNER_DISPOSED =
                new SwitchMapSingleObserver<>(null);

        Disposable upstream;

            

Reported by PMD.

src/main/java/io/reactivex/rxjava3/internal/operators/mixed/ObservableSwitchMapMaybe.java
27 issues
Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 38

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

    final Observable<T> source;

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

    final boolean delayErrors;


            

Reported by PMD.

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

Line: 40

              
    final Observable<T> source;

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

    final boolean delayErrors;

    public ObservableSwitchMapMaybe(Observable<T> source,
            Function<? super T, ? extends MaybeSource<? extends R>> mapper,

            

Reported by PMD.

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

Line: 42

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

    final boolean delayErrors;

    public ObservableSwitchMapMaybe(Observable<T> source,
            Function<? super T, ? extends MaybeSource<? extends R>> mapper,
            boolean delayErrors) {
        this.source = source;

            

Reported by PMD.

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

Line: 59

                      }
    }

    static final class SwitchMapMaybeMainObserver<T, R> extends AtomicInteger
    implements Observer<T>, Disposable {

        private static final long serialVersionUID = -5402190102429853762L;

        final Observer<? super R> downstream;

            

Reported by PMD.

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

Line: 59

                      }
    }

    static final class SwitchMapMaybeMainObserver<T, R> extends AtomicInteger
    implements Observer<T>, Disposable {

        private static final long serialVersionUID = -5402190102429853762L;

        final Observer<? super R> downstream;

            

Reported by PMD.

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

Line: 64

              
        private static final long serialVersionUID = -5402190102429853762L;

        final Observer<? super R> downstream;

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

        final boolean delayErrors;


            

Reported by PMD.

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

Line: 66

              
        final Observer<? super R> downstream;

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

        final boolean delayErrors;

        final AtomicThrowable errors;


            

Reported by PMD.

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

Line: 68

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

        final boolean delayErrors;

        final AtomicThrowable errors;

        final AtomicReference<SwitchMapMaybeObserver<R>> inner;


            

Reported by PMD.

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

Line: 70

              
        final boolean delayErrors;

        final AtomicThrowable errors;

        final AtomicReference<SwitchMapMaybeObserver<R>> inner;

        static final SwitchMapMaybeObserver<Object> INNER_DISPOSED =
                new SwitchMapMaybeObserver<>(null);

            

Reported by PMD.

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

Line: 72

              
        final AtomicThrowable errors;

        final AtomicReference<SwitchMapMaybeObserver<R>> inner;

        static final SwitchMapMaybeObserver<Object> INNER_DISPOSED =
                new SwitchMapMaybeObserver<>(null);

        Disposable upstream;

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/maybe/MaybeToFutureTest.java
27 issues
A method/constructor should not explicitly throw java.lang.Exception
Design

Line: 30

              public class MaybeToFutureTest extends RxJavaTest {

    @Test
    public void success() throws Exception {
        assertEquals((Integer)1, Maybe.just(1)
        .subscribeOn(Schedulers.computation())
        .toFuture()
        .get());
    }

            

Reported by PMD.

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

Line: 31

              
    @Test
    public void success() throws Exception {
        assertEquals((Integer)1, Maybe.just(1)
        .subscribeOn(Schedulers.computation())
        .toFuture()
        .get());
    }


            

Reported by PMD.

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

Line: 31

              
    @Test
    public void success() throws Exception {
        assertEquals((Integer)1, Maybe.just(1)
        .subscribeOn(Schedulers.computation())
        .toFuture()
        .get());
    }


            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 31

              
    @Test
    public void success() throws Exception {
        assertEquals((Integer)1, Maybe.just(1)
        .subscribeOn(Schedulers.computation())
        .toFuture()
        .get());
    }


            

Reported by PMD.

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

Line: 31

              
    @Test
    public void success() throws Exception {
        assertEquals((Integer)1, Maybe.just(1)
        .subscribeOn(Schedulers.computation())
        .toFuture()
        .get());
    }


            

Reported by PMD.

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

Line: 38

                  }

    @Test
    public void empty() throws Exception {
        assertNull(Maybe.empty()
        .subscribeOn(Schedulers.computation())
        .toFuture()
        .get());
    }

            

Reported by PMD.

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

Line: 39

              
    @Test
    public void empty() throws Exception {
        assertNull(Maybe.empty()
        .subscribeOn(Schedulers.computation())
        .toFuture()
        .get());
    }


            

Reported by PMD.

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

Line: 39

              
    @Test
    public void empty() throws Exception {
        assertNull(Maybe.empty()
        .subscribeOn(Schedulers.computation())
        .toFuture()
        .get());
    }


            

Reported by PMD.

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

Line: 39

              
    @Test
    public void empty() throws Exception {
        assertNull(Maybe.empty()
        .subscribeOn(Schedulers.computation())
        .toFuture()
        .get());
    }


            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 39

              
    @Test
    public void empty() throws Exception {
        assertNull(Maybe.empty()
        .subscribeOn(Schedulers.computation())
        .toFuture()
        .get());
    }


            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableFromMaybeTest.java
27 issues
JUnit tests should include assert() or fail()
Design

Line: 30

              public class FlowableFromMaybeTest extends RxJavaTest {

    @Test
    public void success() {
        Flowable.fromMaybe(Maybe.just(1).hide())
        .test()
        .assertResult(1);
    }


            

Reported by PMD.

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

Line: 31

              
    @Test
    public void success() {
        Flowable.fromMaybe(Maybe.just(1).hide())
        .test()
        .assertResult(1);
    }

    @Test

            

Reported by PMD.

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

Line: 31

              
    @Test
    public void success() {
        Flowable.fromMaybe(Maybe.just(1).hide())
        .test()
        .assertResult(1);
    }

    @Test

            

Reported by PMD.

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

Line: 31

              
    @Test
    public void success() {
        Flowable.fromMaybe(Maybe.just(1).hide())
        .test()
        .assertResult(1);
    }

    @Test

            

Reported by PMD.

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

Line: 37

                  }

    @Test
    public void empty() {
        Flowable.fromMaybe(Maybe.empty().hide())
        .test()
        .assertResult();
    }


            

Reported by PMD.

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

Line: 38

              
    @Test
    public void empty() {
        Flowable.fromMaybe(Maybe.empty().hide())
        .test()
        .assertResult();
    }

    @Test

            

Reported by PMD.

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

Line: 38

              
    @Test
    public void empty() {
        Flowable.fromMaybe(Maybe.empty().hide())
        .test()
        .assertResult();
    }

    @Test

            

Reported by PMD.

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

Line: 38

              
    @Test
    public void empty() {
        Flowable.fromMaybe(Maybe.empty().hide())
        .test()
        .assertResult();
    }

    @Test

            

Reported by PMD.

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

Line: 44

                  }

    @Test
    public void error() {
        Flowable.fromMaybe(Maybe.error(new TestException()).hide())
        .test()
        .assertFailure(TestException.class);
    }


            

Reported by PMD.

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

Line: 51

                  }

    @Test
    public void cancelComposes() {
        MaybeSubject<Integer> ms = MaybeSubject.create();

        TestSubscriber<Integer> ts = Flowable.fromMaybe(ms)
        .test();


            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/completable/CompletableFromSupplierTest.java
27 issues
JUnit assertions should include a message
Design

Line: 51

                          .test()
            .assertResult();

        assertEquals(1, atomicInteger.get());
    }

    @Test
    public void fromSupplierTwice() {
        final AtomicInteger atomicInteger = new AtomicInteger();

            

Reported by PMD.

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

Line: 55

                  }

    @Test
    public void fromSupplierTwice() {
        final AtomicInteger atomicInteger = new AtomicInteger();

        Supplier<Object> supplier = new Supplier<Object>() {
            @Override
            public Object get() throws Exception {

            

Reported by PMD.

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

Line: 66

                          }
        };

        Completable.fromSupplier(supplier)
            .test()
            .assertResult();

        assertEquals(1, atomicInteger.get());


            

Reported by PMD.

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

Line: 66

                          }
        };

        Completable.fromSupplier(supplier)
            .test()
            .assertResult();

        assertEquals(1, atomicInteger.get());


            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 70

                          .test()
            .assertResult();

        assertEquals(1, atomicInteger.get());

        Completable.fromSupplier(supplier)
            .test()
            .assertResult();


            

Reported by PMD.

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

Line: 72

              
        assertEquals(1, atomicInteger.get());

        Completable.fromSupplier(supplier)
            .test()
            .assertResult();

        assertEquals(2, atomicInteger.get());
    }

            

Reported by PMD.

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

Line: 72

              
        assertEquals(1, atomicInteger.get());

        Completable.fromSupplier(supplier)
            .test()
            .assertResult();

        assertEquals(2, atomicInteger.get());
    }

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 76

                          .test()
            .assertResult();

        assertEquals(2, atomicInteger.get());
    }

    @Test
    public void fromSupplierInvokesLazy() {
        final AtomicInteger atomicInteger = new AtomicInteger();

            

Reported by PMD.

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

Line: 80

                  }

    @Test
    public void fromSupplierInvokesLazy() {
        final AtomicInteger atomicInteger = new AtomicInteger();

        Completable completable = Completable.fromSupplier(new Supplier<Object>() {
            @Override
            public Object get() throws Exception {

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 91

                          }
        });

        assertEquals(0, atomicInteger.get());

        completable
            .test()
            .assertResult();


            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableToSingleTest.java
27 issues
Potential violation of Law of Demeter (method chain calls)
Design

Line: 29

                  @Test
    public void justSingleItemObservable() {
        TestSubscriber<String> subscriber = TestSubscriber.create();
        Single<String> single = Flowable.just("Hello World!").single("");
        single.toFlowable().subscribe(subscriber);

        subscriber.assertResult("Hello World!");
    }


            

Reported by PMD.

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

Line: 30

                  public void justSingleItemObservable() {
        TestSubscriber<String> subscriber = TestSubscriber.create();
        Single<String> single = Flowable.just("Hello World!").single("");
        single.toFlowable().subscribe(subscriber);

        subscriber.assertResult("Hello World!");
    }

    @Test

            

Reported by PMD.

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

Line: 30

                  public void justSingleItemObservable() {
        TestSubscriber<String> subscriber = TestSubscriber.create();
        Single<String> single = Flowable.just("Hello World!").single("");
        single.toFlowable().subscribe(subscriber);

        subscriber.assertResult("Hello World!");
    }

    @Test

            

Reported by PMD.

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

Line: 32

                      Single<String> single = Flowable.just("Hello World!").single("");
        single.toFlowable().subscribe(subscriber);

        subscriber.assertResult("Hello World!");
    }

    @Test
    public void errorObservable() {
        TestSubscriber<String> subscriber = TestSubscriber.create();

            

Reported by PMD.

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

Line: 39

                  public void errorObservable() {
        TestSubscriber<String> subscriber = TestSubscriber.create();
        IllegalArgumentException error = new IllegalArgumentException("Error");
        Single<String> single = Flowable.<String>error(error).single("");
        single.toFlowable().subscribe(subscriber);

        subscriber.assertError(error);
    }


            

Reported by PMD.

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

Line: 39

                  public void errorObservable() {
        TestSubscriber<String> subscriber = TestSubscriber.create();
        IllegalArgumentException error = new IllegalArgumentException("Error");
        Single<String> single = Flowable.<String>error(error).single("");
        single.toFlowable().subscribe(subscriber);

        subscriber.assertError(error);
    }


            

Reported by PMD.

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

Line: 40

                      TestSubscriber<String> subscriber = TestSubscriber.create();
        IllegalArgumentException error = new IllegalArgumentException("Error");
        Single<String> single = Flowable.<String>error(error).single("");
        single.toFlowable().subscribe(subscriber);

        subscriber.assertError(error);
    }

    @Test

            

Reported by PMD.

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

Line: 40

                      TestSubscriber<String> subscriber = TestSubscriber.create();
        IllegalArgumentException error = new IllegalArgumentException("Error");
        Single<String> single = Flowable.<String>error(error).single("");
        single.toFlowable().subscribe(subscriber);

        subscriber.assertError(error);
    }

    @Test

            

Reported by PMD.

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

Line: 42

                      Single<String> single = Flowable.<String>error(error).single("");
        single.toFlowable().subscribe(subscriber);

        subscriber.assertError(error);
    }

    @Test
    public void justTwoEmissionsObservableThrowsError() {
        TestSubscriber<String> subscriber = TestSubscriber.create();

            

Reported by PMD.

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

Line: 48

                  @Test
    public void justTwoEmissionsObservableThrowsError() {
        TestSubscriber<String> subscriber = TestSubscriber.create();
        Single<String> single = Flowable.just("First", "Second").single("");
        single.toFlowable().subscribe(subscriber);

        subscriber.assertError(IllegalArgumentException.class);
    }


            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/subscriptions/DeferredScalarSubscriptionTest.java
27 issues
JUnit assertions should include a message
Design

Line: 31

                  public void queueSubscriptionSyncRejected() {
        DeferredScalarSubscription<Integer> ds = new DeferredScalarSubscription<>(new TestSubscriber<>());

        assertEquals(QueueFuseable.NONE, ds.requestFusion(QueueFuseable.SYNC));
    }

    @Test
    public void clear() {
        DeferredScalarSubscription<Integer> ds = new DeferredScalarSubscription<>(new TestSubscriber<>());

            

Reported by PMD.

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

Line: 35

                  }

    @Test
    public void clear() {
        DeferredScalarSubscription<Integer> ds = new DeferredScalarSubscription<>(new TestSubscriber<>());

        ds.value = 1;

        ds.clear();

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 42

              
        ds.clear();

        assertEquals(DeferredScalarSubscription.FUSED_CONSUMED, ds.get());
        assertNull(ds.value);
    }

    @Test
    public void cancel() {

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 43

                      ds.clear();

        assertEquals(DeferredScalarSubscription.FUSED_CONSUMED, ds.get());
        assertNull(ds.value);
    }

    @Test
    public void cancel() {
        DeferredScalarSubscription<Integer> ds = new DeferredScalarSubscription<>(new TestSubscriber<>());

            

Reported by PMD.

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

Line: 47

                  }

    @Test
    public void cancel() {
        DeferredScalarSubscription<Integer> ds = new DeferredScalarSubscription<>(new TestSubscriber<>());

        assertTrue(ds.tryCancel());

        assertFalse(ds.tryCancel());

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 50

                  public void cancel() {
        DeferredScalarSubscription<Integer> ds = new DeferredScalarSubscription<>(new TestSubscriber<>());

        assertTrue(ds.tryCancel());

        assertFalse(ds.tryCancel());
    }

    @Test

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 52

              
        assertTrue(ds.tryCancel());

        assertFalse(ds.tryCancel());
    }

    @Test
    public void completeCancelRace() {
        for (int i = 0; i < TestHelper.RACE_DEFAULT_LOOPS; i++) {

            

Reported by PMD.

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

Line: 56

                  }

    @Test
    public void completeCancelRace() {
        for (int i = 0; i < TestHelper.RACE_DEFAULT_LOOPS; i++) {
            final DeferredScalarSubscription<Integer> ds = new DeferredScalarSubscription<>(new TestSubscriber<>());

            Runnable r1 = new Runnable() {
                @Override

            

Reported by PMD.

Avoid instantiating new objects inside loops
Performance

Line: 58

                  @Test
    public void completeCancelRace() {
        for (int i = 0; i < TestHelper.RACE_DEFAULT_LOOPS; i++) {
            final DeferredScalarSubscription<Integer> ds = new DeferredScalarSubscription<>(new TestSubscriber<>());

            Runnable r1 = new Runnable() {
                @Override
                public void run() {
                    ds.complete(1);

            

Reported by PMD.

Avoid instantiating new objects inside loops
Performance

Line: 58

                  @Test
    public void completeCancelRace() {
        for (int i = 0; i < TestHelper.RACE_DEFAULT_LOOPS; i++) {
            final DeferredScalarSubscription<Integer> ds = new DeferredScalarSubscription<>(new TestSubscriber<>());

            Runnable r1 = new Runnable() {
                @Override
                public void run() {
                    ds.complete(1);

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/validators/CatchThrowIfFatalCheck.java
27 issues
System.out.println is used
Design

Line: 36

                  public void check() throws Exception {
        File f = TestHelper.findSource("Flowable");
        if (f == null) {
            System.out.println("Unable to find sources of RxJava");
            return;
        }

        Queue<File> dirs = new ArrayDeque<>();


            

Reported by PMD.

System.out.println is used
Design

Line: 92

              
        if (errors != 0) {
            fail.insert(0, "Found " + errors + " cases\n");
            System.out.println(fail);
            throw new AssertionError(fail.toString());
        }
    }
}

            

Reported by PMD.

The class 'CatchThrowIfFatalCheck' has a Standard Cyclomatic Complexity of 11 (Highest = 10).
Design

Line: 30

               * or {@code fail} call.
 * @since 3.0.0
 */
public class CatchThrowIfFatalCheck {

    @Test
    public void check() throws Exception {
        File f = TestHelper.findSource("Flowable");
        if (f == null) {

            

Reported by PMD.

The class 'CatchThrowIfFatalCheck' has a Modified Cyclomatic Complexity of 11 (Highest = 10).
Design

Line: 30

               * or {@code fail} call.
 * @since 3.0.0
 */
public class CatchThrowIfFatalCheck {

    @Test
    public void check() throws Exception {
        File f = TestHelper.findSource("Flowable");
        if (f == null) {

            

Reported by PMD.

The method 'check' has a Modified Cyclomatic Complexity of 10.
Design

Line: 33

              public class CatchThrowIfFatalCheck {

    @Test
    public void check() throws Exception {
        File f = TestHelper.findSource("Flowable");
        if (f == null) {
            System.out.println("Unable to find sources of RxJava");
            return;
        }

            

Reported by PMD.

The method 'check' has a Standard Cyclomatic Complexity of 10.
Design

Line: 33

              public class CatchThrowIfFatalCheck {

    @Test
    public void check() throws Exception {
        File f = TestHelper.findSource("Flowable");
        if (f == null) {
            System.out.println("Unable to find sources of RxJava");
            return;
        }

            

Reported by PMD.

The method 'check()' has a cyclomatic complexity of 14.
Design

Line: 33

              public class CatchThrowIfFatalCheck {

    @Test
    public void check() throws Exception {
        File f = TestHelper.findSource("Flowable");
        if (f == null) {
            System.out.println("Unable to find sources of RxJava");
            return;
        }

            

Reported by PMD.

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

Line: 33

              public class CatchThrowIfFatalCheck {

    @Test
    public void check() throws Exception {
        File f = TestHelper.findSource("Flowable");
        if (f == null) {
            System.out.println("Unable to find sources of RxJava");
            return;
        }

            

Reported by PMD.

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

Line: 45

                      StringBuilder fail = new StringBuilder();
        int errors = 0;

        File parent = f.getParentFile().getParentFile();

        dirs.offer(new File(parent.getAbsolutePath().replace('\\', '/')));

        while (!dirs.isEmpty()) {
            f = dirs.poll();

            

Reported by PMD.

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

Line: 45

                      StringBuilder fail = new StringBuilder();
        int errors = 0;

        File parent = f.getParentFile().getParentFile();

        dirs.offer(new File(parent.getAbsolutePath().replace('\\', '/')));

        while (!dirs.isEmpty()) {
            f = dirs.poll();

            

Reported by PMD.