aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/main/java
diff options
context:
space:
mode:
authorPer-Åke Minborg <minborg@speedment.com>2016-10-28 08:46:30 -0700
committerVaadin Code Review <review@vaadin.com>2016-11-04 13:36:29 +0000
commit888568f27ae538c34a264aeb737bb6dd6b5b9b57 (patch)
treebcbd7e6badd3c10d7bc76cc30b9f95d68701d835 /server/src/main/java
parent0fc0ac038644248b12a2c8d4eed299a7a286d4f8 (diff)
downloadvaadin-framework-888568f27ae538c34a264aeb737bb6dd6b5b9b57.tar.gz
vaadin-framework-888568f27ae538c34a264aeb737bb6dd6b5b9b57.zip
Use chain of .append() methods instead of String concatenation
Change-Id: I80b73b653e97904605dc62484a7448f3bfbf721d
Diffstat (limited to 'server/src/main/java')
-rw-r--r--server/src/main/java/com/vaadin/server/ComponentSizeValidator.java12
-rw-r--r--server/src/main/java/com/vaadin/server/JsonPaintTarget.java4
-rw-r--r--server/src/main/java/com/vaadin/server/communication/PortletBootstrapHandler.java2
3 files changed, 8 insertions, 10 deletions
diff --git a/server/src/main/java/com/vaadin/server/ComponentSizeValidator.java b/server/src/main/java/com/vaadin/server/ComponentSizeValidator.java
index e68fbb5903..7d4de85cfe 100644
--- a/server/src/main/java/com/vaadin/server/ComponentSizeValidator.java
+++ b/server/src/main/java/com/vaadin/server/ComponentSizeValidator.java
@@ -217,7 +217,7 @@ public class ComponentSizeValidator implements Serializable {
Component parent = component.getParent();
String paintableId = component.getConnectorId();
- clientJSON.append("\"id\":\"" + paintableId + "\"");
+ clientJSON.append("\"id\":\"").append(paintableId).append("\"");
if (invalidHeight) {
Stack<ComponentInfo> attributes = null;
@@ -247,7 +247,7 @@ public class ComponentSizeValidator implements Serializable {
attributes = getHeightAttributes(component);
}
printServerError(msg, attributes, false, serverErrorStream);
- clientJSON.append(",\"heightMsg\":\"" + msg + "\"");
+ clientJSON.append(",\"heightMsg\":\"").append(msg).append("\"");
}
if (invalidWidth) {
Stack<ComponentInfo> attributes = null;
@@ -275,7 +275,7 @@ public class ComponentSizeValidator implements Serializable {
msg = "A component with relative width needs a parent with defined width.";
attributes = getWidthAttributes(component);
}
- clientJSON.append(",\"widthMsg\":\"" + msg + "\"");
+ clientJSON.append(",\"widthMsg\":\"").append(msg).append("\"");
printServerError(msg, attributes, true, serverErrorStream);
}
if (subErrors.size() > 0) {
@@ -402,8 +402,7 @@ public class ComponentSizeValidator implements Serializable {
}
if (createLoc != null) {
- err.append(", created at (" + createLoc.file + ":"
- + createLoc.lineNumber + ")");
+ err.append(", created at (").append(createLoc.file).append(":").append(createLoc.lineNumber).append(")");
}
@@ -411,8 +410,7 @@ public class ComponentSizeValidator implements Serializable {
err.append(" (");
err.append(attribute);
if (sizeLoc != null) {
- err.append(", set at (" + sizeLoc.file + ":"
- + sizeLoc.lineNumber + ")");
+ err.append(", set at (").append(sizeLoc.file).append(":").append(sizeLoc.lineNumber).append(")");
}
err.append(")");
diff --git a/server/src/main/java/com/vaadin/server/JsonPaintTarget.java b/server/src/main/java/com/vaadin/server/JsonPaintTarget.java
index 4463fd1ab5..9792673062 100644
--- a/server/src/main/java/com/vaadin/server/JsonPaintTarget.java
+++ b/server/src/main/java/com/vaadin/server/JsonPaintTarget.java
@@ -443,7 +443,7 @@ public class JsonPaintTarget implements PaintTarget {
"Parameters must be non-null strings");
}
final StringBuilder buf = new StringBuilder();
- buf.append("\"" + name + "\":[");
+ buf.append("\"").append(name).append("\":[");
for (int i = 0; i < values.length; i++) {
if (i > 0) {
buf.append(",");
@@ -743,7 +743,7 @@ public class JsonPaintTarget implements PaintTarget {
private boolean tagClosed = false;
public JsonTag(String tagName) {
- data.append("[\"" + tagName + "\"");
+ data.append("[\"").append(tagName).append("\"");
}
private void closeTag() {
diff --git a/server/src/main/java/com/vaadin/server/communication/PortletBootstrapHandler.java b/server/src/main/java/com/vaadin/server/communication/PortletBootstrapHandler.java
index 2b40b6caca..a75e6a810b 100644
--- a/server/src/main/java/com/vaadin/server/communication/PortletBootstrapHandler.java
+++ b/server/src/main/java/com/vaadin/server/communication/PortletBootstrapHandler.java
@@ -78,7 +78,7 @@ public class PortletBootstrapHandler extends BootstrapHandler {
&& !portalTheme.equals(context.getThemeName())) {
String portalThemeUri = getThemeUri(context, portalTheme);
// XSS safe - originates from portal properties
- builder.append("vaadin.loadTheme('" + portalThemeUri + "');");
+ builder.append("vaadin.loadTheme('").append(portalThemeUri).append("');");
}
super.appendMainScriptTagContents(context, builder);