DarkAssassinator commented on code in PR #12980:
URL: 
https://github.com/apache/dolphinscheduler/pull/12980#discussion_r1031025062


##########
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/registry/ServerNodeManager.java:
##########
@@ -241,8 +235,7 @@ private void updateMasterNodes() {
         try {
             registryClient.getLock(nodeLock);
             Collection<String> currentNodes = 
registryClient.getMasterNodesDirectly();
-            List<Server> masterNodes = 
registryClient.getServerList(NodeType.MASTER);
-            syncMasterNodes(currentNodes, masterNodes);
+            syncMasterNodes(currentNodes, 
registryClient.getServerList(NodeType.MASTER));

Review Comment:
   > There is no need to do this code change.
   
   Because `masterNodes` local variable should not shadow class fields. 
Override or shadow a variable declared in the outer scope can strongly impact 
the readability,and it will lead mantainers to introduce bugs because they 
think they are using one variable but are really using another. WDYT.



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to