azagniotov commented on code in PR #2886:
URL: https://github.com/apache/solr/pull/2886#discussion_r1860642411


##########
solr/modules/langid/src/java/org/apache/solr/update/processor/LanguageIdentifierUpdateProcessor.java:
##########
@@ -111,18 +111,21 @@ private void initParams(SolrParams params) {
       overwrite = params.getBool(OVERWRITE, false);
       langAllowlist = new HashSet<>();
       threshold = params.getDouble(THRESHOLD, DOCID_THRESHOLD_DEFAULT);
-      String legacyAllowList = params.get(LANG_WHITELIST, "");
-      if (legacyAllowList.length() > 0) {
+      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
       }
-      if (params.get(LANG_ALLOWLIST, legacyAllowList).length() > 0) {
-        for (String lang : params.get(LANG_ALLOWLIST, "").split(",")) {
-          langAllowlist.add(lang);
+      if (!params.get(LANG_ALLOWLIST, legacyAllowList).isEmpty()) {
+        for (String lang : params.get(LANG_ALLOWLIST, 
legacyAllowList).split(",")) {
+          if (lang.trim().isEmpty()) {
+            continue;
+          }
+          langAllowlist.add(lang.trim());

Review Comment:
   @janhoy thanks! I was considering the similar to be honest. But, 
contribution guidelines suggest to "try to adhere to the coding style of files 
you edit", so I chose not to follow the functional style. I am happy to apply 
the suggestion.



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