The following issues were found

guava-testlib/src/com/google/common/collect/testing/DerivedTestIteratorGenerator.java
2 issues
Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 30

              @GwtCompatible
public final class DerivedTestIteratorGenerator<E>
    implements TestIteratorGenerator<E>, DerivedGenerator {
  private final TestSubjectGenerator<? extends Iterable<E>> collectionGenerator;

  public DerivedTestIteratorGenerator(
      TestSubjectGenerator<? extends Iterable<E>> collectionGenerator) {
    this.collectionGenerator = collectionGenerator;
  }

            

Reported by PMD.

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

Line: 44

              
  @Override
  public Iterator<E> get() {
    return collectionGenerator.createTestSubject().iterator();
  }
}

            

Reported by PMD.

android/guava/src/com/google/common/collect/HashBasedTable.java
2 issues
Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 53

              @ElementTypesAreNonnullByDefault
public class HashBasedTable<R, C, V> extends StandardTable<R, C, V> {
  private static class Factory<C, V> implements Supplier<Map<C, V>>, Serializable {
    final int expectedSize;

    Factory(int expectedSize) {
      this.expectedSize = expectedSize;
    }


            

Reported by PMD.

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

Line: 97

                public static <R, C, V> HashBasedTable<R, C, V> create(
      Table<? extends R, ? extends C, ? extends V> table) {
    HashBasedTable<R, C, V> result = create();
    result.putAll(table);
    return result;
  }

  HashBasedTable(Map<R, Map<C, V>> backingMap, Factory<C, V> factory) {
    super(backingMap, factory);

            

Reported by PMD.

android/guava/src/com/google/common/collect/ForwardingSet.java
2 issues
Potential violation of Law of Demeter (method chain calls)
Design

Line: 63

              
  @Override
  public boolean equals(@CheckForNull Object object) {
    return object == this || delegate().equals(object);
  }

  @Override
  public int hashCode() {
    return delegate().hashCode();

            

Reported by PMD.

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

Line: 68

              
  @Override
  public int hashCode() {
    return delegate().hashCode();
  }

  /**
   * A sensible definition of {@link #removeAll} in terms of {@link #iterator} and {@link #remove}.
   * If you override {@code iterator} or {@code remove}, you may wish to override {@link #removeAll}

            

Reported by PMD.

guava-testlib/src/com/google/common/collect/testing/MinimalSet.java
2 issues
A class which only has private constructors should be final
Design

Line: 34

               * @author Regina O'Dell
 */
@GwtCompatible
public class MinimalSet<E> extends MinimalCollection<E> implements Set<E> {

  @SuppressWarnings("unchecked") // empty Object[] as E[]
  public static <E> MinimalSet<E> of(E... contents) {
    return ofClassAndContents(Object.class, (E[]) new Object[0], Arrays.asList(contents));
  }

            

Reported by PMD.

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

Line: 69

                public boolean equals(Object object) {
    if (object instanceof Set) {
      Set<?> that = (Set<?>) object;
      return (this.size() == that.size()) && this.containsAll(that);
    }
    return false;
  }

  @Override

            

Reported by PMD.

android/guava/src/com/google/common/collect/ForwardingImmutableCollection.java
2 issues
A class which only has private constructors should be final
Design

Line: 28

               */
@GwtCompatible(emulated = true)
@ElementTypesAreNonnullByDefault
class ForwardingImmutableCollection {
  private ForwardingImmutableCollection() {}
}

            

Reported by PMD.

Class cannot be instantiated and does not provide any static methods or fields
Error

Line: 28

               */
@GwtCompatible(emulated = true)
@ElementTypesAreNonnullByDefault
class ForwardingImmutableCollection {
  private ForwardingImmutableCollection() {}
}

            

Reported by PMD.

android/guava/src/com/google/common/collect/Count.java
2 issues
Classes implementing Serializable should set a serialVersionUID
Error

Line: 28

               */
@GwtCompatible
@ElementTypesAreNonnullByDefault
final class Count implements Serializable {
  private int value;

  Count(int value) {
    this.value = value;
  }

            

Reported by PMD.

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

Line: 29

              @GwtCompatible
@ElementTypesAreNonnullByDefault
final class Count implements Serializable {
  private int value;

  Count(int value) {
    this.value = value;
  }


            

Reported by PMD.

android/guava/src/com/google/common/collect/CompoundOrdering.java
2 issues
Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 31

              @ElementTypesAreNonnullByDefault
final class CompoundOrdering<T extends @Nullable Object> extends Ordering<T>
    implements Serializable {
  final Comparator<? super T>[] comparators;

  CompoundOrdering(Comparator<? super T> primary, Comparator<? super T> secondary) {
    this.comparators = (Comparator<? super T>[]) new Comparator[] {primary, secondary};
  }


            

Reported by PMD.

This for loop can be replaced by a foreach loop
Design

Line: 43

              
  @Override
  public int compare(@ParametricNullness T left, @ParametricNullness T right) {
    for (int i = 0; i < comparators.length; i++) {
      int result = comparators[i].compare(left, right);
      if (result != 0) {
        return result;
      }
    }

            

Reported by PMD.

android/guava-tests/test/com/google/common/util/concurrent/ServiceTest.java
2 issues
Unit tests should not contain more than 1 assert(s).
Design

Line: 33

              public class ServiceTest extends TestCase {

  /** Assert on the comparison ordering of the State enum since we guarantee it. */
  public void testStateOrdering() {
    // List every valid (direct) state transition.
    assertLessThan(NEW, STARTING);
    assertLessThan(NEW, TERMINATED);

    assertLessThan(STARTING, RUNNING);

            

Reported by PMD.

JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 33

              public class ServiceTest extends TestCase {

  /** Assert on the comparison ordering of the State enum since we guarantee it. */
  public void testStateOrdering() {
    // List every valid (direct) state transition.
    assertLessThan(NEW, STARTING);
    assertLessThan(NEW, TERMINATED);

    assertLessThan(STARTING, RUNNING);

            

Reported by PMD.

android/guava-tests/test/com/google/common/util/concurrent/RunnablesTest.java
2 issues
JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 29

               */
@GwtCompatible
public class RunnablesTest extends TestCase {
  public void testDoNothingRunnableIsSingleton() {
    assertSame(Runnables.doNothing(), Runnables.doNothing());
  }
}

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 30

              @GwtCompatible
public class RunnablesTest extends TestCase {
  public void testDoNothingRunnableIsSingleton() {
    assertSame(Runnables.doNothing(), Runnables.doNothing());
  }
}

            

Reported by PMD.

android/guava-tests/test/com/google/common/util/concurrent/ForwardingListeningExecutorServiceTest.java
2 issues
JUnit tests should include assert() or fail()
Design

Line: 23

              
/** Unit tests for {@link ForwardingListeningExecutorService} */
public class ForwardingListeningExecutorServiceTest extends TestCase {
  public void testForwarding() {
    ForwardingObjectTester.testForwardingObject(ForwardingListeningExecutorService.class);
  }
}

            

Reported by PMD.

JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 23

              
/** Unit tests for {@link ForwardingListeningExecutorService} */
public class ForwardingListeningExecutorServiceTest extends TestCase {
  public void testForwarding() {
    ForwardingObjectTester.testForwardingObject(ForwardingListeningExecutorService.class);
  }
}

            

Reported by PMD.