HeartSaVioR commented on a change in pull request #2997: [STORM-3380] Use 
Objects.equals to avoid possible NullPointerException
URL: https://github.com/apache/storm/pull/2997#discussion_r279683081
 
 

 ##########
 File path: storm-server/src/main/java/org/apache/storm/stats/StatsUtil.java
 ##########
 @@ -2004,7 +2005,7 @@ private static ComponentPageInfo thriftifyCompPageData(
         win2stats.put(FAILED, ClientStatsUtil.getMapByKey(data, 
WIN_TO_FAILED));
 
         String compType = (String) data.get(TYPE);
-        if (compType.equals(ClientStatsUtil.SPOUT)) {
+        if (Objects.equals(compType,ClientStatsUtil.SPOUT)) {
 
 Review comment:
   It looks like only avoiding NPE, which also makes misleading as component 
being interpreted as bolt. We should see what are the actual cases of 
`data.get(TYPE)` being null, and decide how to fix based on the case.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to