The following issues were found
android/guava-tests/test/com/google/common/collect/InternersTest.java
61 issues
Line: 36
public void testStrong_simplistic() {
String canonical = "a";
String not = new String("a");
Interner<String> pool = Interners.newStrongInterner();
assertSame(canonical, pool.intern(canonical));
assertSame(canonical, pool.intern(not));
}
Reported by PMD.
Line: 62
public void testWeak_simplistic() {
String canonical = "a";
String not = new String("a");
Interner<String> pool = Interners.newWeakInterner();
assertSame(canonical, pool.intern(canonical));
assertSame(canonical, pool.intern(not));
}
Reported by PMD.
Line: 89
public void testWeak_afterGC() throws InterruptedException {
Integer canonical = new Integer(5);
Integer not = new Integer(5);
Interner<Integer> pool = Interners.newWeakInterner();
assertSame(canonical, pool.intern(canonical));
Reported by PMD.
Line: 90
public void testWeak_afterGC() throws InterruptedException {
Integer canonical = new Integer(5);
Integer not = new Integer(5);
Interner<Integer> pool = Interners.newWeakInterner();
assertSame(canonical, pool.intern(canonical));
WeakReference<Integer> signal = new WeakReference<>(canonical);
Reported by PMD.
Line: 104
public void testAsFunction_simplistic() {
String canonical = "a";
String not = new String("a");
Function<String, String> internerFunction =
Interners.asFunction(Interners.<String>newStrongInterner());
assertSame(canonical, internerFunction.apply(canonical));
Reported by PMD.
Line: 32
*
* @author Kevin Bourrillion
*/
public class InternersTest extends TestCase {
public void testStrong_simplistic() {
String canonical = "a";
String not = new String("a");
Reported by PMD.
Line: 34
*/
public class InternersTest extends TestCase {
public void testStrong_simplistic() {
String canonical = "a";
String not = new String("a");
Interner<String> pool = Interners.newStrongInterner();
assertSame(canonical, pool.intern(canonical));
Reported by PMD.
Line: 34
*/
public class InternersTest extends TestCase {
public void testStrong_simplistic() {
String canonical = "a";
String not = new String("a");
Interner<String> pool = Interners.newStrongInterner();
assertSame(canonical, pool.intern(canonical));
Reported by PMD.
Line: 39
String not = new String("a");
Interner<String> pool = Interners.newStrongInterner();
assertSame(canonical, pool.intern(canonical));
assertSame(canonical, pool.intern(not));
}
public void testStrong_null() {
Interner<String> pool = Interners.newStrongInterner();
Reported by PMD.
Line: 39
String not = new String("a");
Interner<String> pool = Interners.newStrongInterner();
assertSame(canonical, pool.intern(canonical));
assertSame(canonical, pool.intern(not));
}
public void testStrong_null() {
Interner<String> pool = Interners.newStrongInterner();
Reported by PMD.
guava/src/com/google/common/collect/Multimaps.java
61 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.checkNonnegative;
import static com.google.common.collect.CollectPreconditions.checkRemove;
import static com.google.common.collect.NullnessCasts.uncheckedCastNullableTToT;
Reported by PMD.
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.checkNonnegative;
import static com.google.common.collect.CollectPreconditions.checkRemove;
import static com.google.common.collect.NullnessCasts.uncheckedCastNullableTToT;
Reported by PMD.
Line: 77
*/
@GwtCompatible(emulated = true)
@ElementTypesAreNonnullByDefault
public final class Multimaps {
private Multimaps() {}
/**
* Returns a {@code Collector} accumulating entries into a {@code Multimap} generated from the
* specified supplier. The keys and values of the entries are the result of applying the provided
Reported by PMD.
Line: 77
*/
@GwtCompatible(emulated = true)
@ElementTypesAreNonnullByDefault
public final class Multimaps {
private Multimaps() {}
/**
* Returns a {@code Collector} accumulating entries into a {@code Multimap} generated from the
* specified supplier. The keys and values of the entries are the result of applying the provided
Reported by PMD.
Line: 77
*/
@GwtCompatible(emulated = true)
@ElementTypesAreNonnullByDefault
public final class Multimaps {
private Multimaps() {}
/**
* Returns a {@code Collector} accumulating entries into a {@code Multimap} generated from the
* specified supplier. The keys and values of the entries are the result of applying the provided
Reported by PMD.
Line: 282
}
@GwtIncompatible // java.io.ObjectInputStream
@SuppressWarnings("unchecked") // reading data stored by writeObject
private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException {
stream.defaultReadObject();
factory = (Supplier<? extends Collection<V>>) stream.readObject();
Map<K, Collection<V>> map = (Map<K, Collection<V>>) stream.readObject();
setMap(map);
Reported by PMD.
Line: 517
K extends @Nullable Object, V extends @Nullable Object>
extends AbstractSortedSetMultimap<K, V> {
transient Supplier<? extends SortedSet<V>> factory;
@CheckForNull transient Comparator<? super V> valueComparator;
CustomSortedSetMultimap(Map<K, Collection<V>> map, Supplier<? extends SortedSet<V>> factory) {
super(map);
this.factory = checkNotNull(factory);
valueComparator = factory.get().comparator();
Reported by PMD.
Line: 559
private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException {
stream.defaultReadObject();
factory = (Supplier<? extends SortedSet<V>>) stream.readObject();
valueComparator = factory.get().comparator();
Map<K, Collection<V>> map = (Map<K, Collection<V>>) stream.readObject();
setMap(map);
}
@GwtIncompatible // not needed in emulated source
Reported by PMD.
Line: 657
}
private static class UnmodifiableMultimap<K extends @Nullable Object, V extends @Nullable Object>
extends ForwardingMultimap<K, V> implements Serializable {
final Multimap<K, V> delegate;
@LazyInit @CheckForNull transient Collection<Entry<K, V>> entries;
@LazyInit @CheckForNull transient Multiset<K> keys;
@LazyInit @CheckForNull transient Set<K> keySet;
@LazyInit @CheckForNull transient Collection<V> values;
Reported by PMD.
Line: 658
private static class UnmodifiableMultimap<K extends @Nullable Object, V extends @Nullable Object>
extends ForwardingMultimap<K, V> implements Serializable {
final Multimap<K, V> delegate;
@LazyInit @CheckForNull transient Collection<Entry<K, V>> entries;
@LazyInit @CheckForNull transient Multiset<K> keys;
@LazyInit @CheckForNull transient Set<K> keySet;
@LazyInit @CheckForNull transient Collection<V> values;
@LazyInit @CheckForNull transient Map<K, Collection<V>> map;
Reported by PMD.
android/guava-testlib/src/com/google/common/collect/testing/google/SetGenerators.java
61 issues
Line: 310
}
}
public abstract static class TestUnhashableSetGenerator
extends TestUnhashableCollectionGenerator<Set<UnhashableObject>>
implements TestSetGenerator<UnhashableObject> {}
private static Ordering<String> createExplicitComparator(String[] elements) {
// Collapse equal elements, which Ordering.explicit() doesn't support, while
Reported by PMD.
Line: 17
* limitations under the License.
*/
package com.google.common.collect.testing.google;
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.collect.Lists.newArrayList;
import static com.google.common.collect.Sets.newTreeSet;
import static com.google.common.collect.testing.SampleElements.Strings.AFTER_LAST;
Reported by PMD.
Line: 86
@Override
protected Set<String> create(String[] elements) {
ImmutableSet.Builder<String> builder =
ImmutableSet.builderWithExpectedSize(Sets.newHashSet(elements).size());
for (String e : elements) {
builder.add(e);
}
return builder.build();
}
Reported by PMD.
Line: 98
@Override
protected Set<String> create(String[] elements) {
ImmutableSet.Builder<String> builder =
ImmutableSet.builderWithExpectedSize(Sets.newHashSet(elements).size() + 1);
for (String e : elements) {
builder.add(e);
}
return builder.build();
}
Reported by PMD.
Line: 110
@Override
protected Set<String> create(String[] elements) {
ImmutableSet.Builder<String> builder =
ImmutableSet.builderWithExpectedSize(Math.max(0, Sets.newHashSet(elements).size() - 1));
for (String e : elements) {
builder.add(e);
}
return builder.build();
}
Reported by PMD.
Line: 150
@Override
protected SortedSet<String> create(String[] elements) {
List<String> list = Lists.newArrayList(elements);
list.add("zzz");
return ImmutableSortedSet.copyOf(list).headSet("zzy");
}
}
public static class ImmutableSortedSetTailsetGenerator extends TestStringSortedSetGenerator {
Reported by PMD.
Line: 151
protected SortedSet<String> create(String[] elements) {
List<String> list = Lists.newArrayList(elements);
list.add("zzz");
return ImmutableSortedSet.copyOf(list).headSet("zzy");
}
}
public static class ImmutableSortedSetTailsetGenerator extends TestStringSortedSetGenerator {
@Override
Reported by PMD.
Line: 159
@Override
protected SortedSet<String> create(String[] elements) {
List<String> list = Lists.newArrayList(elements);
list.add("\0");
return ImmutableSortedSet.copyOf(list).tailSet("\0\0");
}
}
public static class ImmutableSortedSetSubsetGenerator extends TestStringSortedSetGenerator {
Reported by PMD.
Line: 160
protected SortedSet<String> create(String[] elements) {
List<String> list = Lists.newArrayList(elements);
list.add("\0");
return ImmutableSortedSet.copyOf(list).tailSet("\0\0");
}
}
public static class ImmutableSortedSetSubsetGenerator extends TestStringSortedSetGenerator {
@Override
Reported by PMD.
Line: 168
@Override
protected SortedSet<String> create(String[] elements) {
List<String> list = Lists.newArrayList(elements);
list.add("\0");
list.add("zzz");
return ImmutableSortedSet.copyOf(list).subSet("\0\0", "zzy");
}
}
Reported by PMD.
guava-testlib/src/com/google/common/collect/testing/google/SetGenerators.java
61 issues
Line: 310
}
}
public abstract static class TestUnhashableSetGenerator
extends TestUnhashableCollectionGenerator<Set<UnhashableObject>>
implements TestSetGenerator<UnhashableObject> {}
private static Ordering<String> createExplicitComparator(String[] elements) {
// Collapse equal elements, which Ordering.explicit() doesn't support, while
Reported by PMD.
Line: 17
* limitations under the License.
*/
package com.google.common.collect.testing.google;
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.collect.Lists.newArrayList;
import static com.google.common.collect.Sets.newTreeSet;
import static com.google.common.collect.testing.SampleElements.Strings.AFTER_LAST;
Reported by PMD.
Line: 86
@Override
protected Set<String> create(String[] elements) {
ImmutableSet.Builder<String> builder =
ImmutableSet.builderWithExpectedSize(Sets.newHashSet(elements).size());
for (String e : elements) {
builder.add(e);
}
return builder.build();
}
Reported by PMD.
Line: 98
@Override
protected Set<String> create(String[] elements) {
ImmutableSet.Builder<String> builder =
ImmutableSet.builderWithExpectedSize(Sets.newHashSet(elements).size() + 1);
for (String e : elements) {
builder.add(e);
}
return builder.build();
}
Reported by PMD.
Line: 110
@Override
protected Set<String> create(String[] elements) {
ImmutableSet.Builder<String> builder =
ImmutableSet.builderWithExpectedSize(Math.max(0, Sets.newHashSet(elements).size() - 1));
for (String e : elements) {
builder.add(e);
}
return builder.build();
}
Reported by PMD.
Line: 150
@Override
protected SortedSet<String> create(String[] elements) {
List<String> list = Lists.newArrayList(elements);
list.add("zzz");
return ImmutableSortedSet.copyOf(list).headSet("zzy");
}
}
public static class ImmutableSortedSetTailsetGenerator extends TestStringSortedSetGenerator {
Reported by PMD.
Line: 151
protected SortedSet<String> create(String[] elements) {
List<String> list = Lists.newArrayList(elements);
list.add("zzz");
return ImmutableSortedSet.copyOf(list).headSet("zzy");
}
}
public static class ImmutableSortedSetTailsetGenerator extends TestStringSortedSetGenerator {
@Override
Reported by PMD.
Line: 159
@Override
protected SortedSet<String> create(String[] elements) {
List<String> list = Lists.newArrayList(elements);
list.add("\0");
return ImmutableSortedSet.copyOf(list).tailSet("\0\0");
}
}
public static class ImmutableSortedSetSubsetGenerator extends TestStringSortedSetGenerator {
Reported by PMD.
Line: 160
protected SortedSet<String> create(String[] elements) {
List<String> list = Lists.newArrayList(elements);
list.add("\0");
return ImmutableSortedSet.copyOf(list).tailSet("\0\0");
}
}
public static class ImmutableSortedSetSubsetGenerator extends TestStringSortedSetGenerator {
@Override
Reported by PMD.
Line: 168
@Override
protected SortedSet<String> create(String[] elements) {
List<String> list = Lists.newArrayList(elements);
list.add("\0");
list.add("zzz");
return ImmutableSortedSet.copyOf(list).subSet("\0\0", "zzy");
}
}
Reported by PMD.
guava-tests/test/com/google/common/collect/InternersTest.java
61 issues
Line: 36
public void testStrong_simplistic() {
String canonical = "a";
String not = new String("a");
Interner<String> pool = Interners.newStrongInterner();
assertSame(canonical, pool.intern(canonical));
assertSame(canonical, pool.intern(not));
}
Reported by PMD.
Line: 62
public void testWeak_simplistic() {
String canonical = "a";
String not = new String("a");
Interner<String> pool = Interners.newWeakInterner();
assertSame(canonical, pool.intern(canonical));
assertSame(canonical, pool.intern(not));
}
Reported by PMD.
Line: 89
public void testWeak_afterGC() throws InterruptedException {
Integer canonical = new Integer(5);
Integer not = new Integer(5);
Interner<Integer> pool = Interners.newWeakInterner();
assertSame(canonical, pool.intern(canonical));
Reported by PMD.
Line: 90
public void testWeak_afterGC() throws InterruptedException {
Integer canonical = new Integer(5);
Integer not = new Integer(5);
Interner<Integer> pool = Interners.newWeakInterner();
assertSame(canonical, pool.intern(canonical));
WeakReference<Integer> signal = new WeakReference<>(canonical);
Reported by PMD.
Line: 104
public void testAsFunction_simplistic() {
String canonical = "a";
String not = new String("a");
Function<String, String> internerFunction =
Interners.asFunction(Interners.<String>newStrongInterner());
assertSame(canonical, internerFunction.apply(canonical));
Reported by PMD.
Line: 32
*
* @author Kevin Bourrillion
*/
public class InternersTest extends TestCase {
public void testStrong_simplistic() {
String canonical = "a";
String not = new String("a");
Reported by PMD.
Line: 34
*/
public class InternersTest extends TestCase {
public void testStrong_simplistic() {
String canonical = "a";
String not = new String("a");
Interner<String> pool = Interners.newStrongInterner();
assertSame(canonical, pool.intern(canonical));
Reported by PMD.
Line: 34
*/
public class InternersTest extends TestCase {
public void testStrong_simplistic() {
String canonical = "a";
String not = new String("a");
Interner<String> pool = Interners.newStrongInterner();
assertSame(canonical, pool.intern(canonical));
Reported by PMD.
Line: 39
String not = new String("a");
Interner<String> pool = Interners.newStrongInterner();
assertSame(canonical, pool.intern(canonical));
assertSame(canonical, pool.intern(not));
}
public void testStrong_null() {
Interner<String> pool = Interners.newStrongInterner();
Reported by PMD.
Line: 39
String not = new String("a");
Interner<String> pool = Interners.newStrongInterner();
assertSame(canonical, pool.intern(canonical));
assertSame(canonical, pool.intern(not));
}
public void testStrong_null() {
Interner<String> pool = Interners.newStrongInterner();
Reported by PMD.
guava-tests/test/com/google/common/collect/LinkedHashMultisetTest.java
60 issues
Line: 43
@GwtCompatible(emulated = true)
public class LinkedHashMultisetTest extends TestCase {
@GwtIncompatible // suite
public static Test suite() {
TestSuite suite = new TestSuite();
suite.addTest(
MultisetTestSuiteBuilder.using(linkedHashMultisetGenerator())
.named("LinkedHashMultiset")
Reported by PMD.
Line: 47
public static Test suite() {
TestSuite suite = new TestSuite();
suite.addTest(
MultisetTestSuiteBuilder.using(linkedHashMultisetGenerator())
.named("LinkedHashMultiset")
.withFeatures(
CollectionSize.ANY,
CollectionFeature.KNOWN_ORDER,
CollectionFeature.FAILS_FAST_ON_CONCURRENT_MODIFICATION,
Reported by PMD.
Line: 47
public static Test suite() {
TestSuite suite = new TestSuite();
suite.addTest(
MultisetTestSuiteBuilder.using(linkedHashMultisetGenerator())
.named("LinkedHashMultiset")
.withFeatures(
CollectionSize.ANY,
CollectionFeature.KNOWN_ORDER,
CollectionFeature.FAILS_FAST_ON_CONCURRENT_MODIFICATION,
Reported by PMD.
Line: 47
public static Test suite() {
TestSuite suite = new TestSuite();
suite.addTest(
MultisetTestSuiteBuilder.using(linkedHashMultisetGenerator())
.named("LinkedHashMultiset")
.withFeatures(
CollectionSize.ANY,
CollectionFeature.KNOWN_ORDER,
CollectionFeature.FAILS_FAST_ON_CONCURRENT_MODIFICATION,
Reported by PMD.
Line: 85
};
}
public void testCreate() {
Multiset<String> multiset = LinkedHashMultiset.create();
multiset.add("foo", 2);
multiset.add("bar");
assertEquals(3, multiset.size());
assertEquals(2, multiset.count("foo"));
Reported by PMD.
Line: 85
};
}
public void testCreate() {
Multiset<String> multiset = LinkedHashMultiset.create();
multiset.add("foo", 2);
multiset.add("bar");
assertEquals(3, multiset.size());
assertEquals(2, multiset.count("foo"));
Reported by PMD.
Line: 87
public void testCreate() {
Multiset<String> multiset = LinkedHashMultiset.create();
multiset.add("foo", 2);
multiset.add("bar");
assertEquals(3, multiset.size());
assertEquals(2, multiset.count("foo"));
assertEquals("[foo x 2, bar]", multiset.toString());
}
Reported by PMD.
Line: 87
public void testCreate() {
Multiset<String> multiset = LinkedHashMultiset.create();
multiset.add("foo", 2);
multiset.add("bar");
assertEquals(3, multiset.size());
assertEquals(2, multiset.count("foo"));
assertEquals("[foo x 2, bar]", multiset.toString());
}
Reported by PMD.
Line: 88
public void testCreate() {
Multiset<String> multiset = LinkedHashMultiset.create();
multiset.add("foo", 2);
multiset.add("bar");
assertEquals(3, multiset.size());
assertEquals(2, multiset.count("foo"));
assertEquals("[foo x 2, bar]", multiset.toString());
}
Reported by PMD.
Line: 89
Multiset<String> multiset = LinkedHashMultiset.create();
multiset.add("foo", 2);
multiset.add("bar");
assertEquals(3, multiset.size());
assertEquals(2, multiset.count("foo"));
assertEquals("[foo x 2, bar]", multiset.toString());
}
public void testCreateWithSize() {
Reported by PMD.
android/guava-tests/test/com/google/common/collect/LinkedHashMultisetTest.java
60 issues
Line: 43
@GwtCompatible(emulated = true)
public class LinkedHashMultisetTest extends TestCase {
@GwtIncompatible // suite
public static Test suite() {
TestSuite suite = new TestSuite();
suite.addTest(
MultisetTestSuiteBuilder.using(linkedHashMultisetGenerator())
.named("LinkedHashMultiset")
Reported by PMD.
Line: 47
public static Test suite() {
TestSuite suite = new TestSuite();
suite.addTest(
MultisetTestSuiteBuilder.using(linkedHashMultisetGenerator())
.named("LinkedHashMultiset")
.withFeatures(
CollectionSize.ANY,
CollectionFeature.KNOWN_ORDER,
CollectionFeature.FAILS_FAST_ON_CONCURRENT_MODIFICATION,
Reported by PMD.
Line: 47
public static Test suite() {
TestSuite suite = new TestSuite();
suite.addTest(
MultisetTestSuiteBuilder.using(linkedHashMultisetGenerator())
.named("LinkedHashMultiset")
.withFeatures(
CollectionSize.ANY,
CollectionFeature.KNOWN_ORDER,
CollectionFeature.FAILS_FAST_ON_CONCURRENT_MODIFICATION,
Reported by PMD.
Line: 47
public static Test suite() {
TestSuite suite = new TestSuite();
suite.addTest(
MultisetTestSuiteBuilder.using(linkedHashMultisetGenerator())
.named("LinkedHashMultiset")
.withFeatures(
CollectionSize.ANY,
CollectionFeature.KNOWN_ORDER,
CollectionFeature.FAILS_FAST_ON_CONCURRENT_MODIFICATION,
Reported by PMD.
Line: 85
};
}
public void testCreate() {
Multiset<String> multiset = LinkedHashMultiset.create();
multiset.add("foo", 2);
multiset.add("bar");
assertEquals(3, multiset.size());
assertEquals(2, multiset.count("foo"));
Reported by PMD.
Line: 85
};
}
public void testCreate() {
Multiset<String> multiset = LinkedHashMultiset.create();
multiset.add("foo", 2);
multiset.add("bar");
assertEquals(3, multiset.size());
assertEquals(2, multiset.count("foo"));
Reported by PMD.
Line: 87
public void testCreate() {
Multiset<String> multiset = LinkedHashMultiset.create();
multiset.add("foo", 2);
multiset.add("bar");
assertEquals(3, multiset.size());
assertEquals(2, multiset.count("foo"));
assertEquals("[foo x 2, bar]", multiset.toString());
}
Reported by PMD.
Line: 87
public void testCreate() {
Multiset<String> multiset = LinkedHashMultiset.create();
multiset.add("foo", 2);
multiset.add("bar");
assertEquals(3, multiset.size());
assertEquals(2, multiset.count("foo"));
assertEquals("[foo x 2, bar]", multiset.toString());
}
Reported by PMD.
Line: 88
public void testCreate() {
Multiset<String> multiset = LinkedHashMultiset.create();
multiset.add("foo", 2);
multiset.add("bar");
assertEquals(3, multiset.size());
assertEquals(2, multiset.count("foo"));
assertEquals("[foo x 2, bar]", multiset.toString());
}
Reported by PMD.
Line: 89
Multiset<String> multiset = LinkedHashMultiset.create();
multiset.add("foo", 2);
multiset.add("bar");
assertEquals(3, multiset.size());
assertEquals(2, multiset.count("foo"));
assertEquals("[foo x 2, bar]", multiset.toString());
}
public void testCreateWithSize() {
Reported by PMD.
guava-testlib/src/com/google/common/testing/NullPointerTester.java
60 issues
Line: 370
error.initCause(cause);
throw error;
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
}
}
private Object[] buildParamList(Invokable<?, ?> invokable, int indexOfParamToSetToNull) {
ImmutableList<Parameter> params = invokable.getParameters();
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 com.google.common.annotations.Beta;
Reported by PMD.
Line: 73
*/
@Beta
@GwtIncompatible
public final class NullPointerTester {
private final ClassToInstanceMap<Object> defaults = MutableClassToInstanceMap.create();
private final List<Member> ignoredMembers = Lists.newArrayList();
private ExceptionTypePolicy policy = ExceptionTypePolicy.NPE_OR_UOE;
Reported by PMD.
Line: 73
*/
@Beta
@GwtIncompatible
public final class NullPointerTester {
private final ClassToInstanceMap<Object> defaults = MutableClassToInstanceMap.create();
private final List<Member> ignoredMembers = Lists.newArrayList();
private ExceptionTypePolicy policy = ExceptionTypePolicy.NPE_OR_UOE;
Reported by PMD.
Line: 75
@GwtIncompatible
public final class NullPointerTester {
private final ClassToInstanceMap<Object> defaults = MutableClassToInstanceMap.create();
private final List<Member> ignoredMembers = Lists.newArrayList();
private ExceptionTypePolicy policy = ExceptionTypePolicy.NPE_OR_UOE;
/**
Reported by PMD.
Line: 76
public final class NullPointerTester {
private final ClassToInstanceMap<Object> defaults = MutableClassToInstanceMap.create();
private final List<Member> ignoredMembers = Lists.newArrayList();
private ExceptionTypePolicy policy = ExceptionTypePolicy.NPE_OR_UOE;
/**
* Sets a default value that can be used for any parameter of type {@code type}. Returns this
Reported by PMD.
Line: 78
private final ClassToInstanceMap<Object> defaults = MutableClassToInstanceMap.create();
private final List<Member> ignoredMembers = Lists.newArrayList();
private ExceptionTypePolicy policy = ExceptionTypePolicy.NPE_OR_UOE;
/**
* Sets a default value that can be used for any parameter of type {@code type}. Returns this
* object.
*/
Reported by PMD.
Line: 78
private final ClassToInstanceMap<Object> defaults = MutableClassToInstanceMap.create();
private final List<Member> ignoredMembers = Lists.newArrayList();
private ExceptionTypePolicy policy = ExceptionTypePolicy.NPE_OR_UOE;
/**
* Sets a default value that can be used for any parameter of type {@code type}. Returns this
* object.
*/
Reported by PMD.
Line: 113
* Runs {@link #testConstructor} on every constructor in class {@code c} that has at least {@code
* minimalVisibility}.
*/
public void testConstructors(Class<?> c, Visibility minimalVisibility) {
for (Constructor<?> constructor : c.getDeclaredConstructors()) {
if (minimalVisibility.isVisible(constructor) && !isIgnored(constructor)) {
testConstructor(constructor);
}
}
Reported by PMD.
Line: 122
}
/** Runs {@link #testConstructor} on every public constructor in class {@code c}. */
public void testAllPublicConstructors(Class<?> c) {
testConstructors(c, Visibility.PUBLIC);
}
/**
* Runs {@link #testMethod} on every static method of class {@code c} that has at least {@code
Reported by PMD.
guava-tests/test/com/google/common/collect/AbstractMapEntryTest.java
60 issues
Line: 70
assertFalse(control("foo", 1).equals(entry("foo", 2)));
assertFalse(foo1.equals(control("bar", 1)));
assertFalse(foo1.equals(new Object()));
assertFalse(foo1.equals(null));
}
public void testEqualsNull() {
assertEquals(control(NK, 1), entry(NK, 1));
assertEquals(control("bar", NV), entry("bar", NV));
Reported by PMD.
Line: 79
assertFalse(control(NK, 1).equals(entry(NK, 2)));
assertFalse(entry(NK, 1).equals(control("bar", 1)));
assertFalse(entry(NK, 1).equals(new Object()));
assertFalse(entry(NK, 1).equals(null));
}
public void testHashCode() {
assertEquals(control("foo", 1).hashCode(), entry("foo", 1).hashCode());
assertEquals(control("bar", 2).hashCode(), entry("bar", 2).hashCode());
Reported by PMD.
Line: 49
}
private static <K, V> Entry<K, V> control(K key, V value) {
return Collections.singletonMap(key, value).entrySet().iterator().next();
}
public void testToString() {
assertEquals("foo=1", entry("foo", 1).toString());
}
Reported by PMD.
Line: 49
}
private static <K, V> Entry<K, V> control(K key, V value) {
return Collections.singletonMap(key, value).entrySet().iterator().next();
}
public void testToString() {
assertEquals("foo=1", entry("foo", 1).toString());
}
Reported by PMD.
Line: 49
}
private static <K, V> Entry<K, V> control(K key, V value) {
return Collections.singletonMap(key, value).entrySet().iterator().next();
}
public void testToString() {
assertEquals("foo=1", entry("foo", 1).toString());
}
Reported by PMD.
Line: 52
return Collections.singletonMap(key, value).entrySet().iterator().next();
}
public void testToString() {
assertEquals("foo=1", entry("foo", 1).toString());
}
public void testToStringNull() {
assertEquals("null=1", entry(NK, 1).toString());
Reported by PMD.
Line: 53
}
public void testToString() {
assertEquals("foo=1", entry("foo", 1).toString());
}
public void testToStringNull() {
assertEquals("null=1", entry(NK, 1).toString());
assertEquals("foo=null", entry("foo", NV).toString());
Reported by PMD.
Line: 53
}
public void testToString() {
assertEquals("foo=1", entry("foo", 1).toString());
}
public void testToStringNull() {
assertEquals("null=1", entry(NK, 1).toString());
assertEquals("foo=null", entry("foo", NV).toString());
Reported by PMD.
Line: 53
}
public void testToString() {
assertEquals("foo=1", entry("foo", 1).toString());
}
public void testToStringNull() {
assertEquals("null=1", entry(NK, 1).toString());
assertEquals("foo=null", entry("foo", NV).toString());
Reported by PMD.
Line: 56
assertEquals("foo=1", entry("foo", 1).toString());
}
public void testToStringNull() {
assertEquals("null=1", entry(NK, 1).toString());
assertEquals("foo=null", entry("foo", NV).toString());
assertEquals("null=null", entry(NK, NV).toString());
}
Reported by PMD.
android/guava-tests/test/com/google/common/collect/AbstractMapEntryTest.java
60 issues
Line: 70
assertFalse(control("foo", 1).equals(entry("foo", 2)));
assertFalse(foo1.equals(control("bar", 1)));
assertFalse(foo1.equals(new Object()));
assertFalse(foo1.equals(null));
}
public void testEqualsNull() {
assertEquals(control(NK, 1), entry(NK, 1));
assertEquals(control("bar", NV), entry("bar", NV));
Reported by PMD.
Line: 79
assertFalse(control(NK, 1).equals(entry(NK, 2)));
assertFalse(entry(NK, 1).equals(control("bar", 1)));
assertFalse(entry(NK, 1).equals(new Object()));
assertFalse(entry(NK, 1).equals(null));
}
public void testHashCode() {
assertEquals(control("foo", 1).hashCode(), entry("foo", 1).hashCode());
assertEquals(control("bar", 2).hashCode(), entry("bar", 2).hashCode());
Reported by PMD.
Line: 49
}
private static <K, V> Entry<K, V> control(K key, V value) {
return Collections.singletonMap(key, value).entrySet().iterator().next();
}
public void testToString() {
assertEquals("foo=1", entry("foo", 1).toString());
}
Reported by PMD.
Line: 49
}
private static <K, V> Entry<K, V> control(K key, V value) {
return Collections.singletonMap(key, value).entrySet().iterator().next();
}
public void testToString() {
assertEquals("foo=1", entry("foo", 1).toString());
}
Reported by PMD.
Line: 49
}
private static <K, V> Entry<K, V> control(K key, V value) {
return Collections.singletonMap(key, value).entrySet().iterator().next();
}
public void testToString() {
assertEquals("foo=1", entry("foo", 1).toString());
}
Reported by PMD.
Line: 52
return Collections.singletonMap(key, value).entrySet().iterator().next();
}
public void testToString() {
assertEquals("foo=1", entry("foo", 1).toString());
}
public void testToStringNull() {
assertEquals("null=1", entry(NK, 1).toString());
Reported by PMD.
Line: 53
}
public void testToString() {
assertEquals("foo=1", entry("foo", 1).toString());
}
public void testToStringNull() {
assertEquals("null=1", entry(NK, 1).toString());
assertEquals("foo=null", entry("foo", NV).toString());
Reported by PMD.
Line: 53
}
public void testToString() {
assertEquals("foo=1", entry("foo", 1).toString());
}
public void testToStringNull() {
assertEquals("null=1", entry(NK, 1).toString());
assertEquals("foo=null", entry("foo", NV).toString());
Reported by PMD.
Line: 53
}
public void testToString() {
assertEquals("foo=1", entry("foo", 1).toString());
}
public void testToStringNull() {
assertEquals("null=1", entry(NK, 1).toString());
assertEquals("foo=null", entry("foo", NV).toString());
Reported by PMD.
Line: 56
assertEquals("foo=1", entry("foo", 1).toString());
}
public void testToStringNull() {
assertEquals("null=1", entry(NK, 1).toString());
assertEquals("foo=null", entry("foo", NV).toString());
assertEquals("null=null", entry(NK, NV).toString());
}
Reported by PMD.