Copilot commented on code in PR #3696:
URL: https://github.com/apache/solr/pull/3696#discussion_r2384122161


##########
solr/modules/langid/src/java/org/apache/solr/update/processor/LanguageIdentifierUpdateProcessor.java:
##########
@@ -111,19 +111,14 @@ private void initParams(SolrParams params) {
       overwrite = params.getBool(OVERWRITE, false);
       langAllowlist = new HashSet<>();
       threshold = params.getDouble(THRESHOLD, DOCID_THRESHOLD_DEFAULT);
-      final String legacyAllowList = params.get(LANG_WHITELIST, "").trim();
-      if (!legacyAllowList.isEmpty()) {
-        // nowarn compile time string concatenation
-        log.warn(
-            LANG_WHITELIST
-                + " parameter is deprecated; use "
-                + LANG_ALLOWLIST
-                + " instead."); // nowarn
+
+      HashSet<String> strings = langAllowlist;
+      for (String s : params.get(LANG_ALLOWLIST).split(",")) {
+        String lang = s.trim();
+        if (!lang.isEmpty()) {
+          strings.add(lang);
+        }
       }

Review Comment:
   The code will throw NullPointerException if `params.get(LANG_ALLOWLIST)` 
returns null. The original code handled this by providing an empty string as 
default. Add null checking or provide a default value.



##########
solr/core/src/java/org/apache/solr/cloud/ZkSolrResourceLoader.java:
##########
@@ -22,8 +22,6 @@
 import java.lang.invoke.MethodHandles;
 import java.nio.file.FileSystems;
 import java.nio.file.Path;
-import org.apache.solr.common.SolrException.ErrorCode;
-import org.apache.solr.common.cloud.ZooKeeperException;
 import org.apache.solr.common.util.Pair;

Review Comment:
   The imports `org.apache.solr.common.SolrException.ErrorCode` and 
`org.apache.solr.common.cloud.ZooKeeperException` are removed but may still be 
needed elsewhere in the file. Verify that these imports are not used in other 
parts of the class.



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