palantir / gradle-baseline

A set of Gradle plugins that configure default code quality tools for developers.
Apache License 2.0
299 stars 135 forks source link

bug in StringBuilderConstantParameters fixer #2812

Open nakulj opened 3 months ago

nakulj commented 3 months ago

What happened?

Correctly spots a StringBuilderConstantParameters here, but suggests an incorrect fix:

new StringBuilder(foo)
  .append("_")
  .append(bar)
  .toString()
  .toLowerCase();

Suggestion:

foo + "_" + bar.toLowerCase();

What did you want to happen?

(foo + "_" + bar).toLowerCase();