The following issues were found
guava-tests/test/com/google/common/graph/StandardImmutableUndirectedGraphTest.java
4 issues
Line: 36
return Arrays.asList(new Object[][] {{false}, {true}});
}
private final boolean allowsSelfLoops;
private ImmutableGraph.Builder<Integer> graphBuilder;
public StandardImmutableUndirectedGraphTest(boolean allowsSelfLoops) {
this.allowsSelfLoops = allowsSelfLoops;
}
Reported by PMD.
Line: 37
}
private final boolean allowsSelfLoops;
private ImmutableGraph.Builder<Integer> graphBuilder;
public StandardImmutableUndirectedGraphTest(boolean allowsSelfLoops) {
this.allowsSelfLoops = allowsSelfLoops;
}
Reported by PMD.
Line: 45
@Override
public Graph<Integer> createGraph() {
graphBuilder = GraphBuilder.undirected().allowsSelfLoops(allowsSelfLoops).immutable();
return graphBuilder.build();
}
@Override
final void addNode(Integer n) {
Reported by PMD.
Line: 45
@Override
public Graph<Integer> createGraph() {
graphBuilder = GraphBuilder.undirected().allowsSelfLoops(allowsSelfLoops).immutable();
return graphBuilder.build();
}
@Override
final void addNode(Integer n) {
Reported by PMD.
guava-testlib/src/com/google/common/collect/testing/google/MultisetSerializationTester.java
4 issues
Line: 37
@GwtCompatible // but no-op
@Ignore // Affects only Android test runner, which respects JUnit 4 annotations on JUnit 3 tests.
public class MultisetSerializationTester<E> extends AbstractMultisetTester<E> {
@CollectionFeature.Require(SERIALIZABLE_INCLUDING_VIEWS)
public void testEntrySetSerialization() {
Set<Multiset.Entry<E>> expected = getMultiset().entrySet();
assertEquals(expected, SerializableTester.reserialize(expected));
}
Reported by PMD.
Line: 39
public class MultisetSerializationTester<E> extends AbstractMultisetTester<E> {
@CollectionFeature.Require(SERIALIZABLE_INCLUDING_VIEWS)
public void testEntrySetSerialization() {
Set<Multiset.Entry<E>> expected = getMultiset().entrySet();
assertEquals(expected, SerializableTester.reserialize(expected));
}
@CollectionFeature.Require(SERIALIZABLE_INCLUDING_VIEWS)
public void testElementSetSerialization() {
Reported by PMD.
Line: 43
assertEquals(expected, SerializableTester.reserialize(expected));
}
@CollectionFeature.Require(SERIALIZABLE_INCLUDING_VIEWS)
public void testElementSetSerialization() {
Set<E> expected = getMultiset().elementSet();
assertEquals(expected, SerializableTester.reserialize(expected));
}
}
Reported by PMD.
Line: 45
@CollectionFeature.Require(SERIALIZABLE_INCLUDING_VIEWS)
public void testElementSetSerialization() {
Set<E> expected = getMultiset().elementSet();
assertEquals(expected, SerializableTester.reserialize(expected));
}
}
Reported by PMD.
guava-testlib/src/com/google/common/testing/SloppyTearDown.java
4 issues
Line: 43
try {
sloppyTearDown();
} catch (Throwable t) {
logger.log(Level.INFO, "exception thrown during tearDown: " + t.getMessage(), t);
}
}
public abstract void sloppyTearDown() throws Exception;
}
Reported by PMD.
Line: 38
public abstract class SloppyTearDown implements TearDown {
private static final Logger logger = Logger.getLogger(SloppyTearDown.class.getName());
@Override
public final void tearDown() {
try {
sloppyTearDown();
} catch (Throwable t) {
logger.log(Level.INFO, "exception thrown during tearDown: " + t.getMessage(), t);
Reported by PMD.
Line: 42
public final void tearDown() {
try {
sloppyTearDown();
} catch (Throwable t) {
logger.log(Level.INFO, "exception thrown during tearDown: " + t.getMessage(), t);
}
}
public abstract void sloppyTearDown() throws Exception;
Reported by PMD.
Line: 47
}
}
public abstract void sloppyTearDown() throws Exception;
}
Reported by PMD.
guava-testlib/src/com/google/common/collect/testing/google/SortedSetMultimapGetTester.java
4 issues
Line: 32
@Ignore // Affects only Android test runner, which respects JUnit 4 annotations on JUnit 3 tests.
public class SortedSetMultimapGetTester<K, V>
extends AbstractMultimapTester<K, V, SortedSetMultimap<K, V>> {
public void testValueComparator() {
assertEquals(multimap().valueComparator(), multimap().get(k0()).comparator());
}
}
Reported by PMD.
Line: 33
public class SortedSetMultimapGetTester<K, V>
extends AbstractMultimapTester<K, V, SortedSetMultimap<K, V>> {
public void testValueComparator() {
assertEquals(multimap().valueComparator(), multimap().get(k0()).comparator());
}
}
Reported by PMD.
Line: 33
public class SortedSetMultimapGetTester<K, V>
extends AbstractMultimapTester<K, V, SortedSetMultimap<K, V>> {
public void testValueComparator() {
assertEquals(multimap().valueComparator(), multimap().get(k0()).comparator());
}
}
Reported by PMD.
Line: 33
public class SortedSetMultimapGetTester<K, V>
extends AbstractMultimapTester<K, V, SortedSetMultimap<K, V>> {
public void testValueComparator() {
assertEquals(multimap().valueComparator(), multimap().get(k0()).comparator());
}
}
Reported by PMD.
guava-tests/test/com/google/common/collect/ForwardingTableTest.java
4 issues
Line: 31
*/
public class ForwardingTableTest extends TestCase {
@SuppressWarnings("rawtypes")
public void testForwarding() {
new ForwardingWrapperTester()
.testForwarding(
Table.class,
new Function<Table, Table>() {
Reported by PMD.
Line: 32
public class ForwardingTableTest extends TestCase {
@SuppressWarnings("rawtypes")
public void testForwarding() {
new ForwardingWrapperTester()
.testForwarding(
Table.class,
new Function<Table, Table>() {
@Override
Reported by PMD.
Line: 44
});
}
public void testEquals() {
Table<Integer, Integer, String> table1 = ImmutableTable.of(1, 1, "one");
Table<Integer, Integer, String> table2 = ImmutableTable.of(2, 2, "two");
new EqualsTester()
.addEqualityGroup(table1, wrap(table1), wrap(table1))
.addEqualityGroup(table2, wrap(table2))
Reported by PMD.
Line: 44
});
}
public void testEquals() {
Table<Integer, Integer, String> table1 = ImmutableTable.of(1, 1, "one");
Table<Integer, Integer, String> table2 = ImmutableTable.of(2, 2, "two");
new EqualsTester()
.addEqualityGroup(table1, wrap(table1), wrap(table1))
.addEqualityGroup(table2, wrap(table2))
Reported by PMD.
guava-testlib/src/com/google/common/collect/testing/google/TestEnumMultisetGenerator.java
4 issues
Line: 49
return create(array);
}
protected abstract Multiset<AnEnum> create(AnEnum[] elements);
@Override
public AnEnum[] createArray(int length) {
return new AnEnum[length];
}
Reported by PMD.
Line: 41
@Override
public Multiset<AnEnum> create(Object... elements) {
AnEnum[] array = new AnEnum[elements.length];
int i = 0;
for (Object e : elements) {
array[i++] = (AnEnum) e;
}
return create(array);
Reported by PMD.
Line: 42
@Override
public Multiset<AnEnum> create(Object... elements) {
AnEnum[] array = new AnEnum[elements.length];
int i = 0;
for (Object e : elements) {
array[i++] = (AnEnum) e;
}
return create(array);
}
Reported by PMD.
Line: 44
AnEnum[] array = new AnEnum[elements.length];
int i = 0;
for (Object e : elements) {
array[i++] = (AnEnum) e;
}
return create(array);
}
protected abstract Multiset<AnEnum> create(AnEnum[] elements);
Reported by PMD.
guava-testlib/src/com/google/common/collect/testing/google/TestStringBiMapGenerator.java
4 issues
Line: 60
return create(array);
}
protected abstract BiMap<String, String> create(Entry<String, String>[] entries);
@Override
@SuppressWarnings("unchecked")
public final Entry<String, String>[] createArray(int length) {
return new Entry[length];
Reported by PMD.
Line: 50
@Override
public final BiMap<String, String> create(Object... entries) {
@SuppressWarnings("unchecked")
Entry<String, String>[] array = new Entry[entries.length];
int i = 0;
for (Object o : entries) {
@SuppressWarnings("unchecked")
Entry<String, String> e = (Entry<String, String>) o;
array[i++] = e;
Reported by PMD.
Line: 51
public final BiMap<String, String> create(Object... entries) {
@SuppressWarnings("unchecked")
Entry<String, String>[] array = new Entry[entries.length];
int i = 0;
for (Object o : entries) {
@SuppressWarnings("unchecked")
Entry<String, String> e = (Entry<String, String>) o;
array[i++] = e;
}
Reported by PMD.
Line: 55
for (Object o : entries) {
@SuppressWarnings("unchecked")
Entry<String, String> e = (Entry<String, String>) o;
array[i++] = e;
}
return create(array);
}
protected abstract BiMap<String, String> create(Entry<String, String>[] entries);
Reported by PMD.
guava-tests/test/com/google/common/collect/ForwardingSortedSetMultimapTest.java
4 issues
Line: 31
*/
public class ForwardingSortedSetMultimapTest extends TestCase {
@SuppressWarnings("rawtypes")
public void testForwarding() {
new ForwardingWrapperTester()
.testForwarding(
SortedSetMultimap.class,
new Function<SortedSetMultimap, SortedSetMultimap>() {
Reported by PMD.
Line: 32
public class ForwardingSortedSetMultimapTest extends TestCase {
@SuppressWarnings("rawtypes")
public void testForwarding() {
new ForwardingWrapperTester()
.testForwarding(
SortedSetMultimap.class,
new Function<SortedSetMultimap, SortedSetMultimap>() {
@Override
Reported by PMD.
Line: 44
});
}
public void testEquals() {
SortedSetMultimap<Integer, String> map1 = TreeMultimap.create(ImmutableMultimap.of(1, "one"));
SortedSetMultimap<Integer, String> map2 = TreeMultimap.create(ImmutableMultimap.of(2, "two"));
new EqualsTester()
.addEqualityGroup(map1, wrap(map1), wrap(map1))
.addEqualityGroup(map2, wrap(map2))
Reported by PMD.
Line: 44
});
}
public void testEquals() {
SortedSetMultimap<Integer, String> map1 = TreeMultimap.create(ImmutableMultimap.of(1, "one"));
SortedSetMultimap<Integer, String> map2 = TreeMultimap.create(ImmutableMultimap.of(2, "two"));
new EqualsTester()
.addEqualityGroup(map1, wrap(map1), wrap(map1))
.addEqualityGroup(map2, wrap(map2))
Reported by PMD.
guava-testlib/test/com/google/common/collect/testing/OpenJdk6MapTests.java
4 issues
Line: 49
* under JDK7
*/
public class OpenJdk6MapTests extends TestsForMapsInJavaUtil {
public static Test suite() {
return new OpenJdk6MapTests().allTests();
}
@Override
protected Collection<Method> suppressForTreeMapNatural() {
Reported by PMD.
Line: 86
@Override
protected Collection<Method> suppressForConcurrentSkipListMap() {
List<Method> methods = newArrayList();
methods.addAll(super.suppressForConcurrentSkipListMap());
methods.add(getContainsEntryWithIncomparableKeyMethod());
methods.add(getContainsEntryWithIncomparableValueMethod());
return methods;
}
Reported by PMD.
Line: 87
protected Collection<Method> suppressForConcurrentSkipListMap() {
List<Method> methods = newArrayList();
methods.addAll(super.suppressForConcurrentSkipListMap());
methods.add(getContainsEntryWithIncomparableKeyMethod());
methods.add(getContainsEntryWithIncomparableValueMethod());
return methods;
}
@Override
Reported by PMD.
Line: 88
List<Method> methods = newArrayList();
methods.addAll(super.suppressForConcurrentSkipListMap());
methods.add(getContainsEntryWithIncomparableKeyMethod());
methods.add(getContainsEntryWithIncomparableValueMethod());
return methods;
}
@Override
protected Collection<Method> suppressForHashtable() {
Reported by PMD.
guava-testlib/src/com/google/common/collect/testing/google/TestStringListMultimapGenerator.java
4 issues
Line: 74
return create(array);
}
protected abstract ListMultimap<String, String> create(Entry<String, String>[] entries);
@Override
@SuppressWarnings("unchecked")
public final Entry<String, String>[] createArray(int length) {
return new Entry[length];
Reported by PMD.
Line: 64
@Override
public final ListMultimap<String, String> create(Object... entries) {
@SuppressWarnings("unchecked")
Entry<String, String>[] array = new Entry[entries.length];
int i = 0;
for (Object o : entries) {
@SuppressWarnings("unchecked")
Entry<String, String> e = (Entry<String, String>) o;
array[i++] = e;
Reported by PMD.
Line: 65
public final ListMultimap<String, String> create(Object... entries) {
@SuppressWarnings("unchecked")
Entry<String, String>[] array = new Entry[entries.length];
int i = 0;
for (Object o : entries) {
@SuppressWarnings("unchecked")
Entry<String, String> e = (Entry<String, String>) o;
array[i++] = e;
}
Reported by PMD.
Line: 69
for (Object o : entries) {
@SuppressWarnings("unchecked")
Entry<String, String> e = (Entry<String, String>) o;
array[i++] = e;
}
return create(array);
}
protected abstract ListMultimap<String, String> create(Entry<String, String>[] entries);
Reported by PMD.