Willdotwhite commented on code in PR #1688:
URL: https://github.com/apache/solr/pull/1688#discussion_r1217711029


##########
solr/core/src/java/org/apache/solr/packagemanager/PackageUtils.java:
##########
@@ -268,17 +270,8 @@ public static void print(String color, Object message) {
   }
 
   public static String[] validateCollections(String collections[]) {

Review Comment:
   Only in one other file: [PackageTool 
deploy](https://github.com/apache/solr/blob/main/solr/core/src/java/org/apache/solr/cli/PackageTool.java#L184)
 and [PackageTool 
undeploy](https://github.com/apache/solr/blob/main/solr/core/src/java/org/apache/solr/cli/PackageTool.java#L214).
   
   We could remove this method entirely and use something like this inline:
   
   ```java
   Arrays.stream(cli.getOptionValue("collections").split(","))
       .map(SolrIdentifierValidator::validateCollectionName)
       .toArray(String[]::new)
   ```
   
   in both locations, although I sincerely hope there's a slightly shorter 
approach I've not thought of yet!
   
   We could do something a bit less packed together given that `String[] 
collections` isn't final, but that'd take a bit more work to make sure it 
doesn't get a bit lengthy or involve multiple short-lived arrays.



-- 
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: issues-unsubscr...@solr.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to