Skip to content

Commit

Permalink
refactor: Use of @EqualsAndHashCode on Recipe (#3979)
Browse files Browse the repository at this point in the history
  • Loading branch information
timtebeek and TeamModerne authored Feb 6, 2024
1 parent 3ecebb8 commit cce9953
Show file tree
Hide file tree
Showing 157 changed files with 161 additions and 161 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import java.nio.file.PathMatcher;

@Value
@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode(callSuper = false)
public class DeleteSourceFiles extends Recipe {

@Option(displayName = "File pattern",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import java.util.Set;

@Value
@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode(callSuper = false)
public class FindCollidingSourceFiles extends ScanningRecipe<FindCollidingSourceFiles.Accumulator> {

transient CollidingSourceFiles collidingSourceFiles = new CollidingSourceFiles(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import static java.time.ZoneOffset.UTC;

@Value
@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode(callSuper = false)
public class FindDeserializationErrors extends Recipe {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import static java.time.ZoneOffset.UTC;

@Value
@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode(callSuper = false)
public class FindLstProvenance extends ScanningRecipe<FindLstProvenance.Accumulator> {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import java.util.Objects;

@Value
@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode(callSuper = false)
public class FindParseFailures extends Recipe {

@Option(displayName = "Max snippet length",
Expand Down
2 changes: 1 addition & 1 deletion rewrite-core/src/main/java/org/openrewrite/FindQuarks.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import static java.util.Objects.requireNonNull;

@Value
@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode(callSuper = false)
public class FindQuarks extends Recipe {
@Override
public String getDisplayName() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@


@Value
@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode(callSuper = false)
public class FindSourceFiles extends Recipe {
transient SourcesFiles results = new SourcesFiles(this);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import java.util.Set;

@Value
@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode(callSuper = false)
public class IsInRepository extends Recipe {
@Override
public String getDisplayName() {
Expand Down
2 changes: 1 addition & 1 deletion rewrite-core/src/main/java/org/openrewrite/RenameFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import java.nio.file.PathMatcher;

@Value
@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode(callSuper = false)
public class RenameFile extends Recipe {
@Option(displayName = "File matcher",
description = "Matching files will be renamed. This is a glob expression.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import java.nio.file.PathMatcher;

@Value
@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode(callSuper = false)
public class SetFilePermissions extends Recipe {
@Option(displayName = "File matcher",
description = "Permissions will be applied to matching files. This is a glob expression.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ private void initialize(List<Recipe> uninitialized, List<Recipe> initialized, Co
}

@Value
@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode(callSuper = false)
@RequiredArgsConstructor
static class PreconditionBellwether extends Recipe {

Expand Down Expand Up @@ -162,7 +162,7 @@ public boolean isAcceptable(SourceFile sourceFile, ExecutionContext ctx) {
}
}

@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode(callSuper = false)
@Value
static class BellwetherDecoratedRecipe extends Recipe {

Expand Down Expand Up @@ -196,7 +196,7 @@ public List<Recipe> getRecipeList() {
}

@Value
@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode(callSuper = false)
static class BellwetherDecoratedScanningRecipe<T> extends ScanningRecipe<T> {

DeclarativeRecipe.PreconditionBellwether bellwether;
Expand Down Expand Up @@ -318,7 +318,7 @@ public Validated<Object> validate() {
}

@Value
@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode(callSuper = false)
private static class LazyLoadedRecipe extends Recipe {
String recipeFqn;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import java.util.TreeMap;

@Value
@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode(callSuper = false)
public class FindCommitters extends ScanningRecipe<Map<String, GitProvenance.Committer>> {
private transient final DistinctCommitters committers = new DistinctCommitters(this);
private transient final CommitsByDay commitsByDay = new CommitsByDay(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import static java.util.Objects.requireNonNull;

@Value
@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode(callSuper = false)
public class AppendToTextFile extends ScanningRecipe<AtomicBoolean> {
@Option(displayName = "Relative File Name",
description = "File name, using a relative path. If a non-plaintext file already exists at this location, then this recipe will do nothing.",
Expand Down
2 changes: 1 addition & 1 deletion rewrite-core/src/main/java/org/openrewrite/text/Find.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import static java.util.Objects.requireNonNull;

@Value
@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode(callSuper = false)
public class Find extends Recipe {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import static org.openrewrite.Tree.randomId;

@Value
@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode(callSuper = false)
public class FindAndReplace extends Recipe {

@Option(displayName = "Find",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

@Incubating(since = "8.2.0")
@Value
@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode(callSuper = false)
public class FindMultiselect extends Recipe {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ void generateFile() {
}

@Value
@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode(callSuper = false)
static class DeleteFirst extends Recipe {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ void dollarSignsTolerated() {
}

@Value
@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode(callSuper = false)
static class MultiFindAndReplace extends Recipe {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
import static java.util.Objects.requireNonNull;

@Value
@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode(callSuper = false)
public class AddDependency extends ScanningRecipe<AddDependency.Scanned> {

@EqualsAndHashCode.Exclude
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
import static java.util.Objects.requireNonNull;

@Value
@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode(callSuper = false)
public class ChangeDependency extends Recipe {
@Option(displayName = "Old groupId",
description = "The old groupId to replace. The groupId is the first part of a dependency coordinate 'com.google.guava:guava:VERSION'. Supports glob expressions.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

import static java.util.Objects.requireNonNull;

@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode(callSuper = false)
@Value
public class ChangeDependencyArtifactId extends Recipe {
@Option(displayName = "Group",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
import static java.util.Objects.requireNonNull;

@Value
@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode(callSuper = false)
public class ChangeDependencyClassifier extends Recipe {
@Option(displayName = "Group",
description = "The first part of a dependency coordinate `com.google.guava:guava:VERSION`. This can be a glob expression.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import java.util.List;

@Value
@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode(callSuper = false)
public class ChangeDependencyConfiguration extends Recipe {
@Option(displayName = "Group",
description = "The first part of a dependency coordinate `com.google.guava:guava:VERSION`. This can be a glob expression.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
import static java.util.Objects.requireNonNull;

@Value
@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode(callSuper = false)
public class ChangeDependencyExtension extends Recipe {
@Option(displayName = "Group",
description = "The first part of a dependency coordinate `com.google.guava:guava:VERSION`. This can be a glob expression.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

import static java.util.Objects.requireNonNull;

@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode(callSuper = false)
@Value
public class ChangeDependencyGroupId extends Recipe {
@Option(displayName = "Group",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@


@Value
@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode(callSuper = false)
public class ChangeExtraProperty extends Recipe {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
import static java.util.Objects.requireNonNull;

@Value
@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode(callSuper = false)
public class RemoveDependency extends Recipe {

@Option(displayName = "Group",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import org.openrewrite.java.tree.J;

@Value
@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode(callSuper = false)
public class RemoveRepository extends Recipe {
@Override
public String getDisplayName() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

@RequiredArgsConstructor
@FieldDefaults(level = AccessLevel.PRIVATE)
@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode(callSuper = false)
public class UpdateGradleWrapper extends ScanningRecipe<UpdateGradleWrapper.GradleWrapperState> {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
import static org.openrewrite.Tree.randomId;

@Value
@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode(callSuper = false)
public class UpdateJavaCompatibility extends Recipe {
@Option(displayName = "Java version",
description = "The Java version to upgrade to.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ private J.MethodInvocation updateDependency(J.MethodInvocation method, Execution
}

@Value
@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode(callSuper = false)
private class UpdateVariable extends GroovyIsoVisitor<ExecutionContext> {
Map<String, Map<GroupArtifact, Set<String>>> versionVariableNames;
GradleProject gradleProject;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import java.util.Optional;

@Value
@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode(callSuper = false)
public class AddBuildPlugin extends Recipe {
@Option(displayName = "Plugin id",
description = "The plugin id to apply.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
import static org.openrewrite.gradle.plugins.AddPluginVisitor.resolvePluginVersion;

@Value
@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode(callSuper = false)
public class AddDevelocityGradlePlugin extends Recipe {
transient MavenMetadataFailures metadataFailures = new MavenMetadataFailures(this);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import java.util.Optional;

@Value
@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode(callSuper = false)
public class AddSettingsPlugin extends Recipe {
@Option(displayName = "Plugin id",
description = "The plugin id to apply.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
import static java.util.Objects.requireNonNull;

@Value
@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode(callSuper = false)
public class AddSettingsPluginRepository extends Recipe {

@Option(displayName = "Type",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
* If you are using either of these plugin styles, you should ensure that the plugin's version is appropriately updated.
*/
@Value
@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode(callSuper = false)
public class ChangePlugin extends Recipe {
@Option(displayName = "Plugin ID",
description = "The current Gradle plugin id.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import org.openrewrite.gradle.IsBuildGradle;

@Value
@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode(callSuper = false)
public class RemoveBuildPlugin extends Recipe {
@Option(displayName = "Plugin id",
description = "The plugin id to remove.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import org.openrewrite.gradle.IsSettingsGradle;

@Value
@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode(callSuper = false)
public class RemoveSettingsPlugin extends Recipe {
@Option(displayName = "Plugin id",
description = "The plugin id to remove.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
import java.util.Optional;

@Value
@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode(callSuper = false)
public class UpgradePluginVersion extends ScanningRecipe<UpgradePluginVersion.DependencyVersionState> {
transient MavenMetadataFailures metadataFailures = new MavenMetadataFailures(this);
private static final String GRADLE_PROPERTIES_FILE_NAME = "gradle.properties";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@


@Value
@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode(callSuper = false)
public class DependencyInsight extends Recipe {
transient DependenciesInUse dependenciesInUse = new DependenciesInUse(this);

Expand Down Expand Up @@ -191,7 +191,7 @@ public Tree visit(@Nullable Tree tree, ExecutionContext ctx) {
};
}

@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode(callSuper = false)
@Value
private static class MarkIndividualDependency extends JavaIsoVisitor<ExecutionContext> {

Expand Down
Loading

0 comments on commit cce9953

Please sign in to comment.