Skip to content

Remove ignored getter calls in NewStringBuilderBufferWithCharArgument and UnnecessaryThrows - #1081

Merged
timtebeek merged 1 commit into
mainfrom
tim/fix-ignored-return-values
Oct 4, 2026
Merged

timtebeek merged 1 commit into
mainfrom
tim/fix-ignored-return-values

Conversation

@timtebeek

Copy link
Copy Markdown
Member

What's changed?

Drop two stray statements whose results were discarded: nc.getArguments(); in NewStringBuilderBufferWithCharArgument and baseMethod.getThrownExceptions(); in UnnecessaryThrows. In both cases the next line calls the same getter again and uses the result.

What's your motivation?

org.openrewrite.java.tree is annotated @CheckReturnValue, so both are flagged as ignored results. Found with a work-in-progress FindIgnoredCheckReturnValue search recipe. No behavior change.

@github-project-automation github-project-automation Bot moved this to In Progress in OpenRewrite Oct 4, 2026
@timtebeek
timtebeek marked this pull request as ready for review October 4, 2026 20:11
@timtebeek
timtebeek merged commit 0659287 into main Oct 4, 2026
1 check passed
@timtebeek
timtebeek deleted the tim/fix-ignored-return-values branch October 4, 2026 20:11
@github-project-automation github-project-automation Bot moved this from In Progress to Done in OpenRewrite Oct 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

1 participant