murblanc commented on a change in pull request #2148:
URL: https://github.com/apache/lucene-solr/pull/2148#discussion_r551633302



##########
File path: solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java
##########
@@ -1365,6 +1382,32 @@ public void refreshAndWatch() {
         log.error("Unwatched collection: [{}]", coll, e);
       }
     }
+
+    private void refreshAndWatchChildren() throws KeeperException, 
InterruptedException {
+      Stat stat = new Stat();
+      List<String> replicaStates = null;
+      try {
+        replicaStates = zkClient.getChildren(collectionPath, this, stat, true);
+        PerReplicaStates newStates = new PerReplicaStates(collectionPath, 
stat.getCversion(), replicaStates);
+        DocCollection oldState = watchedCollectionStates.get(coll);
+        DocCollection newState = null;

Review comment:
       Please do not initialize `newState` to `null` and instead mark it 
`final` so compiler enforces it being assigned. (same for `replicaStates` above)




----------------------------------------------------------------
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:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to