8317126: Redundant entries in Windows tzmappings file

Reviewed-by: lancea, iris, joehw
This commit is contained in:
Naoto Sato 2023-09-29 16:36:29 +00:00
parent fa0697a637
commit 014c95a54d

View File

@ -1184,6 +1184,8 @@ public class CLDRConverter {
Files.createDirectories(Paths.get(DESTINATION_DIR, "windows", "conf"));
Files.write(Paths.get(DESTINATION_DIR, "windows", "conf", "tzmappings"),
handlerWinZones.keySet().stream()
.filter(k -> k.endsWith(":001") ||
!handlerWinZones.get(k).equals(handlerWinZones.get(k.replaceFirst(":\\w{2,3}$", ":001"))))
.map(k -> k + ":" + handlerWinZones.get(k) + ":")
.sorted(new Comparator<String>() {
public int compare(String t1, String t2) {