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

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

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


##########
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:
   Map.of and Map.copyOf return immutable maps already. https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Map.html under `Unmodifiable Maps



##########
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:
   Map.of and Map.copyOf return immutable maps already. https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Map.html under "Unmodifiable Maps"



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