From 6578b3317685240484d7db95c8b5191bf6db9957 Mon Sep 17 00:00:00 2001 From: Naoto Sato Date: Thu, 7 Nov 2024 14:21:18 -0800 Subject: [PATCH] initial commit --- .../build/tools/cldrconverter/CLDRConverter.java | 4 ++++ .../tools/cldrconverter/WinZonesParseHandler.java | 14 ++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/make/jdk/src/classes/build/tools/cldrconverter/CLDRConverter.java b/make/jdk/src/classes/build/tools/cldrconverter/CLDRConverter.java index 8865e3908ae6b..e698bd7065277 100644 --- a/make/jdk/src/classes/build/tools/cldrconverter/CLDRConverter.java +++ b/make/jdk/src/classes/build/tools/cldrconverter/CLDRConverter.java @@ -1273,6 +1273,10 @@ private static Stream extractLinks(Path tzFile) { // Note: the entries are alphabetically sorted, *except* the "world" region // code, i.e., "001". It should be the last entry for the same windows time // zone name entries. (cf. TimeZone_md.c) + // + // The default entries from CLDR's windowsZones.xml file can be modified + // with WinZoneParseHandler.endDocument(), where mapping overrides + // can be specified. private static void generateWindowsTZMappings() throws Exception { Files.createDirectories(Paths.get(DESTINATION_DIR, "windows", "conf")); Files.write(Paths.get(DESTINATION_DIR, "windows", "conf", "tzmappings"), diff --git a/make/jdk/src/classes/build/tools/cldrconverter/WinZonesParseHandler.java b/make/jdk/src/classes/build/tools/cldrconverter/WinZonesParseHandler.java index a584358f0cbbf..a260bd417928c 100644 --- a/make/jdk/src/classes/build/tools/cldrconverter/WinZonesParseHandler.java +++ b/make/jdk/src/classes/build/tools/cldrconverter/WinZonesParseHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,7 +39,7 @@ * windowsZones.xml */ -class WinZonesParseHandler extends AbstractLDMLHandler { +class WinZonesParseHandler extends AbstractLDMLHandler { @Override public InputSource resolveEntity(String publicID, String systemID) throws IOException, SAXException { // avoid HTTP traffic to unicode.org @@ -65,4 +65,14 @@ public void startElement(String uri, String localName, String qName, Attributes break; } } + + @Override + public void endDocument() { + // Placeholder for patching old CLDR windowsZones mappings + getData().putAll( + Map.of( +// "Foo Standard Time:ZZ", "Foo/Bar" + ) + ); + } }