The following issues were found
android/guava-testlib/src/com/google/common/collect/testing/google/MultimapSizeTester.java
34 issues
Line: 42
@Ignore // Affects only Android test runner, which respects JUnit 4 annotations on JUnit 3 tests.
public class MultimapSizeTester<K, V> extends AbstractMultimapTester<K, V, Multimap<K, V>> {
public void testSize() {
int expectedSize = getNumElements();
Multimap<K, V> multimap = multimap();
assertEquals(expectedSize, multimap.size());
int size = 0;
Reported by PMD.
Line: 42
@Ignore // Affects only Android test runner, which respects JUnit 4 annotations on JUnit 3 tests.
public class MultimapSizeTester<K, V> extends AbstractMultimapTester<K, V, Multimap<K, V>> {
public void testSize() {
int expectedSize = getNumElements();
Multimap<K, V> multimap = multimap();
assertEquals(expectedSize, multimap.size());
int size = 0;
Reported by PMD.
Line: 45
public void testSize() {
int expectedSize = getNumElements();
Multimap<K, V> multimap = multimap();
assertEquals(expectedSize, multimap.size());
int size = 0;
for (Entry<K, V> entry : multimap.entries()) {
assertTrue(multimap.containsEntry(entry.getKey(), entry.getValue()));
size++;
Reported by PMD.
Line: 55
assertEquals(expectedSize, size);
int size2 = 0;
for (Entry<K, Collection<V>> entry2 : multimap.asMap().entrySet()) {
size2 += entry2.getValue().size();
}
assertEquals(expectedSize, size2);
}
Reported by PMD.
Line: 56
int size2 = 0;
for (Entry<K, Collection<V>> entry2 : multimap.asMap().entrySet()) {
size2 += entry2.getValue().size();
}
assertEquals(expectedSize, size2);
}
@CollectionSize.Require(ZERO)
Reported by PMD.
Line: 61
assertEquals(expectedSize, size2);
}
@CollectionSize.Require(ZERO)
public void testIsEmptyYes() {
assertTrue(multimap().isEmpty());
}
@CollectionSize.Require(absent = ZERO)
Reported by PMD.
Line: 63
@CollectionSize.Require(ZERO)
public void testIsEmptyYes() {
assertTrue(multimap().isEmpty());
}
@CollectionSize.Require(absent = ZERO)
public void testIsEmptyNo() {
assertFalse(multimap().isEmpty());
Reported by PMD.
Line: 66
assertTrue(multimap().isEmpty());
}
@CollectionSize.Require(absent = ZERO)
public void testIsEmptyNo() {
assertFalse(multimap().isEmpty());
}
@CollectionSize.Require(absent = ZERO)
Reported by PMD.
Line: 68
@CollectionSize.Require(absent = ZERO)
public void testIsEmptyNo() {
assertFalse(multimap().isEmpty());
}
@CollectionSize.Require(absent = ZERO)
@MapFeature.Require(ALLOWS_NULL_KEYS)
public void testSizeNullKey() {
Reported by PMD.
Line: 71
assertFalse(multimap().isEmpty());
}
@CollectionSize.Require(absent = ZERO)
@MapFeature.Require(ALLOWS_NULL_KEYS)
public void testSizeNullKey() {
initMultimapWithNullKey();
assertEquals(getNumElements(), multimap().size());
assertFalse(multimap().isEmpty());
Reported by PMD.
android/guava/src/com/google/common/collect/ImmutableMultiset.java
34 issues
Line: 285
@GwtIncompatible // not present in emulated superclass
@Override
int copyIntoArray(Object[] dst, int offset) {
for (Multiset.Entry<E> entry : entrySet()) {
Arrays.fill(dst, offset, offset + entry.getCount(), entry.getElement());
offset += entry.getCount();
}
return offset;
Reported by PMD.
Line: 54
@SuppressWarnings("serial") // we're overriding default serialization
@ElementTypesAreNonnullByDefault
public abstract class ImmutableMultiset<E> extends ImmutableMultisetGwtSerializationDependencies<E>
implements Multiset<E> {
/**
* Returns the empty immutable multiset.
*
* <p><b>Performance note:</b> the instance returned is a singleton.
*/
Reported by PMD.
Line: 150
if (elements instanceof ImmutableMultiset) {
@SuppressWarnings("unchecked") // all supported methods are covariant
ImmutableMultiset<E> result = (ImmutableMultiset<E>) elements;
if (!result.isPartialView()) {
return result;
}
}
ImmutableMultiset.Builder<E> builder =
new ImmutableMultiset.Builder<E>(Multisets.inferDistinctElements(elements));
Reported by PMD.
Line: 187
@Override
public UnmodifiableIterator<E> iterator() {
final Iterator<Entry<E>> entryIterator = entrySet().iterator();
return new UnmodifiableIterator<E>() {
int remaining;
@CheckForNull E element;
@Override
Reported by PMD.
Line: 201
public E next() {
if (remaining <= 0) {
Entry<E> entry = entryIterator.next();
element = entry.getElement();
remaining = entry.getCount();
}
remaining--;
/*
* requireNonNull is safe because `remaining` starts at 0, forcing us to initialize
Reported by PMD.
Line: 202
if (remaining <= 0) {
Entry<E> entry = entryIterator.next();
element = entry.getElement();
remaining = entry.getCount();
}
remaining--;
/*
* requireNonNull is safe because `remaining` starts at 0, forcing us to initialize
* `element` above. After that, we never clear it.
Reported by PMD.
Line: 214
};
}
@LazyInit @CheckForNull private transient ImmutableList<E> asList;
@Override
public ImmutableList<E> asList() {
ImmutableList<E> result = asList;
return (result == null) ? asList = super.asList() : result;
Reported by PMD.
Line: 236
@CanIgnoreReturnValue
@Deprecated
@Override
@DoNotCall("Always throws UnsupportedOperationException")
public final int add(E element, int occurrences) {
throw new UnsupportedOperationException();
}
/**
Reported by PMD.
Line: 305
@Override
public String toString() {
return entrySet().toString();
}
/** @since 21.0 (present with return type {@code Set} since 2.0) */
@Override
public abstract ImmutableSet<E> elementSet();
Reported by PMD.
Line: 312
@Override
public abstract ImmutableSet<E> elementSet();
@LazyInit @CheckForNull private transient ImmutableSet<Entry<E>> entrySet;
@Override
public ImmutableSet<Entry<E>> entrySet() {
ImmutableSet<Entry<E>> es = entrySet;
return (es == null) ? (entrySet = createEntrySet()) : es;
Reported by PMD.
android/guava-tests/test/com/google/common/util/concurrent/FluentFutureTest.java
34 issues
Line: 42
*/
@GwtCompatible(emulated = true)
public class FluentFutureTest extends TestCase {
public void testFromFluentFuture() {
FluentFuture<String> f = FluentFuture.from(SettableFuture.<String>create());
assertThat(FluentFuture.from(f)).isSameInstanceAs(f);
}
public void testFromFluentFuturePassingAsNonFluent() {
Reported by PMD.
Line: 44
public class FluentFutureTest extends TestCase {
public void testFromFluentFuture() {
FluentFuture<String> f = FluentFuture.from(SettableFuture.<String>create());
assertThat(FluentFuture.from(f)).isSameInstanceAs(f);
}
public void testFromFluentFuturePassingAsNonFluent() {
ListenableFuture<String> f = FluentFuture.from(SettableFuture.<String>create());
assertThat(FluentFuture.from(f)).isSameInstanceAs(f);
Reported by PMD.
Line: 47
assertThat(FluentFuture.from(f)).isSameInstanceAs(f);
}
public void testFromFluentFuturePassingAsNonFluent() {
ListenableFuture<String> f = FluentFuture.from(SettableFuture.<String>create());
assertThat(FluentFuture.from(f)).isSameInstanceAs(f);
}
public void testFromNonFluentFuture() throws Exception {
Reported by PMD.
Line: 49
public void testFromFluentFuturePassingAsNonFluent() {
ListenableFuture<String> f = FluentFuture.from(SettableFuture.<String>create());
assertThat(FluentFuture.from(f)).isSameInstanceAs(f);
}
public void testFromNonFluentFuture() throws Exception {
ListenableFuture<String> f =
new SimpleForwardingListenableFuture<String>(immediateFuture("a")) {};
Reported by PMD.
Line: 52
assertThat(FluentFuture.from(f)).isSameInstanceAs(f);
}
public void testFromNonFluentFuture() throws Exception {
ListenableFuture<String> f =
new SimpleForwardingListenableFuture<String>(immediateFuture("a")) {};
verify(!(f instanceof FluentFuture));
assertThat(FluentFuture.from(f).get()).isEqualTo("a");
// TODO(cpovirk): Test forwarding more extensively.
Reported by PMD.
Line: 56
ListenableFuture<String> f =
new SimpleForwardingListenableFuture<String>(immediateFuture("a")) {};
verify(!(f instanceof FluentFuture));
assertThat(FluentFuture.from(f).get()).isEqualTo("a");
// TODO(cpovirk): Test forwarding more extensively.
}
public void testAddCallback() {
FluentFuture<String> f = FluentFuture.from(immediateFuture("a"));
Reported by PMD.
Line: 56
ListenableFuture<String> f =
new SimpleForwardingListenableFuture<String>(immediateFuture("a")) {};
verify(!(f instanceof FluentFuture));
assertThat(FluentFuture.from(f).get()).isEqualTo("a");
// TODO(cpovirk): Test forwarding more extensively.
}
public void testAddCallback() {
FluentFuture<String> f = FluentFuture.from(immediateFuture("a"));
Reported by PMD.
Line: 60
// TODO(cpovirk): Test forwarding more extensively.
}
public void testAddCallback() {
FluentFuture<String> f = FluentFuture.from(immediateFuture("a"));
final boolean[] called = new boolean[1];
f.addCallback(
new FutureCallback<String>() {
@Override
Reported by PMD.
Line: 74
public void onFailure(Throwable t) {}
},
directExecutor());
assertThat(called[0]).isTrue();
}
public void testCatching() throws Exception {
FluentFuture<?> f =
FluentFuture.from(immediateFailedFuture(new RuntimeException()))
Reported by PMD.
Line: 77
assertThat(called[0]).isTrue();
}
public void testCatching() throws Exception {
FluentFuture<?> f =
FluentFuture.from(immediateFailedFuture(new RuntimeException()))
.catching(
Throwable.class,
new Function<Throwable, Class<?>>() {
Reported by PMD.
guava-testlib/src/com/google/common/collect/testing/google/MultimapSizeTester.java
34 issues
Line: 42
@Ignore // Affects only Android test runner, which respects JUnit 4 annotations on JUnit 3 tests.
public class MultimapSizeTester<K, V> extends AbstractMultimapTester<K, V, Multimap<K, V>> {
public void testSize() {
int expectedSize = getNumElements();
Multimap<K, V> multimap = multimap();
assertEquals(expectedSize, multimap.size());
int size = 0;
Reported by PMD.
Line: 42
@Ignore // Affects only Android test runner, which respects JUnit 4 annotations on JUnit 3 tests.
public class MultimapSizeTester<K, V> extends AbstractMultimapTester<K, V, Multimap<K, V>> {
public void testSize() {
int expectedSize = getNumElements();
Multimap<K, V> multimap = multimap();
assertEquals(expectedSize, multimap.size());
int size = 0;
Reported by PMD.
Line: 45
public void testSize() {
int expectedSize = getNumElements();
Multimap<K, V> multimap = multimap();
assertEquals(expectedSize, multimap.size());
int size = 0;
for (Entry<K, V> entry : multimap.entries()) {
assertTrue(multimap.containsEntry(entry.getKey(), entry.getValue()));
size++;
Reported by PMD.
Line: 55
assertEquals(expectedSize, size);
int size2 = 0;
for (Entry<K, Collection<V>> entry2 : multimap.asMap().entrySet()) {
size2 += entry2.getValue().size();
}
assertEquals(expectedSize, size2);
}
Reported by PMD.
Line: 56
int size2 = 0;
for (Entry<K, Collection<V>> entry2 : multimap.asMap().entrySet()) {
size2 += entry2.getValue().size();
}
assertEquals(expectedSize, size2);
}
@CollectionSize.Require(ZERO)
Reported by PMD.
Line: 61
assertEquals(expectedSize, size2);
}
@CollectionSize.Require(ZERO)
public void testIsEmptyYes() {
assertTrue(multimap().isEmpty());
}
@CollectionSize.Require(absent = ZERO)
Reported by PMD.
Line: 63
@CollectionSize.Require(ZERO)
public void testIsEmptyYes() {
assertTrue(multimap().isEmpty());
}
@CollectionSize.Require(absent = ZERO)
public void testIsEmptyNo() {
assertFalse(multimap().isEmpty());
Reported by PMD.
Line: 66
assertTrue(multimap().isEmpty());
}
@CollectionSize.Require(absent = ZERO)
public void testIsEmptyNo() {
assertFalse(multimap().isEmpty());
}
@CollectionSize.Require(absent = ZERO)
Reported by PMD.
Line: 68
@CollectionSize.Require(absent = ZERO)
public void testIsEmptyNo() {
assertFalse(multimap().isEmpty());
}
@CollectionSize.Require(absent = ZERO)
@MapFeature.Require(ALLOWS_NULL_KEYS)
public void testSizeNullKey() {
Reported by PMD.
Line: 71
assertFalse(multimap().isEmpty());
}
@CollectionSize.Require(absent = ZERO)
@MapFeature.Require(ALLOWS_NULL_KEYS)
public void testSizeNullKey() {
initMultimapWithNullKey();
assertEquals(getNumElements(), multimap().size());
assertFalse(multimap().isEmpty());
Reported by PMD.
guava-testlib/src/com/google/common/collect/testing/AbstractMapTester.java
34 issues
Line: 41
@GwtCompatible
@Ignore // Affects only Android test runner, which respects JUnit 4 annotations on JUnit 3 tests.
public abstract class AbstractMapTester<K, V>
extends AbstractContainerTester<Map<K, V>, Entry<K, V>> {
protected Map<K, V> getMap() {
return container;
}
@Override
Reported by PMD.
Line: 48
@Override
protected Collection<Entry<K, V>> actualContents() {
return getMap().entrySet();
}
/** @see AbstractContainerTester#resetContainer() */
protected final void resetMap() {
resetContainer();
Reported by PMD.
Line: 62
protected void expectMissingKeys(K... elements) {
for (K element : elements) {
assertFalse("Should not contain key " + element, getMap().containsKey(element));
}
}
protected void expectMissingValues(V... elements) {
for (V element : elements) {
Reported by PMD.
Line: 68
protected void expectMissingValues(V... elements) {
for (V element : elements) {
assertFalse("Should not contain value " + element, getMap().containsValue(element));
}
}
/** @return an array of the proper size with {@code null} as the key of the middle element. */
protected Entry<K, V>[] createArrayWithNullKey() {
Reported by PMD.
Line: 77
Entry<K, V>[] array = createSamplesArray();
final int nullKeyLocation = getNullLocation();
final Entry<K, V> oldEntry = array[nullKeyLocation];
array[nullKeyLocation] = entry(null, oldEntry.getValue());
return array;
}
protected V getValueForNullKey() {
return getEntryNullReplaces().getValue();
Reported by PMD.
Line: 82
}
protected V getValueForNullKey() {
return getEntryNullReplaces().getValue();
}
protected K getKeyForNullValue() {
return getEntryNullReplaces().getKey();
}
Reported by PMD.
Line: 86
}
protected K getKeyForNullValue() {
return getEntryNullReplaces().getKey();
}
private Entry<K, V> getEntryNullReplaces() {
Iterator<Entry<K, V>> entries = getSampleElements().iterator();
for (int i = 0; i < getNullLocation(); i++) {
Reported by PMD.
Line: 90
}
private Entry<K, V> getEntryNullReplaces() {
Iterator<Entry<K, V>> entries = getSampleElements().iterator();
for (int i = 0; i < getNullLocation(); i++) {
entries.next();
}
return entries.next();
}
Reported by PMD.
Line: 102
Entry<K, V>[] array = createSamplesArray();
final int nullValueLocation = getNullLocation();
final Entry<K, V> oldEntry = array[nullValueLocation];
array[nullValueLocation] = entry(oldEntry.getKey(), null);
return array;
}
protected void initMapWithNullKey() {
resetMap(createArrayWithNullKey());
Reported by PMD.
Line: 122
*/
protected void expectNullKeyMissingWhenNullKeysUnsupported(String message) {
try {
assertFalse(message, getMap().containsKey(null));
} catch (NullPointerException tolerated) {
// Tolerated
}
}
Reported by PMD.
guava-tests/test/com/google/common/util/concurrent/FluentFutureTest.java
34 issues
Line: 42
*/
@GwtCompatible(emulated = true)
public class FluentFutureTest extends TestCase {
public void testFromFluentFuture() {
FluentFuture<String> f = FluentFuture.from(SettableFuture.<String>create());
assertThat(FluentFuture.from(f)).isSameInstanceAs(f);
}
public void testFromFluentFuturePassingAsNonFluent() {
Reported by PMD.
Line: 44
public class FluentFutureTest extends TestCase {
public void testFromFluentFuture() {
FluentFuture<String> f = FluentFuture.from(SettableFuture.<String>create());
assertThat(FluentFuture.from(f)).isSameInstanceAs(f);
}
public void testFromFluentFuturePassingAsNonFluent() {
ListenableFuture<String> f = FluentFuture.from(SettableFuture.<String>create());
assertThat(FluentFuture.from(f)).isSameInstanceAs(f);
Reported by PMD.
Line: 47
assertThat(FluentFuture.from(f)).isSameInstanceAs(f);
}
public void testFromFluentFuturePassingAsNonFluent() {
ListenableFuture<String> f = FluentFuture.from(SettableFuture.<String>create());
assertThat(FluentFuture.from(f)).isSameInstanceAs(f);
}
public void testFromNonFluentFuture() throws Exception {
Reported by PMD.
Line: 49
public void testFromFluentFuturePassingAsNonFluent() {
ListenableFuture<String> f = FluentFuture.from(SettableFuture.<String>create());
assertThat(FluentFuture.from(f)).isSameInstanceAs(f);
}
public void testFromNonFluentFuture() throws Exception {
ListenableFuture<String> f =
new SimpleForwardingListenableFuture<String>(immediateFuture("a")) {};
Reported by PMD.
Line: 52
assertThat(FluentFuture.from(f)).isSameInstanceAs(f);
}
public void testFromNonFluentFuture() throws Exception {
ListenableFuture<String> f =
new SimpleForwardingListenableFuture<String>(immediateFuture("a")) {};
verify(!(f instanceof FluentFuture));
assertThat(FluentFuture.from(f).get()).isEqualTo("a");
// TODO(cpovirk): Test forwarding more extensively.
Reported by PMD.
Line: 56
ListenableFuture<String> f =
new SimpleForwardingListenableFuture<String>(immediateFuture("a")) {};
verify(!(f instanceof FluentFuture));
assertThat(FluentFuture.from(f).get()).isEqualTo("a");
// TODO(cpovirk): Test forwarding more extensively.
}
public void testAddCallback() {
FluentFuture<String> f = FluentFuture.from(immediateFuture("a"));
Reported by PMD.
Line: 56
ListenableFuture<String> f =
new SimpleForwardingListenableFuture<String>(immediateFuture("a")) {};
verify(!(f instanceof FluentFuture));
assertThat(FluentFuture.from(f).get()).isEqualTo("a");
// TODO(cpovirk): Test forwarding more extensively.
}
public void testAddCallback() {
FluentFuture<String> f = FluentFuture.from(immediateFuture("a"));
Reported by PMD.
Line: 60
// TODO(cpovirk): Test forwarding more extensively.
}
public void testAddCallback() {
FluentFuture<String> f = FluentFuture.from(immediateFuture("a"));
final boolean[] called = new boolean[1];
f.addCallback(
new FutureCallback<String>() {
@Override
Reported by PMD.
Line: 74
public void onFailure(Throwable t) {}
},
directExecutor());
assertThat(called[0]).isTrue();
}
public void testCatching() throws Exception {
FluentFuture<?> f =
FluentFuture.from(immediateFailedFuture(new RuntimeException()))
Reported by PMD.
Line: 77
assertThat(called[0]).isTrue();
}
public void testCatching() throws Exception {
FluentFuture<?> f =
FluentFuture.from(immediateFailedFuture(new RuntimeException()))
.catching(
Throwable.class,
new Function<Throwable, Class<?>>() {
Reported by PMD.
guava-testlib/src/com/google/common/collect/testing/testers/ListAddAllAtIndexTester.java
34 issues
Line: 42
@SuppressWarnings("unchecked") // too many "unchecked generic array creations"
@GwtCompatible
@Ignore // Affects only Android test runner, which respects JUnit 4 annotations on JUnit 3 tests.
public class ListAddAllAtIndexTester<E> extends AbstractListTester<E> {
@ListFeature.Require(SUPPORTS_ADD_WITH_INDEX)
@CollectionSize.Require(absent = ZERO)
public void testAddAllAtIndex_supportedAllPresent() {
assertTrue(
"addAll(n, allPresent) should return true",
Reported by PMD.
Line: 43
@GwtCompatible
@Ignore // Affects only Android test runner, which respects JUnit 4 annotations on JUnit 3 tests.
public class ListAddAllAtIndexTester<E> extends AbstractListTester<E> {
@ListFeature.Require(SUPPORTS_ADD_WITH_INDEX)
@CollectionSize.Require(absent = ZERO)
public void testAddAllAtIndex_supportedAllPresent() {
assertTrue(
"addAll(n, allPresent) should return true",
getList().addAll(0, MinimalCollection.of(e0())));
Reported by PMD.
Line: 48
public void testAddAllAtIndex_supportedAllPresent() {
assertTrue(
"addAll(n, allPresent) should return true",
getList().addAll(0, MinimalCollection.of(e0())));
expectAdded(0, e0());
}
@ListFeature.Require(absent = SUPPORTS_ADD_WITH_INDEX)
@CollectionSize.Require(absent = ZERO)
Reported by PMD.
Line: 52
expectAdded(0, e0());
}
@ListFeature.Require(absent = SUPPORTS_ADD_WITH_INDEX)
@CollectionSize.Require(absent = ZERO)
public void testAddAllAtIndex_unsupportedAllPresent() {
try {
getList().addAll(0, MinimalCollection.of(e0()));
fail("addAll(n, allPresent) should throw");
Reported by PMD.
Line: 56
@CollectionSize.Require(absent = ZERO)
public void testAddAllAtIndex_unsupportedAllPresent() {
try {
getList().addAll(0, MinimalCollection.of(e0()));
fail("addAll(n, allPresent) should throw");
} catch (UnsupportedOperationException expected) {
}
expectUnchanged();
}
Reported by PMD.
Line: 63
expectUnchanged();
}
@ListFeature.Require(SUPPORTS_ADD_WITH_INDEX)
@CollectionSize.Require(absent = ZERO)
public void testAddAllAtIndex_supportedSomePresent() {
assertTrue(
"addAll(n, allPresent) should return true",
getList().addAll(0, MinimalCollection.of(e0(), e3())));
Reported by PMD.
Line: 68
public void testAddAllAtIndex_supportedSomePresent() {
assertTrue(
"addAll(n, allPresent) should return true",
getList().addAll(0, MinimalCollection.of(e0(), e3())));
expectAdded(0, e0(), e3());
}
@ListFeature.Require(absent = SUPPORTS_ADD_WITH_INDEX)
@CollectionSize.Require(absent = ZERO)
Reported by PMD.
Line: 72
expectAdded(0, e0(), e3());
}
@ListFeature.Require(absent = SUPPORTS_ADD_WITH_INDEX)
@CollectionSize.Require(absent = ZERO)
public void testAddAllAtIndex_unsupportedSomePresent() {
try {
getList().addAll(0, MinimalCollection.of(e0(), e3()));
fail("addAll(n, allPresent) should throw");
Reported by PMD.
Line: 76
@CollectionSize.Require(absent = ZERO)
public void testAddAllAtIndex_unsupportedSomePresent() {
try {
getList().addAll(0, MinimalCollection.of(e0(), e3()));
fail("addAll(n, allPresent) should throw");
} catch (UnsupportedOperationException expected) {
}
expectUnchanged();
expectMissing(e3());
Reported by PMD.
Line: 84
expectMissing(e3());
}
@ListFeature.Require(SUPPORTS_ADD_WITH_INDEX)
public void testAddAllAtIndex_supportedNothing() {
assertFalse("addAll(n, nothing) should return false", getList().addAll(0, emptyCollection()));
expectUnchanged();
}
Reported by PMD.
guava-tests/test/com/google/common/collect/FauxveridesTest.java
34 issues
Line: 150
}
/** [descendant, ancestor) */
private static Set<Class<?>> getClassesBetween(Class<?> descendant, Class<?> ancestor) {
Set<Class<?>> classes = newHashSet();
while (!descendant.equals(ancestor)) {
classes.add(descendant);
descendant = descendant.getSuperclass();
Reported by PMD.
Line: 45
*
* @author Chris Povirk
*/
public class FauxveridesTest extends TestCase {
public void testImmutableBiMap() {
doHasAllFauxveridesTest(ImmutableBiMap.class, ImmutableMap.class);
}
public void testImmutableListMultimap() {
Reported by PMD.
Line: 46
* @author Chris Povirk
*/
public class FauxveridesTest extends TestCase {
public void testImmutableBiMap() {
doHasAllFauxveridesTest(ImmutableBiMap.class, ImmutableMap.class);
}
public void testImmutableListMultimap() {
doHasAllFauxveridesTest(ImmutableListMultimap.class, ImmutableMultimap.class);
Reported by PMD.
Line: 46
* @author Chris Povirk
*/
public class FauxveridesTest extends TestCase {
public void testImmutableBiMap() {
doHasAllFauxveridesTest(ImmutableBiMap.class, ImmutableMap.class);
}
public void testImmutableListMultimap() {
doHasAllFauxveridesTest(ImmutableListMultimap.class, ImmutableMultimap.class);
Reported by PMD.
Line: 50
doHasAllFauxveridesTest(ImmutableBiMap.class, ImmutableMap.class);
}
public void testImmutableListMultimap() {
doHasAllFauxveridesTest(ImmutableListMultimap.class, ImmutableMultimap.class);
}
public void testImmutableSetMultimap() {
doHasAllFauxveridesTest(ImmutableSetMultimap.class, ImmutableMultimap.class);
Reported by PMD.
Line: 50
doHasAllFauxveridesTest(ImmutableBiMap.class, ImmutableMap.class);
}
public void testImmutableListMultimap() {
doHasAllFauxveridesTest(ImmutableListMultimap.class, ImmutableMultimap.class);
}
public void testImmutableSetMultimap() {
doHasAllFauxveridesTest(ImmutableSetMultimap.class, ImmutableMultimap.class);
Reported by PMD.
Line: 54
doHasAllFauxveridesTest(ImmutableListMultimap.class, ImmutableMultimap.class);
}
public void testImmutableSetMultimap() {
doHasAllFauxveridesTest(ImmutableSetMultimap.class, ImmutableMultimap.class);
}
public void testImmutableSortedMap() {
doHasAllFauxveridesTest(ImmutableSortedMap.class, ImmutableMap.class);
Reported by PMD.
Line: 54
doHasAllFauxveridesTest(ImmutableListMultimap.class, ImmutableMultimap.class);
}
public void testImmutableSetMultimap() {
doHasAllFauxveridesTest(ImmutableSetMultimap.class, ImmutableMultimap.class);
}
public void testImmutableSortedMap() {
doHasAllFauxveridesTest(ImmutableSortedMap.class, ImmutableMap.class);
Reported by PMD.
Line: 58
doHasAllFauxveridesTest(ImmutableSetMultimap.class, ImmutableMultimap.class);
}
public void testImmutableSortedMap() {
doHasAllFauxveridesTest(ImmutableSortedMap.class, ImmutableMap.class);
}
public void testImmutableSortedSet() {
doHasAllFauxveridesTest(ImmutableSortedSet.class, ImmutableSet.class);
Reported by PMD.
Line: 58
doHasAllFauxveridesTest(ImmutableSetMultimap.class, ImmutableMultimap.class);
}
public void testImmutableSortedMap() {
doHasAllFauxveridesTest(ImmutableSortedMap.class, ImmutableMap.class);
}
public void testImmutableSortedSet() {
doHasAllFauxveridesTest(ImmutableSortedSet.class, ImmutableSet.class);
Reported by PMD.
guava-tests/test/com/google/common/hash/AbstractByteHasherTest.java
34 issues
Line: 32
*/
public class AbstractByteHasherTest extends TestCase {
public void testBytes() {
TestHasher hasher = new TestHasher(); // byte order insignificant here
byte[] expected = {1, 2, 3, 4, 5, 6, 7, 8};
hasher.putByte((byte) 1);
hasher.putBytes(new byte[] {2, 3, 4, 5, 6});
hasher.putByte((byte) 7);
Reported by PMD.
Line: 32
*/
public class AbstractByteHasherTest extends TestCase {
public void testBytes() {
TestHasher hasher = new TestHasher(); // byte order insignificant here
byte[] expected = {1, 2, 3, 4, 5, 6, 7, 8};
hasher.putByte((byte) 1);
hasher.putBytes(new byte[] {2, 3, 4, 5, 6});
hasher.putByte((byte) 7);
Reported by PMD.
Line: 43
hasher.assertBytes(expected);
}
public void testShort() {
TestHasher hasher = new TestHasher();
hasher.putShort((short) 0x0201);
hasher.assertBytes(new byte[] {1, 2});
}
Reported by PMD.
Line: 43
hasher.assertBytes(expected);
}
public void testShort() {
TestHasher hasher = new TestHasher();
hasher.putShort((short) 0x0201);
hasher.assertBytes(new byte[] {1, 2});
}
Reported by PMD.
Line: 49
hasher.assertBytes(new byte[] {1, 2});
}
public void testInt() {
TestHasher hasher = new TestHasher();
hasher.putInt(0x04030201);
hasher.assertBytes(new byte[] {1, 2, 3, 4});
}
Reported by PMD.
Line: 49
hasher.assertBytes(new byte[] {1, 2});
}
public void testInt() {
TestHasher hasher = new TestHasher();
hasher.putInt(0x04030201);
hasher.assertBytes(new byte[] {1, 2, 3, 4});
}
Reported by PMD.
Line: 55
hasher.assertBytes(new byte[] {1, 2, 3, 4});
}
public void testLong() {
TestHasher hasher = new TestHasher();
hasher.putLong(0x0807060504030201L);
hasher.assertBytes(new byte[] {1, 2, 3, 4, 5, 6, 7, 8});
}
Reported by PMD.
Line: 55
hasher.assertBytes(new byte[] {1, 2, 3, 4});
}
public void testLong() {
TestHasher hasher = new TestHasher();
hasher.putLong(0x0807060504030201L);
hasher.assertBytes(new byte[] {1, 2, 3, 4, 5, 6, 7, 8});
}
Reported by PMD.
Line: 61
hasher.assertBytes(new byte[] {1, 2, 3, 4, 5, 6, 7, 8});
}
public void testChar() {
TestHasher hasher = new TestHasher();
hasher.putChar((char) 0x0201);
hasher.assertBytes(new byte[] {1, 2});
}
Reported by PMD.
Line: 61
hasher.assertBytes(new byte[] {1, 2, 3, 4, 5, 6, 7, 8});
}
public void testChar() {
TestHasher hasher = new TestHasher();
hasher.putChar((char) 0x0201);
hasher.assertBytes(new byte[] {1, 2});
}
Reported by PMD.
guava-testlib/src/com/google/common/collect/testing/google/MultisetTestSuiteBuilder.java
33 issues
Line: 17
* limitations under the License.
*/
package com.google.common.collect.testing.google;
import static com.google.common.base.Preconditions.checkArgument;
import com.google.common.annotations.GwtIncompatible;
import com.google.common.collect.Multiset;
Reported by PMD.
Line: 74
@Override
protected List<Class<? extends AbstractTester>> getTesters() {
List<Class<? extends AbstractTester>> testers = Helpers.copyToList(super.getTesters());
testers.add(CollectionSerializationEqualTester.class);
testers.add(MultisetAddTester.class);
testers.add(MultisetContainsTester.class);
testers.add(MultisetCountTester.class);
testers.add(MultisetElementSetTester.class);
testers.add(MultisetEqualsTester.class);
Reported by PMD.
Line: 75
protected List<Class<? extends AbstractTester>> getTesters() {
List<Class<? extends AbstractTester>> testers = Helpers.copyToList(super.getTesters());
testers.add(CollectionSerializationEqualTester.class);
testers.add(MultisetAddTester.class);
testers.add(MultisetContainsTester.class);
testers.add(MultisetCountTester.class);
testers.add(MultisetElementSetTester.class);
testers.add(MultisetEqualsTester.class);
testers.add(MultisetForEachEntryTester.class);
Reported by PMD.
Line: 76
List<Class<? extends AbstractTester>> testers = Helpers.copyToList(super.getTesters());
testers.add(CollectionSerializationEqualTester.class);
testers.add(MultisetAddTester.class);
testers.add(MultisetContainsTester.class);
testers.add(MultisetCountTester.class);
testers.add(MultisetElementSetTester.class);
testers.add(MultisetEqualsTester.class);
testers.add(MultisetForEachEntryTester.class);
testers.add(MultisetReadsTester.class);
Reported by PMD.
Line: 77
testers.add(CollectionSerializationEqualTester.class);
testers.add(MultisetAddTester.class);
testers.add(MultisetContainsTester.class);
testers.add(MultisetCountTester.class);
testers.add(MultisetElementSetTester.class);
testers.add(MultisetEqualsTester.class);
testers.add(MultisetForEachEntryTester.class);
testers.add(MultisetReadsTester.class);
testers.add(MultisetSetCountConditionallyTester.class);
Reported by PMD.
Line: 78
testers.add(MultisetAddTester.class);
testers.add(MultisetContainsTester.class);
testers.add(MultisetCountTester.class);
testers.add(MultisetElementSetTester.class);
testers.add(MultisetEqualsTester.class);
testers.add(MultisetForEachEntryTester.class);
testers.add(MultisetReadsTester.class);
testers.add(MultisetSetCountConditionallyTester.class);
testers.add(MultisetSetCountUnconditionallyTester.class);
Reported by PMD.
Line: 79
testers.add(MultisetContainsTester.class);
testers.add(MultisetCountTester.class);
testers.add(MultisetElementSetTester.class);
testers.add(MultisetEqualsTester.class);
testers.add(MultisetForEachEntryTester.class);
testers.add(MultisetReadsTester.class);
testers.add(MultisetSetCountConditionallyTester.class);
testers.add(MultisetSetCountUnconditionallyTester.class);
testers.add(MultisetRemoveTester.class);
Reported by PMD.
Line: 80
testers.add(MultisetCountTester.class);
testers.add(MultisetElementSetTester.class);
testers.add(MultisetEqualsTester.class);
testers.add(MultisetForEachEntryTester.class);
testers.add(MultisetReadsTester.class);
testers.add(MultisetSetCountConditionallyTester.class);
testers.add(MultisetSetCountUnconditionallyTester.class);
testers.add(MultisetRemoveTester.class);
testers.add(MultisetEntrySetTester.class);
Reported by PMD.
Line: 81
testers.add(MultisetElementSetTester.class);
testers.add(MultisetEqualsTester.class);
testers.add(MultisetForEachEntryTester.class);
testers.add(MultisetReadsTester.class);
testers.add(MultisetSetCountConditionallyTester.class);
testers.add(MultisetSetCountUnconditionallyTester.class);
testers.add(MultisetRemoveTester.class);
testers.add(MultisetEntrySetTester.class);
testers.add(MultisetIteratorTester.class);
Reported by PMD.
Line: 82
testers.add(MultisetEqualsTester.class);
testers.add(MultisetForEachEntryTester.class);
testers.add(MultisetReadsTester.class);
testers.add(MultisetSetCountConditionallyTester.class);
testers.add(MultisetSetCountUnconditionallyTester.class);
testers.add(MultisetRemoveTester.class);
testers.add(MultisetEntrySetTester.class);
testers.add(MultisetIteratorTester.class);
testers.add(MultisetSerializationTester.class);
Reported by PMD.