Copilot commented on code in PR #16940:
URL: https://github.com/apache/pinot/pull/16940#discussion_r2396022990


##########
pinot-controller/src/main/java/org/apache/pinot/controller/util/ServerSegmentMetadataReader.java:
##########
@@ -504,16 +526,11 @@ private String generateStaleSegmentsServerURL(String 
tableNameWithType, String e
   }
 
   private String generateParam(String key, List<String> values) {
-    String paramsStr = "";
-    if (CollectionUtils.isEmpty(values)) {
-      return paramsStr;
-    }
     List<String> params = new ArrayList<>(values.size());
     for (String value : values) {
-      params.add(key + "=" + value);
+      params.add(key + "=" + URLEncoder.encode(value, StandardCharsets.UTF_8));
     }
-    paramsStr = String.join("&", params);
-    return paramsStr;
+    return String.join("&", params);
   }

Review Comment:
   The generateParam method no longer checks if values is null or empty, which 
could cause a NullPointerException. The caller methods now handle empty checks, 
but this method should still guard against null input for robustness.



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