The following issues were found

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

Line: 88

                 */
  public abstract String escape(String string);

  private final Function<String, String> asFunction =
      new Function<String, String>() {
        @Override
        public String apply(String from) {
          return escape(from);
        }

            

Reported by PMD.

Field asFunction has the same name as a method
Error

Line: 88

                 */
  public abstract String escape(String string);

  private final Function<String, String> asFunction =
      new Function<String, String>() {
        @Override
        public String apply(String from) {
          return escape(from);
        }

            

Reported by PMD.

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.

guava/src/com/google/common/math/BigDecimalMath.java
2 issues
Potential violation of Law of Demeter (static property access)
Design

Line: 54

                 * @since 30.0
   */
  public static double roundToDouble(BigDecimal x, RoundingMode mode) {
    return BigDecimalToDoubleRounder.INSTANCE.roundToDouble(x, mode);
  }

  private static class BigDecimalToDoubleRounder extends ToDoubleRounder<BigDecimal> {
    static final BigDecimalToDoubleRounder INSTANCE = new BigDecimalToDoubleRounder();


            

Reported by PMD.

Avoid creating BigDecimal with a decimal (float/double) literal. Use a String literal
Error

Line: 74

              
    @Override
    BigDecimal toX(double d, RoundingMode mode) {
      return new BigDecimal(d);
    }

    @Override
    BigDecimal minus(BigDecimal a, BigDecimal b) {
      return a.subtract(b);

            

Reported by PMD.

android/guava/src/com/google/common/collect/SortedLists.java
2 issues
Avoid reassigning parameters such as 'list'
Design

Line: 271

                 *     otherwise the index determined by the {@code KeyAbsentBehavior}.
   */
  public static <E extends @Nullable Object> int binarySearch(
      List<? extends E> list,
      @ParametricNullness E key,
      Comparator<? super E> comparator,
      KeyPresentBehavior presentBehavior,
      KeyAbsentBehavior absentBehavior) {
    checkNotNull(comparator);

            

Reported by PMD.

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

Line: 286

                  // TODO(lowasser): benchmark when it's best to do a linear search

    int lower = 0;
    int upper = list.size() - 1;

    while (lower <= upper) {
      int middle = (lower + upper) >>> 1;
      int c = comparator.compare(key, list.get(middle));
      if (c < 0) {

            

Reported by PMD.

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

Line: 37

              @GwtIncompatible
@ElementTypesAreNonnullByDefault
class AppendableWriter extends Writer {
  private final Appendable target;
  private boolean closed;

  /**
   * Creates a new writer that appends everything it writes to {@code target}.
   *

            

Reported by PMD.

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

Line: 38

              @ElementTypesAreNonnullByDefault
class AppendableWriter extends Writer {
  private final Appendable target;
  private boolean closed;

  /**
   * Creates a new writer that appends everything it writes to {@code target}.
   *
   * @param target target to which to append output

            

Reported by PMD.

android/guava/src/com/google/common/hash/PrimitiveSink.java
2 issues
Do not use the short type
Performance

Line: 73

                PrimitiveSink putBytes(ByteBuffer bytes);

  /** Puts a short into this sink. */
  PrimitiveSink putShort(short s);

  /** Puts an int into this sink. */
  PrimitiveSink putInt(int i);

  /** Puts a long into this sink. */

            

Reported by PMD.

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

Line: 31

              @Beta
@CanIgnoreReturnValue
@ElementTypesAreNonnullByDefault
public interface PrimitiveSink {
  /**
   * Puts a byte into this sink.
   *
   * @param b a byte
   * @return this instance

            

Reported by PMD.

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

Line: 36

               */
@CanIgnoreReturnValue
@ElementTypesAreNonnullByDefault
abstract class AbstractByteHasher extends AbstractHasher {
  private final ByteBuffer scratch = ByteBuffer.allocate(8).order(ByteOrder.LITTLE_ENDIAN);

  /** Updates this hasher with the given byte. */
  protected abstract void update(byte b);


            

Reported by PMD.

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

Line: 37

              @CanIgnoreReturnValue
@ElementTypesAreNonnullByDefault
abstract class AbstractByteHasher extends AbstractHasher {
  private final ByteBuffer scratch = ByteBuffer.allocate(8).order(ByteOrder.LITTLE_ENDIAN);

  /** Updates this hasher with the given byte. */
  protected abstract void update(byte b);

  /** Updates this hasher with the given bytes. */

            

Reported by PMD.

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

Line: 63

              
  @Override
  public Set<N> adjacentNodes() {
    return Collections.unmodifiableSet(adjacentNodesMultiset().elementSet());
  }

  private Multiset<N> adjacentNodesMultiset() {
    Multiset<N> adjacentNodes = getReference(adjacentNodesReference);
    if (adjacentNodes == null) {

            

Reported by PMD.

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

Line: 80

                  return new MultiEdgesConnecting<E>(incidentEdgeMap, node) {
      @Override
      public int size() {
        return adjacentNodesMultiset().count(node);
      }
    };
  }

  @Override

            

Reported by PMD.

android/guava/src/com/google/common/util/concurrent/GwtFuturesCatchingSpecialization.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: 27

               */
@GwtCompatible(emulated = true)
@ElementTypesAreNonnullByDefault
abstract class GwtFuturesCatchingSpecialization {
  /*
   * This server copy of the class is empty. The corresponding GWT copy contains alternative
   * versions of catching() and catchingAsync() with slightly different signatures from the ones
   * found in Futures.java.
   */

            

Reported by PMD.

This abstract class does not have any abstract methods
Design

Line: 27

               */
@GwtCompatible(emulated = true)
@ElementTypesAreNonnullByDefault
abstract class GwtFuturesCatchingSpecialization {
  /*
   * This server copy of the class is empty. The corresponding GWT copy contains alternative
   * versions of catching() and catchingAsync() with slightly different signatures from the ones
   * found in Futures.java.
   */

            

Reported by PMD.

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

Line: 88

                 */
  public abstract String escape(String string);

  private final Function<String, String> asFunction =
      new Function<String, String>() {
        @Override
        public String apply(String from) {
          return escape(from);
        }

            

Reported by PMD.

Field asFunction has the same name as a method
Error

Line: 88

                 */
  public abstract String escape(String string);

  private final Function<String, String> asFunction =
      new Function<String, String>() {
        @Override
        public String apply(String from) {
          return escape(from);
        }

            

Reported by PMD.