You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "serhiy-bzhezytskyy (via GitHub)" <gi...@apache.org> on 2026/08/25 09:31:52 UTC

[PR] Tighten SolrQueryResponse.getResponseHeader/addResponseHeader to SimpleOrderedMap [solr]

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


Re: [PR] Tighten SolrQueryResponse.getResponseHeader/addResponseHeader to SimpleOrderedMap [solr]

Posted by "dsmiley (via GitHub)" <gi...@apache.org>.
dsmiley merged PR #4809:
URL: https://github.com/apache/solr/pull/4809


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


Re: [PR] Tighten SolrQueryResponse.getResponseHeader/addResponseHeader to SimpleOrderedMap [solr]

Posted by "serhiy-bzhezytskyy (via GitHub)" <gi...@apache.org>.
serhiy-bzhezytskyy commented on PR #4809:
URL: https://github.com/apache/solr/pull/4809#issuecomment-5421269980

   Added — see `changelog/unreleased/SOLR-solrqueryresponse-return-types.yml`.


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


Re: [PR] Tighten SolrQueryResponse.getResponseHeader/addResponseHeader to SimpleOrderedMap [solr]

Posted by "epugh (via GitHub)" <gi...@apache.org>.
epugh commented on PR #4809:
URL: https://github.com/apache/solr/pull/4809#issuecomment-5416608717

   @serhiy-bzhezytskyy can you add a changelog since this is a binary incompatbility?


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