The following issues were found

src/main/java/io/reactivex/rxjava3/internal/operators/parallel/ParallelFromArray.java
5 issues
Avoid reassigning parameters such as 'subscribers'
Design

Line: 40

                  }

    @Override
    public void subscribe(Subscriber<? super T>[] subscribers) {
        subscribers = RxJavaPlugins.onSubscribe(this, subscribers);

        if (!validate(subscribers)) {
            return;
        }

            

Reported by PMD.

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

Line: 28

               * @param <T> the value type
 */
public final class ParallelFromArray<T> extends ParallelFlowable<T> {
    final Publisher<T>[] sources;

    public ParallelFromArray(Publisher<T>[] sources) {
        this.sources = sources;
    }


            

Reported by PMD.

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

Line: 30

              public final class ParallelFromArray<T> extends ParallelFlowable<T> {
    final Publisher<T>[] sources;

    public ParallelFromArray(Publisher<T>[] sources) {
        this.sources = sources;
    }

    @Override
    public int parallelism() {

            

Reported by PMD.

Avoid unused imports such as 'org.reactivestreams'
Design

Line: 16

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

import org.reactivestreams.*;

import io.reactivex.rxjava3.parallel.ParallelFlowable;
import io.reactivex.rxjava3.plugins.RxJavaPlugins;

/**

            

Reported by PMD.

Consider using varargs for methods or constructors which take an array the last parameter.
Design

Line: 30

              public final class ParallelFromArray<T> extends ParallelFlowable<T> {
    final Publisher<T>[] sources;

    public ParallelFromArray(Publisher<T>[] sources) {
        this.sources = sources;
    }

    @Override
    public int parallelism() {

            

Reported by PMD.

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

Line: 30

               */
public final class FlowableSwitchMapSinglePublisher<T, R> extends Flowable<R> {

    final Publisher<T> source;

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

    final boolean delayErrors;


            

Reported by PMD.

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

Line: 32

              
    final Publisher<T> source;

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

    final boolean delayErrors;

    public FlowableSwitchMapSinglePublisher(Publisher<T> source,
            Function<? super T, ? extends SingleSource<? extends R>> mapper,

            

Reported by PMD.

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

Line: 34

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

    final boolean delayErrors;

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

            

Reported by PMD.

Avoid unused imports such as 'org.reactivestreams'
Design

Line: 16

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

import org.reactivestreams.*;

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

/**

            

Reported by PMD.

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

Line: 18

              
import org.reactivestreams.*;

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

/**
 * Switch between subsequent {@link SingleSource}s emitted by a {@link Publisher}.
 * Reuses {@link FlowableSwitchMapSingle} internals.

            

Reported by PMD.

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

Line: 52

              
    private static final long serialVersionUID = 8924480688481408726L;

    final Consumer<? super T> onSuccess;

    public DisposableAutoReleaseMultiObserver(
            DisposableContainer composite,
            Consumer<? super T> onSuccess,
            Consumer<? super Throwable> onError,

            

Reported by PMD.

Field onSuccess has the same name as a method
Error

Line: 52

              
    private static final long serialVersionUID = 8924480688481408726L;

    final Consumer<? super T> onSuccess;

    public DisposableAutoReleaseMultiObserver(
            DisposableContainer composite,
            Consumer<? super T> onSuccess,
            Consumer<? super Throwable> onError,

            

Reported by PMD.

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

Line: 70

                          lazySet(DisposableHelper.DISPOSED);
            try {
                onSuccess.accept(t);
            } catch (Throwable e) {
                Exceptions.throwIfFatal(e);
                RxJavaPlugins.onError(e);
            }
        }
        removeSelf();

            

Reported by PMD.

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

Line: 32

              
package io.reactivex.rxjava3.internal.observers;

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

            

Reported by PMD.

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

Line: 35

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

/**
 * Wraps lambda callbacks and when the upstream terminates or this (Single | Maybe | Completable)

            

Reported by PMD.

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

Line: 30

               */
public final class FlowableSwitchMapMaybePublisher<T, R> extends Flowable<R> {

    final Publisher<T> source;

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

    final boolean delayErrors;


            

Reported by PMD.

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

Line: 32

              
    final Publisher<T> source;

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

    final boolean delayErrors;

    public FlowableSwitchMapMaybePublisher(Publisher<T> source,
            Function<? super T, ? extends MaybeSource<? extends R>> mapper,

            

Reported by PMD.

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

Line: 34

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

    final boolean delayErrors;

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

            

Reported by PMD.

Avoid unused imports such as 'org.reactivestreams'
Design

Line: 16

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

import org.reactivestreams.*;

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

/**

            

Reported by PMD.

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

Line: 18

              
import org.reactivestreams.*;

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

/**
 * Switch between subsequent {@link MaybeSource}s emitted by a {@link Publisher}.
 * Reuses {@link FlowableSwitchMapMaybe} internals.

            

Reported by PMD.

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

Line: 51

              
    private static final long serialVersionUID = 8924480688481408726L;

    final Consumer<? super T> onNext;

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

            

Reported by PMD.

Field onNext has the same name as a method
Error

Line: 51

              
    private static final long serialVersionUID = 8924480688481408726L;

    final Consumer<? super T> onNext;

    public DisposableAutoReleaseObserver(
            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: 68

                      if (get() != DisposableHelper.DISPOSED) {
            try {
                onNext.accept(t);
            } catch (Throwable e) {
                Exceptions.throwIfFatal(e);
                get().dispose();
                onError(e);
            }
        }

            

Reported by PMD.

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

Line: 70

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


            

Reported by PMD.

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

Line: 35

              import io.reactivex.rxjava3.core.Observer;
import io.reactivex.rxjava3.disposables.DisposableContainer;
import io.reactivex.rxjava3.exceptions.Exceptions;
import io.reactivex.rxjava3.functions.*;
import io.reactivex.rxjava3.internal.disposables.DisposableHelper;

/**
 * Wraps lambda callbacks and when the upstream terminates or this observer gets disposed,
 * removes itself from a {@link io.reactivex.rxjava3.disposables.CompositeDisposable}.

            

Reported by PMD.

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

Line: 23

              import io.reactivex.rxjava3.internal.disposables.DisposableHelper;

public final class ObservableSkipLast<T> extends AbstractObservableWithUpstream<T, T> {
    final int skip;

    public ObservableSkipLast(ObservableSource<T> source, int skip) {
        super(source);
        this.skip = skip;
    }

            

Reported by PMD.

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

Line: 38

                  static final class SkipLastObserver<T> extends ArrayDeque<T> implements Observer<T>, Disposable {

        private static final long serialVersionUID = -3807491841935125653L;
        final Observer<? super T> downstream;
        final int skip;

        Disposable upstream;

        SkipLastObserver(Observer<? super T> actual, int skip) {

            

Reported by PMD.

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

Line: 39

              
        private static final long serialVersionUID = -3807491841935125653L;
        final Observer<? super T> downstream;
        final int skip;

        Disposable upstream;

        SkipLastObserver(Observer<? super T> actual, int skip) {
            super(skip);

            

Reported by PMD.

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

Line: 41

                      final Observer<? super T> downstream;
        final int skip;

        Disposable upstream;

        SkipLastObserver(Observer<? super T> actual, int skip) {
            super(skip);
            this.downstream = actual;
            this.skip = skip;

            

Reported by PMD.

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

Line: 18

              
import java.util.ArrayDeque;

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

public final class ObservableSkipLast<T> extends AbstractObservableWithUpstream<T, T> {
    final int skip;

            

Reported by PMD.

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

Line: 37

              public final class FutureMultiObserver<T> extends CountDownLatch
implements MaybeObserver<T>, SingleObserver<T>, CompletableObserver, Future<T>, Disposable {

    T value;
    Throwable error;

    final AtomicReference<Disposable> upstream;

    public FutureMultiObserver() {

            

Reported by PMD.

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

Line: 38

              implements MaybeObserver<T>, SingleObserver<T>, CompletableObserver, Future<T>, Disposable {

    T value;
    Throwable error;

    final AtomicReference<Disposable> upstream;

    public FutureMultiObserver() {
        super(1);

            

Reported by PMD.

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

Line: 40

                  T value;
    Throwable error;

    final AtomicReference<Disposable> upstream;

    public FutureMultiObserver() {
        super(1);
        this.upstream = new AtomicReference<>();
    }

            

Reported by PMD.

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

Line: 57

              
            if (upstream.compareAndSet(a, DisposableHelper.DISPOSED)) {
                if (a != null) {
                    a.dispose();
                }
                countDown();
                return true;
            }
        }

            

Reported by PMD.

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

Line: 22

              import java.util.concurrent.atomic.AtomicReference;

import io.reactivex.rxjava3.annotations.NonNull;
import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.disposables.Disposable;
import io.reactivex.rxjava3.internal.disposables.DisposableHelper;
import io.reactivex.rxjava3.internal.util.BlockingHelper;
import io.reactivex.rxjava3.plugins.RxJavaPlugins;


            

Reported by PMD.

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

Line: 38

              public final class FutureObserver<T> extends CountDownLatch
implements Observer<T>, Future<T>, Disposable {

    T value;
    Throwable error;

    final AtomicReference<Disposable> upstream;

    public FutureObserver() {

            

Reported by PMD.

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

Line: 39

              implements Observer<T>, Future<T>, Disposable {

    T value;
    Throwable error;

    final AtomicReference<Disposable> upstream;

    public FutureObserver() {
        super(1);

            

Reported by PMD.

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

Line: 41

                  T value;
    Throwable error;

    final AtomicReference<Disposable> upstream;

    public FutureObserver() {
        super(1);
        this.upstream = new AtomicReference<>();
    }

            

Reported by PMD.

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

Line: 58

              
            if (upstream.compareAndSet(a, DisposableHelper.DISPOSED)) {
                if (a != null) {
                    a.dispose();
                }
                countDown();
                return true;
            }
        }

            

Reported by PMD.

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

Line: 121

                  @Override
    public void onNext(T t) {
        if (value != null) {
            upstream.get().dispose();
            onError(new IndexOutOfBoundsException("More than one element received"));
            return;
        }
        value = t;
    }

            

Reported by PMD.

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

Line: 26

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

public final class FlowableFromFuture<T> extends Flowable<T> {
    final Future<? extends T> future;
    final long timeout;
    final TimeUnit unit;

    public FlowableFromFuture(Future<? extends T> future, long timeout, TimeUnit unit) {
        this.future = future;

            

Reported by PMD.

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

Line: 27

              
public final class FlowableFromFuture<T> extends Flowable<T> {
    final Future<? extends T> future;
    final long timeout;
    final TimeUnit unit;

    public FlowableFromFuture(Future<? extends T> future, long timeout, TimeUnit unit) {
        this.future = future;
        this.timeout = timeout;

            

Reported by PMD.

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

Line: 28

              public final class FlowableFromFuture<T> extends Flowable<T> {
    final Future<? extends T> future;
    final long timeout;
    final TimeUnit unit;

    public FlowableFromFuture(Future<? extends T> future, long timeout, TimeUnit unit) {
        this.future = future;
        this.timeout = timeout;
        this.unit = unit;

            

Reported by PMD.

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

Line: 44

                      T v;
        try {
            v = unit != null ? future.get(timeout, unit) : future.get();
        } catch (Throwable ex) {
            Exceptions.throwIfFatal(ex);
            if (!deferred.isCancelled()) {
                s.onError(ex);
            }
            return;

            

Reported by PMD.

Found 'DU'-anomaly for variable 'v' (lines '43'-'56').
Error

Line: 43

              
        T v;
        try {
            v = unit != null ? future.get(timeout, unit) : future.get();
        } catch (Throwable ex) {
            Exceptions.throwIfFatal(ex);
            if (!deferred.isCancelled()) {
                s.onError(ex);
            }

            

Reported by PMD.

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

Line: 29

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

    final Scheduler scheduler;

    public MaybeUnsubscribeOn(MaybeSource<T> source, Scheduler scheduler) {
        super(source);
        this.scheduler = scheduler;
    }

            

Reported by PMD.

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

Line: 46

              
        private static final long serialVersionUID = 3256698449646456986L;

        final MaybeObserver<? super T> downstream;

        final Scheduler scheduler;

        Disposable ds;


            

Reported by PMD.

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

Line: 48

              
        final MaybeObserver<? super T> downstream;

        final Scheduler scheduler;

        Disposable ds;

        UnsubscribeOnMaybeObserver(MaybeObserver<? super T> actual, Scheduler scheduler) {
            this.downstream = actual;

            

Reported by PMD.

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

Line: 50

              
        final Scheduler scheduler;

        Disposable ds;

        UnsubscribeOnMaybeObserver(MaybeObserver<? super T> actual, Scheduler scheduler) {
            this.downstream = actual;
            this.scheduler = scheduler;
        }

            

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.internal.disposables.DisposableHelper;

/**
 * Makes sure a dispose() call from downstream happens on the specified scheduler.

            

Reported by PMD.