GUACAMOLE-38: Use StringBuilder to gather up name.

Project: http://git-wip-us.apache.org/repos/asf/guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/guacamole-client/commit/d4b7e2b8
Tree: http://git-wip-us.apache.org/repos/asf/guacamole-client/tree/d4b7e2b8
Diff: http://git-wip-us.apache.org/repos/asf/guacamole-client/diff/d4b7e2b8

Branch: refs/heads/staging/1.0.0
Commit: d4b7e2b8b608eaa8ad8e5a21eed8cd3bd92964e7
Parents: cf241f0
Author: Nick Couchman <vn...@apache.org>
Authored: Thu Apr 19 05:30:51 2018 -0400
Committer: Nick Couchman <vn...@apache.org>
Committed: Fri Jun 1 13:40:52 2018 -0400

----------------------------------------------------------------------
 .../auth/quickconnect/utility/QCParser.java          | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/guacamole-client/blob/d4b7e2b8/extensions/guacamole-auth-quickconnect/src/main/java/org/apache/guacamole/auth/quickconnect/utility/QCParser.java
----------------------------------------------------------------------
diff --git 
a/extensions/guacamole-auth-quickconnect/src/main/java/org/apache/guacamole/auth/quickconnect/utility/QCParser.java
 
b/extensions/guacamole-auth-quickconnect/src/main/java/org/apache/guacamole/auth/quickconnect/utility/QCParser.java
index ba6e3fd..7d5d7d4 100644
--- 
a/extensions/guacamole-auth-quickconnect/src/main/java/org/apache/guacamole/auth/quickconnect/utility/QCParser.java
+++ 
b/extensions/guacamole-auth-quickconnect/src/main/java/org/apache/guacamole/auth/quickconnect/utility/QCParser.java
@@ -19,6 +19,7 @@
 
 package org.apache.guacamole.auth.quickconnect.utility;
 
+import java.lang.StringBuilder;
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.util.Arrays;
@@ -164,23 +165,23 @@ public class QCParser {
         String port = config.getParameter("port");
         String user = config.getParameter("username");
 
-        String name = "";
+        StringBuilder name = new StringBuilder("");
 
         if (protocol != null && !protocol.isEmpty())
-            name += protocol + "://";
+            name.append(protocol).append("://");
 
         if (user != null && !user.isEmpty())
-            name += user + "@";
+            name.append(user).append("@");
 
         if (host != null && !host.isEmpty())
-            name += host;
+            name.append(host);
 
         if (port != null && !port.isEmpty())
-            name += ":" + port;
+            name.append(":").append(port);
 
-        name += "/";
+        name.append("/");
 
-        return name;
+        return name.toString();
     }
 
 }

Reply via email to