The following issues were found

src/test/java/io/reactivex/rxjava3/internal/jdk8/ObservableMapOptionalTest.java
176 issues
This class has too many methods, consider refactoring it.
Design

Line: 30

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

public class ObservableMapOptionalTest extends RxJavaTest {

    static final Function<? super Integer, Optional<? extends Integer>> MODULO = v -> v % 2 == 0 ? Optional.of(v) : Optional.<Integer>empty();

    @Test
    public void allPresent() {

            

Reported by PMD.

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

Line: 35

                  static final Function<? super Integer, Optional<? extends Integer>> MODULO = v -> v % 2 == 0 ? Optional.of(v) : Optional.<Integer>empty();

    @Test
    public void allPresent() {
        Observable.range(1, 5)
        .mapOptional(Optional::of)
        .test()
        .assertResult(1, 2, 3, 4, 5);
    }

            

Reported by PMD.

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

Line: 36

              
    @Test
    public void allPresent() {
        Observable.range(1, 5)
        .mapOptional(Optional::of)
        .test()
        .assertResult(1, 2, 3, 4, 5);
    }


            

Reported by PMD.

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

Line: 36

              
    @Test
    public void allPresent() {
        Observable.range(1, 5)
        .mapOptional(Optional::of)
        .test()
        .assertResult(1, 2, 3, 4, 5);
    }


            

Reported by PMD.

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

Line: 36

              
    @Test
    public void allPresent() {
        Observable.range(1, 5)
        .mapOptional(Optional::of)
        .test()
        .assertResult(1, 2, 3, 4, 5);
    }


            

Reported by PMD.

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

Line: 43

                  }

