The following issues were found

src/main/java/io/reactivex/rxjava3/core/SingleEmitter.java
2 issues
Avoid unused imports such as 'io.reactivex.rxjava3.annotations'
Design

Line: 16

              
package io.reactivex.rxjava3.core;

import io.reactivex.rxjava3.annotations.*;
import io.reactivex.rxjava3.disposables.Disposable;
import io.reactivex.rxjava3.functions.*;

/**
 * Abstraction over an RxJava {@link SingleObserver} that allows associating

            

Reported by PMD.

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

Line: 18

              
import io.reactivex.rxjava3.annotations.*;
import io.reactivex.rxjava3.disposables.Disposable;
import io.reactivex.rxjava3.functions.*;

/**
 * Abstraction over an RxJava {@link SingleObserver} that allows associating
 * a resource with it.
 * <p>

            

Reported by PMD.

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

Line: 26

               */
public final class CompletableToObservable<T> extends Observable<T> {

    final CompletableSource source;

    public CompletableToObservable(CompletableSource source) {
        this.source = source;
    }


            

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.internal.operators.observable.ObservableFromCompletable;

/**
 * Wraps a Completable and exposes it as an Observable.
 *

            

Reported by PMD.

src/main/java/io/reactivex/rxjava3/internal/operators/flowable/AbstractFlowableWithUpstream.java
2 issues
Field source has the same name as a method
Error

Line: 35

                  /**
     * The upstream source Publisher.
     */
    protected final Flowable<T> source;

    /**
     * Constructs a FlowableSource wrapping the given non-null (verified)
     * source Publisher.
     * @param source the source (upstream) Publisher instance, not null (verified)

            

Reported by PMD.

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

Line: 35

                  /**
     * The upstream source Publisher.
     */
    protected final Flowable<T> source;

    /**
     * Constructs a FlowableSource wrapping the given non-null (verified)
     * source Publisher.
     * @param source the source (upstream) Publisher instance, not null (verified)

            

Reported by PMD.

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

Line: 32

               */
public final class FlowableFromCompletionStage<T> extends Flowable<T> {

    final CompletionStage<T> stage;

    public FlowableFromCompletionStage(CompletionStage<T> stage) {
        this.stage = stage;
    }


            

Reported by PMD.

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

Line: 56

              
        private static final long serialVersionUID = 4665335664328839859L;

        final BiConsumerAtomicReference<T> whenReference;

        CompletionStageHandler(Subscriber<? super T> downstream, BiConsumerAtomicReference<T> whenReference) {
            super(downstream);
            this.whenReference = whenReference;
        }

            

Reported by PMD.

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

Line: 33

              
    private static final long serialVersionUID = 7028635084060361255L;

    final AtomicReference<Subscription> actual;

    final AtomicReference<Disposable> resource;

    public AsyncSubscription() {
        resource = new AtomicReference<>();

            

Reported by PMD.

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

Line: 35

              
    final AtomicReference<Subscription> actual;

    final AtomicReference<Disposable> resource;

    public AsyncSubscription() {
        resource = new AtomicReference<>();
        actual = new AtomicReference<>();
    }

            

Reported by PMD.

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

Line: 27

               */
public final class ObservableLastStageObserver<T> extends ObservableStageObserver<T> {

    final boolean hasDefault;

    final T defaultItem;

    public ObservableLastStageObserver(boolean hasDefault, T defaultItem) {
        this.hasDefault = hasDefault;

            

Reported by PMD.

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

Line: 29

              
    final boolean hasDefault;

    final T defaultItem;

    public ObservableLastStageObserver(boolean hasDefault, T defaultItem) {
        this.hasDefault = hasDefault;
        this.defaultItem = defaultItem;
    }

            

Reported by PMD.

src/main/java/io/reactivex/rxjava3/disposables/FutureDisposable.java
2 issues
Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 26

              
    private static final long serialVersionUID = 6545242830671168775L;

    private final boolean allowInterrupt;

    FutureDisposable(Future<?> run, boolean allowInterrupt) {
        super(run);
        this.allowInterrupt = allowInterrupt;
    }

            

Reported by PMD.

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

Line: 36

                  @Override
    public boolean isDisposed() {
        Future<?> f = get();
        return f == null || f.isDone();
    }

    @Override
    public void dispose() {
        Future<?> f = getAndSet(null);

            

Reported by PMD.

src/main/java/io/reactivex/rxjava3/internal/util/BlockingHelper.java
2 issues
Potential violation of Law of Demeter (method chain calls)
Design

Line: 45

                          subscription.dispose();
            // set the interrupted flag again so callers can still get it
            // for more information see https://github.com/ReactiveX/RxJava/pull/147#issuecomment-13624780
            Thread.currentThread().interrupt();
            // using Runtime so it is not checked
            throw new IllegalStateException("Interrupted while waiting for subscription to complete.", e);
        }
    }


            

Reported by PMD.

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

Line: 60

                      if (RxJavaPlugins.isFailOnNonBlockingScheduler()
                && (Thread.currentThread() instanceof NonBlockingThread
                        || RxJavaPlugins.onBeforeBlocking())) {
            throw new IllegalStateException("Attempt to block on a Scheduler " + Thread.currentThread().getName() + " that doesn't support blocking operators as they may lead to deadlock");
        }
    }
}

            

Reported by PMD.

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

Line: 26

              public final class BlockingIgnoringReceiver
extends CountDownLatch
implements Consumer<Throwable>, Action {
    public Throwable error;

    public BlockingIgnoringReceiver() {
        super(1);
    }


            

Reported by PMD.

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

Line: 18

              
import java.util.concurrent.CountDownLatch;

import io.reactivex.rxjava3.functions.*;

/**
 * Stores an incoming Throwable (if any) and counts itself down.
 */
public final class BlockingIgnoringReceiver

            

Reported by PMD.

src/main/java/io/reactivex/rxjava3/internal/util/EmptyComponent.java
2 issues
Avoid unused imports such as 'org.reactivestreams'
Design

Line: 16

              
package io.reactivex.rxjava3.internal.util;

import org.reactivestreams.*;

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


            

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.disposables.Disposable;
import io.reactivex.rxjava3.plugins.RxJavaPlugins;

/**
 * Singleton implementing many interfaces as empty.

            

Reported by PMD.