Skip to content

Commit

Permalink
Align SpacesVisitor#postVisit() with other formatting visitors
Browse files Browse the repository at this point in the history
Using the root cursor is typically a bad idea, as it is globally shared in a recipe run.
  • Loading branch information
knutwannheden committed Nov 13, 2023
1 parent eb9cdda commit 42ebe52
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1076,7 +1076,7 @@ public J.TypeParameter visitTypeParameter(J.TypeParameter typeParam, P p) {
@Override
public J postVisit(J tree, P p) {
if (stopAfter != null && stopAfter.isScope(tree)) {
getCursor().getRoot().putMessage("stop", true);
getCursor().putMessageOnFirstEnclosing(JavaSourceFile.class, "stop", true);
}
return super.postVisit(tree, p);
}
Expand Down

0 comments on commit 42ebe52

Please sign in to comment.