Use Locale.ROOT consistently for toLower/toUpperCase
Closes gh-33708
This commit is contained in:
@@ -34,7 +34,7 @@ class MonthFormatter implements Formatter<Month> {
|
||||
|
||||
@Override
|
||||
public Month parse(String text, Locale locale) throws ParseException {
|
||||
return Month.valueOf(text.toUpperCase());
|
||||
return Month.valueOf(text.toUpperCase(Locale.ROOT));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -21,6 +21,7 @@ import java.time.temporal.ChronoField;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.time.temporal.Temporal;
|
||||
import java.time.temporal.ValueRange;
|
||||
import java.util.Locale;
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
import org.springframework.lang.Nullable;
|
||||
@@ -143,7 +144,7 @@ abstract class CronField {
|
||||
}
|
||||
|
||||
private static String replaceOrdinals(String value, String[] list) {
|
||||
value = value.toUpperCase();
|
||||
value = value.toUpperCase(Locale.ROOT);
|
||||
for (int i = 0; i < list.length; i++) {
|
||||
String replacement = Integer.toString(i + 1);
|
||||
value = StringUtils.replace(value, list[i], replacement);
|
||||
|
||||
Reference in New Issue
Block a user