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