You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by gi...@git.apache.org on 2017/05/18 21:13:46 UTC

[GitHub] fmaximus commented on a change in pull request #1597: added constant for magic code

fmaximus commented on a change in pull request #1597: added constant for magic code
URL: https://github.com/apache/cloudstack/pull/1597#discussion_r117355593
 
 

 ##########
 File path: services/console-proxy/server/src/com/cloud/consoleproxy/ConsoleProxyHttpHandlerHelper.java
 ##########
 @@ -22,21 +22,22 @@
 import com.cloud.consoleproxy.util.Logger;
 
 public class ConsoleProxyHttpHandlerHelper {
-    private static final Logger s_logger = Logger.getLogger(ConsoleProxyHttpHandlerHelper.class);
-
+-    private static final Logger s_logger = Logger.getLogger(ConsoleProxyHttpHandlerHelper.class);
+-    private static final String EQUALS = "=";
+	
     public static Map<String, String> getQueryMap(String query) {
         String[] params = query.split("&");
         Map<String, String> map = new HashMap<String, String>();
         for (String param : params) {
-            String[] paramTokens = param.split("=");
+            String[] paramTokens = param.split(EQUALS);
             if (paramTokens != null && paramTokens.length == 2) {
-                String name = param.split("=")[0];
-                String value = param.split("=")[1];
+                String name = param.split(EQUALS)[0];
+                String value = param.split(EQUALS)[1];
 
 Review comment:
   Could be also simplified to paramTokens[1]
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services