The following issues were found

guava-tests/test/com/google/common/collect/LegacyComparable.java
1 issues
Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

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
JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

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
Potential violation of Law of Demeter (object not created locally)
Design

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
JUnit 4 tests that clean up tests should use the @After annotation, JUnit5 tests should use @AfterEach or @AfterAll
Design

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
Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

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
All methods are static. Consider using a utility class instead. Alternatively, you could add a private constructor or make the class abstract to silence this warning.
Design

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
Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

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
Potential violation of Law of Demeter (method chain calls)
Design

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
High amount of different objects as members denotes a high coupling
Design

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
The class 'SubscriberExceptionContext' is suspected to be a Data Class (WOC=0.000%, NOPA=0, NOAM=4, WMC=5)
Design

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.