< prev index next >

make/jdk/src/classes/build/tools/cldrconverter/Bundle.java

Print this page

        

*** 31,40 **** --- 31,41 ---- import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Objects; + import java.util.stream.Collectors; class Bundle { static enum Type { LOCALENAMES, CURRENCYNAMES, TIMEZONENAMES, CALENDARDATA, FORMATDATA;
*** 51,60 **** --- 52,65 ---- "NumberPatterns/decimal", "NumberPatterns/currency", "NumberPatterns/percent" }; + private final static String[] COMPACT_NUMBER_PATTERN_KEYS = { + "short.CompactNumberPatterns", + "long.CompactNumberPatterns"}; + private final static String[] NUMBER_ELEMENT_KEYS = { "NumberElements/decimal", "NumberElements/group", "NumberElements/list", "NumberElements/percent",
*** 226,235 **** --- 231,250 ---- myMap.put("NumberPatterns", numberPatterns); break; } } + for (String k : COMPACT_NUMBER_PATTERN_KEYS) { + List<String> patterns = (List<String>) myMap.remove(k); + if (patterns != null) { + // Replace any null entry with empty strings. + patterns = patterns.stream() + .map(s -> s == null ? "" : s).collect(Collectors.toList()); + myMap.put(k, patterns); + } + } + // if myMap has any of NUMBER_ELEMENT_KEYS, create a complete NumberElements. String defaultScript = (String) myMap.get("DefaultNumberingSystem"); @SuppressWarnings("unchecked") List<String> scripts = (List<String>) myMap.get("numberingScripts"); if (defaultScript == null && scripts != null) {
< prev index next >