Remove the use of + when using StringBuilder (1 of 2)
Change-Id: I010b487de26c5a16b3dfda41130d7ea91b1587e8
This commit is contained in:
@@ -66,7 +66,7 @@ public class ParameterizedString {
|
|||||||
// "${parameter[.functions...]}" -> "parameter[.functions...]"
|
// "${parameter[.functions...]}" -> "parameter[.functions...]"
|
||||||
final Parameter p = new Parameter(pattern.substring(b + 2, e));
|
final Parameter p = new Parameter(pattern.substring(b + 2, e));
|
||||||
|
|
||||||
raw.append("{" + prs.size() + "}");
|
raw.append("{").append(prs.size()).append("}");
|
||||||
prs.add(p);
|
prs.add(p);
|
||||||
ops.add(p);
|
ops.add(p);
|
||||||
|
|
||||||
|
@@ -48,7 +48,8 @@ public class ServerPlannedIFrameLinker extends AbstractLinker {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (CompilationResult r : artifacts.find(CompilationResult.class)) {
|
for (CompilationResult r : artifacts.find(CompilationResult.class)) {
|
||||||
table.append(r.getStrongName() + "\n");
|
table.append(r.getStrongName());
|
||||||
|
table.append("\n");
|
||||||
for (SortedMap<SelectionProperty, String> p : r.getPropertyMap()) {
|
for (SortedMap<SelectionProperty, String> p : r.getPropertyMap()) {
|
||||||
for (Map.Entry<SelectionProperty, String> e : p.entrySet()) {
|
for (Map.Entry<SelectionProperty, String> e : p.entrySet()) {
|
||||||
table.append(" ");
|
table.append(" ");
|
||||||
|
@@ -100,8 +100,8 @@ public class Permutation {
|
|||||||
// Prevents mixed mode security in IE6/7.
|
// Prevents mixed mode security in IE6/7.
|
||||||
s.append("f.src=\"javascript:''\";");
|
s.append("f.src=\"javascript:''\";");
|
||||||
s.append("f.id=n;");
|
s.append("f.id=n;");
|
||||||
s.append("f.style.cssText"
|
s.append("f.style.cssText)")
|
||||||
+ "='position:absolute;width:0;height:0;border:none';");
|
.append("='position:absolute;width:0;height:0;border:none';");
|
||||||
s.append("f.tabIndex=-1;");
|
s.append("f.tabIndex=-1;");
|
||||||
s.append("d.body.appendChild(f);");
|
s.append("d.body.appendChild(f);");
|
||||||
|
|
||||||
|
@@ -169,7 +169,7 @@ class ProjectBasicAuthFilter implements Filter {
|
|||||||
if (sc == SC_UNAUTHORIZED) {
|
if (sc == SC_UNAUTHORIZED) {
|
||||||
StringBuilder v = new StringBuilder();
|
StringBuilder v = new StringBuilder();
|
||||||
v.append(LIT_BASIC);
|
v.append(LIT_BASIC);
|
||||||
v.append("realm=\"" + REALM_NAME + "\"");
|
v.append("realm=\"").append(REALM_NAME).append("\"");
|
||||||
setHeader(WWW_AUTHENTICATE, v.toString());
|
setHeader(WWW_AUTHENTICATE, v.toString());
|
||||||
} else if (containsHeader(WWW_AUTHENTICATE)) {
|
} else if (containsHeader(WWW_AUTHENTICATE)) {
|
||||||
setHeader(WWW_AUTHENTICATE, null);
|
setHeader(WWW_AUTHENTICATE, null);
|
||||||
|
@@ -293,7 +293,7 @@ class ProjectDigestFilter implements Filter {
|
|||||||
if (sc == SC_UNAUTHORIZED) {
|
if (sc == SC_UNAUTHORIZED) {
|
||||||
StringBuilder v = new StringBuilder();
|
StringBuilder v = new StringBuilder();
|
||||||
v.append("Digest");
|
v.append("Digest");
|
||||||
v.append(" realm=\"" + REALM_NAME + "\"");
|
v.append(" realm=\"").append(REALM_NAME).append("\"");
|
||||||
|
|
||||||
String url = urlProvider.get();
|
String url = urlProvider.get();
|
||||||
if (url == null) {
|
if (url == null) {
|
||||||
@@ -303,14 +303,14 @@ class ProjectDigestFilter implements Filter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (url != null && !url.isEmpty()) {
|
if (url != null && !url.isEmpty()) {
|
||||||
v.append(", domain=\"" + url + "\"");
|
v.append(", domain=\"").append(url).append("\"");
|
||||||
}
|
}
|
||||||
|
|
||||||
v.append(", qop=\"auth\"");
|
v.append(", qop=\"auth\"");
|
||||||
if (stale != null) {
|
if (stale != null) {
|
||||||
v.append(", stale=" + stale);
|
v.append(", stale=").append(stale);
|
||||||
}
|
}
|
||||||
v.append(", nonce=\"" + newNonce() + "\"");
|
v.append(", nonce=\"").append(newNonce()).append("\"");
|
||||||
setHeader(WWW_AUTHENTICATE, v.toString());
|
setHeader(WWW_AUTHENTICATE, v.toString());
|
||||||
|
|
||||||
} else if (containsHeader(WWW_AUTHENTICATE)) {
|
} else if (containsHeader(WWW_AUTHENTICATE)) {
|
||||||
|
@@ -323,7 +323,7 @@ class HttpPluginServlet extends HttpServlet
|
|||||||
String sectionTitle, StringBuilder md, String prefix,
|
String sectionTitle, StringBuilder md, String prefix,
|
||||||
int nameOffset) throws IOException {
|
int nameOffset) throws IOException {
|
||||||
if (!entries.isEmpty()) {
|
if (!entries.isEmpty()) {
|
||||||
md.append("## " + sectionTitle + " ##\n");
|
md.append("## ").append(sectionTitle).append(" ##\n");
|
||||||
for(JarEntry entry : entries) {
|
for(JarEntry entry : entries) {
|
||||||
String rsrc = entry.getName().substring(prefix.length());
|
String rsrc = entry.getName().substring(prefix.length());
|
||||||
String entryTitle;
|
String entryTitle;
|
||||||
|
@@ -43,7 +43,7 @@ class XrdsServlet extends HttpServlet {
|
|||||||
protected void doGet(HttpServletRequest req, HttpServletResponse rsp)
|
protected void doGet(HttpServletRequest req, HttpServletResponse rsp)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
final StringBuilder r = new StringBuilder();
|
final StringBuilder r = new StringBuilder();
|
||||||
r.append("<?xml version=\"1.0\" encoding=\"" + ENC + "\"?>");
|
r.append("<?xml version=\"1.0\" encoding=\"").append(ENC).append("\"?>");
|
||||||
r.append("<xrds:XRDS");
|
r.append("<xrds:XRDS");
|
||||||
r.append(" xmlns:xrds=\"xri://$xrds\"");
|
r.append(" xmlns:xrds=\"xri://$xrds\"");
|
||||||
r.append(" xmlns:openid=\"http://openid.net/xmlns/1.0\"");
|
r.append(" xmlns:openid=\"http://openid.net/xmlns/1.0\"");
|
||||||
@@ -51,7 +51,8 @@ class XrdsServlet extends HttpServlet {
|
|||||||
r.append("<XRD>");
|
r.append("<XRD>");
|
||||||
r.append("<Service priority=\"1\">");
|
r.append("<Service priority=\"1\">");
|
||||||
r.append("<Type>http://specs.openid.net/auth/2.0/return_to</Type>");
|
r.append("<Type>http://specs.openid.net/auth/2.0/return_to</Type>");
|
||||||
r.append("<URI>" + url.get() + OpenIdServiceImpl.RETURN_URL + "</URI>");
|
r.append("<URI>").append(url.get()).append(OpenIdServiceImpl.RETURN_URL)
|
||||||
|
.append("</URI>");
|
||||||
r.append("</Service>");
|
r.append("</Service>");
|
||||||
r.append("</XRD>");
|
r.append("</XRD>");
|
||||||
r.append("</xrds:XRDS>");
|
r.append("</xrds:XRDS>");
|
||||||
|
@@ -323,10 +323,11 @@ public class ChangeUtil {
|
|||||||
ChangeMessage cmsg = new ChangeMessage(
|
ChangeMessage cmsg = new ChangeMessage(
|
||||||
new ChangeMessage.Key(changeId, messageUUID(db.get())),
|
new ChangeMessage.Key(changeId, messageUUID(db.get())),
|
||||||
user().getAccountId(), TimeUtil.nowTs(), patchSetId);
|
user().getAccountId(), TimeUtil.nowTs(), patchSetId);
|
||||||
StringBuilder msgBuf =
|
StringBuilder msgBuf = new StringBuilder();
|
||||||
new StringBuilder("Patch Set " + patchSetId.get() + ": Reverted");
|
msgBuf.append("Patch Set ").append(patchSetId.get()).append(": Reverted");
|
||||||
msgBuf.append("\n\n");
|
msgBuf.append("\n\n");
|
||||||
msgBuf.append("This patchset was reverted in change: " + change.getKey().get());
|
msgBuf.append("This patchset was reverted in change: ")
|
||||||
|
.append(change.getKey().get());
|
||||||
cmsg.setMessage(msgBuf.toString());
|
cmsg.setMessage(msgBuf.toString());
|
||||||
|
|
||||||
ins.setMessage(cmsg).insert();
|
ins.setMessage(cmsg).insert();
|
||||||
|
@@ -252,12 +252,12 @@ public class CherryPickChange {
|
|||||||
new ChangeMessage.Key(
|
new ChangeMessage.Key(
|
||||||
patchSetId.getParentKey(), ChangeUtil.messageUUID(db)),
|
patchSetId.getParentKey(), ChangeUtil.messageUUID(db)),
|
||||||
currentUser.getAccountId(), TimeUtil.nowTs(), patchSetId);
|
currentUser.getAccountId(), TimeUtil.nowTs(), patchSetId);
|
||||||
StringBuilder msgBuf =
|
StringBuilder msgBuf = new StringBuilder();
|
||||||
new StringBuilder("Patch Set " + patchSetId.get()
|
msgBuf.append("Patch Set ").append(patchSetId.get())
|
||||||
+ ": Cherry Picked");
|
.append(": Cherry Picked");
|
||||||
msgBuf.append("\n\n");
|
msgBuf.append("\n\n");
|
||||||
msgBuf.append("This patchset was cherry picked to change: "
|
msgBuf.append("This patchset was cherry picked to change: ")
|
||||||
+ dest.getKey().get());
|
.append(dest.getKey().get());
|
||||||
cmsg.setMessage(msgBuf.toString());
|
cmsg.setMessage(msgBuf.toString());
|
||||||
return cmsg;
|
return cmsg;
|
||||||
}
|
}
|
||||||
|
@@ -268,17 +268,18 @@ public class Submit implements RestModifyView<RevisionResource, SubmitInput>,
|
|||||||
|
|
||||||
case REJECT:
|
case REJECT:
|
||||||
if (msg.length() > 0) msg.append("; ");
|
if (msg.length() > 0) msg.append("; ");
|
||||||
msg.append("blocked by " + lbl.label);
|
msg.append("blocked by ").append(lbl.label);
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
case NEED:
|
case NEED:
|
||||||
if (msg.length() > 0) msg.append("; ");
|
if (msg.length() > 0) msg.append("; ");
|
||||||
msg.append("needs " + lbl.label);
|
msg.append("needs ").append(lbl.label);
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
case IMPOSSIBLE:
|
case IMPOSSIBLE:
|
||||||
if (msg.length() > 0) msg.append("; ");
|
if (msg.length() > 0) msg.append("; ");
|
||||||
msg.append("needs " + lbl.label + " (check project access)");
|
msg.append("needs ").append(lbl.label)
|
||||||
|
.append(" (check project access)");
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@@ -750,8 +750,7 @@ public class MergeOp {
|
|||||||
// dependencies.
|
// dependencies.
|
||||||
//
|
//
|
||||||
StringBuilder m = new StringBuilder();
|
StringBuilder m = new StringBuilder();
|
||||||
m.append("Change cannot be merged due"
|
m.append("Change cannot be merged due to unsatisfiable dependencies.\n");
|
||||||
+ " to unsatisfiable dependencies.\n");
|
|
||||||
m.append("\n");
|
m.append("\n");
|
||||||
m.append("The following dependency errors were found:\n");
|
m.append("The following dependency errors were found:\n");
|
||||||
m.append("\n");
|
m.append("\n");
|
||||||
|
@@ -271,7 +271,7 @@ public class SubmoduleOp {
|
|||||||
|
|
||||||
msgbuf.append("\nProject: ");
|
msgbuf.append("\nProject: ");
|
||||||
msgbuf.append(me.getKey().getParentKey().get());
|
msgbuf.append(me.getKey().getParentKey().get());
|
||||||
msgbuf.append(" " + me.getValue().getName());
|
msgbuf.append(" ").append(me.getValue().getName());
|
||||||
msgbuf.append("\n");
|
msgbuf.append("\n");
|
||||||
if (modules.size() == 1 && msg != null) {
|
if (modules.size() == 1 && msg != null) {
|
||||||
msgbuf.append(msg);
|
msgbuf.append(msg);
|
||||||
|
Reference in New Issue
Block a user