The following issues were found
guava-tests/test/com/google/common/collect/EnumMultisetTest.java
53 issues
Line: 45
* @author Jared Levy
*/
@GwtCompatible(emulated = true)
public class EnumMultisetTest extends TestCase {
@GwtIncompatible // suite
public static Test suite() {
TestSuite suite = new TestSuite();
suite.addTest(
Reported by PMD.
Line: 47
@GwtCompatible(emulated = true)
public class EnumMultisetTest extends TestCase {
@GwtIncompatible // suite
public static Test suite() {
TestSuite suite = new TestSuite();
suite.addTest(
MultisetTestSuiteBuilder.using(enumMultisetGenerator())
.withFeatures(
Reported by PMD.
Line: 51
public static Test suite() {
TestSuite suite = new TestSuite();
suite.addTest(
MultisetTestSuiteBuilder.using(enumMultisetGenerator())
.withFeatures(
CollectionSize.ANY,
CollectionFeature.KNOWN_ORDER,
CollectionFeature.GENERAL_PURPOSE,
CollectionFeature.SUPPORTS_ITERATOR_REMOVE,
Reported by PMD.
Line: 51
public static Test suite() {
TestSuite suite = new TestSuite();
suite.addTest(
MultisetTestSuiteBuilder.using(enumMultisetGenerator())
.withFeatures(
CollectionSize.ANY,
CollectionFeature.KNOWN_ORDER,
CollectionFeature.GENERAL_PURPOSE,
CollectionFeature.SUPPORTS_ITERATOR_REMOVE,
Reported by PMD.
Line: 51
public static Test suite() {
TestSuite suite = new TestSuite();
suite.addTest(
MultisetTestSuiteBuilder.using(enumMultisetGenerator())
.withFeatures(
CollectionSize.ANY,
CollectionFeature.KNOWN_ORDER,
CollectionFeature.GENERAL_PURPOSE,
CollectionFeature.SUPPORTS_ITERATOR_REMOVE,
Reported by PMD.
Line: 89
FEMALE
}
public void testClassCreate() {
Multiset<Color> ms = EnumMultiset.create(Color.class);
ms.add(Color.RED);
ms.add(Color.YELLOW);
ms.add(Color.RED);
assertEquals(0, ms.count(Color.BLUE));
Reported by PMD.
Line: 89
FEMALE
}
public void testClassCreate() {
Multiset<Color> ms = EnumMultiset.create(Color.class);
ms.add(Color.RED);
ms.add(Color.YELLOW);
ms.add(Color.RED);
assertEquals(0, ms.count(Color.BLUE));
Reported by PMD.
Line: 91
public void testClassCreate() {
Multiset<Color> ms = EnumMultiset.create(Color.class);
ms.add(Color.RED);
ms.add(Color.YELLOW);
ms.add(Color.RED);
assertEquals(0, ms.count(Color.BLUE));
assertEquals(1, ms.count(Color.YELLOW));
assertEquals(2, ms.count(Color.RED));
Reported by PMD.
Line: 92
public void testClassCreate() {
Multiset<Color> ms = EnumMultiset.create(Color.class);
ms.add(Color.RED);
ms.add(Color.YELLOW);
ms.add(Color.RED);
assertEquals(0, ms.count(Color.BLUE));
assertEquals(1, ms.count(Color.YELLOW));
assertEquals(2, ms.count(Color.RED));
}
Reported by PMD.
Line: 93
Multiset<Color> ms = EnumMultiset.create(Color.class);
ms.add(Color.RED);
ms.add(Color.YELLOW);
ms.add(Color.RED);
assertEquals(0, ms.count(Color.BLUE));
assertEquals(1, ms.count(Color.YELLOW));
assertEquals(2, ms.count(Color.RED));
}
Reported by PMD.
android/guava-testlib/test/com/google/common/testing/TearDownStackTest.java
52 issues
Line: 88
} catch (ClusterException expected) {
assertThat(expected).hasCauseThat().hasMessageThat().isEqualTo("two");
} catch (RuntimeException e) {
throw new RuntimeException(
"A ClusterException should have been thrown, rather than a " + e.getClass().getName(), e);
}
assertEquals(true, tearDownOne.ran);
assertEquals(true, tearDownTwo.ran);
Reported by PMD.
Line: 142
@Override
public void tearDown() throws Exception {
ran = true;
throw new RuntimeException(id);
}
}
private static final class SimpleTearDown implements TearDown {
Reported by PMD.
Line: 28
@GwtCompatible
public class TearDownStackTest extends TestCase {
private TearDownStack tearDownStack = new TearDownStack();
public void testSingleTearDown() throws Exception {
final TearDownStack stack = buildTearDownStack();
final SimpleTearDown tearDown = new SimpleTearDown();
Reported by PMD.
Line: 28
@GwtCompatible
public class TearDownStackTest extends TestCase {
private TearDownStack tearDownStack = new TearDownStack();
public void testSingleTearDown() throws Exception {
final TearDownStack stack = buildTearDownStack();
final SimpleTearDown tearDown = new SimpleTearDown();
Reported by PMD.
Line: 30
private TearDownStack tearDownStack = new TearDownStack();
public void testSingleTearDown() throws Exception {
final TearDownStack stack = buildTearDownStack();
final SimpleTearDown tearDown = new SimpleTearDown();
stack.addTearDown(tearDown);
Reported by PMD.
Line: 30
private TearDownStack tearDownStack = new TearDownStack();
public void testSingleTearDown() throws Exception {
final TearDownStack stack = buildTearDownStack();
final SimpleTearDown tearDown = new SimpleTearDown();
stack.addTearDown(tearDown);
Reported by PMD.
Line: 34
final TearDownStack stack = buildTearDownStack();
final SimpleTearDown tearDown = new SimpleTearDown();
stack.addTearDown(tearDown);
assertEquals(false, tearDown.ran);
stack.runTearDown();
Reported by PMD.
Line: 36
final SimpleTearDown tearDown = new SimpleTearDown();
stack.addTearDown(tearDown);
assertEquals(false, tearDown.ran);
stack.runTearDown();
assertEquals("tearDown should have run", true, tearDown.ran);
}
Reported by PMD.
Line: 36
final SimpleTearDown tearDown = new SimpleTearDown();
stack.addTearDown(tearDown);
assertEquals(false, tearDown.ran);
stack.runTearDown();
assertEquals("tearDown should have run", true, tearDown.ran);
}
Reported by PMD.
Line: 38
assertEquals(false, tearDown.ran);
stack.runTearDown();
assertEquals("tearDown should have run", true, tearDown.ran);
}
public void testMultipleTearDownsHappenInOrder() throws Exception {
Reported by PMD.
android/guava-testlib/src/com/google/common/collect/testing/google/AbstractMultisetSetCountTester.java
52 issues
Line: 51
*/
@GwtCompatible(emulated = true)
@Ignore // Affects only Android test runner, which respects JUnit 4 annotations on JUnit 3 tests.
public abstract class AbstractMultisetSetCountTester<E> extends AbstractMultisetTester<E> {
/*
* TODO: consider adding MultisetFeatures.SUPPORTS_SET_COUNT. Currently we
* assume that using setCount() to increase the count is permitted iff add()
* is permitted and similarly for decrease/remove(). We assume that a
* setCount() no-op is permitted if either add() or remove() is permitted,
Reported by PMD.
Line: 66
assertEquals(
"multiset.count() should return the value passed to setCount()",
count,
getMultiset().count(element));
int size = 0;
for (Multiset.Entry<E> entry : getMultiset().entrySet()) {
size += entry.getCount();
}
Reported by PMD.
Line: 69
getMultiset().count(element));
int size = 0;
for (Multiset.Entry<E> entry : getMultiset().entrySet()) {
size += entry.getCount();
}
assertEquals(
"multiset.size() should be the sum of the counts of all entries",
size,
Reported by PMD.
Line: 75
assertEquals(
"multiset.size() should be the sum of the counts of all entries",
size,
getMultiset().size());
}
/** Call the {@code setCount()} method under test, and check its return value. */
abstract void setCountCheckReturnValue(E element, int count);
Reported by PMD.
Line: 122
assertSetCount(e0(), 3);
}
@CollectionFeature.Require(SUPPORTS_ADD)
public void testSetCount_zeroToZero_addSupported() {
assertZeroToZero();
}
@CollectionFeature.Require(SUPPORTS_REMOVE)
Reported by PMD.
Line: 127
assertZeroToZero();
}
@CollectionFeature.Require(SUPPORTS_REMOVE)
public void testSetCount_zeroToZero_removeSupported() {
assertZeroToZero();
}
@CollectionFeature.Require(absent = {SUPPORTS_ADD, SUPPORTS_REMOVE})
Reported by PMD.
Line: 132
assertZeroToZero();
}
@CollectionFeature.Require(absent = {SUPPORTS_ADD, SUPPORTS_REMOVE})
public void testSetCount_zeroToZero_unsupported() {
try {
assertZeroToZero();
} catch (UnsupportedOperationException tolerated) {
}
Reported by PMD.
Line: 136
public void testSetCount_zeroToZero_unsupported() {
try {
assertZeroToZero();
} catch (UnsupportedOperationException tolerated) {
}
}
@CollectionSize.Require(absent = ZERO)
@CollectionFeature.Require(SUPPORTS_ADD)
Reported by PMD.
Line: 140
}
}
@CollectionSize.Require(absent = ZERO)
@CollectionFeature.Require(SUPPORTS_ADD)
public void testSetCount_oneToOne_addSupported() {
assertOneToOne();
}
Reported by PMD.
Line: 146
assertOneToOne();
}
@CollectionSize.Require(absent = ZERO)
@CollectionFeature.Require(SUPPORTS_REMOVE)
public void testSetCount_oneToOne_removeSupported() {
assertOneToOne();
}
Reported by PMD.
android/guava-testlib/src/com/google/common/collect/testing/google/MultisetRemoveTester.java
52 issues
Line: 46
*/
@GwtCompatible(emulated = true)
@Ignore // Affects only Android test runner, which respects JUnit 4 annotations on JUnit 3 tests.
public class MultisetRemoveTester<E> extends AbstractMultisetTester<E> {
@CollectionFeature.Require(SUPPORTS_REMOVE)
public void testRemoveNegative() {
try {
getMultiset().remove(e0(), -1);
fail("Expected IllegalArgumentException");
Reported by PMD.
Line: 47
@GwtCompatible(emulated = true)
@Ignore // Affects only Android test runner, which respects JUnit 4 annotations on JUnit 3 tests.
public class MultisetRemoveTester<E> extends AbstractMultisetTester<E> {
@CollectionFeature.Require(SUPPORTS_REMOVE)
public void testRemoveNegative() {
try {
getMultiset().remove(e0(), -1);
fail("Expected IllegalArgumentException");
} catch (IllegalArgumentException expected) {
Reported by PMD.
Line: 50
@CollectionFeature.Require(SUPPORTS_REMOVE)
public void testRemoveNegative() {
try {
getMultiset().remove(e0(), -1);
fail("Expected IllegalArgumentException");
} catch (IllegalArgumentException expected) {
}
expectUnchanged();
}
Reported by PMD.
Line: 57
expectUnchanged();
}
@CollectionFeature.Require(absent = SUPPORTS_REMOVE)
public void testRemoveUnsupported() {
try {
getMultiset().remove(e0(), 2);
fail("Expected UnsupportedOperationException");
} catch (UnsupportedOperationException expected) {
Reported by PMD.
Line: 60
@CollectionFeature.Require(absent = SUPPORTS_REMOVE)
public void testRemoveUnsupported() {
try {
getMultiset().remove(e0(), 2);
fail("Expected UnsupportedOperationException");
} catch (UnsupportedOperationException expected) {
}
}
Reported by PMD.
Line: 66
}
}
@CollectionFeature.Require(SUPPORTS_REMOVE)
public void testRemoveZeroNoOp() {
int originalCount = getMultiset().count(e0());
assertEquals("old count", originalCount, getMultiset().remove(e0(), 0));
expectUnchanged();
}
Reported by PMD.
Line: 68
@CollectionFeature.Require(SUPPORTS_REMOVE)
public void testRemoveZeroNoOp() {
int originalCount = getMultiset().count(e0());
assertEquals("old count", originalCount, getMultiset().remove(e0(), 0));
expectUnchanged();
}
@CollectionSize.Require(absent = ZERO)
Reported by PMD.
Line: 69
@CollectionFeature.Require(SUPPORTS_REMOVE)
public void testRemoveZeroNoOp() {
int originalCount = getMultiset().count(e0());
assertEquals("old count", originalCount, getMultiset().remove(e0(), 0));
expectUnchanged();
}
@CollectionSize.Require(absent = ZERO)
@CollectionFeature.Require(SUPPORTS_REMOVE)
Reported by PMD.
Line: 73
expectUnchanged();
}
@CollectionSize.Require(absent = ZERO)
@CollectionFeature.Require(SUPPORTS_REMOVE)
public void testRemove_occurrences_present() {
assertEquals(
"multiset.remove(present, 2) didn't return the old count",
1,
Reported by PMD.
Line: 75
@CollectionSize.Require(absent = ZERO)
@CollectionFeature.Require(SUPPORTS_REMOVE)
public void testRemove_occurrences_present() {
assertEquals(
"multiset.remove(present, 2) didn't return the old count",
1,
getMultiset().remove(e0(), 2));
assertFalse(
Reported by PMD.
guava-testlib/src/com/google/common/collect/testing/google/AbstractMultisetSetCountTester.java
52 issues
Line: 51
*/
@GwtCompatible(emulated = true)
@Ignore // Affects only Android test runner, which respects JUnit 4 annotations on JUnit 3 tests.
public abstract class AbstractMultisetSetCountTester<E> extends AbstractMultisetTester<E> {
/*
* TODO: consider adding MultisetFeatures.SUPPORTS_SET_COUNT. Currently we
* assume that using setCount() to increase the count is permitted iff add()
* is permitted and similarly for decrease/remove(). We assume that a
* setCount() no-op is permitted if either add() or remove() is permitted,
Reported by PMD.
Line: 66
assertEquals(
"multiset.count() should return the value passed to setCount()",
count,
getMultiset().count(element));
int size = 0;
for (Multiset.Entry<E> entry : getMultiset().entrySet()) {
size += entry.getCount();
}
Reported by PMD.
Line: 69
getMultiset().count(element));
int size = 0;
for (Multiset.Entry<E> entry : getMultiset().entrySet()) {
size += entry.getCount();
}
assertEquals(
"multiset.size() should be the sum of the counts of all entries",
size,
Reported by PMD.
Line: 75
assertEquals(
"multiset.size() should be the sum of the counts of all entries",
size,
getMultiset().size());
}
/** Call the {@code setCount()} method under test, and check its return value. */
abstract void setCountCheckReturnValue(E element, int count);
Reported by PMD.
Line: 122
assertSetCount(e0(), 3);
}
@CollectionFeature.Require(SUPPORTS_ADD)
public void testSetCount_zeroToZero_addSupported() {
assertZeroToZero();
}
@CollectionFeature.Require(SUPPORTS_REMOVE)
Reported by PMD.
Line: 127
assertZeroToZero();
}
@CollectionFeature.Require(SUPPORTS_REMOVE)
public void testSetCount_zeroToZero_removeSupported() {
assertZeroToZero();
}
@CollectionFeature.Require(absent = {SUPPORTS_ADD, SUPPORTS_REMOVE})
Reported by PMD.
Line: 132
assertZeroToZero();
}
@CollectionFeature.Require(absent = {SUPPORTS_ADD, SUPPORTS_REMOVE})
public void testSetCount_zeroToZero_unsupported() {
try {
assertZeroToZero();
} catch (UnsupportedOperationException tolerated) {
}
Reported by PMD.
Line: 136
public void testSetCount_zeroToZero_unsupported() {
try {
assertZeroToZero();
} catch (UnsupportedOperationException tolerated) {
}
}
@CollectionSize.Require(absent = ZERO)
@CollectionFeature.Require(SUPPORTS_ADD)
Reported by PMD.
Line: 140
}
}
@CollectionSize.Require(absent = ZERO)
@CollectionFeature.Require(SUPPORTS_ADD)
public void testSetCount_oneToOne_addSupported() {
assertOneToOne();
}
Reported by PMD.
Line: 146
assertOneToOne();
}
@CollectionSize.Require(absent = ZERO)
@CollectionFeature.Require(SUPPORTS_REMOVE)
public void testSetCount_oneToOne_removeSupported() {
assertOneToOne();
}
Reported by PMD.
guava-testlib/src/com/google/common/collect/testing/google/MultisetRemoveTester.java
52 issues
Line: 46
*/
@GwtCompatible(emulated = true)
@Ignore // Affects only Android test runner, which respects JUnit 4 annotations on JUnit 3 tests.
public class MultisetRemoveTester<E> extends AbstractMultisetTester<E> {
@CollectionFeature.Require(SUPPORTS_REMOVE)
public void testRemoveNegative() {
try {
getMultiset().remove(e0(), -1);
fail("Expected IllegalArgumentException");
Reported by PMD.
Line: 47
@GwtCompatible(emulated = true)
@Ignore // Affects only Android test runner, which respects JUnit 4 annotations on JUnit 3 tests.
public class MultisetRemoveTester<E> extends AbstractMultisetTester<E> {
@CollectionFeature.Require(SUPPORTS_REMOVE)
public void testRemoveNegative() {
try {
getMultiset().remove(e0(), -1);
fail("Expected IllegalArgumentException");
} catch (IllegalArgumentException expected) {
Reported by PMD.
Line: 50
@CollectionFeature.Require(SUPPORTS_REMOVE)
public void testRemoveNegative() {
try {
getMultiset().remove(e0(), -1);
fail("Expected IllegalArgumentException");
} catch (IllegalArgumentException expected) {
}
expectUnchanged();
}
Reported by PMD.
Line: 57
expectUnchanged();
}
@CollectionFeature.Require(absent = SUPPORTS_REMOVE)
public void testRemoveUnsupported() {
try {
getMultiset().remove(e0(), 2);
fail("Expected UnsupportedOperationException");
} catch (UnsupportedOperationException expected) {
Reported by PMD.
Line: 60
@CollectionFeature.Require(absent = SUPPORTS_REMOVE)
public void testRemoveUnsupported() {
try {
getMultiset().remove(e0(), 2);
fail("Expected UnsupportedOperationException");
} catch (UnsupportedOperationException expected) {
}
}
Reported by PMD.
Line: 66
}
}
@CollectionFeature.Require(SUPPORTS_REMOVE)
public void testRemoveZeroNoOp() {
int originalCount = getMultiset().count(e0());
assertEquals("old count", originalCount, getMultiset().remove(e0(), 0));
expectUnchanged();
}
Reported by PMD.
Line: 68
@CollectionFeature.Require(SUPPORTS_REMOVE)
public void testRemoveZeroNoOp() {
int originalCount = getMultiset().count(e0());
assertEquals("old count", originalCount, getMultiset().remove(e0(), 0));
expectUnchanged();
}
@CollectionSize.Require(absent = ZERO)
Reported by PMD.
Line: 69
@CollectionFeature.Require(SUPPORTS_REMOVE)
public void testRemoveZeroNoOp() {
int originalCount = getMultiset().count(e0());
assertEquals("old count", originalCount, getMultiset().remove(e0(), 0));
expectUnchanged();
}
@CollectionSize.Require(absent = ZERO)
@CollectionFeature.Require(SUPPORTS_REMOVE)
Reported by PMD.
Line: 73
expectUnchanged();
}
@CollectionSize.Require(absent = ZERO)
@CollectionFeature.Require(SUPPORTS_REMOVE)
public void testRemove_occurrences_present() {
assertEquals(
"multiset.remove(present, 2) didn't return the old count",
1,
Reported by PMD.
Line: 75
@CollectionSize.Require(absent = ZERO)
@CollectionFeature.Require(SUPPORTS_REMOVE)
public void testRemove_occurrences_present() {
assertEquals(
"multiset.remove(present, 2) didn't return the old count",
1,
getMultiset().remove(e0(), 2));
assertFalse(
Reported by PMD.
guava/src/com/google/common/hash/Murmur3_32HashFunction.java
52 issues
Line: 235
return Ints.fromBytes(input[offset + 3], input[offset + 2], input[offset + 1], input[offset]);
}
private static int mixK1(int k1) {
k1 *= C1;
k1 = Integer.rotateLeft(k1, 15);
k1 *= C2;
return k1;
}
Reported by PMD.
Line: 235
return Ints.fromBytes(input[offset + 3], input[offset + 2], input[offset + 1], input[offset]);
}
private static int mixK1(int k1) {
k1 *= C1;
k1 = Integer.rotateLeft(k1, 15);
k1 *= C2;
return k1;
}
Reported by PMD.
Line: 235
return Ints.fromBytes(input[offset + 3], input[offset + 2], input[offset + 1], input[offset]);
}
private static int mixK1(int k1) {
k1 *= C1;
k1 = Integer.rotateLeft(k1, 15);
k1 *= C2;
return k1;
}
Reported by PMD.
Line: 242
return k1;
}
private static int mixH1(int h1, int k1) {
h1 ^= k1;
h1 = Integer.rotateLeft(h1, 13);
h1 = h1 * 5 + 0xe6546b64;
return h1;
}
Reported by PMD.
Line: 242
return k1;
}
private static int mixH1(int h1, int k1) {
h1 ^= k1;
h1 = Integer.rotateLeft(h1, 13);
h1 = h1 * 5 + 0xe6546b64;
return h1;
}
Reported by PMD.
Line: 242
return k1;
}
private static int mixH1(int h1, int k1) {
h1 ^= k1;
h1 = Integer.rotateLeft(h1, 13);
h1 = h1 * 5 + 0xe6546b64;
return h1;
}
Reported by PMD.
Line: 250
}
// Finalization mix - force all bits of a hash block to avalanche
private static HashCode fmix(int h1, int length) {
h1 ^= length;
h1 ^= h1 >>> 16;
h1 *= 0x85ebca6b;
h1 ^= h1 >>> 13;
h1 *= 0xc2b2ae35;
Reported by PMD.
Line: 250
}
// Finalization mix - force all bits of a hash block to avalanche
private static HashCode fmix(int h1, int length) {
h1 ^= length;
h1 ^= h1 >>> 16;
h1 *= 0x85ebca6b;
h1 ^= h1 >>> 13;
h1 *= 0xc2b2ae35;
Reported by PMD.
Line: 250
}
// Finalization mix - force all bits of a hash block to avalanche
private static HashCode fmix(int h1, int length) {
h1 ^= length;
h1 ^= h1 >>> 16;
h1 *= 0x85ebca6b;
h1 ^= h1 >>> 13;
h1 *= 0xc2b2ae35;
Reported by PMD.
Line: 250
}
// Finalization mix - force all bits of a hash block to avalanche
private static HashCode fmix(int h1, int length) {
h1 ^= length;
h1 ^= h1 >>> 16;
h1 *= 0x85ebca6b;
h1 ^= h1 >>> 13;
h1 *= 0xc2b2ae35;
Reported by PMD.
guava-testlib/test/com/google/common/testing/TearDownStackTest.java
52 issues
Line: 88
} catch (ClusterException expected) {
assertThat(expected).hasCauseThat().hasMessageThat().isEqualTo("two");
} catch (RuntimeException e) {
throw new RuntimeException(
"A ClusterException should have been thrown, rather than a " + e.getClass().getName(), e);
}
assertEquals(true, tearDownOne.ran);
assertEquals(true, tearDownTwo.ran);
Reported by PMD.
Line: 142
@Override
public void tearDown() throws Exception {
ran = true;
throw new RuntimeException(id);
}
}
private static final class SimpleTearDown implements TearDown {
Reported by PMD.
Line: 28
@GwtCompatible
public class TearDownStackTest extends TestCase {
private TearDownStack tearDownStack = new TearDownStack();
public void testSingleTearDown() throws Exception {
final TearDownStack stack = buildTearDownStack();
final SimpleTearDown tearDown = new SimpleTearDown();
Reported by PMD.
Line: 28
@GwtCompatible
public class TearDownStackTest extends TestCase {
private TearDownStack tearDownStack = new TearDownStack();
public void testSingleTearDown() throws Exception {
final TearDownStack stack = buildTearDownStack();
final SimpleTearDown tearDown = new SimpleTearDown();
Reported by PMD.
Line: 30
private TearDownStack tearDownStack = new TearDownStack();
public void testSingleTearDown() throws Exception {
final TearDownStack stack = buildTearDownStack();
final SimpleTearDown tearDown = new SimpleTearDown();
stack.addTearDown(tearDown);
Reported by PMD.
Line: 30
private TearDownStack tearDownStack = new TearDownStack();
public void testSingleTearDown() throws Exception {
final TearDownStack stack = buildTearDownStack();
final SimpleTearDown tearDown = new SimpleTearDown();
stack.addTearDown(tearDown);
Reported by PMD.
Line: 34
final TearDownStack stack = buildTearDownStack();
final SimpleTearDown tearDown = new SimpleTearDown();
stack.addTearDown(tearDown);
assertEquals(false, tearDown.ran);
stack.runTearDown();
Reported by PMD.
Line: 36
final SimpleTearDown tearDown = new SimpleTearDown();
stack.addTearDown(tearDown);
assertEquals(false, tearDown.ran);
stack.runTearDown();
assertEquals("tearDown should have run", true, tearDown.ran);
}
Reported by PMD.
Line: 36
final SimpleTearDown tearDown = new SimpleTearDown();
stack.addTearDown(tearDown);
assertEquals(false, tearDown.ran);
stack.runTearDown();
assertEquals("tearDown should have run", true, tearDown.ran);
}
Reported by PMD.
Line: 38
assertEquals(false, tearDown.ran);
stack.runTearDown();
assertEquals("tearDown should have run", true, tearDown.ran);
}
public void testMultipleTearDownsHappenInOrder() throws Exception {
Reported by PMD.
android/guava/src/com/google/common/hash/Murmur3_32HashFunction.java
52 issues
Line: 235
return Ints.fromBytes(input[offset + 3], input[offset + 2], input[offset + 1], input[offset]);
}
private static int mixK1(int k1) {
k1 *= C1;
k1 = Integer.rotateLeft(k1, 15);
k1 *= C2;
return k1;
}
Reported by PMD.
Line: 235
return Ints.fromBytes(input[offset + 3], input[offset + 2], input[offset + 1], input[offset]);
}
private static int mixK1(int k1) {
k1 *= C1;
k1 = Integer.rotateLeft(k1, 15);
k1 *= C2;
return k1;
}
Reported by PMD.
Line: 235
return Ints.fromBytes(input[offset + 3], input[offset + 2], input[offset + 1], input[offset]);
}
private static int mixK1(int k1) {
k1 *= C1;
k1 = Integer.rotateLeft(k1, 15);
k1 *= C2;
return k1;
}
Reported by PMD.
Line: 242
return k1;
}
private static int mixH1(int h1, int k1) {
h1 ^= k1;
h1 = Integer.rotateLeft(h1, 13);
h1 = h1 * 5 + 0xe6546b64;
return h1;
}
Reported by PMD.
Line: 242
return k1;
}
private static int mixH1(int h1, int k1) {
h1 ^= k1;
h1 = Integer.rotateLeft(h1, 13);
h1 = h1 * 5 + 0xe6546b64;
return h1;
}
Reported by PMD.
Line: 242
return k1;
}
private static int mixH1(int h1, int k1) {
h1 ^= k1;
h1 = Integer.rotateLeft(h1, 13);
h1 = h1 * 5 + 0xe6546b64;
return h1;
}
Reported by PMD.
Line: 250
}
// Finalization mix - force all bits of a hash block to avalanche
private static HashCode fmix(int h1, int length) {
h1 ^= length;
h1 ^= h1 >>> 16;
h1 *= 0x85ebca6b;
h1 ^= h1 >>> 13;
h1 *= 0xc2b2ae35;
Reported by PMD.
Line: 250
}
// Finalization mix - force all bits of a hash block to avalanche
private static HashCode fmix(int h1, int length) {
h1 ^= length;
h1 ^= h1 >>> 16;
h1 *= 0x85ebca6b;
h1 ^= h1 >>> 13;
h1 *= 0xc2b2ae35;
Reported by PMD.
Line: 250
}
// Finalization mix - force all bits of a hash block to avalanche
private static HashCode fmix(int h1, int length) {
h1 ^= length;
h1 ^= h1 >>> 16;
h1 *= 0x85ebca6b;
h1 ^= h1 >>> 13;
h1 *= 0xc2b2ae35;
Reported by PMD.
Line: 250
}
// Finalization mix - force all bits of a hash block to avalanche
private static HashCode fmix(int h1, int length) {
h1 ^= length;
h1 ^= h1 >>> 16;
h1 *= 0x85ebca6b;
h1 ^= h1 >>> 13;
h1 *= 0xc2b2ae35;
Reported by PMD.
android/guava-tests/test/com/google/common/collect/MultimapBuilderTest.java
51 issues
Line: 39
@GwtCompatible(emulated = true)
public class MultimapBuilderTest extends TestCase {
@GwtIncompatible // doesn't build without explicit type parameters on build() methods
public void testGenerics() {
ListMultimap<String, Integer> a = MultimapBuilder.hashKeys().arrayListValues().build();
SortedSetMultimap<String, Integer> b = MultimapBuilder.linkedHashKeys().treeSetValues().build();
SetMultimap<String, Integer> c =
MultimapBuilder.treeKeys(String.CASE_INSENSITIVE_ORDER).hashSetValues().build();
Reported by PMD.
Line: 40
public class MultimapBuilderTest extends TestCase {
@GwtIncompatible // doesn't build without explicit type parameters on build() methods
public void testGenerics() {
ListMultimap<String, Integer> a = MultimapBuilder.hashKeys().arrayListValues().build();
SortedSetMultimap<String, Integer> b = MultimapBuilder.linkedHashKeys().treeSetValues().build();
SetMultimap<String, Integer> c =
MultimapBuilder.treeKeys(String.CASE_INSENSITIVE_ORDER).hashSetValues().build();
}
Reported by PMD.
Line: 41
@GwtIncompatible // doesn't build without explicit type parameters on build() methods
public void testGenerics() {
ListMultimap<String, Integer> a = MultimapBuilder.hashKeys().arrayListValues().build();
SortedSetMultimap<String, Integer> b = MultimapBuilder.linkedHashKeys().treeSetValues().build();
SetMultimap<String, Integer> c =
MultimapBuilder.treeKeys(String.CASE_INSENSITIVE_ORDER).hashSetValues().build();
}
Reported by PMD.
Line: 41
@GwtIncompatible // doesn't build without explicit type parameters on build() methods
public void testGenerics() {
ListMultimap<String, Integer> a = MultimapBuilder.hashKeys().arrayListValues().build();
SortedSetMultimap<String, Integer> b = MultimapBuilder.linkedHashKeys().treeSetValues().build();
SetMultimap<String, Integer> c =
MultimapBuilder.treeKeys(String.CASE_INSENSITIVE_ORDER).hashSetValues().build();
}
Reported by PMD.
Line: 41
@GwtIncompatible // doesn't build without explicit type parameters on build() methods
public void testGenerics() {
ListMultimap<String, Integer> a = MultimapBuilder.hashKeys().arrayListValues().build();
SortedSetMultimap<String, Integer> b = MultimapBuilder.linkedHashKeys().treeSetValues().build();
SetMultimap<String, Integer> c =
MultimapBuilder.treeKeys(String.CASE_INSENSITIVE_ORDER).hashSetValues().build();
}
Reported by PMD.
Line: 42
@GwtIncompatible // doesn't build without explicit type parameters on build() methods
public void testGenerics() {
ListMultimap<String, Integer> a = MultimapBuilder.hashKeys().arrayListValues().build();
SortedSetMultimap<String, Integer> b = MultimapBuilder.linkedHashKeys().treeSetValues().build();
SetMultimap<String, Integer> c =
MultimapBuilder.treeKeys(String.CASE_INSENSITIVE_ORDER).hashSetValues().build();
}
public void testGenerics_gwtCompatible() {
Reported by PMD.
Line: 42
@GwtIncompatible // doesn't build without explicit type parameters on build() methods
public void testGenerics() {
ListMultimap<String, Integer> a = MultimapBuilder.hashKeys().arrayListValues().build();
SortedSetMultimap<String, Integer> b = MultimapBuilder.linkedHashKeys().treeSetValues().build();
SetMultimap<String, Integer> c =
MultimapBuilder.treeKeys(String.CASE_INSENSITIVE_ORDER).hashSetValues().build();
}
public void testGenerics_gwtCompatible() {
Reported by PMD.
Line: 42
@GwtIncompatible // doesn't build without explicit type parameters on build() methods
public void testGenerics() {
ListMultimap<String, Integer> a = MultimapBuilder.hashKeys().arrayListValues().build();
SortedSetMultimap<String, Integer> b = MultimapBuilder.linkedHashKeys().treeSetValues().build();
SetMultimap<String, Integer> c =
MultimapBuilder.treeKeys(String.CASE_INSENSITIVE_ORDER).hashSetValues().build();
}
public void testGenerics_gwtCompatible() {
Reported by PMD.
Line: 43
public void testGenerics() {
ListMultimap<String, Integer> a = MultimapBuilder.hashKeys().arrayListValues().build();
SortedSetMultimap<String, Integer> b = MultimapBuilder.linkedHashKeys().treeSetValues().build();
SetMultimap<String, Integer> c =
MultimapBuilder.treeKeys(String.CASE_INSENSITIVE_ORDER).hashSetValues().build();
}
public void testGenerics_gwtCompatible() {
ListMultimap<String, Integer> a =
Reported by PMD.
Line: 44
ListMultimap<String, Integer> a = MultimapBuilder.hashKeys().arrayListValues().build();
SortedSetMultimap<String, Integer> b = MultimapBuilder.linkedHashKeys().treeSetValues().build();
SetMultimap<String, Integer> c =
MultimapBuilder.treeKeys(String.CASE_INSENSITIVE_ORDER).hashSetValues().build();
}
public void testGenerics_gwtCompatible() {
ListMultimap<String, Integer> a =
MultimapBuilder.hashKeys().arrayListValues().<String, Integer>build();
Reported by PMD.