--- a/make/jdk/src/classes/build/tools/cldrconverter/MetaZonesParseHandler.java Wed Apr 11 10:19:37 2018 +0100
+++ b/make/jdk/src/classes/build/tools/cldrconverter/MetaZonesParseHandler.java Wed Apr 11 09:14:47 2018 -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<String> {
private String tzid, metazone;
+ // for java.time.format.ZoneNames.java
+ private List<String> mzoneMapEntryList = new ArrayList<>();
+ private Map<String, String> 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<String, String> zidMap() {
+ return zones;
+ }
+
+ public Stream<String> mzoneMapEntry() {
+ return mzoneMapEntryList.stream();
+ }
}