dsmiley commented on code in PR #2826:
URL: https://github.com/apache/solr/pull/2826#discussion_r1826144232


##########
solr/core/src/test/org/apache/solr/cloud/OverseerTest.java:
##########
@@ -758,7 +758,7 @@ private void waitForCollections(ZkStateReader stateReader, 
String... collections
     while (0 < maxIterations--) {
 
       final ClusterState state = stateReader.getClusterState();
-      Set<String> availableCollections = state.getCollectionsMap().keySet();
+      Set<String> availableCollections = 
Set.copyOf(state.getCollectionNames());

Review Comment:
   state.getCollectionNames returns a Collection that just-so-happens to be a 
Set but may end up being a List in the future.  I didn't want to choose a Set 
on the first introduction of this method unless we think this choice is stable.
   
   Since this spot here is merely a test, maybe I'll simply cast it to a Set.  
If one day it becomes a List or something... whatever; easy enough to switch to 
Set.copyOf.  I wish the JDK had a convenient option to cast-or-create.  Didn't 
seem worth it in this class to hand-role a few lines of code for it.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to