1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2025-12-16 18:11:08 +01: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:
Florian Schmaus 2015-07-21 08:19:15 +02:00
parent 19ebcb814b
commit e0e4fd9b12
46 changed files with 159 additions and 142 deletions

View file

@ -80,11 +80,11 @@ public class OfflineMessageInfo implements ExtensionElement {
public String toXML() {
StringBuilder buf = new StringBuilder();
buf.append("<").append(getElementName()).append(" xmlns=\"").append(getNamespace()).append(
buf.append('<').append(getElementName()).append(" xmlns=\"").append(getNamespace()).append(
"\">");
if (getNode() != null)
buf.append("<item node=\"").append(getNode()).append("\"/>");
buf.append("</").append(getElementName()).append(">");
buf.append("</").append(getElementName()).append('>');
return buf.toString();
}

View file

@ -182,13 +182,13 @@ public class OfflineMessageRequest extends IQ {
StringBuilder buf = new StringBuilder();
buf.append("<item");
if (getAction() != null) {
buf.append(" action=\"").append(getAction()).append("\"");
buf.append(" action=\"").append(getAction()).append('"');
}
if (getJid() != null) {
buf.append(" jid=\"").append(getJid()).append("\"");
buf.append(" jid=\"").append(getJid()).append('"');
}
if (getNode() != null) {
buf.append(" node=\"").append(getNode()).append("\"");
buf.append(" node=\"").append(getNode()).append('"');
}
buf.append("/>");
return buf.toString();