diff options
author | Anna Koskinen <Ansku@users.noreply.github.com> | 2020-04-24 13:15:59 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-24 13:15:59 +0300 |
commit | 03a71b4506632359766a6483c30ddad6e082128a (patch) | |
tree | 43cb38fbfd8e5199f02e2feffd58cf6f8009dba5 | |
parent | 59619cf102fa04e78a7636a2a9237914b53a2b0b (diff) | |
download | vaadin-framework-03a71b4506632359766a6483c30ddad6e082128a.tar.gz vaadin-framework-03a71b4506632359766a6483c30ddad6e082128a.zip |
Change to using StringBuilder (#11941) (#11962)
* Change to using StringBuilder (#11941)
Should use a StringBuilder to accumulate strings in a loop, to avoid the performance cost of repeatedly constructing strings.
-rw-r--r-- | server/src/main/java/com/vaadin/ui/declarative/Design.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/server/src/main/java/com/vaadin/ui/declarative/Design.java b/server/src/main/java/com/vaadin/ui/declarative/Design.java index 0b78a9cbde..a2c698c6bd 100644 --- a/server/src/main/java/com/vaadin/ui/declarative/Design.java +++ b/server/src/main/java/com/vaadin/ui/declarative/Design.java @@ -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; |