StringBuilderRules
SUGGESTION
Simplification
Suppression
Disable all rules by adding
-XepOpt:Refaster:NamePattern=^(?!StringBuilderRules\$).*as compiler argument.
Table of contents
StringBuilderRepeat
SUGGESTION
Simplification
Suppression
Suppress false positives by adding the suppression annotation
@SuppressWarnings("StringBuilderRepeat")to the enclosing element.Disable this rule by adding
-XepOpt:Refaster:NamePattern=^(?!StringBuilderRules\$StringBuilderRepeat).*as compiler argument.
Samples
Shows the difference in example code before and after the Refaster rule is applied.
StringBuilder testStringBuilderRepeat() {
- return new StringBuilder().append("foo".repeat(1));
+ return new StringBuilder().repeat("foo", 1);
}