serhiy-bzhezytskyy commented on code in PR #4761:
URL: https://github.com/apache/solr/pull/4761#discussion_r3844603237
##########
solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java:
##########
@@ -1282,6 +1280,11 @@ protected void mergeIds(ResponseBuilder rb, ShardRequest
sreq) {
}
}
+ protected static void updateResponseHeader(NamedList<Object> header, String
key, Object value) {
+ header.remove(key);
+ header.add(key, value);
+ }
+
Review Comment:
It didn't work, that's why -- I reverted it. `getResponseHeader()`'s
documented contract is `NamedList<Object>`, not `SimpleOrderedMap`.
`QueryComponentPartialResultsTest`'s mock stubs `getResponseHeader()` to return
a plain `NamedList` via Mockito, fully within that contract, and the cast threw
`ClassCastException` there. `remove()`/`add()` works regardless of the actual
runtime type.
--
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]