Skip to content

Commit

Permalink
Pass parent cursor into .visit() calls
Browse files Browse the repository at this point in the history
  • Loading branch information
timtebeek committed Oct 14, 2024
1 parent 233d6f1 commit 7560861
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public J.ClassDeclaration visitClassDeclaration(J.ClassDeclaration classDecl, Ex
J.Identifier ident = new J.Identifier(Tree.randomId(), Space.format(" "), Markers.EMPTY, emptyList(),
"SmartInstantiationAwareBeanPostProcessor", JavaType.buildType(toImplementsFqn), null);
J.Block body = cd.getBody();
cd = maybeAutoFormat(cd, cd.withBody(cd.getBody().withStatements(emptyList())).withImplements(ListUtils.concat(cd.getImplements(), ident)), ctx, getCursor());
cd = maybeAutoFormat(cd, cd.withBody(cd.getBody().withStatements(emptyList())).withImplements(ListUtils.concat(cd.getImplements(), ident)), ctx, getCursor().getParentOrThrow());
cd = cd.withBody(body);
}
return cd;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ void migrateInterface() {
java(
"""
import org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessorAdapter;
class A extends InstantiationAwareBeanPostProcessorAdapter {
}
""",
"""
import org.springframework.beans.factory.config.SmartInstantiationAwareBeanPostProcessor;
class A implements SmartInstantiationAwareBeanPostProcessor {
}
"""
Expand Down

0 comments on commit 7560861

Please sign in to comment.