mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2025-09-09 10:19:41 +02:00
Add checkstyle rule for StringBuilder.append(char)
And replace all instances where String.Builder.append() is called with a String of length one with append(char). Also adds StringUtils.toStringBuilder(Collection, String).
This commit is contained in:
parent
19ebcb814b
commit
e0e4fd9b12
46 changed files with 159 additions and 142 deletions
|
@ -19,6 +19,18 @@
|
|||
<property name="format" value="MXParser"/>
|
||||
<property name="message" value="Must not use MXParser, use XmlPullParserFactory instead"/>
|
||||
</module>
|
||||
<module name="RegexpSingleline">
|
||||
<!--
|
||||
Matches StringBuilder.append(String) calls where the
|
||||
argument is a String of length one. Those should be replaced
|
||||
with append(char) for performance reasons.
|
||||
|
||||
TODO: This could be more advanced in order to match also
|
||||
- .append("\u1234")
|
||||
-->
|
||||
<property name="format" value="\.append\("(.|\\.)"\)"/>
|
||||
<property name="message" value="Don't use StringBuilder.append(String) when you can use StringBuilder.append(char). Solution: Replace double quotes of append's argument with single quotes."/>
|
||||
</module>
|
||||
<module name="RegexpSingleline">
|
||||
<property name="format" value="^\s+$"/>
|
||||
<property name="message" value="Line containing only whitespace character(s)"/>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue