You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@storm.apache.org by GitBox <gi...@apache.org> on 2019/02/06 18:08:36 UTC

[GitHub] srdo commented on a change in pull request #2950: STORM-3327: Use UTF-8 for URL encoding in storm-webapp

srdo commented on a change in pull request #2950: STORM-3327: Use UTF-8 for URL encoding in storm-webapp
URL: https://github.com/apache/storm/pull/2950#discussion_r254386275
 
 

 ##########
 File path: storm-webapp/src/main/java/org/apache/storm/daemon/ui/UIHelpers.java
 ##########
 @@ -1312,21 +1326,27 @@ private static Double nullToZero(Double value) {
         Map<String, Object> result = new HashMap();
         ExecutorSummary executorSummary = executorAggregateStats.get_exec_summary();
         ExecutorInfo executorInfo = executorSummary.get_executor_info();
-        ComponentAggregateStats componentAggregateStats = executorAggregateStats.get_stats();
-        SpecificAggregateStats specificAggregateStats = componentAggregateStats.get_specific_stats();
-        BoltAggregateStats boltAggregateStats = specificAggregateStats.get_bolt();
-        CommonAggregateStats commonAggregateStats = componentAggregateStats.get_common_stats();
         String executorId = prettyExecutorInfo(executorInfo);
         result.put("id", executorId);
-        result.put("encodedId", URLEncoder.encode(executorId));
+        try {
+            result.put("encodedId", URLEncoder.encode(executorId, StandardCharsets.UTF_8.name()));
+        } catch (UnsupportedEncodingException e) {
+            throw Utils.wrapInRuntime(e);
+        }
         result.put("uptime", prettyUptimeSec(executorSummary.get_uptime_secs()));
         result.put("uptimeSeconds", executorSummary.get_uptime_secs());
         String host = executorSummary.get_host();
         result.put("host", host);
         int port = executorSummary.get_port();
         result.put("port", port);
+        
+        ComponentAggregateStats componentAggregateStats = executorAggregateStats.get_stats();
 
 Review comment:
   Checkstyle started complaining that the variable declarations were too far from first use. 

----------------------------------------------------------------
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