psalagnac commented on code in PR #3834:
URL: https://github.com/apache/solr/pull/3834#discussion_r2500033577


##########
solr/core/src/java/org/apache/solr/handler/designer/SchemaDesignerAPI.java:
##########
@@ -1119,8 +1120,9 @@ protected Map<String, Object> buildResponse(
     Map<String, Object> response = new HashMap<>();
 
     DocCollection coll = zkStateReader().getCollection(mutableId);
-    if (coll.getActiveSlicesArr().length > 0) {
-      String coreName = coll.getActiveSlicesArr()[0].getLeader().getCoreName();
+    if (!coll.getActiveSlices().isEmpty()) {
+      List<Slice> activeSlices = new ArrayList<>(coll.getActiveSlices());
+      String coreName = activeSlices.getFirst().getLeader().getCoreName();

Review Comment:
   I was creating the ArrayList to easily get the first element.
   This may be avoided by using a stream or an iterator.



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