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

 ##########
 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];
 
 Review comment:
   Could be also simplified to paramTokens[0]
 
----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to