Skip to content

Commit

Permalink
Add safe null check for visiting J.TypeParameter's modifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
kunli2 committed Nov 20, 2023
1 parent 4f04066 commit 9965bbf
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1191,7 +1191,11 @@ public J visitTypeParameter(J.TypeParameter typeParam, P p) {
t = t.withPrefix(visitSpace(t.getPrefix(), Space.Location.TYPE_PARAMETERS_PREFIX, p));
t = t.withMarkers(visitMarkers(t.getMarkers(), p));
t = t.withAnnotations(ListUtils.map(t.getAnnotations(), a -> visitAndCast(a, p)));
t = t.withModifiers(ListUtils.map(t.getModifiers(), m -> visitAndCast(m, p)));

if (t.getModifiers() != null && !t.getModifiers().isEmpty()) {
t = t.withModifiers(ListUtils.map(t.getModifiers(), m -> visitAndCast(m, p)));
}

t = t.withName(visitAndCast(t.getName(), p));
if (t.getName() instanceof NameTree) {
t = t.withName((Expression) visitTypeName((NameTree) t.getName(), p));
Expand Down

0 comments on commit 9965bbf

Please sign in to comment.