jaykay12 commented on code in PR #5022:
URL: https://github.com/apache/solr/pull/5022#discussion_r4237355242


##########
solr/solrj/src/resources/java-template/api.mustache:
##########
@@ -233,14 +233,14 @@ public class {{classname}} {
 
             @Override
             public SolrParams getParams() {
-              final ModifiableSolrParams params = new ModifiableSolrParams();
+              final ModifiableSolrParams solrParams = new 
ModifiableSolrParams();

Review Comment:
   Not a tidy - it was a name clash. 
   I hit it via a failing test - 
   
https://github.com/jaykay12/solr/blob/cf8b0220fd4c94759e20a857a2b6ba29d64206e2/solr/core/src/test/org/apache/solr/handler/admin/api/GetConfigTest.java#L72
   
   Actually getZnodeVersion has @QueryParam("params"), so codegen produces a 
field/local named params. The template then emitted params.add(...) on a local 
also called params, which failed to compile. Renaming the local to solrParams 
avoids colliding with any query param named params. Behavior of the generated 
clients is unchanged.
   
   
   this change in mustache templating was suggested to me by Cursor, when 
debugging the failed test, since it was local variable renaming, & test passed 
post this renaming so felt safe to me!



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