isaric commented on code in PR #5326:
URL: https://github.com/apache/solr/pull/5326#discussion_r4712857394
##########
solr/core/src/java/org/apache/solr/api/ApiBag.java:
##########
@@ -457,7 +458,7 @@ public static List<CommandOperation> getCommandOperations(
ContentStream stream, Map<String, JsonSchemaValidator> validators,
boolean validate) {
List<CommandOperation> parsedCommands = null;
try {
- parsedCommands = readCommands(Set.of(stream), new NamedList<>());
+ parsedCommands = readCommands(Set.of(stream), new SimpleOrderedMap<>());
Review Comment:
This one needs to stay mutable: `readCommands` adds the parse errors to it
(`resp.add(CommandOperation.ERR_MSGS, errList)`) before returning null, so the
shared immutable instance would throw on the error path. The other six are now
`SimpleOrderedMap.of()`.
##########
solr/core/src/java/org/apache/solr/core/SolrCore.java:
##########
@@ -3205,7 +3205,7 @@ protected RestManager initRestManager() throws
SolrException {
if (mgr == null) mgr = new RestManager();
- if (initArgs == null) initArgs = new NamedList<>();
+ if (initArgs == null) initArgs = new SimpleOrderedMap<>();
Review Comment:
Kept mutable here: `ManagedResourceStorage.newStorageIO` adds `storageDir`
to these args when none is configured and the config dir is writable, which is
the common case. It is also typed `NamedList<String>`, so `of()` would need a
cast on top.
##########
solr/core/src/java/org/apache/solr/core/OpenTelemetryConfigurator.java:
##########
@@ -121,7 +122,7 @@ private static OpenTelemetry
autoConfigOTEL(SolrResourceLoader loader) {
try {
OpenTelemetryConfigurator configurator =
loader.newInstance(DEFAULT_CLASS_NAME,
OpenTelemetryConfigurator.class);
- configurator.init(new NamedList<>());
+ configurator.init(new SimpleOrderedMap<>());
Review Comment:
Done for the six where the receiver only reads its args (no-op `init`
defaults, `SchemaCodecFactory`, `DefaultSchemaSuggester`,
`ManagedIndexSchemaFactory`, the default distrib factory). Checked each:
`remove` of an absent key on the shared empty instance is a no-op, so the ones
that strip keys are fine too.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]