The following issues were found
guava-tests/test/com/google/common/io/CharSequenceReaderTest.java
84 issues
Line: 30
*/
public class CharSequenceReaderTest extends TestCase {
public void testReadEmptyString() throws IOException {
assertReadsCorrectly("");
}
public void testReadsStringsCorrectly() throws IOException {
assertReadsCorrectly("abc");
Reported by PMD.
Line: 34
assertReadsCorrectly("");
}
public void testReadsStringsCorrectly() throws IOException {
assertReadsCorrectly("abc");
assertReadsCorrectly("abcde");
assertReadsCorrectly("abcdefghijkl");
assertReadsCorrectly(
""
Reported by PMD.
Line: 34
assertReadsCorrectly("");
}
public void testReadsStringsCorrectly() throws IOException {
assertReadsCorrectly("abc");
assertReadsCorrectly("abcde");
assertReadsCorrectly("abcdefghijkl");
assertReadsCorrectly(
""
Reported by PMD.
Line: 39
assertReadsCorrectly("abcde");
assertReadsCorrectly("abcdefghijkl");
assertReadsCorrectly(
""
+ "abcdefghijklmnopqrstuvwxyz\n"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZ\r"
+ "0123456789\r\n"
+ "!@#$%^&*()-=_+\t[]{};':\",./<>?\\| ");
}
Reported by PMD.
Line: 46
+ "!@#$%^&*()-=_+\t[]{};':\",./<>?\\| ");
}
public void testMarkAndReset() throws IOException {
String string = "abcdefghijklmnopqrstuvwxyz";
CharSequenceReader reader = new CharSequenceReader(string);
assertTrue(reader.markSupported());
assertEquals(string, readFully(reader));
Reported by PMD.
Line: 46
+ "!@#$%^&*()-=_+\t[]{};':\",./<>?\\| ");
}
public void testMarkAndReset() throws IOException {
String string = "abcdefghijklmnopqrstuvwxyz";
CharSequenceReader reader = new CharSequenceReader(string);
assertTrue(reader.markSupported());
assertEquals(string, readFully(reader));
Reported by PMD.
Line: 48
public void testMarkAndReset() throws IOException {
String string = "abcdefghijklmnopqrstuvwxyz";
CharSequenceReader reader = new CharSequenceReader(string);
assertTrue(reader.markSupported());
assertEquals(string, readFully(reader));
assertFullyRead(reader);
Reported by PMD.
Line: 49
public void testMarkAndReset() throws IOException {
String string = "abcdefghijklmnopqrstuvwxyz";
CharSequenceReader reader = new CharSequenceReader(string);
assertTrue(reader.markSupported());
assertEquals(string, readFully(reader));
assertFullyRead(reader);
// reset and read again
Reported by PMD.
Line: 51
CharSequenceReader reader = new CharSequenceReader(string);
assertTrue(reader.markSupported());
assertEquals(string, readFully(reader));
assertFullyRead(reader);
// reset and read again
reader.reset();
assertEquals(string, readFully(reader));
Reported by PMD.
Line: 56
// reset and read again
reader.reset();
assertEquals(string, readFully(reader));
assertFullyRead(reader);
// reset, skip, mark, then read the rest
reader.reset();
assertEquals(5, reader.skip(5));
Reported by PMD.
guava-tests/test/com/google/common/graph/ImmutableNetworkTest.java
84 issues
Line: 30
public class ImmutableNetworkTest {
@Test
public void immutableNetwork() {
MutableNetwork<String, Integer> mutableNetwork = NetworkBuilder.directed().build();
mutableNetwork.addNode("A");
ImmutableNetwork<String, Integer> immutableNetwork = ImmutableNetwork.copyOf(mutableNetwork);
assertThat(immutableNetwork.asGraph()).isInstanceOf(ImmutableGraph.class);
Reported by PMD.
Line: 31
@Test
public void immutableNetwork() {
MutableNetwork<String, Integer> mutableNetwork = NetworkBuilder.directed().build();
mutableNetwork.addNode("A");
ImmutableNetwork<String, Integer> immutableNetwork = ImmutableNetwork.copyOf(mutableNetwork);
assertThat(immutableNetwork.asGraph()).isInstanceOf(ImmutableGraph.class);
assertThat(immutableNetwork).isNotInstanceOf(MutableNetwork.class);
Reported by PMD.
Line: 32
@Test
public void immutableNetwork() {
MutableNetwork<String, Integer> mutableNetwork = NetworkBuilder.directed().build();
mutableNetwork.addNode("A");
ImmutableNetwork<String, Integer> immutableNetwork = ImmutableNetwork.copyOf(mutableNetwork);
assertThat(immutableNetwork.asGraph()).isInstanceOf(ImmutableGraph.class);
assertThat(immutableNetwork).isNotInstanceOf(MutableNetwork.class);
assertThat(immutableNetwork).isEqualTo(mutableNetwork);
Reported by PMD.
Line: 35
mutableNetwork.addNode("A");
ImmutableNetwork<String, Integer> immutableNetwork = ImmutableNetwork.copyOf(mutableNetwork);
assertThat(immutableNetwork.asGraph()).isInstanceOf(ImmutableGraph.class);
assertThat(immutableNetwork).isNotInstanceOf(MutableNetwork.class);
assertThat(immutableNetwork).isEqualTo(mutableNetwork);
mutableNetwork.addNode("B");
assertThat(immutableNetwork).isNotEqualTo(mutableNetwork);
Reported by PMD.
Line: 35
mutableNetwork.addNode("A");
ImmutableNetwork<String, Integer> immutableNetwork = ImmutableNetwork.copyOf(mutableNetwork);
assertThat(immutableNetwork.asGraph()).isInstanceOf(ImmutableGraph.class);
assertThat(immutableNetwork).isNotInstanceOf(MutableNetwork.class);
assertThat(immutableNetwork).isEqualTo(mutableNetwork);
mutableNetwork.addNode("B");
assertThat(immutableNetwork).isNotEqualTo(mutableNetwork);
Reported by PMD.
Line: 36
ImmutableNetwork<String, Integer> immutableNetwork = ImmutableNetwork.copyOf(mutableNetwork);
assertThat(immutableNetwork.asGraph()).isInstanceOf(ImmutableGraph.class);
assertThat(immutableNetwork).isNotInstanceOf(MutableNetwork.class);
assertThat(immutableNetwork).isEqualTo(mutableNetwork);
mutableNetwork.addNode("B");
assertThat(immutableNetwork).isNotEqualTo(mutableNetwork);
}
Reported by PMD.
Line: 37
assertThat(immutableNetwork.asGraph()).isInstanceOf(ImmutableGraph.class);
assertThat(immutableNetwork).isNotInstanceOf(MutableNetwork.class);
assertThat(immutableNetwork).isEqualTo(mutableNetwork);
mutableNetwork.addNode("B");
assertThat(immutableNetwork).isNotEqualTo(mutableNetwork);
}
Reported by PMD.
Line: 39
assertThat(immutableNetwork).isNotInstanceOf(MutableNetwork.class);
assertThat(immutableNetwork).isEqualTo(mutableNetwork);
mutableNetwork.addNode("B");
assertThat(immutableNetwork).isNotEqualTo(mutableNetwork);
}
@Test
public void copyOfImmutableNetwork_optimized() {
Reported by PMD.
Line: 40
assertThat(immutableNetwork).isEqualTo(mutableNetwork);
mutableNetwork.addNode("B");
assertThat(immutableNetwork).isNotEqualTo(mutableNetwork);
}
@Test
public void copyOfImmutableNetwork_optimized() {
Network<String, String> network1 =
Reported by PMD.
Line: 46
@Test
public void copyOfImmutableNetwork_optimized() {
Network<String, String> network1 =
ImmutableNetwork.copyOf(NetworkBuilder.directed().<String, String>build());
Network<String, String> network2 = ImmutableNetwork.copyOf(network1);
assertThat(network2).isSameInstanceAs(network1);
}
Reported by PMD.
android/guava-tests/test/com/google/common/graph/ImmutableNetworkTest.java
84 issues
Line: 30
public class ImmutableNetworkTest {
@Test
public void immutableNetwork() {
MutableNetwork<String, Integer> mutableNetwork = NetworkBuilder.directed().build();
mutableNetwork.addNode("A");
ImmutableNetwork<String, Integer> immutableNetwork = ImmutableNetwork.copyOf(mutableNetwork);
assertThat(immutableNetwork.asGraph()).isInstanceOf(ImmutableGraph.class);
Reported by PMD.
Line: 31
@Test
public void immutableNetwork() {
MutableNetwork<String, Integer> mutableNetwork = NetworkBuilder.directed().build();
mutableNetwork.addNode("A");
ImmutableNetwork<String, Integer> immutableNetwork = ImmutableNetwork.copyOf(mutableNetwork);
assertThat(immutableNetwork.asGraph()).isInstanceOf(ImmutableGraph.class);
assertThat(immutableNetwork).isNotInstanceOf(MutableNetwork.class);
Reported by PMD.
Line: 32
@Test
public void immutableNetwork() {
MutableNetwork<String, Integer> mutableNetwork = NetworkBuilder.directed().build();
mutableNetwork.addNode("A");
ImmutableNetwork<String, Integer> immutableNetwork = ImmutableNetwork.copyOf(mutableNetwork);
assertThat(immutableNetwork.asGraph()).isInstanceOf(ImmutableGraph.class);
assertThat(immutableNetwork).isNotInstanceOf(MutableNetwork.class);
assertThat(immutableNetwork).isEqualTo(mutableNetwork);
Reported by PMD.
Line: 35
mutableNetwork.addNode("A");
ImmutableNetwork<String, Integer> immutableNetwork = ImmutableNetwork.copyOf(mutableNetwork);
assertThat(immutableNetwork.asGraph()).isInstanceOf(ImmutableGraph.class);
assertThat(immutableNetwork).isNotInstanceOf(MutableNetwork.class);
assertThat(immutableNetwork).isEqualTo(mutableNetwork);
mutableNetwork.addNode("B");
assertThat(immutableNetwork).isNotEqualTo(mutableNetwork);
Reported by PMD.
Line: 35
mutableNetwork.addNode("A");
ImmutableNetwork<String, Integer> immutableNetwork = ImmutableNetwork.copyOf(mutableNetwork);
assertThat(immutableNetwork.asGraph()).isInstanceOf(ImmutableGraph.class);
assertThat(immutableNetwork).isNotInstanceOf(MutableNetwork.class);
assertThat(immutableNetwork).isEqualTo(mutableNetwork);
mutableNetwork.addNode("B");
assertThat(immutableNetwork).isNotEqualTo(mutableNetwork);
Reported by PMD.
Line: 36
ImmutableNetwork<String, Integer> immutableNetwork = ImmutableNetwork.copyOf(mutableNetwork);
assertThat(immutableNetwork.asGraph()).isInstanceOf(ImmutableGraph.class);
assertThat(immutableNetwork).isNotInstanceOf(MutableNetwork.class);
assertThat(immutableNetwork).isEqualTo(mutableNetwork);
mutableNetwork.addNode("B");
assertThat(immutableNetwork).isNotEqualTo(mutableNetwork);
}
Reported by PMD.
Line: 37
assertThat(immutableNetwork.asGraph()).isInstanceOf(ImmutableGraph.class);
assertThat(immutableNetwork).isNotInstanceOf(MutableNetwork.class);
assertThat(immutableNetwork).isEqualTo(mutableNetwork);
mutableNetwork.addNode("B");
assertThat(immutableNetwork).isNotEqualTo(mutableNetwork);
}
Reported by PMD.
Line: 39
assertThat(immutableNetwork).isNotInstanceOf(MutableNetwork.class);
assertThat(immutableNetwork).isEqualTo(mutableNetwork);
mutableNetwork.addNode("B");
assertThat(immutableNetwork).isNotEqualTo(mutableNetwork);
}
@Test
public void copyOfImmutableNetwork_optimized() {
Reported by PMD.
Line: 40
assertThat(immutableNetwork).isEqualTo(mutableNetwork);
mutableNetwork.addNode("B");
assertThat(immutableNetwork).isNotEqualTo(mutableNetwork);
}
@Test
public void copyOfImmutableNetwork_optimized() {
Network<String, String> network1 =
Reported by PMD.
Line: 46
@Test
public void copyOfImmutableNetwork_optimized() {
Network<String, String> network1 =
ImmutableNetwork.copyOf(NetworkBuilder.directed().<String, String>build());
Network<String, String> network2 = ImmutableNetwork.copyOf(network1);
assertThat(network2).isSameInstanceAs(network1);
}
Reported by PMD.
guava-tests/benchmark/com/google/common/util/concurrent/MonitorBasedArrayBlockingQueue.java
83 issues
Line: 198
this(capacity, fair);
if (capacity < c.size()) throw new IllegalArgumentException();
for (E e : c) add(e);
}
@SuppressWarnings("unchecked") // please don't try this home, kids
private static <E> E[] newEArray(int capacity) {
return (E[]) new Object[capacity];
Reported by PMD.
Line: 231
*/
@Override
public boolean offer(E e) {
if (e == null) throw new NullPointerException();
final Monitor monitor = this.monitor;
if (monitor.enterIf(notFull)) {
try {
insert(e);
return true;
Reported by PMD.
Line: 255
@Override
public boolean offer(E e, long timeout, TimeUnit unit) throws InterruptedException {
if (e == null) throw new NullPointerException();
final Monitor monitor = this.monitor;
if (monitor.enterWhen(notFull, timeout, unit)) {
try {
insert(e);
return true;
Reported by PMD.
Line: 278
*/
@Override
public void put(E e) throws InterruptedException {
if (e == null) throw new NullPointerException();
final Monitor monitor = this.monitor;
monitor.enterWhen(notFull);
try {
insert(e);
} finally {
Reported by PMD.
Line: 568
*/
@Override
public int drainTo(Collection<? super E> c) {
if (c == null) throw new NullPointerException();
if (c == this) throw new IllegalArgumentException();
final E[] items = this.items;
final Monitor monitor = this.monitor;
monitor.enter();
try {
Reported by PMD.
Line: 602
*/
@Override
public int drainTo(Collection<? super E> c, int maxElements) {
if (c == null) throw new NullPointerException();
if (c == this) throw new IllegalArgumentException();
if (maxElements <= 0) return 0;
final E[] items = this.items;
final Monitor monitor = this.monitor;
monitor.enter();
Reported by PMD.
Line: 87
// Internal helper methods
/** Circularly increment i. */
final int inc(int i) {
return (++i == items.length) ? 0 : i;
}
/**
* Inserts element at current put position, advances, and signals. Call only when occupying
Reported by PMD.
Line: 118
* Utility for remove and iterator.remove: Delete item at position i. Call only when occupying
* monitor.
*/
void removeAt(int i) {
final E[] items = this.items;
// if removing front item, just advance
if (i == takeIndex) {
items[takeIndex] = null;
takeIndex = inc(takeIndex);
Reported by PMD.
Line: 499
* @throws NullPointerException if the specified array is null
*/
@Override
public <T> T[] toArray(T[] a) {
final E[] items = this.items;
final Monitor monitor = this.monitor;
monitor.enter();
try {
if (a.length < count) a = ObjectArrays.newArray(a, count);
Reported by PMD.
Line: 56
*/
@CanIgnoreReturnValue
public class MonitorBasedArrayBlockingQueue<E> extends AbstractQueue<E>
implements BlockingQueue<E> {
// Based on revision 1.58 of ArrayBlockingQueue by Doug Lea, from
// http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/main/java/util/concurrent/
/** The queued items */
Reported by PMD.
android/guava-testlib/test/com/google/common/testing/EqualsTesterTest.java
83 issues
Line: 34
*/
@GwtCompatible
@SuppressWarnings("MissingTestCall")
public class EqualsTesterTest extends TestCase {
private ValidTestObject reference;
private EqualsTester equalsTester;
private ValidTestObject equalObject1;
private ValidTestObject equalObject2;
private ValidTestObject notEqualObject1;
Reported by PMD.
Line: 35
@GwtCompatible
@SuppressWarnings("MissingTestCall")
public class EqualsTesterTest extends TestCase {
private ValidTestObject reference;
private EqualsTester equalsTester;
private ValidTestObject equalObject1;
private ValidTestObject equalObject2;
private ValidTestObject notEqualObject1;
Reported by PMD.
Line: 36
@SuppressWarnings("MissingTestCall")
public class EqualsTesterTest extends TestCase {
private ValidTestObject reference;
private EqualsTester equalsTester;
private ValidTestObject equalObject1;
private ValidTestObject equalObject2;
private ValidTestObject notEqualObject1;
@Override
Reported by PMD.
Line: 37
public class EqualsTesterTest extends TestCase {
private ValidTestObject reference;
private EqualsTester equalsTester;
private ValidTestObject equalObject1;
private ValidTestObject equalObject2;
private ValidTestObject notEqualObject1;
@Override
public void setUp() throws Exception {
Reported by PMD.
Line: 38
private ValidTestObject reference;
private EqualsTester equalsTester;
private ValidTestObject equalObject1;
private ValidTestObject equalObject2;
private ValidTestObject notEqualObject1;
@Override
public void setUp() throws Exception {
super.setUp();
Reported by PMD.
Line: 39
private EqualsTester equalsTester;
private ValidTestObject equalObject1;
private ValidTestObject equalObject2;
private ValidTestObject notEqualObject1;
@Override
public void setUp() throws Exception {
super.setUp();
reference = new ValidTestObject(1, 2);
Reported by PMD.
Line: 41
private ValidTestObject equalObject2;
private ValidTestObject notEqualObject1;
@Override
public void setUp() throws Exception {
super.setUp();
reference = new ValidTestObject(1, 2);
equalsTester = new EqualsTester();
equalObject1 = new ValidTestObject(1, 2);
Reported by PMD.
Line: 52
}
/** Test null reference yields error */
public void testAddNullReference() {
try {
equalsTester.addEqualityGroup((Object) null);
fail("Should fail on null reference");
} catch (NullPointerException e) {
}
Reported by PMD.
Line: 55
public void testAddNullReference() {
try {
equalsTester.addEqualityGroup((Object) null);
fail("Should fail on null reference");
} catch (NullPointerException e) {
}
}
/** Test equalObjects after adding multiple instances at once with a null */
Reported by PMD.
Line: 56
try {
equalsTester.addEqualityGroup((Object) null);
fail("Should fail on null reference");
} catch (NullPointerException e) {
}
}
/** Test equalObjects after adding multiple instances at once with a null */
public void testAddTwoEqualObjectsAtOnceWithNull() {
Reported by PMD.
guava-tests/benchmark/com/google/common/util/concurrent/ExecutionListBenchmark.java
83 issues
Line: 593
UNSAFE = getUnsafe();
HEAD_OFFSET = UNSAFE.objectFieldOffset(ExecutionListCAS.class.getDeclaredField("head"));
} catch (Exception ex) {
throw new Error(ex);
}
}
/** TODO(lukes): This was copied verbatim from Striped64.java... standardize this? */
private static sun.misc.Unsafe getUnsafe() {
Reported by PMD.
Line: 618
}
});
} catch (java.security.PrivilegedActionException e) {
throw new RuntimeException("Could not initialize intrinsics", e.getCause());
}
}
private volatile RunnableExecutorPair head = NULL_PAIR;
Reported by PMD.
Line: 426
try {
executor.execute(runnable);
} catch (RuntimeException e) {
log.log(
Level.SEVERE,
"RuntimeException while executing runnable "
+ runnable
+ " with executor "
+ executor,
Reported by PMD.
Line: 481
try {
executor.execute(runnable);
} catch (RuntimeException e) {
log.log(
Level.SEVERE,
"RuntimeException while executing runnable " + runnable + " with executor " + executor,
e);
}
}
Reported by PMD.
Line: 556
try {
executor.execute(runnable);
} catch (RuntimeException e) {
log.log(
Level.SEVERE,
"RuntimeException while executing runnable " + runnable + " with executor " + executor,
e);
}
}
Reported by PMD.
Line: 683
try {
executor.execute(runnable);
} catch (RuntimeException e) {
log.log(
Level.SEVERE,
"RuntimeException while executing runnable "
+ runnable
+ " with executor "
+ executor,
Reported by PMD.
Line: 225
abstract ExecutionListWrapper newExecutionList();
}
private ThreadPoolExecutor executorService;
private CountDownLatch listenerLatch;
private ExecutionListWrapper list;
@Param Impl impl;
Reported by PMD.
Line: 226
}
private ThreadPoolExecutor executorService;
private CountDownLatch listenerLatch;
private ExecutionListWrapper list;
@Param Impl impl;
@Param({"1", "5", "10"})
Reported by PMD.
Line: 227
private ThreadPoolExecutor executorService;
private CountDownLatch listenerLatch;
private ExecutionListWrapper list;
@Param Impl impl;
@Param({"1", "5", "10"})
int numListeners;
Reported by PMD.
Line: 229
private CountDownLatch listenerLatch;
private ExecutionListWrapper list;
@Param Impl impl;
@Param({"1", "5", "10"})
int numListeners;
private final Runnable listener =
Reported by PMD.
android/guava-tests/benchmark/com/google/common/util/concurrent/MonitorBasedArrayBlockingQueue.java
83 issues
Line: 198
this(capacity, fair);
if (capacity < c.size()) throw new IllegalArgumentException();
for (E e : c) add(e);
}
@SuppressWarnings("unchecked") // please don't try this home, kids
private static <E> E[] newEArray(int capacity) {
return (E[]) new Object[capacity];
Reported by PMD.
Line: 231
*/
@Override
public boolean offer(E e) {
if (e == null) throw new NullPointerException();
final Monitor monitor = this.monitor;
if (monitor.enterIf(notFull)) {
try {
insert(e);
return true;
Reported by PMD.
Line: 255
@Override
public boolean offer(E e, long timeout, TimeUnit unit) throws InterruptedException {
if (e == null) throw new NullPointerException();
final Monitor monitor = this.monitor;
if (monitor.enterWhen(notFull, timeout, unit)) {
try {
insert(e);
return true;
Reported by PMD.
Line: 278
*/
@Override
public void put(E e) throws InterruptedException {
if (e == null) throw new NullPointerException();
final Monitor monitor = this.monitor;
monitor.enterWhen(notFull);
try {
insert(e);
} finally {
Reported by PMD.
Line: 568
*/
@Override
public int drainTo(Collection<? super E> c) {
if (c == null) throw new NullPointerException();
if (c == this) throw new IllegalArgumentException();
final E[] items = this.items;
final Monitor monitor = this.monitor;
monitor.enter();
try {
Reported by PMD.
Line: 602
*/
@Override
public int drainTo(Collection<? super E> c, int maxElements) {
if (c == null) throw new NullPointerException();
if (c == this) throw new IllegalArgumentException();
if (maxElements <= 0) return 0;
final E[] items = this.items;
final Monitor monitor = this.monitor;
monitor.enter();
Reported by PMD.
Line: 87
// Internal helper methods
/** Circularly increment i. */
final int inc(int i) {
return (++i == items.length) ? 0 : i;
}
/**
* Inserts element at current put position, advances, and signals. Call only when occupying
Reported by PMD.
Line: 118
* Utility for remove and iterator.remove: Delete item at position i. Call only when occupying
* monitor.
*/
void removeAt(int i) {
final E[] items = this.items;
// if removing front item, just advance
if (i == takeIndex) {
items[takeIndex] = null;
takeIndex = inc(takeIndex);
Reported by PMD.
Line: 499
* @throws NullPointerException if the specified array is null
*/
@Override
public <T> T[] toArray(T[] a) {
final E[] items = this.items;
final Monitor monitor = this.monitor;
monitor.enter();
try {
if (a.length < count) a = ObjectArrays.newArray(a, count);
Reported by PMD.
Line: 56
*/
@CanIgnoreReturnValue
public class MonitorBasedArrayBlockingQueue<E> extends AbstractQueue<E>
implements BlockingQueue<E> {
// Based on revision 1.58 of ArrayBlockingQueue by Doug Lea, from
// http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/main/java/util/concurrent/
/** The queued items */
Reported by PMD.
android/guava-tests/benchmark/com/google/common/util/concurrent/ExecutionListBenchmark.java
83 issues
Line: 593
UNSAFE = getUnsafe();
HEAD_OFFSET = UNSAFE.objectFieldOffset(ExecutionListCAS.class.getDeclaredField("head"));
} catch (Exception ex) {
throw new Error(ex);
}
}
/** TODO(lukes): This was copied verbatim from Striped64.java... standardize this? */
private static sun.misc.Unsafe getUnsafe() {
Reported by PMD.
Line: 618
}
});
} catch (java.security.PrivilegedActionException e) {
throw new RuntimeException("Could not initialize intrinsics", e.getCause());
}
}
private volatile RunnableExecutorPair head = NULL_PAIR;
Reported by PMD.
Line: 426
try {
executor.execute(runnable);
} catch (RuntimeException e) {
log.log(
Level.SEVERE,
"RuntimeException while executing runnable "
+ runnable
+ " with executor "
+ executor,
Reported by PMD.
Line: 481
try {
executor.execute(runnable);
} catch (RuntimeException e) {
log.log(
Level.SEVERE,
"RuntimeException while executing runnable " + runnable + " with executor " + executor,
e);
}
}
Reported by PMD.
Line: 556
try {
executor.execute(runnable);
} catch (RuntimeException e) {
log.log(
Level.SEVERE,
"RuntimeException while executing runnable " + runnable + " with executor " + executor,
e);
}
}
Reported by PMD.
Line: 683
try {
executor.execute(runnable);
} catch (RuntimeException e) {
log.log(
Level.SEVERE,
"RuntimeException while executing runnable "
+ runnable
+ " with executor "
+ executor,
Reported by PMD.
Line: 225
abstract ExecutionListWrapper newExecutionList();
}
private ThreadPoolExecutor executorService;
private CountDownLatch listenerLatch;
private ExecutionListWrapper list;
@Param Impl impl;
Reported by PMD.
Line: 226
}
private ThreadPoolExecutor executorService;
private CountDownLatch listenerLatch;
private ExecutionListWrapper list;
@Param Impl impl;
@Param({"1", "5", "10"})
Reported by PMD.
Line: 227
private ThreadPoolExecutor executorService;
private CountDownLatch listenerLatch;
private ExecutionListWrapper list;
@Param Impl impl;
@Param({"1", "5", "10"})
int numListeners;
Reported by PMD.
Line: 229
private CountDownLatch listenerLatch;
private ExecutionListWrapper list;
@Param Impl impl;
@Param({"1", "5", "10"})
int numListeners;
private final Runnable listener =
Reported by PMD.
guava-testlib/test/com/google/common/testing/EqualsTesterTest.java
83 issues
Line: 34
*/
@GwtCompatible
@SuppressWarnings("MissingTestCall")
public class EqualsTesterTest extends TestCase {
private ValidTestObject reference;
private EqualsTester equalsTester;
private ValidTestObject equalObject1;
private ValidTestObject equalObject2;
private ValidTestObject notEqualObject1;
Reported by PMD.
Line: 35
@GwtCompatible
@SuppressWarnings("MissingTestCall")
public class EqualsTesterTest extends TestCase {
private ValidTestObject reference;
private EqualsTester equalsTester;
private ValidTestObject equalObject1;
private ValidTestObject equalObject2;
private ValidTestObject notEqualObject1;
Reported by PMD.
Line: 36
@SuppressWarnings("MissingTestCall")
public class EqualsTesterTest extends TestCase {
private ValidTestObject reference;
private EqualsTester equalsTester;
private ValidTestObject equalObject1;
private ValidTestObject equalObject2;
private ValidTestObject notEqualObject1;
@Override
Reported by PMD.
Line: 37
public class EqualsTesterTest extends TestCase {
private ValidTestObject reference;
private EqualsTester equalsTester;
private ValidTestObject equalObject1;
private ValidTestObject equalObject2;
private ValidTestObject notEqualObject1;
@Override
public void setUp() throws Exception {
Reported by PMD.
Line: 38
private ValidTestObject reference;
private EqualsTester equalsTester;
private ValidTestObject equalObject1;
private ValidTestObject equalObject2;
private ValidTestObject notEqualObject1;
@Override
public void setUp() throws Exception {
super.setUp();
Reported by PMD.
Line: 39
private EqualsTester equalsTester;
private ValidTestObject equalObject1;
private ValidTestObject equalObject2;
private ValidTestObject notEqualObject1;
@Override
public void setUp() throws Exception {
super.setUp();
reference = new ValidTestObject(1, 2);
Reported by PMD.
Line: 41
private ValidTestObject equalObject2;
private ValidTestObject notEqualObject1;
@Override
public void setUp() throws Exception {
super.setUp();
reference = new ValidTestObject(1, 2);
equalsTester = new EqualsTester();
equalObject1 = new ValidTestObject(1, 2);
Reported by PMD.
Line: 52
}
/** Test null reference yields error */
public void testAddNullReference() {
try {
equalsTester.addEqualityGroup((Object) null);
fail("Should fail on null reference");
} catch (NullPointerException e) {
}
Reported by PMD.
Line: 55
public void testAddNullReference() {
try {
equalsTester.addEqualityGroup((Object) null);
fail("Should fail on null reference");
} catch (NullPointerException e) {
}
}
/** Test equalObjects after adding multiple instances at once with a null */
Reported by PMD.
Line: 56
try {
equalsTester.addEqualityGroup((Object) null);
fail("Should fail on null reference");
} catch (NullPointerException e) {
}
}
/** Test equalObjects after adding multiple instances at once with a null */
public void testAddTwoEqualObjectsAtOnceWithNull() {
Reported by PMD.
android/guava-tests/test/com/google/common/util/concurrent/TrustedListenableFutureTaskTest.java
82 issues
Line: 216
try {
barrier.await();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
Reported by PMD.
Line: 41
@GwtCompatible(emulated = true)
public class TrustedListenableFutureTaskTest extends TestCase {
public void testSuccessful() throws Exception {
TrustedListenableFutureTask<Integer> task = TrustedListenableFutureTask.create(returning(2));
assertFalse(task.isDone());
task.run();
assertTrue(task.isDone());
assertFalse(task.isCancelled());
Reported by PMD.
Line: 41
@GwtCompatible(emulated = true)
public class TrustedListenableFutureTaskTest extends TestCase {
public void testSuccessful() throws Exception {
TrustedListenableFutureTask<Integer> task = TrustedListenableFutureTask.create(returning(2));
assertFalse(task.isDone());
task.run();
assertTrue(task.isDone());
assertFalse(task.isCancelled());
Reported by PMD.
Line: 43
public void testSuccessful() throws Exception {
TrustedListenableFutureTask<Integer> task = TrustedListenableFutureTask.create(returning(2));
assertFalse(task.isDone());
task.run();
assertTrue(task.isDone());
assertFalse(task.isCancelled());
assertEquals(2, getDone(task).intValue());
}
Reported by PMD.
Line: 43
public void testSuccessful() throws Exception {
TrustedListenableFutureTask<Integer> task = TrustedListenableFutureTask.create(returning(2));
assertFalse(task.isDone());
task.run();
assertTrue(task.isDone());
assertFalse(task.isCancelled());
assertEquals(2, getDone(task).intValue());
}
Reported by PMD.
Line: 44
public void testSuccessful() throws Exception {
TrustedListenableFutureTask<Integer> task = TrustedListenableFutureTask.create(returning(2));
assertFalse(task.isDone());
task.run();
assertTrue(task.isDone());
assertFalse(task.isCancelled());
assertEquals(2, getDone(task).intValue());
}
Reported by PMD.
Line: 45
TrustedListenableFutureTask<Integer> task = TrustedListenableFutureTask.create(returning(2));
assertFalse(task.isDone());
task.run();
assertTrue(task.isDone());
assertFalse(task.isCancelled());
assertEquals(2, getDone(task).intValue());
}
public void testCancelled() throws Exception {
Reported by PMD.
Line: 45
TrustedListenableFutureTask<Integer> task = TrustedListenableFutureTask.create(returning(2));
assertFalse(task.isDone());
task.run();
assertTrue(task.isDone());
assertFalse(task.isCancelled());
assertEquals(2, getDone(task).intValue());
}
public void testCancelled() throws Exception {
Reported by PMD.
Line: 46
assertFalse(task.isDone());
task.run();
assertTrue(task.isDone());
assertFalse(task.isCancelled());
assertEquals(2, getDone(task).intValue());
}
public void testCancelled() throws Exception {
TrustedListenableFutureTask<Integer> task = TrustedListenableFutureTask.create(returning(2));
Reported by PMD.
Line: 46
assertFalse(task.isDone());
task.run();
assertTrue(task.isDone());
assertFalse(task.isCancelled());
assertEquals(2, getDone(task).intValue());
}
public void testCancelled() throws Exception {
TrustedListenableFutureTask<Integer> task = TrustedListenableFutureTask.create(returning(2));
Reported by PMD.