iamsanjay commented on code in PR #2633:
URL: https://github.com/apache/solr/pull/2633#discussion_r1712666166


##########
solr/core/src/java/org/apache/solr/highlight/UnifiedSolrHighlighter.java:
##########
@@ -395,12 +395,12 @@ protected Locale parseLocale(String language, String 
country, String variant) {
             "language is required if country or variant is specified");
       } else if (country == null && variant != null) {
         throw new IllegalArgumentException("To specify variant, country is 
required");
-      } else if (country != null && variant != null) {
-        return new Locale(language, country, variant);
-      } else if (country != null) {
-        return new Locale(language, country);
       } else {
-        return new Locale(language);
+        return new Locale.Builder()

Review Comment:
   Earlier, the Locale constructors would throws NullPointerException if any of 
the param is Null. However, Locale Builder setters handle this case now and set 
the field to empty string if null is passed. Therefore, no need to explicitly 
check for null.
   



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