< prev index next >

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

Print this page
rev 56197 : imported patch 8230284

*** 508,517 **** --- 508,522 ---- // Get the target map, which contains all the data that should be // visible for the bundle's locale Map<String, Object> targetMap = bundle.getTargetMap(); + // for debugging + // if (bundle.getID().equals("root")) { + // dumpMap(targetMap); + // } + EnumSet<Bundle.Type> bundleTypes = bundle.getBundleTypes(); if (bundle.isRoot()) { // Add DateTimePatternChars because CLDR no longer supports localized patterns. targetMap.put("DateTimePatternChars", "GyMdkHmsSEDFwWahKzZ");
*** 889,904 **** @SuppressWarnings("unchecked") List<String> numberingScripts = (List<String>) map.remove("numberingScripts"); if (numberingScripts != null) { for (String script : numberingScripts) { ! copyIfPresent(map, script + "." + "NumberElements", formatData); } } else { copyIfPresent(map, "NumberElements", formatData); - } copyIfPresent(map, "NumberPatterns", formatData); copyIfPresent(map, "short.CompactNumberPatterns", formatData); copyIfPresent(map, "long.CompactNumberPatterns", formatData); // put extra number elements for available scripts into formatData, if it is "root" if (id.equals("root")) { --- 894,910 ---- @SuppressWarnings("unchecked") List<String> numberingScripts = (List<String>) map.remove("numberingScripts"); if (numberingScripts != null) { for (String script : numberingScripts) { ! copyIfPresent(map, script + ".NumberElements", formatData); ! copyIfPresent(map, script + ".NumberPatterns", formatData); } } else { copyIfPresent(map, "NumberElements", formatData); copyIfPresent(map, "NumberPatterns", formatData); + } copyIfPresent(map, "short.CompactNumberPatterns", formatData); copyIfPresent(map, "long.CompactNumberPatterns", formatData); // put extra number elements for available scripts into formatData, if it is "root" if (id.equals("root")) {
*** 1157,1162 **** --- 1163,1185 ---- } }) .collect(Collectors.toList()), StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING); } + + private static void dumpMap(Map<String, Object> map) { + map.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .map(e -> { + Object val = e.getValue(); + String valStr = null; + + if (val instanceof String[]) { + valStr = Arrays.asList((String[])val).toString(); + } else if (val != null) { + valStr = val.toString(); + } + return e.getKey() + " = " + valStr; + }) + .forEach(System.out::println); + } }
< prev index next >