The following issues were found

src/test/java/io/reactivex/rxjava3/validators/InternalWrongNaming.java
60 issues
Avoid instantiating FileInputStream, FileOutputStream, FileReader, or FileWriter
Performance

Line: 86

                  static List<String> readFile(File u) throws Exception {
        List<String> lines = new ArrayList<>();

        BufferedReader in = new BufferedReader(new FileReader(u));
        try {
            for (;;) {
                String line = in.readLine();
                if (line == null) {
                    break;

            

Reported by PMD.

System.out.println is used
Design

Line: 73

                          }

            if (fail.length() != 0) {
                System.out.println(fail);

                System.out.println();
                System.out.println("Total: " + count);
                throw new AssertionError(fail.toString());
            }

            

Reported by PMD.

System.out.println is used
Design

Line: 75

                          if (fail.length() != 0) {
                System.out.println(fail);

                System.out.println();
                System.out.println("Total: " + count);
                throw new AssertionError(fail.toString());
            }

        }

            

Reported by PMD.

System.out.println is used
Design

Line: 76

                              System.out.println(fail);

                System.out.println();
                System.out.println("Total: " + count);
                throw new AssertionError(fail.toString());
            }

        }
    }

            

Reported by PMD.

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

Line: 26

              /**
 * Adds license header to java files.
 */
public class InternalWrongNaming {

