The following issues were found
guava-tests/test/com/google/common/collect/LegacyComparable.java
1 issues
Line: 40
static final Iterable<LegacyComparable> VALUES_FORWARD = Arrays.asList(X, Y, Z);
static final Iterable<LegacyComparable> VALUES_BACKWARD = Arrays.asList(Z, Y, X);
private final String value;
LegacyComparable(String value) {
this.value = value;
}
Reported by PMD.
guava-testlib/src/com/google/common/collect/testing/testers/CollectionSizeTester.java
1 issues
Line: 32
@GwtCompatible
@Ignore // Affects only Android test runner, which respects JUnit 4 annotations on JUnit 3 tests.
public class CollectionSizeTester<E> extends AbstractCollectionTester<E> {
public void testSize() {
assertEquals("size():", getNumElements(), collection.size());
}
}
Reported by PMD.
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.
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.
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.
guava-gwt/test-super/com/google/common/primitives/super/com/google/common/primitives/TestPlatform.java
1 issues
Line: 22
import com.google.common.annotations.GwtCompatible;
@GwtCompatible(emulated = true)
class TestPlatform {
static int reduceIterationsIfGwt(int iterations) {
return iterations / 10;
}
}
Reported by PMD.
android/guava/src/com/google/common/collect/LexicographicalOrdering.java
1 issues
Line: 31
@ElementTypesAreNonnullByDefault
final class LexicographicalOrdering<T extends @Nullable Object> extends Ordering<Iterable<T>>
implements Serializable {
final Comparator<? super T> elementOrder;
LexicographicalOrdering(Comparator<? super T> elementOrder) {
this.elementOrder = elementOrder;
}
Reported by PMD.
android/guava/src/com/google/common/collect/UsingToStringOrdering.java
1 issues
Line: 30
@Override
public int compare(Object left, Object right) {
return left.toString().compareTo(right.toString());
}
// preserve singleton-ness, so equals() and hashCode() work correctly
private Object readResolve() {
return INSTANCE;
Reported by PMD.
guava-testlib/src/com/google/common/collect/testing/AbstractCollectionTestSuiteBuilder.java
1 issues
Line: 17
* limitations under the License.
*/
package com.google.common.collect.testing;
import com.google.common.annotations.GwtIncompatible;
import com.google.common.collect.testing.testers.CollectionAddAllTester;
import com.google.common.collect.testing.testers.CollectionAddTester;
import com.google.common.collect.testing.testers.CollectionClearTester;
Reported by PMD.
android/guava/src/com/google/common/eventbus/SubscriberExceptionContext.java
1 issues
Line: 27
* @since 16.0
*/
@ElementTypesAreNonnullByDefault
public class SubscriberExceptionContext {
private final EventBus eventBus;
private final Object event;
private final Object subscriber;
private final Method subscriberMethod;
Reported by PMD.