The following issues were found
guava-testlib/src/com/google/common/collect/testing/TestMapEntrySetGenerator.java
3 issues
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.
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.
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
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.
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.
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
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.
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.
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
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.
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.
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
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.
Line: 45
}
};
private final NavigableSet<E> delegate;
public SafeTreeSet() {
this(new TreeSet<E>());
}
Reported by PMD.
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
Line: 28
*/
@GwtCompatible(emulated = true)
@ElementTypesAreNonnullByDefault
abstract class ForwardingImmutableList<E> {
private ForwardingImmutableList() {}
}
Reported by PMD.
Line: 28
*/
@GwtCompatible(emulated = true)
@ElementTypesAreNonnullByDefault
abstract class ForwardingImmutableList<E> {
private ForwardingImmutableList() {}
}
Reported by PMD.
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
Line: 28
*/
@GwtCompatible(emulated = true)
@ElementTypesAreNonnullByDefault
abstract class ForwardingImmutableMap<K, V> {
private ForwardingImmutableMap() {}
}
Reported by PMD.
Line: 28
*/
@GwtCompatible(emulated = true)
@ElementTypesAreNonnullByDefault
abstract class ForwardingImmutableMap<K, V> {
private ForwardingImmutableMap() {}
}
Reported by PMD.
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
Line: 28
*/
@GwtCompatible(emulated = true)
@ElementTypesAreNonnullByDefault
abstract class ForwardingImmutableSet<E> {
private ForwardingImmutableSet() {}
}
Reported by PMD.
Line: 28
*/
@GwtCompatible(emulated = true)
@ElementTypesAreNonnullByDefault
abstract class ForwardingImmutableSet<E> {
private ForwardingImmutableSet() {}
}
Reported by PMD.
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
Line: 52
@Override
public boolean hasNext() {
return delegate().hasNext();
}
@CanIgnoreReturnValue
@Override
@ParametricNullness
Reported by PMD.
Line: 59
@Override
@ParametricNullness
public T next() {
return delegate().next();
}
@Override
public void remove() {
delegate().remove();
Reported by PMD.
Line: 64
@Override
public void remove() {
delegate().remove();
}
}
Reported by PMD.
android/guava/src/com/google/common/collect/ForwardingListMultimap.java
3 issues
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.
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.
Line: 62
@CanIgnoreReturnValue
@Override
public List<V> replaceValues(@ParametricNullness K key, Iterable<? extends V> values) {
return delegate().replaceValues(key, values);
}
}
Reported by PMD.