The following issues were found
android/guava-testlib/src/com/google/common/testing/ClassSanityTester.java
98 issues
Line: 196
doTestNulls(cls, Visibility.PACKAGE);
} catch (Exception e) {
throwIfUnchecked(e);
throw new RuntimeException(e);
}
}
void doTestNulls(Class<?> cls, Visibility visibility)
throws ParameterNotInstantiableException, IllegalAccessException, InvocationTargetException,
Reported by PMD.
Line: 288
doTestEquals(cls);
} catch (Exception e) {
throwIfUnchecked(e);
throw new RuntimeException(e);
}
}
void doTestEquals(Class<?> cls)
throws ParameterNotInstantiableException, ParameterHasNoDistinctValueException,
Reported by PMD.
Line: 17
* limitations under the License.
*/
package com.google.common.testing;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.Throwables.throwIfUnchecked;
import static com.google.common.testing.NullPointerTester.isNullable;
Reported by PMD.
Line: 83
*/
@Beta
@GwtIncompatible
public final class ClassSanityTester {
private static final Ordering<Invokable<?, ?>> BY_METHOD_NAME =
new Ordering<Invokable<?, ?>>() {
@Override
public int compare(Invokable<?, ?> left, Invokable<?, ?> right) {
Reported by PMD.
Line: 83
*/
@Beta
@GwtIncompatible
public final class ClassSanityTester {
private static final Ordering<Invokable<?, ?>> BY_METHOD_NAME =
new Ordering<Invokable<?, ?>>() {
@Override
public int compare(Invokable<?, ?> left, Invokable<?, ?> right) {
Reported by PMD.
Line: 83
*/
@Beta
@GwtIncompatible
public final class ClassSanityTester {
private static final Ordering<Invokable<?, ?>> BY_METHOD_NAME =
new Ordering<Invokable<?, ?>>() {
@Override
public int compare(Invokable<?, ?> left, Invokable<?, ?> right) {
Reported by PMD.
Line: 89
new Ordering<Invokable<?, ?>>() {
@Override
public int compare(Invokable<?, ?> left, Invokable<?, ?> right) {
return left.getName().compareTo(right.getName());
}
};
private static final Ordering<Invokable<?, ?>> BY_PARAMETERS =
new Ordering<Invokable<?, ?>>() {
Reported by PMD.
Line: 97
new Ordering<Invokable<?, ?>>() {
@Override
public int compare(Invokable<?, ?> left, Invokable<?, ?> right) {
return Ordering.usingToString().compare(left.getParameters(), right.getParameters());
}
};
private static final Ordering<Invokable<?, ?>> BY_NUMBER_OF_PARAMETERS =
new Ordering<Invokable<?, ?>>() {
Reported by PMD.
Line: 105
new Ordering<Invokable<?, ?>>() {
@Override
public int compare(Invokable<?, ?> left, Invokable<?, ?> right) {
return Ints.compare(left.getParameters().size(), right.getParameters().size());
}
};
private final MutableClassToInstanceMap<Object> defaultValues =
MutableClassToInstanceMap.create();
Reported by PMD.
Line: 105
new Ordering<Invokable<?, ?>>() {
@Override
public int compare(Invokable<?, ?> left, Invokable<?, ?> right) {
return Ints.compare(left.getParameters().size(), right.getParameters().size());
}
};
private final MutableClassToInstanceMap<Object> defaultValues =
MutableClassToInstanceMap.create();
Reported by PMD.
guava/src/com/google/common/collect/CompactHashMap.java
98 issues
Line: 17
* limitations under the License.
*/
package com.google.common.collect;
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.collect.CollectPreconditions.checkRemove;
import static com.google.common.collect.CompactHashing.UNSET;
import static com.google.common.collect.Hashing.smearedHash;
Reported by PMD.
Line: 84
*/
@GwtIncompatible // not worth using in GWT for now
@ElementTypesAreNonnullByDefault
class CompactHashMap<K extends @Nullable Object, V extends @Nullable Object>
extends AbstractMap<K, V> implements Serializable {
/*
* TODO: Make this a drop-in replacement for j.u. versions, actually drop them in, and test the
* world. Figure out what sort of space-time tradeoff we're actually going to get here with the
* *Map variants. This class is particularly hard to benchmark, because the benefit is not only in
Reported by PMD.
Line: 84
*/
@GwtIncompatible // not worth using in GWT for now
@ElementTypesAreNonnullByDefault
class CompactHashMap<K extends @Nullable Object, V extends @Nullable Object>
extends AbstractMap<K, V> implements Serializable {
/*
* TODO: Make this a drop-in replacement for j.u. versions, actually drop them in, and test the
* world. Figure out what sort of space-time tradeoff we're actually going to get here with the
* *Map variants. This class is particularly hard to benchmark, because the benefit is not only in
Reported by PMD.
Line: 84
*/
@GwtIncompatible // not worth using in GWT for now
@ElementTypesAreNonnullByDefault
class CompactHashMap<K extends @Nullable Object, V extends @Nullable Object>
extends AbstractMap<K, V> implements Serializable {
/*
* TODO: Make this a drop-in replacement for j.u. versions, actually drop them in, and test the
* world. Figure out what sort of space-time tradeoff we're actually going to get here with the
* *Map variants. This class is particularly hard to benchmark, because the benefit is not only in
Reported by PMD.
Line: 84
*/
@GwtIncompatible // not worth using in GWT for now
@ElementTypesAreNonnullByDefault
class CompactHashMap<K extends @Nullable Object, V extends @Nullable Object>
extends AbstractMap<K, V> implements Serializable {
/*
* TODO: Make this a drop-in replacement for j.u. versions, actually drop them in, and test the
* world. Figure out what sort of space-time tradeoff we're actually going to get here with the
* *Map variants. This class is particularly hard to benchmark, because the benefit is not only in
Reported by PMD.
Line: 85
@GwtIncompatible // not worth using in GWT for now
@ElementTypesAreNonnullByDefault
class CompactHashMap<K extends @Nullable Object, V extends @Nullable Object>
extends AbstractMap<K, V> implements Serializable {
/*
* TODO: Make this a drop-in replacement for j.u. versions, actually drop them in, and test the
* world. Figure out what sort of space-time tradeoff we're actually going to get here with the
* *Map variants. This class is particularly hard to benchmark, because the benefit is not only in
* less allocation, but also having the GC do less work to scan the heap because of fewer
Reported by PMD.
Line: 218
* The values of the entries in the map, in the range of [0, size()). The values in [size(),
* values.length) are all {@code null}.
*/
@VisibleForTesting @CheckForNull transient @Nullable Object[] values;
/**
* Keeps track of metadata like the number of hash table bits and modifications of this data
* structure (to make it possible to throw ConcurrentModificationException in the iterator). Note
* that we choose not to make this volatile, so we do less of a "best effort" to track such
Reported by PMD.
Line: 235
private transient int metadata;
/** The number of elements contained in the set. */
private transient int size;
/** Constructs a new empty instance of {@code CompactHashMap}. */
CompactHashMap() {
init(CompactHashing.DEFAULT_SIZE);
}
Reported by PMD.
Line: 282
return expectedSize;
}
@SuppressWarnings("unchecked")
@VisibleForTesting
@CheckForNull
Map<K, V> delegateOrNull() {
if (table instanceof Map) {
return (Map<K, V>) table;
Reported by PMD.
Line: 304
newDelegate.put(key(i), value(i));
}
this.table = newDelegate;
this.entries = null;
this.keys = null;
this.values = null;
incrementModCount();
return newDelegate;
}
Reported by PMD.
guava/src/com/google/common/reflect/TypeToken.java
98 issues
Line: 15
* the License.
*/
package com.google.common.reflect;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.Preconditions.checkState;
import static java.util.Objects.requireNonNull;
Reported by PMD.
Line: 103
@Beta
@SuppressWarnings("serial") // SimpleTypeToken is the serialized form.
@ElementTypesAreNonnullByDefault
public abstract class TypeToken<T> extends TypeCapture<T> implements Serializable {
private final Type runtimeType;
/** Resolver for resolving parameter and field types with {@link #runtimeType} as context. */
@CheckForNull private transient TypeResolver invariantTypeResolver;
Reported by PMD.
Line: 103
@Beta
@SuppressWarnings("serial") // SimpleTypeToken is the serialized form.
@ElementTypesAreNonnullByDefault
public abstract class TypeToken<T> extends TypeCapture<T> implements Serializable {
private final Type runtimeType;
/** Resolver for resolving parameter and field types with {@link #runtimeType} as context. */
@CheckForNull private transient TypeResolver invariantTypeResolver;
Reported by PMD.
Line: 103
@Beta
@SuppressWarnings("serial") // SimpleTypeToken is the serialized form.
@ElementTypesAreNonnullByDefault
public abstract class TypeToken<T> extends TypeCapture<T> implements Serializable {
private final Type runtimeType;
/** Resolver for resolving parameter and field types with {@link #runtimeType} as context. */
@CheckForNull private transient TypeResolver invariantTypeResolver;
Reported by PMD.
Line: 103
@Beta
@SuppressWarnings("serial") // SimpleTypeToken is the serialized form.
@ElementTypesAreNonnullByDefault
public abstract class TypeToken<T> extends TypeCapture<T> implements Serializable {
private final Type runtimeType;
/** Resolver for resolving parameter and field types with {@link #runtimeType} as context. */
@CheckForNull private transient TypeResolver invariantTypeResolver;
Reported by PMD.
Line: 196
*/
public final Class<? super T> getRawType() {
// For wildcard or type variable, the first bound determines the runtime type.
Class<?> rawType = getRawTypes().iterator().next();
@SuppressWarnings("unchecked") // raw type is |T|
Class<? super T> result = (Class<? super T>) rawType;
return result;
}
Reported by PMD.
Line: 196
*/
public final Class<? super T> getRawType() {
// For wildcard or type variable, the first bound determines the runtime type.
Class<?> rawType = getRawTypes().iterator().next();
@SuppressWarnings("unchecked") // raw type is |T|
Class<? super T> result = (Class<? super T>) rawType;
return result;
}
Reported by PMD.
Line: 197
public final Class<? super T> getRawType() {
// For wildcard or type variable, the first bound determines the runtime type.
Class<?> rawType = getRawTypes().iterator().next();
@SuppressWarnings("unchecked") // raw type is |T|
Class<? super T> result = (Class<? super T>) rawType;
return result;
}
/** Returns the represented type. */
Reported by PMD.
Line: 285
checkNotNull(type);
// Being conservative here because the user could use resolveType() to resolve a type in an
// invariant context.
return of(getInvariantTypeResolver().resolveType(type));
}
private TypeToken<?> resolveSupertype(Type type) {
TypeToken<?> supertype = of(getCovariantTypeResolver().resolveType(type));
// super types' type mapping is a subset of type mapping of this type.
Reported by PMD.
Line: 289
}
private TypeToken<?> resolveSupertype(Type type) {
TypeToken<?> supertype = of(getCovariantTypeResolver().resolveType(type));
// super types' type mapping is a subset of type mapping of this type.
supertype.covariantTypeResolver = covariantTypeResolver;
supertype.invariantTypeResolver = invariantTypeResolver;
return supertype;
}
Reported by PMD.
android/guava/src/com/google/common/reflect/TypeToken.java
98 issues
Line: 15
* the License.
*/
package com.google.common.reflect;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.Preconditions.checkState;
import static java.util.Objects.requireNonNull;
Reported by PMD.
Line: 103
@Beta
@SuppressWarnings("serial") // SimpleTypeToken is the serialized form.
@ElementTypesAreNonnullByDefault
public abstract class TypeToken<T> extends TypeCapture<T> implements Serializable {
private final Type runtimeType;
/** Resolver for resolving parameter and field types with {@link #runtimeType} as context. */
@CheckForNull private transient TypeResolver invariantTypeResolver;
Reported by PMD.
Line: 103
@Beta
@SuppressWarnings("serial") // SimpleTypeToken is the serialized form.
@ElementTypesAreNonnullByDefault
public abstract class TypeToken<T> extends TypeCapture<T> implements Serializable {
private final Type runtimeType;
/** Resolver for resolving parameter and field types with {@link #runtimeType} as context. */
@CheckForNull private transient TypeResolver invariantTypeResolver;
Reported by PMD.
Line: 103
@Beta
@SuppressWarnings("serial") // SimpleTypeToken is the serialized form.
@ElementTypesAreNonnullByDefault
public abstract class TypeToken<T> extends TypeCapture<T> implements Serializable {
private final Type runtimeType;
/** Resolver for resolving parameter and field types with {@link #runtimeType} as context. */
@CheckForNull private transient TypeResolver invariantTypeResolver;
Reported by PMD.
Line: 103
@Beta
@SuppressWarnings("serial") // SimpleTypeToken is the serialized form.
@ElementTypesAreNonnullByDefault
public abstract class TypeToken<T> extends TypeCapture<T> implements Serializable {
private final Type runtimeType;
/** Resolver for resolving parameter and field types with {@link #runtimeType} as context. */
@CheckForNull private transient TypeResolver invariantTypeResolver;
Reported by PMD.
Line: 196
*/
public final Class<? super T> getRawType() {
// For wildcard or type variable, the first bound determines the runtime type.
Class<?> rawType = getRawTypes().iterator().next();
@SuppressWarnings("unchecked") // raw type is |T|
Class<? super T> result = (Class<? super T>) rawType;
return result;
}
Reported by PMD.
Line: 196
*/
public final Class<? super T> getRawType() {
// For wildcard or type variable, the first bound determines the runtime type.
Class<?> rawType = getRawTypes().iterator().next();
@SuppressWarnings("unchecked") // raw type is |T|
Class<? super T> result = (Class<? super T>) rawType;
return result;
}
Reported by PMD.
Line: 197
public final Class<? super T> getRawType() {
// For wildcard or type variable, the first bound determines the runtime type.
Class<?> rawType = getRawTypes().iterator().next();
@SuppressWarnings("unchecked") // raw type is |T|
Class<? super T> result = (Class<? super T>) rawType;
return result;
}
/** Returns the represented type. */
Reported by PMD.
Line: 285
checkNotNull(type);
// Being conservative here because the user could use resolveType() to resolve a type in an
// invariant context.
return of(getInvariantTypeResolver().resolveType(type));
}
private TypeToken<?> resolveSupertype(Type type) {
TypeToken<?> supertype = of(getCovariantTypeResolver().resolveType(type));
// super types' type mapping is a subset of type mapping of this type.
Reported by PMD.
Line: 289
}
private TypeToken<?> resolveSupertype(Type type) {
TypeToken<?> supertype = of(getCovariantTypeResolver().resolveType(type));
// super types' type mapping is a subset of type mapping of this type.
supertype.covariantTypeResolver = covariantTypeResolver;
supertype.invariantTypeResolver = invariantTypeResolver;
return supertype;
}
Reported by PMD.
guava-testlib/src/com/google/common/testing/ClassSanityTester.java
98 issues
Line: 196
doTestNulls(cls, Visibility.PACKAGE);
} catch (Exception e) {
throwIfUnchecked(e);
throw new RuntimeException(e);
}
}
void doTestNulls(Class<?> cls, Visibility visibility)
throws ParameterNotInstantiableException, IllegalAccessException, InvocationTargetException,
Reported by PMD.
Line: 288
doTestEquals(cls);
} catch (Exception e) {
throwIfUnchecked(e);
throw new RuntimeException(e);
}
}
void doTestEquals(Class<?> cls)
throws ParameterNotInstantiableException, ParameterHasNoDistinctValueException,
Reported by PMD.
Line: 17
* limitations under the License.
*/
package com.google.common.testing;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.Throwables.throwIfUnchecked;
import static com.google.common.testing.NullPointerTester.isNullable;
Reported by PMD.
Line: 83
*/
@Beta
@GwtIncompatible
public final class ClassSanityTester {
private static final Ordering<Invokable<?, ?>> BY_METHOD_NAME =
new Ordering<Invokable<?, ?>>() {
@Override
public int compare(Invokable<?, ?> left, Invokable<?, ?> right) {
Reported by PMD.
Line: 83
*/
@Beta
@GwtIncompatible
public final class ClassSanityTester {
private static final Ordering<Invokable<?, ?>> BY_METHOD_NAME =
new Ordering<Invokable<?, ?>>() {
@Override
public int compare(Invokable<?, ?> left, Invokable<?, ?> right) {
Reported by PMD.
Line: 83
*/
@Beta
@GwtIncompatible
public final class ClassSanityTester {
private static final Ordering<Invokable<?, ?>> BY_METHOD_NAME =
new Ordering<Invokable<?, ?>>() {
@Override
public int compare(Invokable<?, ?> left, Invokable<?, ?> right) {
Reported by PMD.
Line: 89
new Ordering<Invokable<?, ?>>() {
@Override
public int compare(Invokable<?, ?> left, Invokable<?, ?> right) {
return left.getName().compareTo(right.getName());
}
};
private static final Ordering<Invokable<?, ?>> BY_PARAMETERS =
new Ordering<Invokable<?, ?>>() {
Reported by PMD.
Line: 97
new Ordering<Invokable<?, ?>>() {
@Override
public int compare(Invokable<?, ?> left, Invokable<?, ?> right) {
return Ordering.usingToString().compare(left.getParameters(), right.getParameters());
}
};
private static final Ordering<Invokable<?, ?>> BY_NUMBER_OF_PARAMETERS =
new Ordering<Invokable<?, ?>>() {
Reported by PMD.
Line: 105
new Ordering<Invokable<?, ?>>() {
@Override
public int compare(Invokable<?, ?> left, Invokable<?, ?> right) {
return Ints.compare(left.getParameters().size(), right.getParameters().size());
}
};
private final MutableClassToInstanceMap<Object> defaultValues =
MutableClassToInstanceMap.create();
Reported by PMD.
Line: 105
new Ordering<Invokable<?, ?>>() {
@Override
public int compare(Invokable<?, ?> left, Invokable<?, ?> right) {
return Ints.compare(left.getParameters().size(), right.getParameters().size());
}
};
private final MutableClassToInstanceMap<Object> defaultValues =
MutableClassToInstanceMap.create();
Reported by PMD.
android/guava-tests/test/com/google/common/util/concurrent/JSR166TestCase.java
97 issues
Line: 891
public static class NPETask implements Callable<String> {
public String call() {
throw new NullPointerException();
}
}
public static class CallableOne implements Callable<Integer> {
public Integer call() {
Reported by PMD.
Line: 130
} finally {
long elapsedMillis = (System.nanoTime() - t0) / (1000L * 1000L);
if (elapsedMillis >= profileThreshold)
System.out.printf("%n%s: %d%n", toString(), elapsedMillis);
}
}
// /**
// * Runs all JSR166 unit tests using junit.textui.TestRunner
Reported by PMD.
Line: 434
* Delays, via Thread.sleep, for the given millisecond delay, but if the sleep is shorter than
* specified, may re-sleep or yield until time elapses.
*/
static void delay(long millis) throws InterruptedException {
long startTime = System.nanoTime();
long ns = millis * 1000 * 1000;
for (; ; ) {
if (millis > 0L) Thread.sleep(millis);
else // too short to sleep
Reported by PMD.
Line: 534
// Some convenient Integer constants
public static final Integer zero = new Integer(0);
public static final Integer one = new Integer(1);
public static final Integer two = new Integer(2);
public static final Integer three = new Integer(3);
public static final Integer four = new Integer(4);
public static final Integer five = new Integer(5);
Reported by PMD.
Line: 535
// Some convenient Integer constants
public static final Integer zero = new Integer(0);
public static final Integer one = new Integer(1);
public static final Integer two = new Integer(2);
public static final Integer three = new Integer(3);
public static final Integer four = new Integer(4);
public static final Integer five = new Integer(5);
public static final Integer six = new Integer(6);
Reported by PMD.
Line: 536
public static final Integer zero = new Integer(0);
public static final Integer one = new Integer(1);
public static final Integer two = new Integer(2);
public static final Integer three = new Integer(3);
public static final Integer four = new Integer(4);
public static final Integer five = new Integer(5);
public static final Integer six = new Integer(6);
public static final Integer seven = new Integer(7);
Reported by PMD.
Line: 537
public static final Integer zero = new Integer(0);
public static final Integer one = new Integer(1);
public static final Integer two = new Integer(2);
public static final Integer three = new Integer(3);
public static final Integer four = new Integer(4);
public static final Integer five = new Integer(5);
public static final Integer six = new Integer(6);
public static final Integer seven = new Integer(7);
public static final Integer eight = new Integer(8);
Reported by PMD.
Line: 538
public static final Integer one = new Integer(1);
public static final Integer two = new Integer(2);
public static final Integer three = new Integer(3);
public static final Integer four = new Integer(4);
public static final Integer five = new Integer(5);
public static final Integer six = new Integer(6);
public static final Integer seven = new Integer(7);
public static final Integer eight = new Integer(8);
public static final Integer nine = new Integer(9);
Reported by PMD.
Line: 539
public static final Integer two = new Integer(2);
public static final Integer three = new Integer(3);
public static final Integer four = new Integer(4);
public static final Integer five = new Integer(5);
public static final Integer six = new Integer(6);
public static final Integer seven = new Integer(7);
public static final Integer eight = new Integer(8);
public static final Integer nine = new Integer(9);
public static final Integer m1 = new Integer(-1);
Reported by PMD.
Line: 540
public static final Integer three = new Integer(3);
public static final Integer four = new Integer(4);
public static final Integer five = new Integer(5);
public static final Integer six = new Integer(6);
public static final Integer seven = new Integer(7);
public static final Integer eight = new Integer(8);
public static final Integer nine = new Integer(9);
public static final Integer m1 = new Integer(-1);
public static final Integer m2 = new Integer(-2);
Reported by PMD.
guava-tests/test/com/google/common/util/concurrent/JSR166TestCase.java
97 issues
Line: 910
public static class NPETask implements Callable<String> {
@Override
public String call() {
throw new NullPointerException();
}
}
public static class CallableOne implements Callable<Integer> {
@Override
Reported by PMD.
Line: 131
} finally {
long elapsedMillis = (System.nanoTime() - t0) / (1000L * 1000L);
if (elapsedMillis >= profileThreshold)
System.out.printf("%n%s: %d%n", toString(), elapsedMillis);
}
}
// /**
// * Runs all JSR166 unit tests using junit.textui.TestRunner
Reported by PMD.
Line: 437
* Delays, via Thread.sleep, for the given millisecond delay, but if the sleep is shorter than
* specified, may re-sleep or yield until time elapses.
*/
static void delay(long millis) throws InterruptedException {
long startTime = System.nanoTime();
long ns = millis * 1000 * 1000;
for (; ; ) {
if (millis > 0L) Thread.sleep(millis);
else // too short to sleep
Reported by PMD.
Line: 537
// Some convenient Integer constants
public static final Integer zero = new Integer(0);
public static final Integer one = new Integer(1);
public static final Integer two = new Integer(2);
public static final Integer three = new Integer(3);
public static final Integer four = new Integer(4);
public static final Integer five = new Integer(5);
Reported by PMD.
Line: 538
// Some convenient Integer constants
public static final Integer zero = new Integer(0);
public static final Integer one = new Integer(1);
public static final Integer two = new Integer(2);
public static final Integer three = new Integer(3);
public static final Integer four = new Integer(4);
public static final Integer five = new Integer(5);
public static final Integer six = new Integer(6);
Reported by PMD.
Line: 539
public static final Integer zero = new Integer(0);
public static final Integer one = new Integer(1);
public static final Integer two = new Integer(2);
public static final Integer three = new Integer(3);
public static final Integer four = new Integer(4);
public static final Integer five = new Integer(5);
public static final Integer six = new Integer(6);
public static final Integer seven = new Integer(7);
Reported by PMD.
Line: 540
public static final Integer zero = new Integer(0);
public static final Integer one = new Integer(1);
public static final Integer two = new Integer(2);
public static final Integer three = new Integer(3);
public static final Integer four = new Integer(4);
public static final Integer five = new Integer(5);
public static final Integer six = new Integer(6);
public static final Integer seven = new Integer(7);
public static final Integer eight = new Integer(8);
Reported by PMD.
Line: 541
public static final Integer one = new Integer(1);
public static final Integer two = new Integer(2);
public static final Integer three = new Integer(3);
public static final Integer four = new Integer(4);
public static final Integer five = new Integer(5);
public static final Integer six = new Integer(6);
public static final Integer seven = new Integer(7);
public static final Integer eight = new Integer(8);
public static final Integer nine = new Integer(9);
Reported by PMD.
Line: 542
public static final Integer two = new Integer(2);
public static final Integer three = new Integer(3);
public static final Integer four = new Integer(4);
public static final Integer five = new Integer(5);
public static final Integer six = new Integer(6);
public static final Integer seven = new Integer(7);
public static final Integer eight = new Integer(8);
public static final Integer nine = new Integer(9);
public static final Integer m1 = new Integer(-1);
Reported by PMD.
Line: 543
public static final Integer three = new Integer(3);
public static final Integer four = new Integer(4);
public static final Integer five = new Integer(5);
public static final Integer six = new Integer(6);
public static final Integer seven = new Integer(7);
public static final Integer eight = new Integer(8);
public static final Integer nine = new Integer(9);
public static final Integer m1 = new Integer(-1);
public static final Integer m2 = new Integer(-2);
Reported by PMD.
guava/src/com/google/common/collect/TreeMultiset.java
97 issues
Line: 63
*/
@GwtCompatible(emulated = true)
@ElementTypesAreNonnullByDefault
public final class TreeMultiset<E extends @Nullable Object> extends AbstractSortedMultiset<E>
implements Serializable {
/**
* Creates a new, empty multiset, sorted according to the elements' natural order. All elements
* inserted into the multiset must implement the {@code Comparable} interface. Furthermore, all
Reported by PMD.
Line: 63
*/
@GwtCompatible(emulated = true)
@ElementTypesAreNonnullByDefault
public final class TreeMultiset<E extends @Nullable Object> extends AbstractSortedMultiset<E>
implements Serializable {
/**
* Creates a new, empty multiset, sorted according to the elements' natural order. All elements
* inserted into the multiset must implement the {@code Comparable} interface. Furthermore, all
Reported by PMD.
Line: 63
*/
@GwtCompatible(emulated = true)
@ElementTypesAreNonnullByDefault
public final class TreeMultiset<E extends @Nullable Object> extends AbstractSortedMultiset<E>
implements Serializable {
/**
* Creates a new, empty multiset, sorted according to the elements' natural order. All elements
* inserted into the multiset must implement the {@code Comparable} interface. Furthermore, all
Reported by PMD.
Line: 64
@GwtCompatible(emulated = true)
@ElementTypesAreNonnullByDefault
public final class TreeMultiset<E extends @Nullable Object> extends AbstractSortedMultiset<E>
implements Serializable {
/**
* Creates a new, empty multiset, sorted according to the elements' natural order. All elements
* inserted into the multiset must implement the {@code Comparable} interface. Furthermore, all
* such elements must be <i>mutually comparable</i>: {@code e1.compareTo(e2)} must not throw a
Reported by PMD.
Line: 93
* @param comparator the comparator that will be used to sort this multiset. A null value
* indicates that the elements' <i>natural ordering</i> should be used.
*/
@SuppressWarnings("unchecked")
public static <E extends @Nullable Object> TreeMultiset<E> create(
@CheckForNull Comparator<? super E> comparator) {
return (comparator == null)
? new TreeMultiset<E>((Comparator) Ordering.natural())
: new TreeMultiset<E>(comparator);
Reported by PMD.
Line: 183
}
// The cast is safe because we call this method only if hasLowerBound().
int cmp =
comparator()
.compare(uncheckedCastNullableTToT(range.getLowerEndpoint()), node.getElement());
if (cmp < 0) {
return aggregateBelowRange(aggr, node.left);
} else if (cmp == 0) {
switch (range.getLowerBoundType()) {
Reported by PMD.
Line: 209
}
// The cast is safe because we call this method only if hasUpperBound().
int cmp =
comparator()
.compare(uncheckedCastNullableTToT(range.getUpperEndpoint()), node.getElement());
if (cmp > 0) {
return aggregateAboveRange(aggr, node.right);
} else if (cmp == 0) {
switch (range.getUpperBoundType()) {
Reported by PMD.
Line: 252
if (!range.contains(e) || root == null) {
return 0;
}
return root.count(comparator(), e);
} catch (ClassCastException | NullPointerException e) {
return 0;
}
}
Reported by PMD.
Line: 253
return 0;
}
return root.count(comparator(), e);
} catch (ClassCastException | NullPointerException e) {
return 0;
}
}
@CanIgnoreReturnValue
Reported by PMD.
Line: 253
return 0;
}
return root.count(comparator(), e);
} catch (ClassCastException | NullPointerException e) {
return 0;
}
}
@CanIgnoreReturnValue
Reported by PMD.
guava/src/com/google/common/util/concurrent/ClosingFuture.java
96 issues
Line: 17
* limitations under the License.
*/
package com.google.common.util.concurrent;
import static com.google.common.base.Functions.constant;
import static com.google.common.base.MoreObjects.toStringHelper;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
Reported by PMD.
Line: 17
* limitations under the License.
*/
package com.google.common.util.concurrent;
import static com.google.common.base.Functions.constant;
import static com.google.common.base.MoreObjects.toStringHelper;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
Reported by PMD.
Line: 197
@DoNotMock("Use ClosingFuture.from(Futures.immediate*Future)")
@ElementTypesAreNonnullByDefault
// TODO(dpb): GWT compatibility.
public final class ClosingFuture<V extends @Nullable Object> {
private static final Logger logger = Logger.getLogger(ClosingFuture.class.getName());
/**
* An object that can capture objects to be closed later, when a {@link ClosingFuture} pipeline is
Reported by PMD.
Line: 197
@DoNotMock("Use ClosingFuture.from(Futures.immediate*Future)")
@ElementTypesAreNonnullByDefault
// TODO(dpb): GWT compatibility.
public final class ClosingFuture<V extends @Nullable Object> {
private static final Logger logger = Logger.getLogger(ClosingFuture.class.getName());
/**
* An object that can capture objects to be closed later, when a {@link ClosingFuture} pipeline is
Reported by PMD.
Line: 197
@DoNotMock("Use ClosingFuture.from(Futures.immediate*Future)")
@ElementTypesAreNonnullByDefault
// TODO(dpb): GWT compatibility.
public final class ClosingFuture<V extends @Nullable Object> {
private static final Logger logger = Logger.getLogger(ClosingFuture.class.getName());
/**
* An object that can capture objects to be closed later, when a {@link ClosingFuture} pipeline is
Reported by PMD.
Line: 206
* done.
*/
public static final class DeferredCloser {
@RetainedWith private final CloseableList list;
DeferredCloser(CloseableList list) {
this.list = list;
}
Reported by PMD.
Line: 262
* not before this method completes), even if this method throws or the pipeline is cancelled.
*/
@ParametricNullness
V call(DeferredCloser closer) throws Exception;
}
/**
* An operation that computes a {@link ClosingFuture} of a result.
*
Reported by PMD.
Line: 280
* closer.eventuallyClose()} will be closed when the {@link ClosingFuture} pipeline is done (but
* not before this method completes), even if this method throws or the pipeline is cancelled.
*/
ClosingFuture<V> call(DeferredCloser closer) throws Exception;
}
/**
* A function from an input to a result.
*
Reported by PMD.
Line: 300
* not before this method completes), even if this method throws or the pipeline is cancelled.
*/
@ParametricNullness
U apply(DeferredCloser closer, @ParametricNullness T input) throws Exception;
}
/**
* A function from an input to a {@link ClosingFuture} of a result.
*
Reported by PMD.
Line: 318
* closer.eventuallyClose()} will be closed when the {@link ClosingFuture} pipeline is done (but
* not before this method completes), even if this method throws or the pipeline is cancelled.
*/
ClosingFuture<U> apply(DeferredCloser closer, @ParametricNullness T input) throws Exception;
}
/**
* An object that holds the final result of an asynchronous {@link ClosingFuture} operation and
* allows the user to close all the closeable objects that were captured during it for later
Reported by PMD.
android/guava/src/com/google/common/util/concurrent/ClosingFuture.java
96 issues
Line: 17
* limitations under the License.
*/
package com.google.common.util.concurrent;
import static com.google.common.base.Functions.constant;
import static com.google.common.base.MoreObjects.toStringHelper;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
Reported by PMD.
Line: 17
* limitations under the License.
*/
package com.google.common.util.concurrent;
import static com.google.common.base.Functions.constant;
import static com.google.common.base.MoreObjects.toStringHelper;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
Reported by PMD.
Line: 198
@DoNotMock("Use ClosingFuture.from(Futures.immediate*Future)")
@ElementTypesAreNonnullByDefault
// TODO(dpb): GWT compatibility.
public final class ClosingFuture<V extends @Nullable Object> {
private static final Logger logger = Logger.getLogger(ClosingFuture.class.getName());
/**
* An object that can capture objects to be closed later, when a {@link ClosingFuture} pipeline is
Reported by PMD.
Line: 198
@DoNotMock("Use ClosingFuture.from(Futures.immediate*Future)")
@ElementTypesAreNonnullByDefault
// TODO(dpb): GWT compatibility.
public final class ClosingFuture<V extends @Nullable Object> {
private static final Logger logger = Logger.getLogger(ClosingFuture.class.getName());
/**
* An object that can capture objects to be closed later, when a {@link ClosingFuture} pipeline is
Reported by PMD.
Line: 198
@DoNotMock("Use ClosingFuture.from(Futures.immediate*Future)")
@ElementTypesAreNonnullByDefault
// TODO(dpb): GWT compatibility.
public final class ClosingFuture<V extends @Nullable Object> {
private static final Logger logger = Logger.getLogger(ClosingFuture.class.getName());
/**
* An object that can capture objects to be closed later, when a {@link ClosingFuture} pipeline is
Reported by PMD.
Line: 207
* done.
*/
public static final class DeferredCloser {
@RetainedWith private final CloseableList list;
DeferredCloser(CloseableList list) {
this.list = list;
}
Reported by PMD.
Line: 263
* not before this method completes), even if this method throws or the pipeline is cancelled.
*/
@ParametricNullness
V call(DeferredCloser closer) throws Exception;
}
/**
* An operation that computes a {@link ClosingFuture} of a result.
*
Reported by PMD.
Line: 280
* closer.eventuallyClose()} will be closed when the {@link ClosingFuture} pipeline is done (but
* not before this method completes), even if this method throws or the pipeline is cancelled.
*/
ClosingFuture<V> call(DeferredCloser closer) throws Exception;
}
/**
* A function from an input to a result.
*
Reported by PMD.
Line: 299
* not before this method completes), even if this method throws or the pipeline is cancelled.
*/
@ParametricNullness
U apply(DeferredCloser closer, @ParametricNullness T input) throws Exception;
}
/**
* A function from an input to a {@link ClosingFuture} of a result.
*
Reported by PMD.
Line: 316
* closer.eventuallyClose()} will be closed when the {@link ClosingFuture} pipeline is done (but
* not before this method completes), even if this method throws or the pipeline is cancelled.
*/
ClosingFuture<U> apply(DeferredCloser closer, @ParametricNullness T input) throws Exception;
}
/**
* An object that holds the final result of an asynchronous {@link ClosingFuture} operation and
* allows the user to close all the closeable objects that were captured during it for later
Reported by PMD.