The following issues were found

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

Line: 26

              import io.reactivex.rxjava3.internal.subscriptions.SubscriptionArbiter;

public final class FlowableRetryBiPredicate<T> extends AbstractFlowableWithUpstream<T, T> {
    final BiPredicate<? super Integer, ? super Throwable> predicate;
    public FlowableRetryBiPredicate(
            Flowable<T> source,
            BiPredicate<? super Integer, ? super Throwable> predicate) {
        super(source);
        this.predicate = predicate;

            

Reported by PMD.

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

Line: 47

              
        private static final long serialVersionUID = -7098360935104053232L;

        final Subscriber<? super T> downstream;
        final SubscriptionArbiter sa;
        final Publisher<? extends T> source;
        final BiPredicate<? super Integer, ? super Throwable> predicate;
        int retries;


            

Reported by PMD.

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

Line: 48

                      private static final long serialVersionUID = -7098360935104053232L;

        final Subscriber<? super T> downstream;
        final SubscriptionArbiter sa;
        final Publisher<? extends T> source;
        final BiPredicate<? super Integer, ? super Throwable> predicate;
        int retries;

        long produced;

            

Reported by PMD.

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

Line: 49

              
        final Subscriber<? super T> downstream;
        final SubscriptionArbiter sa;
        final Publisher<? extends T> source;
        final BiPredicate<? super Integer, ? super Throwable> predicate;
        int retries;

        long produced;


            

Reported by PMD.

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

Line: 50

                      final Subscriber<? super T> downstream;
        final SubscriptionArbiter sa;
        final Publisher<? extends T> source;
        final BiPredicate<? super Integer, ? super Throwable> predicate;
        int retries;

        long produced;

        RetryBiSubscriber(Subscriber<? super T> actual,

            

Reported by PMD.

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

Line: 51

                      final SubscriptionArbiter sa;
        final Publisher<? extends T> source;
        final BiPredicate<? super Integer, ? super Throwable> predicate;
        int retries;

        long produced;

        RetryBiSubscriber(Subscriber<? super T> actual,
                BiPredicate<? super Integer, ? super Throwable> predicate, SubscriptionArbiter sa, Publisher<? extends T> source) {

            

Reported by PMD.

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

Line: 53

                      final BiPredicate<? super Integer, ? super Throwable> predicate;
        int retries;

        long produced;

        RetryBiSubscriber(Subscriber<? super T> actual,
                BiPredicate<? super Integer, ? super Throwable> predicate, SubscriptionArbiter sa, Publisher<? extends T> source) {
            this.downstream = actual;
            this.sa = sa;

            

Reported by PMD.

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

Line: 79

                          boolean b;
            try {
                b = predicate.test(++retries, t);
            } catch (Throwable e) {
                Exceptions.throwIfFatal(e);
                downstream.onError(new CompositeException(t, e));
                return;
            }
            if (!b) {

            

Reported by PMD.

Avoid using Literals in Conditional Statements
Error

Line: 108

                                  }

                    long p = produced;
                    if (p != 0L) {
                        produced = 0L;
                        sa.produced(p);
                    }

                    source.subscribe(this);

            

Reported by PMD.

Avoid unused imports such as 'org.reactivestreams'
Design

Line: 18

              
import java.util.concurrent.atomic.AtomicInteger;

import org.reactivestreams.*;

import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.exceptions.*;
import io.reactivex.rxjava3.functions.BiPredicate;
import io.reactivex.rxjava3.internal.subscriptions.SubscriptionArbiter;

            

Reported by PMD.

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

Line: 34

                  @SuppressWarnings("rawtypes")
    static final CacheDisposable[] TERMINATED = new CacheDisposable[0];

    final AtomicReference<MaybeSource<T>> source;

    final AtomicReference<CacheDisposable<T>[]> observers;

    T value;


            

Reported by PMD.

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

Line: 36

              
    final AtomicReference<MaybeSource<T>> source;

    final AtomicReference<CacheDisposable<T>[]> observers;

    T value;

    Throwable error;


            

Reported by PMD.

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

Line: 38

              
    final AtomicReference<CacheDisposable<T>[]> observers;

    T value;

    Throwable error;

    @SuppressWarnings("unchecked")
    public MaybeCache(MaybeSource<T> source) {

            

Reported by PMD.

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

Line: 40

              
    T value;

    Throwable error;

    @SuppressWarnings("unchecked")
    public MaybeCache(MaybeSource<T> source) {
        this.source = new AtomicReference<>(source);
        this.observers = new AtomicReference<>(EMPTY);

            

Reported by PMD.

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

Line: 42

              
    Throwable error;

    @SuppressWarnings("unchecked")
    public MaybeCache(MaybeSource<T> source) {
        this.source = new AtomicReference<>(source);
        this.observers = new AtomicReference<>(EMPTY);
    }


            

Reported by PMD.

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

Line: 92

                      this.value = value;
        for (CacheDisposable<T> inner : observers.getAndSet(TERMINATED)) {
            if (!inner.isDisposed()) {
                inner.downstream.onSuccess(value);
            }
        }
    }

    @SuppressWarnings("unchecked")

            

Reported by PMD.

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

Line: 103

                      this.error = e;
        for (CacheDisposable<T> inner : observers.getAndSet(TERMINATED)) {
            if (!inner.isDisposed()) {
                inner.downstream.onError(e);
            }
        }
    }

    @SuppressWarnings("unchecked")

            

Reported by PMD.

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

Line: 113

                  public void onComplete() {
        for (CacheDisposable<T> inner : observers.getAndSet(TERMINATED)) {
            if (!inner.isDisposed()) {
                inner.downstream.onComplete();
            }
        }
    }

    boolean add(CacheDisposable<T> inner) {

            

Reported by PMD.

Avoid instantiating new objects inside loops
Performance

Line: 127

                          int n = a.length;

            @SuppressWarnings("unchecked")
            CacheDisposable<T>[] b = new CacheDisposable[n + 1];
            System.arraycopy(a, 0, b, 0, n);
            b[n] = inner;
            if (observers.compareAndSet(a, b)) {
                return true;
            }

            

Reported by PMD.

Avoid using Literals in Conditional Statements
Error

Line: 159

                          }

            CacheDisposable<T>[] b;
            if (n == 1) {
                b = EMPTY;
            } else {
                b = new CacheDisposable[n - 1];
                System.arraycopy(a, 0, b, 0, j);
                System.arraycopy(a, j + 1, b, j, n - j - 1);

            

Reported by PMD.

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

Line: 27

              import io.reactivex.rxjava3.internal.util.*;

public final class BlockingObservableIterable<T> implements Iterable<T> {
    final ObservableSource<? extends T> source;

    final int bufferSize;

    public BlockingObservableIterable(ObservableSource<? extends T> source, int bufferSize) {
        this.source = source;

            

Reported by PMD.

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

Line: 29

              public final class BlockingObservableIterable<T> implements Iterable<T> {
    final ObservableSource<? extends T> source;

    final int bufferSize;

    public BlockingObservableIterable(ObservableSource<? extends T> source, int bufferSize) {
        this.source = source;
        this.bufferSize = bufferSize;
    }

            

Reported by PMD.

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

Line: 43

                      return it;
    }

    static final class BlockingObservableIterator<T>
    extends AtomicReference<Disposable>
    implements io.reactivex.rxjava3.core.Observer<T>, Iterator<T>, Disposable {

        private static final long serialVersionUID = 6695226475494099826L;


            

Reported by PMD.

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

Line: 43

                      return it;
    }

    static final class BlockingObservableIterator<T>
    extends AtomicReference<Disposable>
    implements io.reactivex.rxjava3.core.Observer<T>, Iterator<T>, Disposable {

        private static final long serialVersionUID = 6695226475494099826L;


            

Reported by PMD.

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

Line: 49

              
        private static final long serialVersionUID = 6695226475494099826L;

        final SpscLinkedArrayQueue<T> queue;

        final Lock lock;

        final Condition condition;


            

Reported by PMD.

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

Line: 51

              
        final SpscLinkedArrayQueue<T> queue;

        final Lock lock;

        final Condition condition;

        volatile boolean done;
        volatile Throwable error;

            

Reported by PMD.

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

Line: 53

              
        final Lock lock;

        final Condition condition;

        volatile boolean done;
        volatile Throwable error;

        BlockingObservableIterator(int batchSize) {

            

Reported by PMD.

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

Line: 55

              
        final Condition condition;

        volatile boolean done;
        volatile Throwable error;

        BlockingObservableIterator(int batchSize) {
            this.queue = new SpscLinkedArrayQueue<>(batchSize);
            this.lock = new ReentrantLock();

            

Reported by PMD.

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

Line: 56

                      final Condition condition;

        volatile boolean done;
        volatile Throwable error;

        BlockingObservableIterator(int batchSize) {
            this.queue = new SpscLinkedArrayQueue<>(batchSize);
            this.lock = new ReentrantLock();
            this.condition = lock.newCondition();

            

Reported by PMD.

The method 'hasNext()' has a cyclomatic complexity of 15.
Design

Line: 65

                      }

        @Override
        public boolean hasNext() {
            for (;;) {
                if (isDisposed()) {
                    Throwable e = error;
                    if (e != null) {
                        throw ExceptionHelper.wrapOrThrow(e);

            

Reported by PMD.

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

Line: 34

               */
public final class ObservableFlatMapCompletableCompletable<T> extends Completable implements FuseToObservable<T> {

    final ObservableSource<T> source;

    final Function<? super T, ? extends CompletableSource> mapper;

    final boolean delayErrors;


            

Reported by PMD.

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

Line: 36

              
    final ObservableSource<T> source;

    final Function<? super T, ? extends CompletableSource> mapper;

    final boolean delayErrors;

    public ObservableFlatMapCompletableCompletable(ObservableSource<T> source,
            Function<? super T, ? extends CompletableSource> mapper, boolean delayErrors) {

            

Reported by PMD.

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

Line: 38

              
    final Function<? super T, ? extends CompletableSource> mapper;

    final boolean delayErrors;

    public ObservableFlatMapCompletableCompletable(ObservableSource<T> source,
            Function<? super T, ? extends CompletableSource> mapper, boolean delayErrors) {
        this.source = source;
        this.mapper = mapper;

            

Reported by PMD.

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

Line: 60

                  static final class FlatMapCompletableMainObserver<T> extends AtomicInteger implements Disposable, Observer<T> {
        private static final long serialVersionUID = 8443155186132538303L;

        final CompletableObserver downstream;

        final AtomicThrowable errors;

        final Function<? super T, ? extends CompletableSource> mapper;


            

Reported by PMD.

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

Line: 62

              
        final CompletableObserver downstream;

        final AtomicThrowable errors;

        final Function<? super T, ? extends CompletableSource> mapper;

        final boolean delayErrors;


            

Reported by PMD.

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

Line: 64

              
        final AtomicThrowable errors;

        final Function<? super T, ? extends CompletableSource> mapper;

        final boolean delayErrors;

        final CompositeDisposable set;


            

Reported by PMD.

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

Line: 66

              
        final Function<? super T, ? extends CompletableSource> mapper;

        final boolean delayErrors;

        final CompositeDisposable set;

        Disposable upstream;


            

Reported by PMD.

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

Line: 68

              
        final boolean delayErrors;

        final CompositeDisposable set;

        Disposable upstream;

        volatile boolean disposed;


            

Reported by PMD.

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

Line: 70

              
        final CompositeDisposable set;

        Disposable upstream;

        volatile boolean disposed;

        FlatMapCompletableMainObserver(CompletableObserver observer, Function<? super T, ? extends CompletableSource> mapper, boolean delayErrors) {
            this.downstream = observer;

            

Reported by PMD.

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

Line: 72

              
        Disposable upstream;

        volatile boolean disposed;

        FlatMapCompletableMainObserver(CompletableObserver observer, Function<? super T, ? extends CompletableSource> mapper, boolean delayErrors) {
            this.downstream = observer;
            this.mapper = mapper;
            this.delayErrors = delayErrors;

            

Reported by PMD.

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

Line: 26

              import io.reactivex.rxjava3.internal.observers.BasicQueueDisposable;

public final class ObservableFromIterable<T> extends Observable<T> {
    final Iterable<? extends T> source;
    public ObservableFromIterable(Iterable<? extends T> source) {
        this.source = source;
    }

    @Override

            

Reported by PMD.

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

Line: 36

                      Iterator<? extends T> it;
        try {
            it = source.iterator();
        } catch (Throwable e) {
            Exceptions.throwIfFatal(e);
            EmptyDisposable.error(e, observer);
            return;
        }
        boolean hasNext;

            

Reported by PMD.

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

Line: 44

                      boolean hasNext;
        try {
            hasNext = it.hasNext();
        } catch (Throwable e) {
            Exceptions.throwIfFatal(e);
            EmptyDisposable.error(e, observer);
            return;
        }
        if (!hasNext) {

            

Reported by PMD.

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

Line: 64

              
    static final class FromIterableDisposable<T> extends BasicQueueDisposable<T> {

        final Observer<? super T> downstream;

        final Iterator<? extends T> it;

        volatile boolean disposed;


            

Reported by PMD.

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

Line: 66

              
        final Observer<? super T> downstream;

        final Iterator<? extends T> it;

        volatile boolean disposed;

        boolean fusionMode;


            

Reported by PMD.

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

Line: 68

              
        final Iterator<? extends T> it;

        volatile boolean disposed;

        boolean fusionMode;

        boolean done;


            

Reported by PMD.

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

Line: 70

              
        volatile boolean disposed;

        boolean fusionMode;

        boolean done;

        boolean checkNext;


            

Reported by PMD.

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

Line: 72

              
        boolean fusionMode;

        boolean done;

        boolean checkNext;

        FromIterableDisposable(Observer<? super T> actual, Iterator<? extends T> it) {
            this.downstream = actual;

            

Reported by PMD.

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

Line: 74

              
        boolean done;

        boolean checkNext;

        FromIterableDisposable(Observer<? super T> actual, Iterator<? extends T> it) {
            this.downstream = actual;
            this.it = it;
        }

            

Reported by PMD.

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

Line: 92

              
                try {
                    v = Objects.requireNonNull(it.next(), "The iterator returned a null value");
                } catch (Throwable e) {
                    Exceptions.throwIfFatal(e);
                    downstream.onError(e);
                    return;
                }


            

Reported by PMD.

src/main/java/io/reactivex/rxjava3/internal/operators/observable/ObservableScalarXMap.java
14 issues
A catch statement should never catch throwable since it includes errors.
Error

Line: 55

              
            try {
                t = ((Supplier<T>)source).get();
            } catch (Throwable ex) {
                Exceptions.throwIfFatal(ex);
                EmptyDisposable.error(ex, observer);
                return true;
            }


            

Reported by PMD.

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

Line: 70

              
            try {
                r = Objects.requireNonNull(mapper.apply(t), "The mapper returned a null ObservableSource");
            } catch (Throwable ex) {
                Exceptions.throwIfFatal(ex);
                EmptyDisposable.error(ex, observer);
                return true;
            }


            

Reported by PMD.

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

Line: 81

              
                try {
                    u = ((Supplier<R>)r).get();
                } catch (Throwable ex) {
                    Exceptions.throwIfFatal(ex);
                    EmptyDisposable.error(ex, observer);
                    return true;
                }


            

Reported by PMD.

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

Line: 95

                              observer.onSubscribe(sd);
                sd.run();
            } else {
                r.subscribe(observer);
            }

            return true;
        }
        return false;

            

Reported by PMD.

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

Line: 126

                   */
    static final class ScalarXMapObservable<T, R> extends Observable<R> {

        final T value;

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

        ScalarXMapObservable(T value,
                Function<? super T, ? extends ObservableSource<? extends R>> mapper) {

            

Reported by PMD.

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

Line: 128

              
        final T value;

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

        ScalarXMapObservable(T value,
                Function<? super T, ? extends ObservableSource<? extends R>> mapper) {
            this.value = value;
            this.mapper = mapper;

            

Reported by PMD.

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

Line: 142

                          ObservableSource<? extends R> other;
            try {
                other = Objects.requireNonNull(mapper.apply(value), "The mapper returned a null ObservableSource");
            } catch (Throwable e) {
                Exceptions.throwIfFatal(e);
                EmptyDisposable.error(e, observer);
                return;
            }
            if (other instanceof Supplier) {

            

Reported by PMD.

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

Line: 152

              
                try {
                    u = ((Supplier<R>)other).get();
                } catch (Throwable ex) {
                    Exceptions.throwIfFatal(ex);
                    EmptyDisposable.error(ex, observer);
                    return;
                }


            

Reported by PMD.

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

Line: 182

              
        private static final long serialVersionUID = 3880992722410194083L;

        final Observer<? super T> observer;

        final T value;

        static final int START = 0;
        static final int FUSED = 1;

            

Reported by PMD.

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

Line: 184

              
        final Observer<? super T> observer;

        final T value;

        static final int START = 0;
        static final int FUSED = 1;
        static final int ON_NEXT = 2;
        static final int ON_COMPLETE = 3;

            

Reported by PMD.

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

Line: 26

              import java.util.Objects;

public final class ObservableScanSeed<T, R> extends AbstractObservableWithUpstream<T, R> {
    final BiFunction<R, ? super T, R> accumulator;
    final Supplier<R> seedSupplier;

    public ObservableScanSeed(ObservableSource<T> source, Supplier<R> seedSupplier, BiFunction<R, ? super T, R> accumulator) {
        super(source);
        this.accumulator = accumulator;

            

Reported by PMD.

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

Line: 27

              
public final class ObservableScanSeed<T, R> extends AbstractObservableWithUpstream<T, R> {
    final BiFunction<R, ? super T, R> accumulator;
    final Supplier<R> seedSupplier;

    public ObservableScanSeed(ObservableSource<T> source, Supplier<R> seedSupplier, BiFunction<R, ? super T, R> accumulator) {
        super(source);
        this.accumulator = accumulator;
        this.seedSupplier = seedSupplier;

            

Reported by PMD.

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

Line: 41

              
        try {
            r = Objects.requireNonNull(seedSupplier.get(), "The seed supplied is null");
        } catch (Throwable e) {
            Exceptions.throwIfFatal(e);
            EmptyDisposable.error(e, t);
            return;
        }


            

Reported by PMD.

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

Line: 51

                  }

    static final class ScanSeedObserver<T, R> implements Observer<T>, Disposable {
        final Observer<? super R> downstream;
        final BiFunction<R, ? super T, R> accumulator;

        R value;

        Disposable upstream;

            

Reported by PMD.

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

Line: 52

              
    static final class ScanSeedObserver<T, R> implements Observer<T>, Disposable {
        final Observer<? super R> downstream;
        final BiFunction<R, ? super T, R> accumulator;

        R value;

        Disposable upstream;


            

Reported by PMD.

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

Line: 54

                      final Observer<? super R> downstream;
        final BiFunction<R, ? super T, R> accumulator;

        R value;

        Disposable upstream;

        boolean done;


            

Reported by PMD.

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

Line: 56

              
        R value;

        Disposable upstream;

        boolean done;

        ScanSeedObserver(Observer<? super R> actual, BiFunction<R, ? super T, R> accumulator, R value) {
            this.downstream = actual;

            

Reported by PMD.

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

Line: 58

              
        Disposable upstream;

        boolean done;

        ScanSeedObserver(Observer<? super R> actual, BiFunction<R, ? super T, R> accumulator, R value) {
            this.downstream = actual;
            this.accumulator = accumulator;
            this.value = value;

            

Reported by PMD.

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

Line: 99

              
            try {
                u = Objects.requireNonNull(accumulator.apply(v, t), "The accumulator returned a null value");
            } catch (Throwable e) {
                Exceptions.throwIfFatal(e);
                upstream.dispose();
                onError(e);
                return;
            }

            

Reported by PMD.

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

Line: 16

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

import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.disposables.Disposable;
import io.reactivex.rxjava3.exceptions.Exceptions;
import io.reactivex.rxjava3.functions.*;
import io.reactivex.rxjava3.internal.disposables.*;
import io.reactivex.rxjava3.plugins.RxJavaPlugins;

            

Reported by PMD.

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

Line: 34

               */
public final class SingleFlatMapNotification<T, R> extends Single<R> {

    final SingleSource<T> source;

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

    final Function<? super Throwable, ? extends SingleSource<? extends R>> onErrorMapper;


            

Reported by PMD.

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

Line: 36

              
    final SingleSource<T> source;

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

    final Function<? super Throwable, ? extends SingleSource<? extends R>> onErrorMapper;

    public SingleFlatMapNotification(SingleSource<T> source,
            Function<? super T, ? extends SingleSource<? extends R>> onSuccessMapper,

            

Reported by PMD.

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

Line: 38

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

    final Function<? super Throwable, ? extends SingleSource<? extends R>> onErrorMapper;

    public SingleFlatMapNotification(SingleSource<T> source,
            Function<? super T, ? extends SingleSource<? extends R>> onSuccessMapper,
            Function<? super Throwable, ? extends SingleSource<? extends R>> onErrorMapper) {
        this.source = source;

            

Reported by PMD.

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

Line: 59

              
        private static final long serialVersionUID = 4375739915521278546L;

        final SingleObserver<? super R> downstream;

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

        final Function<? super Throwable, ? extends SingleSource<? extends R>> onErrorMapper;


            

Reported by PMD.

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

Line: 61

              
        final SingleObserver<? super R> downstream;

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

        final Function<? super Throwable, ? extends SingleSource<? extends R>> onErrorMapper;

        Disposable upstream;


            

Reported by PMD.

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

Line: 63

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

        final Function<? super Throwable, ? extends SingleSource<? extends R>> onErrorMapper;

        Disposable upstream;

        FlatMapSingleObserver(SingleObserver<? super R> actual,
                Function<? super T, ? extends SingleSource<? extends R>> onSuccessMapper,

            

Reported by PMD.

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

Line: 65

              
        final Function<? super Throwable, ? extends SingleSource<? extends R>> onErrorMapper;

        Disposable upstream;

        FlatMapSingleObserver(SingleObserver<? super R> actual,
                Function<? super T, ? extends SingleSource<? extends R>> onSuccessMapper,
                Function<? super Throwable, ? extends SingleSource<? extends R>> onErrorMapper) {
            this.downstream = actual;

            

Reported by PMD.

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

Line: 101

              
            try {
                source = Objects.requireNonNull(onSuccessMapper.apply(value), "The onSuccessMapper returned a null SingleSource");
            } catch (Throwable ex) {
                Exceptions.throwIfFatal(ex);
                downstream.onError(ex);
                return;
            }


            

Reported by PMD.

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

Line: 118

              
            try {
                source = Objects.requireNonNull(onErrorMapper.apply(e), "The onErrorMapper returned a null SingleSource");
            } catch (Throwable ex) {
                Exceptions.throwIfFatal(ex);
                downstream.onError(new CompositeException(e, ex));
                return;
            }


            

Reported by PMD.

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

Line: 19

              import java.util.Objects;
import java.util.concurrent.atomic.AtomicReference;

import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.disposables.Disposable;
import io.reactivex.rxjava3.exceptions.*;
import io.reactivex.rxjava3.functions.*;
import io.reactivex.rxjava3.internal.disposables.DisposableHelper;


            

Reported by PMD.

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

Line: 58

              
    private static final long serialVersionUID = 8924480688481408726L;

    final AtomicReference<DisposableContainer> composite;

    final Consumer<? super T> onNext;

    final Consumer<? super Throwable> onError;


            

Reported by PMD.

Field onNext has the same name as a method
Error

Line: 60

              
    final AtomicReference<DisposableContainer> composite;

    final Consumer<? super T> onNext;

    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: 60

              
    final AtomicReference<DisposableContainer> composite;

    final Consumer<? super T> onNext;

    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: 62

              
    final Consumer<? super T> onNext;

    final Consumer<? super Throwable> onError;

    final Action onComplete;

    public DisposableAutoReleaseSubscriber(
            DisposableContainer composite,

            

Reported by PMD.

Field onError has the same name as a method
Error

Line: 62

              
    final Consumer<? super T> onNext;

    final Consumer<? super Throwable> onError;

    final Action onComplete;

    public DisposableAutoReleaseSubscriber(
            DisposableContainer composite,

            

Reported by PMD.

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

Line: 64

              
    final Consumer<? super Throwable> onError;

    final Action onComplete;

    public DisposableAutoReleaseSubscriber(
            DisposableContainer composite,
            Consumer<? super T> onNext,
            Consumer<? super Throwable> onError,

            

Reported by PMD.

Field onComplete has the same name as a method
Error

Line: 64

              
    final Consumer<? super Throwable> onError;

    final Action onComplete;

    public DisposableAutoReleaseSubscriber(
            DisposableContainer composite,
            Consumer<? super T> onNext,
            Consumer<? super Throwable> onError,

            

Reported by PMD.

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

Line: 83

                      if (get() != SubscriptionHelper.CANCELLED) {
            try {
                onNext.accept(t);
            } catch (Throwable e) {
                Exceptions.throwIfFatal(e);
                get().cancel();
                onError(e);
            }
        }

            

Reported by PMD.

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

Line: 85

                              onNext.accept(t);
            } catch (Throwable e) {
                Exceptions.throwIfFatal(e);
                get().cancel();
                onError(e);
            }
        }
    }


            

Reported by PMD.

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

Line: 97

                          lazySet(SubscriptionHelper.CANCELLED);
            try {
                onError.accept(t);
            } catch (Throwable e) {
                Exceptions.throwIfFatal(e);
                RxJavaPlugins.onError(new CompositeException(t, e));
            }
        } else {
            RxJavaPlugins.onError(t);

            

Reported by PMD.

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

Line: 26

               */
public class LinkedArrayList {
    /** The capacity of each array segment. */
    final int capacityHint;
    /**
     * Contains the head of the linked array list if not null. The
     * length is always capacityHint + 1 and the last element is an Object[] pointing
     * to the next element of the linked array list.
     */

            

Reported by PMD.

Field head has the same name as a method
Error

Line: 32

                   * length is always capacityHint + 1 and the last element is an Object[] pointing
     * to the next element of the linked array list.
     */
    Object[] head;
    /** The tail array where new elements will be added. */
    Object[] tail;
    /**
     * The total size of the list; written after elements have been added (release) and
     * and when read, the value indicates how many elements can be safely read (acquire).

            

Reported by PMD.

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

Line: 32

                   * length is always capacityHint + 1 and the last element is an Object[] pointing
     * to the next element of the linked array list.
     */
    Object[] head;
    /** The tail array where new elements will be added. */
    Object[] tail;
    /**
     * The total size of the list; written after elements have been added (release) and
     * and when read, the value indicates how many elements can be safely read (acquire).

            

Reported by PMD.

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

Line: 34

                   */
    Object[] head;
    /** The tail array where new elements will be added. */
    Object[] tail;
    /**
     * The total size of the list; written after elements have been added (release) and
     * and when read, the value indicates how many elements can be safely read (acquire).
     */
    volatile int size;

            

Reported by PMD.

Field size has the same name as a method
Error

Line: 39

                   * The total size of the list; written after elements have been added (release) and
     * and when read, the value indicates how many elements can be safely read (acquire).
     */
    volatile int size;
    /** The next available slot in the current tail. */
    int indexInTail;
    /**
     * Constructor with the capacity hint of each array segment.
     * @param capacityHint the expected number of elements to hold (can grow beyond that)

            

Reported by PMD.

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

Line: 39

                   * The total size of the list; written after elements have been added (release) and
     * and when read, the value indicates how many elements can be safely read (acquire).
     */
    volatile int size;
    /** The next available slot in the current tail. */
    int indexInTail;
    /**
     * Constructor with the capacity hint of each array segment.
     * @param capacityHint the expected number of elements to hold (can grow beyond that)

            

Reported by PMD.

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

Line: 41

                   */
    volatile int size;
    /** The next available slot in the current tail. */
    int indexInTail;
    /**
     * Constructor with the capacity hint of each array segment.
     * @param capacityHint the expected number of elements to hold (can grow beyond that)
     */
    public LinkedArrayList(int capacityHint) {

            

Reported by PMD.

Avoid assignments in operands
Error

Line: 104

                      while (j < s) {
            list.add(h[k]);
            j++;
            if (++k == cap) {
                k = 0;
                h = (Object[])h[cap];
            }
        }


            

Reported by PMD.

Found 'DD'-anomaly for variable 't' (lines '64'-'65').
Error

Line: 64

                      } else
        // if the tail is full, create a new tail and link
        if (indexInTail == capacityHint) {
            Object[] t = new Object[capacityHint + 1];
            t[0] = o;
            tail[capacityHint] = t;
            tail = t;
            indexInTail = 1;
            size++;

            

Reported by PMD.

Found 'DU'-anomaly for variable 'cap' (lines '94'-'111').
Error

Line: 94

              
    @Override
    public String toString() {
        final int cap = capacityHint;
        final int s = size;
        final List<Object> list = new ArrayList<>(s + 1);

        Object[] h = head();
        int j = 0;

            

Reported by PMD.