diff --git a/rewrite-core/src/main/java/org/openrewrite/DeleteSourceFiles.java b/rewrite-core/src/main/java/org/openrewrite/DeleteSourceFiles.java index 8fc8031c6f0..9adf86e4e92 100644 --- a/rewrite-core/src/main/java/org/openrewrite/DeleteSourceFiles.java +++ b/rewrite-core/src/main/java/org/openrewrite/DeleteSourceFiles.java @@ -46,7 +46,7 @@ public TreeVisitor getVisitor() { return new TreeVisitor() { @Nullable @Override - public Tree visit(@Nullable Tree tree, ExecutionContext executionContext) { + public Tree visit(@Nullable Tree tree, ExecutionContext ctx) { if (tree instanceof SourceFile) { SourceFile sourceFile = (SourceFile) tree; Path sourcePath = sourceFile.getSourcePath(); diff --git a/rewrite-core/src/main/java/org/openrewrite/FindCollidingSourceFiles.java b/rewrite-core/src/main/java/org/openrewrite/FindCollidingSourceFiles.java index 9f295645dbf..0687c63fd19 100644 --- a/rewrite-core/src/main/java/org/openrewrite/FindCollidingSourceFiles.java +++ b/rewrite-core/src/main/java/org/openrewrite/FindCollidingSourceFiles.java @@ -53,7 +53,7 @@ public Accumulator getInitialValue(ExecutionContext ctx) { public TreeVisitor getScanner(Accumulator acc) { return new TreeVisitor() { @Override - public Tree visit(@Nullable Tree tree, ExecutionContext executionContext) { + public Tree visit(@Nullable Tree tree, ExecutionContext ctx) { assert tree instanceof SourceFile; Path p = ((SourceFile) tree).getSourcePath(); if(acc.getSourcePaths().contains(p)) { @@ -76,11 +76,11 @@ public Collection generate(Accumulator acc, ExecutionConte public TreeVisitor getVisitor(Accumulator acc) { return new TreeVisitor() { @Override - public @Nullable Tree visit(@Nullable Tree tree, ExecutionContext executionContext) { + public @Nullable Tree visit(@Nullable Tree tree, ExecutionContext ctx) { if(tree instanceof SourceFile) { Path p = ((SourceFile) tree).getSourcePath(); if(acc.getDuplicates().contains(p)) { - collidingSourceFiles.insertRow(executionContext, new CollidingSourceFiles.Row( + collidingSourceFiles.insertRow(ctx, new CollidingSourceFiles.Row( p.toString(), tree.getClass().toString() )); diff --git a/rewrite-core/src/main/java/org/openrewrite/FindGitProvenance.java b/rewrite-core/src/main/java/org/openrewrite/FindGitProvenance.java index 9490a988508..e3c57e5d8ca 100644 --- a/rewrite-core/src/main/java/org/openrewrite/FindGitProvenance.java +++ b/rewrite-core/src/main/java/org/openrewrite/FindGitProvenance.java @@ -50,7 +50,7 @@ public Set getInitialValue(ExecutionContext ctx) { public TreeVisitor getScanner(Set provenances) { return new TreeVisitor() { @Override - public Tree visit(@Nullable Tree tree, ExecutionContext executionContext) { + public Tree visit(@Nullable Tree tree, ExecutionContext ctx) { SourceFile sourceFile = (SourceFile) requireNonNull(tree); sourceFile.getMarkers().findFirst(GitProvenance.class).ifPresent(provenance -> provenances.add(provenance.withId(DONT_CONSIDER_ID_IN_HASH_CODE))); diff --git a/rewrite-core/src/main/java/org/openrewrite/IsInRepository.java b/rewrite-core/src/main/java/org/openrewrite/IsInRepository.java index 70a790d3f4c..b5c52bc2b2e 100644 --- a/rewrite-core/src/main/java/org/openrewrite/IsInRepository.java +++ b/rewrite-core/src/main/java/org/openrewrite/IsInRepository.java @@ -48,7 +48,7 @@ public String getDescription() { public TreeVisitor getVisitor() { return new TreeVisitor() { @Override - public @Nullable Tree visit(@Nullable Tree tree, ExecutionContext executionContext) { + public @Nullable Tree visit(@Nullable Tree tree, ExecutionContext ctx) { if (tree == null) { return null; } diff --git a/rewrite-core/src/main/java/org/openrewrite/RenameFile.java b/rewrite-core/src/main/java/org/openrewrite/RenameFile.java index be392f48446..a47c4cdadb3 100644 --- a/rewrite-core/src/main/java/org/openrewrite/RenameFile.java +++ b/rewrite-core/src/main/java/org/openrewrite/RenameFile.java @@ -50,7 +50,7 @@ public TreeVisitor getVisitor() { return new TreeVisitor() { @Nullable @Override - public Tree visit(@Nullable Tree tree, ExecutionContext executionContext) { + public Tree visit(@Nullable Tree tree, ExecutionContext ctx) { if (tree instanceof SourceFile) { SourceFile sourceFile = (SourceFile) tree; Path sourcePath = sourceFile.getSourcePath(); @@ -59,7 +59,7 @@ public Tree visit(@Nullable Tree tree, ExecutionContext executionContext) { return ((SourceFile) tree).withSourcePath(sourcePath.resolveSibling(fileName).normalize()); } } - return super.visit(tree, executionContext); + return super.visit(tree, ctx); } }; } diff --git a/rewrite-core/src/main/java/org/openrewrite/SetFilePermissions.java b/rewrite-core/src/main/java/org/openrewrite/SetFilePermissions.java index 693025a972a..1f49774616c 100644 --- a/rewrite-core/src/main/java/org/openrewrite/SetFilePermissions.java +++ b/rewrite-core/src/main/java/org/openrewrite/SetFilePermissions.java @@ -57,7 +57,7 @@ public TreeVisitor getVisitor() { return new TreeVisitor() { @Nullable @Override - public Tree visit(@Nullable Tree tree, ExecutionContext executionContext) { + public Tree visit(@Nullable Tree tree, ExecutionContext ctx) { if (tree instanceof SourceFile) { SourceFile sourceFile = (SourceFile) tree; Path sourcePath = sourceFile.getSourcePath(); @@ -72,7 +72,7 @@ public Tree visit(@Nullable Tree tree, ExecutionContext executionContext) { return sourceFile; } } - return super.visit(tree, executionContext); + return super.visit(tree, ctx); } }; } diff --git a/rewrite-core/src/main/java/org/openrewrite/search/FindBuildMetadata.java b/rewrite-core/src/main/java/org/openrewrite/search/FindBuildMetadata.java index d439112b6aa..8c3c80b06f6 100644 --- a/rewrite-core/src/main/java/org/openrewrite/search/FindBuildMetadata.java +++ b/rewrite-core/src/main/java/org/openrewrite/search/FindBuildMetadata.java @@ -50,7 +50,7 @@ public String getDescription() { public TreeVisitor getVisitor() { return new TreeVisitor() { @Override - public Tree visit(@Nullable Tree tree, ExecutionContext executionContext) { + public Tree visit(@Nullable Tree tree, ExecutionContext ctx) { if (tree instanceof SourceFile) { for (BuildMetadata buildMetadata : tree.getMarkers().findAll(BuildMetadata.class)) { if (buildMetadata.getMetadata().containsKey(key)) { diff --git a/rewrite-core/src/main/java/org/openrewrite/text/CreateTextFile.java b/rewrite-core/src/main/java/org/openrewrite/text/CreateTextFile.java index 85a1c41f820..46a675afecf 100644 --- a/rewrite-core/src/main/java/org/openrewrite/text/CreateTextFile.java +++ b/rewrite-core/src/main/java/org/openrewrite/text/CreateTextFile.java @@ -84,7 +84,7 @@ public TreeVisitor getVisitor(AtomicBoolean created) { Path path = Paths.get(relativeFileName); return new TreeVisitor() { @Override - public SourceFile visit(@Nullable Tree tree, ExecutionContext executionContext) { + public SourceFile visit(@Nullable Tree tree, ExecutionContext ctx) { SourceFile sourceFile = (SourceFile) requireNonNull(tree); if ((created.get() || Boolean.TRUE.equals(overwriteExisting)) && path.equals(sourceFile.getSourcePath())) { if (sourceFile instanceof PlainText) { diff --git a/rewrite-core/src/test/java/org/openrewrite/PreconditionsTest.java b/rewrite-core/src/test/java/org/openrewrite/PreconditionsTest.java index 0583f91f064..891b503cbd3 100644 --- a/rewrite-core/src/test/java/org/openrewrite/PreconditionsTest.java +++ b/rewrite-core/src/test/java/org/openrewrite/PreconditionsTest.java @@ -97,7 +97,7 @@ void checkApplicabilityAgainstOtherSourceTypes() { Recipe recipe(TreeVisitor applicability) { return toRecipe(() -> Preconditions.check(applicability, new PlainTextVisitor<>() { @Override - public PlainText visitText(PlainText text, ExecutionContext executionContext) { + public PlainText visitText(PlainText text, ExecutionContext ctx) { return text.withText("goodbye"); } })); diff --git a/rewrite-core/src/test/java/org/openrewrite/RecipeLifecycleTest.java b/rewrite-core/src/test/java/org/openrewrite/RecipeLifecycleTest.java index 4f239cff2b4..817021cda84 100644 --- a/rewrite-core/src/test/java/org/openrewrite/RecipeLifecycleTest.java +++ b/rewrite-core/src/test/java/org/openrewrite/RecipeLifecycleTest.java @@ -54,7 +54,7 @@ void panic() { rewriteRun( spec -> spec.recipe(toRecipe(() -> new TreeVisitor<>() { @Override - public Tree visit(@Nullable Tree tree, ExecutionContext executionContext) { + public Tree visit(@Nullable Tree tree, ExecutionContext ctx) { fail("Should never have reached a visit method"); return tree; } @@ -116,7 +116,7 @@ void deleteFileByReturningNullFromVisit() { rewriteRun( spec -> spec.recipe(toRecipe(() -> new PlainTextVisitor<>() { @Override - public @Nullable PlainText visit(@Nullable Tree tree, ExecutionContext executionContext) { + public @Nullable PlainText visit(@Nullable Tree tree, ExecutionContext ctx) { return null; } })), @@ -262,11 +262,11 @@ void accurateReportingOfRecipesMakingChanges() { private Recipe testRecipe(@Language("markdown") String name) { return toRecipe(() -> new PlainTextVisitor<>() { @Override - public PlainText visitText(PlainText text, ExecutionContext executionContext) { + public PlainText visitText(PlainText text, ExecutionContext ctx) { if (!text.getText().contains(name)) { return text.withText(name + text.getText()); } - return super.visitText(text, executionContext); + return super.visitText(text, ctx); } }).withName(name); } @@ -421,11 +421,11 @@ public String getDescription() { public TreeVisitor getVisitor() { return new PlainTextVisitor<>() { @Override - public PlainText visitText(PlainText text, ExecutionContext executionContext) { + public PlainText visitText(PlainText text, ExecutionContext ctx) { if (!text.getText().contains(getDisplayName())) { return text.withText(getDisplayName() + text.getText()); } - return super.visitText(text, executionContext); + return super.visitText(text, ctx); } }; } @@ -448,11 +448,11 @@ public String getDescription() { public TreeVisitor getVisitor() { return new PlainTextVisitor<>() { @Override - public PlainText visitText(PlainText text, ExecutionContext executionContext) { + public PlainText visitText(PlainText text, ExecutionContext ctx) { if (!text.getText().contains(getDisplayName())) { return text.withText(getDisplayName() + text.getText()); } - return super.visitText(text, executionContext); + return super.visitText(text, ctx); } }; } diff --git a/rewrite-core/src/test/java/org/openrewrite/RecipeSchedulerTest.java b/rewrite-core/src/test/java/org/openrewrite/RecipeSchedulerTest.java index b4c485747e0..8caaae7acf7 100644 --- a/rewrite-core/src/test/java/org/openrewrite/RecipeSchedulerTest.java +++ b/rewrite-core/src/test/java/org/openrewrite/RecipeSchedulerTest.java @@ -74,7 +74,7 @@ public String getDescription() { public TreeVisitor getVisitor() { return new PlainTextVisitor<>() { @Override - public PlainText visitText(PlainText text, ExecutionContext executionContext) { + public PlainText visitText(PlainText text, ExecutionContext ctx) { throw new BoomException(); } }; diff --git a/rewrite-core/src/test/java/org/openrewrite/config/DeclarativeRecipeTest.java b/rewrite-core/src/test/java/org/openrewrite/config/DeclarativeRecipeTest.java index 66ff6f788f3..014acffb0c4 100644 --- a/rewrite-core/src/test/java/org/openrewrite/config/DeclarativeRecipeTest.java +++ b/rewrite-core/src/test/java/org/openrewrite/config/DeclarativeRecipeTest.java @@ -41,7 +41,7 @@ void precondition() { dr.addPrecondition( toRecipe(() -> new PlainTextVisitor<>() { @Override - public PlainText visitText(PlainText text, ExecutionContext executionContext) { + public PlainText visitText(PlainText text, ExecutionContext ctx) { if("1".equals(text.getText())) { return SearchResult.found(text); } diff --git a/rewrite-core/src/test/java/org/openrewrite/table/RecipeRunStatsTest.java b/rewrite-core/src/test/java/org/openrewrite/table/RecipeRunStatsTest.java index 8374e7bf6dd..de82a382ca9 100644 --- a/rewrite-core/src/test/java/org/openrewrite/table/RecipeRunStatsTest.java +++ b/rewrite-core/src/test/java/org/openrewrite/table/RecipeRunStatsTest.java @@ -46,7 +46,7 @@ public TreeVisitor getVisitor() { return Preconditions.check( new PlainTextVisitor<>() { @Override - public PlainText visitText(PlainText text, ExecutionContext executionContext) { + public PlainText visitText(PlainText text, ExecutionContext ctx) { if (!"sam".equals(text.getText())) { return SearchResult.found(text); } diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyArtifactId.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyArtifactId.java index bf751abd47c..f2735ea8326 100755 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyArtifactId.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyArtifactId.java @@ -82,8 +82,8 @@ public TreeVisitor getVisitor() { final MethodMatcher dependencyDsl = new MethodMatcher("DependencyHandlerSpec *(..)"); @Override - public J visitMethodInvocation(J.MethodInvocation method, ExecutionContext context) { - J.MethodInvocation m = (J.MethodInvocation) super.visitMethodInvocation(method, context); + public J visitMethodInvocation(J.MethodInvocation method, ExecutionContext ctx) { + J.MethodInvocation m = (J.MethodInvocation) super.visitMethodInvocation(method, ctx); if (!dependencyDsl.matches(m) || !(StringUtils.isBlank(configuration) || m.getSimpleName().equals(configuration))) { return m; } diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyClassifier.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyClassifier.java index 6f7140854e3..9b7b9a5681b 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyClassifier.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyClassifier.java @@ -82,8 +82,8 @@ public TreeVisitor getVisitor() { final MethodMatcher dependencyDsl = new MethodMatcher("DependencyHandlerSpec *(..)"); @Override - public J visitMethodInvocation(J.MethodInvocation method, ExecutionContext context) { - J.MethodInvocation m = (J.MethodInvocation) super.visitMethodInvocation(method, context); + public J visitMethodInvocation(J.MethodInvocation method, ExecutionContext ctx) { + J.MethodInvocation m = (J.MethodInvocation) super.visitMethodInvocation(method, ctx); if (!dependencyDsl.matches(m) || !(StringUtils.isBlank(configuration) || m.getSimpleName().equals(configuration))) { return m; } diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyConfiguration.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyConfiguration.java index bc6d91ecce0..3d0114fb4fa 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyConfiguration.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyConfiguration.java @@ -84,8 +84,8 @@ public TreeVisitor getVisitor() { final MethodMatcher dependencyDsl = new MethodMatcher("DependencyHandlerSpec *(..)"); @Override - public J visitMethodInvocation(J.MethodInvocation method, ExecutionContext context) { - J.MethodInvocation m = (J.MethodInvocation) super.visitMethodInvocation(method, context); + public J visitMethodInvocation(J.MethodInvocation method, ExecutionContext ctx) { + J.MethodInvocation m = (J.MethodInvocation) super.visitMethodInvocation(method, ctx); if (!dependencyDsl.matches(m) || !(StringUtils.isBlank(configuration) || m.getSimpleName().equals(configuration))) { return m; } diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyExtension.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyExtension.java index 9f37da0336a..2db21d10151 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyExtension.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyExtension.java @@ -82,8 +82,8 @@ public TreeVisitor getVisitor() { final MethodMatcher dependencyDsl = new MethodMatcher("DependencyHandlerSpec *(..)"); @Override - public J visitMethodInvocation(J.MethodInvocation method, ExecutionContext context) { - J.MethodInvocation m = (J.MethodInvocation) super.visitMethodInvocation(method, context); + public J visitMethodInvocation(J.MethodInvocation method, ExecutionContext ctx) { + J.MethodInvocation m = (J.MethodInvocation) super.visitMethodInvocation(method, ctx); if (!dependencyDsl.matches(m) || !(StringUtils.isBlank(configuration) || m.getSimpleName().equals(configuration))) { return m; } diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyGroupId.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyGroupId.java index be561ce2d45..c70d1036499 100755 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyGroupId.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyGroupId.java @@ -82,8 +82,8 @@ public TreeVisitor getVisitor() { final MethodMatcher dependencyDsl = new MethodMatcher("DependencyHandlerSpec *(..)"); @Override - public J visitMethodInvocation(J.MethodInvocation method, ExecutionContext context) { - J.MethodInvocation m = (J.MethodInvocation) super.visitMethodInvocation(method, context); + public J visitMethodInvocation(J.MethodInvocation method, ExecutionContext ctx) { + J.MethodInvocation m = (J.MethodInvocation) super.visitMethodInvocation(method, ctx); if (!dependencyDsl.matches(m) || !(StringUtils.isBlank(configuration) || m.getSimpleName().equals(configuration))) { return m; } diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeExtraProperty.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeExtraProperty.java index 1227c26d555..87bd6e22a2e 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeExtraProperty.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeExtraProperty.java @@ -57,7 +57,7 @@ public String getDescription() { public TreeVisitor getVisitor() { return Preconditions.check(new FindGradleProject(FindGradleProject.SearchCriteria.File).getVisitor(), new GroovyIsoVisitor() { @Override - public J.Assignment visitAssignment(J.Assignment as, ExecutionContext executionContext) { + public J.Assignment visitAssignment(J.Assignment as, ExecutionContext ctx) { if(!(as.getAssignment() instanceof J.Literal)) { return as; } diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/DependencyUseMapNotation.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/DependencyUseMapNotation.java index d6abcfdadf7..c3bcf665ff7 100755 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/DependencyUseMapNotation.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/DependencyUseMapNotation.java @@ -54,8 +54,8 @@ public TreeVisitor getVisitor() { final MethodMatcher dependencyDsl = new MethodMatcher("DependencyHandlerSpec *(..)"); return Preconditions.check(new IsBuildGradle<>(), new GroovyVisitor() { @Override - public J visitMethodInvocation(J.MethodInvocation method, ExecutionContext context) { - J.MethodInvocation m = (J.MethodInvocation) super.visitMethodInvocation(method, context); + public J visitMethodInvocation(J.MethodInvocation method, ExecutionContext ctx) { + J.MethodInvocation m = (J.MethodInvocation) super.visitMethodInvocation(method, ctx); if (!dependencyDsl.matches(m)) { return m; } diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/DependencyUseStringNotation.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/DependencyUseStringNotation.java index f2a3bdd7d7e..82437d56c1a 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/DependencyUseStringNotation.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/DependencyUseStringNotation.java @@ -54,8 +54,8 @@ public TreeVisitor getVisitor() { final MethodMatcher dependencyDsl = new MethodMatcher("DependencyHandlerSpec *(..)"); return Preconditions.check(new IsBuildGradle<>(), new GroovyVisitor() { @Override - public J visitMethodInvocation(J.MethodInvocation method, ExecutionContext context) { - J.MethodInvocation m = (J.MethodInvocation) super.visitMethodInvocation(method, context); + public J visitMethodInvocation(J.MethodInvocation method, ExecutionContext ctx) { + J.MethodInvocation m = (J.MethodInvocation) super.visitMethodInvocation(method, ctx); if (!dependencyDsl.matches(m)) { return m; } diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/UpdateGradleWrapper.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/UpdateGradleWrapper.java index 69b03b2a3bf..73d42a99eca 100755 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/UpdateGradleWrapper.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/UpdateGradleWrapper.java @@ -180,8 +180,8 @@ public Properties visitEntry(Properties.Entry entry, ExecutionContext ctx) { }, new TreeVisitor() { @Override - public boolean isAcceptable(SourceFile sourceFile, ExecutionContext executionContext) { - if (!super.isAcceptable(sourceFile, executionContext)) { + public boolean isAcceptable(SourceFile sourceFile, ExecutionContext ctx) { + if (!super.isAcceptable(sourceFile, ctx)) { return false; } @@ -403,8 +403,8 @@ public WrapperPropertiesVisitor(GradleWrapper gradleWrapper) { } @Override - public Properties visitFile(Properties.File file, ExecutionContext executionContext) { - Properties p = super.visitFile(file, executionContext); + public Properties visitFile(Properties.File file, ExecutionContext ctx) { + Properties p = super.visitFile(file, ctx); Set checksumKey = FindProperties.find(p, DISTRIBUTION_SHA_256_SUM_KEY, false); if (checksumKey.isEmpty()) { Properties.Value propertyValue = new Properties.Value(Tree.randomId(), "", Markers.EMPTY, gradleWrapper.getDistributionChecksum().getHexValue()); diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/UpdateJavaCompatibility.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/UpdateJavaCompatibility.java index 50b137e02cd..a61d720cd64 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/UpdateJavaCompatibility.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/UpdateJavaCompatibility.java @@ -81,8 +81,8 @@ public TreeVisitor getVisitor() { final MethodMatcher javaVersionToVersionMatcher = new MethodMatcher("org.gradle.api.JavaVersion toVersion(..)"); @Override - public J visitAssignment(J.Assignment assignment, ExecutionContext executionContext) { - J.Assignment a = (J.Assignment) super.visitAssignment(assignment, executionContext); + public J visitAssignment(J.Assignment assignment, ExecutionContext ctx) { + J.Assignment a = (J.Assignment) super.visitAssignment(assignment, ctx); if (a.getVariable() instanceof J.Identifier) { J.Identifier variable = (J.Identifier) a.getVariable(); diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/plugins/ChangePlugin.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/plugins/ChangePlugin.java index 47ece8117b3..bfd37d3d312 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/plugins/ChangePlugin.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/plugins/ChangePlugin.java @@ -104,7 +104,7 @@ public TreeVisitor getVisitor() { GradleSettings gradleSettings; @Override - public G.CompilationUnit visitCompilationUnit(G.CompilationUnit cu, ExecutionContext executionContext) { + public G.CompilationUnit visitCompilationUnit(G.CompilationUnit cu, ExecutionContext ctx) { Optional maybeGp = cu.getMarkers().findFirst(GradleProject.class); Optional maybeGs = cu.getMarkers().findFirst(GradleSettings.class); if (!maybeGp.isPresent() && !maybeGs.isPresent()) { @@ -114,7 +114,7 @@ public G.CompilationUnit visitCompilationUnit(G.CompilationUnit cu, ExecutionCon gradleProject = maybeGp.orElse(null); gradleSettings = maybeGs.orElse(null); - G.CompilationUnit g = super.visitCompilationUnit(cu, executionContext); + G.CompilationUnit g = super.visitCompilationUnit(cu, ctx); if (g != cu) { if (gradleProject != null) { GradleProject updatedGp = gradleProject.withPlugins(ListUtils.map(gradleProject.getPlugins(), plugin -> { diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/plugins/UpgradePluginVersion.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/plugins/UpgradePluginVersion.java index 0657d48fe91..32fd74be414 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/plugins/UpgradePluginVersion.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/plugins/UpgradePluginVersion.java @@ -96,7 +96,7 @@ public TreeVisitor getVisitor() { private GradleSettings gradleSettings; @Override - public J visitCompilationUnit(G.CompilationUnit cu, ExecutionContext executionContext) { + public J visitCompilationUnit(G.CompilationUnit cu, ExecutionContext ctx) { Optional maybeGradleProject = cu.getMarkers().findFirst(GradleProject.class); Optional maybeGradleSettings = cu.getMarkers().findFirst(GradleSettings.class); if (!maybeGradleProject.isPresent() && !maybeGradleSettings.isPresent()) { @@ -105,7 +105,7 @@ public J visitCompilationUnit(G.CompilationUnit cu, ExecutionContext executionCo gradleProject = maybeGradleProject.orElse(null); gradleSettings = maybeGradleSettings.orElse(null); - return super.visitCompilationUnit(cu, executionContext); + return super.visitCompilationUnit(cu, ctx); } @Override diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/search/FindDependency.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/search/FindDependency.java index dade989a279..935751b42ac 100755 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/search/FindDependency.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/search/FindDependency.java @@ -66,7 +66,7 @@ public TreeVisitor getVisitor() { MethodMatcher dependency = new MethodMatcher("DependencyHandlerSpec *(..)"); return Preconditions.check(new IsBuildGradle<>(), new GroovyVisitor() { @Override - public J visitMethodInvocation(J.MethodInvocation method, ExecutionContext context) { + public J visitMethodInvocation(J.MethodInvocation method, ExecutionContext ctx) { if (dependency.matches(method)) { if (StringUtils.isBlank(configuration) || method.getSimpleName().equals(configuration)) { List depArgs = method.getArguments(); @@ -83,7 +83,7 @@ public J visitMethodInvocation(J.MethodInvocation method, ExecutionContext conte } } } - return super.visitMethodInvocation(method, context); + return super.visitMethodInvocation(method, ctx); } }); } diff --git a/rewrite-java-test/src/test/java/org/openrewrite/java/ExtractInterfaceTest.java b/rewrite-java-test/src/test/java/org/openrewrite/java/ExtractInterfaceTest.java index f6d8f01b355..d32f5db1f09 100644 --- a/rewrite-java-test/src/test/java/org/openrewrite/java/ExtractInterfaceTest.java +++ b/rewrite-java-test/src/test/java/org/openrewrite/java/ExtractInterfaceTest.java @@ -51,7 +51,7 @@ public AtomicReference getInitialValue(ExecutionContext ctx) public TreeVisitor getScanner(AtomicReference acc) { return new JavaIsoVisitor<>() { @Override - public J.CompilationUnit visitCompilationUnit(J.CompilationUnit cu, ExecutionContext executionContext) { + public J.CompilationUnit visitCompilationUnit(J.CompilationUnit cu, ExecutionContext ctx) { acc.set(cu.withId(randomId())); return cu; } diff --git a/rewrite-java-test/src/test/java/org/openrewrite/java/JavaTemplateInstanceOfTest.java b/rewrite-java-test/src/test/java/org/openrewrite/java/JavaTemplateInstanceOfTest.java index e477887d27b..3f786807a90 100755 --- a/rewrite-java-test/src/test/java/org/openrewrite/java/JavaTemplateInstanceOfTest.java +++ b/rewrite-java-test/src/test/java/org/openrewrite/java/JavaTemplateInstanceOfTest.java @@ -55,7 +55,7 @@ public void defaults(RecipeSpec spec) { //noinspection DataFlowIssue spec.recipe(toRecipe(() -> new JavaVisitor<>() { @Override - public J visitLiteral(J.Literal literal, ExecutionContext executionContext) { + public J visitLiteral(J.Literal literal, ExecutionContext ctx) { return literal.getValue() == Integer.valueOf(42) ? JavaTemplate.builder("s.length()") .contextSensitive() @@ -64,7 +64,7 @@ public J visitLiteral(J.Literal literal, ExecutionContext executionContext) { getCursor(), literal.getCoordinates().replace() ) : - super.visitLiteral(literal, executionContext); + super.visitLiteral(literal, ctx); } })) // custom missing type validation @@ -472,8 +472,8 @@ void replaceNestedMethodInvocationInTernaryTrue() { rewriteRun( spec -> spec.recipe(toRecipe(() -> new JavaVisitor<>() { @Override - public J visitMethodInvocation(J.MethodInvocation method, ExecutionContext p) { - J.MethodInvocation mi = (J.MethodInvocation) super.visitMethodInvocation(method, p); + public J visitMethodInvocation(J.MethodInvocation method, ExecutionContext ctx) { + J.MethodInvocation mi = (J.MethodInvocation) super.visitMethodInvocation(method, ctx); if (!new MethodMatcher("java.lang.String format(String, Object[])").matches(mi)) { return mi; } @@ -489,7 +489,7 @@ public J visitMethodInvocation(J.MethodInvocation method, ExecutionContext p) { ); mi = maybeAutoFormat(mi, mi.withArguments( - ListUtils.map(arguments.subList(1, arguments.size()), (a, b) -> b.withPrefix(arguments.get(a + 1).getPrefix()))), p); + ListUtils.map(arguments.subList(1, arguments.size()), (a, b) -> b.withPrefix(arguments.get(a + 1).getPrefix()))), ctx); return mi; } } diff --git a/rewrite-java-test/src/test/java/org/openrewrite/java/JavaTemplateTest2Test.java b/rewrite-java-test/src/test/java/org/openrewrite/java/JavaTemplateTest2Test.java index 369b7b892f3..06c832969dc 100644 --- a/rewrite-java-test/src/test/java/org/openrewrite/java/JavaTemplateTest2Test.java +++ b/rewrite-java-test/src/test/java/org/openrewrite/java/JavaTemplateTest2Test.java @@ -244,12 +244,12 @@ void replaceIdentifierWithMethodInvocation() { rewriteRun( spec -> spec.recipe(toRecipe(() -> new JavaVisitor<>() { @Override - public J visitMethodDeclaration(J.MethodDeclaration method, ExecutionContext p) { - return method.withBody((J.Block) visit(method.getBody(), p)); + public J visitMethodDeclaration(J.MethodDeclaration method, ExecutionContext ctx) { + return method.withBody((J.Block) visit(method.getBody(), ctx)); } @Override - public J visitIdentifier(J.Identifier identifier, ExecutionContext p) { + public J visitIdentifier(J.Identifier identifier, ExecutionContext ctx) { if (identifier.getSimpleName().equals("f")) { return JavaTemplate.apply("#{any(java.io.File)}.getCanonicalFile().toPath()", getCursor(), identifier.getCoordinates().replace(), identifier); diff --git a/rewrite-java-test/src/test/java/org/openrewrite/java/JavaTemplateTest5Test.java b/rewrite-java-test/src/test/java/org/openrewrite/java/JavaTemplateTest5Test.java index 820d1f8eadc..ceba347ab79 100644 --- a/rewrite-java-test/src/test/java/org/openrewrite/java/JavaTemplateTest5Test.java +++ b/rewrite-java-test/src/test/java/org/openrewrite/java/JavaTemplateTest5Test.java @@ -38,7 +38,7 @@ void lastStatementInClassBlock() { rewriteRun( spec -> spec.recipe(toRecipe(() -> new JavaVisitor<>() { @Override - public J visitClassDeclaration(J.ClassDeclaration classDecl, ExecutionContext p) { + public J visitClassDeclaration(J.ClassDeclaration classDecl, ExecutionContext ctx) { if (classDecl.getBody().getStatements().isEmpty()) { return JavaTemplate.apply("int n;", getCursor(), classDecl.getBody().getCoordinates().lastStatement()); } @@ -64,7 +64,7 @@ void lastStatementInMethodBlock() { rewriteRun( spec -> spec.recipe(toRecipe(() -> new JavaVisitor<>() { @Override - public J visitMethodDeclaration(J.MethodDeclaration method, ExecutionContext p) { + public J visitMethodDeclaration(J.MethodDeclaration method, ExecutionContext ctx) { if (method.getBody().getStatements().size() == 1) { return JavaTemplate.builder("n = 1;") .contextSensitive() @@ -101,7 +101,7 @@ void replaceStatementRequiringNewImport() { rewriteRun( spec -> spec.recipe(toRecipe(() -> new JavaVisitor<>() { @Override - public J visitAssert(J.Assert assert_, ExecutionContext p) { + public J visitAssert(J.Assert assert_, ExecutionContext ctx) { maybeAddImport("java.util.List"); return JavaTemplate.builder("List s = null;") .imports("java.util.List") @@ -183,13 +183,13 @@ void fred(int m, int n, String foo) { Recipe replaceAnnotationRecipe = toRecipe(() -> new JavaIsoVisitor<>() { @Override - public J.Annotation visitAnnotation(J.Annotation annotation, ExecutionContext p) { + public J.Annotation visitAnnotation(J.Annotation annotation, ExecutionContext ctx) { if (annotation.getSimpleName().equals("SuppressWarnings")) { return JavaTemplate.apply("@Deprecated", getCursor(), annotation.getCoordinates().replace()); } else if (annotation.getSimpleName().equals("A1")) { return JavaTemplate.apply("@A2", getCursor(), annotation.getCoordinates().replace()); } - return super.visitAnnotation(annotation, p); + return super.visitAnnotation(annotation, ctx); } }); @@ -286,12 +286,12 @@ void replaceMethodAnnotations() { rewriteRun( spec -> spec.recipe(toRecipe(() -> new JavaIsoVisitor<>() { @Override - public J.MethodDeclaration visitMethodDeclaration(J.MethodDeclaration method, ExecutionContext p) { + public J.MethodDeclaration visitMethodDeclaration(J.MethodDeclaration method, ExecutionContext ctx) { if (method.getLeadingAnnotations().isEmpty()) { return JavaTemplate.apply("@SuppressWarnings(\"other\")", getCursor(), method.getCoordinates().replaceAnnotations()); } - return super.visitMethodDeclaration(method, p); + return super.visitMethodDeclaration(method, ctx); } })), java( @@ -335,11 +335,11 @@ void replaceClassAnnotations() { rewriteRun( spec -> spec.recipe(toRecipe(() -> new JavaIsoVisitor<>() { @Override - public J.ClassDeclaration visitClassDeclaration(J.ClassDeclaration classDecl, ExecutionContext p) { + public J.ClassDeclaration visitClassDeclaration(J.ClassDeclaration classDecl, ExecutionContext ctx) { if (classDecl.getLeadingAnnotations().isEmpty() && !classDecl.getSimpleName().equals("Test")) { return JavaTemplate.apply("@SuppressWarnings(\"other\")", getCursor(), classDecl.getCoordinates().replaceAnnotations()); } - return super.visitClassDeclaration(classDecl, p); + return super.visitClassDeclaration(classDecl, ctx); } })), java( @@ -369,11 +369,11 @@ void replaceVariableAnnotations() { rewriteRun( spec -> spec.recipe(toRecipe(() -> new JavaIsoVisitor<>() { @Override - public J.VariableDeclarations visitVariableDeclarations(J.VariableDeclarations multiVariable, ExecutionContext p) { + public J.VariableDeclarations visitVariableDeclarations(J.VariableDeclarations multiVariable, ExecutionContext ctx) { if (multiVariable.getLeadingAnnotations().isEmpty()) { return JavaTemplate.apply("@SuppressWarnings(\"other\")", getCursor(), multiVariable.getCoordinates().replaceAnnotations()); } - return super.visitVariableDeclarations(multiVariable, p); + return super.visitVariableDeclarations(multiVariable, ctx); } })), java( @@ -406,11 +406,11 @@ void addVariableAnnotationsToVariableAlreadyAnnotated() { rewriteRun( spec -> spec.recipe(toRecipe(() -> new JavaIsoVisitor<>() { @Override - public J.VariableDeclarations visitVariableDeclarations(J.VariableDeclarations multiVariable, ExecutionContext p) { + public J.VariableDeclarations visitVariableDeclarations(J.VariableDeclarations multiVariable, ExecutionContext ctx) { if (multiVariable.getLeadingAnnotations().size() == 1) { return JavaTemplate.apply("@Deprecated", getCursor(), multiVariable.getCoordinates().addAnnotation(comparing(a -> 0))); } - return super.visitVariableDeclarations(multiVariable, p); + return super.visitVariableDeclarations(multiVariable, ctx); } })), java( diff --git a/rewrite-java-test/src/test/java/org/openrewrite/java/RenameVariableTest.java b/rewrite-java-test/src/test/java/org/openrewrite/java/RenameVariableTest.java index 7e1c21452ef..63f2e64fe42 100644 --- a/rewrite-java-test/src/test/java/org/openrewrite/java/RenameVariableTest.java +++ b/rewrite-java-test/src/test/java/org/openrewrite/java/RenameVariableTest.java @@ -35,7 +35,7 @@ class RenameVariableTest implements RewriteTest { private static Recipe renameVariableTest(String hasName, String toName, boolean includeMethodParameters) { return toRecipe(() -> new JavaVisitor<>() { @Override - public J visitClassDeclaration(J.ClassDeclaration classDecl, ExecutionContext p) { + public J visitClassDeclaration(J.ClassDeclaration classDecl, ExecutionContext ctx) { if (classDecl.getSimpleName().equals("A")) { List variableDecls = classDecl.getBody().getStatements().stream() .filter(J.VariableDeclarations.class::isInstance) @@ -65,7 +65,7 @@ public J visitClassDeclaration(J.ClassDeclaration classDecl, ExecutionContext p) } } } - return super.visitClassDeclaration(classDecl, p); + return super.visitClassDeclaration(classDecl, ctx); } }); } @@ -807,13 +807,13 @@ void renameVariable() { rewriteRun( spec -> spec.recipe(toRecipe(() -> new JavaVisitor<>() { @Override - public J visitVariableDeclarations(J.VariableDeclarations multiVariable, ExecutionContext p) { + public J visitVariableDeclarations(J.VariableDeclarations multiVariable, ExecutionContext ctx) { if (getCursor().getParentTreeCursor().getValue() instanceof J.MethodDeclaration) { doAfterVisit(new RenameVariable<>(multiVariable.getVariables().get(0), "n2")); } else if (!(getCursor().getParentTreeCursor().getParentTreeCursor().getValue() instanceof J.ClassDeclaration)) { doAfterVisit(new RenameVariable<>(multiVariable.getVariables().get(0), "n1")); } - return super.visitVariableDeclarations(multiVariable, p); + return super.visitVariableDeclarations(multiVariable, ctx); } })), java( diff --git a/rewrite-java-test/src/test/java/org/openrewrite/java/format/NormalizeFormatTest.java b/rewrite-java-test/src/test/java/org/openrewrite/java/format/NormalizeFormatTest.java index f9f0756a83c..a8b465b5a03 100644 --- a/rewrite-java-test/src/test/java/org/openrewrite/java/format/NormalizeFormatTest.java +++ b/rewrite-java-test/src/test/java/org/openrewrite/java/format/NormalizeFormatTest.java @@ -30,7 +30,7 @@ class NormalizeFormatTest implements RewriteTest { Recipe removeAnnotation = toRecipe(() -> new JavaIsoVisitor<>() { @Override - public J.Annotation visitAnnotation(J.Annotation annotation, ExecutionContext executionContext) { + public J.Annotation visitAnnotation(J.Annotation annotation, ExecutionContext ctx) { //noinspection ConstantConditions return null; } diff --git a/rewrite-java/src/main/java/org/openrewrite/java/AddLicenseHeader.java b/rewrite-java/src/main/java/org/openrewrite/java/AddLicenseHeader.java index aa1e2019135..d4cc7d772a0 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/AddLicenseHeader.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/AddLicenseHeader.java @@ -79,13 +79,13 @@ public J visit(@Nullable Tree tree, ExecutionContext ctx) { } @Override - public J.Import visitImport(J.Import _import, ExecutionContext executionContext) { + public J.Import visitImport(J.Import _import, ExecutionContext ctx) { // short circuit everything else return _import; } @Override - public J.ClassDeclaration visitClassDeclaration(J.ClassDeclaration classDecl, ExecutionContext executionContext) { + public J.ClassDeclaration visitClassDeclaration(J.ClassDeclaration classDecl, ExecutionContext ctx) { // short circuit everything else return classDecl; } diff --git a/rewrite-java/src/main/java/org/openrewrite/java/AddOrUpdateAnnotationAttribute.java b/rewrite-java/src/main/java/org/openrewrite/java/AddOrUpdateAnnotationAttribute.java index 8adf1459d39..4224e1d0e2c 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/AddOrUpdateAnnotationAttribute.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/AddOrUpdateAnnotationAttribute.java @@ -70,7 +70,7 @@ public String getDescription() { public TreeVisitor getVisitor() { return Preconditions.check(new UsesType<>(annotationType, false), new JavaIsoVisitor() { @Override - public J.Annotation visitAnnotation(J.Annotation a, ExecutionContext context) { + public J.Annotation visitAnnotation(J.Annotation a, ExecutionContext ctx) { if (!TypeUtils.isOfClassType(a.getType(), annotationType)) { return a; } @@ -149,7 +149,7 @@ public J.Annotation visitAnnotation(J.Annotation a, ExecutionContext context) { ).getArguments().get(0); List newArguments = ListUtils.concat(as, a.getArguments()); a = a.withArguments(newArguments); - a = autoFormat(a, context); + a = autoFormat(a, ctx); } return a; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/ChangeAnnotationAttributeName.java b/rewrite-java/src/main/java/org/openrewrite/java/ChangeAnnotationAttributeName.java index 76c26097610..5a9f2d55c4e 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/ChangeAnnotationAttributeName.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/ChangeAnnotationAttributeName.java @@ -55,8 +55,8 @@ public TreeVisitor getVisitor() { return Preconditions.check(new UsesType<>(annotationType, false), new JavaIsoVisitor() { private final AnnotationMatcher annotationMatcher = new AnnotationMatcher(annotationType); @Override - public J.Annotation visitAnnotation(J.Annotation annotation, ExecutionContext context) { - J.Annotation a = super.visitAnnotation(annotation, context); + public J.Annotation visitAnnotation(J.Annotation annotation, ExecutionContext ctx) { + J.Annotation a = super.visitAnnotation(annotation, ctx); if (!annotationMatcher.matches(a)) { return a; } diff --git a/rewrite-java/src/main/java/org/openrewrite/java/ChangeMethodName.java b/rewrite-java/src/main/java/org/openrewrite/java/ChangeMethodName.java index 7ef5147843d..b368294b63f 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/ChangeMethodName.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/ChangeMethodName.java @@ -119,8 +119,8 @@ public J.MethodInvocation visitMethodInvocation(J.MethodInvocation method, Execu } @Override - public J.MemberReference visitMemberReference(J.MemberReference memberRef, ExecutionContext context) { - J.MemberReference m = super.visitMemberReference(memberRef, context); + public J.MemberReference visitMemberReference(J.MemberReference memberRef, ExecutionContext ctx) { + J.MemberReference m = super.visitMemberReference(memberRef, ctx); if (methodMatcher.matches(m.getMethodType()) && !m.getReference().getSimpleName().equals(newMethodName)) { JavaType.Method type = m.getMethodType(); if (type != null) { diff --git a/rewrite-java/src/main/java/org/openrewrite/java/ChangePackage.java b/rewrite-java/src/main/java/org/openrewrite/java/ChangePackage.java index 31c76e53180..db6db1e069f 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/ChangePackage.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/ChangePackage.java @@ -141,7 +141,7 @@ public J visitFieldAccess(J.FieldAccess fieldAccess, ExecutionContext ctx) { } @Override - public J.Package visitPackage(J.Package pkg, ExecutionContext context) { + public J.Package visitPackage(J.Package pkg, ExecutionContext ctx) { String original = pkg.getExpression().printTrimmed(getCursor()).replaceAll("\\s", ""); getCursor().putMessageOnFirstEnclosing(JavaSourceFile.class, RENAME_FROM_KEY, original); @@ -168,13 +168,13 @@ public J.Package visitPackage(J.Package pkg, ExecutionContext context) { } @Override - public J visitImport(J.Import _import, ExecutionContext executionContext) { + public J visitImport(J.Import _import, ExecutionContext ctx) { // Polls message before calling super to change the prefix of the first import if applicable. Boolean updatePrefix = getCursor().pollNearestMessage("UPDATE_PREFIX"); if (updatePrefix != null && updatePrefix) { _import = _import.withPrefix(Space.EMPTY); } - return super.visitImport(_import, executionContext); + return super.visitImport(_import, ctx); } @Override @@ -189,13 +189,13 @@ public J visitClassDeclaration(J.ClassDeclaration classDecl, ExecutionContext ct } @Override - public @Nullable JavaType visitType(@Nullable JavaType javaType, ExecutionContext executionContext) { + public @Nullable JavaType visitType(@Nullable JavaType javaType, ExecutionContext ctx) { return updateType(javaType); } @Override - public J postVisit(J tree, ExecutionContext executionContext) { - J j = super.postVisit(tree, executionContext); + public J postVisit(J tree, ExecutionContext ctx) { + J j = super.postVisit(tree, ctx); if (j instanceof J.MethodDeclaration) { J.MethodDeclaration m = (J.MethodDeclaration) j; JavaType.Method mt = updateType(m.getMethodType()); @@ -224,7 +224,7 @@ public J postVisit(J tree, ExecutionContext executionContext) { for (J.Import anImport : sf.getImports()) { if (anImport.getPackageName().equals(changingTo) && !anImport.isStatic()) { - sf = (JavaSourceFile) new RemoveImport(anImport.getTypeName(), true).visit(sf, executionContext, getCursor()); + sf = (JavaSourceFile) new RemoveImport(anImport.getTypeName(), true).visit(sf, ctx, getCursor()); assert sf != null; } } diff --git a/rewrite-java/src/main/java/org/openrewrite/java/ChangeStaticFieldToMethod.java b/rewrite-java/src/main/java/org/openrewrite/java/ChangeStaticFieldToMethod.java index 863fbfa5477..2fbfae25cdd 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/ChangeStaticFieldToMethod.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/ChangeStaticFieldToMethod.java @@ -72,12 +72,12 @@ public String getDescription() { public TreeVisitor getVisitor() { return Preconditions.check(new UsesField<>(oldClassName, oldFieldName), new JavaVisitor() { @Override - public J visitClassDeclaration(J.ClassDeclaration classDecl, ExecutionContext context) { + public J visitClassDeclaration(J.ClassDeclaration classDecl, ExecutionContext ctx) { if (TypeUtils.isOfClassType(classDecl.getType(), oldClassName)) { // Don't modify the class that declares the static field being replaced return classDecl; } - return super.visitClassDeclaration(classDecl, context); + return super.visitClassDeclaration(classDecl, ctx); } @Override @@ -91,7 +91,7 @@ public J visitFieldAccess(J.FieldAccess fieldAccess, ExecutionContext ctx) { } @Override - public J visitIdentifier(J.Identifier ident, ExecutionContext executionContext) { + public J visitIdentifier(J.Identifier ident, ExecutionContext ctx) { JavaType.Variable varType = ident.getFieldType(); if (varType != null && TypeUtils.isOfClassType(varType.getOwner(), oldClassName) && diff --git a/rewrite-java/src/main/java/org/openrewrite/java/ChangeType.java b/rewrite-java/src/main/java/org/openrewrite/java/ChangeType.java index fc7d6c21198..39b9de98d41 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/ChangeType.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/ChangeType.java @@ -511,7 +511,7 @@ private boolean updatePath(JavaSourceFile sf, String oldPath, String newPath) { } @Override - public J.Package visitPackage(J.Package pkg, ExecutionContext ctxext) { + public J.Package visitPackage(J.Package pkg, ExecutionContext ctx) { String original = pkg.getExpression().printTrimmed(getCursor()).replaceAll("\\s", ""); if (original.equals(originalType.getPackageName())) { JavaType.FullyQualified fq = TypeUtils.asFullyQualified(targetType); diff --git a/rewrite-java/src/main/java/org/openrewrite/java/CreateEmptyJavaClass.java b/rewrite-java/src/main/java/org/openrewrite/java/CreateEmptyJavaClass.java index c09375782cc..c835e0494ef 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/CreateEmptyJavaClass.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/CreateEmptyJavaClass.java @@ -111,7 +111,7 @@ public TreeVisitor getVisitor(AtomicBoolean created) { Path path = getSourcePath(); return new JavaIsoVisitor() { @Override - public J.CompilationUnit visitCompilationUnit(J.CompilationUnit cu, ExecutionContext executionContext) { + public J.CompilationUnit visitCompilationUnit(J.CompilationUnit cu, ExecutionContext ctx) { if ((created.get() || Boolean.TRUE.equals(overwriteExisting)) && path.equals(cu.getSourcePath())) { Optional sourceFile = createEmptyClass().findFirst(); if (sourceFile.isPresent() && sourceFile.get() instanceof J.CompilationUnit) { diff --git a/rewrite-java/src/main/java/org/openrewrite/java/RemoveImplements.java b/rewrite-java/src/main/java/org/openrewrite/java/RemoveImplements.java index 9692a5b7652..67f364cf37c 100755 --- a/rewrite-java/src/main/java/org/openrewrite/java/RemoveImplements.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/RemoveImplements.java @@ -90,13 +90,13 @@ public J.ClassDeclaration visitClassDeclaration(J.ClassDeclaration cd, Execution } @Override - public J.MethodDeclaration visitMethodDeclaration(J.MethodDeclaration md, ExecutionContext context) { + public J.MethodDeclaration visitMethodDeclaration(J.MethodDeclaration md, ExecutionContext ctx) { if (md.getMethodType() == null) { - return super.visitMethodDeclaration(md, context); + return super.visitMethodDeclaration(md, ctx); } Object maybeClassType = getCursor().getNearestMessage(md.getMethodType().getDeclaringType().getFullyQualifiedName()); if (!(maybeClassType instanceof JavaType.Class)) { - return super.visitMethodDeclaration(md, context); + return super.visitMethodDeclaration(md, ctx); } JavaType.Class cdt = (JavaType.Class) maybeClassType; JavaType.Method mt = md.getMethodType().withDeclaringType(cdt); @@ -105,10 +105,10 @@ public J.MethodDeclaration visitMethodDeclaration(J.MethodDeclaration md, Execut md = md.withName(md.getName().withType(mt)); } if (md.getAllAnnotations().stream().noneMatch(ann -> isOfClassType(ann.getType(), "java.lang.Override")) || TypeUtils.isOverride(md.getMethodType())) { - return super.visitMethodDeclaration(md, context); + return super.visitMethodDeclaration(md, ctx); } - md = (J.MethodDeclaration) new RemoveAnnotation("@java.lang.Override").getVisitor().visitNonNull(md, context, getCursor().getParentOrThrow()); - return super.visitMethodDeclaration(md, context); + md = (J.MethodDeclaration) new RemoveAnnotation("@java.lang.Override").getVisitor().visitNonNull(md, ctx, getCursor().getParentOrThrow()); + return super.visitMethodDeclaration(md, ctx); } }); } diff --git a/rewrite-java/src/main/java/org/openrewrite/java/RemoveObjectsIsNull.java b/rewrite-java/src/main/java/org/openrewrite/java/RemoveObjectsIsNull.java index 2a55e364d40..53239317d33 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/RemoveObjectsIsNull.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/RemoveObjectsIsNull.java @@ -43,21 +43,21 @@ public String getDescription() { public TreeVisitor getVisitor() { return Preconditions.check(Preconditions.or(new UsesMethod<>(IS_NULL), new UsesMethod<>(NON_NULL)), new JavaVisitor() { @Override - public Expression visitMethodInvocation(J.MethodInvocation method, ExecutionContext executionContext) { - J.MethodInvocation m = (J.MethodInvocation) super.visitMethodInvocation(method, executionContext); + public Expression visitMethodInvocation(J.MethodInvocation method, ExecutionContext ctx) { + J.MethodInvocation m = (J.MethodInvocation) super.visitMethodInvocation(method, ctx); if (IS_NULL.matches(m)) { - return replace(executionContext, m, "(#{any(boolean)}) == null"); + return replace(ctx, m, "(#{any(boolean)}) == null"); } else if (NON_NULL.matches(m)) { - return replace(executionContext, m, "(#{any(boolean)}) != null"); + return replace(ctx, m, "(#{any(boolean)}) != null"); } return m; } - private Expression replace(ExecutionContext executionContext, J.MethodInvocation m, String pattern) { + private Expression replace(ExecutionContext ctx, J.MethodInvocation m, String pattern) { Expression e = m.getArguments().get(0); Expression replaced = JavaTemplate.apply(pattern, getCursor(), m.getCoordinates().replace(), e); return (Expression) new UnnecessaryParenthesesVisitor() - .visitNonNull(replaced, executionContext, getCursor()); + .visitNonNull(replaced, ctx, getCursor()); } }); } diff --git a/rewrite-java/src/main/java/org/openrewrite/java/ReorderMethodArguments.java b/rewrite-java/src/main/java/org/openrewrite/java/ReorderMethodArguments.java index db60cb9b267..ca18677a322 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/ReorderMethodArguments.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/ReorderMethodArguments.java @@ -126,8 +126,8 @@ public J.MethodInvocation visitMethodInvocation(J.MethodInvocation method, Execu } @Override - public J.NewClass visitNewClass(J.NewClass newClass, ExecutionContext executionContext) { - return (J.NewClass) visitMethodCall(super.visitNewClass(newClass, executionContext)); + public J.NewClass visitNewClass(J.NewClass newClass, ExecutionContext ctx) { + return (J.NewClass) visitMethodCall(super.visitNewClass(newClass, ctx)); } private MethodCall visitMethodCall(MethodCall m) { diff --git a/rewrite-java/src/main/java/org/openrewrite/java/ReplaceConstant.java b/rewrite-java/src/main/java/org/openrewrite/java/ReplaceConstant.java index 2aeef773a18..0f5b6f9ef4a 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/ReplaceConstant.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/ReplaceConstant.java @@ -58,21 +58,21 @@ public TreeVisitor getVisitor() { J.Literal literal; @Override - public J visitFieldAccess(J.FieldAccess fieldAccess, ExecutionContext executionContext) { + public J visitFieldAccess(J.FieldAccess fieldAccess, ExecutionContext ctx) { if (isConstant(fieldAccess.getName().getFieldType())) { maybeRemoveImport(owningType); return buildLiteral().withPrefix(fieldAccess.getPrefix()); } - return super.visitFieldAccess(fieldAccess, executionContext); + return super.visitFieldAccess(fieldAccess, ctx); } @Override - public J visitIdentifier(J.Identifier ident, ExecutionContext executionContext) { + public J visitIdentifier(J.Identifier ident, ExecutionContext ctx) { if (isConstant(ident.getFieldType()) && !isVariableDeclaration()) { maybeRemoveImport(owningType); return buildLiteral().withPrefix(ident.getPrefix()); } - return super.visitIdentifier(ident, executionContext); + return super.visitIdentifier(ident, ctx); } private boolean isConstant(@Nullable JavaType.Variable varType) { diff --git a/rewrite-java/src/main/java/org/openrewrite/java/ReplaceStringLiteralWithConstant.java b/rewrite-java/src/main/java/org/openrewrite/java/ReplaceStringLiteralWithConstant.java index cd844f41ada..d7a0bbc804d 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/ReplaceStringLiteralWithConstant.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/ReplaceStringLiteralWithConstant.java @@ -123,11 +123,11 @@ public ReplaceStringLiteralVisitor(String literalValue, String fullyQualifiedCon } @Override - public J visitLiteral(J.Literal literal, ExecutionContext executionContext) { + public J visitLiteral(J.Literal literal, ExecutionContext ctx) { // Only handle String literals if (!TypeUtils.isString(literal.getType()) || !Objects.equals(literalValue, literal.getValue())) { - return super.visitLiteral(literal, executionContext); + return super.visitLiteral(literal, ctx); } // Prevent changing constant definition @@ -135,7 +135,7 @@ public J visitLiteral(J.Literal literal, ExecutionContext executionContext) { if (classDeclaration != null && classDeclaration.getType() != null && owningType.equals(classDeclaration.getType().getFullyQualifiedName())) { - return super.visitLiteral(literal, executionContext); + return super.visitLiteral(literal, ctx); } maybeAddImport(owningType, false); diff --git a/rewrite-java/src/main/java/org/openrewrite/java/UseStaticImport.java b/rewrite-java/src/main/java/org/openrewrite/java/UseStaticImport.java index 234781e7214..10dd76b7682 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/UseStaticImport.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/UseStaticImport.java @@ -102,7 +102,7 @@ protected JavadocVisitor getJavadocVisitor() { * Otherwise, the Javadoc method reference would eventually be refactored to static import, which is not valid for Javadoc. */ @Override - public Javadoc visitReference(Javadoc.Reference reference, ExecutionContext p) { + public Javadoc visitReference(Javadoc.Reference reference, ExecutionContext ctx) { return reference; } }; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/format/PadEmptyForLoopComponents.java b/rewrite-java/src/main/java/org/openrewrite/java/format/PadEmptyForLoopComponents.java index 1f584aa82dc..ca0d42a9e42 100755 --- a/rewrite-java/src/main/java/org/openrewrite/java/format/PadEmptyForLoopComponents.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/format/PadEmptyForLoopComponents.java @@ -76,8 +76,8 @@ public J visit(@Nullable Tree tree, ExecutionContext ctx) { } @Override - public J.ForLoop visitForLoop(J.ForLoop forLoop, ExecutionContext executionContext) { - J.ForLoop fl = super.visitForLoop(forLoop, executionContext); + public J.ForLoop visitForLoop(J.ForLoop forLoop, ExecutionContext ctx) { + J.ForLoop fl = super.visitForLoop(forLoop, ctx); List updates = forLoop.getControl().getUpdate(); if (emptyForIteratorPadStyle != null && updates.size() == 1 && updates.get(0) instanceof J.Empty) { Statement update = updates.get(0); diff --git a/rewrite-java/src/main/java/org/openrewrite/java/recipes/FindRecipes.java b/rewrite-java/src/main/java/org/openrewrite/java/recipes/FindRecipes.java index 31d50530727..abe0fe8cc68 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/recipes/FindRecipes.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/recipes/FindRecipes.java @@ -79,11 +79,11 @@ public J.ClassDeclaration visitClassDeclaration(J.ClassDeclaration classDecl, Ex } @Override - public J.VariableDeclarations visitVariableDeclarations(J.VariableDeclarations multiVariable, ExecutionContext executionContext) { + public J.VariableDeclarations visitVariableDeclarations(J.VariableDeclarations multiVariable, ExecutionContext ctx) { if (multiVariable.getLeadingAnnotations().stream().anyMatch(optionAnnotation::matches)) { options.add(multiVariable); } - return super.visitVariableDeclarations(multiVariable, executionContext); + return super.visitVariableDeclarations(multiVariable, ctx); } @Override diff --git a/rewrite-java/src/main/java/org/openrewrite/java/recipes/MigrateJavaTemplateToRewrite8.java b/rewrite-java/src/main/java/org/openrewrite/java/recipes/MigrateJavaTemplateToRewrite8.java index d14120a2e22..61656682acb 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/recipes/MigrateJavaTemplateToRewrite8.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/recipes/MigrateJavaTemplateToRewrite8.java @@ -56,8 +56,8 @@ public Set getTags() { public TreeVisitor getVisitor() { return new JavaIsoVisitor(){ @Override - public J.CompilationUnit visitCompilationUnit(J.CompilationUnit cu, ExecutionContext executionContext) { - return super.visitCompilationUnit(cu, executionContext); + public J.CompilationUnit visitCompilationUnit(J.CompilationUnit cu, ExecutionContext ctx) { + return super.visitCompilationUnit(cu, ctx); } @Override diff --git a/rewrite-java/src/main/java/org/openrewrite/java/recipes/MigrateMarkersSearchResult.java b/rewrite-java/src/main/java/org/openrewrite/java/recipes/MigrateMarkersSearchResult.java index ac88387f87a..6f4bcd6d1f4 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/recipes/MigrateMarkersSearchResult.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/recipes/MigrateMarkersSearchResult.java @@ -56,8 +56,8 @@ public TreeVisitor getVisitor() { return new JavaIsoVisitor() { @Override public J.MethodInvocation visitMethodInvocation(J.MethodInvocation method, - ExecutionContext executionContext) { - method = super.visitMethodInvocation(method, executionContext); + ExecutionContext ctx) { + method = super.visitMethodInvocation(method, ctx); if (method.getSimpleName().equals("withMarkers") && method.getSelect() != null && TypeUtils.isOfClassType(method.getSelect().getType(), "org.openrewrite.yaml.tree.Yaml.Mapping.Entry")) { diff --git a/rewrite-java/src/main/java/org/openrewrite/java/recipes/MigrateRecipeToRewrite8.java b/rewrite-java/src/main/java/org/openrewrite/java/recipes/MigrateRecipeToRewrite8.java index d9f58602577..91a580ea766 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/recipes/MigrateRecipeToRewrite8.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/recipes/MigrateRecipeToRewrite8.java @@ -121,7 +121,7 @@ public TreeVisitor getVisitor() { @Override public J.MemberReference visitMemberReference(final J.MemberReference memberRef, - final ExecutionContext executionContext) { + final ExecutionContext ctx) { if (MigrateRecipeToRewrite8.VISIT_JAVA_SOURCE_FILE_METHOD_MATCHER.matches(memberRef.getMethodType())) { maybeAddImport("org.openrewrite.TreeVisitor"); return getVisitMemberReferenceTemplate(); @@ -195,11 +195,11 @@ public J.Return visitReturn(J.Return _return, AtomicInteger returnsCount) { return (J.ClassDeclaration) new JavaIsoVisitor() { @Override public J.MethodDeclaration visitMethodDeclaration(J.MethodDeclaration method, - ExecutionContext executionContext) { + ExecutionContext ctx) { if (VISIT_METHOD_MATCHER.matches(method.getMethodType())) { return (J.MethodDeclaration) commentOf(method, VISIT_SOURCE_FILES_COMMENT); } - return super.visitMethodDeclaration(method, executionContext); + return super.visitMethodDeclaration(method, ctx); } }.visitNonNull(classDecl, ctx); } @@ -318,7 +318,7 @@ public J.MethodDeclaration visitMethodDeclaration(J.MethodDeclaration method, visitMethod = (J.MethodDeclaration) new JavaVisitor() { @Override public J visitMethodInvocation(J.MethodInvocation method, - ExecutionContext executionContext) { + ExecutionContext ctx) { if (method.getSimpleName().equals("visitJavaSourceFile")) { boolean isVariableDeclaration = getCursor().dropParentUntil(p -> p instanceof J.VariableDeclarations || @@ -333,12 +333,12 @@ public J visitMethodInvocation(J.MethodInvocation method, return getVisitMethodInvocationTemplate().withSelect(method.getSelect()).withArguments(method.getArguments()); } } - return super.visitMethodInvocation(method, executionContext); + return super.visitMethodInvocation(method, ctx); } @Override public J.MemberReference visitMemberReference(J.MemberReference memberRef, - ExecutionContext executionContext) { + ExecutionContext ctx) { if (memberRef.getReference().getSimpleName().equals("visitJavaSourceFile")) { maybeAddImport("org.openrewrite.TreeVisitor"); return getVisitMemberReferenceTemplate(); @@ -387,8 +387,8 @@ private static J replaceApplicabilityMethods(J tree, ExecutionContext ctx) { return new JavaIsoVisitor() { @Override public J.MethodInvocation visitMethodInvocation(J.MethodInvocation method, - ExecutionContext executionContext) { - method = super.visitMethodInvocation(method, executionContext); + ExecutionContext ctx) { + method = super.visitMethodInvocation(method, ctx); if (method.getSelect() instanceof J.Identifier && ((J.Identifier) method.getSelect()).getSimpleName().equals("Applicability")) { switch (method.getSimpleName()) { diff --git a/rewrite-java/src/main/java/org/openrewrite/java/recipes/SelectRecipeExamples.java b/rewrite-java/src/main/java/org/openrewrite/java/recipes/SelectRecipeExamples.java index 25820e3771b..56cd343878e 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/recipes/SelectRecipeExamples.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/recipes/SelectRecipeExamples.java @@ -66,19 +66,19 @@ public TreeVisitor getVisitor() { @Override public J.ClassDeclaration visitClassDeclaration(J.ClassDeclaration classDecl, - ExecutionContext executionContext) { + ExecutionContext ctx) { if (classDecl.getImplements() != null && !classDecl.getImplements().isEmpty()) { if (!TypeUtils.isOfClassType(classDecl.getImplements().get(0).getType(), REWRITE_TEST_FQN)) { return classDecl; } } selectedCount = 0; - return super.visitClassDeclaration(classDecl, executionContext); + return super.visitClassDeclaration(classDecl, ctx); } @Override public J.MethodDeclaration visitMethodDeclaration(J.MethodDeclaration method, - ExecutionContext executionContext) { + ExecutionContext ctx) { if (selectedCount > 0) { return method; } diff --git a/rewrite-java/src/main/java/org/openrewrite/java/recipes/UpdateMovedPackageClassName.java b/rewrite-java/src/main/java/org/openrewrite/java/recipes/UpdateMovedPackageClassName.java index b0e0c06d974..0a604065e55 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/recipes/UpdateMovedPackageClassName.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/recipes/UpdateMovedPackageClassName.java @@ -52,17 +52,17 @@ public String getDescription() { public TreeVisitor getVisitor() { return new JavaIsoVisitor() { @Override - public J.FieldAccess visitFieldAccess(J.FieldAccess fieldAccess, ExecutionContext executionContext) { + public J.FieldAccess visitFieldAccess(J.FieldAccess fieldAccess, ExecutionContext ctx) { if (fieldAccess.toString().equals(fullyQualifiedClassNameMovedFrom)) { return TypeTree.build(fullyQualifiedClassNameMovedTo) .withPrefix(fieldAccess.getPrefix()); } - return super.visitFieldAccess(fieldAccess, executionContext); + return super.visitFieldAccess(fieldAccess, ctx); } @Override - public J.Import visitImport(J.Import _import, ExecutionContext executionContext) { - J.Import after = super.visitImport(_import, executionContext); + public J.Import visitImport(J.Import _import, ExecutionContext ctx) { + J.Import after = super.visitImport(_import, ctx); if (_import != after) { maybeRemoveImport(fullyQualifiedClassNameMovedFrom); maybeAddImport(fullyQualifiedClassNameMovedTo); diff --git a/rewrite-java/src/main/java/org/openrewrite/java/recipes/UpdateMovedRecipeYaml.java b/rewrite-java/src/main/java/org/openrewrite/java/recipes/UpdateMovedRecipeYaml.java index d6eed695ded..658fa74ebb9 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/recipes/UpdateMovedRecipeYaml.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/recipes/UpdateMovedRecipeYaml.java @@ -56,7 +56,7 @@ public String getDescription() { public TreeVisitor getVisitor() { return new YamlIsoVisitor() { @Override - public Yaml.Scalar visitScalar(Yaml.Scalar scalar, ExecutionContext executionContext) { + public Yaml.Scalar visitScalar(Yaml.Scalar scalar, ExecutionContext ctx) { List keys = getCursor().getPathAsStream() .filter(Yaml.Mapping.Entry.class::isInstance) .map(Yaml.Mapping.Entry.class::cast) @@ -70,7 +70,7 @@ public Yaml.Scalar visitScalar(Yaml.Scalar scalar, ExecutionContext executionCon && scalar.getValue().equals(oldRecipeFullyQualifiedClassName)) { return scalar.withValue(newRecipeFullyQualifiedClassName); } - return super.visitScalar(scalar, executionContext); + return super.visitScalar(scalar, ctx); } }; } diff --git a/rewrite-java/src/main/java/org/openrewrite/java/search/FindComments.java b/rewrite-java/src/main/java/org/openrewrite/java/search/FindComments.java index 874fb834b1a..855a226d48e 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/search/FindComments.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/search/FindComments.java @@ -79,7 +79,7 @@ public TreeVisitor getVisitor() { return new JavaIsoVisitor() { @Override - public Space visitSpace(Space space, Space.Location loc, ExecutionContext context) { + public Space visitSpace(Space space, Space.Location loc, ExecutionContext ctx) { return space.withComments(ListUtils.map(space.getComments(), comment -> { if(comment instanceof TextComment) { for (Pattern p : compiledPatterns) { @@ -94,7 +94,7 @@ public Space visitSpace(Space space, Space.Location loc, ExecutionContext contex } @Override - public J.Literal visitLiteral(J.Literal literal, ExecutionContext context) { + public J.Literal visitLiteral(J.Literal literal, ExecutionContext ctx) { if (literal.getType() == JavaType.Primitive.Null) { return literal; } diff --git a/rewrite-java/src/main/java/org/openrewrite/java/search/FindDeprecatedClasses.java b/rewrite-java/src/main/java/org/openrewrite/java/search/FindDeprecatedClasses.java index e5d9668a27d..7626f6e430b 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/search/FindDeprecatedClasses.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/search/FindDeprecatedClasses.java @@ -84,7 +84,7 @@ public J.CompilationUnit visitCompilationUnit(J.CompilationUnit cu, ExecutionCon } }, new JavaIsoVisitor() { @Override - public N visitTypeName(N nameTree, ExecutionContext executionContext) { + public N visitTypeName(N nameTree, ExecutionContext ctx) { if (getCursor().firstEnclosing(J.Import.class) == null) { JavaType.FullyQualified fqn = TypeUtils.asFullyQualified(nameTree.getType()); if (fqn != null && (typeMatcher == null || typeMatcher.matches(fqn))) { diff --git a/rewrite-java/src/main/java/org/openrewrite/java/search/FindEmptyClasses.java b/rewrite-java/src/main/java/org/openrewrite/java/search/FindEmptyClasses.java index 64f24e87268..c6ac0a7f3d5 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/search/FindEmptyClasses.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/search/FindEmptyClasses.java @@ -53,13 +53,13 @@ public Duration getEstimatedEffortPerOccurrence() { public TreeVisitor getVisitor() { return new JavaVisitor() { @Override - public J visitClassDeclaration(J.ClassDeclaration classDecl, ExecutionContext executionContext) { + public J visitClassDeclaration(J.ClassDeclaration classDecl, ExecutionContext ctx) { if (classDecl.getType() != null && JavaType.Class.Kind.Class.equals(classDecl.getType().getKind()) && (classDecl.getBody() == null || classDecl.getBody().getStatements().isEmpty()) && classDecl.getLeadingAnnotations().isEmpty() && classDecl.getExtends() == null && classDecl.getImplements() == null) { return SearchResult.found(classDecl); } - return super.visitClassDeclaration(classDecl, executionContext); + return super.visitClassDeclaration(classDecl, ctx); } }; } diff --git a/rewrite-java/src/main/java/org/openrewrite/java/search/FindFields.java b/rewrite-java/src/main/java/org/openrewrite/java/search/FindFields.java index 30f190d800f..019fb9eda2b 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/search/FindFields.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/search/FindFields.java @@ -63,18 +63,18 @@ public String getDescription() { public TreeVisitor getVisitor() { return Preconditions.check(new UsesField<>(fullyQualifiedTypeName, fieldName), new JavaIsoVisitor() { @Override - public J.FieldAccess visitFieldAccess(J.FieldAccess fieldAccess, ExecutionContext executionContext) { + public J.FieldAccess visitFieldAccess(J.FieldAccess fieldAccess, ExecutionContext ctx) { JavaType.Variable varType = fieldAccess.getName().getFieldType(); if (varType != null && new TypeMatcher(fullyQualifiedTypeName, Boolean.TRUE.equals(matchInherited)).matches(varType.getOwner()) && StringUtils.matchesGlob(varType.getName(), fieldName)) { return SearchResult.found(fieldAccess); } - return super.visitFieldAccess(fieldAccess, executionContext); + return super.visitFieldAccess(fieldAccess, ctx); } @Override - public J.Identifier visitIdentifier(J.Identifier identifier, ExecutionContext executionContext) { - J.Identifier i = super.visitIdentifier(identifier, executionContext); + public J.Identifier visitIdentifier(J.Identifier identifier, ExecutionContext ctx) { + J.Identifier i = super.visitIdentifier(identifier, ctx); JavaType.Variable varType = identifier.getFieldType(); if (varType != null && new TypeMatcher(fullyQualifiedTypeName, Boolean.TRUE.equals(matchInherited)).matches(varType.getOwner()) && StringUtils.matchesGlob(varType.getName(), fieldName)) { diff --git a/rewrite-java/src/main/java/org/openrewrite/java/search/FindImports.java b/rewrite-java/src/main/java/org/openrewrite/java/search/FindImports.java index e431ec43464..ea311b32f96 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/search/FindImports.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/search/FindImports.java @@ -58,11 +58,11 @@ public TreeVisitor getVisitor() { TypeMatcher typeMatcher = new TypeMatcher(typePattern, Boolean.TRUE.equals(matchInherited)); return new JavaIsoVisitor() { @Override - public J.Import visitImport(J.Import anImport, ExecutionContext executionContext) { + public J.Import visitImport(J.Import anImport, ExecutionContext ctx) { if (typeMatcher.matchesPackage(anImport.getTypeName())) { return SearchResult.found(anImport); } - return super.visitImport(anImport, executionContext); + return super.visitImport(anImport, ctx); } }; } diff --git a/rewrite-java/src/main/java/org/openrewrite/java/search/FindMethodDeclaration.java b/rewrite-java/src/main/java/org/openrewrite/java/search/FindMethodDeclaration.java index 4403d2475fa..8f1184ba70c 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/search/FindMethodDeclaration.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/search/FindMethodDeclaration.java @@ -53,8 +53,8 @@ public TreeVisitor getVisitor() { return Preconditions.check(new DeclaresMethod<>(methodPattern, matchOverrides), new JavaIsoVisitor() { final MethodMatcher m = new MethodMatcher(methodPattern, matchOverrides); @Override - public J.MethodDeclaration visitMethodDeclaration(J.MethodDeclaration method, ExecutionContext executionContext) { - J.MethodDeclaration md = super.visitMethodDeclaration(method, executionContext); + public J.MethodDeclaration visitMethodDeclaration(J.MethodDeclaration method, ExecutionContext ctx) { + J.MethodDeclaration md = super.visitMethodDeclaration(method, ctx); J.ClassDeclaration cd = getCursor().firstEnclosing(J.ClassDeclaration.class); if(cd == null) { return md; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/search/FindMethods.java b/rewrite-java/src/main/java/org/openrewrite/java/search/FindMethods.java index a3d11d2dc00..9bda4a5afa8 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/search/FindMethods.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/search/FindMethods.java @@ -171,14 +171,14 @@ public static Set findDeclaration(J j, String methodPattern final MethodMatcher methodMatcher = new MethodMatcher(methodPattern, matchOverrides); @Override - public J.MethodDeclaration visitMethodDeclaration(J.MethodDeclaration method, ExecutionContext p) { + public J.MethodDeclaration visitMethodDeclaration(J.MethodDeclaration method, ExecutionContext ctx) { J.ClassDeclaration enclosingClass = getCursor().firstEnclosing(J.ClassDeclaration.class); if (enclosingClass != null && methodMatcher.matches(method, getCursor().firstEnclosingOrThrow(J.ClassDeclaration.class))) { return SearchResult.found(method); } else if (methodMatcher.matches(method.getMethodType())) { return SearchResult.found(method); } - return super.visitMethodDeclaration(method, p); + return super.visitMethodDeclaration(method, ctx); } }, j, diff --git a/rewrite-java/src/main/java/org/openrewrite/java/search/FindMissingTypes.java b/rewrite-java/src/main/java/org/openrewrite/java/search/FindMissingTypes.java index 5384fe56a80..9caedf3e751 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/search/FindMissingTypes.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/search/FindMissingTypes.java @@ -206,8 +206,8 @@ public J.ClassDeclaration visitClassDeclaration(J.ClassDeclaration classDecl, Ex } @Override - public J.NewClass visitNewClass(J.NewClass newClass, ExecutionContext executionContext) { - J.NewClass n = super.visitNewClass(newClass, executionContext); + public J.NewClass visitNewClass(J.NewClass newClass, ExecutionContext ctx) { + J.NewClass n = super.visitNewClass(newClass, ctx); if (n == newClass && !isWellFormedType(n.getType(), seenTypes)) { n = SearchResult.found(n, "NewClass type is missing or malformed"); } @@ -219,8 +219,8 @@ public J.NewClass visitNewClass(J.NewClass newClass, ExecutionContext executionC } @Override - public J.ParameterizedType visitParameterizedType(J.ParameterizedType type, ExecutionContext executionContext) { - J.ParameterizedType p = super.visitParameterizedType(type, executionContext); + public J.ParameterizedType visitParameterizedType(J.ParameterizedType type, ExecutionContext ctx) { + J.ParameterizedType p = super.visitParameterizedType(type, ctx); if (p.getClazz() instanceof J.Identifier && p.getClazz().getType() != null && !(p.getClazz().getType() instanceof JavaType.Class || p.getClazz().getType() instanceof JavaType.Unknown)) { p = SearchResult.found(p, "ParameterizedType#clazz is J.Identifier and the type is is not JavaType$Class."); diff --git a/rewrite-java/src/main/java/org/openrewrite/java/search/FindTypeMappings.java b/rewrite-java/src/main/java/org/openrewrite/java/search/FindTypeMappings.java index d97f19d52aa..0e8169b999b 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/search/FindTypeMappings.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/search/FindTypeMappings.java @@ -60,13 +60,13 @@ public TreeVisitor getScanner(Accumulator acc) { return new JavaIsoVisitor() { String sourcePath = ""; @Override - public J.CompilationUnit visitCompilationUnit(J.CompilationUnit cu, ExecutionContext executionContext) { + public J.CompilationUnit visitCompilationUnit(J.CompilationUnit cu, ExecutionContext ctx) { sourcePath = cu.getSourcePath().toString(); - return super.visitCompilationUnit(cu, executionContext); + return super.visitCompilationUnit(cu, ctx); } @Override - public @Nullable J visit(@Nullable Tree tree, ExecutionContext executionContext) { + public @Nullable J visit(@Nullable Tree tree, ExecutionContext ctx) { if (tree instanceof TypedTree) { Map counts = acc.getSourceToMappedTypeCount() .computeIfAbsent(sourcePath, k -> new HashMap<>()) @@ -116,7 +116,7 @@ public J.CompilationUnit visitCompilationUnit(J.CompilationUnit cu, ExecutionCon ((TypedTree) tree).getType().getClass().getName(), k -> new AtomicInteger(0)) .incrementAndGet(); } - return super.visit(tree, executionContext); + return super.visit(tree, ctx); } }; } diff --git a/rewrite-java/src/main/java/org/openrewrite/java/search/FindTypes.java b/rewrite-java/src/main/java/org/openrewrite/java/search/FindTypes.java index b60f87388b8..98cd6f17d38 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/search/FindTypes.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/search/FindTypes.java @@ -64,7 +64,7 @@ public TreeVisitor getVisitor() { return Preconditions.check(new UsesType<>(fullyQualifiedTypeName, false), new JavaVisitor() { @Override - public J visitIdentifier(J.Identifier ident, ExecutionContext executionContext) { + public J visitIdentifier(J.Identifier ident, ExecutionContext ctx) { if (ident.getType() != null && getCursor().firstEnclosing(J.Import.class) == null && getCursor().firstEnclosing(J.FieldAccess.class) == null && @@ -75,7 +75,7 @@ public J visitIdentifier(J.Identifier ident, ExecutionContext executionContext) return SearchResult.found(ident); } } - return super.visitIdentifier(ident, executionContext); + return super.visitIdentifier(ident, ctx); } @Override diff --git a/rewrite-java/src/main/java/org/openrewrite/java/search/ResultOfMethodCallIgnored.java b/rewrite-java/src/main/java/org/openrewrite/java/search/ResultOfMethodCallIgnored.java index 6bffc65bb3a..b3b73249d80 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/search/ResultOfMethodCallIgnored.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/search/ResultOfMethodCallIgnored.java @@ -60,8 +60,8 @@ public TreeVisitor getVisitor() { MethodMatcher methodMatcher = new MethodMatcher(methodPattern, matchOverrides); return new JavaIsoVisitor() { @Override - public J.MethodInvocation visitMethodInvocation(J.MethodInvocation method, ExecutionContext executionContext) { - J.MethodInvocation m = super.visitMethodInvocation(method, executionContext); + public J.MethodInvocation visitMethodInvocation(J.MethodInvocation method, ExecutionContext ctx) { + J.MethodInvocation m = super.visitMethodInvocation(method, ctx); if (methodMatcher.matches(method)) { if (getCursor().getParentTreeCursor().getValue() instanceof J.Block) { m = SearchResult.found(m); diff --git a/rewrite-json/src/main/java/org/openrewrite/json/ChangeKey.java b/rewrite-json/src/main/java/org/openrewrite/json/ChangeKey.java index c36e6e18714..ec5fda6b86e 100644 --- a/rewrite-json/src/main/java/org/openrewrite/json/ChangeKey.java +++ b/rewrite-json/src/main/java/org/openrewrite/json/ChangeKey.java @@ -48,8 +48,8 @@ public TreeVisitor getVisitor() { JsonPathMatcher matcher = new JsonPathMatcher(oldKeyPath); return new JsonIsoVisitor() { @Override - public Json.Member visitMember(Json.Member member, ExecutionContext executionContext) { - Json.Member m = super.visitMember(member, executionContext); + public Json.Member visitMember(Json.Member member, ExecutionContext ctx) { + Json.Member m = super.visitMember(member, ctx); if (matcher.matches(getCursor())) { String value = ChangeKey.this.newKey; if (value.startsWith("'") || value.startsWith("\"")) { diff --git a/rewrite-json/src/main/java/org/openrewrite/json/ChangeValue.java b/rewrite-json/src/main/java/org/openrewrite/json/ChangeValue.java index e5385d42c05..f9cdd4352e5 100644 --- a/rewrite-json/src/main/java/org/openrewrite/json/ChangeValue.java +++ b/rewrite-json/src/main/java/org/openrewrite/json/ChangeValue.java @@ -54,8 +54,8 @@ public TreeVisitor getVisitor() { JsonPathMatcher matcher = new JsonPathMatcher(oldKeyPath); return new JsonIsoVisitor() { @Override - public Json.Member visitMember(Json.Member member, ExecutionContext executionContext) { - Json.Member m = super.visitMember(member, executionContext); + public Json.Member visitMember(Json.Member member, ExecutionContext ctx) { + Json.Member m = super.visitMember(member, ctx); if (matcher.matches(getCursor()) && (!(m.getValue() instanceof Json.Literal) || !((Json.Literal) m.getValue()).getValue().equals(value))) { String source = ChangeValue.this.value; if (source.startsWith("'") || source.startsWith("\"")) { diff --git a/rewrite-json/src/main/java/org/openrewrite/json/DeleteKey.java b/rewrite-json/src/main/java/org/openrewrite/json/DeleteKey.java index 3fe1706fe45..4aff56eeea2 100644 --- a/rewrite-json/src/main/java/org/openrewrite/json/DeleteKey.java +++ b/rewrite-json/src/main/java/org/openrewrite/json/DeleteKey.java @@ -47,8 +47,8 @@ public TreeVisitor getVisitor() { JsonPathMatcher matcher = new JsonPathMatcher(keyPath); return new JsonIsoVisitor() { @Override - public Json.JsonObject visitObject(Json.JsonObject obj, ExecutionContext executionContext) { - Json.JsonObject o = super.visitObject(obj, executionContext); + public Json.JsonObject visitObject(Json.JsonObject obj, ExecutionContext ctx) { + Json.JsonObject o = super.visitObject(obj, ctx); AtomicReference copyFirstPrefix = new AtomicReference<>(); o = o.withMembers(ListUtils.map(o.getMembers(), (i, e) -> { if (matcher.matches(new Cursor(getCursor(), e))) { diff --git a/rewrite-json/src/main/java/org/openrewrite/json/search/FindKey.java b/rewrite-json/src/main/java/org/openrewrite/json/search/FindKey.java index 8414a0de4f0..5902263ec98 100644 --- a/rewrite-json/src/main/java/org/openrewrite/json/search/FindKey.java +++ b/rewrite-json/src/main/java/org/openrewrite/json/search/FindKey.java @@ -53,8 +53,8 @@ public TreeVisitor getVisitor() { JsonPathMatcher matcher = new JsonPathMatcher(key); return new JsonIsoVisitor() { @Override - public Json.Member visitMember(Json.Member member, ExecutionContext executionContext) { - Json.Member m = super.visitMember(member, executionContext); + public Json.Member visitMember(Json.Member member, ExecutionContext ctx) { + Json.Member m = super.visitMember(member, ctx); if (matcher.matches(getCursor())) { return m.withKey(SearchResult.found(m.getKey())); } diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/AddPlugin.java b/rewrite-maven/src/main/java/org/openrewrite/maven/AddPlugin.java index 4a0301ec04d..4803472ea49 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/AddPlugin.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/AddPlugin.java @@ -105,11 +105,11 @@ public TreeVisitor getVisitor() { private class AddPluginVisitor extends MavenIsoVisitor { @Override - public boolean isAcceptable(SourceFile sourceFile, ExecutionContext executionContext) { + public boolean isAcceptable(SourceFile sourceFile, ExecutionContext ctx) { if (filePattern != null) { - return PathUtils.matchesGlob(sourceFile.getSourcePath(), filePattern) && super.isAcceptable(sourceFile, executionContext); + return PathUtils.matchesGlob(sourceFile.getSourcePath(), filePattern) && super.isAcceptable(sourceFile, ctx); } - return super.isAcceptable(sourceFile, executionContext); + return super.isAcceptable(sourceFile, ctx); } @Override diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/AddProperty.java b/rewrite-maven/src/main/java/org/openrewrite/maven/AddProperty.java index 39767baa408..c7e5766b1de 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/AddProperty.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/AddProperty.java @@ -68,7 +68,7 @@ public String getDescription() { public TreeVisitor getVisitor() { return Preconditions.check(new MavenVisitor() { @Override - public Xml visitDocument(Xml.Document document, ExecutionContext executionContext) { + public Xml visitDocument(Xml.Document document, ExecutionContext ctx) { String currentValue = getResolutionResult().getPom().getProperties().get(key); boolean trust = Boolean.TRUE.equals(trustParent); if (!trust && !value.equals(currentValue)) { diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/ChangePackaging.java b/rewrite-maven/src/main/java/org/openrewrite/maven/ChangePackaging.java index af516de272e..cd871f4b960 100755 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/ChangePackaging.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/ChangePackaging.java @@ -82,8 +82,8 @@ public Xml visitDocument(Xml.Document document, ExecutionContext ctx) { } @Override - public Xml visitTag(Xml.Tag tag, ExecutionContext context) { - Xml.Tag t = (Xml.Tag) super.visitTag(tag, context); + public Xml visitTag(Xml.Tag tag, ExecutionContext ctx) { + Xml.Tag t = (Xml.Tag) super.visitTag(tag, ctx); if (PROJECT_MATCHER.matches(getCursor())) { if (packaging == null || "jar".equals(packaging)) { t = filterTagChildren(t, it -> !"packaging".equals(it.getName())); diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/ChangeParentPom.java b/rewrite-maven/src/main/java/org/openrewrite/maven/ChangeParentPom.java index 0a6c85e445e..bb88ab7662b 100755 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/ChangeParentPom.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/ChangeParentPom.java @@ -155,7 +155,7 @@ public TreeVisitor getVisitor() { return Preconditions.check(new MavenVisitor() { @Override - public Xml visitDocument(Xml.Document document, ExecutionContext executionContext) { + public Xml visitDocument(Xml.Document document, ExecutionContext ctx) { Parent parent = getResolutionResult().getPom().getRequested().getParent(); if (parent != null && matchesGlob(parent.getArtifactId(), oldArtifactId) && diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/ChangePropertyValue.java b/rewrite-maven/src/main/java/org/openrewrite/maven/ChangePropertyValue.java index c10dff245f4..33b67e7ce6a 100755 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/ChangePropertyValue.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/ChangePropertyValue.java @@ -64,7 +64,7 @@ public String getDescription() { public TreeVisitor getVisitor() { return Preconditions.check(new MavenVisitor() { @Override - public Xml visitDocument(Xml.Document document, ExecutionContext executionContext) { + public Xml visitDocument(Xml.Document document, ExecutionContext ctx) { String currentValue = getResolutionResult().getPom().getProperties().get(key); boolean trust = Boolean.TRUE.equals(trustParent); if (!trust && !newValue.equals(currentValue)) { diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/ManageDependencies.java b/rewrite-maven/src/main/java/org/openrewrite/maven/ManageDependencies.java index 0ab87d713b7..63f43aca979 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/ManageDependencies.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/ManageDependencies.java @@ -90,8 +90,8 @@ public Map> getInitialValue public TreeVisitor getScanner(Map> rootGavToDependencies) { return Preconditions.check(Boolean.TRUE.equals(addToRootPom), new MavenIsoVisitor() { @Override - public Xml.Document visitDocument(Xml.Document document, ExecutionContext executionContext) { - Xml.Document doc = super.visitDocument(document, executionContext); + public Xml.Document visitDocument(Xml.Document document, ExecutionContext ctx) { + Xml.Document doc = super.visitDocument(document, ctx); Collection manageableDependencies = findDependencies(groupPattern, artifactPattern != null ? artifactPattern : "*"); ResolvedGroupArtifactVersion root = findRootPom(getResolutionResult()).getPom().getGav(); rootGavToDependencies.computeIfAbsent(new GroupArtifactVersion(root.getGroupId(), root.getArtifactId(), root.getVersion()), v -> new ArrayList<>()).addAll(manageableDependencies); @@ -104,8 +104,8 @@ public Xml.Document visitDocument(Xml.Document document, ExecutionContext execut public TreeVisitor getVisitor(Map> rootGavToDependencies) { return new MavenVisitor() { @Override - public Xml visitDocument(Xml.Document document, ExecutionContext executionContext) { - Xml maven = super.visitDocument(document, executionContext); + public Xml visitDocument(Xml.Document document, ExecutionContext ctx) { + Xml maven = super.visitDocument(document, ctx); Collection manageableDependencies; if (Boolean.TRUE.equals(addToRootPom)) { diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/OrderPomElements.java b/rewrite-maven/src/main/java/org/openrewrite/maven/OrderPomElements.java index 81ee0e3ce2b..d5ef11c1d43 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/OrderPomElements.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/OrderPomElements.java @@ -135,8 +135,8 @@ public Xml.Document visitDocument(Xml.Document document, ExecutionContext ctx) { } @Override - public Xml.Tag visitTag(Xml.Tag tag, ExecutionContext executionContext) { - Xml.Tag tg = super.visitTag(tag, executionContext); + public Xml.Tag visitTag(Xml.Tag tag, ExecutionContext ctx) { + Xml.Tag tg = super.visitTag(tag, ctx); if ("dependency".equals(tg.getName()) || "parent".equals(tg.getName())) { tg = orderGav(tg); } diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/RemoveDuplicateDependencies.java b/rewrite-maven/src/main/java/org/openrewrite/maven/RemoveDuplicateDependencies.java index 6c381ea1b79..565a39e2dc5 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/RemoveDuplicateDependencies.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/RemoveDuplicateDependencies.java @@ -56,7 +56,7 @@ public Duration getEstimatedEffortPerOccurrence() { public TreeVisitor getVisitor() { return Preconditions.check(new MavenIsoVisitor() { @Override - public Xml.Document visitDocument(Xml.Document document, ExecutionContext executionContext) { + public Xml.Document visitDocument(Xml.Document document, ExecutionContext ctx) { Xml.Tag root = document.getRoot(); if (root.getChild("dependencies").isPresent() || root.getChild("dependencyManagement").isPresent()) { return SearchResult.found(document); diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/RemoveExclusion.java b/rewrite-maven/src/main/java/org/openrewrite/maven/RemoveExclusion.java index 985e7bd8770..c960be6657f 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/RemoveExclusion.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/RemoveExclusion.java @@ -77,7 +77,7 @@ public String getDescription() { public TreeVisitor getVisitor() { return new MavenVisitor() { @Override - public Xml visitTag(Xml.Tag tag, ExecutionContext executionContext) { + public Xml visitTag(Xml.Tag tag, ExecutionContext ctx) { if (isDependencyTag(groupId, artifactId) || isManagedDependencyTag(groupId, artifactId)) { Optional maybeExclusions = tag.getChild("exclusions"); if (maybeExclusions.isPresent()) { @@ -110,7 +110,7 @@ public Xml visitTag(Xml.Tag tag, ExecutionContext executionContext) { })); } } - return super.visitTag(tag, executionContext); + return super.visitTag(tag, ctx); } private GroupArtifact groupArtifact(Xml.Tag tag) { diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/RemovePlugin.java b/rewrite-maven/src/main/java/org/openrewrite/maven/RemovePlugin.java index 37f8ca9ea79..fe61cdaa70b 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/RemovePlugin.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/RemovePlugin.java @@ -53,11 +53,11 @@ public String getDescription() { public TreeVisitor getVisitor() { return new MavenIsoVisitor() { @Override - public Xml.Document visitDocument(Xml.Document document, ExecutionContext executionContext) { + public Xml.Document visitDocument(Xml.Document document, ExecutionContext ctx) { for (Xml.Tag plugin : FindPlugin.find(document, groupId, artifactId)) { doAfterVisit(new RemoveContentVisitor<>(plugin, true)); } - return super.visitDocument(document, executionContext); + return super.visitDocument(document, ctx); } }; } diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/UpdateMavenWrapper.java b/rewrite-maven/src/main/java/org/openrewrite/maven/UpdateMavenWrapper.java index f98777e4c17..1908fe48e40 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/UpdateMavenWrapper.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/UpdateMavenWrapper.java @@ -193,8 +193,8 @@ public boolean isAcceptable(SourceFile sourceFile, ExecutionContext ctx) { } @Override - public Properties visitFile(Properties.File file, ExecutionContext executionContext) { - Properties p = super.visitFile(file, executionContext); + public Properties visitFile(Properties.File file, ExecutionContext ctx) { + Properties p = super.visitFile(file, ctx); if (FindProperties.find(p, DISTRIBUTION_SHA_256_SUM_KEY, null).isEmpty() || FindProperties.find(p, WRAPPER_SHA_256_SUM_KEY, null).isEmpty()) { acc.needsWrapperUpdate = true; @@ -436,8 +436,8 @@ private static class WrapperPropertiesVisitor extends PropertiesIsoVisitor getInitialValue(ExecutionContext ctx) { public TreeVisitor getScanner(Set projectArtifacts) { return new MavenIsoVisitor() { @Override - public Xml.Document visitDocument(Xml.Document document, ExecutionContext executionContext) { + public Xml.Document visitDocument(Xml.Document document, ExecutionContext ctx) { ResolvedPom pom = getResolutionResult().getPom(); projectArtifacts.add(new GroupArtifact(pom.getGroupId(), pom.getArtifactId())); return document; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/search/FindDependency.java b/rewrite-maven/src/main/java/org/openrewrite/maven/search/FindDependency.java index 7dbe2f1c908..8845529ec1e 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/search/FindDependency.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/search/FindDependency.java @@ -43,11 +43,11 @@ public static Set find(Xml.Document maven, String groupId, String artif Set ds = new HashSet<>(); new MavenIsoVisitor() { @Override - public Xml.Tag visitTag(Xml.Tag tag, ExecutionContext context) { + public Xml.Tag visitTag(Xml.Tag tag, ExecutionContext ctx) { if (isDependencyTag(groupId, artifactId)) { ds.add(tag); } - return super.visitTag(tag, context); + return super.visitTag(tag, ctx); } }.visit(maven, new InMemoryExecutionContext()); return ds; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/search/FindPlugin.java b/rewrite-maven/src/main/java/org/openrewrite/maven/search/FindPlugin.java index 6d71fb4afe8..9b65fcab530 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/search/FindPlugin.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/search/FindPlugin.java @@ -43,11 +43,11 @@ public static Set find(Xml.Document maven, String groupId, String artif Set ds = new HashSet<>(); new MavenIsoVisitor() { @Override - public Xml.Tag visitTag(Xml.Tag tag, ExecutionContext context) { + public Xml.Tag visitTag(Xml.Tag tag, ExecutionContext ctx) { if (isPluginTag(groupId, artifactId)) { ds.add(tag); } - return super.visitTag(tag, context); + return super.visitTag(tag, ctx); } }.visit(maven, new InMemoryExecutionContext()); return ds; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/search/FindProperties.java b/rewrite-maven/src/main/java/org/openrewrite/maven/search/FindProperties.java index 09eec492c2f..8fe2bf298b3 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/search/FindProperties.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/search/FindProperties.java @@ -59,8 +59,8 @@ public TreeVisitor getVisitor() { Pattern propertyUsageMatcher = Pattern.compile(".*\\$\\{" + propertyMatcher.pattern() + "}.*"); return new MavenVisitor() { @Override - public Xml visitTag(Xml.Tag tag, ExecutionContext context) { - Xml.Tag t = (Xml.Tag) super.visitTag(tag, context); + public Xml visitTag(Xml.Tag tag, ExecutionContext ctx) { + Xml.Tag t = (Xml.Tag) super.visitTag(tag, ctx); if (isPropertyTag() && propertyMatcher.matcher(t.getName()).matches()) { t = SearchResult.found(t); } diff --git a/rewrite-maven/src/test/java/org/openrewrite/maven/AssertionsTest.java b/rewrite-maven/src/test/java/org/openrewrite/maven/AssertionsTest.java index d303caac057..33598593744 100644 --- a/rewrite-maven/src/test/java/org/openrewrite/maven/AssertionsTest.java +++ b/rewrite-maven/src/test/java/org/openrewrite/maven/AssertionsTest.java @@ -125,9 +125,9 @@ public Xml visit(@Nullable Tree tree, ExecutionContext ctx) { } @Override - public Xml.Tag visitTag(Xml.Tag tag, ExecutionContext executionContext) { + public Xml.Tag visitTag(Xml.Tag tag, ExecutionContext ctx) { assertThat(filename).isEqualTo("pom.xml"); - return super.visitTag(tag, executionContext); + return super.visitTag(tag, ctx); } }; } diff --git a/rewrite-maven/src/test/java/org/openrewrite/maven/MavenDependencyFailuresTest.java b/rewrite-maven/src/test/java/org/openrewrite/maven/MavenDependencyFailuresTest.java index 031ce40d56c..069fe72d152 100644 --- a/rewrite-maven/src/test/java/org/openrewrite/maven/MavenDependencyFailuresTest.java +++ b/rewrite-maven/src/test/java/org/openrewrite/maven/MavenDependencyFailuresTest.java @@ -284,7 +284,7 @@ void unreachableRepository() { private Recipe updateModel() { return toRecipe(() -> new MavenIsoVisitor<>() { @Override - public Xml.Document visitDocument(Xml.Document document, ExecutionContext executionContext) { + public Xml.Document visitDocument(Xml.Document document, ExecutionContext ctx) { if (document.getMarkers().findFirst(Markup.class).isEmpty()) { maybeUpdateModel(); } diff --git a/rewrite-test/src/main/java/org/openrewrite/test/RecipeSpec.java b/rewrite-test/src/main/java/org/openrewrite/test/RecipeSpec.java index 24139d4579b..61a853defa9 100644 --- a/rewrite-test/src/main/java/org/openrewrite/test/RecipeSpec.java +++ b/rewrite-test/src/main/java/org/openrewrite/test/RecipeSpec.java @@ -162,13 +162,13 @@ public RecipeSpec parser(Parser.Builder parser) { return this; } - public RecipeSpec executionContext(ExecutionContext executionContext) { - this.executionContext = executionContext; + public RecipeSpec executionContext(ExecutionContext ctx) { + this.executionContext = ctx; return this; } - public RecipeSpec recipeExecutionContext(ExecutionContext executionContext) { - this.recipeExecutionContext = executionContext; + public RecipeSpec recipeExecutionContext(ExecutionContext ctx) { + this.recipeExecutionContext = ctx; return this; } diff --git a/rewrite-xml/src/main/java/org/openrewrite/xml/ChangeTagName.java b/rewrite-xml/src/main/java/org/openrewrite/xml/ChangeTagName.java index 3629b49754c..c5d673d23bf 100644 --- a/rewrite-xml/src/main/java/org/openrewrite/xml/ChangeTagName.java +++ b/rewrite-xml/src/main/java/org/openrewrite/xml/ChangeTagName.java @@ -52,11 +52,11 @@ public TreeVisitor getVisitor() { private final XPathMatcher xPathMatcher = new XPathMatcher(elementName); @Override - public Xml.Tag visitTag(final Xml.Tag tag, final ExecutionContext executionContext) { + public Xml.Tag visitTag(final Xml.Tag tag, final ExecutionContext ctx) { if (xPathMatcher.matches(getCursor())) { return tag.withName(newName); } - return super.visitTag(tag, executionContext); + return super.visitTag(tag, ctx); } }; } diff --git a/rewrite-xml/src/main/java/org/openrewrite/xml/CreateXmlFile.java b/rewrite-xml/src/main/java/org/openrewrite/xml/CreateXmlFile.java index b2a7c4c65ac..0870e8f01dc 100644 --- a/rewrite-xml/src/main/java/org/openrewrite/xml/CreateXmlFile.java +++ b/rewrite-xml/src/main/java/org/openrewrite/xml/CreateXmlFile.java @@ -93,7 +93,7 @@ public TreeVisitor getVisitor(AtomicBoolean created) { Path path = Paths.get(relativeFileName); return new XmlVisitor() { @Override - public Xml visitDocument(Xml.Document document, ExecutionContext executionContext) { + public Xml visitDocument(Xml.Document document, ExecutionContext ctx) { if ((created.get() || Boolean.TRUE.equals(overwriteExisting)) && path.equals(document.getSourcePath())) { if (StringUtils.isBlank(fileContents)) { return document.withProlog(null).withRoot(null); diff --git a/rewrite-xml/src/main/java/org/openrewrite/xml/security/IsOwaspSuppressionsFile.java b/rewrite-xml/src/main/java/org/openrewrite/xml/security/IsOwaspSuppressionsFile.java index 06405366a76..2492aa00b26 100644 --- a/rewrite-xml/src/main/java/org/openrewrite/xml/security/IsOwaspSuppressionsFile.java +++ b/rewrite-xml/src/main/java/org/openrewrite/xml/security/IsOwaspSuppressionsFile.java @@ -38,8 +38,8 @@ public String getDescription() { public TreeVisitor getVisitor() { return new XmlIsoVisitor() { @Override - public Xml.Document visitDocument(Xml.Document document, ExecutionContext executionContext) { - Xml.Document doc = super.visitDocument(document, executionContext); + public Xml.Document visitDocument(Xml.Document document, ExecutionContext ctx) { + Xml.Document doc = super.visitDocument(document, ctx); if (doc.getRoot() == null) { return doc; } diff --git a/rewrite-yaml/src/main/java/org/openrewrite/yaml/ChangeKey.java b/rewrite-yaml/src/main/java/org/openrewrite/yaml/ChangeKey.java index ad0fc8f347d..b472868cbca 100644 --- a/rewrite-yaml/src/main/java/org/openrewrite/yaml/ChangeKey.java +++ b/rewrite-yaml/src/main/java/org/openrewrite/yaml/ChangeKey.java @@ -51,8 +51,8 @@ public TreeVisitor getVisitor() { JsonPathMatcher matcher = new JsonPathMatcher(oldKeyPath); return new YamlIsoVisitor() { @Override - public Yaml.Mapping.Entry visitMappingEntry(Yaml.Mapping.Entry entry, ExecutionContext context) { - Yaml.Mapping.Entry e = super.visitMappingEntry(entry, context); + public Yaml.Mapping.Entry visitMappingEntry(Yaml.Mapping.Entry entry, ExecutionContext ctx) { + Yaml.Mapping.Entry e = super.visitMappingEntry(entry, ctx); if (matcher.matches(getCursor())) { if (e.getKey() instanceof Yaml.Scalar) { e = e.withKey(((Yaml.Scalar)e.getKey()).withValue(newKey)); diff --git a/rewrite-yaml/src/main/java/org/openrewrite/yaml/ChangeValue.java b/rewrite-yaml/src/main/java/org/openrewrite/yaml/ChangeValue.java index 22549feca10..6b16aefb548 100644 --- a/rewrite-yaml/src/main/java/org/openrewrite/yaml/ChangeValue.java +++ b/rewrite-yaml/src/main/java/org/openrewrite/yaml/ChangeValue.java @@ -54,8 +54,8 @@ public TreeVisitor getVisitor() { JsonPathMatcher matcher = new JsonPathMatcher(oldKeyPath); return new YamlIsoVisitor() { @Override - public Yaml.Mapping.Entry visitMappingEntry(Yaml.Mapping.Entry entry, ExecutionContext context) { - Yaml.Mapping.Entry e = super.visitMappingEntry(entry, context); + public Yaml.Mapping.Entry visitMappingEntry(Yaml.Mapping.Entry entry, ExecutionContext ctx) { + Yaml.Mapping.Entry e = super.visitMappingEntry(entry, ctx); if (matcher.matches(getCursor()) && (!(e.getValue() instanceof Yaml.Scalar) || !((Yaml.Scalar) e.getValue()).getValue().equals(value))) { Yaml.Anchor anchor = (e.getValue() instanceof Yaml.Scalar) ? ((Yaml.Scalar) e.getValue()).getAnchor() : null; String prefix = e.getValue() instanceof Yaml.Sequence ? ((Yaml.Sequence) e.getValue()).getOpeningBracketPrefix() : e.getValue().getPrefix(); @@ -68,8 +68,8 @@ public Yaml.Mapping.Entry visitMappingEntry(Yaml.Mapping.Entry entry, ExecutionC } @Override - public Yaml.Scalar visitScalar(Yaml.Scalar scalar, ExecutionContext executionContext) { - Yaml.Scalar s = super.visitScalar(scalar, executionContext); + public Yaml.Scalar visitScalar(Yaml.Scalar scalar, ExecutionContext ctx) { + Yaml.Scalar s = super.visitScalar(scalar, ctx); if (matcher.matches(getCursor())) { s = s.withValue(value); } diff --git a/rewrite-yaml/src/main/java/org/openrewrite/yaml/CommentOutProperty.java b/rewrite-yaml/src/main/java/org/openrewrite/yaml/CommentOutProperty.java index f1d2d4dda5a..51b438a29ee 100644 --- a/rewrite-yaml/src/main/java/org/openrewrite/yaml/CommentOutProperty.java +++ b/rewrite-yaml/src/main/java/org/openrewrite/yaml/CommentOutProperty.java @@ -60,7 +60,7 @@ public TreeVisitor getVisitor() { @Override public Yaml.Sequence.Entry visitSequenceEntry(Yaml.Sequence.Entry entry, - ExecutionContext executionContext) { + ExecutionContext ctx) { indentation = entry.getPrefix(); if (!comment.isEmpty()) { // add comment and return @@ -68,7 +68,7 @@ public Yaml.Sequence.Entry visitSequenceEntry(Yaml.Sequence.Entry entry, comment = ""; return entry.withPrefix(newPrefix); } - return super.visitSequenceEntry(entry, executionContext); + return super.visitSequenceEntry(entry, ctx); } @Override diff --git a/rewrite-yaml/src/main/java/org/openrewrite/yaml/CopyValue.java b/rewrite-yaml/src/main/java/org/openrewrite/yaml/CopyValue.java index 3dd1ca35967..9db9f1ce8cd 100644 --- a/rewrite-yaml/src/main/java/org/openrewrite/yaml/CopyValue.java +++ b/rewrite-yaml/src/main/java/org/openrewrite/yaml/CopyValue.java @@ -61,7 +61,7 @@ public Yaml.Mapping.Entry visitMappingEntry(Yaml.Mapping.Entry entry, ExecutionC if (oldPathMatcher.matches(getCursor()) && entry.getValue() instanceof Yaml.Scalar) { doAfterVisit(new YamlIsoVisitor() { @Override - public Yaml.Mapping.Entry visitMappingEntry(Yaml.Mapping.Entry entry, ExecutionContext executionContext) { + public Yaml.Mapping.Entry visitMappingEntry(Yaml.Mapping.Entry entry, ExecutionContext ctx) { Yaml.Mapping.Entry dest = super.visitMappingEntry(entry, ctx); if (newPathMatcher.matches(getCursor())) { dest = dest.withValue(source.getValue()); diff --git a/rewrite-yaml/src/main/java/org/openrewrite/yaml/CreateYamlFile.java b/rewrite-yaml/src/main/java/org/openrewrite/yaml/CreateYamlFile.java index 6209e2e0797..2c05b37e884 100644 --- a/rewrite-yaml/src/main/java/org/openrewrite/yaml/CreateYamlFile.java +++ b/rewrite-yaml/src/main/java/org/openrewrite/yaml/CreateYamlFile.java @@ -90,7 +90,7 @@ public TreeVisitor getVisitor(AtomicBoolean created) { Path path = Paths.get(relativeFileName); return new YamlVisitor() { @Override - public Yaml visitDocuments(Yaml.Documents documents, ExecutionContext executionContext) { + public Yaml visitDocuments(Yaml.Documents documents, ExecutionContext ctx) { if ((created.get() || Boolean.TRUE.equals(overwriteExisting)) && path.equals(documents.getSourcePath())) { if (StringUtils.isBlank(fileContents)) { return documents.withDocuments(emptyList()); diff --git a/rewrite-yaml/src/main/java/org/openrewrite/yaml/DeleteKey.java b/rewrite-yaml/src/main/java/org/openrewrite/yaml/DeleteKey.java index 3a25bdda7fa..5134a196b19 100644 --- a/rewrite-yaml/src/main/java/org/openrewrite/yaml/DeleteKey.java +++ b/rewrite-yaml/src/main/java/org/openrewrite/yaml/DeleteKey.java @@ -46,12 +46,12 @@ public TreeVisitor getVisitor() { JsonPathMatcher matcher = new JsonPathMatcher(keyPath); return new YamlIsoVisitor() { @Override - public Yaml.Sequence.Entry visitSequenceEntry(Yaml.Sequence.Entry entry, ExecutionContext executionContext) { + public Yaml.Sequence.Entry visitSequenceEntry(Yaml.Sequence.Entry entry, ExecutionContext ctx) { if (matcher.matches(getCursor()) || matcher.matches(new Cursor(getCursor(), entry.getBlock()))) { //noinspection ConstantConditions return null; } - return super.visitSequenceEntry(entry, executionContext); + return super.visitSequenceEntry(entry, ctx); } @Override diff --git a/rewrite-yaml/src/main/java/org/openrewrite/yaml/DeleteProperty.java b/rewrite-yaml/src/main/java/org/openrewrite/yaml/DeleteProperty.java index 2060a8a69fb..427f59cefff 100755 --- a/rewrite-yaml/src/main/java/org/openrewrite/yaml/DeleteProperty.java +++ b/rewrite-yaml/src/main/java/org/openrewrite/yaml/DeleteProperty.java @@ -74,12 +74,12 @@ public TreeVisitor getVisitor() { return new YamlIsoVisitor() { @Override - public Yaml.Documents visitDocuments(Yaml.Documents documents, ExecutionContext executionContext) { + public Yaml.Documents visitDocuments(Yaml.Documents documents, ExecutionContext ctx) { // TODO: Update DeleteProperty to support documents having Anchor / Alias Pairs - if (documents != new ReplaceAliasWithAnchorValueVisitor().visit(documents, executionContext)) { + if (documents != new ReplaceAliasWithAnchorValueVisitor().visit(documents, ctx)) { return documents; } - return super.visitDocuments(documents, executionContext); + return super.visitDocuments(documents, ctx); } @Override diff --git a/rewrite-yaml/src/test/java/org/openrewrite/yaml/CopyValueTest.java b/rewrite-yaml/src/test/java/org/openrewrite/yaml/CopyValueTest.java index 7b1f8ee9402..4c095711bf2 100644 --- a/rewrite-yaml/src/test/java/org/openrewrite/yaml/CopyValueTest.java +++ b/rewrite-yaml/src/test/java/org/openrewrite/yaml/CopyValueTest.java @@ -91,7 +91,7 @@ void changeOnlyMatchingFile() { spec -> spec.recipe( toRecipe(() -> Preconditions.check(new FindSourceFiles("**/a.yml"), new YamlIsoVisitor<>() { @Override - public Yaml.Documents visitDocuments(Yaml.Documents documents, ExecutionContext executionContext) { + public Yaml.Documents visitDocuments(Yaml.Documents documents, ExecutionContext ctx) { doAfterVisit(new CopyValue(".source", ".destination").getVisitor()); return documents; }