Skip to content

Commit

Permalink
Remove uses of J.ClassDeclaration#getAnnotations()
Browse files Browse the repository at this point in the history
This is also covered by `J.ClassDeclaration#getPadding()`
  • Loading branch information
knutwannheden committed May 7, 2024
1 parent bb0aadd commit 1ed9c44
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public J.ClassDeclaration visitClassDeclaration(J.ClassDeclaration classDecl, Ex
// Temporary work around until issue https://github.com/openrewrite/rewrite/issues/2348 is implemented.
if (!cd.getLeadingAnnotations().isEmpty()) {
// Setting the prefix to empty will cause the `Spaces` visitor to fix the formatting.
cd = cd.getAnnotations().withKind(cd.getAnnotations().getKind().withPrefix(Space.EMPTY));
cd = cd.getPadding().withKind(cd.getPadding().getKind().withPrefix(Space.EMPTY));
}

assert getCursor().getParent() != null;
Expand Down

0 comments on commit 1ed9c44

Please sign in to comment.