From a6927038d1bdc09fa7481addef1c7f1bf74a086f Mon Sep 17 00:00:00 2001 From: aboyko Date: Fri, 28 Jul 2023 14:43:26 -0400 Subject: [PATCH] Adopt latest rewrite-spring --- .../java/rewrite/reconcile/HttpSecurityLamdaDslCodeAction.java | 3 ++- .../reconcile/ServerHttpSecurityLambdaDslCodeAction.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/rewrite/reconcile/HttpSecurityLamdaDslCodeAction.java b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/rewrite/reconcile/HttpSecurityLamdaDslCodeAction.java index 14003b4b0..11b3a7930 100644 --- a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/rewrite/reconcile/HttpSecurityLamdaDslCodeAction.java +++ b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/rewrite/reconcile/HttpSecurityLamdaDslCodeAction.java @@ -16,6 +16,7 @@ import org.openrewrite.ExecutionContext; import org.openrewrite.SourceFile; import org.openrewrite.Tree; import org.openrewrite.java.JavaVisitor; +import org.openrewrite.java.spring.boot2.ConvertToSecurityDslVisitor; import org.openrewrite.java.spring.boot2.HttpSecurityLambdaDsl; import org.openrewrite.java.tree.J.MethodInvocation; import org.openrewrite.marker.Range; @@ -45,7 +46,7 @@ public class HttpSecurityLamdaDslCodeAction implements RecipeCodeActionDescripto @Override public MethodInvocation visitMethodInvocation(MethodInvocation method, ExecutionContext p) { - if (recipe.getVisitor().isApplicableTopLevelMethodInvocation(method)) { + if (((ConvertToSecurityDslVisitor) recipe.getVisitor()).isApplicableTopLevelMethodInvocation(method)) { // Don't step into the method any further String uri = getCursor().firstEnclosing(SourceFile.class).getSourcePath().toUri().toASCIIString(); FixAssistMarker marker = new FixAssistMarker(Tree.randomId(), getId()).withLabel(PROBLEM_LABEL) diff --git a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/rewrite/reconcile/ServerHttpSecurityLambdaDslCodeAction.java b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/rewrite/reconcile/ServerHttpSecurityLambdaDslCodeAction.java index 31a439e84..ba34d3cc6 100644 --- a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/rewrite/reconcile/ServerHttpSecurityLambdaDslCodeAction.java +++ b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/rewrite/reconcile/ServerHttpSecurityLambdaDslCodeAction.java @@ -16,6 +16,7 @@ import org.openrewrite.ExecutionContext; import org.openrewrite.SourceFile; import org.openrewrite.Tree; import org.openrewrite.java.JavaVisitor; +import org.openrewrite.java.spring.boot2.ConvertToSecurityDslVisitor; import org.openrewrite.java.spring.boot2.ServerHttpSecurityLambdaDsl; import org.openrewrite.java.tree.J.MethodInvocation; import org.openrewrite.marker.Range; @@ -45,7 +46,7 @@ public class ServerHttpSecurityLambdaDslCodeAction implements RecipeCodeActionDe @Override public MethodInvocation visitMethodInvocation(MethodInvocation method, ExecutionContext p) { - if (recipe.getVisitor().isApplicableTopLevelMethodInvocation(method)) { + if (((ConvertToSecurityDslVisitor)recipe.getVisitor()).isApplicableTopLevelMethodInvocation(method)) { // Don't step into the method any further String uri = getCursor().firstEnclosing(SourceFile.class).getSourcePath().toUri().toASCIIString(); FixAssistMarker marker = new FixAssistMarker(Tree.randomId(), getId()).withLabel(PROBLEM_LABEL)