The following issues were found

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

Line: 32

               */
@GwtCompatible
public abstract class TestMapEntrySetGenerator<K, V> implements TestSetGenerator<Map.Entry<K, V>> {
  private final SampleElements<K> keys;
  private final SampleElements<V> values;

  protected TestMapEntrySetGenerator(SampleElements<K> keys, SampleElements<V> values) {
    this.keys = keys;
    this.values = values;

            

Reported by PMD.

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

Line: 33

              @GwtCompatible
public abstract class TestMapEntrySetGenerator<K, V> implements TestSetGenerator<Map.Entry<K, V>> {
  private final SampleElements<K> keys;
  private final SampleElements<V> values;

  protected TestMapEntrySetGenerator(SampleElements<K> keys, SampleElements<V> values) {
    this.keys = keys;
    this.values = values;
  }

            

Reported by PMD.

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

Line: 52

                  return createFromEntries(entries);
  }

  public abstract Set<Entry<K, V>> createFromEntries(Entry<K, V>[] entries);

  @Override
  @SuppressWarnings("unchecked") // generic arrays make typesafety sad
  public Entry<K, V>[] createArray(int length) {
    return new Entry[length];

            

Reported by PMD.

android/guava/src/com/google/common/util/concurrent/CollectionFuture.java
3 issues
Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 39

                 * there: cancel() never reads this field, only writes to it. That makes the race here completely
   * harmless, rather than just 99.99% harmless.
   */
  @CheckForNull private List<@Nullable Present<V>> values;

  CollectionFuture(
      ImmutableCollection<? extends ListenableFuture<? extends V>> futures,
      boolean allMustSucceed) {
    super(futures, allMustSucceed, true);

            

Reported by PMD.

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

Line: 78

                @Override
  void releaseResources(ReleaseResourcesReason reason) {
    super.releaseResources(reason);
    this.values = null;
  }

  abstract C combine(List<@Nullable Present<V>> values);

  /** Used for {@link Futures#allAsList} and {@link Futures#successfulAsList}. */

            

Reported by PMD.

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

Line: 105

              
  /** The result of a successful {@code Future}. */
  private static final class Present<V extends @Nullable Object> {
    V value;

    Present(V value) {
      this.value = value;
    }
  }

            

Reported by PMD.

android/guava/src/com/google/common/util/concurrent/ImmediateFuture.java
3 issues
Logger calls should be surrounded by log level guards.
Design

Line: 52

                  } catch (RuntimeException e) {
      // ListenableFuture's contract is that it will not throw unchecked exceptions, so log the bad
      // runnable and/or executor and swallow it.
      log.log(
          Level.SEVERE,
          "RuntimeException while executing runnable " + listener + " with executor " + executor,
          e);
    }
  }

            

Reported by PMD.

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

Line: 37

              
  private static final Logger log = Logger.getLogger(ImmediateFuture.class.getName());

  @ParametricNullness private final V value;

  ImmediateFuture(@ParametricNullness V value) {
    this.value = value;
  }


            

Reported by PMD.

Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block
Design

Line: 49

                  checkNotNull(executor, "Executor was null.");
    try {
      executor.execute(listener);
    } catch (RuntimeException e) {
      // ListenableFuture's contract is that it will not throw unchecked exceptions, so log the bad
      // runnable and/or executor and swallow it.
      log.log(
          Level.SEVERE,
          "RuntimeException while executing runnable " + listener + " with executor " + executor,

            

Reported by PMD.

android/guava/src/com/google/common/collect/EnumHashBiMap.java
3 issues
Field keyType has the same name as a method
Error

Line: 48

              @ElementTypesAreNonnullByDefault
public final class EnumHashBiMap<K extends Enum<K>, V extends @Nullable Object>
    extends AbstractBiMap<K, V> {
  private transient Class<K> keyType;

  /**
   * Returns a new, empty {@code EnumHashBiMap} using the specified key type.
   *
   * @param keyType the key type

            

Reported by PMD.

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

Line: 73

                public static <K extends Enum<K>, V extends @Nullable Object> EnumHashBiMap<K, V> create(
      Map<K, ? extends V> map) {
    EnumHashBiMap<K, V> bimap = create(EnumBiMap.inferKeyType(map));
    bimap.putAll(map);
    return bimap;
  }

  private EnumHashBiMap(Class<K> keyType) {
    super(

            

Reported by PMD.

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

Line: 131

                  stream.defaultReadObject();
    keyType = (Class<K>) stream.readObject();
    setDelegates(
        new EnumMap<K, V>(keyType), new HashMap<V, K>(keyType.getEnumConstants().length * 3 / 2));
    Serialization.populateMap(this, stream);
  }

  @GwtIncompatible // only needed in emulated source.
  private static final long serialVersionUID = 0;

            

Reported by PMD.

guava-testlib/src/com/google/common/collect/testing/SafeTreeSet.java
3 issues
This class has too many methods, consider refactoring it.
Design

Line: 35

               * @author Louis Wasserman
 */
@GwtIncompatible
public final class SafeTreeSet<E> implements Serializable, NavigableSet<E> {
  @SuppressWarnings("unchecked")
  private static final Comparator<Object> NATURAL_ORDER =
      new Comparator<Object>() {
        @Override
        public int compare(Object o1, Object o2) {

            

Reported by PMD.

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

Line: 45

                      }
      };

  private final NavigableSet<E> delegate;

  public SafeTreeSet() {
    this(new TreeSet<E>());
  }


            

Reported by PMD.

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

Line: 235

                  // a ClassCastException is what's supposed to happen!
    @SuppressWarnings("unchecked")
    E e = (E) t;
    comparator().compare(e, e);
    return t;
  }

  @Override
  public boolean equals(Object obj) {

            

Reported by PMD.

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

Line: 28

               */
@GwtCompatible(emulated = true)
@ElementTypesAreNonnullByDefault
abstract class ForwardingImmutableList<E> {
  private ForwardingImmutableList() {}
}

            

Reported by PMD.

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

Line: 28

               */
@GwtCompatible(emulated = true)
@ElementTypesAreNonnullByDefault
abstract class ForwardingImmutableList<E> {
  private ForwardingImmutableList() {}
}

            

Reported by PMD.

This abstract class does not have any abstract methods
Design

Line: 28

               */
@GwtCompatible(emulated = true)
@ElementTypesAreNonnullByDefault
abstract class ForwardingImmutableList<E> {
  private ForwardingImmutableList() {}
}

            

Reported by PMD.

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

Line: 28

               */
@GwtCompatible(emulated = true)
@ElementTypesAreNonnullByDefault
abstract class ForwardingImmutableMap<K, V> {
  private ForwardingImmutableMap() {}
}

            

Reported by PMD.

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

Line: 28

               */
@GwtCompatible(emulated = true)
@ElementTypesAreNonnullByDefault
abstract class ForwardingImmutableMap<K, V> {
  private ForwardingImmutableMap() {}
}

            

Reported by PMD.

This abstract class does not have any abstract methods
Design

Line: 28

               */
@GwtCompatible(emulated = true)
@ElementTypesAreNonnullByDefault
abstract class ForwardingImmutableMap<K, V> {
  private ForwardingImmutableMap() {}
}

            

Reported by PMD.

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

Line: 28

               */
@GwtCompatible(emulated = true)
@ElementTypesAreNonnullByDefault
abstract class ForwardingImmutableSet<E> {
  private ForwardingImmutableSet() {}
}

            

Reported by PMD.

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

Line: 28

               */
@GwtCompatible(emulated = true)
@ElementTypesAreNonnullByDefault
abstract class ForwardingImmutableSet<E> {
  private ForwardingImmutableSet() {}
}

            

Reported by PMD.

This abstract class does not have any abstract methods
Design

Line: 28

               */
@GwtCompatible(emulated = true)
@ElementTypesAreNonnullByDefault
abstract class ForwardingImmutableSet<E> {
  private ForwardingImmutableSet() {}
}

            

Reported by PMD.

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

Line: 52

              
  @Override
  public boolean hasNext() {
    return delegate().hasNext();
  }

  @CanIgnoreReturnValue
  @Override
  @ParametricNullness

            

Reported by PMD.

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

Line: 59

                @Override
  @ParametricNullness
  public T next() {
    return delegate().next();
  }

  @Override
  public void remove() {
    delegate().remove();

            

Reported by PMD.

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

Line: 64

              
  @Override
  public void remove() {
    delegate().remove();
  }
}

            

Reported by PMD.

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

Line: 50

              
  @Override
  public List<V> get(@ParametricNullness K key) {
    return delegate().get(key);
  }

  @CanIgnoreReturnValue
  @Override
  public List<V> removeAll(@CheckForNull Object key) {

            

Reported by PMD.

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

Line: 56

                @CanIgnoreReturnValue
  @Override
  public List<V> removeAll(@CheckForNull Object key) {
    return delegate().removeAll(key);
  }

  @CanIgnoreReturnValue
  @Override
  public List<V> replaceValues(@ParametricNullness K key, Iterable<? extends V> values) {

            

Reported by PMD.

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

Line: 62

                @CanIgnoreReturnValue
  @Override
  public List<V> replaceValues(@ParametricNullness K key, Iterable<? extends V> values) {
    return delegate().replaceValues(key, values);
  }
}

            

Reported by PMD.