The following issues were found

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

Line: 31

               */
public final class CompletableOnErrorReturn<T> extends Maybe<T> {

    final CompletableSource source;

    final Function<? super Throwable, ? extends T> valueSupplier;

    public CompletableOnErrorReturn(CompletableSource source,
            Function<? super Throwable, ? extends T> valueSupplier) {

            

Reported by PMD.

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

Line: 33

              
    final CompletableSource source;

    final Function<? super Throwable, ? extends T> valueSupplier;

    public CompletableOnErrorReturn(CompletableSource source,
            Function<? super Throwable, ? extends T> valueSupplier) {
        this.source = source;
        this.valueSupplier = valueSupplier;

            

Reported by PMD.

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

Line: 48

              
    static final class OnErrorReturnMaybeObserver<T> implements CompletableObserver, Disposable {

        final MaybeObserver<? super T> downstream;

        final Function<? super Throwable, ? extends T> itemSupplier;

        Disposable upstream;


            

Reported by PMD.

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

Line: 50

              
        final MaybeObserver<? super T> downstream;

        final Function<? super Throwable, ? extends T> itemSupplier;

        Disposable upstream;

        OnErrorReturnMaybeObserver(MaybeObserver<? super T> actual,
                Function<? super Throwable, ? extends T> itemSupplier) {

            

Reported by PMD.

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

Line: 52

              
        final Function<? super Throwable, ? extends T> itemSupplier;

        Disposable upstream;

        OnErrorReturnMaybeObserver(MaybeObserver<? super T> actual,
                Function<? super Throwable, ? extends T> itemSupplier) {
            this.downstream = actual;
            this.itemSupplier = itemSupplier;

            

Reported by PMD.

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

Line: 85

              
            try {
                v = Objects.requireNonNull(itemSupplier.apply(e), "The itemSupplier returned a null value");
            } 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: 16

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

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


            

Reported by PMD.

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

Line: 18

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

import java.util.Objects;


            

Reported by PMD.

Found 'DU'-anomaly for variable 'v' (lines '84'-'92').
Error

Line: 84

                          T v;

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

            

Reported by PMD.

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

Line: 32

               */
public final class FlowableOnErrorComplete<T> extends AbstractFlowableWithUpstream<T, T> {

    final Predicate<? super Throwable> predicate;

    public FlowableOnErrorComplete(Flowable<T> source,
            Predicate<? 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: 48

                  public static final class OnErrorCompleteSubscriber<T>
    implements FlowableSubscriber<T>, Subscription {

        final Subscriber<? super T> downstream;

        final Predicate<? super Throwable> predicate;

        Subscription upstream;


            

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 Predicate<? super Throwable> predicate;

        Subscription upstream;

        public OnErrorCompleteSubscriber(Subscriber<? super T> actual, Predicate<? super Throwable> predicate) {
            this.downstream = actual;

            

Reported by PMD.

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

Line: 52

              
        final Predicate<? super Throwable> predicate;

        Subscription upstream;

        public OnErrorCompleteSubscriber(Subscriber<? super T> actual, Predicate<? super Throwable> predicate) {
            this.downstream = actual;
            this.predicate = predicate;
        }

            

Reported by PMD.

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

Line: 79

              
            try {
                b = predicate.test(e);
            } catch (Throwable ex) {
                Exceptions.throwIfFatal(ex);
                downstream.onError(new CompositeException(e, ex));
                return;
            }


            

Reported by PMD.

Avoid unused imports such as 'org.reactivestreams'
Design

Line: 16

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

import org.reactivestreams.*;

import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.exceptions.*;
import io.reactivex.rxjava3.functions.Predicate;
import io.reactivex.rxjava3.internal.subscriptions.SubscriptionHelper;

            

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.exceptions.*;
import io.reactivex.rxjava3.functions.Predicate;
import io.reactivex.rxjava3.internal.subscriptions.SubscriptionHelper;

/**

            

Reported by PMD.

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

Line: 19

              import org.reactivestreams.*;

import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.exceptions.*;
import io.reactivex.rxjava3.functions.Predicate;
import io.reactivex.rxjava3.internal.subscriptions.SubscriptionHelper;

/**
 * Emits an onComplete if the source emits an onError and the predicate returns true for

            

Reported by PMD.

Found 'DU'-anomaly for variable 'b' (lines '78'-'90').
Error

Line: 78

                          boolean b;

            try {
                b = predicate.test(e);
            } catch (Throwable ex) {
                Exceptions.throwIfFatal(ex);
                downstream.onError(new CompositeException(e, ex));
                return;
            }

            

Reported by PMD.

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

Line: 34

               */
public final class CompletableAndThenPublisher<R> extends Flowable<R> {

    final CompletableSource source;

    final Publisher<? extends R> other;

    public CompletableAndThenPublisher(CompletableSource source,
            Publisher<? extends R> other) {

            

Reported by PMD.

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

Line: 36

              
    final CompletableSource source;

    final Publisher<? extends R> other;

    public CompletableAndThenPublisher(CompletableSource source,
            Publisher<? extends R> other) {
        this.source = source;
        this.other = other;

            

Reported by PMD.

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

Line: 55

              
        private static final long serialVersionUID = -8948264376121066672L;

        final Subscriber<? super R> downstream;

        Publisher<? extends R> other;

        Disposable upstream;


            

Reported by PMD.

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

Line: 57

              
        final Subscriber<? super R> downstream;

        Publisher<? extends R> other;

        Disposable upstream;

        final AtomicLong requested;


            

Reported by PMD.

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

Line: 59

              
        Publisher<? extends R> other;

        Disposable upstream;

        final AtomicLong requested;

        AndThenPublisherSubscriber(Subscriber<? super R> downstream, Publisher<? extends R> other) {
            this.downstream = downstream;

            

Reported by PMD.

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

Line: 61

              
        Disposable upstream;

        final AtomicLong requested;

        AndThenPublisherSubscriber(Subscriber<? super R> downstream, Publisher<? extends R> other) {
            this.downstream = downstream;
            this.other = other;
            this.requested = new AtomicLong();

            

Reported by PMD.

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

Line: 85

                          if (p == null) {
                downstream.onComplete();
            } else {
                other = null;
                p.subscribe(this);
            }
        }

        @Override

            

Reported by PMD.

Avoid unused imports such as 'org.reactivestreams'
Design

Line: 18

              
import java.util.concurrent.atomic.*;

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.

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

Line: 20

              
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/flowable/FlowableOnBackpressureDrop.java
9 issues
Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 29

              
public final class FlowableOnBackpressureDrop<T> extends AbstractFlowableWithUpstream<T, T> implements Consumer<T> {

    final Consumer<? super T> onDrop;

    public FlowableOnBackpressureDrop(Flowable<T> source) {
        super(source);
        this.onDrop = this;
    }

            

Reported by PMD.

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

Line: 56

              
        private static final long serialVersionUID = -6246093802440953054L;

        final Subscriber<? super T> downstream;
        final Consumer<? super T> onDrop;

        Subscription upstream;

        boolean done;

            

Reported by PMD.

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

Line: 57

                      private static final long serialVersionUID = -6246093802440953054L;

        final Subscriber<? super T> downstream;
        final Consumer<? super T> onDrop;

        Subscription upstream;

        boolean done;


            

Reported by PMD.

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

Line: 59

                      final Subscriber<? super T> downstream;
        final Consumer<? super T> onDrop;

        Subscription upstream;

        boolean done;

        BackpressureDropSubscriber(Subscriber<? super T> actual, Consumer<? super T> onDrop) {
            this.downstream = actual;

            

Reported by PMD.

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

Line: 61

              
        Subscription upstream;

        boolean done;

        BackpressureDropSubscriber(Subscriber<? super T> actual, Consumer<? super T> onDrop) {
            this.downstream = actual;
            this.onDrop = onDrop;
        }

            

Reported by PMD.

Avoid using Literals in Conditional Statements
Error

Line: 83

                              return;
            }
            long r = get();
            if (r != 0L) {
                downstream.onNext(t);
                BackpressureHelper.produced(this, 1);
            } else {
                try {
                    onDrop.accept(t);

            

Reported by PMD.

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

Line: 89

                          } else {
                try {
                    onDrop.accept(t);
                } catch (Throwable e) {
                    Exceptions.throwIfFatal(e);
                    cancel();
                    onError(e);
                }
            }

            

Reported by PMD.

Avoid unused imports such as 'org.reactivestreams'
Design

Line: 18

              
import java.util.concurrent.atomic.AtomicLong;

import org.reactivestreams.*;

import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.exceptions.Exceptions;
import io.reactivex.rxjava3.functions.Consumer;
import io.reactivex.rxjava3.internal.subscriptions.SubscriptionHelper;

            

Reported by PMD.

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

Line: 20

              
import org.reactivestreams.*;

import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.exceptions.Exceptions;
import io.reactivex.rxjava3.functions.Consumer;
import io.reactivex.rxjava3.internal.subscriptions.SubscriptionHelper;
import io.reactivex.rxjava3.internal.util.BackpressureHelper;
import io.reactivex.rxjava3.plugins.RxJavaPlugins;

            

Reported by PMD.

src/jmh/java/io/reactivex/rxjava3/core/BlockingGetPerf.java
9 issues
Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 27

              @Fork(value = 1)
@State(Scope.Thread)
public class BlockingGetPerf {
    Flowable<Integer> flowable;

    Observable<Integer> observable;

    Single<Integer> single;


            

Reported by PMD.

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

Line: 29

              public class BlockingGetPerf {
    Flowable<Integer> flowable;

    Observable<Integer> observable;

    Single<Integer> single;

    Maybe<Integer> maybe;


            

Reported by PMD.

Field single has the same name as a method
Error

Line: 31

              
    Observable<Integer> observable;

    Single<Integer> single;

    Maybe<Integer> maybe;

    Completable completable;


            

Reported by PMD.

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

Line: 31

              
    Observable<Integer> observable;

    Single<Integer> single;

    Maybe<Integer> maybe;

    Completable completable;


            

Reported by PMD.

Field maybe has the same name as a method
Error

Line: 33

              
    Single<Integer> single;

    Maybe<Integer> maybe;

    Completable completable;

    @Setup
    public void setup() {

            

Reported by PMD.

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

Line: 33

              
    Single<Integer> single;

    Maybe<Integer> maybe;

    Completable completable;

    @Setup
    public void setup() {

            

Reported by PMD.

Field completable has the same name as a method
Error

Line: 35

              
    Maybe<Integer> maybe;

    Completable completable;

    @Setup
    public void setup() {
        flowable = Flowable.just(1);


            

Reported by PMD.

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

Line: 35

              
    Maybe<Integer> maybe;

    Completable completable;

    @Setup
    public void setup() {
        flowable = Flowable.just(1);


            

Reported by PMD.

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

Line: 18

              
import java.util.concurrent.TimeUnit;

import org.openjdk.jmh.annotations.*;

@BenchmarkMode(Mode.Throughput)
@Warmup(iterations = 5)
@Measurement(iterations = 5, time = 5, timeUnit = TimeUnit.SECONDS)
@OutputTimeUnit(TimeUnit.SECONDS)

            

Reported by PMD.

src/main/java/io/reactivex/rxjava3/internal/observers/DisposableLambdaObserver.java
9 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 DisposableLambdaObserver<T> implements Observer<T>, Disposable {
    final Observer<? super T> downstream;
    final Consumer<? super Disposable> onSubscribe;
    final Action onDispose;

    Disposable upstream;


            

Reported by PMD.

Field onSubscribe has the same name as a method
Error

Line: 25

              
public final class DisposableLambdaObserver<T> implements Observer<T>, Disposable {
    final Observer<? super T> downstream;
    final Consumer<? super Disposable> onSubscribe;
    final Action onDispose;

    Disposable upstream;

    public DisposableLambdaObserver(Observer<? super T> actual,

            

Reported by PMD.

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

Line: 25

              
public final class DisposableLambdaObserver<T> implements Observer<T>, Disposable {
    final Observer<? super T> downstream;
    final Consumer<? super Disposable> onSubscribe;
    final Action onDispose;

    Disposable upstream;

    public DisposableLambdaObserver(Observer<? super T> actual,

            

Reported by PMD.

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

Line: 26

              public final class DisposableLambdaObserver<T> implements Observer<T>, Disposable {
    final Observer<? super T> downstream;
    final Consumer<? super Disposable> onSubscribe;
    final Action onDispose;

    Disposable upstream;

    public DisposableLambdaObserver(Observer<? super T> actual,
            Consumer<? super Disposable> onSubscribe,

            

Reported by PMD.

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

Line: 28

                  final Consumer<? super Disposable> onSubscribe;
    final Action onDispose;

    Disposable upstream;

    public DisposableLambdaObserver(Observer<? super T> actual,
            Consumer<? super Disposable> onSubscribe,
            Action onDispose) {
        this.downstream = actual;

            

Reported by PMD.

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

Line: 43

                      // this way, multiple calls to onSubscribe can show up in tests that use doOnSubscribe to validate behavior
        try {
            onSubscribe.accept(d);
        } catch (Throwable e) {
            Exceptions.throwIfFatal(e);
            d.dispose();
            this.upstream = DisposableHelper.DISPOSED;
            EmptyDisposable.error(e, downstream);
            return;

            

Reported by PMD.

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

Line: 86

                          upstream = DisposableHelper.DISPOSED;
            try {
                onDispose.run();
            } catch (Throwable e) {
                Exceptions.throwIfFatal(e);
                RxJavaPlugins.onError(e);
            }
            d.dispose();
        }

            

Reported by PMD.

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

Line: 19

              import io.reactivex.rxjava3.core.Observer;
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;

public final class DisposableLambdaObserver<T> implements Observer<T>, Disposable {
    final Observer<? super T> downstream;

            

Reported by PMD.

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

Line: 20

              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;

public final class DisposableLambdaObserver<T> implements Observer<T>, Disposable {
    final Observer<? super T> downstream;
    final Consumer<? super Disposable> onSubscribe;

            

Reported by PMD.

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

Line: 60

                  }

    @Override
    public void subscribe(Subscriber<? super R>[] 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: 31

               */
public final class ParallelFlatMap<T, R> extends ParallelFlowable<R> {

    final ParallelFlowable<T> source;

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

    final boolean delayError;


            

Reported by PMD.

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

Line: 33

              
    final ParallelFlowable<T> source;

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

    final boolean delayError;

    final int maxConcurrency;


            

Reported by PMD.

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

Line: 35

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

    final boolean delayError;

    final int maxConcurrency;

    final int prefetch;


            

Reported by PMD.

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

Line: 37

              
    final boolean delayError;

    final int maxConcurrency;

    final int prefetch;

    public ParallelFlatMap(
            ParallelFlowable<T> source,

            

Reported by PMD.

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

Line: 39

              
    final int maxConcurrency;

    final int prefetch;

    public ParallelFlatMap(
            ParallelFlowable<T> source,
            Function<? super T, ? extends Publisher<? extends R>> mapper,
            boolean delayError,

            

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.functions.Function;
import io.reactivex.rxjava3.internal.operators.flowable.FlowableFlatMap;
import io.reactivex.rxjava3.parallel.ParallelFlowable;
import io.reactivex.rxjava3.plugins.RxJavaPlugins;

            

Reported by PMD.

Found 'DD'-anomaly for variable 'parents' (lines '70'-'73').
Error

Line: 70

                      int n = subscribers.length;

        @SuppressWarnings("unchecked")
        final Subscriber<T>[] parents = new Subscriber[n];

        for (int i = 0; i < n; i++) {
            parents[i] = FlowableFlatMap.subscribe(subscribers[i], mapper, delayError, maxConcurrency, prefetch);
        }


            

Reported by PMD.

Found 'DD'-anomaly for variable 'parents' (lines '73'-'73').
Error

Line: 73

                      final Subscriber<T>[] parents = new Subscriber[n];

        for (int i = 0; i < n; i++) {
            parents[i] = FlowableFlatMap.subscribe(subscribers[i], mapper, delayError, maxConcurrency, prefetch);
        }

        source.subscribe(parents);
    }
}

            

Reported by PMD.

src/main/java/io/reactivex/rxjava3/internal/operators/maybe/MaybeDoOnTerminate.java
9 issues
Avoid reassigning parameters such as 'e'
Design

Line: 63

                      }

        @Override
        public void onError(Throwable e) {
            try {
                onTerminate.run();
            } catch (Throwable ex) {
                Exceptions.throwIfFatal(ex);
                e = new CompositeException(e, ex);

            

Reported by PMD.

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

Line: 23

              
public final class MaybeDoOnTerminate<T> extends Maybe<T> {

    final MaybeSource<T> source;

    final Action onTerminate;

    public MaybeDoOnTerminate(MaybeSource<T> source, Action onTerminate) {
        this.source = source;

            

Reported by PMD.

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

Line: 25

              
    final MaybeSource<T> source;

    final Action onTerminate;

    public MaybeDoOnTerminate(MaybeSource<T> source, Action onTerminate) {
        this.source = source;
        this.onTerminate = onTerminate;
    }

            

Reported by PMD.

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

Line: 38

                  }

    final class DoOnTerminate implements MaybeObserver<T> {
        final MaybeObserver<? super T> downstream;

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


            

Reported by PMD.

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

Line: 53

                      public void onSuccess(T value) {
            try {
                onTerminate.run();
            } 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: 66

                      public void onError(Throwable e) {
            try {
                onTerminate.run();
            } catch (Throwable ex) {
                Exceptions.throwIfFatal(ex);
                e = new CompositeException(e, ex);
            }

            downstream.onError(e);

            

Reported by PMD.

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

Line: 78

                      public void onComplete() {
            try {
                onTerminate.run();
            } catch (Throwable ex) {
                Exceptions.throwIfFatal(ex);
                downstream.onError(ex);
                return;
            }


            

Reported by PMD.

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

Line: 16

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

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

public final class MaybeDoOnTerminate<T> extends Maybe<T> {

            

Reported by PMD.

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

Line: 18

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

public final class MaybeDoOnTerminate<T> extends Maybe<T> {

    final MaybeSource<T> source;

            

Reported by PMD.

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

Line: 26

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

public final class SingleFlatMap<T, R> extends Single<R> {
    final SingleSource<? extends T> source;

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

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

            

Reported by PMD.

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

Line: 28

              public final class SingleFlatMap<T, R> extends Single<R> {
    final SingleSource<? extends T> source;

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

    public SingleFlatMap(SingleSource<? extends T> source, Function<? super T, ? extends SingleSource<? extends R>> mapper) {
        this.mapper = mapper;
        this.source = source;
    }

            

Reported by PMD.

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

Line: 45

                  implements SingleObserver<T>, Disposable {
        private static final long serialVersionUID = 3258103020495908596L;

        final SingleObserver<? super R> downstream;

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

        SingleFlatMapCallback(SingleObserver<? super R> actual,
                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: 47

              
        final SingleObserver<? super R> downstream;

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

        SingleFlatMapCallback(SingleObserver<? super R> actual,
                Function<? super T, ? extends SingleSource<? extends R>> mapper) {
            this.downstream = actual;
            this.mapper = mapper;

            

Reported by PMD.

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

Line: 78

              
            try {
                o = Objects.requireNonNull(mapper.apply(value), "The single returned by the mapper is null");
            } catch (Throwable e) {
                Exceptions.throwIfFatal(e);
                downstream.onError(e);
                return;
            }


            

Reported by PMD.

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

Line: 96

              
        static final class FlatMapSingleObserver<R> implements SingleObserver<R> {

            final AtomicReference<Disposable> parent;

            final SingleObserver<? super R> downstream;

            FlatMapSingleObserver(AtomicReference<Disposable> parent, SingleObserver<? super R> downstream) {
                this.parent = parent;

            

Reported by PMD.

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

Line: 98

              
            final AtomicReference<Disposable> parent;

            final SingleObserver<? super R> downstream;

            FlatMapSingleObserver(AtomicReference<Disposable> parent, SingleObserver<? super R> downstream) {
                this.parent = parent;
                this.downstream = downstream;
            }

            

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.Exceptions;
import io.reactivex.rxjava3.functions.Function;
import io.reactivex.rxjava3.internal.disposables.DisposableHelper;


            

Reported by PMD.

Found 'DU'-anomaly for variable 'o' (lines '77'-'87').
Error

Line: 77

                          SingleSource<? extends R> o;

            try {
                o = Objects.requireNonNull(mapper.apply(value), "The single returned by the mapper is null");
            } catch (Throwable e) {
                Exceptions.throwIfFatal(e);
                downstream.onError(e);
                return;
            }

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/completable/CompletableUnsafeTest.java
9 issues
Avoid throwing null pointer exceptions.
Design

Line: 58

                      Completable.unsafeCreate(new CompletableSource() {
            @Override
            public void subscribe(CompletableObserver observer) {
                throw new NullPointerException();
            }
        }).test();
    }

    @Test

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 36

              
    @Test
    public void wrapAlreadyCompletable() {
        assertSame(Completable.complete(), Completable.wrap(Completable.complete()));
    }

    @Test
    public void wrapCustomCompletable() {


            

Reported by PMD.

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

Line: 40

                  }

    @Test
    public void wrapCustomCompletable() {

        Completable.wrap(new CompletableSource() {
            @Override
            public void subscribe(CompletableObserver observer) {
                observer.onSubscribe(Disposable.empty());

            

Reported by PMD.

Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block
Design

Line: 74

                              }
            }).test();
            fail("Should have thrown!");
        } catch (NullPointerException ex) {
            if (!(ex.getCause() instanceof IllegalArgumentException)) {
                fail(ex.toString() + ": should have thrown NPA(IAE)");
            }

            TestHelper.assertError(errors, 0, IllegalArgumentException.class);

            

Reported by PMD.

Avoid catching NullPointerException; consider removing the cause of the NPE.
Error

Line: 74

                              }
            }).test();
            fail("Should have thrown!");
        } catch (NullPointerException ex) {
            if (!(ex.getCause() instanceof IllegalArgumentException)) {
                fail(ex.toString() + ": should have thrown NPA(IAE)");
            }

            TestHelper.assertError(errors, 0, IllegalArgumentException.class);

            

Reported by PMD.

Avoid unused imports such as 'org.junit.Assert'
Design

Line: 16

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

import static org.junit.Assert.*;

import java.util.List;

import io.reactivex.rxjava3.disposables.Disposable;
import org.junit.Test;

            

Reported by PMD.

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

Line: 23

              import io.reactivex.rxjava3.disposables.Disposable;
import org.junit.Test;

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

public class CompletableUnsafeTest extends RxJavaTest {


            

Reported by PMD.

Found 'DU'-anomaly for variable 'errors' (lines '65'-'83').
Error

Line: 65

              
    @Test
    public void unsafeCreateThrowsIAE() {
        List<Throwable> errors = TestHelper.trackPluginErrors();
        try {
            Completable.unsafeCreate(new CompletableSource() {
                @Override
                public void subscribe(CompletableObserver observer) {
                    throw new IllegalArgumentException();

            

Reported by PMD.

Found 'DU'-anomaly for variable 'errors' (lines '65'-'83').
Error

Line: 65

              
    @Test
    public void unsafeCreateThrowsIAE() {
        List<Throwable> errors = TestHelper.trackPluginErrors();
        try {
            Completable.unsafeCreate(new CompletableSource() {
                @Override
                public void subscribe(CompletableObserver observer) {
                    throw new IllegalArgumentException();

            

Reported by PMD.