The following issues were found
android/guava-testlib/src/com/google/common/collect/testing/testers/ListRemoveTester.java
9 issues
Line: 37
@GwtCompatible
@Ignore // Affects only Android test runner, which respects JUnit 4 annotations on JUnit 3 tests.
public class ListRemoveTester<E> extends AbstractListTester<E> {
@CollectionFeature.Require(SUPPORTS_REMOVE)
@CollectionSize.Require(absent = {ZERO, ONE})
public void testRemove_duplicate() {
ArrayWithDuplicate<E> arrayAndDuplicate = createArrayWithDuplicateElement();
collection = getSubjectGenerator().create(arrayAndDuplicate.elements);
E duplicate = arrayAndDuplicate.duplicate;
Reported by PMD.
Line: 39
public class ListRemoveTester<E> extends AbstractListTester<E> {
@CollectionFeature.Require(SUPPORTS_REMOVE)
@CollectionSize.Require(absent = {ZERO, ONE})
public void testRemove_duplicate() {
ArrayWithDuplicate<E> arrayAndDuplicate = createArrayWithDuplicateElement();
collection = getSubjectGenerator().create(arrayAndDuplicate.elements);
E duplicate = arrayAndDuplicate.duplicate;
int firstIndex = getList().indexOf(duplicate);
Reported by PMD.
Line: 41
@CollectionSize.Require(absent = {ZERO, ONE})
public void testRemove_duplicate() {
ArrayWithDuplicate<E> arrayAndDuplicate = createArrayWithDuplicateElement();
collection = getSubjectGenerator().create(arrayAndDuplicate.elements);
E duplicate = arrayAndDuplicate.duplicate;
int firstIndex = getList().indexOf(duplicate);
int initialSize = getList().size();
assertTrue("remove(present) should return true", getList().remove(duplicate));
Reported by PMD.
Line: 44
collection = getSubjectGenerator().create(arrayAndDuplicate.elements);
E duplicate = arrayAndDuplicate.duplicate;
int firstIndex = getList().indexOf(duplicate);
int initialSize = getList().size();
assertTrue("remove(present) should return true", getList().remove(duplicate));
assertTrue(
"After remove(duplicate), a list should still contain the duplicate element",
getList().contains(duplicate));
Reported by PMD.
Line: 45
E duplicate = arrayAndDuplicate.duplicate;
int firstIndex = getList().indexOf(duplicate);
int initialSize = getList().size();
assertTrue("remove(present) should return true", getList().remove(duplicate));
assertTrue(
"After remove(duplicate), a list should still contain the duplicate element",
getList().contains(duplicate));
assertFalse(
Reported by PMD.
Line: 46
int firstIndex = getList().indexOf(duplicate);
int initialSize = getList().size();
assertTrue("remove(present) should return true", getList().remove(duplicate));
assertTrue(
"After remove(duplicate), a list should still contain the duplicate element",
getList().contains(duplicate));
assertFalse(
"remove(duplicate) should remove the first instance of the "
Reported by PMD.
Line: 49
assertTrue("remove(present) should return true", getList().remove(duplicate));
assertTrue(
"After remove(duplicate), a list should still contain the duplicate element",
getList().contains(duplicate));
assertFalse(
"remove(duplicate) should remove the first instance of the "
+ "duplicate element in the list",
firstIndex == getList().indexOf(duplicate));
assertEquals(
Reported by PMD.
Line: 53
assertFalse(
"remove(duplicate) should remove the first instance of the "
+ "duplicate element in the list",
firstIndex == getList().indexOf(duplicate));
assertEquals(
"remove(present) should decrease the size of a list by one.",
initialSize - 1,
getList().size());
}
Reported by PMD.
Line: 57
assertEquals(
"remove(present) should decrease the size of a list by one.",
initialSize - 1,
getList().size());
}
}
Reported by PMD.
android/guava-testlib/src/com/google/common/collect/testing/testers/ListListIteratorTester.java
9 issues
Line: 51
@GwtCompatible(emulated = true)
@Ignore // Affects only Android test runner, which respects JUnit 4 annotations on JUnit 3 tests.
public class ListListIteratorTester<E> extends AbstractListTester<E> {
@CollectionFeature.Require(absent = SUPPORTS_REMOVE)
@ListFeature.Require(absent = {SUPPORTS_SET, SUPPORTS_ADD_WITH_INDEX})
public void testListIterator_unmodifiable() {
runListIteratorTest(UNMODIFIABLE);
}
Reported by PMD.
Line: 61
* For now, we don't cope with testing this when the list supports only some
* modification operations.
*/
@CollectionFeature.Require(SUPPORTS_REMOVE)
@ListFeature.Require({SUPPORTS_SET, SUPPORTS_ADD_WITH_INDEX})
public void testListIterator_fullyModifiable() {
runListIteratorTest(MODIFIABLE);
}
Reported by PMD.
Line: 77
@Override
protected ListIterator<E> newTargetIterator() {
resetCollection();
return getList().listIterator();
}
@Override
protected void verify(List<E> elements) {
expectContents(elements);
Reported by PMD.
Line: 87
}.test();
}
public void testListIterator_tooLow() {
try {
getList().listIterator(-1);
fail();
} catch (IndexOutOfBoundsException expected) {
}
Reported by PMD.
Line: 89
public void testListIterator_tooLow() {
try {
getList().listIterator(-1);
fail();
} catch (IndexOutOfBoundsException expected) {
}
}
Reported by PMD.
Line: 95
}
}
public void testListIterator_tooHigh() {
try {
getList().listIterator(getNumElements() + 1);
fail();
} catch (IndexOutOfBoundsException expected) {
}
Reported by PMD.
Line: 97
public void testListIterator_tooHigh() {
try {
getList().listIterator(getNumElements() + 1);
fail();
} catch (IndexOutOfBoundsException expected) {
}
}
Reported by PMD.
Line: 103
}
}
public void testListIterator_atSize() {
getList().listIterator(getNumElements());
// TODO: run the iterator through ListIteratorTester
}
/**
Reported by PMD.
Line: 104
}
public void testListIterator_atSize() {
getList().listIterator(getNumElements());
// TODO: run the iterator through ListIteratorTester
}
/**
* Returns the {@link Method} instance for {@link #testListIterator_fullyModifiable()} so that
Reported by PMD.
android/guava-testlib/src/com/google/common/collect/testing/testers/CollectionAddTester.java
9 issues
Line: 47
@GwtCompatible(emulated = true)
@Ignore // Affects only Android test runner, which respects JUnit 4 annotations on JUnit 3 tests.
public class CollectionAddTester<E> extends AbstractCollectionTester<E> {
@CollectionFeature.Require(SUPPORTS_ADD)
public void testAdd_supportedNotPresent() {
assertTrue("add(notPresent) should return true", collection.add(e3()));
expectAdded(e3());
}
Reported by PMD.
Line: 53
expectAdded(e3());
}
@CollectionFeature.Require(absent = SUPPORTS_ADD)
public void testAdd_unsupportedNotPresent() {
try {
collection.add(e3());
fail("add(notPresent) should throw");
} catch (UnsupportedOperationException expected) {
Reported by PMD.
Line: 64
expectMissing(e3());
}
@CollectionFeature.Require(absent = SUPPORTS_ADD)
@CollectionSize.Require(absent = ZERO)
public void testAdd_unsupportedPresent() {
try {
assertFalse("add(present) should return false or throw", collection.add(e0()));
} catch (UnsupportedOperationException tolerated) {
Reported by PMD.
Line: 69
public void testAdd_unsupportedPresent() {
try {
assertFalse("add(present) should return false or throw", collection.add(e0()));
} catch (UnsupportedOperationException tolerated) {
}
expectUnchanged();
}
@CollectionFeature.Require(
Reported by PMD.
Line: 74
expectUnchanged();
}
@CollectionFeature.Require(
value = {SUPPORTS_ADD, ALLOWS_NULL_VALUES},
absent = RESTRICTS_ELEMENTS)
public void testAdd_nullSupported() {
assertTrue("add(null) should return true", collection.add(null));
expectAdded((E) null);
Reported by PMD.
Line: 82
expectAdded((E) null);
}
@CollectionFeature.Require(value = SUPPORTS_ADD, absent = ALLOWS_NULL_VALUES)
public void testAdd_nullUnsupported() {
try {
collection.add(null);
fail("add(null) should throw");
} catch (NullPointerException expected) {
Reported by PMD.
Line: 87
try {
collection.add(null);
fail("add(null) should throw");
} catch (NullPointerException expected) {
}
expectUnchanged();
expectNullMissingWhenNullUnsupported("Should not contain null after unsupported add(null)");
}
Reported by PMD.
Line: 87
try {
collection.add(null);
fail("add(null) should throw");
} catch (NullPointerException expected) {
}
expectUnchanged();
expectNullMissingWhenNullUnsupported("Should not contain null after unsupported add(null)");
}
Reported by PMD.
Line: 93
expectNullMissingWhenNullUnsupported("Should not contain null after unsupported add(null)");
}
@CollectionFeature.Require({SUPPORTS_ADD, FAILS_FAST_ON_CONCURRENT_MODIFICATION})
@CollectionSize.Require(absent = ZERO)
public void testAddConcurrentWithIteration() {
try {
Iterator<E> iterator = collection.iterator();
assertTrue(collection.add(e3()));
Reported by PMD.
android/guava-tests/test/com/google/common/collect/ForwardingObjectTest.java
9 issues
Line: 30
*/
public class ForwardingObjectTest extends TestCase {
public void testEqualsReflexive() {
final Object delegate = new Object();
ForwardingObject forward =
new ForwardingObject() {
@Override
protected Object delegate() {
Reported by PMD.
Line: 30
*/
public class ForwardingObjectTest extends TestCase {
public void testEqualsReflexive() {
final Object delegate = new Object();
ForwardingObject forward =
new ForwardingObject() {
@Override
protected Object delegate() {
Reported by PMD.
Line: 42
new EqualsTester().addEqualityGroup(forward).testEquals();
}
public void testEqualsSymmetric() {
final Set<String> delegate = Sets.newHashSet("foo");
ForwardingObject forward =
new ForwardingObject() {
@Override
protected Object delegate() {
Reported by PMD.
Line: 51
return delegate;
}
};
assertEquals(forward.equals(delegate), delegate.equals(forward));
}
}
Reported by PMD.
Line: 51
return delegate;
}
};
assertEquals(forward.equals(delegate), delegate.equals(forward));
}
}
Reported by PMD.
Line: 32
public void testEqualsReflexive() {
final Object delegate = new Object();
ForwardingObject forward =
new ForwardingObject() {
@Override
protected Object delegate() {
return delegate;
}
Reported by PMD.
Line: 32
public void testEqualsReflexive() {
final Object delegate = new Object();
ForwardingObject forward =
new ForwardingObject() {
@Override
protected Object delegate() {
return delegate;
}
Reported by PMD.
Line: 44
public void testEqualsSymmetric() {
final Set<String> delegate = Sets.newHashSet("foo");
ForwardingObject forward =
new ForwardingObject() {
@Override
protected Object delegate() {
return delegate;
}
Reported by PMD.
Line: 44
public void testEqualsSymmetric() {
final Set<String> delegate = Sets.newHashSet("foo");
ForwardingObject forward =
new ForwardingObject() {
@Override
protected Object delegate() {
return delegate;
}
Reported by PMD.
android/guava-tests/test/com/google/common/collect/ImmutableCollectionTest.java
9 issues
Line: 27
* @author Louis Wasserman
*/
public class ImmutableCollectionTest extends TestCase {
public void testCapacityExpansion() {
assertEquals(1, ImmutableCollection.Builder.expandedCapacity(0, 1));
assertEquals(2, ImmutableCollection.Builder.expandedCapacity(0, 2));
assertEquals(2, ImmutableCollection.Builder.expandedCapacity(1, 2));
assertEquals(
Integer.MAX_VALUE, ImmutableCollection.Builder.expandedCapacity(0, Integer.MAX_VALUE));
Reported by PMD.
Line: 27
* @author Louis Wasserman
*/
public class ImmutableCollectionTest extends TestCase {
public void testCapacityExpansion() {
assertEquals(1, ImmutableCollection.Builder.expandedCapacity(0, 1));
assertEquals(2, ImmutableCollection.Builder.expandedCapacity(0, 2));
assertEquals(2, ImmutableCollection.Builder.expandedCapacity(1, 2));
assertEquals(
Integer.MAX_VALUE, ImmutableCollection.Builder.expandedCapacity(0, Integer.MAX_VALUE));
Reported by PMD.
Line: 28
*/
public class ImmutableCollectionTest extends TestCase {
public void testCapacityExpansion() {
assertEquals(1, ImmutableCollection.Builder.expandedCapacity(0, 1));
assertEquals(2, ImmutableCollection.Builder.expandedCapacity(0, 2));
assertEquals(2, ImmutableCollection.Builder.expandedCapacity(1, 2));
assertEquals(
Integer.MAX_VALUE, ImmutableCollection.Builder.expandedCapacity(0, Integer.MAX_VALUE));
assertEquals(
Reported by PMD.
Line: 29
public class ImmutableCollectionTest extends TestCase {
public void testCapacityExpansion() {
assertEquals(1, ImmutableCollection.Builder.expandedCapacity(0, 1));
assertEquals(2, ImmutableCollection.Builder.expandedCapacity(0, 2));
assertEquals(2, ImmutableCollection.Builder.expandedCapacity(1, 2));
assertEquals(
Integer.MAX_VALUE, ImmutableCollection.Builder.expandedCapacity(0, Integer.MAX_VALUE));
assertEquals(
Integer.MAX_VALUE, ImmutableCollection.Builder.expandedCapacity(1, Integer.MAX_VALUE));
Reported by PMD.
Line: 30
public void testCapacityExpansion() {
assertEquals(1, ImmutableCollection.Builder.expandedCapacity(0, 1));
assertEquals(2, ImmutableCollection.Builder.expandedCapacity(0, 2));
assertEquals(2, ImmutableCollection.Builder.expandedCapacity(1, 2));
assertEquals(
Integer.MAX_VALUE, ImmutableCollection.Builder.expandedCapacity(0, Integer.MAX_VALUE));
assertEquals(
Integer.MAX_VALUE, ImmutableCollection.Builder.expandedCapacity(1, Integer.MAX_VALUE));
assertEquals(
Reported by PMD.
Line: 31
assertEquals(1, ImmutableCollection.Builder.expandedCapacity(0, 1));
assertEquals(2, ImmutableCollection.Builder.expandedCapacity(0, 2));
assertEquals(2, ImmutableCollection.Builder.expandedCapacity(1, 2));
assertEquals(
Integer.MAX_VALUE, ImmutableCollection.Builder.expandedCapacity(0, Integer.MAX_VALUE));
assertEquals(
Integer.MAX_VALUE, ImmutableCollection.Builder.expandedCapacity(1, Integer.MAX_VALUE));
assertEquals(
Integer.MAX_VALUE,
Reported by PMD.
Line: 33
assertEquals(2, ImmutableCollection.Builder.expandedCapacity(1, 2));
assertEquals(
Integer.MAX_VALUE, ImmutableCollection.Builder.expandedCapacity(0, Integer.MAX_VALUE));
assertEquals(
Integer.MAX_VALUE, ImmutableCollection.Builder.expandedCapacity(1, Integer.MAX_VALUE));
assertEquals(
Integer.MAX_VALUE,
ImmutableCollection.Builder.expandedCapacity(Integer.MAX_VALUE - 1, Integer.MAX_VALUE));
Reported by PMD.
Line: 35
Integer.MAX_VALUE, ImmutableCollection.Builder.expandedCapacity(0, Integer.MAX_VALUE));
assertEquals(
Integer.MAX_VALUE, ImmutableCollection.Builder.expandedCapacity(1, Integer.MAX_VALUE));
assertEquals(
Integer.MAX_VALUE,
ImmutableCollection.Builder.expandedCapacity(Integer.MAX_VALUE - 1, Integer.MAX_VALUE));
assertEquals(13, ImmutableCollection.Builder.expandedCapacity(8, 9));
}
Reported by PMD.
Line: 39
Integer.MAX_VALUE,
ImmutableCollection.Builder.expandedCapacity(Integer.MAX_VALUE - 1, Integer.MAX_VALUE));
assertEquals(13, ImmutableCollection.Builder.expandedCapacity(8, 9));
}
}
Reported by PMD.
android/guava-tests/test/com/google/common/collect/MapMakerTest.java
9 issues
Line: 34
@GwtCompatible(emulated = true)
public class MapMakerTest extends TestCase {
@GwtIncompatible // NullPointerTester
public void testNullParameters() throws Exception {
NullPointerTester tester = new NullPointerTester();
tester.testAllPublicInstanceMethods(new MapMaker());
}
Reported by PMD.
Line: 35
public class MapMakerTest extends TestCase {
@GwtIncompatible // NullPointerTester
public void testNullParameters() throws Exception {
NullPointerTester tester = new NullPointerTester();
tester.testAllPublicInstanceMethods(new MapMaker());
}
@GwtIncompatible // threads
Reported by PMD.
Line: 42
@GwtIncompatible // threads
static final class DelayingIdentityLoader<T> implements Function<T, T> {
private final CountDownLatch delayLatch;
DelayingIdentityLoader(CountDownLatch delayLatch) {
this.delayLatch = delayLatch;
}
Reported by PMD.
Line: 62
/** Tests for the builder. */
public static class MakerTest extends TestCase {
public void testInitialCapacity_negative() {
MapMaker maker = new MapMaker();
try {
maker.initialCapacity(-1);
fail();
} catch (IllegalArgumentException expected) {
Reported by PMD.
Line: 66
MapMaker maker = new MapMaker();
try {
maker.initialCapacity(-1);
fail();
} catch (IllegalArgumentException expected) {
}
}
// TODO(cpovirk): enable when ready
Reported by PMD.
Line: 66
MapMaker maker = new MapMaker();
try {
maker.initialCapacity(-1);
fail();
} catch (IllegalArgumentException expected) {
}
}
// TODO(cpovirk): enable when ready
Reported by PMD.
Line: 77
try {
// even to the same value is not allowed
maker.initialCapacity(16);
fail();
} catch (IllegalArgumentException expected) {
}
}
public void testReturnsPlainConcurrentHashMapWhenPossible() {
Reported by PMD.
Line: 82
}
}
public void testReturnsPlainConcurrentHashMapWhenPossible() {
Map<?, ?> map = new MapMaker().initialCapacity(5).makeMap();
assertTrue(map instanceof ConcurrentHashMap);
}
}
}
Reported by PMD.
Line: 84
public void testReturnsPlainConcurrentHashMapWhenPossible() {
Map<?, ?> map = new MapMaker().initialCapacity(5).makeMap();
assertTrue(map instanceof ConcurrentHashMap);
}
}
}
Reported by PMD.
android/guava-testlib/src/com/google/common/collect/testing/google/ListGenerators.java
9 issues
Line: 133
}
}
private abstract static class TestUnhashableListGenerator
extends TestUnhashableCollectionGenerator<List<UnhashableObject>>
implements TestListGenerator<UnhashableObject> {}
public static class UnhashableElementsImmutableListGenerator extends TestUnhashableListGenerator {
@Override
Reported by PMD.
Line: 40
* @author Hayward Chan
*/
@GwtCompatible
public final class ListGenerators {
private ListGenerators() {}
public static class ImmutableListOfGenerator extends TestStringListGenerator {
@Override
Reported by PMD.
Line: 65
public static class BuilderAddAllListGenerator extends TestStringListGenerator {
@Override
protected List<String> create(String[] elements) {
return ImmutableList.<String>builder().addAll(asList(elements)).build();
}
}
public static class BuilderReversedListGenerator extends TestStringListGenerator {
@Override
Reported by PMD.
Line: 65
public static class BuilderAddAllListGenerator extends TestStringListGenerator {
@Override
protected List<String> create(String[] elements) {
return ImmutableList.<String>builder().addAll(asList(elements)).build();
}
}
public static class BuilderReversedListGenerator extends TestStringListGenerator {
@Override
Reported by PMD.
Line: 65
public static class BuilderAddAllListGenerator extends TestStringListGenerator {
@Override
protected List<String> create(String[] elements) {
return ImmutableList.<String>builder().addAll(asList(elements)).build();
}
}
public static class BuilderReversedListGenerator extends TestStringListGenerator {
@Override
Reported by PMD.
Line: 74
protected List<String> create(String[] elements) {
List<String> list = asList(elements);
Collections.reverse(list);
return ImmutableList.copyOf(list).reverse();
}
}
public static class ImmutableListHeadSubListGenerator extends TestStringListGenerator {
@Override
Reported by PMD.
Line: 85
String[] all = new String[elements.length + suffix.length];
System.arraycopy(elements, 0, all, 0, elements.length);
System.arraycopy(suffix, 0, all, elements.length, suffix.length);
return ImmutableList.copyOf(all).subList(0, elements.length);
}
}
public static class ImmutableListTailSubListGenerator extends TestStringListGenerator {
@Override
Reported by PMD.
Line: 96
String[] all = new String[elements.length + prefix.length];
System.arraycopy(prefix, 0, all, 0, 2);
System.arraycopy(elements, 0, all, 2, elements.length);
return ImmutableList.copyOf(all).subList(2, elements.length + 2);
}
}
public static class ImmutableListMiddleSubListGenerator extends TestStringListGenerator {
@Override
Reported by PMD.
Line: 111
System.arraycopy(elements, 0, all, 2, elements.length);
System.arraycopy(suffix, 0, all, 2 + elements.length, 2);
return ImmutableList.copyOf(all).subList(2, elements.length + 2);
}
}
public static class CharactersOfStringGenerator extends TestCharacterListGenerator {
@Override
Reported by PMD.
android/guava-testlib/src/com/google/common/collect/testing/google/BiMapInverseTester.java
9 issues
Line: 45
@Ignore // Affects only Android test runner, which respects JUnit 4 annotations on JUnit 3 tests.
public class BiMapInverseTester<K, V> extends AbstractBiMapTester<K, V> {
public void testInverseSame() {
assertSame(getMap(), getMap().inverse().inverse());
}
@CollectionFeature.Require(SERIALIZABLE)
public void testInverseSerialization() {
Reported by PMD.
Line: 46
public class BiMapInverseTester<K, V> extends AbstractBiMapTester<K, V> {
public void testInverseSame() {
assertSame(getMap(), getMap().inverse().inverse());
}
@CollectionFeature.Require(SERIALIZABLE)
public void testInverseSerialization() {
BiMapPair<K, V> pair = new BiMapPair<>(getMap());
Reported by PMD.
Line: 46
public class BiMapInverseTester<K, V> extends AbstractBiMapTester<K, V> {
public void testInverseSame() {
assertSame(getMap(), getMap().inverse().inverse());
}
@CollectionFeature.Require(SERIALIZABLE)
public void testInverseSerialization() {
BiMapPair<K, V> pair = new BiMapPair<>(getMap());
Reported by PMD.
Line: 49
assertSame(getMap(), getMap().inverse().inverse());
}
@CollectionFeature.Require(SERIALIZABLE)
public void testInverseSerialization() {
BiMapPair<K, V> pair = new BiMapPair<>(getMap());
BiMapPair<K, V> copy = SerializableTester.reserialize(pair);
assertEquals(pair.forward, copy.forward);
assertEquals(pair.backward, copy.backward);
Reported by PMD.
Line: 50
}
@CollectionFeature.Require(SERIALIZABLE)
public void testInverseSerialization() {
BiMapPair<K, V> pair = new BiMapPair<>(getMap());
BiMapPair<K, V> copy = SerializableTester.reserialize(pair);
assertEquals(pair.forward, copy.forward);
assertEquals(pair.backward, copy.backward);
assertSame(copy.backward, copy.forward.inverse());
Reported by PMD.
Line: 55
BiMapPair<K, V> copy = SerializableTester.reserialize(pair);
assertEquals(pair.forward, copy.forward);
assertEquals(pair.backward, copy.backward);
assertSame(copy.backward, copy.forward.inverse());
assertSame(copy.forward, copy.backward.inverse());
}
private static class BiMapPair<K, V> implements Serializable {
final BiMap<K, V> forward;
Reported by PMD.
Line: 56
assertEquals(pair.forward, copy.forward);
assertEquals(pair.backward, copy.backward);
assertSame(copy.backward, copy.forward.inverse());
assertSame(copy.forward, copy.backward.inverse());
}
private static class BiMapPair<K, V> implements Serializable {
final BiMap<K, V> forward;
final BiMap<V, K> backward;
Reported by PMD.
Line: 60
}
private static class BiMapPair<K, V> implements Serializable {
final BiMap<K, V> forward;
final BiMap<V, K> backward;
BiMapPair(BiMap<K, V> original) {
this.forward = original;
this.backward = original.inverse();
Reported by PMD.
Line: 61
private static class BiMapPair<K, V> implements Serializable {
final BiMap<K, V> forward;
final BiMap<V, K> backward;
BiMapPair(BiMap<K, V> original) {
this.forward = original;
this.backward = original.inverse();
}
Reported by PMD.
android/guava-tests/test/com/google/common/graph/StandardMutableDirectedNetworkTest.java
9 issues
Line: 44
});
}
private final boolean allowsSelfLoops;
private final boolean allowsParallelEdges;
private final ElementOrder<Integer> nodeOrder;
private final ElementOrder<String> edgeOrder;
public StandardMutableDirectedNetworkTest(
Reported by PMD.
Line: 45
}
private final boolean allowsSelfLoops;
private final boolean allowsParallelEdges;
private final ElementOrder<Integer> nodeOrder;
private final ElementOrder<String> edgeOrder;
public StandardMutableDirectedNetworkTest(
boolean allowsSelfLoops,
Reported by PMD.
Line: 46
private final boolean allowsSelfLoops;
private final boolean allowsParallelEdges;
private final ElementOrder<Integer> nodeOrder;
private final ElementOrder<String> edgeOrder;
public StandardMutableDirectedNetworkTest(
boolean allowsSelfLoops,
boolean allowsParallelEdges,
Reported by PMD.
Line: 47
private final boolean allowsSelfLoops;
private final boolean allowsParallelEdges;
private final ElementOrder<Integer> nodeOrder;
private final ElementOrder<String> edgeOrder;
public StandardMutableDirectedNetworkTest(
boolean allowsSelfLoops,
boolean allowsParallelEdges,
ElementOrder<Integer> nodeOrder,
Reported by PMD.
Line: 62
@Override
MutableNetwork<Integer, String> createGraph() {
return NetworkBuilder.directed()
.allowsSelfLoops(allowsSelfLoops)
.allowsParallelEdges(allowsParallelEdges)
.nodeOrder(nodeOrder)
.edgeOrder(edgeOrder)
.build();
Reported by PMD.
Line: 62
@Override
MutableNetwork<Integer, String> createGraph() {
return NetworkBuilder.directed()
.allowsSelfLoops(allowsSelfLoops)
.allowsParallelEdges(allowsParallelEdges)
.nodeOrder(nodeOrder)
.edgeOrder(edgeOrder)
.build();
Reported by PMD.
Line: 62
@Override
MutableNetwork<Integer, String> createGraph() {
return NetworkBuilder.directed()
.allowsSelfLoops(allowsSelfLoops)
.allowsParallelEdges(allowsParallelEdges)
.nodeOrder(nodeOrder)
.edgeOrder(edgeOrder)
.build();
Reported by PMD.
Line: 62
@Override
MutableNetwork<Integer, String> createGraph() {
return NetworkBuilder.directed()
.allowsSelfLoops(allowsSelfLoops)
.allowsParallelEdges(allowsParallelEdges)
.nodeOrder(nodeOrder)
.edgeOrder(edgeOrder)
.build();
Reported by PMD.
Line: 62
@Override
MutableNetwork<Integer, String> createGraph() {
return NetworkBuilder.directed()
.allowsSelfLoops(allowsSelfLoops)
.allowsParallelEdges(allowsParallelEdges)
.nodeOrder(nodeOrder)
.edgeOrder(edgeOrder)
.build();
Reported by PMD.
android/guava-tests/test/com/google/common/collect/UnmodifiableIteratorTest.java
9 issues
Line: 32
@GwtCompatible
public class UnmodifiableIteratorTest extends TestCase {
public void testRemove() {
final String[] array = {"a", "b", "c"};
Iterator<String> iterator =
new UnmodifiableIterator<String>() {
int i;
Reported by PMD.
Line: 32
@GwtCompatible
public class UnmodifiableIteratorTest extends TestCase {
public void testRemove() {
final String[] array = {"a", "b", "c"};
Iterator<String> iterator =
new UnmodifiableIterator<String>() {
int i;
Reported by PMD.
Line: 53
}
};
assertTrue(iterator.hasNext());
assertEquals("a", iterator.next());
try {
iterator.remove();
fail();
} catch (UnsupportedOperationException expected) {
Reported by PMD.
Line: 54
};
assertTrue(iterator.hasNext());
assertEquals("a", iterator.next());
try {
iterator.remove();
fail();
} catch (UnsupportedOperationException expected) {
}
Reported by PMD.
Line: 57
assertEquals("a", iterator.next());
try {
iterator.remove();
fail();
} catch (UnsupportedOperationException expected) {
}
}
}
Reported by PMD.
Line: 57
assertEquals("a", iterator.next());
try {
iterator.remove();
fail();
} catch (UnsupportedOperationException expected) {
}
}
}
Reported by PMD.
Line: 35
public void testRemove() {
final String[] array = {"a", "b", "c"};
Iterator<String> iterator =
new UnmodifiableIterator<String>() {
int i;
@Override
public boolean hasNext() {
Reported by PMD.
Line: 35
public void testRemove() {
final String[] array = {"a", "b", "c"};
Iterator<String> iterator =
new UnmodifiableIterator<String>() {
int i;
@Override
public boolean hasNext() {
Reported by PMD.
Line: 35
public void testRemove() {
final String[] array = {"a", "b", "c"};
Iterator<String> iterator =
new UnmodifiableIterator<String>() {
int i;
@Override
public boolean hasNext() {
Reported by PMD.