diff --git a/.github/release.yml b/.github/release.yml index 11251c5533..bbd41aea52 100644 --- a/.github/release.yml +++ b/.github/release.yml @@ -3,7 +3,7 @@ changelog: labels: - "ignore-changelog" categories: - - title: ":rocket: New Error Prone checks and Refaster templates" + - title: ":rocket: New Error Prone checks and Refaster rules" labels: - "new feature" - title: ":sparkles: Improvements" diff --git a/README.md b/README.md index 9aed90153b..ccd1ab3029 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ it: error-prone-contrib ${error-prone-support.version} - + tech.picnic.error-prone-support refaster-runner @@ -122,7 +122,7 @@ $ mvn clean install [INFO] ------------------------------------------------------------- [WARNING] COMPILATION WARNING : [INFO] ------------------------------------------------------------- -[WARNING] Example.java:[9,34] [tech.picnic.errorprone.refastertemplates.BigDecimalTemplates.BigDecimalZero] +[WARNING] Example.java:[9,34] [tech.picnic.errorprone.refasterrules.BigDecimalRules.BigDecimalZero] Did you mean 'return BigDecimal.ZERO;'? [WARNING] Example.java:[13,35] [IdentityConversion] This method invocation appears redundant; remove it or suppress this warning and add a comment explaining its purpose (see https://error-prone.picnic.tech/bugpatterns/IdentityConversion) @@ -136,12 +136,12 @@ Two things are kicking in here: 1. An Error Prone [`BugChecker`][error-prone-bugchecker] that flags unnecessary [identity conversions][bug-checks-identity-conversion]. -2. A [Refaster][refaster] template capable of - [rewriting][refaster-templates-bigdecimal] expressions of the form +2. A [Refaster][refaster] rule capable of + [rewriting][refaster-rules-bigdecimal] expressions of the form `BigDecimal.valueOf(0)` and `new BigDecimal(0)` to `BigDecimal.ZERO`. Be sure to check out all [bug checks][bug-checks] and [refaster -templates][refaster-templates]. +rules][refaster-rules]. ## 👷 Developing Error Prone Support @@ -227,5 +227,5 @@ guidelines][contributing]. [pitest-maven]: https://pitest.org/quickstart/maven [pr-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg [refaster]: https://errorprone.info/docs/refaster -[refaster-templates-bigdecimal]: https://github.com/PicnicSupermarket/error-prone-support/blob/master/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/BigDecimalTemplates.java -[refaster-templates]: https://github.com/PicnicSupermarket/error-prone-support/blob/master/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ +[refaster-rules-bigdecimal]: https://github.com/PicnicSupermarket/error-prone-support/blob/master/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/BigDecimalRules.java +[refaster-rules]: https://github.com/PicnicSupermarket/error-prone-support/blob/master/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/ diff --git a/error-prone-contrib/README.md b/error-prone-contrib/README.md index ace42e7da4..77ee5c6f85 100644 --- a/error-prone-contrib/README.md +++ b/error-prone-contrib/README.md @@ -267,7 +267,7 @@ Refaster's expressiveness: motivating example, see the two subtly different loop definitions in `CollectionRemoveAllFromCollectionExpression`. - Figure out why Refaster sometimes doesn't match the correct generic overload. - See the `AssertThatIterableHasOneComparableElementEqualTo` template for an + See the `AssertThatIterableHasOneComparableElementEqualTo` rule for an example. [autorefactor]: https://autorefactor.org 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 3859e9333d..bce994e816 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 @@ -24,7 +24,7 @@ /** * A {@link BugChecker} that flags AssertJ {@code isEqualTo(null)} checks for simplification. * - *

This bug checker cannot be replaced with a simple Refaster template, as the Refaster approach + *

This bug checker cannot be replaced with a simple Refaster rule, as the Refaster approach * would require that all overloads of {@link org.assertj.core.api.Assert#isEqualTo(Object)} (such * as {@link org.assertj.core.api.AbstractStringAssert#isEqualTo(String)}) are explicitly * enumerated. This bug checker generically matches all such current and future overloads. diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/MissingRefasterAnnotation.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/MissingRefasterAnnotation.java index efc8e9c009..74e92d95a2 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/MissingRefasterAnnotation.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/MissingRefasterAnnotation.java @@ -25,7 +25,7 @@ /** A {@link BugChecker} that flags likely missing Refaster annotations. */ @AutoService(BugChecker.class) @BugPattern( - summary = "The Refaster template contains a method without any Refaster annotations", + summary = "The Refaster rule contains a method without any Refaster annotations", link = BUG_PATTERNS_BASE_URL + "MissingRefasterAnnotation", linkType = CUSTOM, severity = WARNING, 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 e9e4948674..0e636b02e5 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 @@ -22,8 +22,8 @@ /** * A {@link BugChecker} that flags unnecessary {@link Refaster#anyOf(Object[])} usages. * - *

Note that this logic can't be implemented as a Refaster template, as the {@link Refaster} - * class is treated specially. + *

Note that this logic can't be implemented as a Refaster rule, as the {@link Refaster} class is + * treated specially. */ @AutoService(BugChecker.class) @BugPattern( diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/RefasterTemplateModifiers.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/RefasterRuleModifiers.java similarity index 93% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/RefasterTemplateModifiers.java rename to error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/RefasterRuleModifiers.java index 930baee235..fd016da91a 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/RefasterTemplateModifiers.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/RefasterRuleModifiers.java @@ -35,11 +35,11 @@ @AutoService(BugChecker.class) @BugPattern( summary = "Refaster class and method definitions should specify a canonical set of modifiers", - link = BUG_PATTERNS_BASE_URL + "RefasterTemplateModifiers", + link = BUG_PATTERNS_BASE_URL + "RefasterRuleModifiers", linkType = CUSTOM, severity = SUGGESTION, tags = STYLE) -public final class RefasterTemplateModifiers extends BugChecker +public final class RefasterRuleModifiers extends BugChecker implements ClassTreeMatcher, MethodTreeMatcher { private static final long serialVersionUID = 1L; private static final Matcher BEFORE_TEMPLATE_METHOD = hasAnnotation(BeforeTemplate.class); @@ -85,8 +85,8 @@ private static SuggestedFix suggestCanonicalModifiers(ClassTree tree, VisitorSta if (!hasMatchingMember(tree, PLACEHOLDER_METHOD, state)) { /* - * Templates without a `@Placeholder` method should be `final`. Note that Refaster enforces - * that `@Placeholder` methods are `abstract`, so templates _with_ such a method will + * Rules without a `@Placeholder` method should be `final`. Note that Refaster enforces + * that `@Placeholder` methods are `abstract`, so rules _with_ such a method will * naturally be `abstract` and non-`final`. */ modifiersToAdd.add(Modifier.FINAL); diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJBigDecimalTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/AssertJBigDecimalRules.java similarity index 82% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJBigDecimalTemplates.java rename to error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/AssertJBigDecimalRules.java index aea7797008..272b3ab194 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJBigDecimalTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/AssertJBigDecimalRules.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static org.assertj.core.data.Offset.offset; import static org.assertj.core.data.Percentage.withPercentage; @@ -11,17 +11,17 @@ import org.assertj.core.api.BigDecimalAssert; /** - * Refaster templates related to AssertJ assertions over {@link BigDecimal}s. + * Refaster rules related to AssertJ assertions over {@link BigDecimal}s. * - *

Note that, contrary to collections of Refaster templates for other {@link - * org.assertj.core.api.NumberAssert} subtypes, these templates do not rewrite to/from {@link + *

Note that, contrary to collections of Refaster rules for other {@link + * org.assertj.core.api.NumberAssert} subtypes, these rules do not rewrite to/from {@link * BigDecimalAssert#isEqualTo(Object)} and {@link BigDecimalAssert#isNotEqualTo(Object)}. This is * because {@link BigDecimal#equals(Object)} considers not only the numeric value of compared * instances, but also their scale. As a result various seemingly straightforward transformations * would actually subtly change the assertion's semantics. */ -final class AssertJBigDecimalTemplates { - private AssertJBigDecimalTemplates() {} +final class AssertJBigDecimalRules { + private AssertJBigDecimalRules() {} static final class AbstractBigDecimalAssertIsEqualByComparingTo { @BeforeTemplate diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJBigIntegerTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/AssertJBigIntegerRules.java similarity index 95% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJBigIntegerTemplates.java rename to error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/AssertJBigIntegerRules.java index 6394d1cda0..7b3ad736ca 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJBigIntegerTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/AssertJBigIntegerRules.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static org.assertj.core.data.Offset.offset; import static org.assertj.core.data.Percentage.withPercentage; @@ -11,8 +11,8 @@ // XXX: If we add a rule that drops unnecessary `L` suffixes from literal longs, then the `0L`/`1L` // cases below can go. -final class AssertJBigIntegerTemplates { - private AssertJBigIntegerTemplates() {} +final class AssertJBigIntegerRules { + private AssertJBigIntegerRules() {} static final class AbstractBigIntegerAssertIsEqualTo { @BeforeTemplate diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJBooleanTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/AssertJBooleanRules.java similarity index 95% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJBooleanTemplates.java rename to error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/AssertJBooleanRules.java index 6f56835c3f..9c28353c63 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJBooleanTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/AssertJBooleanRules.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static com.google.errorprone.refaster.ImportPolicy.STATIC_IMPORT_ALWAYS; import static org.assertj.core.api.Assertions.assertThat; @@ -9,8 +9,8 @@ import com.google.errorprone.refaster.annotation.UseImportPolicy; import org.assertj.core.api.AbstractBooleanAssert; -final class AssertJBooleanTemplates { - private AssertJBooleanTemplates() {} +final class AssertJBooleanRules { + private AssertJBooleanRules() {} static final class AbstractBooleanAssertIsEqualTo { @BeforeTemplate diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJByteTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/AssertJByteRules.java similarity index 94% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJByteTemplates.java rename to error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/AssertJByteRules.java index 220e3001e7..1c1134c387 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJByteTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/AssertJByteRules.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static org.assertj.core.data.Offset.offset; import static org.assertj.core.data.Percentage.withPercentage; @@ -8,8 +8,8 @@ import com.google.errorprone.refaster.annotation.BeforeTemplate; import org.assertj.core.api.AbstractByteAssert; -final class AssertJByteTemplates { - private AssertJByteTemplates() {} +final class AssertJByteRules { + private AssertJByteRules() {} static final class AbstractByteAssertIsEqualTo { @BeforeTemplate diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJCharSequenceTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/AssertJCharSequenceRules.java similarity index 92% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJCharSequenceTemplates.java rename to error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/AssertJCharSequenceRules.java index f528b7d285..545b7fec08 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJCharSequenceTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/AssertJCharSequenceRules.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static com.google.errorprone.refaster.ImportPolicy.STATIC_IMPORT_ALWAYS; import static org.assertj.core.api.Assertions.assertThat; @@ -9,8 +9,8 @@ import com.google.errorprone.refaster.annotation.UseImportPolicy; import org.assertj.core.api.AbstractAssert; -final class AssertJCharSequenceTemplates { - private AssertJCharSequenceTemplates() {} +final class AssertJCharSequenceRules { + private AssertJCharSequenceRules() {} static final class AssertThatCharSequenceIsEmpty { @BeforeTemplate diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJComparableTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/AssertJComparableRules.java similarity index 95% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJComparableTemplates.java rename to error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/AssertJComparableRules.java index 2d63f665da..ea92d58fb6 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJComparableTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/AssertJComparableRules.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static com.google.errorprone.refaster.ImportPolicy.STATIC_IMPORT_ALWAYS; import static org.assertj.core.api.Assertions.assertThat; @@ -9,8 +9,8 @@ import org.assertj.core.api.AbstractComparableAssert; import org.assertj.core.api.AbstractIntegerAssert; -final class AssertJComparableTemplates { - private AssertJComparableTemplates() {} +final class AssertJComparableRules { + private AssertJComparableRules() {} static final class AssertThatIsEqualByComparingTo> { @BeforeTemplate diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJDoubleTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/AssertJDoubleRules.java similarity index 95% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJDoubleTemplates.java rename to error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/AssertJDoubleRules.java index 44dc57b014..624018ffd9 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJDoubleTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/AssertJDoubleRules.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static org.assertj.core.data.Offset.offset; import static org.assertj.core.data.Percentage.withPercentage; @@ -9,8 +9,8 @@ import org.assertj.core.api.AbstractDoubleAssert; import org.assertj.core.data.Offset; -final class AssertJDoubleTemplates { - private AssertJDoubleTemplates() {} +final class AssertJDoubleRules { + private AssertJDoubleRules() {} static final class AbstractDoubleAssertIsCloseToWithOffset { @BeforeTemplate diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJEnumerableTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/AssertJEnumerableRules.java similarity index 93% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJEnumerableTemplates.java rename to error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/AssertJEnumerableRules.java index 7f20919951..a891bfbc06 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJEnumerableTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/AssertJEnumerableRules.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import com.google.common.collect.Iterables; import com.google.errorprone.refaster.Refaster; @@ -7,8 +7,8 @@ import java.util.Collection; import org.assertj.core.api.EnumerableAssert; -final class AssertJEnumerableTemplates { - private AssertJEnumerableTemplates() {} +final class AssertJEnumerableRules { + private AssertJEnumerableRules() {} static final class EnumerableAssertIsEmpty { @BeforeTemplate diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJFloatTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/AssertJFloatRules.java similarity index 95% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJFloatTemplates.java rename to error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/AssertJFloatRules.java index 6de54b99cb..8952ca4f2b 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJFloatTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/AssertJFloatRules.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static org.assertj.core.data.Offset.offset; import static org.assertj.core.data.Percentage.withPercentage; @@ -9,8 +9,8 @@ import org.assertj.core.api.AbstractFloatAssert; import org.assertj.core.data.Offset; -final class AssertJFloatTemplates { - private AssertJFloatTemplates() {} +final class AssertJFloatRules { + private AssertJFloatRules() {} static final class AbstractFloatAssertIsCloseToWithOffset { @BeforeTemplate diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJIntegerTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/AssertJIntegerRules.java similarity index 94% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJIntegerTemplates.java rename to error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/AssertJIntegerRules.java index f46ac40564..d134bfe6c8 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJIntegerTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/AssertJIntegerRules.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static org.assertj.core.data.Offset.offset; import static org.assertj.core.data.Percentage.withPercentage; @@ -8,8 +8,8 @@ import com.google.errorprone.refaster.annotation.BeforeTemplate; import org.assertj.core.api.AbstractIntegerAssert; -final class AssertJIntegerTemplates { - private AssertJIntegerTemplates() {} +final class AssertJIntegerRules { + private AssertJIntegerRules() {} static final class AbstractIntegerAssertIsEqualTo { @BeforeTemplate diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJLongTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/AssertJLongRules.java similarity index 94% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJLongTemplates.java rename to error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/AssertJLongRules.java index e992886dff..3ac9275fc2 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJLongTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/AssertJLongRules.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static org.assertj.core.data.Offset.offset; import static org.assertj.core.data.Percentage.withPercentage; @@ -8,8 +8,8 @@ import com.google.errorprone.refaster.annotation.BeforeTemplate; import org.assertj.core.api.AbstractLongAssert; -final class AssertJLongTemplates { - private AssertJLongTemplates() {} +final class AssertJLongRules { + private AssertJLongRules() {} static final class AbstractLongAssertIsEqualTo { @BeforeTemplate diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJMapTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/AssertJMapRules.java similarity index 90% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJMapTemplates.java rename to error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/AssertJMapRules.java index 566caa3265..dfbd303ea3 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJMapTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/AssertJMapRules.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import com.google.common.collect.ImmutableMap; import com.google.errorprone.refaster.annotation.AfterTemplate; @@ -6,8 +6,8 @@ import java.util.Map; import org.assertj.core.api.AbstractMapAssert; -final class AssertJMapTemplates { - private AssertJMapTemplates() {} +final class AssertJMapRules { + private AssertJMapRules() {} static final class AbstractMapAssertContainsExactlyInAnyOrderEntriesOf { @BeforeTemplate diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJNumberTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/AssertJNumberRules.java similarity index 98% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJNumberTemplates.java rename to error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/AssertJNumberRules.java index 0c7f08b6aa..fac67d6068 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJNumberTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/AssertJNumberRules.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static com.google.errorprone.refaster.ImportPolicy.STATIC_IMPORT_ALWAYS; import static org.assertj.core.api.Assertions.assertThat; @@ -21,8 +21,8 @@ import org.assertj.core.api.NumberAssert; import tech.picnic.errorprone.refaster.matchers.IsCharacter; -final class AssertJNumberTemplates { - private AssertJNumberTemplates() {} +final class AssertJNumberRules { + private AssertJNumberRules() {} static final class NumberAssertIsPositive { @BeforeTemplate diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJObjectTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/AssertJObjectRules.java similarity index 95% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJObjectTemplates.java rename to error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/AssertJObjectRules.java index 458a4c2c66..b5122b7296 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJObjectTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/AssertJObjectRules.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static com.google.errorprone.refaster.ImportPolicy.STATIC_IMPORT_ALWAYS; import static org.assertj.core.api.Assertions.assertThat; @@ -11,8 +11,8 @@ import org.assertj.core.api.AbstractStringAssert; import org.assertj.core.api.ObjectAssert; -final class AssertJObjectTemplates { - private AssertJObjectTemplates() {} +final class AssertJObjectRules { + private AssertJObjectRules() {} static final class AssertThatIsInstanceOf { @BeforeTemplate diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJOptionalTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/AssertJOptionalRules.java similarity index 97% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJOptionalTemplates.java rename to error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/AssertJOptionalRules.java index 6769749cf5..f14bef43ad 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJOptionalTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/AssertJOptionalRules.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static com.google.errorprone.refaster.ImportPolicy.STATIC_IMPORT_ALWAYS; import static org.assertj.core.api.Assertions.assertThat; @@ -15,8 +15,8 @@ import org.assertj.core.api.ObjectAssert; import org.assertj.core.api.OptionalAssert; -final class AssertJOptionalTemplates { - private AssertJOptionalTemplates() {} +final class AssertJOptionalRules { + private AssertJOptionalRules() {} static final class AssertThatOptional { @BeforeTemplate diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJPrimitiveTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/AssertJPrimitiveRules.java similarity index 96% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJPrimitiveTemplates.java rename to error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/AssertJPrimitiveRules.java index b58a703c71..7635e37037 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJPrimitiveTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/AssertJPrimitiveRules.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static com.google.errorprone.refaster.ImportPolicy.STATIC_IMPORT_ALWAYS; import static org.assertj.core.api.Assertions.assertThat; @@ -10,8 +10,8 @@ import org.assertj.core.api.AbstractBooleanAssert; import org.assertj.core.api.AbstractDoubleAssert; -final class AssertJPrimitiveTemplates { - private AssertJPrimitiveTemplates() {} +final class AssertJPrimitiveRules { + private AssertJPrimitiveRules() {} static final class AssertThatIsEqualTo { @BeforeTemplate diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/AssertJRules.java similarity index 99% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJTemplates.java rename to error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/AssertJRules.java index e941254bb1..4da5ba9c92 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/AssertJRules.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static com.google.errorprone.refaster.ImportPolicy.STATIC_IMPORT_ALWAYS; import static org.assertj.core.api.Assertions.assertThat; @@ -55,7 +55,7 @@ import org.assertj.core.api.OptionalLongAssert; import tech.picnic.errorprone.refaster.matchers.IsArray; -/** Refaster templates related to AssertJ expressions and statements. */ +/** Refaster rules related to AssertJ expressions and statements. */ // XXX: Most `AbstractIntegerAssert` rules can also be applied for other primitive types. Generate // these in separate files. // XXX: Also do for BigInteger/BigDecimal? @@ -63,7 +63,7 @@ // ^ And variants. // XXX: Consider splitting this class into multiple classes. // XXX: Some of these rules may not apply given the updated TestNG rewrite rules. Review. -// XXX: For the templates that "unwrap" explicitly enumerated collections, also introduce variants +// XXX: For the rules that "unwrap" explicitly enumerated collections, also introduce variants // with explicitly enumerated sorted collections. (Requires that the type bound is Comparable.) // XXX: Handle `.isEqualTo(explicitlyEnumeratedCollection)`. Can be considered equivalent to // `.containsOnly(elements)`. (This does mean the auto-generated code needs to be more advanced. @@ -101,7 +101,7 @@ // (etc.) // XXX: Look into using Assertions#contentOf(URL url, Charset charset) instead of our own test // method. -// XXX: Write Optional templates also for `OptionalInt` and variants. +// XXX: Write `Optional` rules also for `OptionalInt` and variants. // XXX: Write plugin to flag `assertThat(compileTimeConstant)` occurrences. Also other likely // candidates, such as `assertThat(ImmutableSet(foo, bar)).XXX` // XXX: Write generic plugin to replace explicit array parameters with varargs (`new int[] {1, 2}` @@ -118,10 +118,10 @@ // XXX: `assertThat(ImmutableList.sortedCopyOf(cmp, values)).somethingExactOrder` -> just compare // "in any order". // XXX: Turns out a lot of this is also covered by https://github.com/palantir/assertj-automation. -// See how we can combine these things. Do note that (at present) their Refaster templates don't -// show up as Error Prone checks. So we'd have to build an integration for that. -final class AssertJTemplates { - private AssertJTemplates() {} +// See how we can combine these things. Do note that (at present) their Refaster rules don't show up +// as Error Prone checks. So we'd have to build an integration for that. +final class AssertJRules { + private AssertJRules() {} // // OptionalDouble @@ -491,7 +491,7 @@ IterableAssert after(Iterable iterable, T element) { } // XXX: This overload is here because `assertThat` has an overload for `Comparable` types. - // Unfortunately this still doesn't convince Refaster to match this template in the context of + // Unfortunately this still doesn't convince Refaster to match this rule in the context of // Comparable types. Figure out why! Note that this also affects the `AssertThatOptional` rule. static final class AssertThatIterableHasOneComparableElementEqualTo< S extends Comparable, T extends S> { diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJShortTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/AssertJShortRules.java similarity index 94% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJShortTemplates.java rename to error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/AssertJShortRules.java index 017f897b93..a09e34ca2b 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJShortTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/AssertJShortRules.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static org.assertj.core.data.Offset.offset; import static org.assertj.core.data.Percentage.withPercentage; @@ -8,8 +8,8 @@ import com.google.errorprone.refaster.annotation.BeforeTemplate; import org.assertj.core.api.AbstractShortAssert; -final class AssertJShortTemplates { - private AssertJShortTemplates() {} +final class AssertJShortRules { + private AssertJShortRules() {} static final class AbstractShortAssertIsEqualTo { @BeforeTemplate diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJStringTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/AssertJStringRules.java similarity index 95% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJStringTemplates.java rename to error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/AssertJStringRules.java index c217193bf5..d149d3b1ff 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJStringTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/AssertJStringRules.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static com.google.errorprone.refaster.ImportPolicy.STATIC_IMPORT_ALWAYS; import static org.assertj.core.api.Assertions.assertThat; @@ -9,8 +9,8 @@ import org.assertj.core.api.AbstractAssert; import org.assertj.core.api.AbstractStringAssert; -final class AssertJStringTemplates { - private AssertJStringTemplates() {} +final class AssertJStringRules { + private AssertJStringRules() {} static final class AbstractStringAssertStringIsEmpty { @BeforeTemplate diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJThrowingCallableTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/AssertJThrowingCallableRules.java similarity index 97% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJThrowingCallableTemplates.java rename to error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/AssertJThrowingCallableRules.java index 14ebac29d5..f221f66425 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJThrowingCallableTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/AssertJThrowingCallableRules.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static com.google.errorprone.refaster.ImportPolicy.STATIC_IMPORT_ALWAYS; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; @@ -18,16 +18,16 @@ import org.assertj.core.api.ThrowableAssert.ThrowingCallable; /** - * Refaster templates related to AssertJ assertions over expressions that may throw a {@link - * Throwable} subtype. + * Refaster rules related to AssertJ assertions over expressions that may throw a {@link Throwable} + * subtype. * *

For reasons of consistency we prefer {@link * org.assertj.core.api.Assertions#assertThatThrownBy} over static methods for specific exception * types. Note that only the most common assertion expressions are rewritten here; covering all * cases would require the implementation of an Error Prone check instead. */ -final class AssertJThrowingCallableTemplates { - private AssertJThrowingCallableTemplates() {} +final class AssertJThrowingCallableRules { + private AssertJThrowingCallableRules() {} static final class AssertThatThrownByIllegalArgumentException { @BeforeTemplate @@ -429,8 +429,8 @@ static final class AssertThatThrownByHasMessageParameters { } } - // XXX: Drop this template in favour of a generic Error Prone check that flags - // `String.format(...)` arguments to a wide range of format methods. + // XXX: Drop this rule in favour of a generic Error Prone check that flags `String.format(...)` + // arguments to a wide range of format methods. static final class AbstractThrowableAssertHasMessage { @BeforeTemplate AbstractThrowableAssert before( @@ -449,8 +449,8 @@ static final class AbstractThrowableAssertHasMessage { } } - // XXX: Drop this template in favour of a generic Error Prone check that flags - // `String.format(...)` arguments to a wide range of format methods. + // XXX: Drop this rule in favour of a generic Error Prone check that flags `String.format(...)` + // arguments to a wide range of format methods. static final class AbstractThrowableAssertWithFailMessage { @BeforeTemplate AbstractThrowableAssert before( diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssortedTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/AssortedRules.java similarity index 94% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssortedTemplates.java rename to error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/AssortedRules.java index 62ec075c2a..872f9eced8 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssortedTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/AssortedRules.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static com.google.common.base.Preconditions.checkElementIndex; import static com.google.common.collect.ImmutableSet.toImmutableSet; @@ -30,11 +30,11 @@ import javax.annotation.Nullable; /** - * Assorted Refaster templates that do not (yet) belong in one of the other classes with more - * topical Refaster templates. + * Assorted Refaster rules that do not (yet) belong in one of the other classes with more topical + * Refaster rules. */ -final class AssortedTemplates { - private AssortedTemplates() {} +final class AssortedRules { + private AssortedRules() {} /** Prefer {@link Objects#checkIndex(int, int)} over the Guava alternative. */ static final class CheckIndex { @@ -117,7 +117,7 @@ T after(Iterator iterator, T defaultValue) { } /** Don't unnecessarily repeat boolean expressions. */ - // XXX: This template captures only the simplest case. `@AlsoNegation` doesn't help. Consider + // XXX: This rule captures only the simplest case. `@AlsoNegation` doesn't help. Consider // contributing a Refaster patch, which handles the negation in the `@BeforeTemplate` more // intelligently. static final class LogicalImplication { @@ -172,8 +172,8 @@ boolean after(Set set1, Set set2) { * Collections#disjoint(Collection, Collection)}. */ // XXX: Other copy operations could be elided too, but these are most common after application of - // the `DisjointSets` template defined above. If we ever introduce a generic "makes a copy" - // stand-in, use it here. + // the `DisjointSets` rule defined above. If we ever introduce a generic "makes a copy" stand-in, + // use it here. static final class DisjointCollections { @BeforeTemplate boolean before(Collection collection1, Collection collection2) { diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/BigDecimalTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/BigDecimalRules.java similarity index 89% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/BigDecimalTemplates.java rename to error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/BigDecimalRules.java index e6169e9b46..7f27917660 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/BigDecimalTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/BigDecimalRules.java @@ -1,13 +1,13 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import com.google.errorprone.refaster.Refaster; import com.google.errorprone.refaster.annotation.AfterTemplate; import com.google.errorprone.refaster.annotation.BeforeTemplate; import java.math.BigDecimal; -/** Refaster templates related to expressions dealing with {@link BigDecimal}s. */ -final class BigDecimalTemplates { - private BigDecimalTemplates() {} +/** Refaster rules related to expressions dealing with {@link BigDecimal}s. */ +final class BigDecimalRules { + private BigDecimalRules() {} /** Prefer using the constant {@link BigDecimal#ZERO} when possible. */ static final class BigDecimalZero { diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/CollectionTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/CollectionRules.java similarity index 98% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/CollectionTemplates.java rename to error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/CollectionRules.java index 55f8a100a0..e02c12c2a2 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/CollectionTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/CollectionRules.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import com.google.common.collect.ImmutableCollection; import com.google.common.collect.ImmutableList; @@ -20,11 +20,11 @@ import java.util.function.IntFunction; import java.util.stream.Stream; -/** Refaster templates related to expressions dealing with (arbitrary) collections. */ +/** Refaster rules related to expressions dealing with (arbitrary) collections. */ // XXX: There are other Guava `Iterables` methods that should not be called if the input is known to // be a `Collection`. Add those here. -final class CollectionTemplates { - private CollectionTemplates() {} +final class CollectionRules { + private CollectionRules() {} /** * Prefer {@link Collection#isEmpty()} over alternatives that consult the collection's size or are diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ComparatorTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/ComparatorRules.java similarity index 97% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ComparatorTemplates.java rename to error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/ComparatorRules.java index c088b8fa82..3a1e94d32b 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ComparatorTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/ComparatorRules.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static com.google.errorprone.refaster.ImportPolicy.STATIC_IMPORT_ALWAYS; import static java.util.Comparator.comparing; @@ -25,9 +25,9 @@ import java.util.function.ToIntFunction; import java.util.function.ToLongFunction; -/** Refaster templates related to expressions dealing with {@link Comparator}s. */ -final class ComparatorTemplates { - private ComparatorTemplates() {} +/** Refaster rules related to expressions dealing with {@link Comparator}s. */ +final class ComparatorRules { + private ComparatorRules() {} /** Prefer {@link Comparator#naturalOrder()} over more complicated constructs. */ static final class NaturalOrder> { diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/DoubleStreamTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/DoubleStreamRules.java similarity index 97% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/DoubleStreamTemplates.java rename to error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/DoubleStreamRules.java index 32ab0fbeaa..7e8e007b19 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/DoubleStreamTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/DoubleStreamRules.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import com.google.common.collect.Streams; import com.google.errorprone.refaster.Refaster; @@ -13,9 +13,9 @@ import java.util.stream.DoubleStream; import java.util.stream.Stream; -/** Refaster templates related to expressions dealing with {@link DoubleStream}s. */ -final class DoubleStreamTemplates { - private DoubleStreamTemplates() {} +/** Refaster rules related to expressions dealing with {@link DoubleStream}s. */ +final class DoubleStreamRules { + private DoubleStreamRules() {} /** Don't unnecessarily call {@link Streams#concat(DoubleStream...)}. */ static final class ConcatOneDoubleStream { diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/EqualityTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/EqualityRules.java similarity index 94% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/EqualityTemplates.java rename to error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/EqualityRules.java index 3cb561b11a..6aaccd1d4d 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/EqualityTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/EqualityRules.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import com.google.errorprone.refaster.Refaster; import com.google.errorprone.refaster.annotation.AfterTemplate; @@ -7,9 +7,9 @@ import java.util.Objects; import java.util.function.Predicate; -/** Refaster templates related to expressions dealing with (in)equalities. */ -final class EqualityTemplates { - private EqualityTemplates() {} +/** Refaster rules related to expressions dealing with (in)equalities. */ +final class EqualityRules { + private EqualityRules() {} /** Prefer reference-based quality for enums. */ // Primitive value comparisons are not listed, because Error Prone flags those out of the box. diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ImmutableListMultimapTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/ImmutableListMultimapRules.java similarity index 97% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ImmutableListMultimapTemplates.java rename to error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/ImmutableListMultimapRules.java index e1da7db817..87fc03db95 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ImmutableListMultimapTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/ImmutableListMultimapRules.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static com.google.common.collect.ImmutableListMultimap.flatteningToImmutableListMultimap; import static com.google.common.collect.ImmutableListMultimap.toImmutableListMultimap; @@ -25,9 +25,9 @@ import java.util.function.Function; import java.util.stream.Stream; -/** Refaster templates related to expressions dealing with {@link ImmutableListMultimap}s. */ -final class ImmutableListMultimapTemplates { - private ImmutableListMultimapTemplates() {} +/** Refaster rules related to expressions dealing with {@link ImmutableListMultimap}s. */ +final class ImmutableListMultimapRules { + private ImmutableListMultimapRules() {} /** * Prefer {@link ImmutableListMultimap#builder()} over the associated constructor on constructions @@ -70,7 +70,7 @@ ImmutableListMultimap after() { * alternatives. */ // XXX: One can define variants for more than one key-value pair, but at some point the builder - // actually produces nicer code. So it's not clear we should add Refaster templates for those + // actually produces nicer code. So it's not clear we should add Refaster rules for those // variants. static final class PairToImmutableListMultimap { @BeforeTemplate diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ImmutableListTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/ImmutableListRules.java similarity index 96% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ImmutableListTemplates.java rename to error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/ImmutableListRules.java index 082fadf231..de9aca4deb 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ImmutableListTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/ImmutableListRules.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static com.google.common.collect.ImmutableList.toImmutableList; import static com.google.common.collect.ImmutableSet.toImmutableSet; @@ -21,9 +21,9 @@ import java.util.List; import java.util.stream.Stream; -/** Refaster templates related to expressions dealing with {@link ImmutableList}s. */ -final class ImmutableListTemplates { - private ImmutableListTemplates() {} +/** Refaster rules related to expressions dealing with {@link ImmutableList}s. */ +final class ImmutableListRules { + private ImmutableListRules() {} /** Prefer {@link ImmutableList#builder()} over the associated constructor. */ // XXX: This drops generic type information, sometimes leading to non-compilable code. See @@ -154,7 +154,7 @@ ImmutableList after(Stream stream) { * communicate the immutability of the resulting list at the type level. */ // XXX: The `Stream` variant may be too contrived to warrant inclusion. Review its usage if/when - // this and similar Refaster templates are replaced with an Error Prone check. + // this and similar Refaster rules are replaced with an Error Prone check. static final class ImmutableListOf { @BeforeTemplate List before() { diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ImmutableMapTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/ImmutableMapRules.java similarity index 98% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ImmutableMapTemplates.java rename to error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/ImmutableMapRules.java index ad9a4e3a70..2d1906983f 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ImmutableMapTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/ImmutableMapRules.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static com.google.common.collect.ImmutableMap.toImmutableMap; import static com.google.errorprone.refaster.ImportPolicy.STATIC_IMPORT_ALWAYS; @@ -22,9 +22,9 @@ import java.util.function.Function; import java.util.stream.Stream; -/** Refaster templates related to expressions dealing with {@link ImmutableMap}s. */ -final class ImmutableMapTemplates { - private ImmutableMapTemplates() {} +/** Refaster rules related to expressions dealing with {@link ImmutableMap}s. */ +final class ImmutableMapRules { + private ImmutableMapRules() {} /** Prefer {@link ImmutableMap#builder()} over the associated constructor. */ // XXX: This drops generic type information, sometimes leading to non-compilable code. See @@ -313,7 +313,7 @@ ImmutableMap after(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V } } - // XXX: Add a template for this: + // XXX: Add a rule for this: // Maps.transformValues(streamOfEntries.collect(groupBy(fun)), ImmutableMap::copyOf) // -> // streamOfEntries.collect(groupBy(fun, toImmutableMap(Map.Entry::getKey, Map.Entry::getValue))) diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ImmutableMultisetTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/ImmutableMultisetRules.java similarity index 93% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ImmutableMultisetTemplates.java rename to error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/ImmutableMultisetRules.java index d60264965f..07802c7741 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ImmutableMultisetTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/ImmutableMultisetRules.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static com.google.common.collect.ImmutableMultiset.toImmutableMultiset; import static com.google.errorprone.refaster.ImportPolicy.STATIC_IMPORT_ALWAYS; @@ -14,9 +14,9 @@ import java.util.Iterator; import java.util.stream.Stream; -/** Refaster templates related to expressions dealing with {@link ImmutableMultiset}s. */ -final class ImmutableMultisetTemplates { - private ImmutableMultisetTemplates() {} +/** Refaster rules related to expressions dealing with {@link ImmutableMultiset}s. */ +final class ImmutableMultisetRules { + private ImmutableMultisetRules() {} /** Prefer {@link ImmutableMultiset#builder()} over the associated constructor. */ // XXX: This drops generic type information, sometimes leading to non-compilable code. See diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ImmutableSetMultimapTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/ImmutableSetMultimapRules.java similarity index 97% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ImmutableSetMultimapTemplates.java rename to error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/ImmutableSetMultimapRules.java index ed991be8ef..8272c05b57 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ImmutableSetMultimapTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/ImmutableSetMultimapRules.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static com.google.common.collect.ImmutableSetMultimap.flatteningToImmutableSetMultimap; import static com.google.common.collect.ImmutableSetMultimap.toImmutableSetMultimap; @@ -22,9 +22,9 @@ import java.util.function.Function; import java.util.stream.Stream; -/** Refaster templates related to expressions dealing with {@link ImmutableSetMultimap}s. */ -final class ImmutableSetMultimapTemplates { - private ImmutableSetMultimapTemplates() {} +/** Refaster rules related to expressions dealing with {@link ImmutableSetMultimap}s. */ +final class ImmutableSetMultimapRules { + private ImmutableSetMultimapRules() {} /** Prefer {@link ImmutableSetMultimap#builder()} over the associated constructor. */ // XXX: This drops generic type information, sometimes leading to non-compilable code. See @@ -56,7 +56,7 @@ ImmutableSetMultimap after() { /** Prefer {@link ImmutableSetMultimap#of(Object, Object)} over more contrived alternatives. */ // XXX: One can define variants for more than one key-value pair, but at some point the builder - // actually produces nicer code. So it's not clear we should add Refaster templates for those + // actually produces nicer code. So it's not clear we should add Refaster rules for those // variants. static final class PairToImmutableSetMultimap { @BeforeTemplate diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ImmutableSetTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/ImmutableSetRules.java similarity index 95% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ImmutableSetTemplates.java rename to error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/ImmutableSetRules.java index b710f4e7a1..b7159b886a 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ImmutableSetTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/ImmutableSetRules.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static com.google.common.collect.ImmutableSet.toImmutableSet; import static com.google.errorprone.refaster.ImportPolicy.STATIC_IMPORT_ALWAYS; @@ -18,9 +18,9 @@ import java.util.Set; import java.util.stream.Stream; -/** Refaster templates related to expressions dealing with {@link ImmutableSet}s. */ -final class ImmutableSetTemplates { - private ImmutableSetTemplates() {} +/** Refaster rules related to expressions dealing with {@link ImmutableSet}s. */ +final class ImmutableSetRules { + private ImmutableSetRules() {} /** Prefer {@link ImmutableSet#builder()} over the associated constructor. */ // XXX: This drops generic type information, sometimes leading to non-compilable code. See @@ -104,7 +104,7 @@ ImmutableSet after(SetView set) { * communicate the immutability of the resulting set at the type level. */ // XXX: The `Stream` variant may be too contrived to warrant inclusion. Review its usage if/when - // this and similar Refaster templates are replaced with an Error Prone check. + // this and similar Refaster rules are replaced with an Error Prone check. static final class ImmutableSetOf { @BeforeTemplate Set before() { diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ImmutableSortedMapTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/ImmutableSortedMapRules.java similarity index 95% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ImmutableSortedMapTemplates.java rename to error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/ImmutableSortedMapRules.java index e5e265d684..ff03163cad 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ImmutableSortedMapTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/ImmutableSortedMapRules.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static com.google.common.collect.ImmutableSortedMap.toImmutableSortedMap; import static java.util.Comparator.naturalOrder; @@ -14,9 +14,9 @@ import java.util.Map; import java.util.stream.Stream; -/** Refaster templates related to expressions dealing with {@link ImmutableSortedMap}s. */ -final class ImmutableSortedMapTemplates { - private ImmutableSortedMapTemplates() {} +/** Refaster rules related to expressions dealing with {@link ImmutableSortedMap}s. */ +final class ImmutableSortedMapRules { + private ImmutableSortedMapRules() {} /** Prefer {@link ImmutableSortedMap#orderedBy(Comparator)} over the associated constructor. */ static final class ImmutableSortedMapBuilder { @@ -82,7 +82,7 @@ ImmutableSortedMap after() { /** Prefer {@link ImmutableSortedMap#of(Object, Object)} over more contrived alternatives. */ // XXX: One can define variants for more than one key-value pair, but at some point the builder - // actually produces nicer code. So it's not clear we should add Refaster templates for those + // actually produces nicer code. So it's not clear we should add Refaster rules for those // variants. // XXX: We could also rewrite builders with non-natural orders, but that would affect // `ImmutableSortedMap#comparator()`. diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ImmutableSortedMultisetTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/ImmutableSortedMultisetRules.java similarity index 95% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ImmutableSortedMultisetTemplates.java rename to error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/ImmutableSortedMultisetRules.java index 68252ae21d..0e8a252223 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ImmutableSortedMultisetTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/ImmutableSortedMultisetRules.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static com.google.common.collect.ImmutableSortedMultiset.toImmutableSortedMultiset; import static com.google.errorprone.refaster.ImportPolicy.STATIC_IMPORT_ALWAYS; @@ -16,9 +16,9 @@ import java.util.Iterator; import java.util.stream.Stream; -/** Refaster templates related to expressions dealing with {@link ImmutableSortedMultiset}s. */ -final class ImmutableSortedMultisetTemplates { - private ImmutableSortedMultisetTemplates() {} +/** Refaster rules related to expressions dealing with {@link ImmutableSortedMultiset}s. */ +final class ImmutableSortedMultisetRules { + private ImmutableSortedMultisetRules() {} /** * Prefer {@link ImmutableSortedMultiset#orderedBy(Comparator)} over the associated constructor. diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ImmutableSortedSetTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/ImmutableSortedSetRules.java similarity index 95% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ImmutableSortedSetTemplates.java rename to error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/ImmutableSortedSetRules.java index bac035d3b0..627fdf7c0f 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ImmutableSortedSetTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/ImmutableSortedSetRules.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static com.google.common.collect.ImmutableSortedSet.toImmutableSortedSet; import static com.google.errorprone.refaster.ImportPolicy.STATIC_IMPORT_ALWAYS; @@ -16,9 +16,9 @@ import java.util.Iterator; import java.util.stream.Stream; -/** Refaster templates related to expressions dealing with {@link ImmutableSortedSet}s. */ -final class ImmutableSortedSetTemplates { - private ImmutableSortedSetTemplates() {} +/** Refaster rules related to expressions dealing with {@link ImmutableSortedSet}s. */ +final class ImmutableSortedSetRules { + private ImmutableSortedSetRules() {} /** Prefer {@link ImmutableSortedSet#orderedBy(Comparator)} over the associated constructor. */ static final class ImmutableSortedSetBuilder { diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/IntStreamTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/IntStreamRules.java similarity index 97% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/IntStreamTemplates.java rename to error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/IntStreamRules.java index 52d8bb2d66..382f5d332b 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/IntStreamTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/IntStreamRules.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import com.google.common.collect.Streams; import com.google.errorprone.refaster.Refaster; @@ -13,9 +13,9 @@ import java.util.stream.IntStream; import java.util.stream.Stream; -/** Refaster templates related to expressions dealing with {@link IntStream}s. */ -final class IntStreamTemplates { - private IntStreamTemplates() {} +/** Refaster rules related to expressions dealing with {@link IntStream}s. */ +final class IntStreamRules { + private IntStreamRules() {} /** Prefer {@link IntStream#range(int, int)} over the more contrived alternative. */ static final class IntStreamClosedOpenRange { diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/JUnitTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/JUnitRules.java similarity index 82% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/JUnitTemplates.java rename to error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/JUnitRules.java index 3386787e95..b2c5942856 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/JUnitTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/JUnitRules.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static com.google.errorprone.refaster.ImportPolicy.STATIC_IMPORT_ALWAYS; import static org.junit.jupiter.params.provider.Arguments.arguments; @@ -9,9 +9,9 @@ import com.google.errorprone.refaster.annotation.UseImportPolicy; import org.junit.jupiter.params.provider.Arguments; -/** Refaster templates related to JUnit expressions and statements. */ -final class JUnitTemplates { - private JUnitTemplates() {} +/** Refaster rules related to JUnit expressions and statements. */ +final class JUnitRules { + private JUnitRules() {} /** Prefer statically imported {@link Arguments#arguments} over {@link Arguments#of} calls. */ static final class ArgumentsEnumeration { diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/LongStreamTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/LongStreamRules.java similarity index 97% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/LongStreamTemplates.java rename to error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/LongStreamRules.java index 2cefe257f3..45b4c0da30 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/LongStreamTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/LongStreamRules.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import com.google.common.collect.Streams; import com.google.errorprone.refaster.Refaster; @@ -13,9 +13,9 @@ import java.util.stream.LongStream; import java.util.stream.Stream; -/** Refaster templates related to expressions dealing with {@link LongStream}s. */ -final class LongStreamTemplates { - private LongStreamTemplates() {} +/** Refaster rules related to expressions dealing with {@link LongStream}s. */ +final class LongStreamRules { + private LongStreamRules() {} /** Prefer {@link LongStream#range(long, long)} over the more contrived alternative. */ static final class LongStreamClosedOpenRange { diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/MapEntryTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/MapEntryRules.java similarity index 94% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/MapEntryTemplates.java rename to error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/MapEntryRules.java index d01d621563..27d3af80c3 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/MapEntryTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/MapEntryRules.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static com.google.errorprone.refaster.ImportPolicy.STATIC_IMPORT_ALWAYS; import static java.util.Comparator.comparing; @@ -15,9 +15,9 @@ import java.util.Comparator; import java.util.Map; -/** Refaster templates related to expressions dealing with {@link Map.Entry} instances. */ -final class MapEntryTemplates { - private MapEntryTemplates() {} +/** Refaster rules related to expressions dealing with {@link Map.Entry} instances. */ +final class MapEntryRules { + private MapEntryRules() {} /** * Prefer {@link Map#entry(Object, Object)} over alternative ways to create an immutable map diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/MockitoTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/MockitoRules.java similarity index 87% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/MockitoTemplates.java rename to error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/MockitoRules.java index 3b67c27046..b17af9b514 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/MockitoTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/MockitoRules.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static com.google.errorprone.refaster.ImportPolicy.STATIC_IMPORT_ALWAYS; import static org.mockito.Mockito.never; @@ -11,9 +11,9 @@ import org.mockito.Mockito; import org.mockito.verification.VerificationMode; -/** Refaster templates related to Mockito expressions and statements. */ -final class MockitoTemplates { - private MockitoTemplates() {} +/** Refaster rules related to Mockito expressions and statements. */ +final class MockitoRules { + private MockitoRules() {} /** * Prefer {@link Mockito#never()}} over explicitly specifying that the associated invocation must diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/MultimapTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/MultimapRules.java similarity index 89% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/MultimapTemplates.java rename to error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/MultimapRules.java index 9e0f45e31a..ff64ad784c 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/MultimapTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/MultimapRules.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import com.google.common.collect.Multimap; import com.google.common.collect.Multimaps; @@ -9,9 +9,9 @@ import java.util.Set; import javax.annotation.Nullable; -/** Refaster templates related to expressions dealing with {@link Multimap}s. */ -final class MultimapTemplates { - private MultimapTemplates() {} +/** Refaster rules related to expressions dealing with {@link Multimap}s. */ +final class MultimapRules { + private MultimapRules() {} /** Prefer {@link Multimap#keySet()} over more contrived alternatives. */ static final class MultimapKeySet { diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/NullTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/NullRules.java similarity index 92% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/NullTemplates.java rename to error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/NullRules.java index d5b8c22d23..770843886c 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/NullTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/NullRules.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static com.google.errorprone.refaster.ImportPolicy.STATIC_IMPORT_ALWAYS; import static java.util.Objects.requireNonNullElse; @@ -11,9 +11,9 @@ import java.util.function.Predicate; import javax.annotation.Nullable; -/** Refaster templates related to expressions dealing with (possibly) null values. */ -final class NullTemplates { - private NullTemplates() {} +/** Refaster rules related to expressions dealing with (possibly) null values. */ +final class NullRules { + private NullRules() {} /** Prefer the {@code ==} operator over {@link Objects#isNull(Object)}. */ static final class IsNull { diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/OptionalTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/OptionalRules.java similarity index 97% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/OptionalTemplates.java rename to error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/OptionalRules.java index 113159d98c..7c990060a5 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/OptionalTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/OptionalRules.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static com.google.errorprone.refaster.ImportPolicy.STATIC_IMPORT_ALWAYS; @@ -18,9 +18,9 @@ import java.util.stream.Stream; import javax.annotation.Nullable; -/** Refaster templates related to expressions dealing with {@link Optional}s. */ -final class OptionalTemplates { - private OptionalTemplates() {} +/** Refaster rules related to expressions dealing with {@link Optional}s. */ +final class OptionalRules { + private OptionalRules() {} static final class OptionalOfNullable { // XXX: Refaster should be smart enough to also rewrite occurrences in which there are @@ -78,8 +78,8 @@ T after(Optional optional) { } /** Prefer {@link Optional#orElseThrow()} over the less explicit {@link Optional#get()}. */ - // XXX: This template is analogous to `OptionalOrElseThrow` above. Arguably this is its - // generalization. If/when Refaster is extended to understand this, delete the template above. + // XXX: This rule is analogous to `OptionalOrElseThrow` above. Arguably this is its + // generalization. If/when Refaster is extended to understand this, delete the rule above. static final class OptionalOrElseThrowMethodReference { @BeforeTemplate Function, T> before() { diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/PrimitiveTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/PrimitiveRules.java similarity index 89% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/PrimitiveTemplates.java rename to error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/PrimitiveRules.java index 622d2538c8..041abec002 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/PrimitiveTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/PrimitiveRules.java @@ -1,12 +1,12 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import com.google.common.primitives.Ints; import com.google.errorprone.refaster.annotation.AfterTemplate; import com.google.errorprone.refaster.annotation.BeforeTemplate; -/** Refaster templates related to expressions dealing with primitives. */ -final class PrimitiveTemplates { - private PrimitiveTemplates() {} +/** Refaster rules related to expressions dealing with primitives. */ +final class PrimitiveRules { + private PrimitiveRules() {} /** Avoid contrived ways of expressing the "less than" relationship. */ static final class LessThan { diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ReactorTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/ReactorRules.java similarity index 97% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ReactorTemplates.java rename to error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/ReactorRules.java index 68391d463e..e03b521533 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ReactorTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/ReactorRules.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static com.google.common.collect.MoreCollectors.toOptional; import static com.google.errorprone.refaster.ImportPolicy.STATIC_IMPORT_ALWAYS; @@ -27,9 +27,9 @@ import reactor.test.publisher.PublisherProbe; import tech.picnic.errorprone.refaster.matchers.ThrowsCheckedException; -/** Refaster templates related to Reactor expressions and statements. */ -final class ReactorTemplates { - private ReactorTemplates() {} +/** Refaster rules related to Reactor expressions and statements. */ +final class ReactorRules { + private ReactorRules() {} /** * Prefer {@link Mono#fromSupplier(Supplier)} over {@link Mono#fromCallable(Callable)} where @@ -95,7 +95,7 @@ Flux after(Throwable throwable) { /** * Don't unnecessarily pass {@link Mono#error(Supplier)} a method reference or lambda expression. */ - // XXX: Drop this rule once the more general rule `AssortedTemplates#SupplierAsSupplier` works + // XXX: Drop this rule once the more general rule `AssortedRules#SupplierAsSupplier` works // reliably. static final class MonoErrorSupplier { @BeforeTemplate @@ -112,7 +112,7 @@ Mono after(Supplier supplier) { /** * Don't unnecessarily pass {@link Flux#error(Supplier)} a method reference or lambda expression. */ - // XXX: Drop this rule once the more general rule `AssortedTemplates#SupplierAsSupplier` works + // XXX: Drop this rule once the more general rule `AssortedRules#SupplierAsSupplier` works // reliably. static final class FluxErrorSupplier { @BeforeTemplate diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/RxJava2AdapterTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/RxJava2AdapterRules.java similarity index 96% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/RxJava2AdapterTemplates.java rename to error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/RxJava2AdapterRules.java index 5384b9fbf7..b03245c7b1 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/RxJava2AdapterTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/RxJava2AdapterRules.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import com.google.errorprone.refaster.Refaster; import com.google.errorprone.refaster.annotation.AfterTemplate; @@ -14,9 +14,9 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** Refaster templates related to expressions dealing with {@link RxJava2Adapter}. */ -final class RxJava2AdapterTemplates { - private RxJava2AdapterTemplates() {} +/** Refaster rules related to expressions dealing with {@link RxJava2Adapter}. */ +final class RxJava2AdapterRules { + private RxJava2AdapterRules() {} /** Use the fluent API style when using {@link RxJava2Adapter#completableToMono}. */ static final class CompletableToMono { diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/StreamTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/StreamRules.java similarity index 98% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/StreamTemplates.java rename to error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/StreamRules.java index 375d67f622..336393e151 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/StreamTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/StreamRules.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static com.google.errorprone.refaster.ImportPolicy.STATIC_IMPORT_ALWAYS; import static java.util.Comparator.naturalOrder; @@ -23,9 +23,9 @@ import java.util.stream.Collectors; import java.util.stream.Stream; -/** Refaster templates related to expressions dealing with {@link Stream}s. */ -final class StreamTemplates { - private StreamTemplates() {} +/** Refaster rules related to expressions dealing with {@link Stream}s. */ +final class StreamRules { + private StreamRules() {} /** * Prefer {@link Collectors#joining()} over {@link Collectors#joining(CharSequence)} with an empty diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/StringTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/StringRules.java similarity index 94% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/StringTemplates.java rename to error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/StringRules.java index 7b7707bfed..3e01463f68 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/StringTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/StringRules.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static java.nio.charset.StandardCharsets.UTF_8; import static java.util.stream.Collectors.joining; @@ -18,10 +18,10 @@ import java.util.function.Function; import javax.annotation.Nullable; -/** Refaster templates related to expressions dealing with {@link String}s. */ +/** Refaster rules related to expressions dealing with {@link String}s. */ // XXX: Should we prefer `s -> !s.isEmpty()` or `not(String::isEmpty)`? -final class StringTemplates { - private StringTemplates() {} +final class StringRules { + private StringRules() {} /** Prefer {@link String#isEmpty()} over alternatives that consult the string's length. */ static final class StringIsEmpty { @@ -128,8 +128,8 @@ String after(Object object) { * Prefer direct delegation to {@link String#valueOf(Object)} over the indirection introduced by * {@link Objects#toString(Object)}. */ - // XXX: This template is analogous to `StringValueOf` above. Arguably this is its generalization. - // If/when Refaster is extended to understand this, delete the template above. + // XXX: This rule is analogous to `StringValueOf` above. Arguably this is its generalization. + // If/when Refaster is extended to understand this, delete the rule above. static final class StringValueOfMethodReference { @BeforeTemplate Function before() { diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/TestNGToAssertJTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/TestNGToAssertJRules.java similarity index 98% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/TestNGToAssertJTemplates.java rename to error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/TestNGToAssertJRules.java index 23f36f7865..e49014fb0f 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/TestNGToAssertJTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/TestNGToAssertJRules.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static com.google.errorprone.refaster.ImportPolicy.STATIC_IMPORT_ALWAYS; import static org.assertj.core.api.Assertions.assertThat; @@ -30,7 +30,7 @@ import org.testng.Assert.ThrowingRunnable; /** - * Refaster templates that replace TestNG assertions with equivalent AssertJ assertions. + * Refaster rules that replace TestNG assertions with equivalent AssertJ assertions. * *

Some of the classes below have TestNG {@code @BeforeTemplate}s that reference wildcard type * bounds ({@code }), while the associated AssertJ {@code @AfterTemplate}s reference stricter @@ -69,11 +69,11 @@ * * */ -// XXX: As-is these templates do not result in a complete migration: +// XXX: As-is these rules do not result in a complete migration: // - Expressions containing comments are skipped due to a limitation of Refaster. // - Assertions inside lambda expressions are also skipped. Unclear why. -final class TestNGToAssertJTemplates { - private TestNGToAssertJTemplates() {} +final class TestNGToAssertJRules { + private TestNGToAssertJRules() {} static final class Fail { @BeforeTemplate diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/TimeTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/TimeRules.java similarity index 98% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/TimeTemplates.java rename to error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/TimeRules.java index d7e9fa8432..6b33428dc6 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/TimeTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/TimeRules.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static java.time.ZoneOffset.UTC; @@ -22,9 +22,9 @@ import java.time.temporal.ChronoUnit; import java.time.temporal.TemporalUnit; -/** Refaster templates related to expressions dealing with time. */ -final class TimeTemplates { - private TimeTemplates() {} +/** Refaster rules related to expressions dealing with time. */ +final class TimeRules { + private TimeRules() {} /** * Prefer {@link Clock#instant()} over {@link Instant#now(Clock)}, as it is more concise and more diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/WebClientTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/WebClientRules.java similarity index 97% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/WebClientTemplates.java rename to error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/WebClientRules.java index 57b5cb850b..8452f00d17 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/WebClientTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/WebClientRules.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static org.springframework.http.HttpMethod.GET; import static org.springframework.http.HttpMethod.HEAD; @@ -22,11 +22,11 @@ import org.springframework.web.reactive.function.client.WebClient.RequestHeadersUriSpec; /** - * Refaster templates related to expressions dealing with {@link + * Refaster rules related to expressions dealing with {@link * org.springframework.web.reactive.function.client.WebClient} and related types. */ -final class WebClientTemplates { - private WebClientTemplates() {} +final class WebClientRules { + private WebClientRules() {} /** Prefer {@link RequestBodySpec#bodyValue(Object)} over more contrived alternatives. */ static final class BodyValue { diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/package-info.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/package-info.java similarity index 54% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/package-info.java rename to error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/package-info.java index 42b5bc948b..d3da8852c7 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/package-info.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/package-info.java @@ -1,4 +1,4 @@ -/** Picnic Refaster templates. */ +/** Picnic Refaster rules. */ @com.google.errorprone.annotations.CheckReturnValue @javax.annotation.ParametersAreNonnullByDefault -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; diff --git a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/MissingRefasterAnnotationTest.java b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/MissingRefasterAnnotationTest.java index 3611a2f6f8..74b2fcbfa0 100644 --- a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/MissingRefasterAnnotationTest.java +++ b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/MissingRefasterAnnotationTest.java @@ -11,7 +11,7 @@ final class MissingRefasterAnnotationTest { .expectErrorMessage( "X", containsPattern( - "The Refaster template contains a method without any Refaster annotations")); + "The Refaster rule contains a method without any Refaster annotations")); @Test void identification() { @@ -74,17 +74,17 @@ void identification() { " }", " }", "", - " static final class ValidRefasterTemplate {", + " static final class ValidRefasterRule {", " @BeforeTemplate", " void unusedPureFunctionCall(Object o) {", " o.toString();", " }", " }", "", - " static final class NotARefasterTemplate {", + " static final class NotARefasterRule {", " @Override", " public String toString() {", - " return \"This is not a Refaster template\";", + " return \"This is not a Refaster rule\";", " }", " }", "}") diff --git a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/RefasterTemplateModifiersTest.java b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/RefasterRuleModifiersTest.java similarity index 96% rename from error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/RefasterTemplateModifiersTest.java rename to error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/RefasterRuleModifiersTest.java index 574f4081b8..c21a784925 100644 --- a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/RefasterTemplateModifiersTest.java +++ b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/RefasterRuleModifiersTest.java @@ -5,11 +5,11 @@ import com.google.errorprone.CompilationTestHelper; import org.junit.jupiter.api.Test; -final class RefasterTemplateModifiersTest { +final class RefasterRuleModifiersTest { private final CompilationTestHelper compilationTestHelper = - CompilationTestHelper.newInstance(RefasterTemplateModifiers.class, getClass()); + CompilationTestHelper.newInstance(RefasterRuleModifiers.class, getClass()); private final BugCheckerRefactoringTestHelper refactoringTestHelper = - BugCheckerRefactoringTestHelper.newInstance(RefasterTemplateModifiers.class, getClass()); + BugCheckerRefactoringTestHelper.newInstance(RefasterRuleModifiers.class, getClass()); @Test void identification() { diff --git a/error-prone-contrib/src/test/java/tech/picnic/errorprone/refasterrules/RefasterRulesTest.java b/error-prone-contrib/src/test/java/tech/picnic/errorprone/refasterrules/RefasterRulesTest.java new file mode 100644 index 0000000000..be11145750 --- /dev/null +++ b/error-prone-contrib/src/test/java/tech/picnic/errorprone/refasterrules/RefasterRulesTest.java @@ -0,0 +1,83 @@ +package tech.picnic.errorprone.refasterrules; + +import static java.util.function.Predicate.not; + +import com.google.common.collect.ImmutableSet; +import java.util.stream.Stream; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollection; + +final class RefasterRulesTest { + /** The names of all Refaster rule groups defined in this module. */ + private static final ImmutableSet> RULE_COLLECTIONS = + ImmutableSet.of( + AssertJRules.class, + AssertJBigDecimalRules.class, + AssertJBigIntegerRules.class, + AssertJBooleanRules.class, + AssertJByteRules.class, + AssertJCharSequenceRules.class, + AssertJComparableRules.class, + AssertJDoubleRules.class, + AssertJEnumerableRules.class, + AssertJFloatRules.class, + AssertJIntegerRules.class, + AssertJLongRules.class, + AssertJNumberRules.class, + AssertJMapRules.class, + AssertJObjectRules.class, + AssertJOptionalRules.class, + AssertJPrimitiveRules.class, + AssertJShortRules.class, + AssertJStringRules.class, + AssertJThrowingCallableRules.class, + AssortedRules.class, + BigDecimalRules.class, + CollectionRules.class, + ComparatorRules.class, + DoubleStreamRules.class, + EqualityRules.class, + ImmutableListRules.class, + ImmutableListMultimapRules.class, + ImmutableMapRules.class, + ImmutableMultisetRules.class, + ImmutableSetRules.class, + ImmutableSetMultimapRules.class, + ImmutableSortedMapRules.class, + ImmutableSortedMultisetRules.class, + ImmutableSortedSetRules.class, + IntStreamRules.class, + JUnitRules.class, + LongStreamRules.class, + MapEntryRules.class, + MockitoRules.class, + MultimapRules.class, + NullRules.class, + OptionalRules.class, + PrimitiveRules.class, + ReactorRules.class, + RxJava2AdapterRules.class, + StreamRules.class, + StringRules.class, + TestNGToAssertJRules.class, + TimeRules.class, + WebClientRules.class); + + // XXX: Create a JUnit extension to automatically discover the rule collections in a given context + // to make sure the list is exhaustive. + private static Stream validateRuleCollectionTestCases() { + // XXX: Drop the filter once we have added tests for AssertJ! We can then also replace this + // method with `@ValueSource(classes = {...})`. + return RULE_COLLECTIONS.stream() + .filter(not(AssertJRules.class::equals)) + .map(Arguments::arguments); + } + + @MethodSource("validateRuleCollectionTestCases") + @ParameterizedTest + void validateRuleCollection(Class clazz) { + RefasterRuleCollection.validate(clazz); + } +} diff --git a/error-prone-contrib/src/test/java/tech/picnic/errorprone/refastertemplates/RefasterTemplatesTest.java b/error-prone-contrib/src/test/java/tech/picnic/errorprone/refastertemplates/RefasterTemplatesTest.java deleted file mode 100644 index b739216bcd..0000000000 --- a/error-prone-contrib/src/test/java/tech/picnic/errorprone/refastertemplates/RefasterTemplatesTest.java +++ /dev/null @@ -1,83 +0,0 @@ -package tech.picnic.errorprone.refastertemplates; - -import static java.util.function.Predicate.not; - -import com.google.common.collect.ImmutableSet; -import java.util.stream.Stream; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.Arguments; -import org.junit.jupiter.params.provider.MethodSource; -import tech.picnic.errorprone.refaster.test.RefasterTemplateCollection; - -final class RefasterTemplatesTest { - /** The names of all Refaster template groups defined in this module. */ - private static final ImmutableSet> TEMPLATE_COLLECTIONS = - ImmutableSet.of( - AssertJTemplates.class, - AssertJBigDecimalTemplates.class, - AssertJBigIntegerTemplates.class, - AssertJBooleanTemplates.class, - AssertJByteTemplates.class, - AssertJCharSequenceTemplates.class, - AssertJComparableTemplates.class, - AssertJDoubleTemplates.class, - AssertJEnumerableTemplates.class, - AssertJFloatTemplates.class, - AssertJIntegerTemplates.class, - AssertJLongTemplates.class, - AssertJNumberTemplates.class, - AssertJMapTemplates.class, - AssertJObjectTemplates.class, - AssertJOptionalTemplates.class, - AssertJPrimitiveTemplates.class, - AssertJShortTemplates.class, - AssertJStringTemplates.class, - AssertJThrowingCallableTemplates.class, - AssortedTemplates.class, - BigDecimalTemplates.class, - CollectionTemplates.class, - ComparatorTemplates.class, - DoubleStreamTemplates.class, - EqualityTemplates.class, - ImmutableListTemplates.class, - ImmutableListMultimapTemplates.class, - ImmutableMapTemplates.class, - ImmutableMultisetTemplates.class, - ImmutableSetTemplates.class, - ImmutableSetMultimapTemplates.class, - ImmutableSortedMapTemplates.class, - ImmutableSortedMultisetTemplates.class, - ImmutableSortedSetTemplates.class, - IntStreamTemplates.class, - JUnitTemplates.class, - LongStreamTemplates.class, - MapEntryTemplates.class, - MockitoTemplates.class, - MultimapTemplates.class, - NullTemplates.class, - OptionalTemplates.class, - PrimitiveTemplates.class, - ReactorTemplates.class, - RxJava2AdapterTemplates.class, - StreamTemplates.class, - StringTemplates.class, - TestNGToAssertJTemplates.class, - TimeTemplates.class, - WebClientTemplates.class); - - // XXX: Create a JUnit extension to automatically discover the template collections in a given - // context to make sure the list is exhaustive. - private static Stream validateTemplateCollectionTestCases() { - // XXX: Drop the filter once we have added tests for AssertJ! We can then also replace this - // method with `@ValueSource(classes = {...})`. - return TEMPLATE_COLLECTIONS.stream() - .filter(not(AssertJTemplates.class::equals)) - .map(Arguments::arguments); - } - - @MethodSource("validateTemplateCollectionTestCases") - @ParameterizedTest - void validateTemplateCollection(Class clazz) { - RefasterTemplateCollection.validate(clazz); - } -} diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJBigDecimalTemplatesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJBigDecimalRulesTestInput.java similarity index 83% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJBigDecimalTemplatesTestInput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJBigDecimalRulesTestInput.java index c8ecc2ecb8..6f33a5c231 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJBigDecimalTemplatesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJBigDecimalRulesTestInput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.data.Offset.offset; @@ -7,9 +7,9 @@ import com.google.common.collect.ImmutableSet; import java.math.BigDecimal; import org.assertj.core.api.AbstractBigDecimalAssert; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class AssertJBigDecimalTemplatesTest implements RefasterTemplateTestCase { +final class AssertJBigDecimalRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of(offset(0), withPercentage(0)); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJBigDecimalTemplatesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJBigDecimalRulesTestOutput.java similarity index 83% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJBigDecimalTemplatesTestOutput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJBigDecimalRulesTestOutput.java index 9807aa5488..9fc72e7b8d 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJBigDecimalTemplatesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJBigDecimalRulesTestOutput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.data.Offset.offset; @@ -7,9 +7,9 @@ import com.google.common.collect.ImmutableSet; import java.math.BigDecimal; import org.assertj.core.api.AbstractBigDecimalAssert; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class AssertJBigDecimalTemplatesTest implements RefasterTemplateTestCase { +final class AssertJBigDecimalRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of(offset(0), withPercentage(0)); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJBigIntegerTemplatesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJBigIntegerRulesTestInput.java similarity index 90% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJBigIntegerTemplatesTestInput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJBigIntegerRulesTestInput.java index 3bbbcf0380..b3feb861e5 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJBigIntegerTemplatesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJBigIntegerRulesTestInput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.data.Offset.offset; @@ -7,9 +7,9 @@ import com.google.common.collect.ImmutableSet; import java.math.BigInteger; import org.assertj.core.api.AbstractBigIntegerAssert; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class AssertJBigIntegerTemplatesTest implements RefasterTemplateTestCase { +final class AssertJBigIntegerRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of(offset(0), withPercentage(0)); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJBigIntegerTemplatesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJBigIntegerRulesTestOutput.java similarity index 89% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJBigIntegerTemplatesTestOutput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJBigIntegerRulesTestOutput.java index 9674b649dd..ea2fa45766 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJBigIntegerTemplatesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJBigIntegerRulesTestOutput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.data.Offset.offset; @@ -7,9 +7,9 @@ import com.google.common.collect.ImmutableSet; import java.math.BigInteger; import org.assertj.core.api.AbstractBigIntegerAssert; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class AssertJBigIntegerTemplatesTest implements RefasterTemplateTestCase { +final class AssertJBigIntegerRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of(offset(0), withPercentage(0)); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJBooleanTemplatesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJBooleanRulesTestInput.java similarity index 86% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJBooleanTemplatesTestInput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJBooleanRulesTestInput.java index 9181a58247..4993f7c707 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJBooleanTemplatesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJBooleanRulesTestInput.java @@ -1,12 +1,12 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static org.assertj.core.api.Assertions.assertThat; import com.google.common.collect.ImmutableSet; import org.assertj.core.api.AbstractBooleanAssert; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class AssertJBooleanTemplatesTest implements RefasterTemplateTestCase { +final class AssertJBooleanRulesTest implements RefasterRuleCollectionTestCase { AbstractBooleanAssert testAbstractBooleanAssertIsEqualTo() { return assertThat(true).isNotEqualTo(!Boolean.FALSE); } diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJBooleanTemplatesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJBooleanRulesTestOutput.java similarity index 85% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJBooleanTemplatesTestOutput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJBooleanRulesTestOutput.java index da458b13b9..e7d11d1e78 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJBooleanTemplatesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJBooleanRulesTestOutput.java @@ -1,12 +1,12 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static org.assertj.core.api.Assertions.assertThat; import com.google.common.collect.ImmutableSet; import org.assertj.core.api.AbstractBooleanAssert; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class AssertJBooleanTemplatesTest implements RefasterTemplateTestCase { +final class AssertJBooleanRulesTest implements RefasterRuleCollectionTestCase { AbstractBooleanAssert testAbstractBooleanAssertIsEqualTo() { return assertThat(true).isEqualTo(Boolean.FALSE); } diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJByteTemplatesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJByteRulesTestInput.java similarity index 85% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJByteTemplatesTestInput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJByteRulesTestInput.java index f9a7b2607e..2db99cbb37 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJByteTemplatesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJByteRulesTestInput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.data.Offset.offset; @@ -6,9 +6,9 @@ import com.google.common.collect.ImmutableSet; import org.assertj.core.api.AbstractByteAssert; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class AssertJByteTemplatesTest implements RefasterTemplateTestCase { +final class AssertJByteRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of(offset(0), withPercentage(0)); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJByteTemplatesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJByteRulesTestOutput.java similarity index 85% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJByteTemplatesTestOutput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJByteRulesTestOutput.java index ea274127a4..5f740bde41 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJByteTemplatesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJByteRulesTestOutput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.data.Offset.offset; @@ -6,9 +6,9 @@ import com.google.common.collect.ImmutableSet; import org.assertj.core.api.AbstractByteAssert; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class AssertJByteTemplatesTest implements RefasterTemplateTestCase { +final class AssertJByteRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of(offset(0), withPercentage(0)); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJCharSequenceTemplatesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJCharSequenceRulesTestInput.java similarity index 74% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJCharSequenceTemplatesTestInput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJCharSequenceRulesTestInput.java index 3cad90b1a0..e45d056c69 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJCharSequenceTemplatesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJCharSequenceRulesTestInput.java @@ -1,12 +1,12 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static org.assertj.core.api.Assertions.assertThat; import com.google.common.collect.ImmutableSet; import org.assertj.core.api.AbstractAssert; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class AssertJCharSequenceTemplatesTest implements RefasterTemplateTestCase { +final class AssertJCharSequenceRulesTest implements RefasterRuleCollectionTestCase { void testAssertThatCharSequenceIsEmpty() { assertThat("foo".length()).isEqualTo(0L); assertThat("foo".length()).isNotPositive(); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJCharSequenceTemplatesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJCharSequenceRulesTestOutput.java similarity index 72% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJCharSequenceTemplatesTestOutput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJCharSequenceRulesTestOutput.java index 9d0fc29bb3..50f906a537 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJCharSequenceTemplatesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJCharSequenceRulesTestOutput.java @@ -1,12 +1,12 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static org.assertj.core.api.Assertions.assertThat; import com.google.common.collect.ImmutableSet; import org.assertj.core.api.AbstractAssert; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class AssertJCharSequenceTemplatesTest implements RefasterTemplateTestCase { +final class AssertJCharSequenceRulesTest implements RefasterRuleCollectionTestCase { void testAssertThatCharSequenceIsEmpty() { assertThat("foo").isEmpty(); assertThat("foo").isEmpty(); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJComparableTemplatesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJComparableRulesTestInput.java similarity index 84% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJComparableTemplatesTestInput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJComparableRulesTestInput.java index 9d3793f23d..6863c8b828 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJComparableTemplatesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJComparableRulesTestInput.java @@ -1,12 +1,12 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static org.assertj.core.api.Assertions.assertThat; import java.math.BigDecimal; import org.assertj.core.api.AbstractComparableAssert; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class AssertJComparableTemplatesTest implements RefasterTemplateTestCase { +final class AssertJComparableRulesTest implements RefasterRuleCollectionTestCase { AbstractComparableAssert testAssertThatIsEqualByComparingTo() { return assertThat(BigDecimal.ZERO.compareTo(BigDecimal.ONE)).isEqualTo(0); } diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJComparableTemplatesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJComparableRulesTestOutput.java similarity index 83% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJComparableTemplatesTestOutput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJComparableRulesTestOutput.java index 8ff2093d8d..a7378f5212 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJComparableTemplatesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJComparableRulesTestOutput.java @@ -1,12 +1,12 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static org.assertj.core.api.Assertions.assertThat; import java.math.BigDecimal; import org.assertj.core.api.AbstractComparableAssert; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class AssertJComparableTemplatesTest implements RefasterTemplateTestCase { +final class AssertJComparableRulesTest implements RefasterRuleCollectionTestCase { AbstractComparableAssert testAssertThatIsEqualByComparingTo() { return assertThat(BigDecimal.ZERO).isEqualByComparingTo(BigDecimal.ONE); } diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJDoubleTemplatesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJDoubleRulesTestInput.java similarity index 87% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJDoubleTemplatesTestInput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJDoubleRulesTestInput.java index 04eb0c7206..232265e98b 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJDoubleTemplatesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJDoubleRulesTestInput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.data.Offset.offset; @@ -6,9 +6,9 @@ import com.google.common.collect.ImmutableSet; import org.assertj.core.api.AbstractDoubleAssert; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class AssertJDoubleTemplatesTest implements RefasterTemplateTestCase { +final class AssertJDoubleRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of(withPercentage(0)); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJDoubleTemplatesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJDoubleRulesTestOutput.java similarity index 86% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJDoubleTemplatesTestOutput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJDoubleRulesTestOutput.java index 12ec9c93be..62acf54d33 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJDoubleTemplatesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJDoubleRulesTestOutput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.data.Offset.offset; @@ -6,9 +6,9 @@ import com.google.common.collect.ImmutableSet; import org.assertj.core.api.AbstractDoubleAssert; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class AssertJDoubleTemplatesTest implements RefasterTemplateTestCase { +final class AssertJDoubleRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of(withPercentage(0)); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJEnumerableTemplatesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJEnumerableRulesTestInput.java similarity index 84% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJEnumerableTemplatesTestInput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJEnumerableRulesTestInput.java index 2ef8511104..7157710f77 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJEnumerableTemplatesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJEnumerableRulesTestInput.java @@ -1,13 +1,13 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static org.assertj.core.api.Assertions.assertThat; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Iterables; import org.assertj.core.api.EnumerableAssert; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class AssertJEnumerableTemplatesTest implements RefasterTemplateTestCase { +final class AssertJEnumerableRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of(Iterables.class); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJEnumerableTemplatesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJEnumerableRulesTestOutput.java similarity index 83% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJEnumerableTemplatesTestOutput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJEnumerableRulesTestOutput.java index 5c46789db9..2f676a8eb7 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJEnumerableTemplatesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJEnumerableRulesTestOutput.java @@ -1,13 +1,13 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static org.assertj.core.api.Assertions.assertThat; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Iterables; import org.assertj.core.api.EnumerableAssert; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class AssertJEnumerableTemplatesTest implements RefasterTemplateTestCase { +final class AssertJEnumerableRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of(Iterables.class); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJFloatTemplatesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJFloatRulesTestInput.java similarity index 87% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJFloatTemplatesTestInput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJFloatRulesTestInput.java index 54b4fac623..caaa12de81 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJFloatTemplatesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJFloatRulesTestInput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.data.Offset.offset; @@ -6,9 +6,9 @@ import com.google.common.collect.ImmutableSet; import org.assertj.core.api.AbstractFloatAssert; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class AssertJFloatTemplatesTest implements RefasterTemplateTestCase { +final class AssertJFloatRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of(withPercentage(0)); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJFloatTemplatesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJFloatRulesTestOutput.java similarity index 86% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJFloatTemplatesTestOutput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJFloatRulesTestOutput.java index 40b9626372..e2c4fd0fdb 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJFloatTemplatesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJFloatRulesTestOutput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.data.Offset.offset; @@ -6,9 +6,9 @@ import com.google.common.collect.ImmutableSet; import org.assertj.core.api.AbstractFloatAssert; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class AssertJFloatTemplatesTest implements RefasterTemplateTestCase { +final class AssertJFloatRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of(withPercentage(0)); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJIntegerTemplatesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJIntegerRulesTestInput.java similarity index 84% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJIntegerTemplatesTestInput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJIntegerRulesTestInput.java index 6b4b7a38c3..9c69c87c3d 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJIntegerTemplatesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJIntegerRulesTestInput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.data.Offset.offset; @@ -6,9 +6,9 @@ import com.google.common.collect.ImmutableSet; import org.assertj.core.api.AbstractIntegerAssert; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class AssertJIntegerTemplatesTest implements RefasterTemplateTestCase { +final class AssertJIntegerRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of(offset(0), withPercentage(0)); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJIntegerTemplatesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJIntegerRulesTestOutput.java similarity index 84% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJIntegerTemplatesTestOutput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJIntegerRulesTestOutput.java index 87613912ff..495cf18588 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJIntegerTemplatesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJIntegerRulesTestOutput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.data.Offset.offset; @@ -6,9 +6,9 @@ import com.google.common.collect.ImmutableSet; import org.assertj.core.api.AbstractIntegerAssert; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class AssertJIntegerTemplatesTest implements RefasterTemplateTestCase { +final class AssertJIntegerRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of(offset(0), withPercentage(0)); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJLongTemplatesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJLongRulesTestInput.java similarity index 85% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJLongTemplatesTestInput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJLongRulesTestInput.java index b55a52774f..7c3bcc4e28 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJLongTemplatesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJLongRulesTestInput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.data.Offset.offset; @@ -6,9 +6,9 @@ import com.google.common.collect.ImmutableSet; import org.assertj.core.api.AbstractLongAssert; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class AssertJLongTemplatesTest implements RefasterTemplateTestCase { +final class AssertJLongRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of(offset(0), withPercentage(0)); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJLongTemplatesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJLongRulesTestOutput.java similarity index 84% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJLongTemplatesTestOutput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJLongRulesTestOutput.java index 1c7a851983..81692bf1d1 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJLongTemplatesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJLongRulesTestOutput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.data.Offset.offset; @@ -6,9 +6,9 @@ import com.google.common.collect.ImmutableSet; import org.assertj.core.api.AbstractLongAssert; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class AssertJLongTemplatesTest implements RefasterTemplateTestCase { +final class AssertJLongRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of(offset(0), withPercentage(0)); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJMapTemplatesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJMapRulesTestInput.java similarity index 74% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJMapTemplatesTestInput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJMapRulesTestInput.java index 84d9fb02d3..064430f62a 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJMapTemplatesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJMapRulesTestInput.java @@ -1,12 +1,12 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static org.assertj.core.api.Assertions.assertThat; import com.google.common.collect.ImmutableMap; import org.assertj.core.api.AbstractMapAssert; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class AssertJMapTemplatesTest implements RefasterTemplateTestCase { +final class AssertJMapRulesTest implements RefasterRuleCollectionTestCase { AbstractMapAssert testAbstractMapAssertContainsExactlyInAnyOrderEntriesOf() { return assertThat(ImmutableMap.of(1, 2, 3, 4)).isEqualTo(ImmutableMap.of(1, 2, 3, 4)); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJMapTemplatesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJMapRulesTestOutput.java similarity index 74% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJMapTemplatesTestOutput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJMapRulesTestOutput.java index 65d1a3b4cb..a5e58f23b0 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJMapTemplatesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJMapRulesTestOutput.java @@ -1,12 +1,12 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static org.assertj.core.api.Assertions.assertThat; import com.google.common.collect.ImmutableMap; import org.assertj.core.api.AbstractMapAssert; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class AssertJMapTemplatesTest implements RefasterTemplateTestCase { +final class AssertJMapRulesTest implements RefasterRuleCollectionTestCase { AbstractMapAssert testAbstractMapAssertContainsExactlyInAnyOrderEntriesOf() { return assertThat(ImmutableMap.of(1, 2, 3, 4)) diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJNumberTemplatesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJNumberRulesTestInput.java similarity index 95% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJNumberTemplatesTestInput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJNumberRulesTestInput.java index ce5773aabe..7b3d027d97 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJNumberTemplatesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJNumberRulesTestInput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static org.assertj.core.api.Assertions.assertThat; @@ -6,9 +6,9 @@ import java.math.BigDecimal; import java.math.BigInteger; import org.assertj.core.api.NumberAssert; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class AssertJNumberTemplatesTest implements RefasterTemplateTestCase { +final class AssertJNumberRulesTest implements RefasterRuleCollectionTestCase { ImmutableSet> testNumberAssertIsPositive() { return ImmutableSet.of( assertThat((byte) 0).isGreaterThan((byte) 0), diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJNumberTemplatesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJNumberRulesTestOutput.java similarity index 95% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJNumberTemplatesTestOutput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJNumberRulesTestOutput.java index 227fedf57e..e141a90742 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJNumberTemplatesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJNumberRulesTestOutput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static org.assertj.core.api.Assertions.assertThat; @@ -6,9 +6,9 @@ import java.math.BigDecimal; import java.math.BigInteger; import org.assertj.core.api.NumberAssert; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class AssertJNumberTemplatesTest implements RefasterTemplateTestCase { +final class AssertJNumberRulesTest implements RefasterRuleCollectionTestCase { ImmutableSet> testNumberAssertIsPositive() { return ImmutableSet.of( assertThat((byte) 0).isPositive(), diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJObjectTemplatesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJObjectRulesTestInput.java similarity index 77% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJObjectTemplatesTestInput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJObjectRulesTestInput.java index 391c6b1228..ce37306575 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJObjectTemplatesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJObjectRulesTestInput.java @@ -1,11 +1,11 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static org.assertj.core.api.Assertions.assertThat; import org.assertj.core.api.AbstractAssert; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class AssertJObjectTemplatesTest implements RefasterTemplateTestCase { +final class AssertJObjectRulesTest implements RefasterRuleCollectionTestCase { AbstractAssert testAssertThatIsInstanceOf() { return assertThat("foo" instanceof String).isTrue(); } diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJObjectTemplatesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJObjectRulesTestOutput.java similarity index 77% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJObjectTemplatesTestOutput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJObjectRulesTestOutput.java index 3e68603b4a..0af2474fe8 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJObjectTemplatesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJObjectRulesTestOutput.java @@ -1,11 +1,11 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static org.assertj.core.api.Assertions.assertThat; import org.assertj.core.api.AbstractAssert; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class AssertJObjectTemplatesTest implements RefasterTemplateTestCase { +final class AssertJObjectRulesTest implements RefasterRuleCollectionTestCase { AbstractAssert testAssertThatIsInstanceOf() { return assertThat("foo").isInstanceOf(String.class); } diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJOptionalTemplatesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJOptionalRulesTestInput.java similarity index 90% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJOptionalTemplatesTestInput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJOptionalRulesTestInput.java index ca6be8ec0b..e337bfb108 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJOptionalTemplatesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJOptionalRulesTestInput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static org.assertj.core.api.Assertions.assertThat; @@ -6,9 +6,9 @@ import java.util.Optional; import org.assertj.core.api.AbstractAssert; import org.assertj.core.api.OptionalAssert; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class AssertJOptionalTemplatesTest implements RefasterTemplateTestCase { +final class AssertJOptionalRulesTest implements RefasterRuleCollectionTestCase { AbstractAssert testAssertThatOptional() { return assertThat(Optional.of(new Object()).orElseThrow()); } diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJOptionalTemplatesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJOptionalRulesTestOutput.java similarity index 89% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJOptionalTemplatesTestOutput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJOptionalRulesTestOutput.java index df5f706c31..e0ec85491b 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJOptionalTemplatesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJOptionalRulesTestOutput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static org.assertj.core.api.Assertions.assertThat; @@ -6,9 +6,9 @@ import java.util.Optional; import org.assertj.core.api.AbstractAssert; import org.assertj.core.api.OptionalAssert; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class AssertJOptionalTemplatesTest implements RefasterTemplateTestCase { +final class AssertJOptionalRulesTest implements RefasterRuleCollectionTestCase { AbstractAssert testAssertThatOptional() { return assertThat(Optional.of(new Object())).get(); } diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJPrimitiveTemplatesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJPrimitiveRulesTestInput.java similarity index 95% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJPrimitiveTemplatesTestInput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJPrimitiveRulesTestInput.java index ace0e0e6c3..d4740aae59 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJPrimitiveTemplatesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJPrimitiveRulesTestInput.java @@ -1,12 +1,12 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static org.assertj.core.api.Assertions.assertThat; import com.google.common.collect.ImmutableSet; import org.assertj.core.api.AbstractAssert; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class AssertJPrimitiveTemplatesTest implements RefasterTemplateTestCase { +final class AssertJPrimitiveRulesTest implements RefasterRuleCollectionTestCase { @SuppressWarnings("SimplifyBooleanExpression") ImmutableSet> testAssertThatIsEqualTo() { return ImmutableSet.of( diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJPrimitiveTemplatesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJPrimitiveRulesTestOutput.java similarity index 96% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJPrimitiveTemplatesTestOutput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJPrimitiveRulesTestOutput.java index 7215bbfb8c..e556908b27 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJPrimitiveTemplatesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJPrimitiveRulesTestOutput.java @@ -1,12 +1,12 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static org.assertj.core.api.Assertions.assertThat; import com.google.common.collect.ImmutableSet; import org.assertj.core.api.AbstractAssert; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class AssertJPrimitiveTemplatesTest implements RefasterTemplateTestCase { +final class AssertJPrimitiveRulesTest implements RefasterRuleCollectionTestCase { @SuppressWarnings("SimplifyBooleanExpression") ImmutableSet> testAssertThatIsEqualTo() { return ImmutableSet.of( diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJShortTemplatesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJShortRulesTestInput.java similarity index 86% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJShortTemplatesTestInput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJShortRulesTestInput.java index e4fc739373..6114d86177 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJShortTemplatesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJShortRulesTestInput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.data.Offset.offset; @@ -6,9 +6,9 @@ import com.google.common.collect.ImmutableSet; import org.assertj.core.api.AbstractShortAssert; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class AssertJShortTemplatesTest implements RefasterTemplateTestCase { +final class AssertJShortRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of(offset(0), withPercentage(0)); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJShortTemplatesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJShortRulesTestOutput.java similarity index 85% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJShortTemplatesTestOutput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJShortRulesTestOutput.java index 58beb71e24..463bea8e37 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJShortTemplatesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJShortRulesTestOutput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.data.Offset.offset; @@ -6,9 +6,9 @@ import com.google.common.collect.ImmutableSet; import org.assertj.core.api.AbstractShortAssert; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class AssertJShortTemplatesTest implements RefasterTemplateTestCase { +final class AssertJShortRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of(offset(0), withPercentage(0)); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJStringTemplatesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJStringRulesTestInput.java similarity index 79% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJStringTemplatesTestInput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJStringRulesTestInput.java index e699740a83..7efb588db8 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJStringTemplatesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJStringRulesTestInput.java @@ -1,12 +1,12 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static org.assertj.core.api.Assertions.assertThat; import org.assertj.core.api.AbstractAssert; import org.assertj.core.api.AbstractStringAssert; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class AssertJStringTemplatesTest implements RefasterTemplateTestCase { +final class AssertJStringRulesTest implements RefasterRuleCollectionTestCase { void testAbstractStringAssertStringIsEmpty() { assertThat("foo").isEqualTo(""); } diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJStringTemplatesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJStringRulesTestOutput.java similarity index 78% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJStringTemplatesTestOutput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJStringRulesTestOutput.java index 1e048f94a2..f0d8293bd9 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJStringTemplatesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJStringRulesTestOutput.java @@ -1,12 +1,12 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static org.assertj.core.api.Assertions.assertThat; import org.assertj.core.api.AbstractAssert; import org.assertj.core.api.AbstractStringAssert; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class AssertJStringTemplatesTest implements RefasterTemplateTestCase { +final class AssertJStringRulesTest implements RefasterRuleCollectionTestCase { void testAbstractStringAssertStringIsEmpty() { assertThat("foo").isEmpty(); } diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJThrowingCallableTemplatesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJThrowingCallableRulesTestInput.java similarity index 96% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJThrowingCallableTemplatesTestInput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJThrowingCallableRulesTestInput.java index 4f43569189..3dc64aeaad 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJThrowingCallableTemplatesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJThrowingCallableRulesTestInput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import static org.assertj.core.api.Assertions.assertThatIOException; @@ -10,9 +10,9 @@ import com.google.common.collect.ImmutableSet; import org.assertj.core.api.AbstractObjectAssert; import org.assertj.core.api.AbstractThrowableAssert; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class AssertJThrowingCallableTemplatesTest implements RefasterTemplateTestCase { +final class AssertJThrowingCallableRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of( diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJThrowingCallableTemplatesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJThrowingCallableRulesTestOutput.java similarity index 96% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJThrowingCallableTemplatesTestOutput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJThrowingCallableRulesTestOutput.java index 3e2fb68076..c00ed335e7 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssertJThrowingCallableTemplatesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssertJThrowingCallableRulesTestOutput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import static org.assertj.core.api.Assertions.assertThatIOException; @@ -11,9 +11,9 @@ import java.io.IOException; import org.assertj.core.api.AbstractObjectAssert; import org.assertj.core.api.AbstractThrowableAssert; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class AssertJThrowingCallableTemplatesTest implements RefasterTemplateTestCase { +final class AssertJThrowingCallableRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of( diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssortedTemplatesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssortedRulesTestInput.java similarity index 94% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssortedTemplatesTestInput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssortedRulesTestInput.java index d4023e4546..6c1398a39c 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssortedTemplatesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssortedRulesTestInput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static com.google.common.collect.ImmutableSet.toImmutableSet; @@ -17,9 +17,9 @@ import java.util.HashSet; import java.util.Map; import java.util.stream.Stream; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class AssortedTemplatesTest implements RefasterTemplateTestCase { +final class AssortedRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of( diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssortedTemplatesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssortedRulesTestOutput.java similarity index 94% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssortedTemplatesTestOutput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssortedRulesTestOutput.java index 10809a7134..7a9a91cb73 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/AssortedTemplatesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/AssortedRulesTestOutput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static com.google.common.collect.ImmutableSet.toImmutableSet; import static com.google.common.collect.Sets.toImmutableEnumSet; @@ -21,9 +21,9 @@ import java.util.Map; import java.util.Objects; import java.util.stream.Stream; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class AssortedTemplatesTest implements RefasterTemplateTestCase { +final class AssortedRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of( diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/BigDecimalTemplatesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/BigDecimalRulesTestInput.java similarity index 77% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/BigDecimalTemplatesTestInput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/BigDecimalRulesTestInput.java index 878b1bac28..37db5459ce 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/BigDecimalTemplatesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/BigDecimalRulesTestInput.java @@ -1,10 +1,10 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import com.google.common.collect.ImmutableSet; import java.math.BigDecimal; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class BigDecimalTemplatesTest implements RefasterTemplateTestCase { +final class BigDecimalRulesTest implements RefasterRuleCollectionTestCase { ImmutableSet testBigDecimalZero() { return ImmutableSet.of(BigDecimal.valueOf(0), BigDecimal.valueOf(0L), new BigDecimal("0")); } diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/BigDecimalTemplatesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/BigDecimalRulesTestOutput.java similarity index 75% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/BigDecimalTemplatesTestOutput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/BigDecimalRulesTestOutput.java index 1a379ce9f7..8be65ad520 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/BigDecimalTemplatesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/BigDecimalRulesTestOutput.java @@ -1,10 +1,10 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import com.google.common.collect.ImmutableSet; import java.math.BigDecimal; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class BigDecimalTemplatesTest implements RefasterTemplateTestCase { +final class BigDecimalRulesTest implements RefasterRuleCollectionTestCase { ImmutableSet testBigDecimalZero() { return ImmutableSet.of(BigDecimal.ZERO, BigDecimal.ZERO, BigDecimal.ZERO); } diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/CollectionTemplatesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/CollectionRulesTestInput.java similarity index 97% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/CollectionTemplatesTestInput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/CollectionRulesTestInput.java index b2509efd1b..c5c3f686d5 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/CollectionTemplatesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/CollectionRulesTestInput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; @@ -12,9 +12,9 @@ import java.util.Optional; import java.util.TreeSet; import java.util.stream.Stream; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class CollectionTemplatesTest implements RefasterTemplateTestCase { +final class CollectionRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of(Iterables.class, Lists.class); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/CollectionTemplatesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/CollectionRulesTestOutput.java similarity index 96% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/CollectionTemplatesTestOutput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/CollectionRulesTestOutput.java index cbbf3dbdae..7d580729cc 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/CollectionTemplatesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/CollectionRulesTestOutput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; @@ -12,9 +12,9 @@ import java.util.Optional; import java.util.TreeSet; import java.util.stream.Stream; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class CollectionTemplatesTest implements RefasterTemplateTestCase { +final class CollectionRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of(Iterables.class, Lists.class); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ComparatorTemplatesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ComparatorRulesTestInput.java similarity index 95% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ComparatorTemplatesTestInput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ComparatorRulesTestInput.java index dee75ddac8..961a5f21c0 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ComparatorTemplatesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ComparatorRulesTestInput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static java.util.Comparator.naturalOrder; import static java.util.Comparator.reverseOrder; @@ -10,9 +10,9 @@ import java.util.Collections; import java.util.Comparator; import java.util.function.BinaryOperator; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class ComparatorTemplatesTest implements RefasterTemplateTestCase { +final class ComparatorRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of( diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ComparatorTemplatesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ComparatorRulesTestOutput.java similarity index 94% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ComparatorTemplatesTestOutput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ComparatorRulesTestOutput.java index e6cd9d1aa8..b2a54f06a1 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ComparatorTemplatesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ComparatorRulesTestOutput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static java.util.Comparator.naturalOrder; import static java.util.Comparator.reverseOrder; @@ -11,9 +11,9 @@ import java.util.Collections; import java.util.Comparator; import java.util.function.BinaryOperator; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class ComparatorTemplatesTest implements RefasterTemplateTestCase { +final class ComparatorRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of( diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/DoubleStreamTemplatesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/DoubleStreamRulesTestInput.java similarity index 93% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/DoubleStreamTemplatesTestInput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/DoubleStreamRulesTestInput.java index 37bd64f8f7..9c35f9c651 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/DoubleStreamTemplatesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/DoubleStreamRulesTestInput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Streams; @@ -6,9 +6,9 @@ import java.util.function.DoublePredicate; import java.util.stream.DoubleStream; import java.util.stream.Stream; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class DoubleStreamTemplatesTest implements RefasterTemplateTestCase { +final class DoubleStreamRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of(Streams.class); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/DoubleStreamTemplatesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/DoubleStreamRulesTestOutput.java similarity index 93% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/DoubleStreamTemplatesTestOutput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/DoubleStreamRulesTestOutput.java index de39e49000..0f5c7db8eb 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/DoubleStreamTemplatesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/DoubleStreamRulesTestOutput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Streams; @@ -6,9 +6,9 @@ import java.util.function.DoublePredicate; import java.util.stream.DoubleStream; import java.util.stream.Stream; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class DoubleStreamTemplatesTest implements RefasterTemplateTestCase { +final class DoubleStreamRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of(Streams.class); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/EqualityTemplatesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/EqualityRulesTestInput.java similarity index 89% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/EqualityTemplatesTestInput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/EqualityRulesTestInput.java index 129fe4eaf1..e887e5a0ca 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/EqualityTemplatesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/EqualityRulesTestInput.java @@ -1,13 +1,13 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import com.google.common.collect.BoundType; import com.google.common.collect.ImmutableSet; import java.math.RoundingMode; import java.util.Objects; import java.util.stream.Stream; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class EqualityTemplatesTest implements RefasterTemplateTestCase { +final class EqualityRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of(Objects.class); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/EqualityTemplatesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/EqualityRulesTestOutput.java similarity index 89% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/EqualityTemplatesTestOutput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/EqualityRulesTestOutput.java index 907e4768ce..b3aa30245a 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/EqualityTemplatesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/EqualityRulesTestOutput.java @@ -1,13 +1,13 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import com.google.common.collect.BoundType; import com.google.common.collect.ImmutableSet; import java.math.RoundingMode; import java.util.Objects; import java.util.stream.Stream; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class EqualityTemplatesTest implements RefasterTemplateTestCase { +final class EqualityRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of(Objects.class); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ImmutableListMultimapTemplatesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ImmutableListMultimapRulesTestInput.java similarity index 96% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ImmutableListMultimapTemplatesTestInput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ImmutableListMultimapRulesTestInput.java index f840b67d17..287e550a99 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ImmutableListMultimapTemplatesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ImmutableListMultimapRulesTestInput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static com.google.common.collect.ImmutableListMultimap.flatteningToImmutableListMultimap; import static com.google.common.collect.ImmutableListMultimap.toImmutableListMultimap; @@ -16,9 +16,9 @@ import com.google.common.collect.TreeMultimap; import java.util.Map; import java.util.stream.Stream; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class ImmutableListMultimapTemplatesTest implements RefasterTemplateTestCase { +final class ImmutableListMultimapRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of( diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ImmutableListMultimapTemplatesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ImmutableListMultimapRulesTestOutput.java similarity index 95% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ImmutableListMultimapTemplatesTestOutput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ImmutableListMultimapRulesTestOutput.java index 7f7e7888b0..cfed18e6fa 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ImmutableListMultimapTemplatesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ImmutableListMultimapRulesTestOutput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static com.google.common.collect.ImmutableListMultimap.flatteningToImmutableListMultimap; import static com.google.common.collect.ImmutableListMultimap.toImmutableListMultimap; @@ -16,9 +16,9 @@ import com.google.common.collect.TreeMultimap; import java.util.Map; import java.util.stream.Stream; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class ImmutableListMultimapTemplatesTest implements RefasterTemplateTestCase { +final class ImmutableListMultimapRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of( diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ImmutableListTemplatesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ImmutableListRulesTestInput.java similarity index 94% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ImmutableListTemplatesTestInput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ImmutableListRulesTestInput.java index 0afd20b0e1..8a8623f0bf 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ImmutableListTemplatesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ImmutableListRulesTestInput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static com.google.common.collect.ImmutableList.toImmutableList; import static java.util.Comparator.naturalOrder; @@ -11,9 +11,9 @@ import java.util.Comparator; import java.util.List; import java.util.stream.Stream; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class ImmutableListTemplatesTest implements RefasterTemplateTestCase { +final class ImmutableListRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of( diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ImmutableListTemplatesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ImmutableListRulesTestOutput.java similarity index 93% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ImmutableListTemplatesTestOutput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ImmutableListRulesTestOutput.java index 915ab1e1df..6a026f8c45 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ImmutableListTemplatesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ImmutableListRulesTestOutput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static com.google.common.collect.ImmutableList.toImmutableList; import static com.google.common.collect.ImmutableSet.toImmutableSet; @@ -12,9 +12,9 @@ import java.util.Comparator; import java.util.List; import java.util.stream.Stream; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class ImmutableListTemplatesTest implements RefasterTemplateTestCase { +final class ImmutableListRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of( diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ImmutableMapTemplatesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ImmutableMapRulesTestInput.java similarity index 95% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ImmutableMapTemplatesTestInput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ImmutableMapRulesTestInput.java index b2667b9f58..b4cd5f950e 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ImmutableMapTemplatesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ImmutableMapRulesTestInput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static com.google.common.collect.ImmutableMap.toImmutableMap; import static java.util.function.Function.identity; @@ -12,9 +12,9 @@ import java.util.Collections; import java.util.Map; import java.util.stream.Stream; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class ImmutableMapTemplatesTest implements RefasterTemplateTestCase { +final class ImmutableMapRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of(Collections.class, Streams.class, identity()); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ImmutableMapTemplatesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ImmutableMapRulesTestOutput.java similarity index 94% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ImmutableMapTemplatesTestOutput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ImmutableMapRulesTestOutput.java index 77153c7466..4c1ddf948f 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ImmutableMapTemplatesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ImmutableMapRulesTestOutput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static com.google.common.collect.ImmutableMap.toImmutableMap; import static java.util.function.Function.identity; @@ -12,9 +12,9 @@ import java.util.Collections; import java.util.Map; import java.util.stream.Stream; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class ImmutableMapTemplatesTest implements RefasterTemplateTestCase { +final class ImmutableMapRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of(Collections.class, Streams.class, identity()); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ImmutableMultisetTemplatesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ImmutableMultisetRulesTestInput.java similarity index 89% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ImmutableMultisetTemplatesTestInput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ImmutableMultisetRulesTestInput.java index 92f4ed84f1..efeeb2db39 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ImmutableMultisetTemplatesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ImmutableMultisetRulesTestInput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static com.google.common.collect.ImmutableMultiset.toImmutableMultiset; @@ -8,9 +8,9 @@ import com.google.common.collect.Streams; import java.util.Arrays; import java.util.stream.Stream; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class ImmutableMultisetTemplatesTest implements RefasterTemplateTestCase { +final class ImmutableMultisetRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of(Arrays.class, Streams.class); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ImmutableMultisetTemplatesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ImmutableMultisetRulesTestOutput.java similarity index 87% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ImmutableMultisetTemplatesTestOutput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ImmutableMultisetRulesTestOutput.java index 84f5122d84..297b316717 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ImmutableMultisetTemplatesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ImmutableMultisetRulesTestOutput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static com.google.common.collect.ImmutableMultiset.toImmutableMultiset; @@ -8,9 +8,9 @@ import com.google.common.collect.Streams; import java.util.Arrays; import java.util.stream.Stream; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class ImmutableMultisetTemplatesTest implements RefasterTemplateTestCase { +final class ImmutableMultisetRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of(Arrays.class, Streams.class); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ImmutableSetMultimapTemplatesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ImmutableSetMultimapRulesTestInput.java similarity index 95% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ImmutableSetMultimapTemplatesTestInput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ImmutableSetMultimapRulesTestInput.java index 2f2cd08f0c..8ac6542589 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ImmutableSetMultimapTemplatesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ImmutableSetMultimapRulesTestInput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static com.google.common.collect.ImmutableSetMultimap.flatteningToImmutableSetMultimap; import static com.google.common.collect.ImmutableSetMultimap.toImmutableSetMultimap; @@ -13,9 +13,9 @@ import com.google.common.collect.TreeMultimap; import java.util.Map; import java.util.stream.Stream; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class ImmutableSetMultimapTemplatesTest implements RefasterTemplateTestCase { +final class ImmutableSetMultimapRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of(Streams.class, flatteningToImmutableSetMultimap(null, null)); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ImmutableSetMultimapTemplatesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ImmutableSetMultimapRulesTestOutput.java similarity index 94% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ImmutableSetMultimapTemplatesTestOutput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ImmutableSetMultimapRulesTestOutput.java index f887977a8b..5f358443ef 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ImmutableSetMultimapTemplatesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ImmutableSetMultimapRulesTestOutput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static com.google.common.collect.ImmutableSetMultimap.flatteningToImmutableSetMultimap; import static com.google.common.collect.ImmutableSetMultimap.toImmutableSetMultimap; @@ -13,9 +13,9 @@ import com.google.common.collect.TreeMultimap; import java.util.Map; import java.util.stream.Stream; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class ImmutableSetMultimapTemplatesTest implements RefasterTemplateTestCase { +final class ImmutableSetMultimapRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of(Streams.class, flatteningToImmutableSetMultimap(null, null)); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ImmutableSetTemplatesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ImmutableSetRulesTestInput.java similarity index 92% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ImmutableSetTemplatesTestInput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ImmutableSetRulesTestInput.java index d2b38ad2ac..9a457ff05b 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ImmutableSetTemplatesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ImmutableSetRulesTestInput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static com.google.common.collect.ImmutableSet.toImmutableSet; @@ -10,9 +10,9 @@ import java.util.Collections; import java.util.Set; import java.util.stream.Stream; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class ImmutableSetTemplatesTest implements RefasterTemplateTestCase { +final class ImmutableSetRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of(Arrays.class, Collections.class, Streams.class); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ImmutableSetTemplatesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ImmutableSetRulesTestOutput.java similarity index 91% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ImmutableSetTemplatesTestOutput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ImmutableSetRulesTestOutput.java index e6ad2e44ad..21e612a36f 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ImmutableSetTemplatesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ImmutableSetRulesTestOutput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static com.google.common.collect.ImmutableSet.toImmutableSet; @@ -10,9 +10,9 @@ import java.util.Collections; import java.util.Set; import java.util.stream.Stream; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class ImmutableSetTemplatesTest implements RefasterTemplateTestCase { +final class ImmutableSetRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of(Arrays.class, Collections.class, Streams.class); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ImmutableSortedMapTemplatesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ImmutableSortedMapRulesTestInput.java similarity index 92% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ImmutableSortedMapTemplatesTestInput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ImmutableSortedMapRulesTestInput.java index a2df4ae2b0..45fef73d29 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ImmutableSortedMapTemplatesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ImmutableSortedMapRulesTestInput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static com.google.common.collect.ImmutableSortedMap.toImmutableSortedMap; import static java.util.Comparator.naturalOrder; @@ -10,9 +10,9 @@ import java.util.Comparator; import java.util.Map; import java.util.stream.Stream; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class ImmutableSortedMapTemplatesTest implements RefasterTemplateTestCase { +final class ImmutableSortedMapRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of( diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ImmutableSortedMapTemplatesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ImmutableSortedMapRulesTestOutput.java similarity index 91% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ImmutableSortedMapTemplatesTestOutput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ImmutableSortedMapRulesTestOutput.java index 7f394fa1f1..9955c0c540 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ImmutableSortedMapTemplatesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ImmutableSortedMapRulesTestOutput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static com.google.common.collect.ImmutableSortedMap.toImmutableSortedMap; import static java.util.Comparator.naturalOrder; @@ -10,9 +10,9 @@ import java.util.Comparator; import java.util.Map; import java.util.stream.Stream; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class ImmutableSortedMapTemplatesTest implements RefasterTemplateTestCase { +final class ImmutableSortedMapRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of( diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ImmutableSortedMultisetTemplatesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ImmutableSortedMultisetRulesTestInput.java similarity index 92% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ImmutableSortedMultisetTemplatesTestInput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ImmutableSortedMultisetRulesTestInput.java index 085fb1e8c6..0906733c3b 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ImmutableSortedMultisetTemplatesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ImmutableSortedMultisetRulesTestInput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static com.google.common.collect.ImmutableSortedMultiset.toImmutableSortedMultiset; import static java.util.Comparator.naturalOrder; @@ -11,9 +11,9 @@ import java.util.Arrays; import java.util.Comparator; import java.util.stream.Stream; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class ImmutableSortedMultisetTemplatesTest implements RefasterTemplateTestCase { +final class ImmutableSortedMultisetRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of(Arrays.class, Streams.class); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ImmutableSortedMultisetTemplatesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ImmutableSortedMultisetRulesTestOutput.java similarity index 91% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ImmutableSortedMultisetTemplatesTestOutput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ImmutableSortedMultisetRulesTestOutput.java index 843c2922e6..ffcba2930a 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ImmutableSortedMultisetTemplatesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ImmutableSortedMultisetRulesTestOutput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static com.google.common.collect.ImmutableSortedMultiset.toImmutableSortedMultiset; import static java.util.Comparator.naturalOrder; @@ -11,9 +11,9 @@ import java.util.Arrays; import java.util.Comparator; import java.util.stream.Stream; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class ImmutableSortedMultisetTemplatesTest implements RefasterTemplateTestCase { +final class ImmutableSortedMultisetRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of(Arrays.class, Streams.class); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ImmutableSortedSetTemplatesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ImmutableSortedSetRulesTestInput.java similarity index 92% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ImmutableSortedSetTemplatesTestInput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ImmutableSortedSetRulesTestInput.java index 4a90a87457..a1d8f80f4c 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ImmutableSortedSetTemplatesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ImmutableSortedSetRulesTestInput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static com.google.common.collect.ImmutableSortedSet.toImmutableSortedSet; import static java.util.Comparator.naturalOrder; @@ -10,9 +10,9 @@ import java.util.Arrays; import java.util.Comparator; import java.util.stream.Stream; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class ImmutableSortedSetTemplatesTest implements RefasterTemplateTestCase { +final class ImmutableSortedSetRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of(Arrays.class, Streams.class); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ImmutableSortedSetTemplatesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ImmutableSortedSetRulesTestOutput.java similarity index 91% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ImmutableSortedSetTemplatesTestOutput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ImmutableSortedSetRulesTestOutput.java index b944a2ef31..5fa58dbbfe 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ImmutableSortedSetTemplatesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ImmutableSortedSetRulesTestOutput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static com.google.common.collect.ImmutableSortedSet.toImmutableSortedSet; import static java.util.Comparator.naturalOrder; @@ -10,9 +10,9 @@ import java.util.Arrays; import java.util.Comparator; import java.util.stream.Stream; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class ImmutableSortedSetTemplatesTest implements RefasterTemplateTestCase { +final class ImmutableSortedSetRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of(Arrays.class, Streams.class); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/IntStreamTemplatesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/IntStreamRulesTestInput.java similarity index 93% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/IntStreamTemplatesTestInput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/IntStreamRulesTestInput.java index 03cf380352..32458e2bbb 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/IntStreamTemplatesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/IntStreamRulesTestInput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Streams; @@ -6,9 +6,9 @@ import java.util.function.IntPredicate; import java.util.stream.IntStream; import java.util.stream.Stream; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class IntStreamTemplatesTest implements RefasterTemplateTestCase { +final class IntStreamRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of(Streams.class); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/IntStreamTemplatesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/IntStreamRulesTestOutput.java similarity index 93% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/IntStreamTemplatesTestOutput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/IntStreamRulesTestOutput.java index c40930f27a..c75ce7bb7f 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/IntStreamTemplatesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/IntStreamRulesTestOutput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Streams; @@ -6,9 +6,9 @@ import java.util.function.IntPredicate; import java.util.stream.IntStream; import java.util.stream.Stream; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class IntStreamTemplatesTest implements RefasterTemplateTestCase { +final class IntStreamRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of(Streams.class); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/JUnitTemplatesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/JUnitRulesTestInput.java similarity index 59% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/JUnitTemplatesTestInput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/JUnitRulesTestInput.java index 77c83e8916..25ebb0d566 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/JUnitTemplatesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/JUnitRulesTestInput.java @@ -1,10 +1,10 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import com.google.common.collect.ImmutableSet; import org.junit.jupiter.params.provider.Arguments; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class JUnitTemplatesTest implements RefasterTemplateTestCase { +final class JUnitRulesTest implements RefasterRuleCollectionTestCase { ImmutableSet testArgumentsEnumeration() { return ImmutableSet.of( Arguments.of("foo"), Arguments.of(1, "foo", 2, "bar"), Arguments.of(new Object())); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/JUnitTemplatesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/JUnitRulesTestOutput.java similarity index 63% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/JUnitTemplatesTestOutput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/JUnitRulesTestOutput.java index 13151144b2..45dba93b76 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/JUnitTemplatesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/JUnitRulesTestOutput.java @@ -1,12 +1,12 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static org.junit.jupiter.params.provider.Arguments.arguments; import com.google.common.collect.ImmutableSet; import org.junit.jupiter.params.provider.Arguments; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class JUnitTemplatesTest implements RefasterTemplateTestCase { +final class JUnitRulesTest implements RefasterRuleCollectionTestCase { ImmutableSet testArgumentsEnumeration() { return ImmutableSet.of( arguments("foo"), arguments(1, "foo", 2, "bar"), arguments(new Object())); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/LongStreamTemplatesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/LongStreamRulesTestInput.java similarity index 93% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/LongStreamTemplatesTestInput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/LongStreamRulesTestInput.java index 51a32a1d3a..3909ce3df7 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/LongStreamTemplatesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/LongStreamRulesTestInput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Streams; @@ -6,9 +6,9 @@ import java.util.function.LongPredicate; import java.util.stream.LongStream; import java.util.stream.Stream; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class LongStreamTemplatesTest implements RefasterTemplateTestCase { +final class LongStreamRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of(Streams.class); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/LongStreamTemplatesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/LongStreamRulesTestOutput.java similarity index 93% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/LongStreamTemplatesTestOutput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/LongStreamRulesTestOutput.java index c87219b7fd..b585534a33 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/LongStreamTemplatesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/LongStreamRulesTestOutput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Streams; @@ -6,9 +6,9 @@ import java.util.function.LongPredicate; import java.util.stream.LongStream; import java.util.stream.Stream; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class LongStreamTemplatesTest implements RefasterTemplateTestCase { +final class LongStreamRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of(Streams.class); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/MapEntryTemplatesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/MapEntryRulesTestInput.java similarity index 87% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/MapEntryTemplatesTestInput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/MapEntryRulesTestInput.java index e829d26833..99b40dd7e2 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/MapEntryTemplatesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/MapEntryRulesTestInput.java @@ -1,13 +1,13 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Maps; import java.util.AbstractMap; import java.util.Comparator; import java.util.Map; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class MapEntryTemplatesTest implements RefasterTemplateTestCase { +final class MapEntryRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of(AbstractMap.class, Maps.class); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/MapEntryTemplatesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/MapEntryRulesTestOutput.java similarity index 85% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/MapEntryTemplatesTestOutput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/MapEntryRulesTestOutput.java index 056bb169ee..39cfa9c280 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/MapEntryTemplatesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/MapEntryRulesTestOutput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static java.util.Map.Entry.comparingByKey; import static java.util.Map.Entry.comparingByValue; @@ -8,9 +8,9 @@ import java.util.AbstractMap; import java.util.Comparator; import java.util.Map; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class MapEntryTemplatesTest implements RefasterTemplateTestCase { +final class MapEntryRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of(AbstractMap.class, Maps.class); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/MockitoTemplatesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/MockitoRulesTestInput.java similarity index 70% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/MockitoTemplatesTestInput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/MockitoRulesTestInput.java index f48eec9c48..667bd22081 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/MockitoTemplatesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/MockitoRulesTestInput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; @@ -6,9 +6,9 @@ import com.google.common.collect.ImmutableSet; import org.mockito.verification.VerificationMode; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class MockitoTemplatesTest implements RefasterTemplateTestCase { +final class MockitoRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of(times(1)); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/MockitoTemplatesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/MockitoRulesTestOutput.java similarity index 72% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/MockitoTemplatesTestOutput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/MockitoRulesTestOutput.java index 367ffba744..292faf3524 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/MockitoTemplatesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/MockitoRulesTestOutput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.never; @@ -7,9 +7,9 @@ import com.google.common.collect.ImmutableSet; import org.mockito.verification.VerificationMode; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class MockitoTemplatesTest implements RefasterTemplateTestCase { +final class MockitoRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of(times(1)); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/MultimapTemplatesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/MultimapRulesTestInput.java similarity index 80% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/MultimapTemplatesTestInput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/MultimapRulesTestInput.java index 3348249ba7..d11347fa16 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/MultimapTemplatesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/MultimapRulesTestInput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSetMultimap; @@ -6,9 +6,9 @@ import com.google.common.collect.Multimaps; import java.util.Collection; import java.util.Set; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class MultimapTemplatesTest implements RefasterTemplateTestCase { +final class MultimapRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of(Multimaps.class); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/MultimapTemplatesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/MultimapRulesTestOutput.java similarity index 79% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/MultimapTemplatesTestOutput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/MultimapRulesTestOutput.java index 0aeab3fc01..417de18ab1 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/MultimapTemplatesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/MultimapRulesTestOutput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSetMultimap; @@ -6,9 +6,9 @@ import com.google.common.collect.Multimaps; import java.util.Collection; import java.util.Set; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class MultimapTemplatesTest implements RefasterTemplateTestCase { +final class MultimapRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of(Multimaps.class); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/NullTemplatesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/NullRulesTestInput.java similarity index 78% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/NullTemplatesTestInput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/NullRulesTestInput.java index 971c3324ee..9163673a5f 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/NullTemplatesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/NullRulesTestInput.java @@ -1,12 +1,12 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import com.google.common.base.MoreObjects; import com.google.common.collect.ImmutableSet; import java.util.Objects; import java.util.stream.Stream; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class NullTemplatesTest implements RefasterTemplateTestCase { +final class NullRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of(MoreObjects.class); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/NullTemplatesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/NullRulesTestOutput.java similarity index 78% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/NullTemplatesTestOutput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/NullRulesTestOutput.java index ed066a5599..4867d0089d 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/NullTemplatesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/NullRulesTestOutput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static java.util.Objects.requireNonNullElse; @@ -6,9 +6,9 @@ import com.google.common.collect.ImmutableSet; import java.util.Objects; import java.util.stream.Stream; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class NullTemplatesTest implements RefasterTemplateTestCase { +final class NullRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of(MoreObjects.class); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/OptionalTemplatesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/OptionalRulesTestInput.java similarity index 95% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/OptionalTemplatesTestInput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/OptionalRulesTestInput.java index 02c027c3d9..d06d9da7d9 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/OptionalTemplatesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/OptionalRulesTestInput.java @@ -1,13 +1,13 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Streams; import java.util.Optional; import java.util.function.Function; import java.util.stream.Stream; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class OptionalTemplatesTest implements RefasterTemplateTestCase { +final class OptionalRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of(Streams.class); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/OptionalTemplatesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/OptionalRulesTestOutput.java similarity index 94% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/OptionalTemplatesTestOutput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/OptionalRulesTestOutput.java index 3c2d94dab9..e20f6b4a6f 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/OptionalTemplatesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/OptionalRulesTestOutput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static com.google.common.collect.Streams.stream; @@ -7,9 +7,9 @@ import java.util.Optional; import java.util.function.Function; import java.util.stream.Stream; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class OptionalTemplatesTest implements RefasterTemplateTestCase { +final class OptionalRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of(Streams.class); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/PrimitiveTemplatesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/PrimitiveRulesTestInput.java similarity index 87% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/PrimitiveTemplatesTestInput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/PrimitiveRulesTestInput.java index c94bdc65a2..c3b5d3d5c9 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/PrimitiveTemplatesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/PrimitiveRulesTestInput.java @@ -1,10 +1,10 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import com.google.common.collect.ImmutableSet; import com.google.common.primitives.Ints; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class PrimitiveTemplatesTest implements RefasterTemplateTestCase { +final class PrimitiveRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of(Ints.class); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/PrimitiveTemplatesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/PrimitiveRulesTestOutput.java similarity index 86% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/PrimitiveTemplatesTestOutput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/PrimitiveRulesTestOutput.java index 0c7e1034c8..a9d675f0a5 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/PrimitiveTemplatesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/PrimitiveRulesTestOutput.java @@ -1,10 +1,10 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import com.google.common.collect.ImmutableSet; import com.google.common.primitives.Ints; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class PrimitiveTemplatesTest implements RefasterTemplateTestCase { +final class PrimitiveRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of(Ints.class); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ReactorTemplatesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ReactorRulesTestInput.java similarity index 96% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ReactorTemplatesTestInput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ReactorRulesTestInput.java index aef41daaca..cbf5cc888f 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ReactorTemplatesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ReactorRulesTestInput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static org.assertj.core.api.Assertions.assertThat; @@ -12,9 +12,9 @@ import reactor.core.publisher.Mono; import reactor.test.StepVerifier; import reactor.test.publisher.PublisherProbe; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class ReactorTemplatesTest implements RefasterTemplateTestCase { +final class ReactorRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of(assertThat(0)); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ReactorTemplatesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ReactorRulesTestOutput.java similarity index 96% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ReactorTemplatesTestOutput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ReactorRulesTestOutput.java index a57a3c561a..94daf79ec9 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/ReactorTemplatesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ReactorRulesTestOutput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static com.google.common.collect.MoreCollectors.toOptional; import static java.util.function.Function.identity; @@ -14,9 +14,9 @@ import reactor.core.publisher.Mono; import reactor.test.StepVerifier; import reactor.test.publisher.PublisherProbe; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class ReactorTemplatesTest implements RefasterTemplateTestCase { +final class ReactorRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of(assertThat(0)); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/RxJava2AdapterTemplatesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/RxJava2AdapterRulesTestInput.java similarity index 93% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/RxJava2AdapterTemplatesTestInput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/RxJava2AdapterRulesTestInput.java index 415a6954a1..5562a671b2 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/RxJava2AdapterTemplatesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/RxJava2AdapterRulesTestInput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import com.google.common.collect.ImmutableSet; import io.reactivex.BackpressureStrategy; @@ -10,9 +10,9 @@ import reactor.adapter.rxjava.RxJava2Adapter; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class RxJava2AdapterTemplatesTest implements RefasterTemplateTestCase { +final class RxJava2AdapterRulesTest implements RefasterRuleCollectionTestCase { ImmutableSet> testCompletableToMono() { return ImmutableSet.of( RxJava2Adapter.completableToMono(Completable.complete()), diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/RxJava2AdapterTemplatesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/RxJava2AdapterRulesTestOutput.java similarity index 94% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/RxJava2AdapterTemplatesTestOutput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/RxJava2AdapterRulesTestOutput.java index ab093b0c0b..6a088d1435 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/RxJava2AdapterTemplatesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/RxJava2AdapterRulesTestOutput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import com.google.common.collect.ImmutableSet; import io.reactivex.BackpressureStrategy; @@ -10,9 +10,9 @@ import reactor.adapter.rxjava.RxJava2Adapter; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class RxJava2AdapterTemplatesTest implements RefasterTemplateTestCase { +final class RxJava2AdapterRulesTest implements RefasterRuleCollectionTestCase { ImmutableSet> testCompletableToMono() { return ImmutableSet.of( Completable.complete().as(RxJava2Adapter::completableToMono), diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/StreamTemplatesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/StreamRulesTestInput.java similarity index 95% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/StreamTemplatesTestInput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/StreamRulesTestInput.java index f59538c6b0..67911c452f 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/StreamTemplatesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/StreamRulesTestInput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static java.util.Comparator.comparingInt; import static java.util.Comparator.reverseOrder; @@ -11,9 +11,9 @@ import java.util.Optional; import java.util.function.Predicate; import java.util.stream.Stream; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class StreamTemplatesTest implements RefasterTemplateTestCase { +final class StreamRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of(Objects.class, Streams.class, not(null), reverseOrder()); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/StreamTemplatesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/StreamRulesTestOutput.java similarity index 95% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/StreamTemplatesTestOutput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/StreamRulesTestOutput.java index c41746138d..87e7619539 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/StreamTemplatesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/StreamRulesTestOutput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static java.util.Comparator.comparingInt; import static java.util.Comparator.naturalOrder; @@ -13,9 +13,9 @@ import java.util.Optional; import java.util.function.Predicate; import java.util.stream.Stream; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class StreamTemplatesTest implements RefasterTemplateTestCase { +final class StreamRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of(Objects.class, Streams.class, not(null), reverseOrder()); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/StringTemplatesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/StringRulesTestInput.java similarity index 93% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/StringTemplatesTestInput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/StringRulesTestInput.java index af94e0a546..f70407c02b 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/StringTemplatesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/StringRulesTestInput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static java.nio.charset.StandardCharsets.UTF_8; import static java.util.stream.Collectors.joining; @@ -14,9 +14,9 @@ import java.util.Optional; import java.util.function.Function; import java.util.stream.Stream; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class StringTemplatesTest implements RefasterTemplateTestCase { +final class StringRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of( diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/StringTemplatesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/StringRulesTestOutput.java similarity index 92% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/StringTemplatesTestOutput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/StringRulesTestOutput.java index 9e85aa5782..723cfe3ce3 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/StringTemplatesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/StringRulesTestOutput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static java.nio.charset.StandardCharsets.UTF_8; import static java.util.stream.Collectors.joining; @@ -15,9 +15,9 @@ import java.util.Optional; import java.util.function.Function; import java.util.stream.Stream; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class StringTemplatesTest implements RefasterTemplateTestCase { +final class StringRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of( diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/TestNGToAssertJTemplatesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/TestNGToAssertJRulesTestInput.java similarity index 97% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/TestNGToAssertJTemplatesTestInput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/TestNGToAssertJRulesTestInput.java index 34d0a9fd48..91e7999b5f 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/TestNGToAssertJTemplatesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/TestNGToAssertJRulesTestInput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertEqualsNoOrder; @@ -17,9 +17,9 @@ import com.google.common.collect.Iterators; import java.util.ArrayList; import java.util.Collections; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class TestNGToAssertJTemplatesTest implements RefasterTemplateTestCase { +final class TestNGToAssertJRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of( diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/TestNGToAssertJTemplatesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/TestNGToAssertJRulesTestOutput.java similarity index 98% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/TestNGToAssertJTemplatesTestOutput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/TestNGToAssertJRulesTestOutput.java index 496620306b..ba9ad9a409 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/TestNGToAssertJTemplatesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/TestNGToAssertJRulesTestOutput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static com.google.common.collect.ImmutableList.copyOf; import static org.assertj.core.api.Assertions.assertThat; @@ -22,9 +22,9 @@ import com.google.common.collect.Iterators; import java.util.ArrayList; import java.util.Collections; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class TestNGToAssertJTemplatesTest implements RefasterTemplateTestCase { +final class TestNGToAssertJRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of( diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/TimeTemplatesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/TimeRulesTestInput.java similarity index 96% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/TimeTemplatesTestInput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/TimeRulesTestInput.java index 09060a69b1..b813403c0d 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/TimeTemplatesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/TimeRulesTestInput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import com.google.common.collect.ImmutableSet; import java.time.Clock; @@ -13,9 +13,9 @@ import java.time.ZoneOffset; import java.time.ZonedDateTime; import java.time.temporal.ChronoUnit; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class TimeTemplatesTest implements RefasterTemplateTestCase { +final class TimeRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of(ChronoUnit.class); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/TimeTemplatesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/TimeRulesTestOutput.java similarity index 95% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/TimeTemplatesTestOutput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/TimeRulesTestOutput.java index 215c93fe8c..2e411bcc19 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/TimeTemplatesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/TimeRulesTestOutput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import com.google.common.collect.ImmutableSet; import java.time.Clock; @@ -13,9 +13,9 @@ import java.time.ZoneOffset; import java.time.ZonedDateTime; import java.time.temporal.ChronoUnit; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class TimeTemplatesTest implements RefasterTemplateTestCase { +final class TimeRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of(ChronoUnit.class); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/WebClientTemplatesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/WebClientRulesTestInput.java similarity index 92% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/WebClientTemplatesTestInput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/WebClientRulesTestInput.java index 323899bb31..61a0cd2dfb 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/WebClientTemplatesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/WebClientRulesTestInput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static org.springframework.http.HttpMethod.GET; import static org.springframework.http.HttpMethod.HEAD; @@ -11,9 +11,9 @@ import com.google.common.collect.ImmutableSet; import org.springframework.test.web.reactive.server.WebTestClient; import org.springframework.web.reactive.function.client.WebClient; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class WebClientTemplatesTest implements RefasterTemplateTestCase { +final class WebClientRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of(fromValue(""), GET, HEAD, OPTIONS, PATCH, POST, PUT); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/WebClientTemplatesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/WebClientRulesTestOutput.java similarity index 91% rename from error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/WebClientTemplatesTestOutput.java rename to error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/WebClientRulesTestOutput.java index 9e0d57831d..fcdbf4c269 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refastertemplates/WebClientTemplatesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/WebClientRulesTestOutput.java @@ -1,4 +1,4 @@ -package tech.picnic.errorprone.refastertemplates; +package tech.picnic.errorprone.refasterrules; import static org.springframework.http.HttpMethod.GET; import static org.springframework.http.HttpMethod.HEAD; @@ -11,9 +11,9 @@ import com.google.common.collect.ImmutableSet; import org.springframework.test.web.reactive.server.WebTestClient; import org.springframework.web.reactive.function.client.WebClient; -import tech.picnic.errorprone.refaster.test.RefasterTemplateTestCase; +import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase; -final class WebClientTemplatesTest implements RefasterTemplateTestCase { +final class WebClientRulesTest implements RefasterRuleCollectionTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of(fromValue(""), GET, HEAD, OPTIONS, PATCH, POST, PUT); diff --git a/pom.xml b/pom.xml index a456f64279..67001d1494 100644 --- a/pom.xml +++ b/pom.xml @@ -1230,10 +1230,9 @@ false - - tech.picnic.errorprone.refastertemplates + + tech.picnic.errorprone.refasterrules ${version.jdk} @@ -1368,7 +1367,7 @@ + check/rule under test. Ideally all test cases are realistic. --> -XepAllSuggestionsAsWarnings -Xep:MethodReferenceUsage:OFF diff --git a/refaster-compiler/pom.xml b/refaster-compiler/pom.xml index 049521617d..c494ab1dc0 100644 --- a/refaster-compiler/pom.xml +++ b/refaster-compiler/pom.xml @@ -11,7 +11,7 @@ refaster-compiler Picnic :: Error Prone Support :: Refaster Compiler - A Java compiler plugin that identifies and compiles Refaster templates, storing them as resource files on the classpath. + A Java compiler plugin that identifies and compiles Refaster rules, storing them as resource files on the classpath. diff --git a/refaster-compiler/src/main/java/tech/picnic/errorprone/refaster/plugin/RefasterRuleCompiler.java b/refaster-compiler/src/main/java/tech/picnic/errorprone/refaster/plugin/RefasterRuleCompiler.java index c78593e4bc..47dcdff99d 100644 --- a/refaster-compiler/src/main/java/tech/picnic/errorprone/refaster/plugin/RefasterRuleCompiler.java +++ b/refaster-compiler/src/main/java/tech/picnic/errorprone/refaster/plugin/RefasterRuleCompiler.java @@ -8,7 +8,7 @@ /** * A variant of {@code com.google.errorprone.refaster.RefasterRuleCompiler} that outputs a {@code * fully/qualified/Class.refaster} file for each compiled {@code fully.qualified.Class} that - * contains a Refaster template. + * contains a Refaster rule. */ @AutoService(Plugin.class) public final class RefasterRuleCompiler implements Plugin { diff --git a/refaster-compiler/src/main/java/tech/picnic/errorprone/refaster/plugin/RefasterRuleCompilerTaskListener.java b/refaster-compiler/src/main/java/tech/picnic/errorprone/refaster/plugin/RefasterRuleCompilerTaskListener.java index e2940b1422..7731ee0810 100644 --- a/refaster-compiler/src/main/java/tech/picnic/errorprone/refaster/plugin/RefasterRuleCompilerTaskListener.java +++ b/refaster-compiler/src/main/java/tech/picnic/errorprone/refaster/plugin/RefasterRuleCompilerTaskListener.java @@ -54,21 +54,21 @@ public void finished(TaskEvent taskEvent) { } ClassTree tree = JavacTrees.instance(context).getTree(taskEvent.getTypeElement()); - if (tree == null || !containsRefasterTemplates(tree)) { + if (tree == null || !containsRefasterRules(tree)) { return; } - ImmutableListMultimap rules = compileRefasterTemplates(tree); + ImmutableListMultimap rules = compileRefasterRules(tree); for (Map.Entry> rule : Multimaps.asMap(rules).entrySet()) { try { outputCodeTransformers(rule.getValue(), getOutputFile(taskEvent, rule.getKey())); } catch (IOException e) { - throw new UncheckedIOException("Failed to persist compiled Refaster templates", e); + throw new UncheckedIOException("Failed to persist compiled Refaster rules", e); } } } - private boolean containsRefasterTemplates(ClassTree tree) { + private boolean containsRefasterRules(ClassTree tree) { return Boolean.TRUE.equals( new TreeScanner() { @Override @@ -87,8 +87,7 @@ public Boolean reduce(Boolean r1, Boolean r2) { }.scan(tree, null)); } - private ImmutableListMultimap compileRefasterTemplates( - ClassTree tree) { + private ImmutableListMultimap compileRefasterRules(ClassTree tree) { ListMultimap rules = ArrayListMultimap.create(); new TreeScanner() { @Nullable diff --git a/refaster-compiler/src/main/java/tech/picnic/errorprone/refaster/plugin/package-info.java b/refaster-compiler/src/main/java/tech/picnic/errorprone/refaster/plugin/package-info.java index 7a5be8d1f6..78b0583712 100644 --- a/refaster-compiler/src/main/java/tech/picnic/errorprone/refaster/plugin/package-info.java +++ b/refaster-compiler/src/main/java/tech/picnic/errorprone/refaster/plugin/package-info.java @@ -1,5 +1,5 @@ /** - * A Java compiler plugin that identifies and compiles Refaster templates, storing them as resource + * A Java compiler plugin that identifies and compiles Refaster rules, storing them as resource * files on the classpath. */ @com.google.errorprone.annotations.CheckReturnValue diff --git a/refaster-runner/pom.xml b/refaster-runner/pom.xml index 7bccf546c5..c0265fc3a7 100644 --- a/refaster-runner/pom.xml +++ b/refaster-runner/pom.xml @@ -11,7 +11,7 @@ refaster-runner Picnic :: Error Prone Support :: Refaster Runner - Exposes Refaster templates found on the classpath through a regular Error Prone check. + Exposes Refaster rules found on the classpath through a regular Error Prone check. diff --git a/refaster-runner/src/main/java/tech/picnic/errorprone/refaster/runner/CodeTransformers.java b/refaster-runner/src/main/java/tech/picnic/errorprone/refaster/runner/CodeTransformers.java index f3bde9fd0c..cda3004c0e 100644 --- a/refaster-runner/src/main/java/tech/picnic/errorprone/refaster/runner/CodeTransformers.java +++ b/refaster-runner/src/main/java/tech/picnic/errorprone/refaster/runner/CodeTransformers.java @@ -15,11 +15,11 @@ import java.util.function.Supplier; /** - * Scans the classpath for {@value #REFASTER_TEMPLATE_SUFFIX} files and loads them as {@link + * Scans the classpath for {@value #REFASTER_RULE_SUFFIX} files and loads them as {@link * CodeTransformer}s. */ public final class CodeTransformers { - private static final String REFASTER_TEMPLATE_SUFFIX = ".refaster"; + private static final String REFASTER_RULE_SUFFIX = ".refaster"; private static final Supplier> ALL_CODE_TRANSFORMERS = Suppliers.memoize(CodeTransformers::loadAllCodeTransformers); @@ -30,28 +30,28 @@ private CodeTransformers() {} * *

This method returns a cached view; all invocations except the first are very cheap. * - * @return A mapping from Refaster template names to associated {@link CodeTransformer}s. + * @return A mapping from Refaster rule names to associated {@link CodeTransformer}s. */ public static ImmutableListMultimap getAllCodeTransformers() { return ALL_CODE_TRANSFORMERS.get(); } /** - * Scans the classpath for compiled Refaster templates and returns the associated deserialized - * {@link CodeTransformer}s, indexed by their name. + * Scans the classpath for compiled Refaster rules and returns the associated deserialized {@link + * CodeTransformer}s, indexed by their name. * - * @return A mapping from Refaster template names to associated {@link CodeTransformer}s. + * @return A mapping from Refaster rule names to associated {@link CodeTransformer}s. */ private static ImmutableListMultimap loadAllCodeTransformers() { ImmutableListMultimap.Builder transformers = ImmutableListMultimap.builder(); for (ResourceInfo resource : getClassPathResources()) { - getRefasterTemplateName(resource) + getRefasterRuleName(resource) .ifPresent( - templateName -> + ruleName -> loadCodeTransformer(resource) - .ifPresent(transformer -> transformers.put(templateName, transformer))); + .ifPresent(transformer -> transformers.put(ruleName, transformer))); } return transformers.build(); @@ -65,15 +65,15 @@ private static ImmutableSet getClassPathResources() { } } - private static Optional getRefasterTemplateName(ResourceInfo resource) { + private static Optional getRefasterRuleName(ResourceInfo resource) { String resourceName = resource.getResourceName(); - if (!resourceName.endsWith(REFASTER_TEMPLATE_SUFFIX)) { + if (!resourceName.endsWith(REFASTER_RULE_SUFFIX)) { return Optional.empty(); } int lastPathSeparator = resourceName.lastIndexOf('/'); int beginIndex = lastPathSeparator < 0 ? 0 : lastPathSeparator + 1; - int endIndex = resourceName.length() - REFASTER_TEMPLATE_SUFFIX.length(); + int endIndex = resourceName.length() - REFASTER_RULE_SUFFIX.length(); return Optional.of(resourceName.substring(beginIndex, endIndex)); } diff --git a/refaster-runner/src/main/java/tech/picnic/errorprone/refaster/runner/Refaster.java b/refaster-runner/src/main/java/tech/picnic/errorprone/refaster/runner/Refaster.java index 118475dbea..203e2fe25b 100644 --- a/refaster-runner/src/main/java/tech/picnic/errorprone/refaster/runner/Refaster.java +++ b/refaster-runner/src/main/java/tech/picnic/errorprone/refaster/runner/Refaster.java @@ -37,11 +37,11 @@ import java.util.stream.Stream; /** - * A {@link BugChecker} that flags code that can be simplified using Refaster templates located on - * the classpath. + * A {@link BugChecker} that flags code that can be simplified using Refaster rules located on the + * classpath. * *

This checker locates all {@code *.refaster} classpath resources and assumes they contain a - * {@link CodeTransformer}. The set of loaded Refaster templates can be restricted by passing {@code + * {@link CodeTransformer}. The set of loaded Refaster rules can be restricted by passing {@code * -XepOpt:Refaster:NamePattern=}. */ @AutoService(BugChecker.class) @@ -51,8 +51,8 @@ severity = SUGGESTION, tags = SIMPLIFICATION) public final class Refaster extends BugChecker implements CompilationUnitTreeMatcher { - /** Flag to pass a pattern that restricts which Refaster templates are loaded. */ - public static final String INCLUDED_TEMPLATES_PATTERN_FLAG = "Refaster:NamePattern"; + /** Flag to pass a pattern that restricts which Refaster rules are loaded. */ + public static final String INCLUDED_RULES_PATTERN_FLAG = "Refaster:NamePattern"; private static final long serialVersionUID = 1L; @@ -151,7 +151,7 @@ private static CodeTransformer createCompositeCodeTransformer(ErrorProneFlags fl CodeTransformers.getAllCodeTransformers(); return CompositeCodeTransformer.compose( flags - .get(INCLUDED_TEMPLATES_PATTERN_FLAG) + .get(INCLUDED_RULES_PATTERN_FLAG) .map(Pattern::compile) .>map( nameFilter -> filterCodeTransformers(allTransformers, nameFilter)) diff --git a/refaster-runner/src/main/java/tech/picnic/errorprone/refaster/runner/package-info.java b/refaster-runner/src/main/java/tech/picnic/errorprone/refaster/runner/package-info.java index dc08a789c6..c10739493d 100644 --- a/refaster-runner/src/main/java/tech/picnic/errorprone/refaster/runner/package-info.java +++ b/refaster-runner/src/main/java/tech/picnic/errorprone/refaster/runner/package-info.java @@ -1,4 +1,4 @@ -/** Exposes Refaster templates found on the classpath through a regular Error Prone check. */ +/** Exposes Refaster rules found on the classpath through a regular Error Prone check. */ @com.google.errorprone.annotations.CheckReturnValue @javax.annotation.ParametersAreNonnullByDefault package tech.picnic.errorprone.refaster.runner; diff --git a/refaster-runner/src/test/java/tech/picnic/errorprone/refaster/runner/CodeTransformersTest.java b/refaster-runner/src/test/java/tech/picnic/errorprone/refaster/runner/CodeTransformersTest.java index b4a2732102..5888f03422 100644 --- a/refaster-runner/src/test/java/tech/picnic/errorprone/refaster/runner/CodeTransformersTest.java +++ b/refaster-runner/src/test/java/tech/picnic/errorprone/refaster/runner/CodeTransformersTest.java @@ -7,11 +7,11 @@ final class CodeTransformersTest { /** * Verifies that {@link CodeTransformers#getAllCodeTransformers()} finds the code transformer - * compiled from {@link FooTemplates} on the classpath. + * compiled from {@link FooRules} on the classpath. */ @Test void getAllCodeTransformers() { assertThat(CodeTransformers.getAllCodeTransformers().keySet()) - .containsExactly("FooTemplates$SimpleTemplate"); + .containsExactly("FooRules$SimpleRule"); } } diff --git a/refaster-runner/src/test/java/tech/picnic/errorprone/refaster/runner/FooTemplates.java b/refaster-runner/src/test/java/tech/picnic/errorprone/refaster/runner/FooRules.java similarity index 64% rename from refaster-runner/src/test/java/tech/picnic/errorprone/refaster/runner/FooTemplates.java rename to refaster-runner/src/test/java/tech/picnic/errorprone/refaster/runner/FooRules.java index 0625275d9f..be79875a47 100644 --- a/refaster-runner/src/test/java/tech/picnic/errorprone/refaster/runner/FooTemplates.java +++ b/refaster-runner/src/test/java/tech/picnic/errorprone/refaster/runner/FooRules.java @@ -3,12 +3,12 @@ import com.google.errorprone.refaster.annotation.AfterTemplate; import com.google.errorprone.refaster.annotation.BeforeTemplate; -/** An example template collection used to test {@link CodeTransformers}. */ -final class FooTemplates { - private FooTemplates() {} +/** An example rule collection used to test {@link CodeTransformers}. */ +final class FooRules { + private FooRules() {} - /** Simple template for testing purposes. */ - static final class SimpleTemplate { + /** Simple rule for testing purposes. */ + static final class SimpleRule { @BeforeTemplate boolean before(String string) { return string.toCharArray().length == 0; diff --git a/refaster-support/pom.xml b/refaster-support/pom.xml index a4e65ea140..51680fc3f4 100644 --- a/refaster-support/pom.xml +++ b/refaster-support/pom.xml @@ -11,7 +11,7 @@ refaster-support Picnic :: Error Prone Support :: Refaster Support - Helper utilities for use with Refaster templates. + Helper utilities for use with Refaster rules.