You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "justinrsweeney (via GitHub)" <gi...@apache.org> on 2023/03/21 13:55:54 UTC

[GitHub] [solr] justinrsweeney commented on a diff in pull request #1466: SOLR-16713: Replace Guava usages with pure Java

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-unsubscribe@solr.apache.org

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


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