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 abfd1c6 commit dff5070
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 @@ -63,7 +63,7 @@ public J.ClassDeclaration visitClassDeclaration(J.ClassDeclaration classDecl, P

if (!c.getPadding().getKind().getPrefix().isEmpty()) {
c = concatenatePrefix(c, c.getPadding().getKind().getPrefix());
c = c.getAnnotations().withKind(c.getPadding().getKind().withPrefix(Space.EMPTY));
c = c.getPadding().withKind(c.getPadding().getKind().withPrefix(Space.EMPTY));
return c;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ public J.ClassDeclaration visitClassDeclaration(J.ClassDeclaration classDecl, P
if (!k.getPrefix().getWhitespace().contains("\n")) {
k = k.withPrefix(withNewline(k.getPrefix()));
}
c = c.getAnnotations().withKind(k);
c = c.getPadding().withKind(k);
}

if (!c.getLeadingAnnotations().isEmpty()) {
Expand All @@ -207,7 +207,7 @@ public J.ClassDeclaration visitClassDeclaration(J.ClassDeclaration classDecl, P
Space kindPrefix = kind.getPrefix();
if (!kindPrefix.getWhitespace().contains("\n") && kindPrefix.getComments().isEmpty()) {
kindPrefix = kindPrefix.withWhitespace("\n" + kindPrefix.getWhitespace());
c = c.getAnnotations().withKind(kind.withPrefix(kindPrefix));
c = c.getPadding().withKind(kind.withPrefix(kindPrefix));
}
}
}
Expand Down

0 comments on commit dff5070

Please sign in to comment.