diff --git a/error-prone-contrib/pom.xml b/error-prone-contrib/pom.xml index 09d8167f22..a1fa4a0c89 100644 --- a/error-prone-contrib/pom.xml +++ b/error-prone-contrib/pom.xml @@ -48,6 +48,10 @@ `annotationProcessorPaths` configuration below. --> provided + + ${project.groupId} + error-prone-utils + ${project.groupId} refaster-support diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/AmbiguousJsonCreator.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/AmbiguousJsonCreator.java index 8eec308ef1..4bb8ea1bc6 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/AmbiguousJsonCreator.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/AmbiguousJsonCreator.java @@ -4,7 +4,7 @@ import static com.google.errorprone.BugPattern.SeverityLevel.WARNING; import static com.google.errorprone.BugPattern.StandardTags.LIKELY_ERROR; import static com.google.errorprone.matchers.Matchers.isType; -import static tech.picnic.errorprone.bugpatterns.util.Documentation.BUG_PATTERNS_BASE_URL; +import static tech.picnic.errorprone.utils.Documentation.BUG_PATTERNS_BASE_URL; import com.google.auto.service.AutoService; import com.google.errorprone.BugPattern; diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/AssertJIsNull.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/AssertJIsNull.java index b8381aa061..59aa2b57c6 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/AssertJIsNull.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/AssertJIsNull.java @@ -8,7 +8,7 @@ import static com.google.errorprone.matchers.Matchers.argumentCount; import static com.google.errorprone.matchers.Matchers.instanceMethod; import static com.google.errorprone.matchers.Matchers.nullLiteral; -import static tech.picnic.errorprone.bugpatterns.util.Documentation.BUG_PATTERNS_BASE_URL; +import static tech.picnic.errorprone.utils.Documentation.BUG_PATTERNS_BASE_URL; import com.google.auto.service.AutoService; import com.google.errorprone.BugPattern; diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/AssociativeMethodInvocation.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/AssociativeMethodInvocation.java index 1bcc8ec37e..cf10b84668 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/AssociativeMethodInvocation.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/AssociativeMethodInvocation.java @@ -7,7 +7,7 @@ import static com.google.errorprone.matchers.Matchers.not; import static com.google.errorprone.matchers.Matchers.staticMethod; import static com.google.errorprone.matchers.Matchers.toType; -import static tech.picnic.errorprone.bugpatterns.util.Documentation.BUG_PATTERNS_BASE_URL; +import static tech.picnic.errorprone.utils.Documentation.BUG_PATTERNS_BASE_URL; import com.google.auto.service.AutoService; import com.google.common.collect.ImmutableSet; @@ -27,7 +27,7 @@ import com.sun.source.tree.ExpressionTree; import com.sun.source.tree.MethodInvocationTree; import com.sun.tools.javac.code.Type; -import tech.picnic.errorprone.bugpatterns.util.SourceCode; +import tech.picnic.errorprone.utils.SourceCode; /** * A {@link BugChecker} that flags unnecessarily nested usage of methods that implement an diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/AutowiredConstructor.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/AutowiredConstructor.java index dc8e0b7322..927117858f 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/AutowiredConstructor.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/AutowiredConstructor.java @@ -6,7 +6,7 @@ import static com.google.errorprone.matchers.ChildMultiMatcher.MatchType.AT_LEAST_ONE; import static com.google.errorprone.matchers.Matchers.annotations; import static com.google.errorprone.matchers.Matchers.isType; -import static tech.picnic.errorprone.bugpatterns.util.Documentation.BUG_PATTERNS_BASE_URL; +import static tech.picnic.errorprone.utils.Documentation.BUG_PATTERNS_BASE_URL; import com.google.auto.service.AutoService; import com.google.common.collect.Iterables; @@ -23,7 +23,7 @@ import com.sun.source.tree.MethodTree; import com.sun.source.tree.Tree; import java.util.List; -import tech.picnic.errorprone.bugpatterns.util.SourceCode; +import tech.picnic.errorprone.utils.SourceCode; /** A {@link BugChecker} that flags redundant {@code @Autowired} constructor annotations. */ @AutoService(BugChecker.class) diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/CanonicalAnnotationSyntax.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/CanonicalAnnotationSyntax.java index a0ad184b32..601af99d8c 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/CanonicalAnnotationSyntax.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/CanonicalAnnotationSyntax.java @@ -3,7 +3,7 @@ import static com.google.errorprone.BugPattern.LinkType.CUSTOM; import static com.google.errorprone.BugPattern.SeverityLevel.SUGGESTION; import static com.google.errorprone.BugPattern.StandardTags.SIMPLIFICATION; -import static tech.picnic.errorprone.bugpatterns.util.Documentation.BUG_PATTERNS_BASE_URL; +import static tech.picnic.errorprone.utils.Documentation.BUG_PATTERNS_BASE_URL; import com.google.auto.service.AutoService; import com.google.common.collect.ImmutableSet; @@ -26,7 +26,7 @@ import java.util.function.BiFunction; import java.util.regex.Matcher; import java.util.regex.Pattern; -import tech.picnic.errorprone.bugpatterns.util.SourceCode; +import tech.picnic.errorprone.utils.SourceCode; /** A {@link BugChecker} that flags annotations that could be written more concisely. */ @AutoService(BugChecker.class) diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/CanonicalClassNameUsage.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/CanonicalClassNameUsage.java index eb62e6b41b..f64a15a0c6 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/CanonicalClassNameUsage.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/CanonicalClassNameUsage.java @@ -9,7 +9,7 @@ import static com.google.errorprone.matchers.Matchers.instanceMethod; import static com.google.errorprone.matchers.Matchers.receiverOfInvocation; import static com.google.errorprone.matchers.Matchers.toType; -import static tech.picnic.errorprone.bugpatterns.util.Documentation.BUG_PATTERNS_BASE_URL; +import static tech.picnic.errorprone.utils.Documentation.BUG_PATTERNS_BASE_URL; import com.google.auto.service.AutoService; import com.google.errorprone.BugPattern; diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/CollectorMutability.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/CollectorMutability.java index 08376ab358..1555cfdcf7 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/CollectorMutability.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/CollectorMutability.java @@ -4,7 +4,7 @@ import static com.google.errorprone.BugPattern.SeverityLevel.WARNING; import static com.google.errorprone.BugPattern.StandardTags.FRAGILE_CODE; import static com.google.errorprone.matchers.method.MethodMatchers.staticMethod; -import static tech.picnic.errorprone.bugpatterns.util.Documentation.BUG_PATTERNS_BASE_URL; +import static tech.picnic.errorprone.utils.Documentation.BUG_PATTERNS_BASE_URL; import com.google.auto.service.AutoService; import com.google.common.collect.ImmutableList; @@ -25,7 +25,7 @@ import java.util.HashSet; import java.util.stream.Collector; import java.util.stream.Collectors; -import tech.picnic.errorprone.bugpatterns.util.ThirdPartyLibrary; +import tech.picnic.errorprone.utils.ThirdPartyLibrary; /** * A {@link BugChecker} that flags {@link Collector Collectors} that don't clearly express diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/DirectReturn.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/DirectReturn.java index 9ed26605e1..8b75500d94 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/DirectReturn.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/DirectReturn.java @@ -11,7 +11,7 @@ import static com.google.errorprone.matchers.Matchers.returnStatement; import static com.google.errorprone.matchers.Matchers.staticMethod; import static com.google.errorprone.matchers.Matchers.toType; -import static tech.picnic.errorprone.bugpatterns.util.Documentation.BUG_PATTERNS_BASE_URL; +import static tech.picnic.errorprone.utils.Documentation.BUG_PATTERNS_BASE_URL; import com.google.auto.service.AutoService; import com.google.common.collect.Streams; @@ -39,8 +39,8 @@ import java.util.List; import java.util.Optional; import org.jspecify.annotations.Nullable; -import tech.picnic.errorprone.bugpatterns.util.MoreASTHelpers; -import tech.picnic.errorprone.bugpatterns.util.SourceCode; +import tech.picnic.errorprone.utils.MoreASTHelpers; +import tech.picnic.errorprone.utils.SourceCode; /** * A {@link BugChecker} that flags unnecessary local variable assignments preceding a return diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/EmptyMethod.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/EmptyMethod.java index d2b53cdb98..306a27c58f 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/EmptyMethod.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/EmptyMethod.java @@ -7,7 +7,7 @@ import static com.google.errorprone.matchers.Matchers.annotations; import static com.google.errorprone.matchers.Matchers.anyOf; import static com.google.errorprone.matchers.Matchers.isType; -import static tech.picnic.errorprone.bugpatterns.util.Documentation.BUG_PATTERNS_BASE_URL; +import static tech.picnic.errorprone.utils.Documentation.BUG_PATTERNS_BASE_URL; import com.google.auto.service.AutoService; import com.google.errorprone.BugPattern; @@ -21,7 +21,7 @@ import com.sun.source.tree.MethodTree; import com.sun.source.tree.Tree; import java.util.Optional; -import tech.picnic.errorprone.bugpatterns.util.SourceCode; +import tech.picnic.errorprone.utils.SourceCode; /** A {@link BugChecker} that flags empty methods that seemingly can simply be deleted. */ @AutoService(BugChecker.class) diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/ErrorProneRuntimeClasspath.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/ErrorProneRuntimeClasspath.java index df48d49f5b..31c4f6c002 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/ErrorProneRuntimeClasspath.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/ErrorProneRuntimeClasspath.java @@ -5,7 +5,7 @@ import static com.google.errorprone.BugPattern.SeverityLevel.SUGGESTION; import static com.google.errorprone.BugPattern.StandardTags.FRAGILE_CODE; import static com.google.errorprone.matchers.Matchers.instanceMethod; -import static tech.picnic.errorprone.bugpatterns.util.Documentation.BUG_PATTERNS_BASE_URL; +import static tech.picnic.errorprone.utils.Documentation.BUG_PATTERNS_BASE_URL; import com.google.auto.service.AutoService; import com.google.common.collect.ImmutableSet; @@ -28,7 +28,7 @@ import com.sun.tools.javac.code.Symbol.ClassSymbol; import com.sun.tools.javac.util.Constants; import java.util.regex.Pattern; -import tech.picnic.errorprone.bugpatterns.util.ThirdPartyLibrary; +import tech.picnic.errorprone.utils.ThirdPartyLibrary; /** * A {@link BugChecker} that flags literal strings in Error Prone Support code that represent the diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/ErrorProneTestHelperSourceFormat.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/ErrorProneTestHelperSourceFormat.java index 99e1d92350..faded811c1 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/ErrorProneTestHelperSourceFormat.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/ErrorProneTestHelperSourceFormat.java @@ -7,7 +7,7 @@ import static com.google.errorprone.matchers.Matchers.instanceMethod; import static com.google.errorprone.matchers.Matchers.staticMethod; import static java.util.stream.Collectors.joining; -import static tech.picnic.errorprone.bugpatterns.util.Documentation.BUG_PATTERNS_BASE_URL; +import static tech.picnic.errorprone.utils.Documentation.BUG_PATTERNS_BASE_URL; import com.google.auto.service.AutoService; import com.google.common.base.Splitter; diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/ExplicitEnumOrdering.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/ExplicitEnumOrdering.java index 1320503146..249474eaed 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/ExplicitEnumOrdering.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/ExplicitEnumOrdering.java @@ -7,7 +7,7 @@ import static com.google.errorprone.BugPattern.StandardTags.FRAGILE_CODE; import static com.google.errorprone.matchers.method.MethodMatchers.staticMethod; import static java.util.stream.Collectors.collectingAndThen; -import static tech.picnic.errorprone.bugpatterns.util.Documentation.BUG_PATTERNS_BASE_URL; +import static tech.picnic.errorprone.utils.Documentation.BUG_PATTERNS_BASE_URL; import com.google.auto.service.AutoService; import com.google.common.collect.ImmutableSet; diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/FluxFlatMapUsage.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/FluxFlatMapUsage.java index 8bd510f3da..ebc2a0a7c2 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/FluxFlatMapUsage.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/FluxFlatMapUsage.java @@ -4,11 +4,11 @@ import static com.google.errorprone.BugPattern.SeverityLevel.ERROR; import static com.google.errorprone.BugPattern.StandardTags.LIKELY_ERROR; import static com.google.errorprone.matchers.method.MethodMatchers.instanceMethod; -import static tech.picnic.errorprone.bugpatterns.util.Documentation.BUG_PATTERNS_BASE_URL; -import static tech.picnic.errorprone.bugpatterns.util.MoreTypes.generic; -import static tech.picnic.errorprone.bugpatterns.util.MoreTypes.subOf; -import static tech.picnic.errorprone.bugpatterns.util.MoreTypes.type; -import static tech.picnic.errorprone.bugpatterns.util.MoreTypes.unbound; +import static tech.picnic.errorprone.utils.Documentation.BUG_PATTERNS_BASE_URL; +import static tech.picnic.errorprone.utils.MoreTypes.generic; +import static tech.picnic.errorprone.utils.MoreTypes.subOf; +import static tech.picnic.errorprone.utils.MoreTypes.type; +import static tech.picnic.errorprone.utils.MoreTypes.unbound; import com.google.auto.service.AutoService; import com.google.common.collect.Iterables; diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/FluxImplicitBlock.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/FluxImplicitBlock.java index 26694e6a7c..84ba3084bc 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/FluxImplicitBlock.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/FluxImplicitBlock.java @@ -6,7 +6,7 @@ import static com.google.errorprone.BugPattern.StandardTags.CONCURRENCY; import static com.google.errorprone.BugPattern.StandardTags.PERFORMANCE; import static com.google.errorprone.matchers.method.MethodMatchers.instanceMethod; -import static tech.picnic.errorprone.bugpatterns.util.Documentation.BUG_PATTERNS_BASE_URL; +import static tech.picnic.errorprone.utils.Documentation.BUG_PATTERNS_BASE_URL; import com.google.auto.service.AutoService; import com.google.common.collect.ImmutableList; @@ -27,7 +27,7 @@ import com.sun.tools.javac.util.Position; import java.util.stream.Collectors; import java.util.stream.Stream; -import tech.picnic.errorprone.bugpatterns.util.ThirdPartyLibrary; +import tech.picnic.errorprone.utils.ThirdPartyLibrary; /** * A {@link BugChecker} that flags {@link reactor.core.publisher.Flux} operator usages that may diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/FormatStringConcatenation.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/FormatStringConcatenation.java index 9f4c8f51c8..ceb0f66d42 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/FormatStringConcatenation.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/FormatStringConcatenation.java @@ -10,7 +10,7 @@ import static com.google.errorprone.matchers.Matchers.not; import static com.google.errorprone.matchers.Matchers.staticMethod; import static java.util.stream.Collectors.joining; -import static tech.picnic.errorprone.bugpatterns.util.Documentation.BUG_PATTERNS_BASE_URL; +import static tech.picnic.errorprone.utils.Documentation.BUG_PATTERNS_BASE_URL; import com.google.auto.service.AutoService; import com.google.common.base.Preconditions; @@ -36,7 +36,7 @@ import java.util.List; import java.util.Optional; import org.jspecify.annotations.Nullable; -import tech.picnic.errorprone.bugpatterns.util.SourceCode; +import tech.picnic.errorprone.utils.SourceCode; /** * A {@link BugChecker} that flags string concatenations that produce a format string; in such cases diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/IdentityConversion.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/IdentityConversion.java index f4b2a980b5..b35331f087 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/IdentityConversion.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/IdentityConversion.java @@ -7,7 +7,7 @@ import static com.google.errorprone.matchers.Matchers.anyOf; import static com.google.errorprone.matchers.Matchers.staticMethod; import static com.google.errorprone.suppliers.Suppliers.OBJECT_TYPE; -import static tech.picnic.errorprone.bugpatterns.util.Documentation.BUG_PATTERNS_BASE_URL; +import static tech.picnic.errorprone.utils.Documentation.BUG_PATTERNS_BASE_URL; import com.google.auto.service.AutoService; import com.google.common.collect.ImmutableBiMap; @@ -41,7 +41,7 @@ import com.sun.tools.javac.code.Types; import java.util.Arrays; import java.util.List; -import tech.picnic.errorprone.bugpatterns.util.SourceCode; +import tech.picnic.errorprone.utils.SourceCode; /** A {@link BugChecker} that flags redundant identity conversions. */ // XXX: Consider detecting cases where a flagged expression is passed to a method, and where removal diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/ImmutablesSortedSetComparator.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/ImmutablesSortedSetComparator.java index 468a2dcc82..dadf1b0910 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/ImmutablesSortedSetComparator.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/ImmutablesSortedSetComparator.java @@ -11,7 +11,7 @@ import static com.google.errorprone.matchers.Matchers.isSubtypeOf; import static com.google.errorprone.matchers.Matchers.methodReturns; import static com.google.errorprone.matchers.Matchers.not; -import static tech.picnic.errorprone.bugpatterns.util.Documentation.BUG_PATTERNS_BASE_URL; +import static tech.picnic.errorprone.utils.Documentation.BUG_PATTERNS_BASE_URL; import com.google.auto.service.AutoService; import com.google.errorprone.BugPattern; diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/IsInstanceLambdaUsage.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/IsInstanceLambdaUsage.java index 75c4e1b630..21ff02436a 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/IsInstanceLambdaUsage.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/IsInstanceLambdaUsage.java @@ -3,7 +3,7 @@ import static com.google.errorprone.BugPattern.LinkType.CUSTOM; import static com.google.errorprone.BugPattern.SeverityLevel.SUGGESTION; import static com.google.errorprone.BugPattern.StandardTags.SIMPLIFICATION; -import static tech.picnic.errorprone.bugpatterns.util.Documentation.BUG_PATTERNS_BASE_URL; +import static tech.picnic.errorprone.utils.Documentation.BUG_PATTERNS_BASE_URL; import com.google.auto.service.AutoService; import com.google.common.collect.Iterables; @@ -18,7 +18,7 @@ import com.sun.source.tree.LambdaExpressionTree; import com.sun.source.tree.Tree.Kind; import com.sun.source.tree.VariableTree; -import tech.picnic.errorprone.bugpatterns.util.SourceCode; +import tech.picnic.errorprone.utils.SourceCode; /** * A {@link BugChecker} that flags lambda expressions that can be replaced with a method reference diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/JUnitClassModifiers.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/JUnitClassModifiers.java index 866b712572..8cfd59cd2a 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/JUnitClassModifiers.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/JUnitClassModifiers.java @@ -11,9 +11,9 @@ import static com.google.errorprone.matchers.Matchers.hasModifier; import static com.google.errorprone.matchers.Matchers.isType; import static com.google.errorprone.matchers.Matchers.not; -import static tech.picnic.errorprone.bugpatterns.util.Documentation.BUG_PATTERNS_BASE_URL; -import static tech.picnic.errorprone.bugpatterns.util.MoreJUnitMatchers.TEST_METHOD; -import static tech.picnic.errorprone.bugpatterns.util.MoreMatchers.hasMetaAnnotation; +import static tech.picnic.errorprone.utils.Documentation.BUG_PATTERNS_BASE_URL; +import static tech.picnic.errorprone.utils.MoreJUnitMatchers.TEST_METHOD; +import static tech.picnic.errorprone.utils.MoreMatchers.hasMetaAnnotation; import com.google.auto.service.AutoService; import com.google.common.collect.ImmutableSet; diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/JUnitMethodDeclaration.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/JUnitMethodDeclaration.java index b7ca52153c..24fbfa3992 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/JUnitMethodDeclaration.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/JUnitMethodDeclaration.java @@ -8,9 +8,9 @@ import static com.google.errorprone.matchers.Matchers.hasModifier; import static com.google.errorprone.matchers.Matchers.not; import static java.util.function.Predicate.not; -import static tech.picnic.errorprone.bugpatterns.util.Documentation.BUG_PATTERNS_BASE_URL; -import static tech.picnic.errorprone.bugpatterns.util.MoreJUnitMatchers.SETUP_OR_TEARDOWN_METHOD; -import static tech.picnic.errorprone.bugpatterns.util.MoreJUnitMatchers.TEST_METHOD; +import static tech.picnic.errorprone.utils.Documentation.BUG_PATTERNS_BASE_URL; +import static tech.picnic.errorprone.utils.MoreJUnitMatchers.SETUP_OR_TEARDOWN_METHOD; +import static tech.picnic.errorprone.utils.MoreJUnitMatchers.TEST_METHOD; import com.google.auto.service.AutoService; import com.google.common.collect.ImmutableSet; @@ -28,7 +28,7 @@ import com.sun.tools.javac.code.Symbol.MethodSymbol; import java.util.Optional; import javax.lang.model.element.Modifier; -import tech.picnic.errorprone.bugpatterns.util.ConflictDetection; +import tech.picnic.errorprone.utils.ConflictDetection; /** A {@link BugChecker} that flags non-canonical JUnit method declarations. */ // XXX: Consider introducing a class-level check that enforces that test classes: diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/JUnitNullaryParameterizedTestDeclaration.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/JUnitNullaryParameterizedTestDeclaration.java index 1ac4a63c7e..f114a47c38 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/JUnitNullaryParameterizedTestDeclaration.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/JUnitNullaryParameterizedTestDeclaration.java @@ -7,8 +7,8 @@ import static com.google.errorprone.matchers.Matchers.annotations; import static com.google.errorprone.matchers.Matchers.anyOf; import static com.google.errorprone.matchers.Matchers.isType; -import static tech.picnic.errorprone.bugpatterns.util.Documentation.BUG_PATTERNS_BASE_URL; -import static tech.picnic.errorprone.bugpatterns.util.MoreMatchers.hasMetaAnnotation; +import static tech.picnic.errorprone.utils.Documentation.BUG_PATTERNS_BASE_URL; +import static tech.picnic.errorprone.utils.MoreMatchers.hasMetaAnnotation; import com.google.auto.service.AutoService; import com.google.errorprone.BugPattern; @@ -23,7 +23,7 @@ import com.google.errorprone.matchers.MultiMatcher.MultiMatchResult; import com.sun.source.tree.AnnotationTree; import com.sun.source.tree.MethodTree; -import tech.picnic.errorprone.bugpatterns.util.SourceCode; +import tech.picnic.errorprone.utils.SourceCode; /** * A {@link BugChecker} that flags nullary {@link diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/JUnitValueSource.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/JUnitValueSource.java index e6dc139f1d..3c529227e4 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/JUnitValueSource.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/JUnitValueSource.java @@ -19,9 +19,9 @@ import static com.google.errorprone.matchers.Matchers.toType; import static java.util.function.Predicate.not; import static java.util.stream.Collectors.joining; -import static tech.picnic.errorprone.bugpatterns.util.Documentation.BUG_PATTERNS_BASE_URL; -import static tech.picnic.errorprone.bugpatterns.util.MoreJUnitMatchers.HAS_METHOD_SOURCE; -import static tech.picnic.errorprone.bugpatterns.util.MoreJUnitMatchers.getMethodSourceFactoryNames; +import static tech.picnic.errorprone.utils.Documentation.BUG_PATTERNS_BASE_URL; +import static tech.picnic.errorprone.utils.MoreJUnitMatchers.HAS_METHOD_SOURCE; +import static tech.picnic.errorprone.utils.MoreJUnitMatchers.getMethodSourceFactoryNames; import com.google.auto.service.AutoService; import com.google.common.collect.ImmutableList; @@ -58,7 +58,7 @@ import java.util.stream.LongStream; import java.util.stream.Stream; import org.jspecify.annotations.Nullable; -import tech.picnic.errorprone.bugpatterns.util.SourceCode; +import tech.picnic.errorprone.utils.SourceCode; /** * A {@link BugChecker} that flags JUnit tests with a {@link diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/LexicographicalAnnotationAttributeListing.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/LexicographicalAnnotationAttributeListing.java index 4d0fcfbaac..bd6fe649b2 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/LexicographicalAnnotationAttributeListing.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/LexicographicalAnnotationAttributeListing.java @@ -7,7 +7,7 @@ import static java.util.Comparator.comparing; import static java.util.Comparator.naturalOrder; import static java.util.stream.Collectors.joining; -import static tech.picnic.errorprone.bugpatterns.util.Documentation.BUG_PATTERNS_BASE_URL; +import static tech.picnic.errorprone.utils.Documentation.BUG_PATTERNS_BASE_URL; import com.google.auto.service.AutoService; import com.google.common.base.Splitter; @@ -42,9 +42,9 @@ import java.util.stream.Stream; import javax.inject.Inject; import org.jspecify.annotations.Nullable; -import tech.picnic.errorprone.bugpatterns.util.AnnotationAttributeMatcher; -import tech.picnic.errorprone.bugpatterns.util.Flags; -import tech.picnic.errorprone.bugpatterns.util.SourceCode; +import tech.picnic.errorprone.utils.AnnotationAttributeMatcher; +import tech.picnic.errorprone.utils.Flags; +import tech.picnic.errorprone.utils.SourceCode; /** * A {@link BugChecker} that flags annotation array listings which aren't sorted lexicographically. diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/LexicographicalAnnotationListing.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/LexicographicalAnnotationListing.java index 694cf41cb8..3924d8556b 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/LexicographicalAnnotationListing.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/LexicographicalAnnotationListing.java @@ -7,7 +7,7 @@ import static com.sun.tools.javac.code.TypeAnnotations.AnnotationType.DECLARATION; import static com.sun.tools.javac.code.TypeAnnotations.AnnotationType.TYPE; import static java.util.Comparator.comparing; -import static tech.picnic.errorprone.bugpatterns.util.Documentation.BUG_PATTERNS_BASE_URL; +import static tech.picnic.errorprone.utils.Documentation.BUG_PATTERNS_BASE_URL; import com.google.auto.service.AutoService; import com.google.common.base.VerifyException; @@ -28,7 +28,7 @@ import java.util.Comparator; import java.util.List; import org.jspecify.annotations.Nullable; -import tech.picnic.errorprone.bugpatterns.util.SourceCode; +import tech.picnic.errorprone.utils.SourceCode; /** * A {@link BugChecker} that flags annotations that are not lexicographically sorted. diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/MethodReferenceUsage.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/MethodReferenceUsage.java index 5c79baf817..4123d02f1e 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/MethodReferenceUsage.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/MethodReferenceUsage.java @@ -4,7 +4,7 @@ import static com.google.errorprone.BugPattern.LinkType.CUSTOM; import static com.google.errorprone.BugPattern.SeverityLevel.SUGGESTION; import static com.google.errorprone.BugPattern.StandardTags.STYLE; -import static tech.picnic.errorprone.bugpatterns.util.Documentation.BUG_PATTERNS_BASE_URL; +import static tech.picnic.errorprone.utils.Documentation.BUG_PATTERNS_BASE_URL; import com.google.auto.service.AutoService; import com.google.common.base.VerifyException; diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/MockitoMockClassReference.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/MockitoMockClassReference.java index f99bba08c9..aa891245e0 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/MockitoMockClassReference.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/MockitoMockClassReference.java @@ -9,7 +9,7 @@ import static com.google.errorprone.matchers.Matchers.isVariable; import static com.google.errorprone.matchers.Matchers.not; import static com.google.errorprone.matchers.Matchers.staticMethod; -import static tech.picnic.errorprone.bugpatterns.util.Documentation.BUG_PATTERNS_BASE_URL; +import static tech.picnic.errorprone.utils.Documentation.BUG_PATTERNS_BASE_URL; import com.google.auto.service.AutoService; import com.google.errorprone.BugPattern; @@ -25,7 +25,7 @@ import com.sun.source.tree.Tree; import com.sun.source.tree.VariableTree; import java.util.List; -import tech.picnic.errorprone.bugpatterns.util.MoreASTHelpers; +import tech.picnic.errorprone.utils.MoreASTHelpers; /** * A {@link BugChecker} that flags the use of {@link org.mockito.Mockito#mock(Class)} and {@link diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/MockitoStubbing.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/MockitoStubbing.java index 396e589158..6e57cc58a7 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/MockitoStubbing.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/MockitoStubbing.java @@ -4,7 +4,7 @@ import static com.google.errorprone.BugPattern.SeverityLevel.SUGGESTION; import static com.google.errorprone.BugPattern.StandardTags.SIMPLIFICATION; import static com.google.errorprone.matchers.Matchers.staticMethod; -import static tech.picnic.errorprone.bugpatterns.util.Documentation.BUG_PATTERNS_BASE_URL; +import static tech.picnic.errorprone.utils.Documentation.BUG_PATTERNS_BASE_URL; import com.google.auto.service.AutoService; import com.google.common.collect.Iterables; @@ -18,7 +18,7 @@ import com.sun.source.tree.ExpressionTree; import com.sun.source.tree.MethodInvocationTree; import java.util.List; -import tech.picnic.errorprone.bugpatterns.util.SourceCode; +import tech.picnic.errorprone.utils.SourceCode; /** * A {@link BugChecker} that flags method invocations for which all arguments are wrapped using diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/MongoDBTextFilterUsage.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/MongoDBTextFilterUsage.java index 77208f673e..88116e8eb7 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/MongoDBTextFilterUsage.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/MongoDBTextFilterUsage.java @@ -4,7 +4,7 @@ import static com.google.errorprone.BugPattern.SeverityLevel.SUGGESTION; import static com.google.errorprone.BugPattern.StandardTags.PERFORMANCE; import static com.google.errorprone.matchers.method.MethodMatchers.staticMethod; -import static tech.picnic.errorprone.bugpatterns.util.Documentation.BUG_PATTERNS_BASE_URL; +import static tech.picnic.errorprone.utils.Documentation.BUG_PATTERNS_BASE_URL; import com.google.auto.service.AutoService; import com.google.errorprone.BugPattern; diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/NestedOptionals.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/NestedOptionals.java index 6bee75348a..b741c2c41d 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/NestedOptionals.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/NestedOptionals.java @@ -3,11 +3,11 @@ import static com.google.errorprone.BugPattern.LinkType.CUSTOM; import static com.google.errorprone.BugPattern.SeverityLevel.WARNING; import static com.google.errorprone.BugPattern.StandardTags.FRAGILE_CODE; -import static tech.picnic.errorprone.bugpatterns.util.Documentation.BUG_PATTERNS_BASE_URL; -import static tech.picnic.errorprone.bugpatterns.util.MoreMatchers.isSubTypeOf; -import static tech.picnic.errorprone.bugpatterns.util.MoreTypes.generic; -import static tech.picnic.errorprone.bugpatterns.util.MoreTypes.raw; -import static tech.picnic.errorprone.bugpatterns.util.MoreTypes.subOf; +import static tech.picnic.errorprone.utils.Documentation.BUG_PATTERNS_BASE_URL; +import static tech.picnic.errorprone.utils.MoreMatchers.isSubTypeOf; +import static tech.picnic.errorprone.utils.MoreTypes.generic; +import static tech.picnic.errorprone.utils.MoreTypes.raw; +import static tech.picnic.errorprone.utils.MoreTypes.subOf; import com.google.auto.service.AutoService; import com.google.errorprone.BugPattern; diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/NestedPublishers.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/NestedPublishers.java index d4f00b99b1..58f418aaa7 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/NestedPublishers.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/NestedPublishers.java @@ -6,13 +6,13 @@ import static com.google.errorprone.matchers.Matchers.typePredicateMatcher; import static com.google.errorprone.predicates.TypePredicates.allOf; import static com.google.errorprone.predicates.TypePredicates.not; -import static tech.picnic.errorprone.bugpatterns.util.Documentation.BUG_PATTERNS_BASE_URL; -import static tech.picnic.errorprone.bugpatterns.util.MoreTypePredicates.hasTypeParameter; -import static tech.picnic.errorprone.bugpatterns.util.MoreTypePredicates.isSubTypeOf; -import static tech.picnic.errorprone.bugpatterns.util.MoreTypes.generic; -import static tech.picnic.errorprone.bugpatterns.util.MoreTypes.raw; -import static tech.picnic.errorprone.bugpatterns.util.MoreTypes.subOf; -import static tech.picnic.errorprone.bugpatterns.util.MoreTypes.type; +import static tech.picnic.errorprone.utils.Documentation.BUG_PATTERNS_BASE_URL; +import static tech.picnic.errorprone.utils.MoreTypePredicates.hasTypeParameter; +import static tech.picnic.errorprone.utils.MoreTypePredicates.isSubTypeOf; +import static tech.picnic.errorprone.utils.MoreTypes.generic; +import static tech.picnic.errorprone.utils.MoreTypes.raw; +import static tech.picnic.errorprone.utils.MoreTypes.subOf; +import static tech.picnic.errorprone.utils.MoreTypes.type; import com.google.auto.service.AutoService; import com.google.errorprone.BugPattern; diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/NonEmptyMono.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/NonEmptyMono.java index 79a185b440..5ec869c878 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/NonEmptyMono.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/NonEmptyMono.java @@ -5,7 +5,7 @@ import static com.google.errorprone.BugPattern.StandardTags.SIMPLIFICATION; import static com.google.errorprone.matchers.Matchers.anyOf; import static com.google.errorprone.matchers.Matchers.instanceMethod; -import static tech.picnic.errorprone.bugpatterns.util.Documentation.BUG_PATTERNS_BASE_URL; +import static tech.picnic.errorprone.utils.Documentation.BUG_PATTERNS_BASE_URL; import com.google.auto.service.AutoService; import com.google.errorprone.BugPattern; @@ -20,7 +20,7 @@ import com.sun.source.tree.MethodInvocationTree; import java.util.function.BiFunction; import reactor.core.publisher.Mono; -import tech.picnic.errorprone.bugpatterns.util.SourceCode; +import tech.picnic.errorprone.utils.SourceCode; /** * A {@link BugChecker} that flags {@link Mono} operations that are known to be vacuous, given that diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/NonStaticImport.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/NonStaticImport.java index bacf57fbe5..a261498677 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/NonStaticImport.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/NonStaticImport.java @@ -4,7 +4,7 @@ import static com.google.errorprone.BugPattern.SeverityLevel.SUGGESTION; import static com.google.errorprone.BugPattern.StandardTags.STYLE; import static tech.picnic.errorprone.bugpatterns.StaticImport.STATIC_IMPORT_CANDIDATE_MEMBERS; -import static tech.picnic.errorprone.bugpatterns.util.Documentation.BUG_PATTERNS_BASE_URL; +import static tech.picnic.errorprone.utils.Documentation.BUG_PATTERNS_BASE_URL; import com.google.auto.service.AutoService; import com.google.auto.value.AutoValue; @@ -35,7 +35,7 @@ import java.util.Locale; import java.util.regex.Pattern; import org.jspecify.annotations.Nullable; -import tech.picnic.errorprone.bugpatterns.util.SourceCode; +import tech.picnic.errorprone.utils.SourceCode; /** * A {@link BugChecker} that flags static imports of type members that should *not* be statically diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/PrimitiveComparison.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/PrimitiveComparison.java index 77a456af6d..e49bbe3f3c 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/PrimitiveComparison.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/PrimitiveComparison.java @@ -7,7 +7,7 @@ import static com.google.errorprone.matchers.method.MethodMatchers.instanceMethod; import static com.google.errorprone.matchers.method.MethodMatchers.staticMethod; import static java.util.stream.Collectors.joining; -import static tech.picnic.errorprone.bugpatterns.util.Documentation.BUG_PATTERNS_BASE_URL; +import static tech.picnic.errorprone.utils.Documentation.BUG_PATTERNS_BASE_URL; import com.google.auto.service.AutoService; import com.google.common.base.VerifyException; @@ -33,7 +33,7 @@ import java.util.Optional; import java.util.function.Function; import java.util.stream.Stream; -import tech.picnic.errorprone.bugpatterns.util.SourceCode; +import tech.picnic.errorprone.utils.SourceCode; /** * A {@link BugChecker} that flags {@code Comparator#comparing*} invocations that can be replaced diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/RedundantStringConversion.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/RedundantStringConversion.java index 4b6ba6ce3d..fea909d00e 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/RedundantStringConversion.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/RedundantStringConversion.java @@ -15,7 +15,7 @@ import static com.google.errorprone.matchers.Matchers.not; import static com.google.errorprone.matchers.method.MethodMatchers.instanceMethod; import static com.google.errorprone.matchers.method.MethodMatchers.staticMethod; -import static tech.picnic.errorprone.bugpatterns.util.Documentation.BUG_PATTERNS_BASE_URL; +import static tech.picnic.errorprone.utils.Documentation.BUG_PATTERNS_BASE_URL; import com.google.auto.service.AutoService; import com.google.common.base.Preconditions; @@ -53,9 +53,9 @@ import java.util.Optional; import java.util.stream.Stream; import javax.inject.Inject; -import tech.picnic.errorprone.bugpatterns.util.Flags; -import tech.picnic.errorprone.bugpatterns.util.MethodMatcherFactory; -import tech.picnic.errorprone.bugpatterns.util.SourceCode; +import tech.picnic.errorprone.utils.Flags; +import tech.picnic.errorprone.utils.MethodMatcherFactory; +import tech.picnic.errorprone.utils.SourceCode; /** A {@link BugChecker} that flags redundant explicit string conversions. */ @AutoService(BugChecker.class) diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/RefasterAnyOfUsage.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/RefasterAnyOfUsage.java index 96e6bc78c6..8b9c35f423 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/RefasterAnyOfUsage.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/RefasterAnyOfUsage.java @@ -4,7 +4,7 @@ import static com.google.errorprone.BugPattern.SeverityLevel.SUGGESTION; import static com.google.errorprone.BugPattern.StandardTags.SIMPLIFICATION; import static com.google.errorprone.matchers.method.MethodMatchers.staticMethod; -import static tech.picnic.errorprone.bugpatterns.util.Documentation.BUG_PATTERNS_BASE_URL; +import static tech.picnic.errorprone.utils.Documentation.BUG_PATTERNS_BASE_URL; import com.google.auto.service.AutoService; import com.google.errorprone.BugPattern; @@ -17,7 +17,7 @@ import com.google.errorprone.refaster.Refaster; import com.sun.source.tree.ExpressionTree; import com.sun.source.tree.MethodInvocationTree; -import tech.picnic.errorprone.bugpatterns.util.SourceCode; +import tech.picnic.errorprone.utils.SourceCode; /** * A {@link BugChecker} that flags unnecessary {@link Refaster#anyOf(Object[])} usages. diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/RefasterMethodParameterOrder.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/RefasterMethodParameterOrder.java index 46575300b3..a228b81cbf 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/RefasterMethodParameterOrder.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/RefasterMethodParameterOrder.java @@ -8,7 +8,7 @@ import static com.google.errorprone.matchers.Matchers.hasAnnotation; import static java.util.Comparator.comparing; import static java.util.stream.Collectors.toCollection; -import static tech.picnic.errorprone.bugpatterns.util.Documentation.BUG_PATTERNS_BASE_URL; +import static tech.picnic.errorprone.utils.Documentation.BUG_PATTERNS_BASE_URL; import com.google.auto.service.AutoService; import com.google.common.collect.ImmutableList; @@ -38,7 +38,7 @@ import java.util.stream.Stream; import javax.lang.model.element.Name; import org.jspecify.annotations.Nullable; -import tech.picnic.errorprone.bugpatterns.util.SourceCode; +import tech.picnic.errorprone.utils.SourceCode; /** * A {@link BugChecker} that flags Refaster methods with a non-canonical parameter order. diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/RefasterRuleModifiers.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/RefasterRuleModifiers.java index 88fbb22fc8..5860571f15 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/RefasterRuleModifiers.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/RefasterRuleModifiers.java @@ -5,7 +5,7 @@ import static com.google.errorprone.BugPattern.StandardTags.STYLE; import static com.google.errorprone.matchers.Matchers.anyOf; import static com.google.errorprone.matchers.Matchers.hasAnnotation; -import static tech.picnic.errorprone.bugpatterns.util.Documentation.BUG_PATTERNS_BASE_URL; +import static tech.picnic.errorprone.utils.Documentation.BUG_PATTERNS_BASE_URL; import com.google.auto.service.AutoService; import com.google.errorprone.BugPattern; diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/RequestMappingAnnotation.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/RequestMappingAnnotation.java index 7c1a48c01f..d33f183e60 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/RequestMappingAnnotation.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/RequestMappingAnnotation.java @@ -11,7 +11,7 @@ import static com.google.errorprone.matchers.Matchers.isType; import static com.google.errorprone.matchers.Matchers.methodHasParameters; import static com.google.errorprone.matchers.Matchers.not; -import static tech.picnic.errorprone.bugpatterns.util.Documentation.BUG_PATTERNS_BASE_URL; +import static tech.picnic.errorprone.utils.Documentation.BUG_PATTERNS_BASE_URL; import com.google.auto.service.AutoService; import com.google.errorprone.BugPattern; diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/RequestParamType.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/RequestParamType.java index 045d6ac8cd..4455f7f149 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/RequestParamType.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/RequestParamType.java @@ -11,7 +11,7 @@ import static com.google.errorprone.matchers.Matchers.isSubtypeOf; import static com.google.errorprone.matchers.Matchers.isType; import static com.google.errorprone.matchers.Matchers.not; -import static tech.picnic.errorprone.bugpatterns.util.Documentation.BUG_PATTERNS_BASE_URL; +import static tech.picnic.errorprone.utils.Documentation.BUG_PATTERNS_BASE_URL; import com.google.auto.service.AutoService; import com.google.common.collect.ImmutableCollection; @@ -28,7 +28,7 @@ import com.sun.source.tree.Tree; import com.sun.source.tree.VariableTree; import javax.inject.Inject; -import tech.picnic.errorprone.bugpatterns.util.Flags; +import tech.picnic.errorprone.utils.Flags; /** A {@link BugChecker} that flags {@code @RequestParam} parameters with an unsupported type. */ @AutoService(BugChecker.class) diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/Slf4jLogStatement.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/Slf4jLogStatement.java index 5d628a31d5..ccf73b8258 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/Slf4jLogStatement.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/Slf4jLogStatement.java @@ -6,7 +6,7 @@ import static com.google.errorprone.BugPattern.StandardTags.LIKELY_ERROR; import static com.google.errorprone.matchers.Matchers.isSubtypeOf; import static com.google.errorprone.matchers.method.MethodMatchers.instanceMethod; -import static tech.picnic.errorprone.bugpatterns.util.Documentation.BUG_PATTERNS_BASE_URL; +import static tech.picnic.errorprone.utils.Documentation.BUG_PATTERNS_BASE_URL; import com.google.auto.service.AutoService; import com.google.common.base.Splitter; @@ -23,7 +23,7 @@ import com.sun.source.tree.Tree.Kind; import java.util.List; import java.util.Optional; -import tech.picnic.errorprone.bugpatterns.util.SourceCode; +import tech.picnic.errorprone.utils.SourceCode; /** A {@link BugChecker} that flags SLF4J usages that are likely to be in error. */ // XXX: The special-casing of Throwable applies only to SLF4J 1.6.0+; see diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/SpringMvcAnnotation.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/SpringMvcAnnotation.java index 1b2119ab12..644d00fe43 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/SpringMvcAnnotation.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/SpringMvcAnnotation.java @@ -6,7 +6,7 @@ import static com.google.errorprone.BugPattern.StandardTags.SIMPLIFICATION; import static java.util.function.Predicate.not; import static java.util.stream.Collectors.joining; -import static tech.picnic.errorprone.bugpatterns.util.Documentation.BUG_PATTERNS_BASE_URL; +import static tech.picnic.errorprone.utils.Documentation.BUG_PATTERNS_BASE_URL; import com.google.auto.service.AutoService; import com.google.common.base.VerifyException; @@ -27,8 +27,8 @@ import com.sun.source.tree.NewArrayTree; import com.sun.source.tree.Tree.Kind; import java.util.Optional; -import tech.picnic.errorprone.bugpatterns.util.AnnotationAttributeMatcher; -import tech.picnic.errorprone.bugpatterns.util.SourceCode; +import tech.picnic.errorprone.utils.AnnotationAttributeMatcher; +import tech.picnic.errorprone.utils.SourceCode; /** * A {@link BugChecker} that flags {@code @RequestMapping} annotations that can be written more diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/StaticImport.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/StaticImport.java index f7fa3fe26b..5d2bd97210 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/StaticImport.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/StaticImport.java @@ -6,7 +6,7 @@ import static java.util.Objects.requireNonNull; import static tech.picnic.errorprone.bugpatterns.NonStaticImport.NON_STATIC_IMPORT_CANDIDATE_IDENTIFIERS; import static tech.picnic.errorprone.bugpatterns.NonStaticImport.NON_STATIC_IMPORT_CANDIDATE_MEMBERS; -import static tech.picnic.errorprone.bugpatterns.util.Documentation.BUG_PATTERNS_BASE_URL; +import static tech.picnic.errorprone.utils.Documentation.BUG_PATTERNS_BASE_URL; import com.google.auto.service.AutoService; import com.google.common.annotations.VisibleForTesting; @@ -132,7 +132,7 @@ public final class StaticImport extends BugChecker implements MemberSelectTreeMa "org.springframework.http.MediaType", "org.testng.Assert", "reactor.function.TupleUtils", - "tech.picnic.errorprone.bugpatterns.util.MoreTypes"); + "tech.picnic.errorprone.utils.MoreTypes"); /** * Type members that should be statically imported. diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/StringJoin.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/StringJoin.java index 0533d0cccd..4ab098b3cb 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/StringJoin.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/StringJoin.java @@ -4,7 +4,7 @@ import static com.google.errorprone.BugPattern.SeverityLevel.SUGGESTION; import static com.google.errorprone.BugPattern.StandardTags.SIMPLIFICATION; import static com.google.errorprone.matchers.method.MethodMatchers.staticMethod; -import static tech.picnic.errorprone.bugpatterns.util.Documentation.BUG_PATTERNS_BASE_URL; +import static tech.picnic.errorprone.utils.Documentation.BUG_PATTERNS_BASE_URL; import com.google.auto.service.AutoService; import com.google.common.base.Splitter; @@ -28,7 +28,7 @@ import java.util.Iterator; import java.util.List; import org.jspecify.annotations.Nullable; -import tech.picnic.errorprone.bugpatterns.util.SourceCode; +import tech.picnic.errorprone.utils.SourceCode; /** * A {@link BugChecker} that flags {@link String#format(String, Object...)} invocations which can be diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/TimeZoneUsage.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/TimeZoneUsage.java index 5cdfec6cea..4bc0650e18 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/TimeZoneUsage.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/TimeZoneUsage.java @@ -10,7 +10,7 @@ import static com.google.errorprone.matchers.Matchers.isSubtypeOf; import static com.google.errorprone.matchers.Matchers.not; import static com.google.errorprone.matchers.Matchers.staticMethod; -import static tech.picnic.errorprone.bugpatterns.util.Documentation.BUG_PATTERNS_BASE_URL; +import static tech.picnic.errorprone.utils.Documentation.BUG_PATTERNS_BASE_URL; import com.google.auto.service.AutoService; import com.google.errorprone.BugPattern; diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/UnqualifiedSuggestedFixImport.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/UnqualifiedSuggestedFixImport.java index 6d27c7c372..99ecb9a98f 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/UnqualifiedSuggestedFixImport.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/UnqualifiedSuggestedFixImport.java @@ -4,7 +4,7 @@ import static com.google.errorprone.BugPattern.SeverityLevel.WARNING; import static com.google.errorprone.BugPattern.StandardTags.FRAGILE_CODE; import static com.google.errorprone.matchers.Matchers.instanceMethod; -import static tech.picnic.errorprone.bugpatterns.util.Documentation.BUG_PATTERNS_BASE_URL; +import static tech.picnic.errorprone.utils.Documentation.BUG_PATTERNS_BASE_URL; import com.google.auto.service.AutoService; import com.google.errorprone.BugPattern; diff --git a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/CanonicalClassNameUsageTest.java b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/CanonicalClassNameUsageTest.java index 27a57e4b13..b5ea6a08c5 100644 --- a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/CanonicalClassNameUsageTest.java +++ b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/CanonicalClassNameUsageTest.java @@ -17,7 +17,7 @@ void identification() { "import static com.google.errorprone.matchers.Matchers.instanceMethod;", "", "import com.google.errorprone.VisitorState;", - "import tech.picnic.errorprone.bugpatterns.util.MoreTypes;", + "import tech.picnic.errorprone.utils.MoreTypes;", "", "class A {", " void m(VisitorState state) {", @@ -54,7 +54,7 @@ void replacement() { "import static com.google.errorprone.matchers.Matchers.instanceMethod;", "", "import com.google.errorprone.BugPattern;", - "import tech.picnic.errorprone.bugpatterns.util.MoreTypes;", + "import tech.picnic.errorprone.utils.MoreTypes;", "", "class A {", " void m() {", @@ -67,7 +67,7 @@ void replacement() { "import static com.google.errorprone.matchers.Matchers.instanceMethod;", "", "import com.google.errorprone.BugPattern;", - "import tech.picnic.errorprone.bugpatterns.util.MoreTypes;", + "import tech.picnic.errorprone.utils.MoreTypes;", "", "class A {", " void m() {", diff --git a/error-prone-utils/pom.xml b/error-prone-utils/pom.xml new file mode 100644 index 0000000000..3ee3655731 --- /dev/null +++ b/error-prone-utils/pom.xml @@ -0,0 +1,81 @@ + + + 4.0.0 + + + tech.picnic.error-prone-support + error-prone-support + 0.14.1-SNAPSHOT + + + error-prone-utils + + Picnic :: Error Prone Support :: Utils + Provides utility classes for Error Prone development. + https://error-prone.picnic.tech + + + + ${groupId.error-prone} + error_prone_annotation + provided + + + ${groupId.error-prone} + error_prone_annotations + provided + + + ${groupId.error-prone} + error_prone_check_api + provided + + + ${groupId.error-prone} + error_prone_core + provided + + + ${groupId.error-prone} + error_prone_test_helpers + provided + + + com.google.guava + guava + provided + + + io.projectreactor + reactor-core + test + + + org.assertj + assertj-core + test + + + org.jspecify + jspecify + provided + + + org.junit.jupiter + junit-jupiter-api + provided + + + + org.junit.jupiter + junit-jupiter-engine + test + + + org.junit.jupiter + junit-jupiter-params + provided + + + diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/util/AnnotationAttributeMatcher.java b/error-prone-utils/src/main/java/tech/picnic/errorprone/utils/AnnotationAttributeMatcher.java similarity index 99% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/util/AnnotationAttributeMatcher.java rename to error-prone-utils/src/main/java/tech/picnic/errorprone/utils/AnnotationAttributeMatcher.java index fc10d03f45..1da2ce124c 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/util/AnnotationAttributeMatcher.java +++ b/error-prone-utils/src/main/java/tech/picnic/errorprone/utils/AnnotationAttributeMatcher.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.bugpatterns.util; +package tech.picnic.errorprone.utils; import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.HashMultimap; diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/util/ConflictDetection.java b/error-prone-utils/src/main/java/tech/picnic/errorprone/utils/ConflictDetection.java similarity index 95% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/util/ConflictDetection.java rename to error-prone-utils/src/main/java/tech/picnic/errorprone/utils/ConflictDetection.java index 42e8286fcf..8d64c82d07 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/util/ConflictDetection.java +++ b/error-prone-utils/src/main/java/tech/picnic/errorprone/utils/ConflictDetection.java @@ -1,6 +1,6 @@ -package tech.picnic.errorprone.bugpatterns.util; +package tech.picnic.errorprone.utils; -import static tech.picnic.errorprone.bugpatterns.util.JavaKeywords.isValidIdentifier; +import static tech.picnic.errorprone.utils.JavaKeywords.isValidIdentifier; import com.google.errorprone.VisitorState; import com.google.errorprone.util.ASTHelpers; diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/util/Documentation.java b/error-prone-utils/src/main/java/tech/picnic/errorprone/utils/Documentation.java similarity index 86% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/util/Documentation.java rename to error-prone-utils/src/main/java/tech/picnic/errorprone/utils/Documentation.java index dd75116294..30fedc4d75 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/util/Documentation.java +++ b/error-prone-utils/src/main/java/tech/picnic/errorprone/utils/Documentation.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.bugpatterns.util; +package tech.picnic.errorprone.utils; /** Utility class providing documentation-related code. */ public final class Documentation { diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/util/Flags.java b/error-prone-utils/src/main/java/tech/picnic/errorprone/utils/Flags.java similarity index 94% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/util/Flags.java rename to error-prone-utils/src/main/java/tech/picnic/errorprone/utils/Flags.java index 349a003bef..df2787c7f4 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/util/Flags.java +++ b/error-prone-utils/src/main/java/tech/picnic/errorprone/utils/Flags.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.bugpatterns.util; +package tech.picnic.errorprone.utils; import com.google.common.collect.ImmutableList; import com.google.errorprone.ErrorProneFlags; diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/util/JavaKeywords.java b/error-prone-utils/src/main/java/tech/picnic/errorprone/utils/JavaKeywords.java similarity index 98% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/util/JavaKeywords.java rename to error-prone-utils/src/main/java/tech/picnic/errorprone/utils/JavaKeywords.java index 6571ecccf2..6a7aa842ae 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/util/JavaKeywords.java +++ b/error-prone-utils/src/main/java/tech/picnic/errorprone/utils/JavaKeywords.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.bugpatterns.util; +package tech.picnic.errorprone.utils; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Sets; diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/util/MethodMatcherFactory.java b/error-prone-utils/src/main/java/tech/picnic/errorprone/utils/MethodMatcherFactory.java similarity index 98% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/util/MethodMatcherFactory.java rename to error-prone-utils/src/main/java/tech/picnic/errorprone/utils/MethodMatcherFactory.java index de03abd098..449d765aa5 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/util/MethodMatcherFactory.java +++ b/error-prone-utils/src/main/java/tech/picnic/errorprone/utils/MethodMatcherFactory.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.bugpatterns.util; +package tech.picnic.errorprone.utils; import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.collect.ImmutableSet.toImmutableSet; diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/util/MoreASTHelpers.java b/error-prone-utils/src/main/java/tech/picnic/errorprone/utils/MoreASTHelpers.java similarity index 95% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/util/MoreASTHelpers.java rename to error-prone-utils/src/main/java/tech/picnic/errorprone/utils/MoreASTHelpers.java index b0d4bcaddc..30c12d3c0d 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/util/MoreASTHelpers.java +++ b/error-prone-utils/src/main/java/tech/picnic/errorprone/utils/MoreASTHelpers.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.bugpatterns.util; +package tech.picnic.errorprone.utils; import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.collect.ImmutableList.toImmutableList; @@ -15,8 +15,7 @@ /** * A collection of helper methods for working with the AST. * - *

