gerlowskija commented on code in PR #2811:
URL: https://github.com/apache/solr/pull/2811#discussion_r1824597751


##########
solr/solrj/src/java/org/apache/solr/client/solrj/impl/ConcurrentUpdateHttp2SolrClient.java:
##########
@@ -358,28 +358,29 @@ private void addRunner() {
   @Override
   public NamedList<Object> request(final SolrRequest<?> request, String 
collection)
       throws SolrServerException, IOException {
-    if (ClientUtils.shouldApplyDefaultCollection(collection, request))
-      collection = defaultCollection;
+    final String effectiveCollection =
+        ClientUtils.shouldApplyDefaultCollection(collection, request)
+            ? defaultCollection
+            : collection;

Review Comment:
   Two reasons:
   
   1. The lambda usage in L366 requires a "final or effectively final" 
variable, so "collection" cannot be used there, just from a compilation 
perspective.
   2. Much less important, but I try to avoid modifying method args [from a 
best-practices 
perspective](https://stackoverflow.com/questions/12019978/is-it-a-good-practice-to-change-arguments-in-java).



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

Reply via email to