serhiy-bzhezytskyy opened a new pull request, #4809: URL: https://github.com/apache/solr/pull/4809
Follow-up to @dsmiley's suggestion on #4761 (review thread on `QueryComponent.java`): rather than keep the `remove()`+`add()` workaround needed there because `getResponseHeader()`'s declared return type (`NamedList<Object>`) doesn't have a `put()`, this tightens the declared type to what it always actually is at runtime -- `SimpleOrderedMap<Object>` -- removing the internal unchecked cast and letting the 4 call sites in `QueryComponent`/`CombinedQueryComponent` use `put()` directly. This also closes the actual hole that caused #4761's `ClassCastException`: `MockResponseBuilder`'s mock was stubbing `getResponseHeader()` to return a bare `NamedList`, which the contract allowed but reality never produced. With the tightened return type, that mismatch is now a compile error instead of a runtime `ClassCastException`. **Compatibility note**: this is binary-incompatible for any external caller compiled against the old `NamedList` signature -- verified locally (compiled a caller against the old class files, ran it against the new ones without recompiling): `NoSuchMethodError` on both `getResponseHeader()` and `addResponseHeader(NamedList)`. `SolrQueryResponse` is `@since solr 0.9` public API with no experimental/internal marker, so flagging this explicitly rather than treating it as a purely internal cleanup -- your call whether that's acceptable for 11.0. AI-assisted (Claude Sonnet 5) -- 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]
