The following issues were found
android/guava-tests/test/com/google/common/collect/SynchronizedMultimapTest.java
77 issues
Line: 78
private static final class TestMultimap<K, V> extends ForwardingSetMultimap<K, V>
implements Serializable {
final SetMultimap<K, V> delegate = HashMultimap.create();
public final Object mutex = new Integer(1); // something Serializable
@Override
protected SetMultimap<K, V> delegate() {
return delegate;
}
Reported by PMD.
Line: 45
*/
public class SynchronizedMultimapTest extends TestCase {
public static Test suite() {
TestSuite suite = new TestSuite();
suite.addTestSuite(SynchronizedMultimapTest.class);
suite.addTest(
SetMultimapTestSuiteBuilder.using(
new TestStringSetMultimapGenerator() {
Reported by PMD.
Line: 76
}
private static final class TestMultimap<K, V> extends ForwardingSetMultimap<K, V>
implements Serializable {
final SetMultimap<K, V> delegate = HashMultimap.create();
public final Object mutex = new Integer(1); // something Serializable
@Override
protected SetMultimap<K, V> delegate() {
Reported by PMD.
Line: 77
private static final class TestMultimap<K, V> extends ForwardingSetMultimap<K, V>
implements Serializable {
final SetMultimap<K, V> delegate = HashMultimap.create();
public final Object mutex = new Integer(1); // something Serializable
@Override
protected SetMultimap<K, V> delegate() {
return delegate;
Reported by PMD.
Line: 77
private static final class TestMultimap<K, V> extends ForwardingSetMultimap<K, V>
implements Serializable {
final SetMultimap<K, V> delegate = HashMultimap.create();
public final Object mutex = new Integer(1); // something Serializable
@Override
protected SetMultimap<K, V> delegate() {
return delegate;
Reported by PMD.
Line: 78
private static final class TestMultimap<K, V> extends ForwardingSetMultimap<K, V>
implements Serializable {
final SetMultimap<K, V> delegate = HashMultimap.create();
public final Object mutex = new Integer(1); // something Serializable
@Override
protected SetMultimap<K, V> delegate() {
return delegate;
}
Reported by PMD.
Line: 87
@Override
public String toString() {
assertTrue(Thread.holdsLock(mutex));
return super.toString();
}
@Override
public boolean equals(@NullableDecl Object o) {
Reported by PMD.
Line: 93
@Override
public boolean equals(@NullableDecl Object o) {
assertTrue(Thread.holdsLock(mutex));
return super.equals(o);
}
@Override
public int hashCode() {
Reported by PMD.
Line: 99
@Override
public int hashCode() {
assertTrue(Thread.holdsLock(mutex));
return super.hashCode();
}
@Override
public int size() {
Reported by PMD.
Line: 105
@Override
public int size() {
assertTrue(Thread.holdsLock(mutex));
return super.size();
}
@Override
public boolean isEmpty() {
Reported by PMD.
guava-tests/test/com/google/common/collect/AbstractTableReadTest.java
77 issues
Line: 34
* @author Jared Levy
*/
@GwtCompatible(emulated = true)
public abstract class AbstractTableReadTest extends TestCase {
protected Table<String, Integer, Character> table;
/**
* Creates a table with the specified data.
*
Reported by PMD.
Line: 35
*/
@GwtCompatible(emulated = true)
public abstract class AbstractTableReadTest extends TestCase {
protected Table<String, Integer, Character> table;
/**
* Creates a table with the specified data.
*
* @param data the table data, repeating the sequence row key, column key, value once per mapping
Reported by PMD.
Line: 47
protected abstract Table<String, Integer, Character> create(Object... data);
protected void assertSize(int expectedSize) {
assertEquals(expectedSize, table.size());
}
@Override
public void setUp() throws Exception {
super.setUp();
Reported by PMD.
Line: 50
assertEquals(expectedSize, table.size());
}
@Override
public void setUp() throws Exception {
super.setUp();
table = create();
}
Reported by PMD.
Line: 56
table = create();
}
public void testContains() {
table = create("foo", 1, 'a', "bar", 1, 'b', "foo", 3, 'c');
assertTrue(table.contains("foo", 1));
assertTrue(table.contains("bar", 1));
assertTrue(table.contains("foo", 3));
assertFalse(table.contains("foo", 2));
Reported by PMD.
Line: 56
table = create();
}
public void testContains() {
table = create("foo", 1, 'a', "bar", 1, 'b', "foo", 3, 'c');
assertTrue(table.contains("foo", 1));
assertTrue(table.contains("bar", 1));
assertTrue(table.contains("foo", 3));
assertFalse(table.contains("foo", 2));
Reported by PMD.
Line: 57
}
public void testContains() {
table = create("foo", 1, 'a', "bar", 1, 'b', "foo", 3, 'c');
assertTrue(table.contains("foo", 1));
assertTrue(table.contains("bar", 1));
assertTrue(table.contains("foo", 3));
assertFalse(table.contains("foo", 2));
assertFalse(table.contains("bar", 3));
Reported by PMD.
Line: 57
}
public void testContains() {
table = create("foo", 1, 'a', "bar", 1, 'b', "foo", 3, 'c');
assertTrue(table.contains("foo", 1));
assertTrue(table.contains("bar", 1));
assertTrue(table.contains("foo", 3));
assertFalse(table.contains("foo", 2));
assertFalse(table.contains("bar", 3));
Reported by PMD.
Line: 58
public void testContains() {
table = create("foo", 1, 'a', "bar", 1, 'b', "foo", 3, 'c');
assertTrue(table.contains("foo", 1));
assertTrue(table.contains("bar", 1));
assertTrue(table.contains("foo", 3));
assertFalse(table.contains("foo", 2));
assertFalse(table.contains("bar", 3));
assertFalse(table.contains("cat", 1));
Reported by PMD.
Line: 59
public void testContains() {
table = create("foo", 1, 'a', "bar", 1, 'b', "foo", 3, 'c');
assertTrue(table.contains("foo", 1));
assertTrue(table.contains("bar", 1));
assertTrue(table.contains("foo", 3));
assertFalse(table.contains("foo", 2));
assertFalse(table.contains("bar", 3));
assertFalse(table.contains("cat", 1));
assertFalse(table.contains("foo", null));
Reported by PMD.
android/guava-tests/test/com/google/common/collect/AbstractTableReadTest.java
77 issues
Line: 34
* @author Jared Levy
*/
@GwtCompatible(emulated = true)
public abstract class AbstractTableReadTest extends TestCase {
protected Table<String, Integer, Character> table;
/**
* Creates a table with the specified data.
*
Reported by PMD.
Line: 35
*/
@GwtCompatible(emulated = true)
public abstract class AbstractTableReadTest extends TestCase {
protected Table<String, Integer, Character> table;
/**
* Creates a table with the specified data.
*
* @param data the table data, repeating the sequence row key, column key, value once per mapping
Reported by PMD.
Line: 47
protected abstract Table<String, Integer, Character> create(Object... data);
protected void assertSize(int expectedSize) {
assertEquals(expectedSize, table.size());
}
@Override
public void setUp() throws Exception {
super.setUp();
Reported by PMD.
Line: 50
assertEquals(expectedSize, table.size());
}
@Override
public void setUp() throws Exception {
super.setUp();
table = create();
}
Reported by PMD.
Line: 56
table = create();
}
public void testContains() {
table = create("foo", 1, 'a', "bar", 1, 'b', "foo", 3, 'c');
assertTrue(table.contains("foo", 1));
assertTrue(table.contains("bar", 1));
assertTrue(table.contains("foo", 3));
assertFalse(table.contains("foo", 2));
Reported by PMD.
Line: 56
table = create();
}
public void testContains() {
table = create("foo", 1, 'a', "bar", 1, 'b', "foo", 3, 'c');
assertTrue(table.contains("foo", 1));
assertTrue(table.contains("bar", 1));
assertTrue(table.contains("foo", 3));
assertFalse(table.contains("foo", 2));
Reported by PMD.
Line: 57
}
public void testContains() {
table = create("foo", 1, 'a', "bar", 1, 'b', "foo", 3, 'c');
assertTrue(table.contains("foo", 1));
assertTrue(table.contains("bar", 1));
assertTrue(table.contains("foo", 3));
assertFalse(table.contains("foo", 2));
assertFalse(table.contains("bar", 3));
Reported by PMD.
Line: 57
}
public void testContains() {
table = create("foo", 1, 'a', "bar", 1, 'b', "foo", 3, 'c');
assertTrue(table.contains("foo", 1));
assertTrue(table.contains("bar", 1));
assertTrue(table.contains("foo", 3));
assertFalse(table.contains("foo", 2));
assertFalse(table.contains("bar", 3));
Reported by PMD.
Line: 58
public void testContains() {
table = create("foo", 1, 'a', "bar", 1, 'b', "foo", 3, 'c');
assertTrue(table.contains("foo", 1));
assertTrue(table.contains("bar", 1));
assertTrue(table.contains("foo", 3));
assertFalse(table.contains("foo", 2));
assertFalse(table.contains("bar", 3));
assertFalse(table.contains("cat", 1));
Reported by PMD.
Line: 59
public void testContains() {
table = create("foo", 1, 'a', "bar", 1, 'b', "foo", 3, 'c');
assertTrue(table.contains("foo", 1));
assertTrue(table.contains("bar", 1));
assertTrue(table.contains("foo", 3));
assertFalse(table.contains("foo", 2));
assertFalse(table.contains("bar", 3));
assertFalse(table.contains("cat", 1));
assertFalse(table.contains("foo", null));
Reported by PMD.
guava-tests/test/com/google/common/collect/SynchronizedMultimapTest.java
77 issues
Line: 78
private static final class TestMultimap<K, V> extends ForwardingSetMultimap<K, V>
implements Serializable {
final SetMultimap<K, V> delegate = HashMultimap.create();
public final Object mutex = new Integer(1); // something Serializable
@Override
protected SetMultimap<K, V> delegate() {
return delegate;
}
Reported by PMD.
Line: 45
*/
public class SynchronizedMultimapTest extends TestCase {
public static Test suite() {
TestSuite suite = new TestSuite();
suite.addTestSuite(SynchronizedMultimapTest.class);
suite.addTest(
SetMultimapTestSuiteBuilder.using(
new TestStringSetMultimapGenerator() {
Reported by PMD.
Line: 76
}
private static final class TestMultimap<K, V> extends ForwardingSetMultimap<K, V>
implements Serializable {
final SetMultimap<K, V> delegate = HashMultimap.create();
public final Object mutex = new Integer(1); // something Serializable
@Override
protected SetMultimap<K, V> delegate() {
Reported by PMD.
Line: 77
private static final class TestMultimap<K, V> extends ForwardingSetMultimap<K, V>
implements Serializable {
final SetMultimap<K, V> delegate = HashMultimap.create();
public final Object mutex = new Integer(1); // something Serializable
@Override
protected SetMultimap<K, V> delegate() {
return delegate;
Reported by PMD.
Line: 77
private static final class TestMultimap<K, V> extends ForwardingSetMultimap<K, V>
implements Serializable {
final SetMultimap<K, V> delegate = HashMultimap.create();
public final Object mutex = new Integer(1); // something Serializable
@Override
protected SetMultimap<K, V> delegate() {
return delegate;
Reported by PMD.
Line: 78
private static final class TestMultimap<K, V> extends ForwardingSetMultimap<K, V>
implements Serializable {
final SetMultimap<K, V> delegate = HashMultimap.create();
public final Object mutex = new Integer(1); // something Serializable
@Override
protected SetMultimap<K, V> delegate() {
return delegate;
}
Reported by PMD.
Line: 87
@Override
public String toString() {
assertTrue(Thread.holdsLock(mutex));
return super.toString();
}
@Override
public boolean equals(@Nullable Object o) {
Reported by PMD.
Line: 93
@Override
public boolean equals(@Nullable Object o) {
assertTrue(Thread.holdsLock(mutex));
return super.equals(o);
}
@Override
public int hashCode() {
Reported by PMD.
Line: 99
@Override
public int hashCode() {
assertTrue(Thread.holdsLock(mutex));
return super.hashCode();
}
@Override
public int size() {
Reported by PMD.
Line: 105
@Override
public int size() {
assertTrue(Thread.holdsLock(mutex));
return super.size();
}
@Override
public boolean isEmpty() {
Reported by PMD.
android/guava-tests/test/com/google/common/collect/ComparisonChainTest.java
75 issues
Line: 39
}
}
public void testCompareBooleans() {
assertEquals(
0,
ComparisonChain.start()
.compare(true, true)
.compare(true, Boolean.TRUE)
Reported by PMD.
Line: 40
}
public void testCompareBooleans() {
assertEquals(
0,
ComparisonChain.start()
.compare(true, true)
.compare(true, Boolean.TRUE)
.compare(Boolean.TRUE, true)
Reported by PMD.
Line: 42
public void testCompareBooleans() {
assertEquals(
0,
ComparisonChain.start()
.compare(true, true)
.compare(true, Boolean.TRUE)
.compare(Boolean.TRUE, true)
.compare(Boolean.TRUE, Boolean.TRUE)
.result());
Reported by PMD.
Line: 42
public void testCompareBooleans() {
assertEquals(
0,
ComparisonChain.start()
.compare(true, true)
.compare(true, Boolean.TRUE)
.compare(Boolean.TRUE, true)
.compare(Boolean.TRUE, Boolean.TRUE)
.result());
Reported by PMD.
Line: 42
public void testCompareBooleans() {
assertEquals(
0,
ComparisonChain.start()
.compare(true, true)
.compare(true, Boolean.TRUE)
.compare(Boolean.TRUE, true)
.compare(Boolean.TRUE, Boolean.TRUE)
.result());
Reported by PMD.
Line: 42
public void testCompareBooleans() {
assertEquals(
0,
ComparisonChain.start()
.compare(true, true)
.compare(true, Boolean.TRUE)
.compare(Boolean.TRUE, true)
.compare(Boolean.TRUE, Boolean.TRUE)
.result());
Reported by PMD.
Line: 42
public void testCompareBooleans() {
assertEquals(
0,
ComparisonChain.start()
.compare(true, true)
.compare(true, Boolean.TRUE)
.compare(Boolean.TRUE, true)
.compare(Boolean.TRUE, Boolean.TRUE)
.result());
Reported by PMD.
Line: 50
.result());
}
public void testDegenerate() {
// kinda bogus, but who cares?
assertEquals(0, ComparisonChain.start().result());
}
public void testOneEqual() {
Reported by PMD.
Line: 52
public void testDegenerate() {
// kinda bogus, but who cares?
assertEquals(0, ComparisonChain.start().result());
}
public void testOneEqual() {
assertEquals(0, ComparisonChain.start().compare("a", "a").result());
}
Reported by PMD.
Line: 52
public void testDegenerate() {
// kinda bogus, but who cares?
assertEquals(0, ComparisonChain.start().result());
}
public void testOneEqual() {
assertEquals(0, ComparisonChain.start().compare("a", "a").result());
}
Reported by PMD.
android/guava-tests/test/com/google/common/collect/ArrayListMultimapTest.java
75 issues
Line: 43
* @author Jared Levy
*/
@GwtCompatible(emulated = true)
public class ArrayListMultimapTest extends TestCase {
@GwtIncompatible // suite
public static Test suite() {
TestSuite suite = new TestSuite();
suite.addTest(
Reported by PMD.
Line: 45
@GwtCompatible(emulated = true)
public class ArrayListMultimapTest extends TestCase {
@GwtIncompatible // suite
public static Test suite() {
TestSuite suite = new TestSuite();
suite.addTest(
ListMultimapTestSuiteBuilder.using(
new TestStringListMultimapGenerator() {
Reported by PMD.
Line: 80
}
/** Confirm that get() returns a List implementing RandomAccess. */
public void testGetRandomAccess() {
Multimap<String, Integer> multimap = create();
multimap.put("foo", 1);
multimap.put("foo", 3);
assertTrue(multimap.get("foo") instanceof RandomAccess);
assertTrue(multimap.get("bar") instanceof RandomAccess);
Reported by PMD.
Line: 80
}
/** Confirm that get() returns a List implementing RandomAccess. */
public void testGetRandomAccess() {
Multimap<String, Integer> multimap = create();
multimap.put("foo", 1);
multimap.put("foo", 3);
assertTrue(multimap.get("foo") instanceof RandomAccess);
assertTrue(multimap.get("bar") instanceof RandomAccess);
Reported by PMD.
Line: 82
/** Confirm that get() returns a List implementing RandomAccess. */
public void testGetRandomAccess() {
Multimap<String, Integer> multimap = create();
multimap.put("foo", 1);
multimap.put("foo", 3);
assertTrue(multimap.get("foo") instanceof RandomAccess);
assertTrue(multimap.get("bar") instanceof RandomAccess);
}
Reported by PMD.
Line: 82
/** Confirm that get() returns a List implementing RandomAccess. */
public void testGetRandomAccess() {
Multimap<String, Integer> multimap = create();
multimap.put("foo", 1);
multimap.put("foo", 3);
assertTrue(multimap.get("foo") instanceof RandomAccess);
assertTrue(multimap.get("bar") instanceof RandomAccess);
}
Reported by PMD.
Line: 83
public void testGetRandomAccess() {
Multimap<String, Integer> multimap = create();
multimap.put("foo", 1);
multimap.put("foo", 3);
assertTrue(multimap.get("foo") instanceof RandomAccess);
assertTrue(multimap.get("bar") instanceof RandomAccess);
}
/** Confirm that removeAll() returns a List implementing RandomAccess. */
Reported by PMD.
Line: 84
Multimap<String, Integer> multimap = create();
multimap.put("foo", 1);
multimap.put("foo", 3);
assertTrue(multimap.get("foo") instanceof RandomAccess);
assertTrue(multimap.get("bar") instanceof RandomAccess);
}
/** Confirm that removeAll() returns a List implementing RandomAccess. */
public void testRemoveAllRandomAccess() {
Reported by PMD.
Line: 84
Multimap<String, Integer> multimap = create();
multimap.put("foo", 1);
multimap.put("foo", 3);
assertTrue(multimap.get("foo") instanceof RandomAccess);
assertTrue(multimap.get("bar") instanceof RandomAccess);
}
/** Confirm that removeAll() returns a List implementing RandomAccess. */
public void testRemoveAllRandomAccess() {
Reported by PMD.
Line: 85
multimap.put("foo", 1);
multimap.put("foo", 3);
assertTrue(multimap.get("foo") instanceof RandomAccess);
assertTrue(multimap.get("bar") instanceof RandomAccess);
}
/** Confirm that removeAll() returns a List implementing RandomAccess. */
public void testRemoveAllRandomAccess() {
Multimap<String, Integer> multimap = create();
Reported by PMD.
guava-tests/test/com/google/common/collect/ArrayListMultimapTest.java
75 issues
Line: 43
* @author Jared Levy
*/
@GwtCompatible(emulated = true)
public class ArrayListMultimapTest extends TestCase {
@GwtIncompatible // suite
public static Test suite() {
TestSuite suite = new TestSuite();
suite.addTest(
Reported by PMD.
Line: 45
@GwtCompatible(emulated = true)
public class ArrayListMultimapTest extends TestCase {
@GwtIncompatible // suite
public static Test suite() {
TestSuite suite = new TestSuite();
suite.addTest(
ListMultimapTestSuiteBuilder.using(
new TestStringListMultimapGenerator() {
Reported by PMD.
Line: 80
}
/** Confirm that get() returns a List implementing RandomAccess. */
public void testGetRandomAccess() {
Multimap<String, Integer> multimap = create();
multimap.put("foo", 1);
multimap.put("foo", 3);
assertTrue(multimap.get("foo") instanceof RandomAccess);
assertTrue(multimap.get("bar") instanceof RandomAccess);
Reported by PMD.
Line: 80
}
/** Confirm that get() returns a List implementing RandomAccess. */
public void testGetRandomAccess() {
Multimap<String, Integer> multimap = create();
multimap.put("foo", 1);
multimap.put("foo", 3);
assertTrue(multimap.get("foo") instanceof RandomAccess);
assertTrue(multimap.get("bar") instanceof RandomAccess);
Reported by PMD.
Line: 82
/** Confirm that get() returns a List implementing RandomAccess. */
public void testGetRandomAccess() {
Multimap<String, Integer> multimap = create();
multimap.put("foo", 1);
multimap.put("foo", 3);
assertTrue(multimap.get("foo") instanceof RandomAccess);
assertTrue(multimap.get("bar") instanceof RandomAccess);
}
Reported by PMD.
Line: 82
/** Confirm that get() returns a List implementing RandomAccess. */
public void testGetRandomAccess() {
Multimap<String, Integer> multimap = create();
multimap.put("foo", 1);
multimap.put("foo", 3);
assertTrue(multimap.get("foo") instanceof RandomAccess);
assertTrue(multimap.get("bar") instanceof RandomAccess);
}
Reported by PMD.
Line: 83
public void testGetRandomAccess() {
Multimap<String, Integer> multimap = create();
multimap.put("foo", 1);
multimap.put("foo", 3);
assertTrue(multimap.get("foo") instanceof RandomAccess);
assertTrue(multimap.get("bar") instanceof RandomAccess);
}
/** Confirm that removeAll() returns a List implementing RandomAccess. */
Reported by PMD.
Line: 84
Multimap<String, Integer> multimap = create();
multimap.put("foo", 1);
multimap.put("foo", 3);
assertTrue(multimap.get("foo") instanceof RandomAccess);
assertTrue(multimap.get("bar") instanceof RandomAccess);
}
/** Confirm that removeAll() returns a List implementing RandomAccess. */
public void testRemoveAllRandomAccess() {
Reported by PMD.
Line: 84
Multimap<String, Integer> multimap = create();
multimap.put("foo", 1);
multimap.put("foo", 3);
assertTrue(multimap.get("foo") instanceof RandomAccess);
assertTrue(multimap.get("bar") instanceof RandomAccess);
}
/** Confirm that removeAll() returns a List implementing RandomAccess. */
public void testRemoveAllRandomAccess() {
Reported by PMD.
Line: 85
multimap.put("foo", 1);
multimap.put("foo", 3);
assertTrue(multimap.get("foo") instanceof RandomAccess);
assertTrue(multimap.get("bar") instanceof RandomAccess);
}
/** Confirm that removeAll() returns a List implementing RandomAccess. */
public void testRemoveAllRandomAccess() {
Multimap<String, Integer> multimap = create();
Reported by PMD.
guava-tests/test/com/google/common/eventbus/EventBusTest.java
75 issues
Line: 149
new SubscriberExceptionHandler() {
@Override
public void handleException(Throwable exception, SubscriberExceptionContext context) {
throw new RuntimeException();
}
});
final Object subscriber =
new Object() {
@Subscribe
Reported by PMD.
Line: 156
new Object() {
@Subscribe
public void throwExceptionOn(String message) {
throw new RuntimeException();
}
};
eventBus.register(subscriber);
try {
eventBus.post(EVENT);
Reported by PMD.
Line: 93
// Two additional event types: Object and Comparable<?> (played by Integer)
Object objEvent = new Object();
Object compEvent = new Integer(6);
bus.post(EVENT);
bus.post(objEvent);
bus.post(compEvent);
Reported by PMD.
Line: 33
*
* @author Cliff Biffle
*/
public class EventBusTest extends TestCase {
private static final String EVENT = "Hello";
private static final String BUS_IDENTIFIER = "test-bus";
private EventBus bus;
Reported by PMD.
Line: 37
private static final String EVENT = "Hello";
private static final String BUS_IDENTIFIER = "test-bus";
private EventBus bus;
@Override
protected void setUp() throws Exception {
super.setUp();
bus = new EventBus(BUS_IDENTIFIER);
Reported by PMD.
Line: 39
private EventBus bus;
@Override
protected void setUp() throws Exception {
super.setUp();
bus = new EventBus(BUS_IDENTIFIER);
}
Reported by PMD.
Line: 45
bus = new EventBus(BUS_IDENTIFIER);
}
public void testBasicCatcherDistribution() {
StringCatcher catcher = new StringCatcher();
bus.register(catcher);
bus.post(EVENT);
List<String> events = catcher.getEvents();
Reported by PMD.
Line: 45
bus = new EventBus(BUS_IDENTIFIER);
}
public void testBasicCatcherDistribution() {
StringCatcher catcher = new StringCatcher();
bus.register(catcher);
bus.post(EVENT);
List<String> events = catcher.getEvents();
Reported by PMD.
Line: 51
bus.post(EVENT);
List<String> events = catcher.getEvents();
assertEquals("Only one event should be delivered.", 1, events.size());
assertEquals("Correct string should be delivered.", EVENT, events.get(0));
}
/**
* Tests that events are distributed to any subscribers to their type or any supertype, including
Reported by PMD.
Line: 52
List<String> events = catcher.getEvents();
assertEquals("Only one event should be delivered.", 1, events.size());
assertEquals("Correct string should be delivered.", EVENT, events.get(0));
}
/**
* Tests that events are distributed to any subscribers to their type or any supertype, including
* interfaces and superclasses.
Reported by PMD.
guava-tests/test/com/google/common/collect/ComparisonChainTest.java
75 issues
Line: 39
}
}
public void testCompareBooleans() {
assertEquals(
0,
ComparisonChain.start()
.compare(true, true)
.compare(true, Boolean.TRUE)
Reported by PMD.
Line: 40
}
public void testCompareBooleans() {
assertEquals(
0,
ComparisonChain.start()
.compare(true, true)
.compare(true, Boolean.TRUE)
.compare(Boolean.TRUE, true)
Reported by PMD.
Line: 42
public void testCompareBooleans() {
assertEquals(
0,
ComparisonChain.start()
.compare(true, true)
.compare(true, Boolean.TRUE)
.compare(Boolean.TRUE, true)
.compare(Boolean.TRUE, Boolean.TRUE)
.result());
Reported by PMD.
Line: 42
public void testCompareBooleans() {
assertEquals(
0,
ComparisonChain.start()
.compare(true, true)
.compare(true, Boolean.TRUE)
.compare(Boolean.TRUE, true)
.compare(Boolean.TRUE, Boolean.TRUE)
.result());
Reported by PMD.
Line: 42
public void testCompareBooleans() {
assertEquals(
0,
ComparisonChain.start()
.compare(true, true)
.compare(true, Boolean.TRUE)
.compare(Boolean.TRUE, true)
.compare(Boolean.TRUE, Boolean.TRUE)
.result());
Reported by PMD.
Line: 42
public void testCompareBooleans() {
assertEquals(
0,
ComparisonChain.start()
.compare(true, true)
.compare(true, Boolean.TRUE)
.compare(Boolean.TRUE, true)
.compare(Boolean.TRUE, Boolean.TRUE)
.result());
Reported by PMD.
Line: 42
public void testCompareBooleans() {
assertEquals(
0,
ComparisonChain.start()
.compare(true, true)
.compare(true, Boolean.TRUE)
.compare(Boolean.TRUE, true)
.compare(Boolean.TRUE, Boolean.TRUE)
.result());
Reported by PMD.
Line: 50
.result());
}
public void testDegenerate() {
// kinda bogus, but who cares?
assertEquals(0, ComparisonChain.start().result());
}
public void testOneEqual() {
Reported by PMD.
Line: 52
public void testDegenerate() {
// kinda bogus, but who cares?
assertEquals(0, ComparisonChain.start().result());
}
public void testOneEqual() {
assertEquals(0, ComparisonChain.start().compare("a", "a").result());
}
Reported by PMD.
Line: 52
public void testDegenerate() {
// kinda bogus, but who cares?
assertEquals(0, ComparisonChain.start().result());
}
public void testOneEqual() {
assertEquals(0, ComparisonChain.start().compare("a", "a").result());
}
Reported by PMD.
android/guava-tests/test/com/google/common/eventbus/EventBusTest.java
75 issues
Line: 149
new SubscriberExceptionHandler() {
@Override
public void handleException(Throwable exception, SubscriberExceptionContext context) {
throw new RuntimeException();
}
});
final Object subscriber =
new Object() {
@Subscribe
Reported by PMD.
Line: 156
new Object() {
@Subscribe
public void throwExceptionOn(String message) {
throw new RuntimeException();
}
};
eventBus.register(subscriber);
try {
eventBus.post(EVENT);
Reported by PMD.
Line: 93
// Two additional event types: Object and Comparable<?> (played by Integer)
Object objEvent = new Object();
Object compEvent = new Integer(6);
bus.post(EVENT);
bus.post(objEvent);
bus.post(compEvent);
Reported by PMD.
Line: 33
*
* @author Cliff Biffle
*/
public class EventBusTest extends TestCase {
private static final String EVENT = "Hello";
private static final String BUS_IDENTIFIER = "test-bus";
private EventBus bus;
Reported by PMD.
Line: 37
private static final String EVENT = "Hello";
private static final String BUS_IDENTIFIER = "test-bus";
private EventBus bus;
@Override
protected void setUp() throws Exception {
super.setUp();
bus = new EventBus(BUS_IDENTIFIER);
Reported by PMD.
Line: 39
private EventBus bus;
@Override
protected void setUp() throws Exception {
super.setUp();
bus = new EventBus(BUS_IDENTIFIER);
}
Reported by PMD.
Line: 45
bus = new EventBus(BUS_IDENTIFIER);
}
public void testBasicCatcherDistribution() {
StringCatcher catcher = new StringCatcher();
bus.register(catcher);
bus.post(EVENT);
List<String> events = catcher.getEvents();
Reported by PMD.
Line: 45
bus = new EventBus(BUS_IDENTIFIER);
}
public void testBasicCatcherDistribution() {
StringCatcher catcher = new StringCatcher();
bus.register(catcher);
bus.post(EVENT);
List<String> events = catcher.getEvents();
Reported by PMD.
Line: 51
bus.post(EVENT);
List<String> events = catcher.getEvents();
assertEquals("Only one event should be delivered.", 1, events.size());
assertEquals("Correct string should be delivered.", EVENT, events.get(0));
}
/**
* Tests that events are distributed to any subscribers to their type or any supertype, including
Reported by PMD.
Line: 52
List<String> events = catcher.getEvents();
assertEquals("Only one event should be delivered.", 1, events.size());
assertEquals("Correct string should be delivered.", EVENT, events.get(0));
}
/**
* Tests that events are distributed to any subscribers to their type or any supertype, including
* interfaces and superclasses.
Reported by PMD.