--- old/make/jdk/src/classes/build/tools/cldrconverter/MetaZonesParseHandler.java 2018-04-06 10:43:18.343576909 -0700 +++ new/make/jdk/src/classes/build/tools/cldrconverter/MetaZonesParseHandler.java 2018-04-06 10:43:18.108572511 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2018, 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 @@ -27,6 +27,9 @@ import java.io.File; import java.io.IOException; +import java.util.*; +import java.util.stream.*; + import org.xml.sax.Attributes; import org.xml.sax.InputSource; import org.xml.sax.SAXException; @@ -34,6 +37,10 @@ class MetaZonesParseHandler extends AbstractLDMLHandler { private String tzid, metazone; + // for java.time.format.ZoneNames.java + private List mzoneMapEntryList = new ArrayList<>(); + private Map zones = new HashMap<>(); + MetaZonesParseHandler() { } @@ -64,6 +71,19 @@ pushIgnoredContainer(qName); break; + case "mapZone": + String territory = attributes.getValue("territory"); + if (territory.equals("001")) { + zones.put(attributes.getValue("other"), attributes.getValue("type")); + } else { + mzoneMapEntryList.add(String.format(" \"%s\", \"%s\", \"%s\",", + attributes.getValue("other"), + territory, + attributes.getValue("type"))); + } + pushIgnoredContainer(qName); + break; + case "version": case "generation": pushIgnoredContainer(qName); @@ -89,4 +109,12 @@ } currentContainer = currentContainer.getParent(); } + + public Map zidMap() { + return zones; + } + + public Stream mzoneMapEntry() { + return mzoneMapEntryList.stream(); + } }