Skip to content

Conversation

greg-at-moderne
Copy link
Contributor

What's changed?

What's your motivation?

Anything in particular you'd like reviewers to focus on?

Anyone you would like to review specifically?

Have you considered any alternatives or workarounds?

Any additional context

Checklist

  • I've added unit tests to cover both positive and negative cases
  • I've read and applied the recipe conventions and best practices
  • I've used the IntelliJ IDEA auto-formatter on affected files

@greg-at-moderne greg-at-moderne self-assigned this Jul 23, 2025
@github-project-automation github-project-automation bot moved this to In Progress in OpenRewrite Jul 23, 2025
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Some suggestions could not be made:

  • src/main/java/org/openrewrite/staticanalysis/UseDiamondOperator.java
    • lines 276-277
    • lines 290-292
    • lines 309-309

Comment on lines +67 to +69
public @Nullable J postVisit(@NonNull J tree, ExecutionContext executionContext) {
J ret = super.postVisit(tree, executionContext);
if (getCursor().pollMessage("PREFER_EARLY_RETURN") != null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
public @Nullable J postVisit(@NonNull J tree, ExecutionContext executionContext) {
J ret = super.postVisit(tree, executionContext);
if (getCursor().pollMessage("PREFER_EARLY_RETURN") != null) {
public @Nullable J postVisit(@NonNull J tree, ExecutionContext ctx) {
J ret = super.postVisit(tree, ctx);
ret = (J) new UnwrapElseAfterReturn().getVisitor().visit(ret, ctx, getCursor().getParent());

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

1 participant