The following issues were found
android/guava-tests/benchmark/com/google/common/base/StopwatchBenchmark.java
1 issues
Line: 35
for (int i = 0; i < reps; i++) {
Stopwatch s = Stopwatch.createStarted();
// here is where you would do something
total += s.elapsed(TimeUnit.NANOSECONDS);
}
return total;
}
@Benchmark
Reported by PMD.
android/guava-testlib/src/com/google/common/collect/testing/ConcurrentNavigableMapTestSuiteBuilder.java
1 issues
Line: 43
@Override
protected List<Class<? extends AbstractTester>> getTesters() {
List<Class<? extends AbstractTester>> testers = Helpers.copyToList(super.getTesters());
testers.addAll(ConcurrentMapTestSuiteBuilder.TESTERS);
return testers;
}
@Override
NavigableMapTestSuiteBuilder<K, V> subSuiteUsing(TestSortedMapGenerator<K, V> generator) {
Reported by PMD.
android/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.
android/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.
android/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.
android/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.
android/guava-tests/test/com/google/common/io/SourceSinkFactory.java
1 issues
Line: 47
T getExpected(T data);
/** Cleans up anything created when creating the source or sink. */
public abstract void tearDown() throws IOException;
/** Factory for byte or char sources. */
public interface SourceFactory<S, T> extends SourceSinkFactory<S, T> {
/** Creates a new source containing some or all of the given data. */
Reported by PMD.
android/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(@NullableDecl LogRecord record) {
list.add(record);
Reported by PMD.
android/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.
android/guava-tests/test/com/google/common/io/TestCharSource.java
1 issues
Line: 32
*/
public class TestCharSource extends CharSource implements TestStreamSupplier {
private final TestByteSource byteSource;
public TestCharSource(String content, TestOption... options) {
this.byteSource = new TestByteSource(content.getBytes(UTF_8), options);
}
Reported by PMD.