justinrsweeney commented on code in PR #1466:
URL: https://github.com/apache/solr/pull/1466#discussion_r1143411837


##########
solr/core/src/java/org/apache/solr/api/Api.java:
##########
@@ -44,9 +43,7 @@ public Map<String, JsonSchemaValidator> getCommandSchema() {
         if (commandSchema == null) {
           ValidatingJsonMap commands = getSpec().getMap("commands", null);
           commandSchema =
-              commands != null
-                  ? ImmutableMap.copyOf(ApiBag.getParsedSchema(commands))
-                  : ImmutableMap.of();
+              commands != null ? Map.copyOf(ApiBag.getParsedSchema(commands)) 
: Map.of();

Review Comment:
   Should we consider using `Collections.unmodifiableMap()` to get closer 
behavior to ImmutableMap? I don't think `Collection.unmodifiableMap` makes all 
of the same guarantees, but might make more clear that it is read only.
   
   This seems to be true for a number of places in these changes where we go 
from an ImmutableCollection to just a regular Map or Set, wondering if that was 
intentional or if we should try to consistently keep those unmodifiable.



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