serhiy-bzhezytskyy commented on code in PR #4760:
URL: https://github.com/apache/solr/pull/4760#discussion_r3821211453
##########
solr/core/src/test/org/apache/solr/cloud/api/collections/ShardSplitTest.java:
##########
@@ -137,7 +137,7 @@ private void
doSplitStaticIndexReplication(SolrIndexSplitter.SplitMethod splitMe
cloudClient
.getClusterState()
.getCollection(AbstractFullDistribZkTestBase.DEFAULT_COLLECTION);
- Replica replica = defCol.getReplicas().get(0);
+ Replica replica = defCol.getReplicaStream().findFirst().orElseThrow();
Review Comment:
Checked both messages directly -- `orElseThrow()` throws
`NoSuchElementException: No value present`, `get(0)` threw
`IndexOutOfBoundsException: Index 0 out of bounds for length 0`. Different
exception type, but neither is less clear than the other, so I don't think this
trips anyone up. All 7 migrated `getReplicaStream().findFirst()` sites use
`.orElseThrow()` the same way, none swallows an empty stream.
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]