These methods are additions to the ones found in {@link - * com.google.errorprone.util.ASTHelpers}. + *

These methods are additions to the ones found in {@link ASTHelpers}. */ public final class MoreASTHelpers { private MoreASTHelpers() {} diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/util/MoreJUnitMatchers.java b/error-prone-utils/src/main/java/tech/picnic/errorprone/utils/MoreJUnitMatchers.java similarity index 97% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/util/MoreJUnitMatchers.java rename to error-prone-utils/src/main/java/tech/picnic/errorprone/utils/MoreJUnitMatchers.java index 6e5e546b42..9439523a7b 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/util/MoreJUnitMatchers.java +++ b/error-prone-utils/src/main/java/tech/picnic/errorprone/utils/MoreJUnitMatchers.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.bugpatterns.util; +package tech.picnic.errorprone.utils; import static com.google.common.collect.ImmutableList.toImmutableList; import static com.google.errorprone.matchers.ChildMultiMatcher.MatchType.AT_LEAST_ONE; @@ -6,7 +6,7 @@ import static com.google.errorprone.matchers.Matchers.anyOf; import static com.google.errorprone.matchers.Matchers.isType; import static java.util.Objects.requireNonNullElse; -import static tech.picnic.errorprone.bugpatterns.util.MoreMatchers.hasMetaAnnotation; +import static tech.picnic.errorprone.utils.MoreMatchers.hasMetaAnnotation; import com.google.common.base.Strings; import com.google.common.collect.ImmutableList; diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/util/MoreMatchers.java b/error-prone-utils/src/main/java/tech/picnic/errorprone/utils/MoreMatchers.java similarity index 93% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/util/MoreMatchers.java rename to error-prone-utils/src/main/java/tech/picnic/errorprone/utils/MoreMatchers.java index eaa683c650..12ac984ca5 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/util/MoreMatchers.java +++ b/error-prone-utils/src/main/java/tech/picnic/errorprone/utils/MoreMatchers.java @@ -1,7 +1,7 @@ -package tech.picnic.errorprone.bugpatterns.util; +package tech.picnic.errorprone.utils; import static com.google.errorprone.matchers.Matchers.typePredicateMatcher; -import static tech.picnic.errorprone.bugpatterns.util.MoreTypePredicates.hasAnnotation; +import static tech.picnic.errorprone.utils.MoreTypePredicates.hasAnnotation; import com.google.errorprone.matchers.Matcher; import com.google.errorprone.matchers.Matchers; diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/util/MoreTypePredicates.java b/error-prone-utils/src/main/java/tech/picnic/errorprone/utils/MoreTypePredicates.java similarity index 98% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/util/MoreTypePredicates.java rename to error-prone-utils/src/main/java/tech/picnic/errorprone/utils/MoreTypePredicates.java index 3ed401d6d6..5dbe242999 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/util/MoreTypePredicates.java +++ b/error-prone-utils/src/main/java/tech/picnic/errorprone/utils/MoreTypePredicates.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.bugpatterns.util; +package tech.picnic.errorprone.utils; import com.google.errorprone.VisitorState; import com.google.errorprone.predicates.TypePredicate; diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/util/MoreTypes.java b/error-prone-utils/src/main/java/tech/picnic/errorprone/utils/MoreTypes.java similarity index 98% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/util/MoreTypes.java rename to error-prone-utils/src/main/java/tech/picnic/errorprone/utils/MoreTypes.java index 7f8c2f3706..d14e555c28 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/util/MoreTypes.java +++ b/error-prone-utils/src/main/java/tech/picnic/errorprone/utils/MoreTypes.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.bugpatterns.util; +package tech.picnic.errorprone.utils; import static java.util.stream.Collectors.toCollection; diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/util/SourceCode.java b/error-prone-utils/src/main/java/tech/picnic/errorprone/utils/SourceCode.java similarity index 99% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/util/SourceCode.java rename to error-prone-utils/src/main/java/tech/picnic/errorprone/utils/SourceCode.java index 1fd8a17f70..824b864942 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/util/SourceCode.java +++ b/error-prone-utils/src/main/java/tech/picnic/errorprone/utils/SourceCode.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.bugpatterns.util; +package tech.picnic.errorprone.utils; import static com.sun.tools.javac.parser.Tokens.TokenKind.RPAREN; import static com.sun.tools.javac.util.Position.NOPOS; diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/util/ThirdPartyLibrary.java b/error-prone-utils/src/main/java/tech/picnic/errorprone/utils/ThirdPartyLibrary.java similarity index 98% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/util/ThirdPartyLibrary.java rename to error-prone-utils/src/main/java/tech/picnic/errorprone/utils/ThirdPartyLibrary.java index 04c994a915..fd88bf9cc5 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/util/ThirdPartyLibrary.java +++ b/error-prone-utils/src/main/java/tech/picnic/errorprone/utils/ThirdPartyLibrary.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.bugpatterns.util; +package tech.picnic.errorprone.utils; import com.google.common.collect.ImmutableList; import com.google.errorprone.VisitorState; diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/util/package-info.java b/error-prone-utils/src/main/java/tech/picnic/errorprone/utils/package-info.java similarity index 75% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/util/package-info.java rename to error-prone-utils/src/main/java/tech/picnic/errorprone/utils/package-info.java index 4b8726cede..325fec921f 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/util/package-info.java +++ b/error-prone-utils/src/main/java/tech/picnic/errorprone/utils/package-info.java @@ -1,4 +1,4 @@ /** Auxiliary utilities for use by Error Prone checks. */ @com.google.errorprone.annotations.CheckReturnValue @org.jspecify.annotations.NullMarked -package tech.picnic.errorprone.bugpatterns.util; +package tech.picnic.errorprone.utils; diff --git a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/util/AnnotationAttributeMatcherTest.java b/error-prone-utils/src/test/java/tech/picnic/errorprone/utils/AnnotationAttributeMatcherTest.java similarity index 98% rename from error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/util/AnnotationAttributeMatcherTest.java rename to error-prone-utils/src/test/java/tech/picnic/errorprone/utils/AnnotationAttributeMatcherTest.java index 5819f720f5..87f4044025 100644 --- a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/util/AnnotationAttributeMatcherTest.java +++ b/error-prone-utils/src/test/java/tech/picnic/errorprone/utils/AnnotationAttributeMatcherTest.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.bugpatterns.util; +package tech.picnic.errorprone.utils; import static org.assertj.core.api.Assertions.assertThat; diff --git a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/util/ConflictDetectionTest.java b/error-prone-utils/src/test/java/tech/picnic/errorprone/utils/ConflictDetectionTest.java similarity index 98% rename from error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/util/ConflictDetectionTest.java rename to error-prone-utils/src/test/java/tech/picnic/errorprone/utils/ConflictDetectionTest.java index 70282dd4fa..525c422cb6 100644 --- a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/util/ConflictDetectionTest.java +++ b/error-prone-utils/src/test/java/tech/picnic/errorprone/utils/ConflictDetectionTest.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.bugpatterns.util; +package tech.picnic.errorprone.utils; import static com.google.errorprone.BugPattern.SeverityLevel.ERROR; diff --git a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/util/FlagsTest.java b/error-prone-utils/src/test/java/tech/picnic/errorprone/utils/FlagsTest.java similarity index 96% rename from error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/util/FlagsTest.java rename to error-prone-utils/src/test/java/tech/picnic/errorprone/utils/FlagsTest.java index 3ba51f0511..bc7658ce84 100644 --- a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/util/FlagsTest.java +++ b/error-prone-utils/src/test/java/tech/picnic/errorprone/utils/FlagsTest.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.bugpatterns.util; +package tech.picnic.errorprone.utils; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.params.provider.Arguments.arguments; diff --git a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/util/JavaKeywordsTest.java b/error-prone-utils/src/test/java/tech/picnic/errorprone/utils/JavaKeywordsTest.java similarity index 95% rename from error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/util/JavaKeywordsTest.java rename to error-prone-utils/src/test/java/tech/picnic/errorprone/utils/JavaKeywordsTest.java index 637b375cf9..2cdf48fcd6 100644 --- a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/util/JavaKeywordsTest.java +++ b/error-prone-utils/src/test/java/tech/picnic/errorprone/utils/JavaKeywordsTest.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.bugpatterns.util; +package tech.picnic.errorprone.utils; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.params.provider.Arguments.arguments; diff --git a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/util/MethodMatcherFactoryTest.java b/error-prone-utils/src/test/java/tech/picnic/errorprone/utils/MethodMatcherFactoryTest.java similarity index 99% rename from error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/util/MethodMatcherFactoryTest.java rename to error-prone-utils/src/test/java/tech/picnic/errorprone/utils/MethodMatcherFactoryTest.java index 2e06f291aa..e4e06f8460 100644 --- a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/util/MethodMatcherFactoryTest.java +++ b/error-prone-utils/src/test/java/tech/picnic/errorprone/utils/MethodMatcherFactoryTest.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.bugpatterns.util; +package tech.picnic.errorprone.utils; import static com.google.errorprone.BugPattern.SeverityLevel.SUGGESTION; import static org.assertj.core.api.Assertions.assertThatThrownBy; diff --git a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/util/MoreASTHelpersTest.java b/error-prone-utils/src/test/java/tech/picnic/errorprone/utils/MoreASTHelpersTest.java similarity index 99% rename from error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/util/MoreASTHelpersTest.java rename to error-prone-utils/src/test/java/tech/picnic/errorprone/utils/MoreASTHelpersTest.java index 19f3db045d..efd0a33bff 100644 --- a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/util/MoreASTHelpersTest.java +++ b/error-prone-utils/src/test/java/tech/picnic/errorprone/utils/MoreASTHelpersTest.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.bugpatterns.util; +package tech.picnic.errorprone.utils; import static com.google.errorprone.BugPattern.SeverityLevel.ERROR; diff --git a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/util/MoreJUnitMatchersTest.java b/error-prone-utils/src/test/java/tech/picnic/errorprone/utils/MoreJUnitMatchersTest.java similarity index 96% rename from error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/util/MoreJUnitMatchersTest.java rename to error-prone-utils/src/test/java/tech/picnic/errorprone/utils/MoreJUnitMatchersTest.java index f21d57c608..b8e7b6f81a 100644 --- a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/util/MoreJUnitMatchersTest.java +++ b/error-prone-utils/src/test/java/tech/picnic/errorprone/utils/MoreJUnitMatchersTest.java @@ -1,10 +1,10 @@ -package tech.picnic.errorprone.bugpatterns.util; +package tech.picnic.errorprone.utils; import static com.google.common.collect.ImmutableSet.toImmutableSet; import static com.google.errorprone.BugPattern.SeverityLevel.ERROR; -import static tech.picnic.errorprone.bugpatterns.util.MoreJUnitMatchers.HAS_METHOD_SOURCE; -import static tech.picnic.errorprone.bugpatterns.util.MoreJUnitMatchers.SETUP_OR_TEARDOWN_METHOD; -import static tech.picnic.errorprone.bugpatterns.util.MoreJUnitMatchers.TEST_METHOD; +import static tech.picnic.errorprone.utils.MoreJUnitMatchers.HAS_METHOD_SOURCE; +import static tech.picnic.errorprone.utils.MoreJUnitMatchers.SETUP_OR_TEARDOWN_METHOD; +import static tech.picnic.errorprone.utils.MoreJUnitMatchers.TEST_METHOD; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; diff --git a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/util/MoreMatchersTest.java b/error-prone-utils/src/test/java/tech/picnic/errorprone/utils/MoreMatchersTest.java similarity index 95% rename from error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/util/MoreMatchersTest.java rename to error-prone-utils/src/test/java/tech/picnic/errorprone/utils/MoreMatchersTest.java index b299ff20eb..31aebad8d3 100644 --- a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/util/MoreMatchersTest.java +++ b/error-prone-utils/src/test/java/tech/picnic/errorprone/utils/MoreMatchersTest.java @@ -1,9 +1,9 @@ -package tech.picnic.errorprone.bugpatterns.util; +package tech.picnic.errorprone.utils; import static com.google.errorprone.BugPattern.SeverityLevel.ERROR; -import static tech.picnic.errorprone.bugpatterns.util.MoreTypes.generic; -import static tech.picnic.errorprone.bugpatterns.util.MoreTypes.subOf; -import static tech.picnic.errorprone.bugpatterns.util.MoreTypes.type; +import static tech.picnic.errorprone.utils.MoreTypes.generic; +import static tech.picnic.errorprone.utils.MoreTypes.subOf; +import static tech.picnic.errorprone.utils.MoreTypes.type; import com.google.common.collect.ImmutableSet; import com.google.errorprone.BugPattern; diff --git a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/util/MoreTypesTest.java b/error-prone-utils/src/test/java/tech/picnic/errorprone/utils/MoreTypesTest.java similarity index 95% rename from error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/util/MoreTypesTest.java rename to error-prone-utils/src/test/java/tech/picnic/errorprone/utils/MoreTypesTest.java index 0a30ba4bc6..1901a63cbb 100644 --- a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/util/MoreTypesTest.java +++ b/error-prone-utils/src/test/java/tech/picnic/errorprone/utils/MoreTypesTest.java @@ -1,12 +1,12 @@ -package tech.picnic.errorprone.bugpatterns.util; +package tech.picnic.errorprone.utils; import static com.google.errorprone.BugPattern.SeverityLevel.ERROR; -import static tech.picnic.errorprone.bugpatterns.util.MoreTypes.generic; -import static tech.picnic.errorprone.bugpatterns.util.MoreTypes.raw; -import static tech.picnic.errorprone.bugpatterns.util.MoreTypes.subOf; -import static tech.picnic.errorprone.bugpatterns.util.MoreTypes.superOf; -import static tech.picnic.errorprone.bugpatterns.util.MoreTypes.type; -import static tech.picnic.errorprone.bugpatterns.util.MoreTypes.unbound; +import static tech.picnic.errorprone.utils.MoreTypes.generic; +import static tech.picnic.errorprone.utils.MoreTypes.raw; +import static tech.picnic.errorprone.utils.MoreTypes.subOf; +import static tech.picnic.errorprone.utils.MoreTypes.superOf; +import static tech.picnic.errorprone.utils.MoreTypes.type; +import static tech.picnic.errorprone.utils.MoreTypes.unbound; import com.google.common.collect.ImmutableSet; import com.google.errorprone.BugPattern; diff --git a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/util/SourceCodeTest.java b/error-prone-utils/src/test/java/tech/picnic/errorprone/utils/SourceCodeTest.java similarity index 99% rename from error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/util/SourceCodeTest.java rename to error-prone-utils/src/test/java/tech/picnic/errorprone/utils/SourceCodeTest.java index 131da0ba38..0b61a05413 100644 --- a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/util/SourceCodeTest.java +++ b/error-prone-utils/src/test/java/tech/picnic/errorprone/utils/SourceCodeTest.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.bugpatterns.util; +package tech.picnic.errorprone.utils; import static com.google.errorprone.BugPattern.SeverityLevel.ERROR; diff --git a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/util/ThirdPartyLibraryTest.java b/error-prone-utils/src/test/java/tech/picnic/errorprone/utils/ThirdPartyLibraryTest.java similarity index 98% rename from error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/util/ThirdPartyLibraryTest.java rename to error-prone-utils/src/test/java/tech/picnic/errorprone/utils/ThirdPartyLibraryTest.java index 4338f9af35..042aa32905 100644 --- a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/util/ThirdPartyLibraryTest.java +++ b/error-prone-utils/src/test/java/tech/picnic/errorprone/utils/ThirdPartyLibraryTest.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.bugpatterns.util; +package tech.picnic.errorprone.utils; import static com.google.errorprone.BugPattern.SeverityLevel.ERROR; import static java.util.stream.Collectors.joining; diff --git a/pom.xml b/pom.xml index b396087e32..12ff71fe60 100644 --- a/pom.xml +++ b/pom.xml @@ -41,6 +41,7 @@ documentation-support error-prone-contrib + error-prone-utils refaster-compiler refaster-runner refaster-support @@ -255,6 +256,11 @@ error-prone-contrib ${project.version} + + ${project.groupId} + error-prone-utils + ${project.version} + ${project.groupId} refaster-compiler