[ 
https://issues.apache.org/jira/browse/SOLR-18603?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18146881#comment-18146881
 ] 

Ivan Saric edited comment on SOLR-18603 at 11/19/26, 7:42 AM:
--------------------------------------------------------------

For the record: the branch_10x backport of SOLR-18606 (commit 0b2fa93853b, [PR 
#5314|https://github.com/apache/solr/pull/5314]) had to leave out 
{{CloudHttp2SolrClientTest.testShardReplicationFactors}} and 
{{testShardReplicationFactorsWithoutRouteFactors}}, which read 
{{CloudSolrClient.REPFACT_BY_ROUTE}} from this change. Per the dev-list 
decision on Nov 4, 10x stays as is, so this is just a note for anyone 
backporting around {{CloudSolrClient}}.


was (Author: JIRAUSER311916):
The branch_10x backport of SOLR-18606 (commit 0b2fa93853b, [PR 
#5314|https://github.com/apache/solr/pull/5314]) had to leave out two tests, 
{{CloudHttp2SolrClientTest.testShardReplicationFactors}} and 
{{testShardReplicationFactorsWithoutRouteFactors}}, because they read 
{{CloudSolrClient.REPFACT_BY_ROUTE}}, which only exists on main since this 
change. That is the first concrete cost of keeping this main-only: any further 
backport around {{CloudSolrClient}} will hit the same gap.

[~dsmiley], on Oct 28 you said you were on board with enforcing the sealing at 
the next 10.x release. I am still happy to prepare the branch_10x backport. The 
one thing to decide is {{CloudSolrClient.RouteResponse}}: sealing {{NamedList}} 
means removing that class, and it cannot be kept on 10x without permitting a 
second subclass. Is removing it acceptable in a 10.x minor? If yes, I will open 
the backport PR. If not, this stays 11.0-only and Nick's workaround becomes the 
pattern for 10x.

> Seal the NamedList class hierarchy (SIP-22 step 4)
> --------------------------------------------------
>
>                 Key: SOLR-18603
>                 URL: https://issues.apache.org/jira/browse/SOLR-18603
>             Project: Solr
>          Issue Type: Improvement
>          Components: SolrJ
>            Reporter: Ivan Saric
>            Priority: Minor
>              Labels: pull-request-available
>             Fix For: main(11.0)
>
>          Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> This is step 4 of [SIP-22: NamedList 
> Reduction|https://cwiki.apache.org/confluence/spaces/SOLR/pages/340036504/SIP-22+NamedList+Reduction]:
> {quote}Minor: Use Java 17 "sealed classes" to insist the NamedList type 
> hierarchy is exactly what we want; no surprises.{quote}
> Steps 1-3 of the SIP are done (SOLR-17623, SOLR-17635, SOLR-17625). This step 
> was agreed as the next one on the dev list: [Follow-up work after 
> SOLR-17600|https://lists.apache.org/thread/2o09q8yjmsx4l9b58mqqk5mgdbv7qf36]. 
> Per that thread, the SIP's "Solr 10" now means Solr 11 ({{main}}), since 10.0 
> has shipped.
> h3. Proposal
> Declare {{org.apache.solr.common.util.NamedList}} as {{sealed}} with an 
> explicit {{permits}} list, so that the set of NamedList subtypes is fixed and 
> visible in one place. The expected outcome is that {{NamedList}} permits 
> exactly {{SimpleOrderedMap}}; whether {{SimpleOrderedMap}} itself becomes 
> {{final}} or stays open is to be decided from the audit below.
> Before writing any {{permits}} clause, audit every subclass of {{NamedList}} 
> across all Gradle modules, including test sources, {{solr/modules/*}} and 
> anonymous subclasses. Any subclass beyond {{SimpleOrderedMap}} is either 
> removed or rewritten (if it is internal), or reported here as a finding 
> before deciding whether to permit it.
> No behaviour changes and no public method signature changes. Those are later 
> SIP-22 steps.
> h3. Compatibility
> {{NamedList}} is public SolrJ API, so sealing it is a plugin-compatibility 
> change: a third-party subclass of {{NamedList}} will no longer compile. This 
> is a {{main}} / 11.0-only change and will be called out in the changelog as 
> an upgrade note. The SIP already anticipates plugin-compatibility impact.
> h3. Out of scope
> * Migrating {{new NamedList(...)}} instantiations to {{SimpleOrderedMap}} 
> (SIP-22 step 5). That will be a separate Jira, per the SIP's "don't combine 
> with anything else".
> * Changing public API signatures away from {{NamedList}} (SIP-22 step 7).
> One PR against {{main}}.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to