diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/hunspell/HunspellDictionary.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/hunspell/HunspellDictionary.java index 626b0cb6ef3..993b734c80d 100644 --- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/hunspell/HunspellDictionary.java +++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/hunspell/HunspellDictionary.java @@ -376,7 +376,7 @@ public class HunspellDictionary { Arrays.sort(wordForm.getFlags()); entry = line.substring(0, flagSep); if(ignoreCase) { - entry = entry.toLowerCase(Locale.ENGLISH); + entry = entry.toLowerCase(Locale.ROOT); } } diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestKeywordMarkerFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestKeywordMarkerFilter.java index e37a0740095..6640452154f 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestKeywordMarkerFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestKeywordMarkerFilter.java @@ -79,7 +79,7 @@ public class TestKeywordMarkerFilter extends BaseTokenStreamTestCase { public boolean incrementToken() throws IOException { if (input.incrementToken()) { if (!keywordAttr.isKeyword()) { - final String term = termAtt.toString().toLowerCase(Locale.ENGLISH); + final String term = termAtt.toString().toLowerCase(Locale.ROOT); termAtt.setEmpty().append(term); } return true; diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/sinks/DateRecognizerSinkTokenizerTest.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/sinks/DateRecognizerSinkTokenizerTest.java index 1ba9654a2fa..13d87370291 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/sinks/DateRecognizerSinkTokenizerTest.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/sinks/DateRecognizerSinkTokenizerTest.java @@ -27,7 +27,7 @@ import org.apache.lucene.analysis.MockTokenizer; public class DateRecognizerSinkTokenizerTest extends BaseTokenStreamTestCase { public void test() throws IOException { - DateRecognizerSinkFilter sinkFilter = new DateRecognizerSinkFilter(new SimpleDateFormat("MM/dd/yyyy", Locale.US)); + DateRecognizerSinkFilter sinkFilter = new DateRecognizerSinkFilter(new SimpleDateFormat("MM/dd/yyyy", Locale.ROOT)); String test = "The quick red fox jumped over the lazy brown dogs on 7/11/2006 The dogs finally reacted on 7/12/2006"; TeeSinkTokenFilter tee = new TeeSinkTokenFilter(new MockTokenizer(new StringReader(test), MockTokenizer.WHITESPACE, false)); TeeSinkTokenFilter.SinkTokenStream sink = tee.newSinkTokenStream(sinkFilter); diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestCharArrayMap.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestCharArrayMap.java index 892e28a6388..ce8db402dd6 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestCharArrayMap.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestCharArrayMap.java @@ -36,7 +36,7 @@ public class TestCharArrayMap extends LuceneTestCase { key[j] = (char)random().nextInt(127); } String keyStr = new String(key); - String hmapKey = ignoreCase ? keyStr.toLowerCase(Locale.ENGLISH) : keyStr; + String hmapKey = ignoreCase ? keyStr.toLowerCase(Locale.ROOT) : keyStr; int val = random().nextInt(); diff --git a/lucene/analysis/common/src/tools/java/org/apache/lucene/analysis/standard/GenerateJflexTLDMacros.java b/lucene/analysis/common/src/tools/java/org/apache/lucene/analysis/standard/GenerateJflexTLDMacros.java index 1249f49e93a..5d7c23d4ae5 100644 --- a/lucene/analysis/common/src/tools/java/org/apache/lucene/analysis/standard/GenerateJflexTLDMacros.java +++ b/lucene/analysis/common/src/tools/java/org/apache/lucene/analysis/standard/GenerateJflexTLDMacros.java @@ -123,11 +123,11 @@ public class GenerateJflexTLDMacros { while (null != (line = reader.readLine())) { Matcher matcher = TLD_PATTERN_1.matcher(line); if (matcher.matches()) { - TLDs.add(matcher.group(1).toLowerCase(Locale.US)); + TLDs.add(matcher.group(1).toLowerCase(Locale.ROOT)); } else { matcher = TLD_PATTERN_2.matcher(line); if (matcher.matches()) { - TLDs.add(matcher.group(1).toLowerCase(Locale.US)); + TLDs.add(matcher.group(1).toLowerCase(Locale.ROOT)); } } } @@ -146,7 +146,7 @@ public class GenerateJflexTLDMacros { */ private void writeOutput(SortedSet ASCIITLDs) throws IOException { final DateFormat dateFormat = DateFormat.getDateTimeInstance - (DateFormat.FULL, DateFormat.FULL, Locale.US); + (DateFormat.FULL, DateFormat.FULL, Locale.ROOT); dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); final Writer writer = new OutputStreamWriter (new FileOutputStream(outputFile), "UTF-8"); diff --git a/lucene/analysis/icu/src/test/org/apache/lucene/collation/TestICUCollationKeyAnalyzer.java b/lucene/analysis/icu/src/test/org/apache/lucene/collation/TestICUCollationKeyAnalyzer.java index 921c00c4c29..0c3a992f361 100644 --- a/lucene/analysis/icu/src/test/org/apache/lucene/collation/TestICUCollationKeyAnalyzer.java +++ b/lucene/analysis/icu/src/test/org/apache/lucene/collation/TestICUCollationKeyAnalyzer.java @@ -64,7 +64,7 @@ public class TestICUCollationKeyAnalyzer extends CollationTestBase { // public void testCollationKeySort() throws Exception { Analyzer usAnalyzer = new ICUCollationKeyAnalyzer - (TEST_VERSION_CURRENT, Collator.getInstance(Locale.US)); + (TEST_VERSION_CURRENT, Collator.getInstance(Locale.ROOT)); Analyzer franceAnalyzer = new ICUCollationKeyAnalyzer (TEST_VERSION_CURRENT, Collator.getInstance(Locale.FRANCE)); Analyzer swedenAnalyzer = new ICUCollationKeyAnalyzer @@ -73,7 +73,7 @@ public class TestICUCollationKeyAnalyzer extends CollationTestBase { (TEST_VERSION_CURRENT, Collator.getInstance(new Locale("da", "dk"))); // The ICU Collator and java.text.Collator implementations differ in their - // orderings - "BFJHD" is the ordering for the ICU Collator for Locale.US. + // orderings - "BFJHD" is the ordering for the ICU Collator for Locale.ROOT. testCollationKeySort (usAnalyzer, franceAnalyzer, swedenAnalyzer, denmarkAnalyzer, "BFJHD", "ECAGI", "BJDFH", "BJDHF"); diff --git a/lucene/analysis/icu/src/tools/java/org/apache/lucene/analysis/icu/GenerateHTMLStripCharFilterSupplementaryMacros.java b/lucene/analysis/icu/src/tools/java/org/apache/lucene/analysis/icu/GenerateHTMLStripCharFilterSupplementaryMacros.java index b3569d21126..18328ccdcda 100644 --- a/lucene/analysis/icu/src/tools/java/org/apache/lucene/analysis/icu/GenerateHTMLStripCharFilterSupplementaryMacros.java +++ b/lucene/analysis/icu/src/tools/java/org/apache/lucene/analysis/icu/GenerateHTMLStripCharFilterSupplementaryMacros.java @@ -29,7 +29,7 @@ public class GenerateHTMLStripCharFilterSupplementaryMacros { private static final UnicodeSet BMP = new UnicodeSet("[\u0000-\uFFFF]"); private static final String NL = System.getProperty("line.separator"); private static final DateFormat DATE_FORMAT = DateFormat.getDateTimeInstance - (DateFormat.FULL, DateFormat.FULL, Locale.US); + (DateFormat.FULL, DateFormat.FULL, Locale.ROOT); static { DATE_FORMAT.setTimeZone(TimeZone.getTimeZone("UTC")); } diff --git a/lucene/analysis/icu/src/tools/java/org/apache/lucene/analysis/icu/GenerateJFlexSupplementaryMacros.java b/lucene/analysis/icu/src/tools/java/org/apache/lucene/analysis/icu/GenerateJFlexSupplementaryMacros.java index 29f7937a128..3292418d609 100644 --- a/lucene/analysis/icu/src/tools/java/org/apache/lucene/analysis/icu/GenerateJFlexSupplementaryMacros.java +++ b/lucene/analysis/icu/src/tools/java/org/apache/lucene/analysis/icu/GenerateJFlexSupplementaryMacros.java @@ -32,7 +32,7 @@ public class GenerateJFlexSupplementaryMacros { private static final UnicodeSet BMP = new UnicodeSet("[\u0000-\uFFFF]"); private static final String NL = System.getProperty("line.separator"); private static final DateFormat DATE_FORMAT = DateFormat.getDateTimeInstance - (DateFormat.FULL, DateFormat.FULL, Locale.US); + (DateFormat.FULL, DateFormat.FULL, Locale.ROOT); static { DATE_FORMAT.setTimeZone(TimeZone.getTimeZone("UTC")); } diff --git a/lucene/analysis/stempel/src/java/org/apache/lucene/analysis/stempel/StempelStemmer.java b/lucene/analysis/stempel/src/java/org/apache/lucene/analysis/stempel/StempelStemmer.java index bf31660b37a..983c2f026c8 100644 --- a/lucene/analysis/stempel/src/java/org/apache/lucene/analysis/stempel/StempelStemmer.java +++ b/lucene/analysis/stempel/src/java/org/apache/lucene/analysis/stempel/StempelStemmer.java @@ -65,7 +65,7 @@ public class StempelStemmer { DataInputStream in = null; try { in = new DataInputStream(new BufferedInputStream(stemmerTable)); - String method = in.readUTF().toUpperCase(Locale.ENGLISH); + String method = in.readUTF().toUpperCase(Locale.ROOT); if (method.indexOf('M') < 0) { return new org.egothor.stemmer.Trie(in); } else { diff --git a/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/DirContentSource.java b/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/DirContentSource.java index e0dfa0bd81e..2e97f26fbd7 100644 --- a/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/DirContentSource.java +++ b/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/DirContentSource.java @@ -163,7 +163,7 @@ public class DirContentSource extends ContentSource { dfi = new DateFormatInfo(); dfi.pos = new ParsePosition(0); // date format: 30-MAR-1987 14:22:36.87 - dfi.df = new SimpleDateFormat("dd-MMM-yyyy kk:mm:ss.SSS", Locale.US); + dfi.df = new SimpleDateFormat("dd-MMM-yyyy kk:mm:ss.SSS", Locale.ROOT); dfi.df.setLenient(true); dateFormat.set(dfi); } diff --git a/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/DocMaker.java b/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/DocMaker.java index 70f19ec3de4..d0be4109b3b 100644 --- a/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/DocMaker.java +++ b/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/DocMaker.java @@ -182,7 +182,7 @@ public class DocMaker implements Closeable { private boolean storeBytes = false; private static class DateUtil { - public SimpleDateFormat parser = new SimpleDateFormat("dd-MMM-yyyy HH:mm:ss", Locale.US); + public SimpleDateFormat parser = new SimpleDateFormat("dd-MMM-yyyy HH:mm:ss", Locale.ROOT); public Calendar cal = Calendar.getInstance(); public ParsePosition pos = new ParsePosition(0); public DateUtil() { diff --git a/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/LongToEnglishContentSource.java b/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/LongToEnglishContentSource.java index 4fa668d37eb..7d33d0c50b7 100644 --- a/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/LongToEnglishContentSource.java +++ b/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/LongToEnglishContentSource.java @@ -35,7 +35,7 @@ public class LongToEnglishContentSource extends ContentSource{ } // TODO: we could take param to specify locale... - private final RuleBasedNumberFormat rnbf = new RuleBasedNumberFormat(Locale.ENGLISH, + private final RuleBasedNumberFormat rnbf = new RuleBasedNumberFormat(Locale.ROOT, RuleBasedNumberFormat.SPELLOUT); @Override public synchronized DocData getNextDocData(DocData docData) throws NoMoreDataException, IOException { diff --git a/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/LongToEnglishQueryMaker.java b/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/LongToEnglishQueryMaker.java index 4c8b5c6cbdb..81cbed2121b 100644 --- a/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/LongToEnglishQueryMaker.java +++ b/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/LongToEnglishQueryMaker.java @@ -37,7 +37,7 @@ public class LongToEnglishQueryMaker implements QueryMaker { protected QueryParser parser; // TODO: we could take param to specify locale... - private final RuleBasedNumberFormat rnbf = new RuleBasedNumberFormat(Locale.ENGLISH, + private final RuleBasedNumberFormat rnbf = new RuleBasedNumberFormat(Locale.ROOT, RuleBasedNumberFormat.SPELLOUT); public Query makeQuery(int size) throws Exception { diff --git a/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/ReutersContentSource.java b/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/ReutersContentSource.java index fe7bb42620c..a6ddcfd905e 100644 --- a/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/ReutersContentSource.java +++ b/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/ReutersContentSource.java @@ -76,7 +76,7 @@ public class ReutersContentSource extends ContentSource { if (dfi == null) { dfi = new DateFormatInfo(); // date format: 30-MAR-1987 14:22:36.87 - dfi.df = new SimpleDateFormat("dd-MMM-yyyy kk:mm:ss.SSS",Locale.US); + dfi.df = new SimpleDateFormat("dd-MMM-yyyy kk:mm:ss.SSS",Locale.ROOT); dfi.df.setLenient(true); dfi.pos = new ParsePosition(0); dateFormat.set(dfi); diff --git a/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/TrecContentSource.java b/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/TrecContentSource.java index 404b75bf229..dbaaf5f3986 100644 --- a/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/TrecContentSource.java +++ b/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/TrecContentSource.java @@ -108,7 +108,7 @@ public class TrecContentSource extends ContentSource { dfi = new DateFormatInfo(); dfi.dfs = new SimpleDateFormat[DATE_FORMATS.length]; for (int i = 0; i < dfi.dfs.length; i++) { - dfi.dfs[i] = new SimpleDateFormat(DATE_FORMATS[i], Locale.US); + dfi.dfs[i] = new SimpleDateFormat(DATE_FORMATS[i], Locale.ROOT); dfi.dfs[i].setLenient(true); } dfi.pos = new ParsePosition(0); diff --git a/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/TrecDocParser.java b/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/TrecDocParser.java index 620812205a1..3d165992d77 100644 --- a/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/TrecDocParser.java +++ b/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/TrecDocParser.java @@ -47,7 +47,7 @@ public abstract class TrecDocParser { static final Map pathName2Type = new HashMap(); static { for (ParsePathType ppt : ParsePathType.values()) { - pathName2Type.put(ppt.name().toUpperCase(Locale.ENGLISH),ppt); + pathName2Type.put(ppt.name().toUpperCase(Locale.ROOT),ppt); } } @@ -60,7 +60,7 @@ public abstract class TrecDocParser { public static ParsePathType pathType(File f) { int pathLength = 0; while (f != null && ++pathLength < MAX_PATH_LENGTH) { - ParsePathType ppt = pathName2Type.get(f.getName().toUpperCase(Locale.ENGLISH)); + ParsePathType ppt = pathName2Type.get(f.getName().toUpperCase(Locale.ROOT)); if (ppt!=null) { return ppt; } diff --git a/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/demohtml/HTMLParser.java b/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/demohtml/HTMLParser.java index 4659f96b87f..ff754c0c594 100644 --- a/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/demohtml/HTMLParser.java +++ b/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/demohtml/HTMLParser.java @@ -227,7 +227,7 @@ InterruptedException { Token t1, t2; boolean inImg = false; t1 = jj_consume_token(TagName); - String tagName = t1.image.toLowerCase(Locale.ENGLISH); + String tagName = t1.image.toLowerCase(Locale.ROOT); if(Tags.WS_ELEMS.contains(tagName) ) { addSpace(); } @@ -264,7 +264,7 @@ InterruptedException { ) && t2 != null) { - currentMetaTag=t2.image.toLowerCase(Locale.ENGLISH); + currentMetaTag=t2.image.toLowerCase(Locale.ROOT); if(currentMetaTag != null && currentMetaContent != null) { addMetaTag(); } @@ -272,7 +272,7 @@ InterruptedException { if(inMetaTag && t1.image.equalsIgnoreCase("content") && t2 != null) { - currentMetaContent=t2.image.toLowerCase(Locale.ENGLISH); + currentMetaContent=t2.image.toLowerCase(Locale.ROOT); if(currentMetaTag != null && currentMetaContent != null) { addMetaTag(); } diff --git a/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/demohtml/HTMLParser.jj b/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/demohtml/HTMLParser.jj index 43b4eda54ad..4b1ed653f7c 100644 --- a/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/demohtml/HTMLParser.jj +++ b/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/demohtml/HTMLParser.jj @@ -227,7 +227,7 @@ void Tag() throws IOException : } { t1= { - String tagName = t1.image.toLowerCase(Locale.ENGLISH); + String tagName = t1.image.toLowerCase(Locale.ROOT); if(Tags.WS_ELEMS.contains(tagName) ) { addSpace(); } @@ -249,7 +249,7 @@ void Tag() throws IOException : ) && t2 != null) { - currentMetaTag=t2.image.toLowerCase(Locale.ENGLISH); + currentMetaTag=t2.image.toLowerCase(Locale.ROOT); if(currentMetaTag != null && currentMetaContent != null) { addMetaTag(); } @@ -257,7 +257,7 @@ void Tag() throws IOException : if(inMetaTag && t1.image.equalsIgnoreCase("content") && t2 != null) { - currentMetaContent=t2.image.toLowerCase(Locale.ENGLISH); + currentMetaContent=t2.image.toLowerCase(Locale.ROOT); if(currentMetaTag != null && currentMetaContent != null) { addMetaTag(); } diff --git a/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/SearchWithSortTask.java b/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/SearchWithSortTask.java index c7c893694a0..91fc485ceab 100644 --- a/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/SearchWithSortTask.java +++ b/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/SearchWithSortTask.java @@ -77,7 +77,7 @@ public class SearchWithSortTask extends ReadTask { } else { throw new RuntimeException("You must specify the sort type ie page:int,subject:string"); } - sortField0 = new SortField(fieldName, SortField.Type.valueOf(typeString.toUpperCase(Locale.ENGLISH))); + sortField0 = new SortField(fieldName, SortField.Type.valueOf(typeString.toUpperCase(Locale.ROOT))); } sortFields[upto++] = sortField0; } diff --git a/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/utils/StreamUtils.java b/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/utils/StreamUtils.java index fedad363c63..a2c25ba30f5 100644 --- a/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/utils/StreamUtils.java +++ b/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/utils/StreamUtils.java @@ -99,7 +99,7 @@ public class StreamUtils { String fileName = file.getName(); int idx = fileName.lastIndexOf('.'); if (idx != -1) { - type = extensionToType.get(fileName.substring(idx).toLowerCase(Locale.ENGLISH)); + type = extensionToType.get(fileName.substring(idx).toLowerCase(Locale.ROOT)); } return type==null ? Type.PLAIN : type; } diff --git a/lucene/core/src/java/org/apache/lucene/document/DateTools.java b/lucene/core/src/java/org/apache/lucene/document/DateTools.java index cf9fdd74e03..1cc3a4d8589 100644 --- a/lucene/core/src/java/org/apache/lucene/document/DateTools.java +++ b/lucene/core/src/java/org/apache/lucene/document/DateTools.java @@ -53,7 +53,7 @@ public class DateTools { private static final ThreadLocal TL_CAL = new ThreadLocal() { @Override protected Calendar initialValue() { - return Calendar.getInstance(GMT, Locale.US); + return Calendar.getInstance(GMT, Locale.ROOT); } }; @@ -194,7 +194,7 @@ public class DateTools { this.formatLen = formatLen; // formatLen 10's place: 11111111 // formatLen 1's place: 12345678901234567 - this.format = new SimpleDateFormat("yyyyMMddHHmmssSSS".substring(0,formatLen),Locale.US); + this.format = new SimpleDateFormat("yyyyMMddHHmmssSSS".substring(0,formatLen),Locale.ROOT); this.format.setTimeZone(GMT); } @@ -202,7 +202,7 @@ public class DateTools { * in lowercase (for backwards compatibility) */ @Override public String toString() { - return super.toString().toLowerCase(Locale.ENGLISH); + return super.toString().toLowerCase(Locale.ROOT); } } diff --git a/lucene/core/src/java/org/apache/lucene/util/RamUsageEstimator.java b/lucene/core/src/java/org/apache/lucene/util/RamUsageEstimator.java index 9e3a7933caf..3b722152ba8 100644 --- a/lucene/core/src/java/org/apache/lucene/util/RamUsageEstimator.java +++ b/lucene/core/src/java/org/apache/lucene/util/RamUsageEstimator.java @@ -559,7 +559,7 @@ public final class RamUsageEstimator { */ public static String humanReadableUnits(long bytes) { return humanReadableUnits(bytes, - new DecimalFormat("0.#", DecimalFormatSymbols.getInstance(Locale.ENGLISH))); + new DecimalFormat("0.#", DecimalFormatSymbols.getInstance(Locale.ROOT))); } /** diff --git a/lucene/core/src/java/org/apache/lucene/util/Version.java b/lucene/core/src/java/org/apache/lucene/util/Version.java index 194d59a201b..3ae1753041e 100644 --- a/lucene/core/src/java/org/apache/lucene/util/Version.java +++ b/lucene/core/src/java/org/apache/lucene/util/Version.java @@ -73,7 +73,7 @@ public enum Version { } public static Version parseLeniently(String version) { - String parsedMatchVersion = version.toUpperCase(Locale.ENGLISH); + String parsedMatchVersion = version.toUpperCase(Locale.ROOT); return Version.valueOf(parsedMatchVersion.replaceFirst("^(\\d)\\.(\\d)$", "LUCENE_$1$2")); } } \ No newline at end of file diff --git a/lucene/core/src/test/org/apache/lucene/analysis/tokenattributes/TestCharTermAttributeImpl.java b/lucene/core/src/test/org/apache/lucene/analysis/tokenattributes/TestCharTermAttributeImpl.java index 5122034edf9..7b1e2695b45 100644 --- a/lucene/core/src/test/org/apache/lucene/analysis/tokenattributes/TestCharTermAttributeImpl.java +++ b/lucene/core/src/test/org/apache/lucene/analysis/tokenattributes/TestCharTermAttributeImpl.java @@ -159,7 +159,7 @@ public class TestCharTermAttributeImpl extends LuceneTestCase { public void testAppendableInterface() { CharTermAttributeImpl t = new CharTermAttributeImpl(); - Formatter formatter = new Formatter(t, Locale.US); + Formatter formatter = new Formatter(t, Locale.ROOT); formatter.format("%d", 1234); assertEquals("1234", t.toString()); formatter.format("%d", 5678); diff --git a/lucene/core/src/test/org/apache/lucene/codecs/pulsing/Test10KPulsings.java b/lucene/core/src/test/org/apache/lucene/codecs/pulsing/Test10KPulsings.java index 0bf3ad526b1..30ebd775f93 100644 --- a/lucene/core/src/test/org/apache/lucene/codecs/pulsing/Test10KPulsings.java +++ b/lucene/core/src/test/org/apache/lucene/codecs/pulsing/Test10KPulsings.java @@ -71,7 +71,7 @@ public class Test10KPulsings extends LuceneTestCase { Field field = newField("field", "", ft); document.add(field); - NumberFormat df = new DecimalFormat("00000", new DecimalFormatSymbols(Locale.ENGLISH)); + NumberFormat df = new DecimalFormat("00000", new DecimalFormatSymbols(Locale.ROOT)); for (int i = 0; i < 10050; i++) { field.setStringValue(df.format(i)); @@ -122,7 +122,7 @@ public class Test10KPulsings extends LuceneTestCase { Field field = newField("field", "", ft); document.add(field); - NumberFormat df = new DecimalFormat("00000", new DecimalFormatSymbols(Locale.ENGLISH)); + NumberFormat df = new DecimalFormat("00000", new DecimalFormatSymbols(Locale.ROOT)); final int freq = freqCutoff + 1; diff --git a/lucene/core/src/test/org/apache/lucene/document/TestDateTools.java b/lucene/core/src/test/org/apache/lucene/document/TestDateTools.java index a60d155f3dd..c42388980da 100644 --- a/lucene/core/src/test/org/apache/lucene/document/TestDateTools.java +++ b/lucene/core/src/test/org/apache/lucene/document/TestDateTools.java @@ -180,7 +180,7 @@ public class TestDateTools extends LuceneTestCase { } private String isoFormat(Date date) { - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS", Locale.US); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS", Locale.ROOT); sdf.setTimeZone(TimeZone.getTimeZone("GMT")); return sdf.format(date); } diff --git a/lucene/core/src/test/org/apache/lucene/search/TestMultiValuedNumericRangeQuery.java b/lucene/core/src/test/org/apache/lucene/search/TestMultiValuedNumericRangeQuery.java index 3d8221b950f..86c690454fe 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestMultiValuedNumericRangeQuery.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestMultiValuedNumericRangeQuery.java @@ -44,7 +44,7 @@ public class TestMultiValuedNumericRangeQuery extends LuceneTestCase { newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random())) .setMaxBufferedDocs(_TestUtil.nextInt(random(), 50, 1000))); - DecimalFormat format = new DecimalFormat("00000000000", new DecimalFormatSymbols(Locale.US)); + DecimalFormat format = new DecimalFormat("00000000000", new DecimalFormatSymbols(Locale.ROOT)); int num = atLeast(500); for (int l = 0; l < num; l++) { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestRegexpRandom.java b/lucene/core/src/test/org/apache/lucene/search/TestRegexpRandom.java index f1562627dd8..97015d5f2ee 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestRegexpRandom.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestRegexpRandom.java @@ -58,7 +58,7 @@ public class TestRegexpRandom extends LuceneTestCase { Field field = newField("field", "", customType); doc.add(field); - NumberFormat df = new DecimalFormat("000", new DecimalFormatSymbols(Locale.ENGLISH)); + NumberFormat df = new DecimalFormat("000", new DecimalFormatSymbols(Locale.ROOT)); for (int i = 0; i < 1000; i++) { field.setStringValue(df.format(i)); writer.addDocument(doc); diff --git a/lucene/core/src/test/org/apache/lucene/search/TestWildcardRandom.java b/lucene/core/src/test/org/apache/lucene/search/TestWildcardRandom.java index ab8217f3fc8..9396efb06f6 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestWildcardRandom.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestWildcardRandom.java @@ -54,7 +54,7 @@ public class TestWildcardRandom extends LuceneTestCase { Field field = newStringField("field", "", Field.Store.NO); doc.add(field); - NumberFormat df = new DecimalFormat("000", new DecimalFormatSymbols(Locale.ENGLISH)); + NumberFormat df = new DecimalFormat("000", new DecimalFormatSymbols(Locale.ROOT)); for (int i = 0; i < 1000; i++) { field.setStringValue(df.format(i)); writer.addDocument(doc); diff --git a/lucene/core/src/test/org/apache/lucene/util/StressRamUsageEstimator.java b/lucene/core/src/test/org/apache/lucene/util/StressRamUsageEstimator.java index 1ca105b8178..820230f3bd6 100644 --- a/lucene/core/src/test/org/apache/lucene/util/StressRamUsageEstimator.java +++ b/lucene/core/src/test/org/apache/lucene/util/StressRamUsageEstimator.java @@ -59,7 +59,7 @@ public class StressRamUsageEstimator extends LuceneTestCase { // Check the current memory consumption and provide the estimate. long jvmUsed = memoryMXBean.getHeapMemoryUsage().getUsed(); long estimated = RamUsageEstimator.sizeOf(first); - System.out.println(String.format(Locale.ENGLISH, "%10d, %10d", + System.out.println(String.format(Locale.ROOT, "%10d, %10d", jvmUsed, estimated)); // Make a batch of objects. @@ -125,7 +125,7 @@ public class StressRamUsageEstimator extends LuceneTestCase { break; } - System.out.println(String.format(Locale.ENGLISH, "%10s\t%10s\t%10s", + System.out.println(String.format(Locale.ROOT, "%10s\t%10s\t%10s", RamUsageEstimator.humanReadableUnits(mu.getUsed()), RamUsageEstimator.humanReadableUnits(mu.getMax()), RamUsageEstimator.humanReadableUnits(estimated))); diff --git a/lucene/core/src/test/org/apache/lucene/util/fst/TestFSTs.java b/lucene/core/src/test/org/apache/lucene/util/fst/TestFSTs.java index 906921e18e1..9bc2f980fe5 100644 --- a/lucene/core/src/test/org/apache/lucene/util/fst/TestFSTs.java +++ b/lucene/core/src/test/org/apache/lucene/util/fst/TestFSTs.java @@ -1298,7 +1298,7 @@ public class TestFSTs extends LuceneTestCase { ord++; if (ord % 500000 == 0) { System.out.println( - String.format(Locale.ENGLISH, + String.format(Locale.ROOT, "%6.2fs: %9d...", ((System.currentTimeMillis() - tStart) / 1000.0), ord)); } if (ord >= limit) { diff --git a/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/BreakIteratorBoundaryScannerTest.java b/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/BreakIteratorBoundaryScannerTest.java index 78f287f4690..4134bb3b8cf 100644 --- a/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/BreakIteratorBoundaryScannerTest.java +++ b/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/BreakIteratorBoundaryScannerTest.java @@ -30,7 +30,7 @@ public class BreakIteratorBoundaryScannerTest extends LuceneTestCase { public void testOutOfRange() throws Exception { StringBuilder text = new StringBuilder(TEXT); - BreakIterator bi = BreakIterator.getWordInstance(Locale.ENGLISH); + BreakIterator bi = BreakIterator.getWordInstance(Locale.ROOT); BoundaryScanner scanner = new BreakIteratorBoundaryScanner(bi); int start = TEXT.length() + 1; @@ -44,7 +44,7 @@ public class BreakIteratorBoundaryScannerTest extends LuceneTestCase { public void testWordBoundary() throws Exception { StringBuilder text = new StringBuilder(TEXT); - BreakIterator bi = BreakIterator.getWordInstance(Locale.ENGLISH); + BreakIterator bi = BreakIterator.getWordInstance(Locale.ROOT); BoundaryScanner scanner = new BreakIteratorBoundaryScanner(bi); int start = TEXT.indexOf("formance"); diff --git a/lucene/queries/src/test/org/apache/lucene/queries/ChainedFilterTest.java b/lucene/queries/src/test/org/apache/lucene/queries/ChainedFilterTest.java index 6b78b483e09..2b588b737ba 100644 --- a/lucene/queries/src/test/org/apache/lucene/queries/ChainedFilterTest.java +++ b/lucene/queries/src/test/org/apache/lucene/queries/ChainedFilterTest.java @@ -183,7 +183,7 @@ public class ChainedFilterTest extends LuceneTestCase { /* private Date parseDate(String s) throws ParseException { - return new SimpleDateFormat("yyyy MMM dd", Locale.US).parse(s); + return new SimpleDateFormat("yyyy MMM dd", Locale.ROOT).parse(s); } */ diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/nodes/NumericQueryNode.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/nodes/NumericQueryNode.java index 139da066ed6..03b65da5d0b 100644 --- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/nodes/NumericQueryNode.java +++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/nodes/NumericQueryNode.java @@ -91,7 +91,7 @@ public class NumericQueryNode extends QueryNodeImpl implements */ protected CharSequence getTermEscaped(EscapeQuerySyntax escaper) { return escaper.escape(NumberFormat.getNumberInstance().format(this.value), - Locale.ENGLISH, Type.NORMAL); + Locale.ROOT, Type.NORMAL); } public CharSequence toQueryString(EscapeQuerySyntax escapeSyntaxParser) { diff --git a/lucene/spatial/src/java/org/apache/lucene/spatial/bbox/BBoxStrategy.java b/lucene/spatial/src/java/org/apache/lucene/spatial/bbox/BBoxStrategy.java index 1631d927779..bb20b4f2b23 100644 --- a/lucene/spatial/src/java/org/apache/lucene/spatial/bbox/BBoxStrategy.java +++ b/lucene/spatial/src/java/org/apache/lucene/spatial/bbox/BBoxStrategy.java @@ -122,7 +122,7 @@ public class BBoxStrategy extends SpatialStrategy { ff.setIndexOptions(IndexOptions.DOCS_ONLY); ff.freeze(); - NumberFormat nf = NumberFormat.getInstance( Locale.US ); + NumberFormat nf = NumberFormat.getInstance( Locale.ROOT ); nf.setMaximumFractionDigits( 5 ); nf.setMinimumFractionDigits( 5 ); nf.setGroupingUsed(false); diff --git a/lucene/spatial/src/java/org/apache/lucene/spatial/query/SpatialOperation.java b/lucene/spatial/src/java/org/apache/lucene/spatial/query/SpatialOperation.java index 9a3732143b4..1d65b930c7b 100644 --- a/lucene/spatial/src/java/org/apache/lucene/spatial/query/SpatialOperation.java +++ b/lucene/spatial/src/java/org/apache/lucene/spatial/query/SpatialOperation.java @@ -61,14 +61,14 @@ public class SpatialOperation implements Serializable { this.sourceNeedsArea = sourceNeedsArea; this.targetNeedsArea = targetNeedsArea; registry.put(name, this); - registry.put(name.toUpperCase(Locale.US), this); + registry.put(name.toUpperCase(Locale.ROOT), this); list.add( this ); } public static SpatialOperation get( String v ) { SpatialOperation op = registry.get( v ); if( op == null ) { - op = registry.get(v.toUpperCase(Locale.US)); + op = registry.get(v.toUpperCase(Locale.ROOT)); } if( op == null ) { throw new InvalidSpatialArgument("Unknown Operation: " + v ); diff --git a/lucene/suggest/src/java/org/apache/lucene/search/spell/DirectSpellChecker.java b/lucene/suggest/src/java/org/apache/lucene/search/spell/DirectSpellChecker.java index a3604196b87..55976900f93 100644 --- a/lucene/suggest/src/java/org/apache/lucene/search/spell/DirectSpellChecker.java +++ b/lucene/suggest/src/java/org/apache/lucene/search/spell/DirectSpellChecker.java @@ -320,7 +320,7 @@ public class DirectSpellChecker { return new SuggestWord[0]; if (lowerCaseTerms) { - term = new Term(term.field(), text.toLowerCase(Locale.ENGLISH)); + term = new Term(term.field(), text.toLowerCase(Locale.ROOT)); } int docfreq = ir.docFreq(term); diff --git a/lucene/suggest/src/java/org/apache/lucene/search/suggest/fst/Sort.java b/lucene/suggest/src/java/org/apache/lucene/search/suggest/fst/Sort.java index a1d0f99b218..83cb1bf32c5 100644 --- a/lucene/suggest/src/java/org/apache/lucene/search/suggest/fst/Sort.java +++ b/lucene/suggest/src/java/org/apache/lucene/search/suggest/fst/Sort.java @@ -132,7 +132,7 @@ public final class Sort { @Override public String toString() { - return String.format(Locale.ENGLISH, + return String.format(Locale.ROOT, "time=%.2f sec. total (%.2f reading, %.2f sorting, %.2f merging), lines=%d, temp files=%d, merges=%d, soft ram limit=%.2f MB", totalTime / 1000.0d, readTime / 1000.0d, sortTime / 1000.0d, mergeTime / 1000.0d, lines, tempMergeFiles, mergeRounds, diff --git a/lucene/suggest/src/test/org/apache/lucene/search/suggest/Average.java b/lucene/suggest/src/test/org/apache/lucene/search/suggest/Average.java index c405a3d51dc..411b5a1cfdf 100644 --- a/lucene/suggest/src/test/org/apache/lucene/search/suggest/Average.java +++ b/lucene/suggest/src/test/org/apache/lucene/search/suggest/Average.java @@ -47,7 +47,7 @@ final class Average public String toString() { - return String.format(Locale.ENGLISH, "%.0f [+- %.2f]", + return String.format(Locale.ROOT, "%.0f [+- %.2f]", avg, stddev); } diff --git a/lucene/suggest/src/test/org/apache/lucene/search/suggest/LookupBenchmarkTest.java b/lucene/suggest/src/test/org/apache/lucene/search/suggest/LookupBenchmarkTest.java index 9126730e505..195ad598a5d 100644 --- a/lucene/suggest/src/test/org/apache/lucene/search/suggest/LookupBenchmarkTest.java +++ b/lucene/suggest/src/test/org/apache/lucene/search/suggest/LookupBenchmarkTest.java @@ -119,7 +119,7 @@ public class LookupBenchmarkTest extends LuceneTestCase { }); System.err.println( - String.format(Locale.ENGLISH, "%-15s input: %d, time[ms]: %s", + String.format(Locale.ROOT, "%-15s input: %d, time[ms]: %s", cls.getSimpleName(), dictionaryInput.length, result.average.toString())); @@ -134,7 +134,7 @@ public class LookupBenchmarkTest extends LuceneTestCase { for (Class cls : benchmarkClasses) { Lookup lookup = buildLookup(cls, dictionaryInput); System.err.println( - String.format(Locale.ENGLISH, "%-15s size[B]:%,13d", + String.format(Locale.ROOT, "%-15s size[B]:%,13d", lookup.getClass().getSimpleName(), RamUsageEstimator.sizeOf(lookup))); } @@ -181,7 +181,7 @@ public class LookupBenchmarkTest extends LuceneTestCase { */ public void runPerformanceTest(final int minPrefixLen, final int maxPrefixLen, final int num, final boolean onlyMorePopular) throws Exception { - System.err.println(String.format(Locale.ENGLISH, + System.err.println(String.format(Locale.ROOT, "-- prefixes: %d-%d, num: %d, onlyMorePopular: %s", minPrefixLen, maxPrefixLen, num, onlyMorePopular)); @@ -206,7 +206,7 @@ public class LookupBenchmarkTest extends LuceneTestCase { }); System.err.println( - String.format(Locale.ENGLISH, "%-15s queries: %d, time[ms]: %s, ~kQPS: %.0f", + String.format(Locale.ROOT, "%-15s queries: %d, time[ms]: %s, ~kQPS: %.0f", lookup.getClass().getSimpleName(), input.size(), result.average.toString(), diff --git a/lucene/suggest/src/test/org/apache/lucene/search/suggest/fst/FSTCompletionTest.java b/lucene/suggest/src/test/org/apache/lucene/search/suggest/fst/FSTCompletionTest.java index c0a853efc6a..71f9114e8a9 100644 --- a/lucene/suggest/src/test/org/apache/lucene/search/suggest/fst/FSTCompletionTest.java +++ b/lucene/suggest/src/test/org/apache/lucene/search/suggest/fst/FSTCompletionTest.java @@ -233,9 +233,9 @@ public class FSTCompletionTest extends LuceneTestCase { StringBuilder b = new StringBuilder(); String format = "%" + colLen + "s " + "%" + colLen + "s\n"; - b.append(String.format(Locale.ENGLISH, format, "Expected", "Result")); + b.append(String.format(Locale.ROOT, format, "Expected", "Result")); for (int i = 0; i < Math.max(result.length, expected.length); i++) { - b.append(String.format(Locale.ENGLISH, format, + b.append(String.format(Locale.ROOT, format, i < expected.length ? expected[i] : "--", i < result.length ? result[i] : "--")); } diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/RandomCodec.java b/lucene/test-framework/src/java/org/apache/lucene/index/RandomCodec.java index 6224309d4c6..1c113d38abc 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/index/RandomCodec.java +++ b/lucene/test-framework/src/java/org/apache/lucene/index/RandomCodec.java @@ -71,7 +71,7 @@ public class RandomCodec extends Lucene40Codec { codec = formats.get(Math.abs(perFieldSeed ^ name.hashCode()) % formats.size()); if (codec instanceof SimpleTextPostingsFormat && perFieldSeed % 5 != 0) { // make simpletext rarer, choose again - codec = formats.get(Math.abs(perFieldSeed ^ name.toUpperCase(Locale.ENGLISH).hashCode()) % formats.size()); + codec = formats.get(Math.abs(perFieldSeed ^ name.toUpperCase(Locale.ROOT).hashCode()) % formats.size()); } previousMappings.put(name, codec); // Safety: diff --git a/lucene/test-framework/src/java/org/apache/lucene/search/CheckHits.java b/lucene/test-framework/src/java/org/apache/lucene/search/CheckHits.java index 70a4a98cc6c..730f253bc8b 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/search/CheckHits.java +++ b/lucene/test-framework/src/java/org/apache/lucene/search/CheckHits.java @@ -357,7 +357,7 @@ public class CheckHits { // - end with one of: "product of:", "sum of:", "max of:", or // - have "max plus times others" (where is float). float x = 0; - String descr = expl.getDescription().toLowerCase(Locale.ENGLISH); + String descr = expl.getDescription().toLowerCase(Locale.ROOT); boolean productOf = descr.endsWith("product of:"); boolean sumOf = descr.endsWith("sum of:"); boolean maxOf = descr.endsWith("max of:"); diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleIcuHack.java b/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleIcuHack.java index 91964d1a7ac..78aa6b6bf7a 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleIcuHack.java +++ b/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleIcuHack.java @@ -39,7 +39,7 @@ final class TestRuleIcuHack implements TestRule { if (!icuTested.getAndSet(true)) { Locale previous = Locale.getDefault(); try { - Locale.setDefault(Locale.US); + Locale.setDefault(Locale.ROOT); Class.forName("com.ibm.icu.util.ULocale"); } catch (ClassNotFoundException cnfe) { // ignore if no ICU is in classpath diff --git a/lucene/tools/src/java/org/apache/lucene/validation/ForbiddenApisCheckTask.java b/lucene/tools/src/java/org/apache/lucene/validation/ForbiddenApisCheckTask.java index 2012a055445..737bb958871 100644 --- a/lucene/tools/src/java/org/apache/lucene/validation/ForbiddenApisCheckTask.java +++ b/lucene/tools/src/java/org/apache/lucene/validation/ForbiddenApisCheckTask.java @@ -168,7 +168,7 @@ public class ForbiddenApisCheckTask extends Task { violations[0]++; final StringBuilder sb = new StringBuilder(" in ").append(className); if (source != null && lineNo >= 0) { - new Formatter(sb, Locale.ENGLISH).format(" (%s:%d)", source, lineNo).flush(); + new Formatter(sb, Locale.ROOT).format(" (%s:%d)", source, lineNo).flush(); } log(sb.toString(), Project.MSG_ERR); } @@ -251,7 +251,7 @@ public class ForbiddenApisCheckTask extends Task { checked++; } - log(String.format(Locale.ENGLISH, + log(String.format(Locale.ROOT, "Scanned %d class file(s) for forbidden method invocations (in %.2fs), %d error(s).", checked, (System.currentTimeMillis() - start) / 1000.0, errors), errors > 0 ? Project.MSG_ERR : Project.MSG_INFO); diff --git a/lucene/tools/src/java/org/apache/lucene/validation/LicenseCheckTask.java b/lucene/tools/src/java/org/apache/lucene/validation/LicenseCheckTask.java index 0704ea7f92c..1be90efc01c 100644 --- a/lucene/tools/src/java/org/apache/lucene/validation/LicenseCheckTask.java +++ b/lucene/tools/src/java/org/apache/lucene/validation/LicenseCheckTask.java @@ -140,7 +140,7 @@ public class LicenseCheckTask extends Task { checked++; } - log(String.format(Locale.ENGLISH, + log(String.format(Locale.ROOT, "Scanned %d JAR file(s) for licenses (in %.2fs.), %d error(s).", checked, (System.currentTimeMillis() - start) / 1000.0, errors), errors > 0 ? Project.MSG_ERR : Project.MSG_INFO); @@ -255,7 +255,7 @@ outer: private static final String createChecksumString(byte[] digest) { StringBuilder checksum = new StringBuilder(); for (int i = 0; i < digest.length; i++) { - checksum.append(String.format(Locale.ENGLISH, "%02x", + checksum.append(String.format(Locale.ROOT, "%02x", CHECKSUM_BYTE_MASK & digest[i])); } return checksum.toString(); diff --git a/solr/contrib/analysis-extras/src/java/org/apache/solr/analysis/MorfologikFilterFactory.java b/solr/contrib/analysis-extras/src/java/org/apache/solr/analysis/MorfologikFilterFactory.java index 764d622eb37..4f79f1af8e6 100644 --- a/solr/contrib/analysis-extras/src/java/org/apache/solr/analysis/MorfologikFilterFactory.java +++ b/solr/contrib/analysis-extras/src/java/org/apache/solr/analysis/MorfologikFilterFactory.java @@ -69,7 +69,7 @@ public class MorfologikFilterFactory extends TokenFilterFactory { String dictionaryName = args.get(DICTIONARY_SCHEMA_ATTRIBUTE); if (dictionaryName != null && !dictionaryName.isEmpty()) { try { - DICTIONARY dictionary = DICTIONARY.valueOf(dictionaryName.toUpperCase(Locale.ENGLISH)); + DICTIONARY dictionary = DICTIONARY.valueOf(dictionaryName.toUpperCase(Locale.ROOT)); assert dictionary != null; this.dictionary = dictionary; } catch (IllegalArgumentException e) { diff --git a/solr/contrib/dataimporthandler-extras/src/java/org/apache/solr/handler/dataimport/MailEntityProcessor.java b/solr/contrib/dataimporthandler-extras/src/java/org/apache/solr/handler/dataimport/MailEntityProcessor.java index fafb00fc3ab..57bf57585e7 100644 --- a/solr/contrib/dataimporthandler-extras/src/java/org/apache/solr/handler/dataimport/MailEntityProcessor.java +++ b/solr/contrib/dataimporthandler-extras/src/java/org/apache/solr/handler/dataimport/MailEntityProcessor.java @@ -171,7 +171,7 @@ public class MailEntityProcessor extends EntityProcessorBase { InputStream is = part.getInputStream(); String fileName = part.getFileName(); Metadata md = new Metadata(); - md.set(HttpHeaders.CONTENT_TYPE, ctype.getBaseType().toLowerCase(Locale.ENGLISH)); + md.set(HttpHeaders.CONTENT_TYPE, ctype.getBaseType().toLowerCase(Locale.ROOT)); md.set(TikaMetadataKeys.RESOURCE_NAME_KEY, fileName); String content = tika.parseToString(is, md); if (disp != null && disp.equalsIgnoreCase(Part.ATTACHMENT)) { diff --git a/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/DataImporter.java b/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/DataImporter.java index b21c40e70cd..357ccdb153f 100644 --- a/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/DataImporter.java +++ b/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/DataImporter.java @@ -128,7 +128,7 @@ public class DataImporter { private void loadSchemaFieldMap() { Map modLnvsf = new HashMap(); for (Map.Entry entry : schema.getFields().entrySet()) { - modLnvsf.put(entry.getKey().toLowerCase(Locale.ENGLISH), entry.getValue()); + modLnvsf.put(entry.getKey().toLowerCase(Locale.ROOT), entry.getValue()); } lowerNameVsSchemaField = Collections.unmodifiableMap(modLnvsf); } @@ -139,7 +139,7 @@ public class DataImporter { schemaField = schema.getFieldOrNull(caseInsensitiveName); } if (schemaField == null) { - schemaField = lowerNameVsSchemaField.get(caseInsensitiveName.toLowerCase(Locale.ENGLISH)); + schemaField = lowerNameVsSchemaField.get(caseInsensitiveName.toLowerCase(Locale.ROOT)); } return schemaField; } diff --git a/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/NumberFormatTransformer.java b/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/NumberFormatTransformer.java index 91e89964956..b03d93a3708 100644 --- a/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/NumberFormatTransformer.java +++ b/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/NumberFormatTransformer.java @@ -72,7 +72,7 @@ public class NumberFormatTransformer extends Transformer { } Object val = row.get(srcCol); - String styleSmall = style.toLowerCase(Locale.ENGLISH); + String styleSmall = style.toLowerCase(Locale.ROOT); if (val instanceof List) { List inputs = (List) val; diff --git a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestCachedSqlEntityProcessor.java b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestCachedSqlEntityProcessor.java index 9119e585d81..8ab2aada950 100644 --- a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestCachedSqlEntityProcessor.java +++ b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestCachedSqlEntityProcessor.java @@ -108,7 +108,7 @@ public class TestCachedSqlEntityProcessor extends AbstractDataImportHandlerTestC if (r == null) break; rows.add(r); - assertEquals(r.get("desc").toString().toUpperCase(Locale.ENGLISH), r.get("desc")); + assertEquals(r.get("desc").toString().toUpperCase(Locale.ROOT), r.get("desc")); } assertEquals(2, rows.size()); assertEquals(2, rows.get(0).size()); @@ -176,7 +176,7 @@ public class TestCachedSqlEntityProcessor extends AbstractDataImportHandlerTestC Object val = entry.getValue(); if (val instanceof String) { String s = (String) val; - entry.setValue(s.toUpperCase(Locale.ENGLISH)); + entry.setValue(s.toUpperCase(Locale.ROOT)); } } return row; diff --git a/solr/contrib/extraction/src/java/org/apache/solr/handler/extraction/ExtractingDocumentLoader.java b/solr/contrib/extraction/src/java/org/apache/solr/handler/extraction/ExtractingDocumentLoader.java index 526d5b996f8..0fee1f346f3 100644 --- a/solr/contrib/extraction/src/java/org/apache/solr/handler/extraction/ExtractingDocumentLoader.java +++ b/solr/contrib/extraction/src/java/org/apache/solr/handler/extraction/ExtractingDocumentLoader.java @@ -138,7 +138,7 @@ public class ExtractingDocumentLoader extends ContentStreamLoader { String streamType = req.getParams().get(ExtractingParams.STREAM_TYPE, null); if (streamType != null) { //Cache? Parsers are lightweight to construct and thread-safe, so I'm told - MediaType mt = MediaType.parse(streamType.trim().toLowerCase(Locale.ENGLISH)); + MediaType mt = MediaType.parse(streamType.trim().toLowerCase(Locale.ROOT)); parser = new DefaultParser(config.getMediaTypeRegistry()).getParsers().get(mt); } else { parser = autoDetectParser; diff --git a/solr/core/src/java/org/apache/solr/analysis/JapaneseTokenizerFactory.java b/solr/core/src/java/org/apache/solr/analysis/JapaneseTokenizerFactory.java index cf30e9755cd..bbc66d96423 100644 --- a/solr/core/src/java/org/apache/solr/analysis/JapaneseTokenizerFactory.java +++ b/solr/core/src/java/org/apache/solr/analysis/JapaneseTokenizerFactory.java @@ -93,7 +93,7 @@ public class JapaneseTokenizerFactory extends TokenizerFactory implements Resour private Mode getMode(Map args) { String mode = args.get(MODE); if (mode != null) { - return Mode.valueOf(mode.toUpperCase(Locale.ENGLISH)); + return Mode.valueOf(mode.toUpperCase(Locale.ROOT)); } else { return JapaneseTokenizer.DEFAULT_MODE; } diff --git a/solr/core/src/java/org/apache/solr/analysis/PhoneticFilterFactory.java b/solr/core/src/java/org/apache/solr/analysis/PhoneticFilterFactory.java index 5ecfcc3c4b2..4df05a47d9f 100644 --- a/solr/core/src/java/org/apache/solr/analysis/PhoneticFilterFactory.java +++ b/solr/core/src/java/org/apache/solr/analysis/PhoneticFilterFactory.java @@ -68,12 +68,12 @@ public class PhoneticFilterFactory extends TokenFilterFactory private static final Map> registry = new HashMap>(6); static { - registry.put("DoubleMetaphone".toUpperCase(Locale.ENGLISH), DoubleMetaphone.class); - registry.put("Metaphone".toUpperCase(Locale.ENGLISH), Metaphone.class); - registry.put("Soundex".toUpperCase(Locale.ENGLISH), Soundex.class); - registry.put("RefinedSoundex".toUpperCase(Locale.ENGLISH), RefinedSoundex.class); - registry.put("Caverphone".toUpperCase(Locale.ENGLISH), Caverphone2.class); - registry.put("ColognePhonetic".toUpperCase(Locale.ENGLISH), ColognePhonetic.class); + registry.put("DoubleMetaphone".toUpperCase(Locale.ROOT), DoubleMetaphone.class); + registry.put("Metaphone".toUpperCase(Locale.ROOT), Metaphone.class); + registry.put("Soundex".toUpperCase(Locale.ROOT), Soundex.class); + registry.put("RefinedSoundex".toUpperCase(Locale.ROOT), RefinedSoundex.class); + registry.put("Caverphone".toUpperCase(Locale.ROOT), Caverphone2.class); + registry.put("ColognePhonetic".toUpperCase(Locale.ROOT), ColognePhonetic.class); } protected boolean inject = true; @@ -93,7 +93,7 @@ public class PhoneticFilterFactory extends TokenFilterFactory throw new InitializationException("Missing required parameter: " + ENCODER + " [" + registry.keySet() + "]"); } - clazz = registry.get(name.toUpperCase(Locale.ENGLISH)); + clazz = registry.get(name.toUpperCase(Locale.ROOT)); if( clazz == null ) { clazz = resolveEncoder(name); } diff --git a/solr/core/src/java/org/apache/solr/core/CachingDirectoryFactory.java b/solr/core/src/java/org/apache/solr/core/CachingDirectoryFactory.java index 92b980dd1a4..99553f30e9d 100644 --- a/solr/core/src/java/org/apache/solr/core/CachingDirectoryFactory.java +++ b/solr/core/src/java/org/apache/solr/core/CachingDirectoryFactory.java @@ -198,7 +198,7 @@ public abstract class CachingDirectoryFactory extends DirectoryFactory { log.warn("No lockType configured for " + dir + " assuming 'simple'"); rawLockType = "simple"; } - final String lockType = rawLockType.toLowerCase(Locale.ENGLISH).trim(); + final String lockType = rawLockType.toLowerCase(Locale.ROOT).trim(); if ("simple".equals(lockType)) { // multiple SimpleFSLockFactory instances should be OK diff --git a/solr/core/src/java/org/apache/solr/core/CoreContainer.java b/solr/core/src/java/org/apache/solr/core/CoreContainer.java index b132dd629ad..4b3a20de332 100644 --- a/solr/core/src/java/org/apache/solr/core/CoreContainer.java +++ b/solr/core/src/java/org/apache/solr/core/CoreContainer.java @@ -781,7 +781,7 @@ public class CoreContainer if (schemaFile.exists()) { String key = schemaFile.getAbsolutePath() + ":" - + new SimpleDateFormat("yyyyMMddHHmmss", Locale.US).format(new Date( + + new SimpleDateFormat("yyyyMMddHHmmss", Locale.ROOT).format(new Date( schemaFile.lastModified())); schema = indexSchemaCache.get(key); if (schema == null) { diff --git a/solr/core/src/java/org/apache/solr/core/JmxMonitoredMap.java b/solr/core/src/java/org/apache/solr/core/JmxMonitoredMap.java index 818b062ff59..abd84c3a861 100644 --- a/solr/core/src/java/org/apache/solr/core/JmxMonitoredMap.java +++ b/solr/core/src/java/org/apache/solr/core/JmxMonitoredMap.java @@ -281,7 +281,7 @@ public class JmxMonitoredMap extends } else if (staticStats.contains(attribute) && attribute != null && attribute.length() > 0) { try { - String getter = "get" + attribute.substring(0, 1).toUpperCase(Locale.ENGLISH) + String getter = "get" + attribute.substring(0, 1).toUpperCase(Locale.ROOT) + attribute.substring(1); Method meth = infoBean.getClass().getMethod(getter); val = meth.invoke(infoBean); diff --git a/solr/core/src/java/org/apache/solr/core/SolrConfig.java b/solr/core/src/java/org/apache/solr/core/SolrConfig.java index c8d81bfb907..c85c4512af1 100644 --- a/solr/core/src/java/org/apache/solr/core/SolrConfig.java +++ b/solr/core/src/java/org/apache/solr/core/SolrConfig.java @@ -344,7 +344,7 @@ public class SolrConfig extends Config { /** Input must not be null */ public static LastModFrom parse(final String s) { try { - return valueOf(s.toUpperCase(Locale.ENGLISH)); + return valueOf(s.toUpperCase(Locale.ROOT)); } catch (Exception e) { log.warn( "Unrecognized value for lastModFrom: " + s, e); return BOGUS; diff --git a/solr/core/src/java/org/apache/solr/core/SolrCore.java b/solr/core/src/java/org/apache/solr/core/SolrCore.java index 834be655407..5ca71aefe27 100644 --- a/solr/core/src/java/org/apache/solr/core/SolrCore.java +++ b/solr/core/src/java/org/apache/solr/core/SolrCore.java @@ -1913,13 +1913,13 @@ public final class SolrCore implements SolrInfoMBean { Set hide = new HashSet(); for (String file : solrConfig.getResourceLoader().listConfigDir()) { - hide.add(file.toUpperCase(Locale.ENGLISH)); + hide.add(file.toUpperCase(Locale.ROOT)); } // except the "gettable" list StringTokenizer st = new StringTokenizer( gettable ); while( st.hasMoreTokens() ) { - hide.remove( st.nextToken().toUpperCase(Locale.ENGLISH) ); + hide.remove( st.nextToken().toUpperCase(Locale.ROOT) ); } for( String s : hide ) { invariants.add( ShowFileRequestHandler.HIDDEN, s ); diff --git a/solr/core/src/java/org/apache/solr/core/SolrDeletionPolicy.java b/solr/core/src/java/org/apache/solr/core/SolrDeletionPolicy.java index 6ac3f0a8836..9cf87596f3d 100644 --- a/solr/core/src/java/org/apache/solr/core/SolrDeletionPolicy.java +++ b/solr/core/src/java/org/apache/solr/core/SolrDeletionPolicy.java @@ -145,7 +145,7 @@ public class SolrDeletionPolicy implements IndexDeletionPolicy, NamedListInitial try { if (maxCommitAge != null) { if (maxCommitAgeTimeStamp==-1) { - DateMathParser dmp = new DateMathParser(DateField.UTC, Locale.US); + DateMathParser dmp = new DateMathParser(DateField.UTC, Locale.ROOT); maxCommitAgeTimeStamp = dmp.parseMath(maxCommitAge).getTime(); } if (IndexDeletionPolicyWrapper.getCommitTimestamp(commit) < maxCommitAgeTimeStamp) { diff --git a/solr/core/src/java/org/apache/solr/handler/PingRequestHandler.java b/solr/core/src/java/org/apache/solr/handler/PingRequestHandler.java index 68e06061367..bd3c62e3099 100644 --- a/solr/core/src/java/org/apache/solr/handler/PingRequestHandler.java +++ b/solr/core/src/java/org/apache/solr/handler/PingRequestHandler.java @@ -191,7 +191,7 @@ public class PingRequestHandler extends RequestHandlerBase implements SolrCoreAw } else { try { - action = ACTIONS.valueOf(actionParam.toUpperCase(Locale.ENGLISH)); + action = ACTIONS.valueOf(actionParam.toUpperCase(Locale.ROOT)); } catch (IllegalArgumentException iae){ throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, diff --git a/solr/core/src/java/org/apache/solr/handler/SnapPuller.java b/solr/core/src/java/org/apache/solr/handler/SnapPuller.java index a0518f49293..b93dc588a47 100644 --- a/solr/core/src/java/org/apache/solr/handler/SnapPuller.java +++ b/solr/core/src/java/org/apache/solr/handler/SnapPuller.java @@ -530,7 +530,7 @@ public class SnapPuller { * All the files are copied to a temp dir first */ private File createTempindexDir(SolrCore core) { - String tmpIdxDirName = "index." + new SimpleDateFormat(SnapShooter.DATE_FMT, Locale.US).format(new Date()); + String tmpIdxDirName = "index." + new SimpleDateFormat(SnapShooter.DATE_FMT, Locale.ROOT).format(new Date()); File tmpIdxDir = new File(core.getDataDir(), tmpIdxDirName); tmpIdxDir.mkdirs(); return tmpIdxDir; @@ -713,7 +713,7 @@ public class SnapPuller { } private String getDateAsStr(Date d) { - return new SimpleDateFormat(SnapShooter.DATE_FMT, Locale.US).format(d); + return new SimpleDateFormat(SnapShooter.DATE_FMT, Locale.ROOT).format(d); } /** diff --git a/solr/core/src/java/org/apache/solr/handler/SnapShooter.java b/solr/core/src/java/org/apache/solr/handler/SnapShooter.java index 45fdfd7dfae..02ac9dba151 100644 --- a/solr/core/src/java/org/apache/solr/handler/SnapShooter.java +++ b/solr/core/src/java/org/apache/solr/handler/SnapShooter.java @@ -91,7 +91,7 @@ public class SnapShooter { if(numberToKeep