epugh commented on code in PR #3860:
URL: https://github.com/apache/solr/pull/3860#discussion_r2529884230
##########
solr/core/src/test/org/apache/solr/cloud/TestRandomFlRTGCloud.java:
##########
@@ -508,38 +487,38 @@ private void assertRTG(final SolrInputDocument[]
knownDocs, final int[] docIds)
}
String wt = params.get(CommonParams.WT, "javabin");
- final SolrClient client = getRandomClient(random(), wt);
+ final SolrClient client = getRandomClient(random());
// If we have chosen a CloudSolrClient, then override wt parameter back to
javabin format,
// regardless of what was randomly picked.
if (client instanceof CloudSolrClient) {
wt = "javabin";
}
- final Object rsp;
- final SolrDocumentList docs;
- if ("javabin".equals(wt)) {
- // the most common case
- final QueryResponse qRsp = client.query(params);
- assertNotNull(params.toString(), qRsp);
- rsp = qRsp;
- docs = getDocsFromRTGResponse(askForList, qRsp);
- } else {
- final NamedList<Object> nlRsp = client.request(new QueryRequest(params));
- assertNotNull(params.toString(), nlRsp);
- rsp = nlRsp;
- final String textResult =
InputStreamResponseParser.consumeResponseToString(nlRsp);
- switch (wt) {
- case "json":
- docs = getDocsFromJsonResponse(askForList, textResult);
- break;
- case "xml":
- docs = getDocsFromXmlResponse(askForList, textResult);
- break;
- default:
- throw new IllegalStateException();
- }
- }
+ final Object rsp; // only here for an assertion message
+
+ var qr = new QueryRequest(params);
+ final SolrDocumentList docs =
Review Comment:
this is lovely! I am not familiar with the `yield` keyword in Java.
HOnestly, I need to probably update myself my my Java 8 days!
--
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]