    @Test
    public void allEmpty() {
        Observable.range(1, 5)
        .mapOptional(v -> Optional.<Integer>empty())
        .test()
        .assertResult();
    }

            

Reported by PMD.

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

Line: 44

              
    @Test
    public void allEmpty() {
        Observable.range(1, 5)
        .mapOptional(v -> Optional.<Integer>empty())
        .test()
        .assertResult();
    }


            

Reported by PMD.

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

Line: 44

              
    @Test
    public void allEmpty() {
        Observable.range(1, 5)
        .mapOptional(v -> Optional.<Integer>empty())
        .test()
        .assertResult();
    }


            

Reported by PMD.

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

Line: 44

              
    @Test
    public void allEmpty() {
        Observable.range(1, 5)
        .mapOptional(v -> Optional.<Integer>empty())
        .test()
        .assertResult();
    }


            

Reported by PMD.

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

Line: 51

                  }

    @Test
    public void mixed() {
        Observable.range(1, 10)
        .mapOptional(MODULO)
        .test()
        .assertResult(2, 4, 6, 8, 10);
    }

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/jdk8/FlowableFlatMapStreamTest.java
176 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 FlowableFlatMapStreamTest extends RxJavaTest {

    @Test
    public void empty() {
        Flowable.empty()
        .flatMapStream(v -> Stream.of(1, 2, 3, 4, 5))

            

Reported by PMD.

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

Line: 37

              public class FlowableFlatMapStreamTest extends RxJavaTest {

    @Test
    public void empty() {
        Flowable.empty()
        .flatMapStream(v -> Stream.of(1, 2, 3, 4, 5))
        .test()
        .assertResult();
    }

            

Reported by PMD.

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

Line: 38

              
    @Test
    public void empty() {
        Flowable.empty()
        .flatMapStream(v -> Stream.of(1, 2, 3, 4, 5))
        .test()
        .assertResult();
    }


            

Reported by PMD.

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

Line: 38

              
    @Test
    public void empty() {
        Flowable.empty()
        .flatMapStream(v -> Stream.of(1, 2, 3, 4, 5))
        .test()
        .assertResult();
    }


            

Reported by PMD.

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

Line: 38

              
    @Test
    public void empty() {
        Flowable.empty()
        .flatMapStream(v -> Stream.of(1, 2, 3, 4, 5))
        .test()
        .assertResult();
    }


            

Reported by PMD.

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

Line: 45

                  }

    @Test
    public void emptyHidden() {
        Flowable.empty()
        .hide()
        .flatMapStream(v -> Stream.of(1, 2, 3, 4, 5))
        .test()
        .assertResult();

            

Reported by PMD.

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

Line: 46

              
    @Test
    public void emptyHidden() {
        Flowable.empty()
        .hide()
        .flatMapStream(v -> Stream.of(1, 2, 3, 4, 5))
        .test()
        .assertResult();
    }

            

Reported by PMD.

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

Line: 46

              
    @Test
    public void emptyHidden() {
        Flowable.empty()
        .hide()
        .flatMapStream(v -> Stream.of(1, 2, 3, 4, 5))
        .test()
        .assertResult();
    }

            

Reported by PMD.

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

Line: 46

              
    @Test
    public void emptyHidden() {
        Flowable.empty()
        .hide()
        .flatMapStream(v -> Stream.of(1, 2, 3, 4, 5))
        .test()
        .assertResult();
    }

            

Reported by PMD.

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

Line: 46

              
    @Test
    public void emptyHidden() {
        Flowable.empty()
        .hide()
        .flatMapStream(v -> Stream.of(1, 2, 3, 4, 5))
        .test()
        .assertResult();
    }

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/schedulers/AbstractSchedulerTests.java
174 issues
System.out.println is used
Design

Line: 367

              
            @Override
            public void accept(Integer v) {
                System.out.println("Value: " + v);
                lastValue.set(v);
            }
        });

        assertEquals(42, lastValue.get());

            

Reported by PMD.

System.out.println is used
Design

Line: 492

                      @Override
        public void onNext(T args) {
            int count = concurrentCounter.incrementAndGet();
            System.out.println("ConcurrentObserverValidator.onNext: " + args);
            if (count > 1) {
                onError(new RuntimeException("we should not have concurrent execution of onNext"));
            }
            try {
                try {

            

Reported by PMD.

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.schedulers;

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

import java.util.*;

            

Reported by PMD.

Possible God Class (WMC=49, ATFD=64, TCC=0.000%)
Design

Line: 43

              /**
 * Base tests for all schedulers including Immediate/Current.
 */
public abstract class AbstractSchedulerTests extends RxJavaTest {

    /**
     * The scheduler to test.
     *
     * @return the Scheduler instance

            

Reported by PMD.

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

Line: 43

              /**
 * Base tests for all schedulers including Immediate/Current.
 */
public abstract class AbstractSchedulerTests extends RxJavaTest {

    /**
     * The scheduler to test.
     *
     * @return the Scheduler instance

            

Reported by PMD.

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

Line: 53

                  protected abstract Scheduler getScheduler();

    @Test
    public void nestedActions() throws InterruptedException {
        Scheduler scheduler = getScheduler();
        final Scheduler.Worker inner = scheduler.createWorker();
        try {
            final CountDownLatch latch = new CountDownLatch(1);


            

Reported by PMD.

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

Line: 55

                  @Test
    public void nestedActions() throws InterruptedException {
        Scheduler scheduler = getScheduler();
        final Scheduler.Worker inner = scheduler.createWorker();
        try {
            final CountDownLatch latch = new CountDownLatch(1);

            final Runnable firstStepStart = mock(Runnable.class);
            final Runnable firstStepEnd = mock(Runnable.class);

            

Reported by PMD.

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

Line: 100

              
            latch.await();

            inOrder.verify(thirdStepStart, times(1)).run();
            inOrder.verify(thirdStepEnd, times(1)).run();
            inOrder.verify(secondStepStart, times(1)).run();
            inOrder.verify(secondStepEnd, times(1)).run();
            inOrder.verify(firstStepStart, times(1)).run();
            inOrder.verify(firstStepEnd, times(1)).run();

            

Reported by PMD.

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

Line: 100

              
            latch.await();

            inOrder.verify(thirdStepStart, times(1)).run();
            inOrder.verify(thirdStepEnd, times(1)).run();
            inOrder.verify(secondStepStart, times(1)).run();
            inOrder.verify(secondStepEnd, times(1)).run();
            inOrder.verify(firstStepStart, times(1)).run();
            inOrder.verify(firstStepEnd, times(1)).run();

            

Reported by PMD.

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

Line: 101

                          latch.await();

            inOrder.verify(thirdStepStart, times(1)).run();
            inOrder.verify(thirdStepEnd, times(1)).run();
            inOrder.verify(secondStepStart, times(1)).run();
            inOrder.verify(secondStepEnd, times(1)).run();
            inOrder.verify(firstStepStart, times(1)).run();
            inOrder.verify(firstStepEnd, times(1)).run();
        } finally {

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/validators/ParamValidationNaming.java
172 issues
High amount of different objects as members denotes a high coupling
Design

Line: 14

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

package io.reactivex.rxjava3.validators;

import java.io.File;
import java.nio.file.Files;
import java.util.*;


            

Reported by PMD.

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

Line: 38

               * and ObjectHelper.verifyPositive calls match the parameter
 *  name in the message.
 */
public class ParamValidationNaming {

    @Test
    public void checkCompletable() throws Exception {
        processFile(Completable.class);
    }

            

Reported by PMD.

Possible God Class (WMC=93, ATFD=59, TCC=0.000%)
Design

Line: 38

               * and ObjectHelper.verifyPositive calls match the parameter
 *  name in the message.
 */
public class ParamValidationNaming {

    @Test
    public void checkCompletable() throws Exception {
        processFile(Completable.class);
    }

            

Reported by PMD.

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

Line: 38

               * and ObjectHelper.verifyPositive calls match the parameter
 *  name in the message.
 */
public class ParamValidationNaming {

    @Test
    public void checkCompletable() throws Exception {
        processFile(Completable.class);
    }

            

Reported by PMD.

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

Line: 38

               * and ObjectHelper.verifyPositive calls match the parameter
 *  name in the message.
 */
public class ParamValidationNaming {

    @Test
    public void checkCompletable() throws Exception {
        processFile(Completable.class);
    }

            

Reported by PMD.

The class 'ParamValidationNaming' has a total cyclomatic complexity of 93 (highest 65).
Design

Line: 38

               * and ObjectHelper.verifyPositive calls match the parameter
 *  name in the message.
 */
public class ParamValidationNaming {

    @Test
    public void checkCompletable() throws Exception {
        processFile(Completable.class);
    }

            

Reported by PMD.

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

Line: 41

              public class ParamValidationNaming {

    @Test
    public void checkCompletable() throws Exception {
        processFile(Completable.class);
    }

    @Test
    public void checkSingle() throws Exception {

            

Reported by PMD.

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

Line: 41

              public class ParamValidationNaming {

    @Test
    public void checkCompletable() throws Exception {
        processFile(Completable.class);
    }

    @Test
    public void checkSingle() throws Exception {

            

Reported by PMD.

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

Line: 46

                  }

    @Test
    public void checkSingle() throws Exception {
        processFile(Single.class);
    }

    @Test
    public void checkMaybe() throws Exception {

            

Reported by PMD.

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

Line: 46

                  }

    @Test
    public void checkSingle() throws Exception {
        processFile(Single.class);
    }

    @Test
    public void checkMaybe() throws Exception {

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableToMultimapTest.java
172 issues
Avoid throwing raw exception types.
Design

Line: 182

                          @Override
            public Integer apply(String t1) {
                if ("b".equals(t1)) {
                    throw new RuntimeException("Forced Failure");
                }
                return t1.length();
            }
        };


            

Reported by PMD.

Avoid throwing raw exception types.
Design

Line: 209

                          @Override
            public String apply(String t1) {
                if ("b".equals(t1)) {
                    throw new RuntimeException("Forced failure");
                }
                return t1 + t1;
            }
        };


            

Reported by PMD.

Avoid throwing raw exception types.
Design

Line: 235

                      Supplier<Map<Integer, Collection<String>>> mapFactory = new Supplier<Map<Integer, Collection<String>>>() {
            @Override
            public Map<Integer, Collection<String>> get() {
                throw new RuntimeException("Forced failure");
            }
        };

        Observable<Map<Integer, Collection<String>>> mapped = source
                .toMultimap(lengthFunc, new Function<String, String>() {

            

Reported by PMD.

Avoid throwing raw exception types.
Design

Line: 266

                          @Override
            public Collection<String> apply(Integer t1) {
                if (t1 == 2) {
                    throw new RuntimeException("Forced failure");
                } else {
                    return new HashSet<>();
                }
            }
        };

            

Reported by PMD.

Avoid throwing raw exception types.
Design

Line: 426

                          @Override
            public Integer apply(String t1) {
                if ("b".equals(t1)) {
                    throw new RuntimeException("Forced Failure");
                }
                return t1.length();
            }
        };


            

Reported by PMD.

Avoid throwing raw exception types.
Design

Line: 452

                          @Override
            public String apply(String t1) {
                if ("b".equals(t1)) {
                    throw new RuntimeException("Forced failure");
                }
                return t1 + t1;
            }
        };


            

Reported by PMD.

Avoid throwing raw exception types.
Design

Line: 477

                      Supplier<Map<Integer, Collection<String>>> mapFactory = new Supplier<Map<Integer, Collection<String>>>() {
            @Override
            public Map<Integer, Collection<String>> get() {
                throw new RuntimeException("Forced failure");
            }
        };

        Single<Map<Integer, Collection<String>>> mapped = source
                .toMultimap(lengthFunc, new Function<String, String>() {

            

Reported by PMD.

Avoid throwing raw exception types.
Design

Line: 507

                          @Override
            public Collection<String> apply(Integer t1) {
                if (t1 == 2) {
                    throw new RuntimeException("Forced failure");
                } else {
                    return new HashSet<>();
                }
            }
        };

            

Reported by PMD.

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

Line: 29

              import io.reactivex.rxjava3.functions.*;
import io.reactivex.rxjava3.testsupport.TestHelper;

public class ObservableToMultimapTest extends RxJavaTest {
    Observer<Object> objectObserver;
    SingleObserver<Object> singleObserver;

    @Before
    public void before() {

            

Reported by PMD.

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

Line: 30

              import io.reactivex.rxjava3.testsupport.TestHelper;

public class ObservableToMultimapTest extends RxJavaTest {
    Observer<Object> objectObserver;
    SingleObserver<Object> singleObserver;

    @Before
    public void before() {
        objectObserver = TestHelper.mockObserver();

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableToMultimapTest.java
172 issues
Avoid throwing raw exception types.
Design

Line: 182

                          @Override
            public Integer apply(String t1) {
                if ("b".equals(t1)) {
                    throw new RuntimeException("Forced Failure");
                }
                return t1.length();
            }
        };


            

Reported by PMD.

Avoid throwing raw exception types.
Design

Line: 209

                          @Override
            public String apply(String t1) {
                if ("b".equals(t1)) {
                    throw new RuntimeException("Forced failure");
                }
                return t1 + t1;
            }
        };


            

Reported by PMD.

Avoid throwing raw exception types.
Design

Line: 235

                      Supplier<Map<Integer, Collection<String>>> mapFactory = new Supplier<Map<Integer, Collection<String>>>() {
            @Override
            public Map<Integer, Collection<String>> get() {
                throw new RuntimeException("Forced failure");
            }
        };

        Flowable<Map<Integer, Collection<String>>> mapped = source
                .toMultimap(lengthFunc, new Function<String, String>() {

            

Reported by PMD.

Avoid throwing raw exception types.
Design

Line: 266

                          @Override
            public Collection<String> apply(Integer t1) {
                if (t1 == 2) {
                    throw new RuntimeException("Forced failure");
                } else {
                    return new HashSet<>();
                }
            }
        };

            

Reported by PMD.

Avoid throwing raw exception types.
Design

Line: 426

                          @Override
            public Integer apply(String t1) {
                if ("b".equals(t1)) {
                    throw new RuntimeException("Forced Failure");
                }
                return t1.length();
            }
        };


            

Reported by PMD.

Avoid throwing raw exception types.
Design

Line: 452

                          @Override
            public String apply(String t1) {
                if ("b".equals(t1)) {
                    throw new RuntimeException("Forced failure");
                }
                return t1 + t1;
            }
        };


            

Reported by PMD.

Avoid throwing raw exception types.
Design

Line: 477

                      Supplier<Map<Integer, Collection<String>>> mapFactory = new Supplier<Map<Integer, Collection<String>>>() {
            @Override
            public Map<Integer, Collection<String>> get() {
                throw new RuntimeException("Forced failure");
            }
        };

        Single<Map<Integer, Collection<String>>> mapped = source
                .toMultimap(lengthFunc, new Function<String, String>() {

            

Reported by PMD.

Avoid throwing raw exception types.
Design

Line: 507

                          @Override
            public Collection<String> apply(Integer t1) {
                if (t1 == 2) {
                    throw new RuntimeException("Forced failure");
                } else {
                    return new HashSet<>();
                }
            }
        };

            

Reported by PMD.

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

Line: 28

              import io.reactivex.rxjava3.functions.*;
import io.reactivex.rxjava3.testsupport.TestHelper;

public class FlowableToMultimapTest extends RxJavaTest {
    Subscriber<Object> objectSubscriber;

    SingleObserver<Object> singleObserver;

    @Before

            

Reported by PMD.

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

Line: 29

              import io.reactivex.rxjava3.testsupport.TestHelper;

public class FlowableToMultimapTest extends RxJavaTest {
    Subscriber<Object> objectSubscriber;

    SingleObserver<Object> singleObserver;

    @Before
    public void before() {

            

Reported by PMD.

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

Line: 82

                                      if (fname.endsWith(".java")) {

                            int lineNum = 0;
                            BufferedReader in = new BufferedReader(new FileReader(u));
                            try {
                                for (;;) {
                                    String line = in.readLine();
                                    if (line != null) {
                                        lineNum++;

            

Reported by PMD.

System.out.println is used
Design

Line: 48

                  static void findPattern(String pattern, boolean checkMain) throws Exception {
        File f = TestHelper.findSource("Flowable");
        if (f == null) {
            System.out.println("Unable to find sources of RxJava");
            return;
        }

        Queue<File> dirs = new ArrayDeque<>();


            

Reported by PMD.

System.out.println is used
Design

Line: 123

                      }
        if (total != 0) {
            fail.insert(0, "Found " + total + " instances");
            System.out.println(fail);
            throw new AssertionError(fail.toString());
        }
    }

    @Test

            

Reported by PMD.

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.validators;

import java.io.*;
import java.util.*;
import java.util.regex.Pattern;


            

Reported by PMD.

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

Line: 39

               * <li>{@code Observer} named as "s" or "subscriber"</li>
 * </ul>
 */
public class CheckLocalVariablesInTests {

    static void findPattern(String pattern) throws Exception {
        findPattern(pattern, false);
    }


            

Reported by PMD.

The class 'CheckLocalVariablesInTests' has a Modified Cyclomatic Complexity of 1 (Highest = 13).
Design

Line: 39

               * <li>{@code Observer} named as "s" or "subscriber"</li>
 * </ul>
 */
public class CheckLocalVariablesInTests {

    static void findPattern(String pattern) throws Exception {
        findPattern(pattern, false);
    }


            

Reported by PMD.

Possible God Class (WMC=80, ATFD=10, TCC=0.000%)
Design

Line: 39

               * <li>{@code Observer} named as "s" or "subscriber"</li>
 * </ul>
 */
public class CheckLocalVariablesInTests {

    static void findPattern(String pattern) throws Exception {
        findPattern(pattern, false);
    }


            

Reported by PMD.

The class 'CheckLocalVariablesInTests' has a Standard Cyclomatic Complexity of 1 (Highest = 13).
Design

Line: 39

               * <li>{@code Observer} named as "s" or "subscriber"</li>
 * </ul>
 */
public class CheckLocalVariablesInTests {

    static void findPattern(String pattern) throws Exception {
        findPattern(pattern, false);
    }


            

Reported by PMD.

The class 'CheckLocalVariablesInTests' has a total cyclomatic complexity of 80 (highest 16).
Design

Line: 39

               * <li>{@code Observer} named as "s" or "subscriber"</li>
 * </ul>
 */
public class CheckLocalVariablesInTests {

    static void findPattern(String pattern) throws Exception {
        findPattern(pattern, false);
    }


            

Reported by PMD.

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

Line: 41

               */
public class CheckLocalVariablesInTests {

    static void findPattern(String pattern) throws Exception {
        findPattern(pattern, false);
    }

    static void findPattern(String pattern, boolean checkMain) throws Exception {
        File f = TestHelper.findSource("Flowable");

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableRetryWithPredicateTest.java
170 issues
Avoid throwing raw exception types.
Design

Line: 323

                          public Long apply(Long x) {
                System.out.println("map " + x);
                if (x == 2 && isFirst.getAndSet(false)) {
                    throw new RuntimeException("retryable error");
                }
                return x;
            }})
        .retry(new BiPredicate<Integer, Throwable>() {
            @Override

            

Reported by PMD.

Avoid throwing raw exception types.
Design

Line: 351

                          public Long apply(Long x) {
                System.out.println("map " + x);
                if (x == 2 && isFirst.getAndSet(false)) {
                    throw new RuntimeException("retryable error");
                }
                return x;
            }})
        .retry()
        .forEach(new Consumer<Long>() {

            

Reported by PMD.

System.out.println is used
Design

Line: 321

                      Flowable.<Long> just(1L, 2L, 3L).map(new Function<Long, Long>() {
            @Override
            public Long apply(Long x) {
                System.out.println("map " + x);
                if (x == 2 && isFirst.getAndSet(false)) {
                    throw new RuntimeException("retryable error");
                }
                return x;
            }})

            

Reported by PMD.

System.out.println is used
Design

Line: 336

              
            @Override
            public void accept(Long t) {
                System.out.println(t);
                list.add(t);
            }});
        assertEquals(Arrays.asList(1L, 1L, 2L, 3L), list);
    }


            

Reported by PMD.

System.out.println is used
Design

Line: 349

                      Flowable.<Long> just(1L, 2L, 3L).map(new Function<Long, Long>() {
            @Override
            public Long apply(Long x) {
                System.out.println("map " + x);
                if (x == 2 && isFirst.getAndSet(false)) {
                    throw new RuntimeException("retryable error");
                }
                return x;
            }})

            

Reported by PMD.

System.out.println is used
Design

Line: 360

              
            @Override
            public void accept(Long t) {
                System.out.println(t);
                list.add(t);
            }});
        assertEquals(Arrays.asList(1L, 1L, 2L, 3L), list);
    }


            

Reported by PMD.

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

Line: 40

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

public class FlowableRetryWithPredicateTest extends RxJavaTest {
    BiPredicate<Integer, Throwable> retryTwice = new BiPredicate<Integer, Throwable>() {
        @Override
        public boolean test(Integer t1, Throwable t2) {
            return t1 <= 2;
        }

            

Reported by PMD.

Field retryTwice has the same name as a method
Error

Line: 41

              import io.reactivex.rxjava3.testsupport.*;

public class FlowableRetryWithPredicateTest extends RxJavaTest {
    BiPredicate<Integer, Throwable> retryTwice = new BiPredicate<Integer, Throwable>() {
        @Override
        public boolean test(Integer t1, Throwable t2) {
            return t1 <= 2;
        }
    };

            

Reported by PMD.

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

Line: 41

              import io.reactivex.rxjava3.testsupport.*;

public class FlowableRetryWithPredicateTest extends RxJavaTest {
    BiPredicate<Integer, Throwable> retryTwice = new BiPredicate<Integer, Throwable>() {
        @Override
        public boolean test(Integer t1, Throwable t2) {
            return t1 <= 2;
        }
    };

            

Reported by PMD.

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

Line: 47

                          return t1 <= 2;
        }
    };
    BiPredicate<Integer, Throwable> retry5 = new BiPredicate<Integer, Throwable>() {
        @Override
        public boolean test(Integer t1, Throwable t2) {
            return t1 <= 5;
        }
    };

            

Reported by PMD.

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

Line: 38

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

public class ObservableWithLatestFromTest extends RxJavaTest {
    static final BiFunction<Integer, Integer, Integer> COMBINER = new BiFunction<Integer, Integer, Integer>() {
        @Override
        public Integer apply(Integer t1, Integer t2) {
            return (t1 << 8) + t2;
        }

            

Reported by PMD.

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

Line: 59

                      Observer<Integer> o = TestHelper.mockObserver();
        InOrder inOrder = inOrder(o);

        Observable<Integer> result = source.withLatestFrom(other, COMBINER);

        result.subscribe(o);

        source.onNext(1);
        inOrder.verify(o, never()).onNext(anyInt());

            

Reported by PMD.

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

Line: 61

              
        Observable<Integer> result = source.withLatestFrom(other, COMBINER);

        result.subscribe(o);

        source.onNext(1);
        inOrder.verify(o, never()).onNext(anyInt());

        other.onNext(1);

            

Reported by PMD.

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

Line: 63

              
        result.subscribe(o);

        source.onNext(1);
        inOrder.verify(o, never()).onNext(anyInt());

        other.onNext(1);
        inOrder.verify(o, never()).onNext(anyInt());


            

Reported by PMD.

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

Line: 64

                      result.subscribe(o);

        source.onNext(1);
        inOrder.verify(o, never()).onNext(anyInt());

        other.onNext(1);
        inOrder.verify(o, never()).onNext(anyInt());

        source.onNext(2);

            

Reported by PMD.

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

Line: 64

                      result.subscribe(o);

        source.onNext(1);
        inOrder.verify(o, never()).onNext(anyInt());

        other.onNext(1);
        inOrder.verify(o, never()).onNext(anyInt());

        source.onNext(2);

            

Reported by PMD.

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

Line: 66

                      source.onNext(1);
        inOrder.verify(o, never()).onNext(anyInt());

        other.onNext(1);
        inOrder.verify(o, never()).onNext(anyInt());

        source.onNext(2);
        inOrder.verify(o).onNext((2 << 8) + 1);


            

Reported by PMD.

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

Line: 67

                      inOrder.verify(o, never()).onNext(anyInt());

        other.onNext(1);
        inOrder.verify(o, never()).onNext(anyInt());

        source.onNext(2);
        inOrder.verify(o).onNext((2 << 8) + 1);

        other.onNext(2);

            

Reported by PMD.

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

Line: 67

                      inOrder.verify(o, never()).onNext(anyInt());

        other.onNext(1);
        inOrder.verify(o, never()).onNext(anyInt());

        source.onNext(2);
        inOrder.verify(o).onNext((2 << 8) + 1);

        other.onNext(2);

            

Reported by PMD.

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

Line: 69

                      other.onNext(1);
        inOrder.verify(o, never()).onNext(anyInt());

        source.onNext(2);
        inOrder.verify(o).onNext((2 << 8) + 1);

        other.onNext(2);
        inOrder.verify(o, never()).onNext(anyInt());


            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/jdk8/ObservableFromStreamTest.java
168 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.jdk8;

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

import java.util.Iterator;

            

Reported by PMD.

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

Line: 33

              import io.reactivex.rxjava3.observers.TestObserver;
import io.reactivex.rxjava3.testsupport.*;

public class ObservableFromStreamTest extends RxJavaTest {

    @Test
    public void empty() {
        Observable.fromStream(Stream.<Integer>of())
        .test()

            

Reported by PMD.

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

Line: 36

              public class ObservableFromStreamTest extends RxJavaTest {

    @Test
    public void empty() {
        Observable.fromStream(Stream.<Integer>of())
        .test()
        .assertResult();
    }


            

Reported by PMD.

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

Line: 37

              
    @Test
    public void empty() {
        Observable.fromStream(Stream.<Integer>of())
        .test()
        .assertResult();
    }

    @Test

            

Reported by PMD.

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

Line: 37

              
    @Test
    public void empty() {
        Observable.fromStream(Stream.<Integer>of())
        .test()
        .assertResult();
    }

    @Test

            

Reported by PMD.

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

Line: 43

                  }

    @Test
    public void just() {
        Observable.fromStream(Stream.<Integer>of(1))
        .test()
        .assertResult(1);
    }


            

Reported by PMD.

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

Line: 44

              
    @Test
    public void just() {
        Observable.fromStream(Stream.<Integer>of(1))
        .test()
        .assertResult(1);
    }

    @Test

            

Reported by PMD.

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

Line: 44

              
    @Test
    public void just() {
        Observable.fromStream(Stream.<Integer>of(1))
        .test()
        .assertResult(1);
    }

    @Test

            

Reported by PMD.

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

Line: 50

                  }

    @Test
    public void many() {
        Observable.fromStream(Stream.<Integer>of(1, 2, 3, 4, 5))
        .test()
        .assertResult(1, 2, 3, 4, 5);
    }


            

Reported by PMD.

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

Line: 51

              
    @Test
    public void many() {
        Observable.fromStream(Stream.<Integer>of(1, 2, 3, 4, 5))
        .test()
        .assertResult(1, 2, 3, 4, 5);
    }

    @Test

            

Reported by PMD.