    static void checkInternalOperatorNaming(String baseClassName, String consumerClassName, String... ignore) throws Exception {
        File f = TestHelper.findSource(baseClassName);
        if (f == null) {
            return;

            

Reported by PMD.

This class has too many methods, consider refactoring it.
Design

Line: 26

              /**
 * Adds license header to java files.
 */
public class InternalWrongNaming {

    static void checkInternalOperatorNaming(String baseClassName, String consumerClassName, String... ignore) throws Exception {
        File f = TestHelper.findSource(baseClassName);
        if (f == null) {
            return;

            

Reported by PMD.

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

Line: 26

              /**
 * Adds license header to java files.
 */
public class InternalWrongNaming {

    static void checkInternalOperatorNaming(String baseClassName, String consumerClassName, String... ignore) throws Exception {
        File f = TestHelper.findSource(baseClassName);
        if (f == null) {
            return;

            

Reported by PMD.

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

Line: 28

               */
public class InternalWrongNaming {

    static void checkInternalOperatorNaming(String baseClassName, String consumerClassName, String... ignore) throws Exception {
        File f = TestHelper.findSource(baseClassName);
        if (f == null) {
            return;
        }


            

Reported by PMD.

The method 'checkInternalOperatorNaming(String, String, String...)' has a cyclomatic complexity of 12.
Design

Line: 28

               */
public class InternalWrongNaming {

    static void checkInternalOperatorNaming(String baseClassName, String consumerClassName, String... ignore) throws Exception {
        File f = TestHelper.findSource(baseClassName);
        if (f == null) {
            return;
        }


            

Reported by PMD.

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

Line: 28

               */
public class InternalWrongNaming {

    static void checkInternalOperatorNaming(String baseClassName, String consumerClassName, String... ignore) throws Exception {
        File f = TestHelper.findSource(baseClassName);
        if (f == null) {
            return;
        }


            

Reported by PMD.

src/main/java/io/reactivex/rxjava3/processors/MulticastProcessor.java
60 issues
The class 'MulticastProcessor' has a Modified Cyclomatic Complexity of 4 (Highest = 28).
Design

Line: 133

               */
@BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.NONE)
public final class MulticastProcessor<@NonNull T> extends FlowableProcessor<T> {

    final AtomicInteger wip;

    final AtomicReference<Subscription> upstream;


            

Reported by PMD.

This class has too many methods, consider refactoring it.
Design

Line: 133

               */
@BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.NONE)
public final class MulticastProcessor<@NonNull T> extends FlowableProcessor<T> {

    final AtomicInteger wip;

    final AtomicReference<Subscription> upstream;


            

Reported by PMD.

The class 'MulticastProcessor' has a total cyclomatic complexity of 81 (highest 30).
Design

Line: 133

               */
@BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.NONE)
public final class MulticastProcessor<@NonNull T> extends FlowableProcessor<T> {

    final AtomicInteger wip;

    final AtomicReference<Subscription> upstream;


            

Reported by PMD.

The class 'MulticastProcessor' has a Standard Cyclomatic Complexity of 4 (Highest = 28).
Design

Line: 133

               */
@BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.NONE)
public final class MulticastProcessor<@NonNull T> extends FlowableProcessor<T> {

    final AtomicInteger wip;

    final AtomicReference<Subscription> upstream;


            

Reported by PMD.

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

Line: 135

              @SchedulerSupport(SchedulerSupport.NONE)
public final class MulticastProcessor<@NonNull T> extends FlowableProcessor<T> {

    final AtomicInteger wip;

    final AtomicReference<Subscription> upstream;

    final AtomicReference<MulticastSubscription<T>[]> subscribers;


            

Reported by PMD.

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

Line: 137

              
    final AtomicInteger wip;

    final AtomicReference<Subscription> upstream;

    final AtomicReference<MulticastSubscription<T>[]> subscribers;

    final int bufferSize;


            

Reported by PMD.

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

Line: 139

              
    final AtomicReference<Subscription> upstream;

    final AtomicReference<MulticastSubscription<T>[]> subscribers;

    final int bufferSize;

    final int limit;


            

Reported by PMD.

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

Line: 141

              
    final AtomicReference<MulticastSubscription<T>[]> subscribers;

    final int bufferSize;

    final int limit;

    final boolean refcount;


            

Reported by PMD.

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

Line: 143

              
    final int bufferSize;

    final int limit;

    final boolean refcount;

    volatile SimpleQueue<T> queue;


            

Reported by PMD.

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

Line: 145

              
    final int limit;

    final boolean refcount;

    volatile SimpleQueue<T> queue;

    volatile boolean done;
    volatile Throwable error;

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/maybe/MaybeZipArrayTest.java
59 issues
This class has too many methods, consider refactoring it.
Design

Line: 35

              import io.reactivex.rxjava3.subjects.MaybeSubject;
import io.reactivex.rxjava3.testsupport.TestHelper;

public class MaybeZipArrayTest extends RxJavaTest {

    final BiFunction<Object, Object, Object> addString = new BiFunction<Object, Object, Object>() {
        @Override
        public Object apply(Object a, Object b) throws Exception {
            return "" + a + b;

            

Reported by PMD.

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

Line: 37

              
public class MaybeZipArrayTest extends RxJavaTest {

    final BiFunction<Object, Object, Object> addString = new BiFunction<Object, Object, Object>() {
        @Override
        public Object apply(Object a, Object b) throws Exception {
            return "" + a + b;
        }
    };

            

Reported by PMD.

Do not add empty strings
Performance

Line: 40

                  final BiFunction<Object, Object, Object> addString = new BiFunction<Object, Object, Object>() {
        @Override
        public Object apply(Object a, Object b) throws Exception {
            return "" + a + b;
        }
    };

    final Function3<Object, Object, Object, Object> addString3 = new Function3<Object, Object, Object, Object>() {
        @Override

            

Reported by PMD.

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

Line: 44

                      }
    };

    final Function3<Object, Object, Object, Object> addString3 = new Function3<Object, Object, Object, Object>() {
        @Override
        public Object apply(Object a, Object b, Object c) throws Exception {
            return "" + a + b + c;
        }
    };

            

Reported by PMD.

Do not add empty strings
Performance

Line: 47

                  final Function3<Object, Object, Object, Object> addString3 = new Function3<Object, Object, Object, Object>() {
        @Override
        public Object apply(Object a, Object b, Object c) throws Exception {
            return "" + a + b + c;
        }
    };

    @Test
    public void firstError() {

            

Reported by PMD.

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

Line: 52

                  };

    @Test
    public void firstError() {
        Maybe.zip(Maybe.error(new TestException()), Maybe.just(1), addString)
        .test()
        .assertFailure(TestException.class);
    }


            

Reported by PMD.

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

Line: 59

                  }

    @Test
    public void secondError() {
        Maybe.zip(Maybe.just(1), Maybe.<Integer>error(new TestException()), addString)
        .test()
        .assertFailure(TestException.class);
    }


            

Reported by PMD.

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

Line: 66

                  }

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

        TestObserver<Object> to = Maybe.zip(pp.singleElement(), pp.singleElement(), addString)
        .test();


            

Reported by PMD.

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

Line: 69

                  public void dispose() {
        PublishProcessor<Integer> pp = PublishProcessor.create();

        TestObserver<Object> to = Maybe.zip(pp.singleElement(), pp.singleElement(), addString)
        .test();

        assertTrue(pp.hasSubscribers());

        to.dispose();

            

Reported by PMD.

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

Line: 69

                  public void dispose() {
        PublishProcessor<Integer> pp = PublishProcessor.create();

        TestObserver<Object> to = Maybe.zip(pp.singleElement(), pp.singleElement(), addString)
        .test();

        assertTrue(pp.hasSubscribers());

        to.dispose();

            

Reported by PMD.

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

Line: 41

              extends Flowable<R> {

    @Nullable
    final Publisher<? extends T>[] array;

    @Nullable
    final Iterable<? extends Publisher<? extends T>> iterable;

    final Function<? super Object[], ? extends R> combiner;

            

Reported by PMD.

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

Line: 44

                  final Publisher<? extends T>[] array;

    @Nullable
    final Iterable<? extends Publisher<? extends T>> iterable;

    final Function<? super Object[], ? extends R> combiner;

    final int bufferSize;


            

Reported by PMD.

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

Line: 46

                  @Nullable
    final Iterable<? extends Publisher<? extends T>> iterable;

    final Function<? super Object[], ? extends R> combiner;

    final int bufferSize;

    final boolean delayErrors;


            

Reported by PMD.

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

Line: 48

              
    final Function<? super Object[], ? extends R> combiner;

    final int bufferSize;

    final boolean delayErrors;

    public FlowableCombineLatest(@NonNull Publisher<? extends T>[] array,
                    @NonNull Function<? super Object[], ? extends R> combiner,

            

Reported by PMD.

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

Line: 50

              
    final int bufferSize;

    final boolean delayErrors;

    public FlowableCombineLatest(@NonNull Publisher<? extends T>[] array,
                    @NonNull Function<? super Object[], ? extends R> combiner,
                    int bufferSize, boolean delayErrors) {
        this.array = array;

            

Reported by PMD.

The user-supplied array 'array' is stored directly.
Design

Line: 52

              
    final boolean delayErrors;

    public FlowableCombineLatest(@NonNull Publisher<? extends T>[] array,
                    @NonNull Function<? super Object[], ? extends R> combiner,
                    int bufferSize, boolean delayErrors) {
        this.array = array;
        this.iterable = null;
        this.combiner = combiner;

            

Reported by PMD.

Assigning an Object to null is a code smell. Consider refactoring.
Error

Line: 56

                                  @NonNull Function<? super Object[], ? extends R> combiner,
                    int bufferSize, boolean delayErrors) {
        this.array = array;
        this.iterable = null;
        this.combiner = combiner;
        this.bufferSize = bufferSize;
        this.delayErrors = delayErrors;
    }


            

Reported by PMD.

Assigning an Object to null is a code smell. Consider refactoring.
Error

Line: 65

                  public FlowableCombineLatest(@NonNull Iterable<? extends Publisher<? extends T>> iterable,
                    @NonNull Function<? super Object[], ? extends R> combiner,
                    int bufferSize, boolean delayErrors) {
        this.array = null;
        this.iterable = iterable;
        this.combiner = combiner;
        this.bufferSize = bufferSize;
        this.delayErrors = delayErrors;
    }

            

Reported by PMD.

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

Line: 72

                      this.delayErrors = delayErrors;
    }

    @SuppressWarnings("unchecked")
    @Override
    public void subscribeActual(Subscriber<? super R> s) {
        Publisher<? extends T>[] sources = array;
        int count;
        if (sources == null) {

            

Reported by PMD.

Avoid instantiating new objects inside loops
Performance

Line: 84

                          try {
                for (Publisher<? extends T> p : iterable) {
                    if (count == sources.length) {
                        Publisher<? extends T>[] b = new Publisher[count + (count >> 2)];
                        System.arraycopy(sources, 0, b, 0, count);
                        sources = b;
                    }
                    sources[count++] = Objects.requireNonNull(p, "The Iterator returned a null Publisher");
                }

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableAllTest.java
59 issues
This class has a bunch of public methods and attributes
Design

Line: 14

               * the License for the specific language governing permissions and limitations under the License.
 */

package io.reactivex.rxjava3.internal.operators.flowable;

import static org.junit.Assert.*;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.*;


            

Reported by PMD.

This class has too many methods, consider refactoring it.
Design

Line: 36

              import io.reactivex.rxjava3.subscribers.TestSubscriber;
import io.reactivex.rxjava3.testsupport.*;

public class FlowableAllTest extends RxJavaTest {

    @Test
    public void all() {
        Flowable<String> obs = Flowable.just("one", "two", "six");


            

Reported by PMD.

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

Line: 40

              
    @Test
    public void all() {
        Flowable<String> obs = Flowable.just("one", "two", "six");

        SingleObserver<Boolean> observer = TestHelper.mockSingleObserver();

        obs.all(new Predicate<String>() {
            @Override

            

Reported by PMD.

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

Line: 40

              
    @Test
    public void all() {
        Flowable<String> obs = Flowable.just("one", "two", "six");

        SingleObserver<Boolean> observer = TestHelper.mockSingleObserver();

        obs.all(new Predicate<String>() {
            @Override

            

Reported by PMD.

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

Line: 40

              
    @Test
    public void all() {
        Flowable<String> obs = Flowable.just("one", "two", "six");

        SingleObserver<Boolean> observer = TestHelper.mockSingleObserver();

        obs.all(new Predicate<String>() {
            @Override

            

Reported by PMD.

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

Line: 53

                      .subscribe(observer);

        verify(observer).onSubscribe((Disposable)any());
        verify(observer).onSuccess(true);
        verifyNoMoreInteractions(observer);
    }

    @Test
    public void notAll() {

            

Reported by PMD.

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

Line: 72

                      .subscribe(observer);

        verify(observer).onSubscribe((Disposable)any());
        verify(observer).onSuccess(false);
        verifyNoMoreInteractions(observer);
    }

    @Test
    public void empty() {

            

Reported by PMD.

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

Line: 91

                      .subscribe(observer);

        verify(observer).onSubscribe((Disposable)any());
        verify(observer).onSuccess(true);
        verifyNoMoreInteractions(observer);
    }

    @Test
    public void error() {

            

Reported by PMD.

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

Line: 111

                      .subscribe(observer);

        verify(observer).onSubscribe((Disposable)any());
        verify(observer).onError(error);
        verifyNoMoreInteractions(observer);
    }

    @Test
    public void followingFirst() {

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 125

                          }
        });

        assertFalse(allOdd.blockingGet());
    }

    @Test
    public void issue1935NoUnsubscribeDownstream() {
        Flowable<Integer> source = Flowable.just(1)

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/jdk8/SingleToCompletionStageTest.java
59 issues
A method/constructor should not explicitly throw java.lang.Exception
Design

Line: 31

              public class SingleToCompletionStageTest extends RxJavaTest {

    @Test
    public void just() throws Exception {
        Integer v = Single.just(1)
                .toCompletionStage()
                .toCompletableFuture()
                .get();


            

Reported by PMD.

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

Line: 32

              
    @Test
    public void just() throws Exception {
        Integer v = Single.just(1)
                .toCompletionStage()
                .toCompletableFuture()
                .get();

        assertEquals((Integer)1, v);

            

Reported by PMD.

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

Line: 32

              
    @Test
    public void just() throws Exception {
        Integer v = Single.just(1)
                .toCompletionStage()
                .toCompletableFuture()
                .get();

        assertEquals((Integer)1, v);

            

Reported by PMD.

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

Line: 32

              
    @Test
    public void just() throws Exception {
        Integer v = Single.just(1)
                .toCompletionStage()
                .toCompletableFuture()
                .get();

        assertEquals((Integer)1, v);

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 37

                              .toCompletableFuture()
                .get();

        assertEquals((Integer)1, v);
    }

    @Test
    public void completableFutureCancels() throws Exception {
        SingleSubject<Integer> source = SingleSubject.create();

            

Reported by PMD.

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

Line: 41

                  }

    @Test
    public void completableFutureCancels() throws Exception {
        SingleSubject<Integer> source = SingleSubject.create();

        CompletableFuture<Integer> cf = source
                .toCompletionStage()
                .toCompletableFuture();

            

Reported by PMD.

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

Line: 41

                  }

    @Test
    public void completableFutureCancels() throws Exception {
        SingleSubject<Integer> source = SingleSubject.create();

        CompletableFuture<Integer> cf = source
                .toCompletionStage()
                .toCompletableFuture();

            

Reported by PMD.

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

Line: 44

                  public void completableFutureCancels() throws Exception {
        SingleSubject<Integer> source = SingleSubject.create();

        CompletableFuture<Integer> cf = source
                .toCompletionStage()
                .toCompletableFuture();

        assertTrue(source.hasObservers());


            

Reported by PMD.

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

Line: 44

                  public void completableFutureCancels() throws Exception {
        SingleSubject<Integer> source = SingleSubject.create();

        CompletableFuture<Integer> cf = source
                .toCompletionStage()
                .toCompletableFuture();

        assertTrue(source.hasObservers());


            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 48

                              .toCompletionStage()
                .toCompletableFuture();

        assertTrue(source.hasObservers());

        cf.cancel(true);

        assertTrue(cf.isCancelled());


            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableDematerializeTest.java
59 issues
System.out.println is used
Design

Line: 146

                      TestObserverEx<Integer> to = new TestObserverEx<>(observer);
        dematerialize.subscribe(to);

        System.out.println(to.errors());

        verify(observer, never()).onError(any(Throwable.class));
        verify(observer, times(1)).onComplete();
        verify(observer, times(0)).onNext(any(Integer.class));
    }

            

Reported by PMD.

This class has too many methods, consider refactoring it.
Design

Line: 31

              import io.reactivex.rxjava3.plugins.RxJavaPlugins;
import io.reactivex.rxjava3.testsupport.*;

public class ObservableDematerializeTest extends RxJavaTest {

    @Test
    public void simpleSelector() {
        Observable<Notification<Integer>> notifications = Observable.just(1, 2).materialize();
        Observable<Integer> dematerialize = notifications.dematerialize(Functions.<Notification<Integer>>identity());

            

Reported by PMD.

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

Line: 35

              
    @Test
    public void simpleSelector() {
        Observable<Notification<Integer>> notifications = Observable.just(1, 2).materialize();
        Observable<Integer> dematerialize = notifications.dematerialize(Functions.<Notification<Integer>>identity());

        Observer<Integer> observer = TestHelper.mockObserver();

        dematerialize.subscribe(observer);

            

Reported by PMD.

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

Line: 36

                  @Test
    public void simpleSelector() {
        Observable<Notification<Integer>> notifications = Observable.just(1, 2).materialize();
        Observable<Integer> dematerialize = notifications.dematerialize(Functions.<Notification<Integer>>identity());

        Observer<Integer> observer = TestHelper.mockObserver();

        dematerialize.subscribe(observer);


            

Reported by PMD.

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

Line: 40

              
        Observer<Integer> observer = TestHelper.mockObserver();

        dematerialize.subscribe(observer);

        verify(observer, times(1)).onNext(1);
        verify(observer, times(1)).onNext(2);
        verify(observer, times(1)).onComplete();
        verify(observer, never()).onError(any(Throwable.class));

            

Reported by PMD.

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

Line: 42

              
        dematerialize.subscribe(observer);

        verify(observer, times(1)).onNext(1);
        verify(observer, times(1)).onNext(2);
        verify(observer, times(1)).onComplete();
        verify(observer, never()).onError(any(Throwable.class));
    }


            

Reported by PMD.

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

Line: 43

                      dematerialize.subscribe(observer);

        verify(observer, times(1)).onNext(1);
        verify(observer, times(1)).onNext(2);
        verify(observer, times(1)).onComplete();
        verify(observer, never()).onError(any(Throwable.class));
    }

    @Test

            

Reported by PMD.

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

Line: 44

              
        verify(observer, times(1)).onNext(1);
        verify(observer, times(1)).onNext(2);
        verify(observer, times(1)).onComplete();
        verify(observer, never()).onError(any(Throwable.class));
    }

    @Test
    public void selectorCrash() {

            

Reported by PMD.

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

Line: 45

                      verify(observer, times(1)).onNext(1);
        verify(observer, times(1)).onNext(2);
        verify(observer, times(1)).onComplete();
        verify(observer, never()).onError(any(Throwable.class));
    }

    @Test
    public void selectorCrash() {
        Observable.just(1, 2)

            

Reported by PMD.

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

Line: 49

                  }

    @Test
    public void selectorCrash() {
        Observable.just(1, 2)
        .materialize()
        .dematerialize(new Function<Notification<Integer>, Notification<Object>>() {
            @Override
            public Notification<Object> apply(Notification<Integer> v) throws Exception {

            

Reported by PMD.

src/jmh/java/io/reactivex/rxjava3/core/CallableAsyncPerf.java
59 issues
The class 'CallableAsyncPerf' is suspected to be a Data Class (WOC=6.250%, NOPA=0, NOAM=15, WMC=16)
Design

Line: 30

              @OutputTimeUnit(TimeUnit.SECONDS)
@Fork(value = 1)
@State(Scope.Thread)
public class CallableAsyncPerf {

    Flowable<Integer> subscribeOnFlowable;

    Flowable<Integer> observeOnFlowable;


            

Reported by PMD.

This class has too many methods, consider refactoring it.
Design

Line: 30

              @OutputTimeUnit(TimeUnit.SECONDS)
@Fork(value = 1)
@State(Scope.Thread)
public class CallableAsyncPerf {

    Flowable<Integer> subscribeOnFlowable;

    Flowable<Integer> observeOnFlowable;


            

Reported by PMD.

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

Line: 32

              @State(Scope.Thread)
public class CallableAsyncPerf {

    Flowable<Integer> subscribeOnFlowable;

    Flowable<Integer> observeOnFlowable;

    Flowable<Integer> pipelineFlowable;


            

Reported by PMD.

Field subscribeOnFlowable has the same name as a method
Error

Line: 32

              @State(Scope.Thread)
public class CallableAsyncPerf {

    Flowable<Integer> subscribeOnFlowable;

    Flowable<Integer> observeOnFlowable;

    Flowable<Integer> pipelineFlowable;


            

Reported by PMD.

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

Line: 34

              
    Flowable<Integer> subscribeOnFlowable;

    Flowable<Integer> observeOnFlowable;

    Flowable<Integer> pipelineFlowable;

    Observable<Integer> subscribeOnObservable;


            

Reported by PMD.

Field observeOnFlowable has the same name as a method
Error

Line: 34

              
    Flowable<Integer> subscribeOnFlowable;

    Flowable<Integer> observeOnFlowable;

    Flowable<Integer> pipelineFlowable;

    Observable<Integer> subscribeOnObservable;


            

Reported by PMD.

Field pipelineFlowable has the same name as a method
Error

Line: 36

              
    Flowable<Integer> observeOnFlowable;

    Flowable<Integer> pipelineFlowable;

    Observable<Integer> subscribeOnObservable;

    Observable<Integer> observeOnObservable;


            

Reported by PMD.

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

Line: 36

              
    Flowable<Integer> observeOnFlowable;

    Flowable<Integer> pipelineFlowable;

    Observable<Integer> subscribeOnObservable;

    Observable<Integer> observeOnObservable;


            

Reported by PMD.

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

Line: 38

              
    Flowable<Integer> pipelineFlowable;

    Observable<Integer> subscribeOnObservable;

    Observable<Integer> observeOnObservable;

    Observable<Integer> pipelineObservable;


            

Reported by PMD.

Field subscribeOnObservable has the same name as a method
Error

Line: 38

              
    Flowable<Integer> pipelineFlowable;

    Observable<Integer> subscribeOnObservable;

    Observable<Integer> observeOnObservable;

    Observable<Integer> pipelineObservable;


            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/jdk8/CompletableToCompletionStageTest.java
59 issues
A method/constructor should not explicitly throw java.lang.Exception
Design

Line: 31

              public class CompletableToCompletionStageTest extends RxJavaTest {

    @Test
    public void complete() throws Exception {
        Object v = Completable.complete()
                .toCompletionStage(null)
                .toCompletableFuture()
                .get();


            

Reported by PMD.

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

Line: 32

              
    @Test
    public void complete() throws Exception {
        Object v = Completable.complete()
                .toCompletionStage(null)
                .toCompletableFuture()
                .get();

        assertNull(v);

            

Reported by PMD.

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

Line: 32

              
    @Test
    public void complete() throws Exception {
        Object v = Completable.complete()
                .toCompletionStage(null)
                .toCompletableFuture()
                .get();

        assertNull(v);

            

Reported by PMD.

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

Line: 32

              
    @Test
    public void complete() throws Exception {
        Object v = Completable.complete()
                .toCompletionStage(null)
                .toCompletableFuture()
                .get();

        assertNull(v);

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 37

                              .toCompletableFuture()
                .get();

        assertNull(v);
    }

    @Test
    public void completableFutureCancels() throws Exception {
        CompletableSubject source = CompletableSubject.create();

            

Reported by PMD.

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

Line: 41

                  }

    @Test
    public void completableFutureCancels() throws Exception {
        CompletableSubject source = CompletableSubject.create();

        CompletableFuture<Object> cf = source
                .toCompletionStage(null)
                .toCompletableFuture();

            

Reported by PMD.

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

Line: 41

                  }

    @Test
    public void completableFutureCancels() throws Exception {
        CompletableSubject source = CompletableSubject.create();

        CompletableFuture<Object> cf = source
                .toCompletionStage(null)
                .toCompletableFuture();

            

Reported by PMD.

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

Line: 44

                  public void completableFutureCancels() throws Exception {
        CompletableSubject source = CompletableSubject.create();

        CompletableFuture<Object> cf = source
                .toCompletionStage(null)
                .toCompletableFuture();

        assertTrue(source.hasObservers());


            

Reported by PMD.

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

Line: 44

                  public void completableFutureCancels() throws Exception {
        CompletableSubject source = CompletableSubject.create();

        CompletableFuture<Object> cf = source
                .toCompletionStage(null)
                .toCompletableFuture();

        assertTrue(source.hasObservers());


            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 48

                              .toCompletionStage(null)
                .toCompletableFuture();

        assertTrue(source.hasObservers());

        cf.cancel(true);

        assertTrue(cf.isCancelled());


            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableSkipTest.java
59 issues
Potential violation of Law of Demeter (method chain calls)
Design

Line: 33

                  @Test(expected = IllegalArgumentException.class)
    public void skipNegativeElements() {

        Observable<String> skip = Observable.just("one", "two", "three").skip(-99);

        Observer<String> observer = TestHelper.mockObserver();
        skip.subscribe(observer);
        verify(observer, times(1)).onNext("one");
        verify(observer, times(1)).onNext("two");

            

Reported by PMD.

The String literal 'two' appears 9 times in this file; the first occurrence is on line 33
Error

Line: 33

                  @Test(expected = IllegalArgumentException.class)
    public void skipNegativeElements() {

        Observable<String> skip = Observable.just("one", "two", "three").skip(-99);

        Observer<String> observer = TestHelper.mockObserver();
        skip.subscribe(observer);
        verify(observer, times(1)).onNext("one");
        verify(observer, times(1)).onNext("two");

            

Reported by PMD.

The String literal 'three' appears 9 times in this file; the first occurrence is on line 33
Error

Line: 33

                  @Test(expected = IllegalArgumentException.class)
    public void skipNegativeElements() {

        Observable<String> skip = Observable.just("one", "two", "three").skip(-99);

        Observer<String> observer = TestHelper.mockObserver();
        skip.subscribe(observer);
        verify(observer, times(1)).onNext("one");
        verify(observer, times(1)).onNext("two");

            

Reported by PMD.

The String literal 'one' appears 10 times in this file; the first occurrence is on line 33
Error

Line: 33

                  @Test(expected = IllegalArgumentException.class)
    public void skipNegativeElements() {

        Observable<String> skip = Observable.just("one", "two", "three").skip(-99);

        Observer<String> observer = TestHelper.mockObserver();
        skip.subscribe(observer);
        verify(observer, times(1)).onNext("one");
        verify(observer, times(1)).onNext("two");

            

Reported by PMD.

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

Line: 36

                      Observable<String> skip = Observable.just("one", "two", "three").skip(-99);

        Observer<String> observer = TestHelper.mockObserver();
        skip.subscribe(observer);
        verify(observer, times(1)).onNext("one");
        verify(observer, times(1)).onNext("two");
        verify(observer, times(1)).onNext("three");
        verify(observer, never()).onError(any(Throwable.class));
        verify(observer, times(1)).onComplete();

            

Reported by PMD.

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

Line: 37

              
        Observer<String> observer = TestHelper.mockObserver();
        skip.subscribe(observer);
        verify(observer, times(1)).onNext("one");
        verify(observer, times(1)).onNext("two");
        verify(observer, times(1)).onNext("three");
        verify(observer, never()).onError(any(Throwable.class));
        verify(observer, times(1)).onComplete();
    }

            

Reported by PMD.

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

Line: 38

                      Observer<String> observer = TestHelper.mockObserver();
        skip.subscribe(observer);
        verify(observer, times(1)).onNext("one");
        verify(observer, times(1)).onNext("two");
        verify(observer, times(1)).onNext("three");
        verify(observer, never()).onError(any(Throwable.class));
        verify(observer, times(1)).onComplete();
    }


            

Reported by PMD.

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

Line: 39

                      skip.subscribe(observer);
        verify(observer, times(1)).onNext("one");
        verify(observer, times(1)).onNext("two");
        verify(observer, times(1)).onNext("three");
        verify(observer, never()).onError(any(Throwable.class));
        verify(observer, times(1)).onComplete();
    }

    @Test

            

Reported by PMD.

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

Line: 40

                      verify(observer, times(1)).onNext("one");
        verify(observer, times(1)).onNext("two");
        verify(observer, times(1)).onNext("three");
        verify(observer, never()).onError(any(Throwable.class));
        verify(observer, times(1)).onComplete();
    }

    @Test
    public void skipZeroElements() {

            

Reported by PMD.

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

Line: 41

                      verify(observer, times(1)).onNext("two");
        verify(observer, times(1)).onNext("three");
        verify(observer, never()).onError(any(Throwable.class));
        verify(observer, times(1)).onComplete();
    }

    @Test
    public void skipZeroElements() {


            

Reported by PMD.