-
Notifications
You must be signed in to change notification settings - Fork 89
PreferEarlyReturn recipe #656
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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
| public @Nullable J postVisit(@NonNull J tree, ExecutionContext executionContext) { | ||
| J ret = super.postVisit(tree, executionContext); | ||
| if (getCursor().pollMessage("PREFER_EARLY_RETURN") != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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()); |
|
This PR is stale because it has been open for 90 days with no activity. Remove |
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