StringBuffer
and StringBuilder
constructors with char
as the argument.
In this case, char
is silently cast to an integer and interpreted as the initial capacity of the buffer.
This can be fixed by replacing char
with a string literal.
Example:
new StringBuilder('(').append("1").append(')');
After the quick-fix is applied:
new StringBuilder("(").append("1").append(')');