The following issues were found
guava-testlib/test/com/google/common/testing/RelationshipTesterTest.java
2 issues
Line: 29
*/
public class RelationshipTesterTest extends TestCase {
public void testNulls() {
new ClassSanityTester()
.setDefault(ItemReporter.class, new ItemReporter())
.testNulls(RelationshipTester.class);
}
}
Reported by PMD.
Line: 29
*/
public class RelationshipTesterTest extends TestCase {
public void testNulls() {
new ClassSanityTester()
.setDefault(ItemReporter.class, new ItemReporter())
.testNulls(RelationshipTester.class);
}
}
Reported by PMD.
guava-testlib/src/com/google/common/testing/FakeTicker.java
2 issues
Line: 43
@GwtCompatible
public class FakeTicker extends Ticker {
private final AtomicLong nanos = new AtomicLong();
private volatile long autoIncrementStepNanos;
/** Advances the ticker value by {@code time} in {@code timeUnit}. */
@SuppressWarnings("GoodTime") // should accept a java.time.Duration
public FakeTicker advance(long time, TimeUnit timeUnit) {
Reported by PMD.
Line: 44
public class FakeTicker extends Ticker {
private final AtomicLong nanos = new AtomicLong();
private volatile long autoIncrementStepNanos;
/** Advances the ticker value by {@code time} in {@code timeUnit}. */
@SuppressWarnings("GoodTime") // should accept a java.time.Duration
public FakeTicker advance(long time, TimeUnit timeUnit) {
return advance(timeUnit.toNanos(time));
Reported by PMD.
guava-tests/test/com/google/common/collect/UnmodifiableMultimapAsMapImplementsMapTest.java
2 issues
Line: 39
@Override
protected Map<String, Collection<Integer>> makeEmptyMap() {
return Multimaps.unmodifiableMultimap(LinkedHashMultimap.<String, Integer>create()).asMap();
}
@Override
protected Map<String, Collection<Integer>> makePopulatedMap() {
Multimap<String, Integer> delegate = LinkedHashMultimap.create();
Reported by PMD.
Line: 46
protected Map<String, Collection<Integer>> makePopulatedMap() {
Multimap<String, Integer> delegate = LinkedHashMultimap.create();
populate(delegate);
return Multimaps.unmodifiableMultimap(delegate).asMap();
}
}
Reported by PMD.
guava-tests/test/com/google/common/collect/ForwardingDequeTest.java
2 issues
Line: 31
*/
public class ForwardingDequeTest extends TestCase {
@SuppressWarnings("rawtypes")
public void testForwarding() {
new ForwardingWrapperTester()
.testForwarding(
Deque.class,
new Function<Deque, Deque>() {
Reported by PMD.
Line: 32
public class ForwardingDequeTest extends TestCase {
@SuppressWarnings("rawtypes")
public void testForwarding() {
new ForwardingWrapperTester()
.testForwarding(
Deque.class,
new Function<Deque, Deque>() {
@Override
Reported by PMD.
guava-tests/test/com/google/common/collect/ForwardingListIteratorTest.java
2 issues
Line: 31
*/
public class ForwardingListIteratorTest extends TestCase {
@SuppressWarnings("rawtypes")
public void testForwarding() {
new ForwardingWrapperTester()
.testForwarding(
ListIterator.class,
new Function<ListIterator, ListIterator>() {
Reported by PMD.
Line: 32
public class ForwardingListIteratorTest extends TestCase {
@SuppressWarnings("rawtypes")
public void testForwarding() {
new ForwardingWrapperTester()
.testForwarding(
ListIterator.class,
new Function<ListIterator, ListIterator>() {
@Override
Reported by PMD.
guava-testlib/src/com/google/common/testing/TearDown.java
2 issues
Line: 48
* @throws Exception for any reason. {@code TearDownTestCase} ensures that any exception thrown
* will not interfere with other TearDown operations.
*/
void tearDown() throws Exception;
}
Reported by PMD.
Line: 48
* @throws Exception for any reason. {@code TearDownTestCase} ensures that any exception thrown
* will not interfere with other TearDown operations.
*/
void tearDown() throws Exception;
}
Reported by PMD.
guava-tests/test/com/google/common/eventbus/StringCatcher.java
2 issues
Line: 33
* @author Cliff Biffle
*/
public class StringCatcher {
private List<String> events = Lists.newArrayList();
@Subscribe
public void hereHaveAString(@Nullable String string) {
events.add(string);
}
Reported by PMD.
Line: 33
* @author Cliff Biffle
*/
public class StringCatcher {
private List<String> events = Lists.newArrayList();
@Subscribe
public void hereHaveAString(@Nullable String string) {
events.add(string);
}
Reported by PMD.
guava-testlib/test/com/google/common/collect/testing/MinimalSetTest.java
2 issues
Line: 30
*
* @author Regina O'Dell
*/
public class MinimalSetTest extends TestCase {
public static Test suite() {
return SetTestSuiteBuilder.using(
new TestStringSetGenerator() {
@Override
protected Set<String> create(String[] elements) {
Reported by PMD.
Line: 31
* @author Regina O'Dell
*/
public class MinimalSetTest extends TestCase {
public static Test suite() {
return SetTestSuiteBuilder.using(
new TestStringSetGenerator() {
@Override
protected Set<String> create(String[] elements) {
return MinimalSet.of(elements);
Reported by PMD.
guava-tests/test/com/google/common/cache/RemovalNotificationTest.java
2 issues
Line: 29
*/
public class RemovalNotificationTest extends TestCase {
public void testEquals() {
new EqualsTester()
.addEqualityGroup(
RemovalNotification.create("one", 1, RemovalCause.EXPLICIT),
RemovalNotification.create("one", 1, RemovalCause.REPLACED))
.addEqualityGroup(RemovalNotification.create("1", 1, RemovalCause.EXPLICIT))
Reported by PMD.
Line: 29
*/
public class RemovalNotificationTest extends TestCase {
public void testEquals() {
new EqualsTester()
.addEqualityGroup(
RemovalNotification.create("one", 1, RemovalCause.EXPLICIT),
RemovalNotification.create("one", 1, RemovalCause.REPLACED))
.addEqualityGroup(RemovalNotification.create("1", 1, RemovalCause.EXPLICIT))
Reported by PMD.
guava-testlib/src/com/google/common/collect/testing/google/MultisetSetCountUnconditionallyTester.java
2 issues
Line: 35
void setCountCheckReturnValue(E element, int count) {
assertEquals(
"multiset.setCount() should return the old count",
getMultiset().count(element),
setCount(element, count));
}
@Override
void setCountNoCheckReturnValue(E element, int count) {
Reported by PMD.
Line: 45
}
private int setCount(E element, int count) {
return getMultiset().setCount(element, count);
}
}
Reported by PMD.