Skip to content

Conversation

timtebeek
Copy link
Member

@timtebeek timtebeek self-assigned this May 31, 2025
@timtebeek timtebeek added the bug Something isn't working label May 31, 2025
@github-project-automation github-project-automation bot moved this to In Progress in OpenRewrite May 31, 2025
Comment on lines +367 to +368
public B.@Nullable C bar() {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not quite happy with this extra newline & double space yet, which are part of moving the annotation after it was added.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this should be fixed upstream, so we'll leave this here for now.

// auto format should handle this, but evidently doesn't
if (at.getAnnotations().isEmpty() && !(getCursor().getParentTreeCursor().getValue() instanceof J.MethodDeclaration)) {
at = at.withTypeExpression(te.withPrefix(te.getPrefix().withWhitespace("")));
}
at = autoFormat(at, at.getTypeExpression(), ctx, getCursor().getParentOrThrow());

@timtebeek timtebeek marked this pull request as ready for review May 31, 2025 14:59
@timtebeek timtebeek moved this from In Progress to Ready to Review in OpenRewrite May 31, 2025
@timtebeek timtebeek merged commit 1d9b54a into main May 31, 2025
2 checks passed
@timtebeek timtebeek deleted the handle-nested-types-in-AnnotateNullableMethods branch May 31, 2025 15:12
@github-project-automation github-project-automation bot moved this from Ready to Review to Done in OpenRewrite May 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

1 participant