The following issues were found

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

Line: 27

               * @param <T> the value type
 */
public class AppendOnlyLinkedArrayList<T> {
    final int capacity;
    final Object[] head;
    Object[] tail;
    int offset;

    /**

            

Reported by PMD.

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

Line: 28

               */
public class AppendOnlyLinkedArrayList<T> {
    final int capacity;
    final Object[] head;
    Object[] tail;
    int offset;

    /**
     * Constructs an empty list with a per-link capacity.

            

Reported by PMD.

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

Line: 29

              public class AppendOnlyLinkedArrayList<T> {
    final int capacity;
    final Object[] head;
    Object[] tail;
    int offset;

    /**
     * Constructs an empty list with a per-link capacity.
     * @param capacity the capacity of each link

            

Reported by PMD.

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

Line: 30

                  final int capacity;
    final Object[] head;
    Object[] tail;
    int offset;

    /**
     * Constructs an empty list with a per-link capacity.
     * @param capacity the capacity of each link
     */

            

Reported by PMD.

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

Line: 19

              import org.reactivestreams.Subscriber;

import io.reactivex.rxjava3.core.Observer;
import io.reactivex.rxjava3.functions.*;

/**
 * A linked-array-list implementation that only supports appending and consumption.
 *
 * @param <T> the value type

            

Reported by PMD.

Found 'DU'-anomaly for variable 'c' (lines '86'-'99').
Error

Line: 86

                  @SuppressWarnings("unchecked")
    public void forEachWhile(NonThrowingPredicate<? super T> consumer) {
        Object[] a = head;
        final int c = capacity;
        while (a != null) {
            for (int i = 0; i < c; i++) {
                Object o = a[i];
                if (o == null) {
                    break;

            

Reported by PMD.

Found 'DU'-anomaly for variable 'c' (lines '111'-'126').
Error

Line: 111

                   */
    public <U> boolean accept(Subscriber<? super U> subscriber) {
        Object[] a = head;
        final int c = capacity;
        while (a != null) {
            for (int i = 0; i < c; i++) {
                Object o = a[i];
                if (o == null) {
                    break;

            

Reported by PMD.

Found 'DU'-anomaly for variable 'c' (lines '138'-'153').
Error

Line: 138

                   */
    public <U> boolean accept(Observer<? super U> observer) {
        Object[] a = head;
        final int c = capacity;
        while (a != null) {
            for (int i = 0; i < c; i++) {
                Object o = a[i];
                if (o == null) {
                    break;

            

Reported by PMD.

Found 'DU'-anomaly for variable 'a' (lines '165'-'179').
Error

Line: 165

                   */
    @SuppressWarnings("unchecked")
    public <S> void forEachWhile(S state, BiPredicate<? super S, ? super T> consumer) throws Throwable {
        Object[] a = head;
        final int c = capacity;
        for (;;) {
            for (int i = 0; i < c; i++) {
                Object o = a[i];
                if (o == null) {

            

Reported by PMD.

Found 'DU'-anomaly for variable 'c' (lines '166'-'179').
Error

Line: 166

                  @SuppressWarnings("unchecked")
    public <S> void forEachWhile(S state, BiPredicate<? super S, ? super T> consumer) throws Throwable {
        Object[] a = head;
        final int c = capacity;
        for (;;) {
            for (int i = 0; i < c; i++) {
                Object o = a[i];
                if (o == null) {
                    return;

            

Reported by PMD.

src/main/java/io/reactivex/rxjava3/internal/operators/completable/CompletableCreate.java
11 issues
Avoid reassigning parameters such as 't'
Design

Line: 83

                      }

        @Override
        public boolean tryOnError(Throwable t) {
            if (t == null) {
                t = ExceptionHelper.createNullPointerException("onError called with a null Throwable.");
            }
            if (get() != DisposableHelper.DISPOSED) {
                Disposable d = getAndSet(DisposableHelper.DISPOSED);

            

Reported by PMD.

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

Line: 28

              
public final class CompletableCreate extends Completable {

    final CompletableOnSubscribe source;

    public CompletableCreate(CompletableOnSubscribe source) {
        this.source = source;
    }


            

Reported by PMD.

A catch statement should never catch throwable since it includes errors.
Error

Line: 41

              
        try {
            source.subscribe(parent);
        } catch (Throwable ex) {
            Exceptions.throwIfFatal(ex);
            parent.onError(ex);
        }
    }


            

Reported by PMD.

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

Line: 53

              
        private static final long serialVersionUID = -2467358622224974244L;

        final CompletableObserver downstream;

        Emitter(CompletableObserver downstream) {
            this.downstream = downstream;
        }


            

Reported by PMD.

Deeply nested if..then statements are hard to read
Design

Line: 67

                                  try {
                        downstream.onComplete();
                    } finally {
                        if (d != null) {
                            d.dispose();
                        }
                    }
                }
            }

            

Reported by PMD.

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

Line: 68

                                      downstream.onComplete();
                    } finally {
                        if (d != null) {
                            d.dispose();
                        }
                    }
                }
            }
        }

            

Reported by PMD.

Deeply nested if..then statements are hard to read
Design

Line: 93

                                  try {
                        downstream.onError(t);
                    } finally {
                        if (d != null) {
                            d.dispose();
                        }
                    }
                    return true;
                }

            

Reported by PMD.

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

Line: 94

                                      downstream.onError(t);
                    } finally {
                        if (d != null) {
                            d.dispose();
                        }
                    }
                    return true;
                }
            }

            

Reported by PMD.

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

Line: 125

              
        @Override
        public String toString() {
            return String.format("%s{%s}", getClass().getSimpleName(), super.toString());
        }
    }
}

            

Reported by PMD.

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

Line: 18

              
import java.util.concurrent.atomic.AtomicReference;

import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.disposables.Disposable;
import io.reactivex.rxjava3.exceptions.Exceptions;
import io.reactivex.rxjava3.functions.Cancellable;
import io.reactivex.rxjava3.internal.disposables.*;
import io.reactivex.rxjava3.internal.util.ExceptionHelper;

            

Reported by PMD.

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

Line: 38

              
    private static final long serialVersionUID = -6076952298809384986L;

    final Consumer<? super T> onSuccess;

    final Consumer<? super Throwable> onError;

    final Action onComplete;


            

Reported by PMD.

Field onSuccess has the same name as a method
Error

Line: 38

              
    private static final long serialVersionUID = -6076952298809384986L;

    final Consumer<? super T> onSuccess;

    final Consumer<? super Throwable> onError;

    final Action onComplete;


            

Reported by PMD.

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

Line: 40

              
    final Consumer<? super T> onSuccess;

    final Consumer<? super Throwable> onError;

    final Action onComplete;

    public MaybeCallbackObserver(Consumer<? super T> onSuccess, Consumer<? super Throwable> onError,
            Action onComplete) {

            

Reported by PMD.

Field onError has the same name as a method
Error

Line: 40

              
    final Consumer<? super T> onSuccess;

    final Consumer<? super Throwable> onError;

    final Action onComplete;

    public MaybeCallbackObserver(Consumer<? super T> onSuccess, Consumer<? super Throwable> onError,
            Action onComplete) {

            

Reported by PMD.

Field onComplete has the same name as a method
Error

Line: 42

              
    final Consumer<? super Throwable> onError;

    final Action onComplete;

    public MaybeCallbackObserver(Consumer<? super T> onSuccess, Consumer<? super Throwable> onError,
            Action onComplete) {
        super();
        this.onSuccess = onSuccess;

            

Reported by PMD.

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

Line: 42

              
    final Consumer<? super Throwable> onError;

    final Action onComplete;

    public MaybeCallbackObserver(Consumer<? super T> onSuccess, Consumer<? super Throwable> onError,
            Action onComplete) {
        super();
        this.onSuccess = onSuccess;

            

Reported by PMD.

A catch statement should never catch throwable since it includes errors.
Error

Line: 72

                      lazySet(DisposableHelper.DISPOSED);
        try {
            onSuccess.accept(value);
        } catch (Throwable ex) {
            Exceptions.throwIfFatal(ex);
            RxJavaPlugins.onError(ex);
        }
    }


            

Reported by PMD.

A catch statement should never catch throwable since it includes errors.
Error

Line: 83

                      lazySet(DisposableHelper.DISPOSED);
        try {
            onError.accept(e);
        } catch (Throwable ex) {
            Exceptions.throwIfFatal(ex);
            RxJavaPlugins.onError(new CompositeException(e, ex));
        }
    }


            

Reported by PMD.

A catch statement should never catch throwable since it includes errors.
Error

Line: 94

                      lazySet(DisposableHelper.DISPOSED);
        try {
            onComplete.run();
        } catch (Throwable ex) {
            Exceptions.throwIfFatal(ex);
            RxJavaPlugins.onError(ex);
        }
    }


            

Reported by PMD.

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

Line: 20

              
import io.reactivex.rxjava3.core.MaybeObserver;
import io.reactivex.rxjava3.disposables.Disposable;
import io.reactivex.rxjava3.exceptions.*;
import io.reactivex.rxjava3.functions.*;
import io.reactivex.rxjava3.internal.disposables.DisposableHelper;
import io.reactivex.rxjava3.internal.functions.Functions;
import io.reactivex.rxjava3.observers.LambdaConsumerIntrospection;
import io.reactivex.rxjava3.plugins.RxJavaPlugins;

            

Reported by PMD.

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

Line: 34

               */
public final class MaybeDelaySubscriptionOtherPublisher<T, U> extends AbstractMaybeWithUpstream<T, T> {

    final Publisher<U> other;

    public MaybeDelaySubscriptionOtherPublisher(MaybeSource<T> source, Publisher<U> other) {
        super(source);
        this.other = other;
    }

            

Reported by PMD.

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

Line: 47

                  }

    static final class OtherSubscriber<T> implements FlowableSubscriber<Object>, Disposable {
        final DelayMaybeObserver<T> main;

        MaybeSource<T> source;

        Subscription upstream;


            

Reported by PMD.

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

Line: 49

                  static final class OtherSubscriber<T> implements FlowableSubscriber<Object>, Disposable {
        final DelayMaybeObserver<T> main;

        MaybeSource<T> source;

        Subscription upstream;

        OtherSubscriber(MaybeObserver<? super T> actual, MaybeSource<T> source) {
            this.main = new DelayMaybeObserver<>(actual);

            

Reported by PMD.

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

Line: 51

              
        MaybeSource<T> source;

        Subscription upstream;

        OtherSubscriber(MaybeObserver<? super T> actual, MaybeSource<T> source) {
            this.main = new DelayMaybeObserver<>(actual);
            this.source = source;
        }

            

Reported by PMD.

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

Line: 63

                          if (SubscriptionHelper.validate(this.upstream, s)) {
                this.upstream = s;

                main.downstream.onSubscribe(this);

                s.request(Long.MAX_VALUE);
            }
        }


            

Reported by PMD.

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

Line: 84

                          if (upstream != SubscriptionHelper.CANCELLED) {
                upstream = SubscriptionHelper.CANCELLED;

                main.downstream.onError(t);
            } else {
                RxJavaPlugins.onError(t);
            }
        }


            

Reported by PMD.

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

Line: 101

              
        void subscribeNext() {
            MaybeSource<T> src = source;
            source = null;

            src.subscribe(main);
        }

        @Override

            

Reported by PMD.

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

Line: 103

                          MaybeSource<T> src = source;
            source = null;

            src.subscribe(main);
        }

        @Override
        public boolean isDisposed() {
            return DisposableHelper.isDisposed(main.get());

            

Reported by PMD.

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

Line: 124

              
        private static final long serialVersionUID = 706635022205076709L;

        final MaybeObserver<? super T> downstream;

        DelayMaybeObserver(MaybeObserver<? super T> downstream) {
            this.downstream = downstream;
        }


            

Reported by PMD.

Avoid unused imports such as 'org.reactivestreams'
Design

Line: 18

              
import java.util.concurrent.atomic.AtomicReference;

import org.reactivestreams.*;

import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.disposables.Disposable;
import io.reactivex.rxjava3.internal.disposables.DisposableHelper;
import io.reactivex.rxjava3.internal.subscriptions.SubscriptionHelper;

            

Reported by PMD.

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

Line: 27

              
public final class SingleFromPublisher<T> extends Single<T> {

    final Publisher<? extends T> publisher;

    public SingleFromPublisher(Publisher<? extends T> publisher) {
        this.publisher = publisher;
    }


            

Reported by PMD.

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

Line: 39

                  }

    static final class ToSingleObserver<T> implements FlowableSubscriber<T>, Disposable {
        final SingleObserver<? super T> downstream;

        Subscription upstream;

        T value;


            

Reported by PMD.

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

Line: 41

                  static final class ToSingleObserver<T> implements FlowableSubscriber<T>, Disposable {
        final SingleObserver<? super T> downstream;

        Subscription upstream;

        T value;

        boolean done;


            

Reported by PMD.

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

Line: 43

              
        Subscription upstream;

        T value;

        boolean done;

        volatile boolean disposed;


            

Reported by PMD.

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

Line: 45

              
        T value;

        boolean done;

        volatile boolean disposed;

        ToSingleObserver(SingleObserver<? super T> downstream) {
            this.downstream = downstream;

            

Reported by PMD.

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

Line: 47

              
        boolean done;

        volatile boolean disposed;

        ToSingleObserver(SingleObserver<? super T> downstream) {
            this.downstream = downstream;
        }


            

Reported by PMD.

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

Line: 72

                          if (value != null) {
                upstream.cancel();
                done = true;
                this.value = null;
                downstream.onError(new IndexOutOfBoundsException("Too many elements in the Publisher"));
            } else {
                value = t;
            }
        }

            

Reported by PMD.

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

Line: 86

                              return;
            }
            done = true;
            this.value = null;
            downstream.onError(t);
        }

        @Override
        public void onComplete() {

            

Reported by PMD.

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

Line: 97

                          }
            done = true;
            T v = this.value;
            this.value = null;
            if (v == null) {
                downstream.onError(new NoSuchElementException("The source Publisher is empty"));
            } else {
                downstream.onSuccess(v);
            }

            

Reported by PMD.

Avoid unused imports such as 'org.reactivestreams'
Design

Line: 18

              
import java.util.NoSuchElementException;

import org.reactivestreams.*;

import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.disposables.Disposable;
import io.reactivex.rxjava3.internal.subscriptions.SubscriptionHelper;
import io.reactivex.rxjava3.plugins.RxJavaPlugins;

            

Reported by PMD.

src/jmh/java/io/reactivex/rxjava3/xmapz/ObservableFlatMapMaybeEmptyPerf.java
11 issues
Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 33

              @State(Scope.Thread)
public class ObservableFlatMapMaybeEmptyPerf {
    @Param({ "1", "10", "100", "1000", "10000", "100000", "1000000" })
    public int count;

    Observable<Integer> observableConvert;

    Observable<Integer> observableDedicated;


            

Reported by PMD.

Field observableConvert has the same name as a method
Error

Line: 35

                  @Param({ "1", "10", "100", "1000", "10000", "100000", "1000000" })
    public int count;

    Observable<Integer> observableConvert;

    Observable<Integer> observableDedicated;

    Observable<Integer> observablePlain;


            

Reported by PMD.

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

Line: 35

                  @Param({ "1", "10", "100", "1000", "10000", "100000", "1000000" })
    public int count;

    Observable<Integer> observableConvert;

    Observable<Integer> observableDedicated;

    Observable<Integer> observablePlain;


            

Reported by PMD.

Field observableDedicated has the same name as a method
Error

Line: 37

              
    Observable<Integer> observableConvert;

    Observable<Integer> observableDedicated;

    Observable<Integer> observablePlain;

    @Setup
    public void setup() {

            

Reported by PMD.

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

Line: 37

              
    Observable<Integer> observableConvert;

    Observable<Integer> observableDedicated;

    Observable<Integer> observablePlain;

    @Setup
    public void setup() {

            

Reported by PMD.

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

Line: 39

              
    Observable<Integer> observableDedicated;

    Observable<Integer> observablePlain;

    @Setup
    public void setup() {
        Integer[] sourceArray = new Integer[count];
        Arrays.fill(sourceArray, 777);

            

Reported by PMD.

Field observablePlain has the same name as a method
Error

Line: 39

              
    Observable<Integer> observableDedicated;

    Observable<Integer> observablePlain;

    @Setup
    public void setup() {
        Integer[] sourceArray = new Integer[count];
        Arrays.fill(sourceArray, 777);

            

Reported by PMD.

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

Line: 58

                      observableConvert = source.flatMap(new Function<Integer, Observable<? extends Integer>>() {
            @Override
            public Observable<? extends Integer> apply(Integer v) {
                return Maybe.<Integer>empty().toObservable();
            }
        });

        observableDedicated = source.flatMapMaybe(new Function<Integer, Maybe<? extends Integer>>() {
            @Override

            

Reported by PMD.

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

Line: 58

                      observableConvert = source.flatMap(new Function<Integer, Observable<? extends Integer>>() {
            @Override
            public Observable<? extends Integer> apply(Integer v) {
                return Maybe.<Integer>empty().toObservable();
            }
        });

        observableDedicated = source.flatMapMaybe(new Function<Integer, Maybe<? extends Integer>>() {
            @Override

            

Reported by PMD.

Avoid unused imports such as 'org.openjdk.jmh.annotations'
Design

Line: 19

              import java.util.Arrays;
import java.util.concurrent.TimeUnit;

import org.openjdk.jmh.annotations.*;
import org.openjdk.jmh.infra.Blackhole;

import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.functions.Function;


            

Reported by PMD.

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

Line: 26

              import io.reactivex.rxjava3.internal.schedulers.TrampolineScheduler;

public final class ObservableIntervalRange extends Observable<Long> {
    final Scheduler scheduler;
    final long start;
    final long end;
    final long initialDelay;
    final long period;
    final TimeUnit unit;

            

Reported by PMD.

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

Line: 27

              
public final class ObservableIntervalRange extends Observable<Long> {
    final Scheduler scheduler;
    final long start;
    final long end;
    final long initialDelay;
    final long period;
    final TimeUnit unit;


            

Reported by PMD.

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

Line: 28

              public final class ObservableIntervalRange extends Observable<Long> {
    final Scheduler scheduler;
    final long start;
    final long end;
    final long initialDelay;
    final long period;
    final TimeUnit unit;

    public ObservableIntervalRange(long start, long end, long initialDelay, long period, TimeUnit unit, Scheduler scheduler) {

            

Reported by PMD.

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

Line: 29

                  final Scheduler scheduler;
    final long start;
    final long end;
    final long initialDelay;
    final long period;
    final TimeUnit unit;

    public ObservableIntervalRange(long start, long end, long initialDelay, long period, TimeUnit unit, Scheduler scheduler) {
        this.initialDelay = initialDelay;

            

Reported by PMD.

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

Line: 30

                  final long start;
    final long end;
    final long initialDelay;
    final long period;
    final TimeUnit unit;

    public ObservableIntervalRange(long start, long end, long initialDelay, long period, TimeUnit unit, Scheduler scheduler) {
        this.initialDelay = initialDelay;
        this.period = period;

            

Reported by PMD.

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

Line: 31

                  final long end;
    final long initialDelay;
    final long period;
    final TimeUnit unit;

    public ObservableIntervalRange(long start, long end, long initialDelay, long period, TimeUnit unit, Scheduler scheduler) {
        this.initialDelay = initialDelay;
        this.period = period;
        this.unit = unit;

            

Reported by PMD.

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

Line: 52

                      if (sch instanceof TrampolineScheduler) {
            Worker worker = sch.createWorker();
            is.setResource(worker);
            worker.schedulePeriodically(is, initialDelay, period, unit);
        } else {
            Disposable d = sch.schedulePeriodicallyDirect(is, initialDelay, period, unit);
            is.setResource(d);
        }
    }

            

Reported by PMD.

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

Line: 65

              
        private static final long serialVersionUID = 1891866368734007884L;

        final Observer<? super Long> downstream;
        final long end;

        long count;

        IntervalRangeObserver(Observer<? super Long> actual, long start, long end) {

            

Reported by PMD.

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

Line: 66

                      private static final long serialVersionUID = 1891866368734007884L;

        final Observer<? super Long> downstream;
        final long end;

        long count;

        IntervalRangeObserver(Observer<? super Long> actual, long start, long end) {
            this.downstream = actual;

            

Reported by PMD.

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

Line: 68

                      final Observer<? super Long> downstream;
        final long end;

        long count;

        IntervalRangeObserver(Observer<? super Long> actual, long start, long end) {
            this.downstream = actual;
            this.count = start;
            this.end = end;

            

Reported by PMD.

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

Line: 27

              import java.util.Objects;

public final class FlowableMap<T, U> extends AbstractFlowableWithUpstream<T, U> {
    final Function<? super T, ? extends U> mapper;
    public FlowableMap(Flowable<T> source, Function<? super T, ? extends U> mapper) {
        super(source);
        this.mapper = mapper;
    }


            

Reported by PMD.

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

Line: 43

                  }

    static final class MapSubscriber<T, U> extends BasicFuseableSubscriber<T, U> {
        final Function<? super T, ? extends U> mapper;

        MapSubscriber(Subscriber<? super U> actual, Function<? super T, ? extends U> mapper) {
            super(actual);
            this.mapper = mapper;
        }

            

Reported by PMD.

The String literal 'The mapper function returned a null value.' appears 5 times in this file; the first occurrence is on line 64
Error

Line: 64

                          U v;

            try {
                v = Objects.requireNonNull(mapper.apply(t), "The mapper function returned a null value.");
            } catch (Throwable ex) {
                fail(ex);
                return;
            }
            downstream.onNext(v);

            

Reported by PMD.

A catch statement should never catch throwable since it includes errors.
Error

Line: 65

              
            try {
                v = Objects.requireNonNull(mapper.apply(t), "The mapper function returned a null value.");
            } catch (Throwable ex) {
                fail(ex);
                return;
            }
            downstream.onNext(v);
        }

            

Reported by PMD.

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

Line: 86

                  }

    static final class MapConditionalSubscriber<T, U> extends BasicFuseableConditionalSubscriber<T, U> {
        final Function<? super T, ? extends U> mapper;

        MapConditionalSubscriber(ConditionalSubscriber<? super U> actual, Function<? super T, ? extends U> function) {
            super(actual);
            this.mapper = function;
        }

            

Reported by PMD.

A catch statement should never catch throwable since it includes errors.
Error

Line: 108

              
            try {
                v = Objects.requireNonNull(mapper.apply(t), "The mapper function returned a null value.");
            } catch (Throwable ex) {
                fail(ex);
                return;
            }
            downstream.onNext(v);
        }

            

Reported by PMD.

A catch statement should never catch throwable since it includes errors.
Error

Line: 130

              
            try {
                v = Objects.requireNonNull(mapper.apply(t), "The mapper function returned a null value.");
            } catch (Throwable ex) {
                fail(ex);
                return true;
            }
            return downstream.tryOnNext(v);
        }

            

Reported by PMD.

Avoid unused imports such as 'io.reactivex.rxjava3.internal.subscribers'
Design

Line: 22

              import io.reactivex.rxjava3.core.Flowable;
import io.reactivex.rxjava3.functions.Function;
import io.reactivex.rxjava3.internal.fuseable.ConditionalSubscriber;
import io.reactivex.rxjava3.internal.subscribers.*;

import java.util.Objects;

public final class FlowableMap<T, U> extends AbstractFlowableWithUpstream<T, U> {
    final Function<? super T, ? extends U> mapper;

            

Reported by PMD.

Found 'DU'-anomaly for variable 'v' (lines '64'-'70').
Error

Line: 64

                          U v;

            try {
                v = Objects.requireNonNull(mapper.apply(t), "The mapper function returned a null value.");
            } catch (Throwable ex) {
                fail(ex);
                return;
            }
            downstream.onNext(v);

            

Reported by PMD.

Found 'DU'-anomaly for variable 'v' (lines '107'-'113').
Error

Line: 107

                          U v;

            try {
                v = Objects.requireNonNull(mapper.apply(t), "The mapper function returned a null value.");
            } catch (Throwable ex) {
                fail(ex);
                return;
            }
            downstream.onNext(v);

            

Reported by PMD.

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

Line: 24

              import io.reactivex.rxjava3.plugins.RxJavaPlugins;

public final class ObservableElementAt<T> extends AbstractObservableWithUpstream<T, T> {
    final long index;
    final T defaultValue;
    final boolean errorOnFewer;

    public ObservableElementAt(ObservableSource<T> source, long index, T defaultValue, boolean errorOnFewer) {
        super(source);

            

Reported by PMD.

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

Line: 25

              
public final class ObservableElementAt<T> extends AbstractObservableWithUpstream<T, T> {
    final long index;
    final T defaultValue;
    final boolean errorOnFewer;

    public ObservableElementAt(ObservableSource<T> source, long index, T defaultValue, boolean errorOnFewer) {
        super(source);
        this.index = index;

            

Reported by PMD.

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

Line: 26

              public final class ObservableElementAt<T> extends AbstractObservableWithUpstream<T, T> {
    final long index;
    final T defaultValue;
    final boolean errorOnFewer;

    public ObservableElementAt(ObservableSource<T> source, long index, T defaultValue, boolean errorOnFewer) {
        super(source);
        this.index = index;
        this.defaultValue = defaultValue;

            

Reported by PMD.

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

Line: 41

                  }

    static final class ElementAtObserver<T> implements Observer<T>, Disposable {
        final Observer<? super T> downstream;
        final long index;
        final T defaultValue;
        final boolean errorOnFewer;

        Disposable upstream;

            

Reported by PMD.

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

Line: 42

              
    static final class ElementAtObserver<T> implements Observer<T>, Disposable {
        final Observer<? super T> downstream;
        final long index;
        final T defaultValue;
        final boolean errorOnFewer;

        Disposable upstream;


            

Reported by PMD.

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

Line: 43

                  static final class ElementAtObserver<T> implements Observer<T>, Disposable {
        final Observer<? super T> downstream;
        final long index;
        final T defaultValue;
        final boolean errorOnFewer;

        Disposable upstream;

        long count;

            

Reported by PMD.

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

Line: 44

                      final Observer<? super T> downstream;
        final long index;
        final T defaultValue;
        final boolean errorOnFewer;

        Disposable upstream;

        long count;


            

Reported by PMD.

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

Line: 46

                      final T defaultValue;
        final boolean errorOnFewer;

        Disposable upstream;

        long count;

        boolean done;


            

Reported by PMD.

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

Line: 48

              
        Disposable upstream;

        long count;

        boolean done;

        ElementAtObserver(Observer<? super T> actual, long index, T defaultValue, boolean errorOnFewer) {
            this.downstream = actual;

            

Reported by PMD.

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

Line: 50

              
        long count;

        boolean done;

        ElementAtObserver(Observer<? super T> actual, long index, T defaultValue, boolean errorOnFewer) {
            this.downstream = actual;
            this.index = index;
            this.defaultValue = defaultValue;

            

Reported by PMD.

src/jmh/java/io/reactivex/rxjava3/xmapz/ObservableSwitchMapMaybeEmptyPerf.java
11 issues
Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 33

              @State(Scope.Thread)
public class ObservableSwitchMapMaybeEmptyPerf {
    @Param({ "1", "10", "100", "1000", "10000", "100000", "1000000" })
    public int count;

    Observable<Integer> observableConvert;

    Observable<Integer> observableDedicated;


            

Reported by PMD.

Field observableConvert has the same name as a method
Error

Line: 35

                  @Param({ "1", "10", "100", "1000", "10000", "100000", "1000000" })
    public int count;

    Observable<Integer> observableConvert;

    Observable<Integer> observableDedicated;

    Observable<Integer> observablePlain;


            

Reported by PMD.

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

Line: 35

                  @Param({ "1", "10", "100", "1000", "10000", "100000", "1000000" })
    public int count;

    Observable<Integer> observableConvert;

    Observable<Integer> observableDedicated;

    Observable<Integer> observablePlain;


            

Reported by PMD.

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

Line: 37

              
    Observable<Integer> observableConvert;

    Observable<Integer> observableDedicated;

    Observable<Integer> observablePlain;

    @Setup
    public void setup() {

            

Reported by PMD.

Field observableDedicated has the same name as a method
Error

Line: 37

              
    Observable<Integer> observableConvert;

    Observable<Integer> observableDedicated;

    Observable<Integer> observablePlain;

    @Setup
    public void setup() {

            

Reported by PMD.

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

Line: 39

              
    Observable<Integer> observableDedicated;

    Observable<Integer> observablePlain;

    @Setup
    public void setup() {
        Integer[] sourceArray = new Integer[count];
        Arrays.fill(sourceArray, 777);

            

Reported by PMD.

Field observablePlain has the same name as a method
Error

Line: 39

              
    Observable<Integer> observableDedicated;

    Observable<Integer> observablePlain;

    @Setup
    public void setup() {
        Integer[] sourceArray = new Integer[count];
        Arrays.fill(sourceArray, 777);

            

Reported by PMD.

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

Line: 58

                      observableConvert = source.switchMap(new Function<Integer, Observable<? extends Integer>>() {
            @Override
            public Observable<? extends Integer> apply(Integer v) {
                return Maybe.<Integer>empty().toObservable();
            }
        });

        observableDedicated = source.switchMapMaybe(new Function<Integer, Maybe<? extends Integer>>() {
            @Override

            

Reported by PMD.

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

Line: 58

                      observableConvert = source.switchMap(new Function<Integer, Observable<? extends Integer>>() {
            @Override
            public Observable<? extends Integer> apply(Integer v) {
                return Maybe.<Integer>empty().toObservable();
            }
        });

        observableDedicated = source.switchMapMaybe(new Function<Integer, Maybe<? extends Integer>>() {
            @Override

            

Reported by PMD.

Avoid unused imports such as 'org.openjdk.jmh.annotations'
Design

Line: 19

              import java.util.Arrays;
import java.util.concurrent.TimeUnit;

import org.openjdk.jmh.annotations.*;
import org.openjdk.jmh.infra.Blackhole;

import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.functions.Function;


            

Reported by PMD.