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


##########
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:
   My intention is only to make it obvious reading the code that urlParamNames 
will be immutable in the end.  That's all.  



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