Browse Source

Change to using StringBuilder (#11941)

Should use a StringBuilder to accumulate strings in a loop, to avoid the performance cost of repeatedly constructing strings.
tags/8.11.0.alpha1
Hk-tang 4 years ago
parent
commit
f6a9a9ad48
No account linked to committer's email address
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      server/src/main/java/com/vaadin/ui/declarative/Design.java

+ 2
- 2
server/src/main/java/com/vaadin/ui/declarative/Design.java View File

@@ -234,14 +234,14 @@ public class Design implements Serializable {
throw new DesignException("Unknown tag: " + tagName);
}
String[] classNameParts = parts[1].split("-");
String className = "";
StringBuilder className = new StringBuilder();
for (String classNamePart : classNameParts) {
// Split will ignore trailing and multiple dashes but that
// should be
// ok
// <vaadin-button--> will be resolved to <vaadin-button>
// <vaadin--button> will be resolved to <vaadin-button>
className += SharedUtil.capitalize(classNamePart);
className.append(SharedUtil.capitalize(classNamePart));
}
String qualifiedClassName = packageName + "." + className;


Loading…
Cancel
Save