Skip to content

Replace ListUtils.map used as a loop with an indexed loop - #319

Merged
timtebeek merged 1 commit into
mainfrom
listutils-map-side-effects
Oct 23, 2026
Merged

timtebeek merged 1 commit into
mainfrom
listutils-map-side-effects

Conversation

@timtebeek

Copy link
Copy Markdown
Member

ParameterizedLogging called ListUtils.map only to build up the message template and discarded the returned list. This replaces it with a plain indexed loop.

openrewrite/rewrite#9369 marks ListUtils with @CheckReturnValue, so IntelliJ will flag a discarded ListUtils.map result. There is no behaviour change here.

ParameterizedLoggingTest and the two slf4j *ToParameterizedLoggingTest classes pass.

@github-project-automation github-project-automation Bot moved this to In Progress in OpenRewrite Oct 23, 2026
@timtebeek
timtebeek merged commit ba2b4b9 into main Oct 23, 2026
2 checks passed
@timtebeek
timtebeek deleted the listutils-map-side-effects branch October 23, 2026 14:53
@github-project-automation github-project-automation Bot moved this from In Progress to Done in OpenRewrite Oct 23, 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