The following issues were found

android/guava/src/com/google/common/collect/NaturalOrdering.java
2 issues
Field nullsFirst has the same name as a method
Error

Line: 33

              final class NaturalOrdering extends Ordering<Comparable<?>> implements Serializable {
  static final NaturalOrdering INSTANCE = new NaturalOrdering();

  @CheckForNull private transient Ordering<@Nullable Comparable<?>> nullsFirst;
  @CheckForNull private transient Ordering<@Nullable Comparable<?>> nullsLast;

  @Override
  public int compare(Comparable<?> left, Comparable<?> right) {
    checkNotNull(left); // for GWT

            

Reported by PMD.

Field nullsLast has the same name as a method
Error

Line: 34

                static final NaturalOrdering INSTANCE = new NaturalOrdering();

  @CheckForNull private transient Ordering<@Nullable Comparable<?>> nullsFirst;
  @CheckForNull private transient Ordering<@Nullable Comparable<?>> nullsLast;

  @Override
  public int compare(Comparable<?> left, Comparable<?> right) {
    checkNotNull(left); // for GWT
    checkNotNull(right);

            

Reported by PMD.

guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/MapMaker.java
2 issues
Field initialCapacity has the same name as a method
Error

Line: 30

               * @author Charles Fry
 */
public final class MapMaker {
  private int initialCapacity = 16;

  public MapMaker() {}

  public MapMaker initialCapacity(int initialCapacity) {
    if (initialCapacity < 0) {

            

Reported by PMD.

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

Line: 30

               * @author Charles Fry
 */
public final class MapMaker {
  private int initialCapacity = 16;

  public MapMaker() {}

  public MapMaker initialCapacity(int initialCapacity) {
    if (initialCapacity < 0) {

            

Reported by PMD.

guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/Platform.java
2 issues
This class has too many methods, consider refactoring it.
Design

Line: 35

               *
 * @author Hayward Chan
 */
final class Platform {
  static <K, V> Map<K, V> newHashMapWithExpectedSize(int expectedSize) {
    return Maps.newHashMapWithExpectedSize(expectedSize);
  }

  static <K, V> Map<K, V> newLinkedHashMapWithExpectedSize(int expectedSize) {

            

Reported by PMD.

Consider using varargs for methods or constructors which take an array the last parameter.
Design

Line: 87

                }

  /** Equivalent to Arrays.copyOfRange(source, from, to, arrayOfType.getClass()). */
  static <T> T[] copy(Object[] source, int from, int to, T[] arrayOfType) {
    T[] result = newArray(arrayOfType, to - from);
    System.arraycopy(source, from, result, 0, to - from);
    return result;
  }


            

Reported by PMD.

guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/RangeGwtSerializationDependencies.java
2 issues
No abstract method which means that the keyword is most likely used to prevent instantiation. Use a private or protected constructor instead.
Design

Line: 23

              import java.io.Serializable;

@GwtCompatible(emulated = true)
abstract class RangeGwtSerializationDependencies<C extends Comparable> implements Serializable {
  C dummy;
}

            

Reported by PMD.

Classes implementing Serializable should set a serialVersionUID
Error

Line: 23

              import java.io.Serializable;

@GwtCompatible(emulated = true)
abstract class RangeGwtSerializationDependencies<C extends Comparable> implements Serializable {
  C dummy;
}

            

Reported by PMD.

guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/RegularImmutableBiMap.java
2 issues
Field inverse has the same name as a method
Error

Line: 34

              
  // This reference is used both by the GWT compiler to infer the elements
  // of the lists that needs to be serialized.
  private ImmutableBiMap<V, K> inverse;

  RegularImmutableBiMap() {
    super(new RegularImmutableMap<K, V>(new HashMap<K, V>()));
    this.inverse = (ImmutableBiMap<V, K>) this;
  }

            

Reported by PMD.

Private field 'inverse' could be made final; it is only initialized in the declaration or constructor.
Design

Line: 34

              
  // This reference is used both by the GWT compiler to infer the elements
  // of the lists that needs to be serialized.
  private ImmutableBiMap<V, K> inverse;

  RegularImmutableBiMap() {
    super(new RegularImmutableMap<K, V>(new HashMap<K, V>()));
    this.inverse = (ImmutableBiMap<V, K>) this;
  }

            

Reported by PMD.

android/guava/src/com/google/common/base/Enums.java
2 issues
Avoid instantiating new objects inside loops
Performance

Line: 82

                    Class<T> enumClass) {
    Map<String, WeakReference<? extends Enum<?>>> result = new HashMap<>();
    for (T enumInstance : EnumSet.allOf(enumClass)) {
      result.put(enumInstance.name(), new WeakReference<Enum<?>>(enumInstance));
    }
    enumConstantCache.put(enumClass, result);
    return result;
  }


            

Reported by PMD.

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

Line: 115

                private static final class StringConverter<T extends Enum<T>> extends Converter<String, T>
      implements Serializable {

    private final Class<T> enumClass;

    StringConverter(Class<T> enumClass) {
      this.enumClass = checkNotNull(enumClass);
    }


            

Reported by PMD.

guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/SingletonImmutableSet.java
2 issues
Classes implementing Serializable should set a serialVersionUID
Error

Line: 26

               *
 * @author Hayward Chan
 */
final class SingletonImmutableSet<E> extends ImmutableSet<E> {

  // This reference is used both by the custom field serializer, and by the
  // GWT compiler to infer the elements of the lists that needs to be
  // serialized.
  //

            

Reported by PMD.

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

Line: 33

                // serialized.
  //
  // Although this reference is non-final, it doesn't change after set creation.
  E element;

  SingletonImmutableSet(E element) {
    this.element = checkNotNull(element);
  }


            

Reported by PMD.

guava-gwt/test-super/com/google/common/collect/testing/super/com/google/common/collect/testing/Platform.java
2 issues
Avoid appending characters as strings in StringBuffer.append.
Performance

Line: 61

                      builder.append(", ");
        builder.append(args[i++]);
      }
      builder.append("]");
    }

    return builder.toString();
  }


            

Reported by PMD.

Consider using varargs for methods or constructors which take an array the last parameter.
Design

Line: 32

                // Class.cast is not supported in GWT.
  static void checkCast(Class<?> clazz, Object obj) {}

  static <T> T[] clone(T[] array) {
    return (T[]) Arrays.copyOfRange(array, 0, array.length);
  }

  // TODO: Consolidate different copies in one single place.
  static String format(String template, Object... args) {

            

Reported by PMD.

android/guava/src/com/google/common/collect/ImmutableMultisetGwtSerializationDependencies.java
2 issues
No abstract method which means that the keyword is most likely used to prevent instantiation. Use a private or protected constructor instead.
Design

Line: 41

               */
@GwtCompatible(emulated = true)
@ElementTypesAreNonnullByDefault
abstract class ImmutableMultisetGwtSerializationDependencies<E> extends ImmutableCollection<E> {}

            

Reported by PMD.

Classes implementing Serializable should set a serialVersionUID
Error

Line: 41

               */
@GwtCompatible(emulated = true)
@ElementTypesAreNonnullByDefault
abstract class ImmutableMultisetGwtSerializationDependencies<E> extends ImmutableCollection<E> {}

            

Reported by PMD.

guava-testlib/src/com/google/common/collect/testing/CollectionTestSuiteBuilder.java
2 issues
Potential violation of Law of Demeter (method chain calls)
Design

Line: 53

                        parentBuilder) {
    List<TestSuite> derivedSuites = new ArrayList<>(super.createDerivedSuites(parentBuilder));

    if (parentBuilder.getFeatures().contains(SERIALIZABLE)) {
      derivedSuites.add(
          CollectionTestSuiteBuilder.using(
                  new ReserializedCollectionGenerator<E>(parentBuilder.getSubjectGenerator()))
              .named(getName() + " reserialized")
              .withFeatures(computeReserializedCollectionFeatures(parentBuilder.getFeatures()))

            

Reported by PMD.

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

Line: 68

                }

  static class ReserializedCollectionGenerator<E> implements TestCollectionGenerator<E> {
    final OneSizeTestContainerGenerator<Collection<E>, E> gen;

    private ReserializedCollectionGenerator(OneSizeTestContainerGenerator<Collection<E>, E> gen) {
      this.gen = gen;
    }


            

Reported by PMD.