diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/JUnitMethodDeclarationCheck.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/JUnitMethodDeclarationCheck.java index b85bae0314..a3ba086c53 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/JUnitMethodDeclarationCheck.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/JUnitMethodDeclarationCheck.java @@ -40,7 +40,7 @@ /** A {@link BugChecker} which flags non-canonical JUnit method declarations. */ // XXX: Consider introducing a class-level check which enforces that test classes: // 1. Are named `*Test` or `Abstract*TestCase`. -// 2. If not `abstract`, don't have public methods and subclasses. +// 2. If not `abstract`, are package-private and don't have public methods and subclasses. // 3. Only have private fields. // XXX: If implemented, the current logic could flag only `private` JUnit methods. @AutoService(BugChecker.class) diff --git a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/AnnotationAttributeMatcherTest.java b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/AnnotationAttributeMatcherTest.java index fbd2cef581..46b4c52bd6 100644 --- a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/AnnotationAttributeMatcherTest.java +++ b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/AnnotationAttributeMatcherTest.java @@ -6,7 +6,7 @@ import java.util.Optional; import org.junit.jupiter.api.Test; -public final class AnnotationAttributeMatcherTest { +final class AnnotationAttributeMatcherTest { @Test void withoutListings() { AnnotationAttributeMatcher matcher = diff --git a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/AutowiredConstructorCheckTest.java b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/AutowiredConstructorCheckTest.java index 7943abb8bd..78b1a56a53 100644 --- a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/AutowiredConstructorCheckTest.java +++ b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/AutowiredConstructorCheckTest.java @@ -5,7 +5,7 @@ import com.google.errorprone.CompilationTestHelper; import org.junit.jupiter.api.Test; -public final class AutowiredConstructorCheckTest { +final class AutowiredConstructorCheckTest { private final CompilationTestHelper compilationTestHelper = CompilationTestHelper.newInstance(AutowiredConstructorCheck.class, getClass()); private final BugCheckerRefactoringTestHelper refactoringTestHelper = diff --git a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/CanonicalAnnotationSyntaxCheckTest.java b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/CanonicalAnnotationSyntaxCheckTest.java index 5a31aa5ad1..18bd06182d 100644 --- a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/CanonicalAnnotationSyntaxCheckTest.java +++ b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/CanonicalAnnotationSyntaxCheckTest.java @@ -5,7 +5,7 @@ import com.google.errorprone.CompilationTestHelper; import org.junit.jupiter.api.Test; -public final class CanonicalAnnotationSyntaxCheckTest { +final class CanonicalAnnotationSyntaxCheckTest { private final CompilationTestHelper compilationTestHelper = CompilationTestHelper.newInstance(CanonicalAnnotationSyntaxCheck.class, getClass()); private final BugCheckerRefactoringTestHelper refactoringTestHelper = diff --git a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/EmptyMethodCheckTest.java b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/EmptyMethodCheckTest.java index 75956cd4a6..f206423db5 100644 --- a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/EmptyMethodCheckTest.java +++ b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/EmptyMethodCheckTest.java @@ -5,7 +5,7 @@ import com.google.errorprone.CompilationTestHelper; import org.junit.jupiter.api.Test; -public final class EmptyMethodCheckTest { +final class EmptyMethodCheckTest { private final CompilationTestHelper compilationTestHelper = CompilationTestHelper.newInstance(EmptyMethodCheck.class, getClass()); private final BugCheckerRefactoringTestHelper refactoringTestHelper = diff --git a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/FormatStringConcatenationCheckTest.java b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/FormatStringConcatenationCheckTest.java index 7ca9d88070..68c6e0adea 100644 --- a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/FormatStringConcatenationCheckTest.java +++ b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/FormatStringConcatenationCheckTest.java @@ -5,7 +5,7 @@ import com.google.errorprone.CompilationTestHelper; import org.junit.jupiter.api.Test; -public final class FormatStringConcatenationCheckTest { +final class FormatStringConcatenationCheckTest { private final CompilationTestHelper compilationTestHelper = CompilationTestHelper.newInstance(FormatStringConcatenationCheck.class, getClass()); private final BugCheckerRefactoringTestHelper refactoringTestHelper = diff --git a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/LexicographicalAnnotationAttributeListingCheckTest.java b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/LexicographicalAnnotationAttributeListingCheckTest.java index fdc54c811a..4b3bc78381 100644 --- a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/LexicographicalAnnotationAttributeListingCheckTest.java +++ b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/LexicographicalAnnotationAttributeListingCheckTest.java @@ -6,7 +6,7 @@ import com.google.errorprone.CompilationTestHelper; import org.junit.jupiter.api.Test; -public final class LexicographicalAnnotationAttributeListingCheckTest { +final class LexicographicalAnnotationAttributeListingCheckTest { private final CompilationTestHelper compilationTestHelper = CompilationTestHelper.newInstance( LexicographicalAnnotationAttributeListingCheck.class, getClass()); diff --git a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/LexicographicalAnnotationListingCheckTest.java b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/LexicographicalAnnotationListingCheckTest.java index 0b03ee6f07..e251863eb5 100644 --- a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/LexicographicalAnnotationListingCheckTest.java +++ b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/LexicographicalAnnotationListingCheckTest.java @@ -7,7 +7,7 @@ import com.google.errorprone.CompilationTestHelper; import org.junit.jupiter.api.Test; -public final class LexicographicalAnnotationListingCheckTest { +final class LexicographicalAnnotationListingCheckTest { private final CompilationTestHelper compilationTestHelper = CompilationTestHelper.newInstance(LexicographicalAnnotationListingCheck.class, getClass()) .expectErrorMessage( diff --git a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/MethodMatcherFactoryTest.java b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/MethodMatcherFactoryTest.java index 5ef8f3347d..2c16a5db21 100644 --- a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/MethodMatcherFactoryTest.java +++ b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/MethodMatcherFactoryTest.java @@ -15,7 +15,7 @@ import com.sun.source.tree.MethodInvocationTree; import org.junit.jupiter.api.Test; -public final class MethodMatcherFactoryTest { +final class MethodMatcherFactoryTest { /** A {@link BugChecker} which flags method invocations matched by {@link #TEST_MATCHER}. */ @BugPattern( name = "MatchedMethodsFlagger", diff --git a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/MethodReferenceUsageCheckTest.java b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/MethodReferenceUsageCheckTest.java index 0fd50ad7aa..ede6dbe706 100644 --- a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/MethodReferenceUsageCheckTest.java +++ b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/MethodReferenceUsageCheckTest.java @@ -5,7 +5,7 @@ import com.google.errorprone.CompilationTestHelper; import org.junit.jupiter.api.Test; -public final class MethodReferenceUsageCheckTest { +final class MethodReferenceUsageCheckTest { private final CompilationTestHelper compilationTestHelper = CompilationTestHelper.newInstance(MethodReferenceUsageCheck.class, getClass()); private final BugCheckerRefactoringTestHelper refactoringTestHelper = diff --git a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/MissingRefasterAnnotationCheckTest.java b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/MissingRefasterAnnotationCheckTest.java index 5ef92360f1..ed429e9ecf 100644 --- a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/MissingRefasterAnnotationCheckTest.java +++ b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/MissingRefasterAnnotationCheckTest.java @@ -5,7 +5,7 @@ import com.google.errorprone.CompilationTestHelper; import org.junit.jupiter.api.Test; -public final class MissingRefasterAnnotationCheckTest { +final class MissingRefasterAnnotationCheckTest { private final CompilationTestHelper compilationTestHelper = CompilationTestHelper.newInstance(MissingRefasterAnnotationCheck.class, getClass()) .expectErrorMessage( diff --git a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/MockitoStubbingCheckTest.java b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/MockitoStubbingCheckTest.java index 81a5d8854e..0525d30c7d 100644 --- a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/MockitoStubbingCheckTest.java +++ b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/MockitoStubbingCheckTest.java @@ -5,7 +5,7 @@ import com.google.errorprone.CompilationTestHelper; import org.junit.jupiter.api.Test; -public final class MockitoStubbingCheckTest { +final class MockitoStubbingCheckTest { private final CompilationTestHelper compilationTestHelper = CompilationTestHelper.newInstance(MockitoStubbingCheck.class, getClass()); private final BugCheckerRefactoringTestHelper refactoringTestHelper = diff --git a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/PrimitiveComparisonCheckTest.java b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/PrimitiveComparisonCheckTest.java index 90e9cf9727..d49772a741 100644 --- a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/PrimitiveComparisonCheckTest.java +++ b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/PrimitiveComparisonCheckTest.java @@ -5,7 +5,7 @@ import com.google.errorprone.CompilationTestHelper; import org.junit.jupiter.api.Test; -public final class PrimitiveComparisonCheckTest { +final class PrimitiveComparisonCheckTest { private final CompilationTestHelper compilationTestHelper = CompilationTestHelper.newInstance(PrimitiveComparisonCheck.class, getClass()); private final BugCheckerRefactoringTestHelper refactoringTestHelper = diff --git a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/RedundantStringConversionCheckTest.java b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/RedundantStringConversionCheckTest.java index 386f614004..3f4bf00db3 100644 --- a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/RedundantStringConversionCheckTest.java +++ b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/RedundantStringConversionCheckTest.java @@ -9,7 +9,7 @@ // XXX: The tests below show that `String.valueOf((String) null)` may be simplified, but // `String.valueOf(null)` may not. That is because the latter matches `String#valueOf(char[])`. We // could special-case `null` arguments, but that doesn't seem worth the trouble. -public final class RedundantStringConversionCheckTest { +final class RedundantStringConversionCheckTest { private final CompilationTestHelper compilationTestHelper = CompilationTestHelper.newInstance(RedundantStringConversionCheck.class, getClass()); private final CompilationTestHelper customizedCompilationTestHelper = diff --git a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/RefasterAnyOfUsageCheckTest.java b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/RefasterAnyOfUsageCheckTest.java index 1ac693e444..f48d3afb20 100644 --- a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/RefasterAnyOfUsageCheckTest.java +++ b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/RefasterAnyOfUsageCheckTest.java @@ -5,7 +5,7 @@ import com.google.errorprone.CompilationTestHelper; import org.junit.jupiter.api.Test; -public final class RefasterAnyOfUsageCheckTest { +final class RefasterAnyOfUsageCheckTest { private final CompilationTestHelper compilationTestHelper = CompilationTestHelper.newInstance(RefasterAnyOfUsageCheck.class, getClass()); private final BugCheckerRefactoringTestHelper refactoringTestHelper = diff --git a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/RefasterCheckTest.java b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/RefasterCheckTest.java index e88218f011..9f4686e4cc 100644 --- a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/RefasterCheckTest.java +++ b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/RefasterCheckTest.java @@ -19,7 +19,7 @@ import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; -public final class RefasterCheckTest { +final class RefasterCheckTest { /** The names of all Refaster template groups defined in this module. */ private static final ImmutableSet TEMPLATE_GROUPS = ImmutableSet.of( diff --git a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/ScheduledTransactionTraceCheckTest.java b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/ScheduledTransactionTraceCheckTest.java index e56f831d80..7446fad733 100644 --- a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/ScheduledTransactionTraceCheckTest.java +++ b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/ScheduledTransactionTraceCheckTest.java @@ -7,7 +7,7 @@ import org.junit.jupiter.api.condition.DisabledForJreRange; import org.junit.jupiter.api.condition.JRE; -public final class ScheduledTransactionTraceCheckTest { +final class ScheduledTransactionTraceCheckTest { private final CompilationTestHelper compilationTestHelper = CompilationTestHelper.newInstance(ScheduledTransactionTraceCheck.class, getClass()); private final BugCheckerRefactoringTestHelper refactoringTestHelper = diff --git a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/Slf4jLogStatementCheckTest.java b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/Slf4jLogStatementCheckTest.java index 762244f472..3a56d70ee9 100644 --- a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/Slf4jLogStatementCheckTest.java +++ b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/Slf4jLogStatementCheckTest.java @@ -5,7 +5,7 @@ import com.google.errorprone.CompilationTestHelper; import org.junit.jupiter.api.Test; -public final class Slf4jLogStatementCheckTest { +final class Slf4jLogStatementCheckTest { private final CompilationTestHelper compilationTestHelper = CompilationTestHelper.newInstance(Slf4jLogStatementCheck.class, getClass()); private final BugCheckerRefactoringTestHelper refactoringTestHelper = diff --git a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/SpringMvcAnnotationCheckTest.java b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/SpringMvcAnnotationCheckTest.java index 76fae4bf8e..842e08e556 100644 --- a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/SpringMvcAnnotationCheckTest.java +++ b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/SpringMvcAnnotationCheckTest.java @@ -5,7 +5,7 @@ import com.google.errorprone.CompilationTestHelper; import org.junit.jupiter.api.Test; -public final class SpringMvcAnnotationCheckTest { +final class SpringMvcAnnotationCheckTest { private final CompilationTestHelper compilationTestHelper = CompilationTestHelper.newInstance(SpringMvcAnnotationCheck.class, getClass()); private final BugCheckerRefactoringTestHelper refactoringTestHelper = diff --git a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/StaticImportCheckTest.java b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/StaticImportCheckTest.java index 6379d5e3c9..398242a2a1 100644 --- a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/StaticImportCheckTest.java +++ b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/StaticImportCheckTest.java @@ -7,7 +7,7 @@ import com.google.errorprone.CompilationTestHelper; import org.junit.jupiter.api.Test; -public final class StaticImportCheckTest { +final class StaticImportCheckTest { private final CompilationTestHelper compilationTestHelper = CompilationTestHelper.newInstance(StaticImportCheck.class, getClass()); private final BugCheckerRefactoringTestHelper refactoringTestHelper = diff --git a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/TimeZoneUsageCheckTest.java b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/TimeZoneUsageCheckTest.java index 170dfc1fc3..64f08ccbcf 100644 --- a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/TimeZoneUsageCheckTest.java +++ b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/TimeZoneUsageCheckTest.java @@ -5,7 +5,7 @@ import com.google.errorprone.CompilationTestHelper; import org.junit.jupiter.api.Test; -public final class TimeZoneUsageCheckTest { +final class TimeZoneUsageCheckTest { private final CompilationTestHelper compilationHelper = CompilationTestHelper.newInstance(TimeZoneUsageCheck.class, getClass()) .expectErrorMessage(