The following issues were found

android/guava/src/com/google/common/escape/CharEscaper.java
2 issues
Avoid reassigning parameters such as 'index'
Design

Line: 99

                 * @return the escaped form of {@code string}
   * @throws NullPointerException if {@code string} is null
   */
  protected final String escapeSlow(String s, int index) {
    int slen = s.length();

    // Get a destination buffer and setup some loop variables.
    char[] dest = Platform.charBufferFromThreadLocal();
    int destSize = dest.length;

            

Reported by PMD.

Found 'DU'-anomaly for variable 'destSize' (lines '104'-'159').
Error

Line: 104

              
    // Get a destination buffer and setup some loop variables.
    char[] dest = Platform.charBufferFromThreadLocal();
    int destSize = dest.length;
    int destIndex = 0;
    int lastEscape = 0;

    // Loop through the rest of the string, replacing when needed into the
    // destination buffer, which gets grown as needed as well.

            

Reported by PMD.

android/guava/src/com/google/common/collect/SortedMultiset.java
2 issues
This class has too many methods, consider refactoring it.
Design

Line: 49

              @GwtCompatible(emulated = true)
@ElementTypesAreNonnullByDefault
public interface SortedMultiset<E extends @Nullable Object>
    extends SortedMultisetBridge<E>, SortedIterable<E> {
  /**
   * Returns the comparator that orders this multiset, or {@link Ordering#natural()} if the natural
   * ordering of the elements is used.
   */
  @Override

            

Reported by PMD.

Avoid unused imports such as 'java.util.Collection'
Design

Line: 20

              package com.google.common.collect;

import com.google.common.annotations.GwtCompatible;
import java.util.Collection;
import java.util.Comparator;
import java.util.Iterator;
import java.util.NavigableSet;
import java.util.Set;
import javax.annotation.CheckForNull;

            

Reported by PMD.

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

Line: 44

              @Beta
@GwtCompatible
@ElementTypesAreNonnullByDefault
public class XmlEscapers {
  private XmlEscapers() {}

  private static final char MIN_ASCII_CONTROL_CHAR = 0x00;
  private static final char MAX_ASCII_CONTROL_CHAR = 0x1F;


            

Reported by PMD.

Avoid unused private fields such as 'XML_ESCAPER'.
Design

Line: 103

                  return XML_ATTRIBUTE_ESCAPER;
  }

  private static final Escaper XML_ESCAPER;
  private static final Escaper XML_CONTENT_ESCAPER;
  private static final Escaper XML_ATTRIBUTE_ESCAPER;

  static {
    Escapers.Builder builder = Escapers.builder();

            

Reported by PMD.

guava-gwt/src-super/com/google/common/base/super/com/google/common/base/Platform.java
2 issues
Potential violation of Law of Demeter (static property access)
Design

Line: 40

                static long systemNanoTime() {
    // System.nanoTime() is not available in GWT, so we get milliseconds
    // and convert to nanos.
    return TimeUnit.MILLISECONDS.toNanos(System.currentTimeMillis());
  }

  static <T extends Enum<T>> Optional<T> getEnumIfPresent(Class<T> enumClass, String value) {
    try {
      return Optional.of(Enum.valueOf(enumClass, value));

            

Reported by PMD.

Do not add empty strings
Performance

Line: 52

                }

  static String formatCompact4Digits(double value) {
    return "" + ((Number) (Object) value).toPrecision(4);
  }

  @JsMethod
  static native boolean stringIsNullOrEmpty(@Nullable String string) /*-{
    return !string;

            

Reported by PMD.

android/guava/src/com/google/common/base/ExtraObjectsMethodsForWeb.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: 25

               */
@GwtCompatible(emulated = true)
@ElementTypesAreNonnullByDefault
abstract class ExtraObjectsMethodsForWeb {}

            

Reported by PMD.

This abstract class does not have any abstract methods
Design

Line: 25

               */
@GwtCompatible(emulated = true)
@ElementTypesAreNonnullByDefault
abstract class ExtraObjectsMethodsForWeb {}

            

Reported by PMD.

android/guava/src/com/google/common/collect/ReverseOrdering.java
2 issues
This class has too many methods, consider refactoring it.
Design

Line: 31

              @GwtCompatible(serializable = true)
@ElementTypesAreNonnullByDefault
final class ReverseOrdering<T extends @Nullable Object> extends Ordering<T>
    implements Serializable {
  final Ordering<? super T> forwardOrder;

  ReverseOrdering(Ordering<? super T> forwardOrder) {
    this.forwardOrder = checkNotNull(forwardOrder);
  }

            

Reported by PMD.

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

Line: 32

              @ElementTypesAreNonnullByDefault
final class ReverseOrdering<T extends @Nullable Object> extends Ordering<T>
    implements Serializable {
  final Ordering<? super T> forwardOrder;

  ReverseOrdering(Ordering<? super T> forwardOrder) {
    this.forwardOrder = checkNotNull(forwardOrder);
  }


            

Reported by PMD.

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

Line: 31

               *
 * @author Hayward Chan
 */
public abstract class ForwardingImmutableMap<K, V> extends ImmutableMap<K, V> {

  final transient Map<K, V> delegate;

  ForwardingImmutableMap(Map<? extends K, ? extends V> delegate) {
    this.delegate = Collections.unmodifiableMap(delegate);

            

Reported by PMD.

Assigning an Object to null is a code smell. Consider refactoring.
Error

Line: 99

                          if (size() < result.length) {
              // It works around a GWT bug where elements after last is not
              // properly null'ed.
              result[size()] = null;
            }
            return result;
          }
        });
  }

            

Reported by PMD.

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

Line: 35

              @ElementTypesAreNonnullByDefault
class RegularImmutableAsList<E> extends ImmutableAsList<E> {
  private final ImmutableCollection<E> delegate;
  private final ImmutableList<? extends E> delegateList;

  RegularImmutableAsList(ImmutableCollection<E> delegate, ImmutableList<? extends E> delegateList) {
    this.delegate = delegate;
    this.delegateList = delegateList;
  }

            

Reported by PMD.

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

Line: 42

                  this.delegateList = delegateList;
  }

  RegularImmutableAsList(ImmutableCollection<E> delegate, Object[] array) {
    this(delegate, ImmutableList.<E>asImmutableList(array));
  }

  RegularImmutableAsList(ImmutableCollection<E> delegate, Object[] array, int size) {
    this(delegate, ImmutableList.<E>asImmutableList(array, size));

            

Reported by PMD.

android/guava/src/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: 32

               * <p>TODO(cpovirk): Consider applying this subclass approach to our other types.
 */
@GwtCompatible(emulated = true)
abstract class RangeGwtSerializationDependencies<C extends Comparable> implements Serializable {}

            

Reported by PMD.

Classes implementing Serializable should set a serialVersionUID
Error

Line: 32

               * <p>TODO(cpovirk): Consider applying this subclass approach to our other types.
 */
@GwtCompatible(emulated = true)
abstract class RangeGwtSerializationDependencies<C extends Comparable> implements Serializable {}

            

Reported by PMD.

guava-gwt/src-super/com/google/common/collect/super/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: 22

              import com.google.common.annotations.GwtCompatible;

@GwtCompatible(emulated = true)
abstract class ImmutableMultisetGwtSerializationDependencies<E> extends ImmutableCollection<E> {
  E dummy;
}

            

Reported by PMD.

Classes implementing Serializable should set a serialVersionUID
Error

Line: 22

              import com.google.common.annotations.GwtCompatible;

@GwtCompatible(emulated = true)
abstract class ImmutableMultisetGwtSerializationDependencies<E> extends ImmutableCollection<E> {
  E dummy;
}

            

Reported by PMD.