The following issues were found
guava-testlib/src/com/google/common/collect/testing/testers/MapSerializationTester.java
1 issues
Line: 37
@GwtCompatible
@Ignore // Affects only Android test runner, which respects JUnit 4 annotations on JUnit 3 tests.
public class MapSerializationTester<K, V> extends AbstractMapTester<K, V> {
@CollectionFeature.Require(SERIALIZABLE)
public void testReserializeMap() {
Map<K, V> deserialized = SerializableTester.reserialize(getMap());
new EqualsTester().addEqualityGroup(getMap(), deserialized).testEquals();
}
}
Reported by PMD.
guava-testlib/test/com/google/common/collect/testing/OpenJdk6SetTests.java
1 issues
Line: 38
* @author Kevin Bourrillion
*/
public class OpenJdk6SetTests extends TestsForSetsInJavaUtil {
public static Test suite() {
return new OpenJdk6SetTests().allTests();
}
@Override
protected Collection<Method> suppressForTreeSetNatural() {
Reported by PMD.
guava-testlib/test/com/google/common/collect/testing/OpenJdk6ListTests.java
1 issues
Line: 38
* @author Kevin Bourrillion
*/
public class OpenJdk6ListTests extends TestsForListsInJavaUtil {
public static Test suite() {
return new OpenJdk6ListTests().allTests();
}
@Override
protected Collection<Method> suppressForArraysAsList() {
Reported by PMD.
guava-testlib/src/com/google/common/testing/TestLogHandler.java
1 issues
Line: 59
@GwtCompatible
public class TestLogHandler extends Handler {
/** We will keep a private list of all logged records */
private final List<LogRecord> list = new ArrayList<>();
/** Adds the most recently logged record to our list. */
@Override
public synchronized void publish(@Nullable LogRecord record) {
list.add(record);
Reported by PMD.
guava-tests/test/com/google/common/io/RandomAmountInputStream.java
1 issues
Line: 28
/** Returns a random portion of the requested bytes on each call. */
class RandomAmountInputStream extends FilterInputStream {
private final Random random;
public RandomAmountInputStream(InputStream in, Random random) {
super(checkNotNull(in));
this.random = checkNotNull(random);
}
Reported by PMD.
guava-testlib/test/com/google/common/collect/testing/OpenJdk6QueueTests.java
1 issues
Line: 35
* @author Kevin Bourrillion
*/
public class OpenJdk6QueueTests extends TestsForQueuesInJavaUtil {
public static Test suite() {
return new OpenJdk6QueueTests().allTests();
}
private static final List<Method> PQ_SUPPRESS =
Arrays.asList(getCreateWithNullUnsupportedMethod());
Reported by PMD.
guava-tests/test/com/google/common/io/TestCharSink.java
1 issues
Line: 33
*/
public class TestCharSink extends CharSink implements TestStreamSupplier {
private final TestByteSink byteSink;
public TestCharSink(TestOption... options) {
this.byteSink = new TestByteSink(options);
}
Reported by PMD.
guava-tests/test/com/google/common/math/MathTesting.java
1 issues
Line: 247
}
}
for (int i = Double.MIN_EXPONENT; i <= Double.MAX_EXPONENT; i++) {
for (int direction : new int[] {1, -1}) {
double d = Double.longBitsToDouble(Double.doubleToLongBits(Math.scalb(1.0, i)) + direction);
// Math.nextUp/nextDown
if (d != Math.rint(d)) {
fractionalBuilder.add(d);
}
Reported by PMD.
guava-testlib/src/com/google/common/testing/Platform.java
1 issues
Line: 46
ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(bytes.toByteArray()));
return (T) in.readObject();
} catch (IOException | ClassNotFoundException e) {
throw new RuntimeException(e);
}
}
private Platform() {}
}
Reported by PMD.
guava-testlib/src/com/google/common/testing/SerializableTester.java
1 issues
Line: 90
public static <T> T reserializeAndAssert(T object) {
T copy = reserialize(object);
new EqualsTester().addEqualityGroup(object, copy).testEquals();
Assert.assertEquals(object.getClass(), copy.getClass());
return copy;
}
}
Reported by PMD.