stillalex commented on code in PR #1253:
URL: https://github.com/apache/solr/pull/1253#discussion_r1059544372


##########
solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpSolrClient.java:
##########
@@ -1041,6 +1052,15 @@ public HttpSolrClient build() {
       if 
(this.invariantParams.get(DelegationTokenHttpSolrClient.DELEGATION_TOKEN_PARAM) 
== null) {
         return new HttpSolrClient(this);
       } else {
+        urlParamNames =
+            urlParamNames == null
+                ? Set.of(DelegationTokenHttpSolrClient.DELEGATION_TOKEN_PARAM)
+                : urlParamNames;
+        if 
(!urlParamNames.contains(DelegationTokenHttpSolrClient.DELEGATION_TOKEN_PARAM)) 
{
+          urlParamNames = new HashSet<>(urlParamNames);
+          
urlParamNames.add(DelegationTokenHttpSolrClient.DELEGATION_TOKEN_PARAM);
+          urlParamNames = Collections.unmodifiableSet(urlParamNames);
+        }
         return new DelegationTokenHttpSolrClient(this);

Review Comment:
   I don't disagree, and I like the Set methods more. but if you look at the 
impl, the UnmodifiableCollection is only a thin wrapper over the original 
collection, so I'm not sure this type of optimizations is really that useful in 
the end.



-- 
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-unsubscr...@solr.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to