azagniotov commented on code in PR #2886:
URL: https://github.com/apache/solr/pull/2886#discussion_r1860812062
##########
solr/modules/langid/src/java/org/apache/solr/update/processor/LanguageIdentifierUpdateProcessor.java:
##########
@@ -111,19 +111,20 @@ 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()) {
Review Comment:
Yes, I will simplify 👍🏼
--
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]