The following issues were found

src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableAllTest.java
59 issues
This class has a bunch of public methods and attributes
Design

Line: 14

               * the License for the specific language governing permissions and limitations under the License.
 */

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

import static org.junit.Assert.*;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.*;


            

Reported by PMD.

This class has too many methods, consider refactoring it.
Design

Line: 36

              import io.reactivex.rxjava3.subscribers.TestSubscriber;
import io.reactivex.rxjava3.testsupport.*;

public class FlowableAllTest extends RxJavaTest {

    @Test
    public void all() {
        Flowable<String> obs = Flowable.just("one", "two", "six");


            

Reported by PMD.

The String literal 'two' appears 4 times in this file; the first occurrence is on line 40
Error

Line: 40

              
    @Test
    public void all() {
        Flowable<String> obs = Flowable.just("one", "two", "six");

        SingleObserver<Boolean> observer = TestHelper.mockSingleObserver();

        obs.all(new Predicate<String>() {
            @Override

            

Reported by PMD.

The String literal 'six' appears 4 times in this file; the first occurrence is on line 40
Error

Line: 40

              
    @Test
    public void all() {
        Flowable<String> obs = Flowable.just("one", "two", "six");

        SingleObserver<Boolean> observer = TestHelper.mockSingleObserver();

        obs.all(new Predicate<String>() {
            @Override

            

Reported by PMD.

The String literal 'one' appears 4 times in this file; the first occurrence is on line 40
Error

Line: 40

              
    @Test
    public void all() {
        Flowable<String> obs = Flowable.just("one", "two", "six");

        SingleObserver<Boolean> observer = TestHelper.mockSingleObserver();

        obs.all(new Predicate<String>() {
            @Override

            

Reported by PMD.

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

Line: 53

                      .subscribe(observer);

        verify(observer).onSubscribe((Disposable)any());
        verify(observer).onSuccess(true);
        verifyNoMoreInteractions(observer);
    }

    @Test
    public void notAll() {

            

Reported by PMD.

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

Line: 72

                      .subscribe(observer);

        verify(observer).onSubscribe((Disposable)any());
        verify(observer).onSuccess(false);
        verifyNoMoreInteractions(observer);
    }

    @Test
    public void empty() {

            

Reported by PMD.

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

Line: 91

                      .subscribe(observer);

        verify(observer).onSubscribe((Disposable)any());
        verify(observer).onSuccess(true);
        verifyNoMoreInteractions(observer);
    }

    @Test
    public void error() {

            

Reported by PMD.

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

Line: 111

                      .subscribe(observer);

        verify(observer).onSubscribe((Disposable)any());
        verify(observer).onError(error);
        verifyNoMoreInteractions(observer);
    }

    @Test
    public void followingFirst() {

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 125

                          }
        });

        assertFalse(allOdd.blockingGet());
    }

    @Test
    public void issue1935NoUnsubscribeDownstream() {
        Flowable<Integer> source = Flowable.just(1)

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableTakeTimedTest.java
58 issues
Potential violation of Law of Demeter (object not created locally)
Design

Line: 39

              
        PublishProcessor<Integer> source = PublishProcessor.create();

        Flowable<Integer> result = source.take(1, TimeUnit.SECONDS, scheduler);

        Subscriber<Object> subscriber = TestHelper.mockSubscriber();

        result.subscribe(subscriber);


            

Reported by PMD.

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

Line: 43

              
        Subscriber<Object> subscriber = TestHelper.mockSubscriber();

        result.subscribe(subscriber);

        source.onNext(1);
        source.onNext(2);
        source.onNext(3);


            

Reported by PMD.

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

Line: 45

              
        result.subscribe(subscriber);

        source.onNext(1);
        source.onNext(2);
        source.onNext(3);

        scheduler.advanceTimeBy(1, TimeUnit.SECONDS);


            

Reported by PMD.

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

Line: 46

                      result.subscribe(subscriber);

        source.onNext(1);
        source.onNext(2);
        source.onNext(3);

        scheduler.advanceTimeBy(1, TimeUnit.SECONDS);

        source.onNext(4);

            

Reported by PMD.

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

Line: 47

              
        source.onNext(1);
        source.onNext(2);
        source.onNext(3);

        scheduler.advanceTimeBy(1, TimeUnit.SECONDS);

        source.onNext(4);


            

Reported by PMD.

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

Line: 51

              
        scheduler.advanceTimeBy(1, TimeUnit.SECONDS);

        source.onNext(4);

        InOrder inOrder = inOrder(subscriber);
        inOrder.verify(subscriber).onNext(1);
        inOrder.verify(subscriber).onNext(2);
        inOrder.verify(subscriber).onNext(3);

            

Reported by PMD.

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

Line: 54

                      source.onNext(4);

        InOrder inOrder = inOrder(subscriber);
        inOrder.verify(subscriber).onNext(1);
        inOrder.verify(subscriber).onNext(2);
        inOrder.verify(subscriber).onNext(3);
        inOrder.verify(subscriber).onComplete();
        inOrder.verifyNoMoreInteractions();


            

Reported by PMD.

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

Line: 54

                      source.onNext(4);

        InOrder inOrder = inOrder(subscriber);
        inOrder.verify(subscriber).onNext(1);
        inOrder.verify(subscriber).onNext(2);
        inOrder.verify(subscriber).onNext(3);
        inOrder.verify(subscriber).onComplete();
        inOrder.verifyNoMoreInteractions();


            

Reported by PMD.

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

Line: 55

              
        InOrder inOrder = inOrder(subscriber);
        inOrder.verify(subscriber).onNext(1);
        inOrder.verify(subscriber).onNext(2);
        inOrder.verify(subscriber).onNext(3);
        inOrder.verify(subscriber).onComplete();
        inOrder.verifyNoMoreInteractions();

        verify(subscriber, never()).onNext(4);

            

Reported by PMD.

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

Line: 55

              
        InOrder inOrder = inOrder(subscriber);
        inOrder.verify(subscriber).onNext(1);
        inOrder.verify(subscriber).onNext(2);
        inOrder.verify(subscriber).onNext(3);
        inOrder.verify(subscriber).onComplete();
        inOrder.verifyNoMoreInteractions();

        verify(subscriber, never()).onNext(4);

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/maybe/MaybeStartWithTest.java
58 issues
This class has too many methods, consider refactoring it.
Design

Line: 23

              import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.exceptions.TestException;

public class MaybeStartWithTest {

    @Test
    public void justCompletableComplete() {
        Maybe.just(1).startWith(Completable.complete())
        .test()

            

Reported by PMD.

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

Line: 26

              public class MaybeStartWithTest {

    @Test
    public void justCompletableComplete() {
        Maybe.just(1).startWith(Completable.complete())
        .test()
        .assertResult(1);
    }


            

Reported by PMD.

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

Line: 27

              
    @Test
    public void justCompletableComplete() {
        Maybe.just(1).startWith(Completable.complete())
        .test()
        .assertResult(1);
    }

    @Test

            

Reported by PMD.

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

Line: 27

              
    @Test
    public void justCompletableComplete() {
        Maybe.just(1).startWith(Completable.complete())
        .test()
        .assertResult(1);
    }

    @Test

            

Reported by PMD.

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

Line: 27

              
    @Test
    public void justCompletableComplete() {
        Maybe.just(1).startWith(Completable.complete())
        .test()
        .assertResult(1);
    }

    @Test

            

Reported by PMD.

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

Line: 33

                  }

    @Test
    public void emptyCompletableComplete() {
        Maybe.empty().startWith(Completable.complete())
        .test()
        .assertResult();
    }


            

Reported by PMD.

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

Line: 34

              
    @Test
    public void emptyCompletableComplete() {
        Maybe.empty().startWith(Completable.complete())
        .test()
        .assertResult();
    }

    @Test

            

Reported by PMD.

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

Line: 34

              
    @Test
    public void emptyCompletableComplete() {
        Maybe.empty().startWith(Completable.complete())
        .test()
        .assertResult();
    }

    @Test

            

Reported by PMD.

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

Line: 34

              
    @Test
    public void emptyCompletableComplete() {
        Maybe.empty().startWith(Completable.complete())
        .test()
        .assertResult();
    }

    @Test

            

Reported by PMD.

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

Line: 47

                      .test()
        .assertFailure(TestException.class);

        verify(run, never()).run();
    }

    @Test
    public void justSingleJust() {
        Maybe.just(1).startWith(Single.just(2))

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/validators/JavadocFindUnescapedAngleBrackets.java
58 issues
Avoid throwing raw exception types.
Design

Line: 113

                      if (b.length() > 0) {
            System.err.println("Should escape < and > in <code> blocks! " + count);
            System.err.println(b);
            throw new Exception("Should escape < and > in <code> blocks! " + count + "\r\n" + b);
        }
    }

    static int countLine(String s, int kdx) {
        int c = 1;

            

Reported by PMD.

Avoid instantiating FileInputStream, FileOutputStream, FileReader, or FileWriter
Performance

Line: 129

              
    static String readFile(File f) throws IOException {
        StringBuilder b = new StringBuilder((int)f.length());
        BufferedReader in = new BufferedReader(new FileReader(f));
        try {
            String line = null;

            while ((line = in.readLine()) != null) {
                b.append(line).append("\n");

            

Reported by PMD.

System.err.println is used
Design

Line: 111

                      }

        if (b.length() > 0) {
            System.err.println("Should escape < and > in <code> blocks! " + count);
            System.err.println(b);
            throw new Exception("Should escape < and > in <code> blocks! " + count + "\r\n" + b);
        }
    }


            

Reported by PMD.

System.err.println is used
Design

Line: 112

              
        if (b.length() > 0) {
            System.err.println("Should escape < and > in <code> blocks! " + count);
            System.err.println(b);
            throw new Exception("Should escape < and > in <code> blocks! " + count + "\r\n" + b);
        }
    }

    static int countLine(String s, int kdx) {

            

Reported by PMD.

The class 'JavadocFindUnescapedAngleBrackets' has a Modified Cyclomatic Complexity of 7 (Highest = 14).
Design

Line: 23

              
import io.reactivex.rxjava3.testsupport.TestHelper;

public class JavadocFindUnescapedAngleBrackets {

    @Test
    public void find() throws Exception {
        File base = TestHelper.findSource("Flowable");


            

Reported by PMD.

The class 'JavadocFindUnescapedAngleBrackets' has a Standard Cyclomatic Complexity of 7 (Highest = 14).
Design

Line: 23

              
import io.reactivex.rxjava3.testsupport.TestHelper;

public class JavadocFindUnescapedAngleBrackets {

    @Test
    public void find() throws Exception {
        File base = TestHelper.findSource("Flowable");


            

Reported by PMD.

A method/constructor should not explicitly throw java.lang.Exception
Design

Line: 26

              public class JavadocFindUnescapedAngleBrackets {

    @Test
    public void find() throws Exception {
        File base = TestHelper.findSource("Flowable");

        if (base == null) {
            return;
        }

            

Reported by PMD.

The method 'find' has a Modified Cyclomatic Complexity of 14.
Design

Line: 26

              public class JavadocFindUnescapedAngleBrackets {

    @Test
    public void find() throws Exception {
        File base = TestHelper.findSource("Flowable");

        if (base == null) {
            return;
        }

            

Reported by PMD.

The method 'find' has a Standard Cyclomatic Complexity of 14.
Design

Line: 26

              public class JavadocFindUnescapedAngleBrackets {

    @Test
    public void find() throws Exception {
        File base = TestHelper.findSource("Flowable");

        if (base == null) {
            return;
        }

            

Reported by PMD.

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

Line: 26

              public class JavadocFindUnescapedAngleBrackets {

    @Test
    public void find() throws Exception {
        File base = TestHelper.findSource("Flowable");

        if (base == null) {
            return;
        }

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/subscriptions/SubscriptionHelperTest.java
58 issues
JUnit tests should include assert() or fail()
Design

Line: 34

              public class SubscriptionHelperTest extends RxJavaTest {

    @Test
    public void checkEnum() {
        TestHelper.checkEnum(SubscriptionHelper.class);
    }

    @Test
    public void validateNullThrows() {

            

Reported by PMD.

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

Line: 39

                  }

    @Test
    public void validateNullThrows() {
        List<Throwable> errors = TestHelper.trackPluginErrors();
        try {
            SubscriptionHelper.validate(null, null);

            TestHelper.assertError(errors, 0, NullPointerException.class, "next is null");

            

Reported by PMD.

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

Line: 51

                  }

    @Test
    public void cancelNoOp() {
        SubscriptionHelper.CANCELLED.cancel();
    }

    @Test
    public void set() {

            

Reported by PMD.

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

Line: 52

              
    @Test
    public void cancelNoOp() {
        SubscriptionHelper.CANCELLED.cancel();
    }

    @Test
    public void set() {
        AtomicReference<Subscription> atomicSubscription = new AtomicReference<>();

            

Reported by PMD.

Unit tests should not contain more than 1 assert(s).
Design

Line: 56

                  }

    @Test
    public void set() {
        AtomicReference<Subscription> atomicSubscription = new AtomicReference<>();

        BooleanSubscription bs1 = new BooleanSubscription();

        assertTrue(SubscriptionHelper.set(atomicSubscription, bs1));

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 61

              
        BooleanSubscription bs1 = new BooleanSubscription();

        assertTrue(SubscriptionHelper.set(atomicSubscription, bs1));

        BooleanSubscription bs2 = new BooleanSubscription();

        assertTrue(SubscriptionHelper.set(atomicSubscription, bs2));


            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 65

              
        BooleanSubscription bs2 = new BooleanSubscription();

        assertTrue(SubscriptionHelper.set(atomicSubscription, bs2));

        assertTrue(bs1.isCancelled());

        assertFalse(bs2.isCancelled());
    }

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 67

              
        assertTrue(SubscriptionHelper.set(atomicSubscription, bs2));

        assertTrue(bs1.isCancelled());

        assertFalse(bs2.isCancelled());
    }

    @Test

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 69

              
        assertTrue(bs1.isCancelled());

        assertFalse(bs2.isCancelled());
    }

    @Test
    public void replace() {
        AtomicReference<Subscription> atomicSubscription = new AtomicReference<>();

            

Reported by PMD.

Unit tests should not contain more than 1 assert(s).
Design

Line: 73

                  }

    @Test
    public void replace() {
        AtomicReference<Subscription> atomicSubscription = new AtomicReference<>();

        BooleanSubscription bs1 = new BooleanSubscription();

        assertTrue(SubscriptionHelper.replace(atomicSubscription, bs1));

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableTakeTimedTest.java
58 issues
Potential violation of Law of Demeter (object not created locally)
Design

Line: 38

              
        PublishSubject<Integer> source = PublishSubject.create();

        Observable<Integer> result = source.take(1, TimeUnit.SECONDS, scheduler);

        Observer<Object> o = TestHelper.mockObserver();

        result.subscribe(o);


            

Reported by PMD.

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

Line: 42

              
        Observer<Object> o = TestHelper.mockObserver();

        result.subscribe(o);

        source.onNext(1);
        source.onNext(2);
        source.onNext(3);


            

Reported by PMD.

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

Line: 44

              
        result.subscribe(o);

        source.onNext(1);
        source.onNext(2);
        source.onNext(3);

        scheduler.advanceTimeBy(1, TimeUnit.SECONDS);


            

Reported by PMD.

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

Line: 45

                      result.subscribe(o);

        source.onNext(1);
        source.onNext(2);
        source.onNext(3);

        scheduler.advanceTimeBy(1, TimeUnit.SECONDS);

        source.onNext(4);

            

Reported by PMD.

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

Line: 46

              
        source.onNext(1);
        source.onNext(2);
        source.onNext(3);

        scheduler.advanceTimeBy(1, TimeUnit.SECONDS);

        source.onNext(4);


            

Reported by PMD.

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

Line: 50

              
        scheduler.advanceTimeBy(1, TimeUnit.SECONDS);

        source.onNext(4);

        InOrder inOrder = inOrder(o);
        inOrder.verify(o).onNext(1);
        inOrder.verify(o).onNext(2);
        inOrder.verify(o).onNext(3);

            

Reported by PMD.

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

Line: 53

                      source.onNext(4);

        InOrder inOrder = inOrder(o);
        inOrder.verify(o).onNext(1);
        inOrder.verify(o).onNext(2);
        inOrder.verify(o).onNext(3);
        inOrder.verify(o).onComplete();
        inOrder.verifyNoMoreInteractions();


            

Reported by PMD.

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

Line: 53

                      source.onNext(4);

        InOrder inOrder = inOrder(o);
        inOrder.verify(o).onNext(1);
        inOrder.verify(o).onNext(2);
        inOrder.verify(o).onNext(3);
        inOrder.verify(o).onComplete();
        inOrder.verifyNoMoreInteractions();


            

Reported by PMD.

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

Line: 54

              
        InOrder inOrder = inOrder(o);
        inOrder.verify(o).onNext(1);
        inOrder.verify(o).onNext(2);
        inOrder.verify(o).onNext(3);
        inOrder.verify(o).onComplete();
        inOrder.verifyNoMoreInteractions();

        verify(o, never()).onNext(4);

            

Reported by PMD.

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

Line: 54

              
        InOrder inOrder = inOrder(o);
        inOrder.verify(o).onNext(1);
        inOrder.verify(o).onNext(2);
        inOrder.verify(o).onNext(3);
        inOrder.verify(o).onComplete();
        inOrder.verifyNoMoreInteractions();

        verify(o, never()).onNext(4);

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/validators/JavadocForAnnotations.java
58 issues
Avoid instantiating FileInputStream, FileOutputStream, FileReader, or FileWriter
Performance

Line: 57

                  public static StringBuilder readFile(File f) throws Exception {
        StringBuilder b = new StringBuilder();

        BufferedReader in = new BufferedReader(new FileReader(f));
        try {
            for (;;) {
                String line = in.readLine();

                if (line == null) {

            

Reported by PMD.

System.out.println is used
Design

Line: 48

                      }

        if (e.length() != 0) {
            System.out.println(e);

            fail(e.toString());
        }
    }


            

Reported by PMD.

System.out.println is used
Design

Line: 198

                      scanForBadMethod(b, "@SchedulerSupport", "Scheduler:", e, baseClassName);

        if (e.length() != 0) {
            System.out.println(e);

            fail(e.toString());
        }
    }


            

Reported by PMD.

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

Line: 29

               * Checks the source code of the base reactive types and locates missing
 * mention of {@code Backpressure:} and {@code Scheduler:} of methods.
 */
public class JavadocForAnnotations {

    static void checkSource(String baseClassName, boolean scheduler) throws Exception {
        File f = TestHelper.findSource(baseClassName);
        if (f == null) {
            return;

            

Reported by PMD.

This class has too many methods, consider refactoring it.
Design

Line: 29

               * Checks the source code of the base reactive types and locates missing
 * mention of {@code Backpressure:} and {@code Scheduler:} of methods.
 */
public class JavadocForAnnotations {

    static void checkSource(String baseClassName, boolean scheduler) throws Exception {
        File f = TestHelper.findSource(baseClassName);
        if (f == null) {
            return;

            

Reported by PMD.

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

Line: 29

               * Checks the source code of the base reactive types and locates missing
 * mention of {@code Backpressure:} and {@code Scheduler:} of methods.
 */
public class JavadocForAnnotations {

    static void checkSource(String baseClassName, boolean scheduler) throws Exception {
        File f = TestHelper.findSource(baseClassName);
        if (f == null) {
            return;

            

Reported by PMD.

A method/constructor should not explicitly throw java.lang.Exception
Design

Line: 31

               */
public class JavadocForAnnotations {

    static void checkSource(String baseClassName, boolean scheduler) throws Exception {
        File f = TestHelper.findSource(baseClassName);
        if (f == null) {
            return;
        }


            

Reported by PMD.

A method/constructor should not explicitly throw java.lang.Exception
Design

Line: 54

                      }
    }

    public static StringBuilder readFile(File f) throws Exception {
        StringBuilder b = new StringBuilder();

        BufferedReader in = new BufferedReader(new FileReader(f));
        try {
            for (;;) {

            

Reported by PMD.

Consider using a try-with-resources statement instead of explicitly closing the resource
Design

Line: 58

                      StringBuilder b = new StringBuilder();

        BufferedReader in = new BufferedReader(new FileReader(f));
        try {
            for (;;) {
                String line = in.readLine();

                if (line == null) {
                    break;

            

Reported by PMD.

StringBuffer (or StringBuilder).append is called 2 consecutive times with literals. Use a single append with a single combined String.
Performance

Line: 94

              
                if (k < 0 || k > idx) {
                    // when printed on the console, IDEs will create a clickable link to help navigate to the offending point
                    e.append("java.lang.RuntimeException: missing ").append(inDoc).append(" section\r\n")
                    ;
                    int lc = lineNumber(sourceCode, idx);

                    e.append(" at io.reactivex.rxjava3.core.").append(baseClassName)
                    .append(" (").append(baseClassName).append(".java:")

            

Reported by PMD.

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

Line: 35

              public final class ObservableBufferTimed<T, U extends Collection<? super T>>
extends AbstractObservableWithUpstream<T, U> {

    final long timespan;
    final long timeskip;
    final TimeUnit unit;
    final Scheduler scheduler;
    final Supplier<U> bufferSupplier;
    final int maxSize;

            

Reported by PMD.

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

Line: 36

              extends AbstractObservableWithUpstream<T, U> {

    final long timespan;
    final long timeskip;
    final TimeUnit unit;
    final Scheduler scheduler;
    final Supplier<U> bufferSupplier;
    final int maxSize;
    final boolean restartTimerOnMaxSize;

            

Reported by PMD.

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

Line: 37

              
    final long timespan;
    final long timeskip;
    final TimeUnit unit;
    final Scheduler scheduler;
    final Supplier<U> bufferSupplier;
    final int maxSize;
    final boolean restartTimerOnMaxSize;


            

Reported by PMD.

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

Line: 38

                  final long timespan;
    final long timeskip;
    final TimeUnit unit;
    final Scheduler scheduler;
    final Supplier<U> bufferSupplier;
    final int maxSize;
    final boolean restartTimerOnMaxSize;

    public ObservableBufferTimed(ObservableSource<T> source, long timespan, long timeskip, TimeUnit unit, Scheduler scheduler, Supplier<U> bufferSupplier, int maxSize,

            

Reported by PMD.

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

Line: 39

                  final long timeskip;
    final TimeUnit unit;
    final Scheduler scheduler;
    final Supplier<U> bufferSupplier;
    final int maxSize;
    final boolean restartTimerOnMaxSize;

    public ObservableBufferTimed(ObservableSource<T> source, long timespan, long timeskip, TimeUnit unit, Scheduler scheduler, Supplier<U> bufferSupplier, int maxSize,
                                 boolean restartTimerOnMaxSize) {

            

Reported by PMD.

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

Line: 40

                  final TimeUnit unit;
    final Scheduler scheduler;
    final Supplier<U> bufferSupplier;
    final int maxSize;
    final boolean restartTimerOnMaxSize;

    public ObservableBufferTimed(ObservableSource<T> source, long timespan, long timeskip, TimeUnit unit, Scheduler scheduler, Supplier<U> bufferSupplier, int maxSize,
                                 boolean restartTimerOnMaxSize) {
        super(source);

            

Reported by PMD.

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

Line: 41

                  final Scheduler scheduler;
    final Supplier<U> bufferSupplier;
    final int maxSize;
    final boolean restartTimerOnMaxSize;

    public ObservableBufferTimed(ObservableSource<T> source, long timespan, long timeskip, TimeUnit unit, Scheduler scheduler, Supplier<U> bufferSupplier, int maxSize,
                                 boolean restartTimerOnMaxSize) {
        super(source);
        this.timespan = timespan;

            

Reported by PMD.

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

Line: 83

              
    static final class BufferExactUnboundedObserver<T, U extends Collection<? super T>>
    extends QueueDrainObserver<T, U, U> implements Runnable, Disposable {
        final Supplier<U> bufferSupplier;
        final long timespan;
        final TimeUnit unit;
        final Scheduler scheduler;

        Disposable upstream;

            

Reported by PMD.

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

Line: 84

                  static final class BufferExactUnboundedObserver<T, U extends Collection<? super T>>
    extends QueueDrainObserver<T, U, U> implements Runnable, Disposable {
        final Supplier<U> bufferSupplier;
        final long timespan;
        final TimeUnit unit;
        final Scheduler scheduler;

        Disposable upstream;


            

Reported by PMD.

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

Line: 85

                  extends QueueDrainObserver<T, U, U> implements Runnable, Disposable {
        final Supplier<U> bufferSupplier;
        final long timespan;
        final TimeUnit unit;
        final Scheduler scheduler;

        Disposable upstream;

        U buffer;

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableIgnoreElementsTest.java
57 issues
This class has too many methods, consider refactoring it.
Design

Line: 29

              import io.reactivex.rxjava3.subjects.PublishSubject;
import io.reactivex.rxjava3.testsupport.*;

public class ObservableIgnoreElementsTest extends RxJavaTest {

    @Test
    public void withEmptyObservable() {
        assertTrue(Observable.empty().ignoreElements().toObservable().isEmpty().blockingGet());
    }

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 33

              
    @Test
    public void withEmptyObservable() {
        assertTrue(Observable.empty().ignoreElements().toObservable().isEmpty().blockingGet());
    }

    @Test
    public void withNonEmptyObservable() {
        assertTrue(Observable.just(1, 2, 3).ignoreElements().toObservable().isEmpty().blockingGet());

            

Reported by PMD.

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

Line: 33

              
    @Test
    public void withEmptyObservable() {
        assertTrue(Observable.empty().ignoreElements().toObservable().isEmpty().blockingGet());
    }

    @Test
    public void withNonEmptyObservable() {
        assertTrue(Observable.just(1, 2, 3).ignoreElements().toObservable().isEmpty().blockingGet());

            

Reported by PMD.

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

Line: 33

              
    @Test
    public void withEmptyObservable() {
        assertTrue(Observable.empty().ignoreElements().toObservable().isEmpty().blockingGet());
    }

    @Test
    public void withNonEmptyObservable() {
        assertTrue(Observable.just(1, 2, 3).ignoreElements().toObservable().isEmpty().blockingGet());

            

Reported by PMD.

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

Line: 33

              
    @Test
    public void withEmptyObservable() {
        assertTrue(Observable.empty().ignoreElements().toObservable().isEmpty().blockingGet());
    }

    @Test
    public void withNonEmptyObservable() {
        assertTrue(Observable.just(1, 2, 3).ignoreElements().toObservable().isEmpty().blockingGet());

            

Reported by PMD.

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

Line: 33

              
    @Test
    public void withEmptyObservable() {
        assertTrue(Observable.empty().ignoreElements().toObservable().isEmpty().blockingGet());
    }

    @Test
    public void withNonEmptyObservable() {
        assertTrue(Observable.just(1, 2, 3).ignoreElements().toObservable().isEmpty().blockingGet());

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 38

              
    @Test
    public void withNonEmptyObservable() {
        assertTrue(Observable.just(1, 2, 3).ignoreElements().toObservable().isEmpty().blockingGet());
    }

    @Test
    public void upstreamIsProcessedButIgnoredObservable() {
        final int num = 10;

            

Reported by PMD.

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

Line: 38

              
    @Test
    public void withNonEmptyObservable() {
        assertTrue(Observable.just(1, 2, 3).ignoreElements().toObservable().isEmpty().blockingGet());
    }

    @Test
    public void upstreamIsProcessedButIgnoredObservable() {
        final int num = 10;

            

Reported by PMD.

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

Line: 38

              
    @Test
    public void withNonEmptyObservable() {
        assertTrue(Observable.just(1, 2, 3).ignoreElements().toObservable().isEmpty().blockingGet());
    }

    @Test
    public void upstreamIsProcessedButIgnoredObservable() {
        final int num = 10;

            

Reported by PMD.

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

Line: 38

              
    @Test
    public void withNonEmptyObservable() {
        assertTrue(Observable.just(1, 2, 3).ignoreElements().toObservable().isEmpty().blockingGet());
    }

    @Test
    public void upstreamIsProcessedButIgnoredObservable() {
        final int num = 10;

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/parallel/ParallelSortedJoinTest.java
57 issues
This class has too many methods, consider refactoring it.
Design

Line: 34

              import io.reactivex.rxjava3.subscribers.TestSubscriber;
import io.reactivex.rxjava3.testsupport.TestHelper;

public class ParallelSortedJoinTest extends RxJavaTest {

    @Test
    public void cancel() {
        PublishProcessor<Integer> pp = PublishProcessor.create();


            

Reported by PMD.

Unit tests should not contain more than 1 assert(s).
Design

Line: 37

              public class ParallelSortedJoinTest extends RxJavaTest {

    @Test
    public void cancel() {
        PublishProcessor<Integer> pp = PublishProcessor.create();

        TestSubscriber<Integer> ts = pp
        .parallel()
        .sorted(Functions.<Integer>naturalComparator())

            

Reported by PMD.

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

Line: 40

                  public void cancel() {
        PublishProcessor<Integer> pp = PublishProcessor.create();

        TestSubscriber<Integer> ts = pp
        .parallel()
        .sorted(Functions.<Integer>naturalComparator())
        .test();

        assertTrue(pp.hasSubscribers());

            

Reported by PMD.

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

Line: 40

                  public void cancel() {
        PublishProcessor<Integer> pp = PublishProcessor.create();

        TestSubscriber<Integer> ts = pp
        .parallel()
        .sorted(Functions.<Integer>naturalComparator())
        .test();

        assertTrue(pp.hasSubscribers());

            

Reported by PMD.

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

Line: 40

                  public void cancel() {
        PublishProcessor<Integer> pp = PublishProcessor.create();

        TestSubscriber<Integer> ts = pp
        .parallel()
        .sorted(Functions.<Integer>naturalComparator())
        .test();

        assertTrue(pp.hasSubscribers());

            

Reported by PMD.

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

Line: 45

                      .sorted(Functions.<Integer>naturalComparator())
        .test();

        assertTrue(pp.hasSubscribers());

        ts.cancel();

        assertFalse(pp.hasSubscribers());
    }

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 45

                      .sorted(Functions.<Integer>naturalComparator())
        .test();

        assertTrue(pp.hasSubscribers());

        ts.cancel();

        assertFalse(pp.hasSubscribers());
    }

            

Reported by PMD.

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

Line: 47

              
        assertTrue(pp.hasSubscribers());

        ts.cancel();

        assertFalse(pp.hasSubscribers());
    }

    @Test

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 49

              
        ts.cancel();

        assertFalse(pp.hasSubscribers());
    }

    @Test
    public void error() {
        List<Throwable> errors = TestHelper.trackPluginErrors();

            

Reported by PMD.

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

Line: 49

              
        ts.cancel();

        assertFalse(pp.hasSubscribers());
    }

    @Test
    public void error() {
        List<Throwable> errors = TestHelper.trackPluginErrors();

            

Reported by PMD.