Skip to content

Commit

Permalink
8212970: TZ database in "vanguard" format support
Browse files Browse the repository at this point in the history
Reviewed-by: rriggs, joehw, erikj, scolebourne
  • Loading branch information
naotoj committed Jul 26, 2019
1 parent e17feae commit c1a479a
Show file tree
Hide file tree
Showing 38 changed files with 478 additions and 20,110 deletions.
1 change: 1 addition & 0 deletions make/CompileToolsJdk.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ $(eval $(call IncludeCustomExtension, CompileTools.gmk))
BUILD_TOOLS_SRC_DIRS += \
$(TOPDIR)/make/jdk/src/classes \
$(BUILDTOOLS_OUTPUTDIR)/interim_cldrconverter_classes \
$(BUILDTOOLS_OUTPUTDIR)/interim_tzdb_classes \
#

$(eval $(call SetupJavaCompilation,BUILD_TOOLS_JDK, \
Expand Down
50 changes: 50 additions & 0 deletions make/CopyInterimTZDB.gmk
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#
# Copyright (c) 2019, 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
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#

default: all

include $(SPEC)
include MakeBase.gmk

##########################################################################################

### TZDB tool needs files from java.time.zone package

define tzdb_copyfiles
$(call MakeTargetDir)
$(RM) '$@'
$(SED) -e "s/package java.time.zone/package build.tools.tzdb/" \
< $(<) > $@
endef

$(eval $(call SetupCopyFiles,COPY_INTERIM_TZDB, \
SRC := $(TOPDIR)/src/java.base/share/classes/java/time/zone, \
DEST := $(BUILDTOOLS_OUTPUTDIR)/interim_tzdb_classes/build/tools/tzdb, \
FILES := ZoneRules.java ZoneOffsetTransition.java ZoneOffsetTransitionRule.java Ser.java, \
MACRO := tzdb_copyfiles))

##########################################################################################

all: $(COPY_INTERIM_TZDB)
8 changes: 6 additions & 2 deletions make/Main.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ interim-rmic:

interim-cldrconverter:
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CopyInterimCLDRConverter.gmk)

interim-tzdb:
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CopyInterimTZDB.gmk)


buildtools-jdk:
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileToolsJdk.gmk)
Expand All @@ -88,7 +92,7 @@ buildtools-hotspot:
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileToolsHotspot.gmk)

ALL_TARGETS += buildtools-langtools interim-langtools \
interim-rmic interim-cldrconverter buildtools-jdk buildtools-modules \
interim-rmic interim-cldrconverter interim-tzdb buildtools-jdk buildtools-modules \
buildtools-hotspot

################################################################################
Expand Down Expand Up @@ -648,7 +652,7 @@ else

interim-langtools: $(INTERIM_LANGTOOLS_GENSRC_TARGETS)

buildtools-jdk: interim-langtools interim-cldrconverter
buildtools-jdk: interim-langtools interim-cldrconverter interim-tzdb

buildtools-hotspot: interim-langtools

Expand Down
106 changes: 53 additions & 53 deletions make/data/tzdata/africa
Original file line number Diff line number Diff line change
Expand Up @@ -941,7 +941,7 @@ Rule Morocco 2012 only - Aug 20 2:00 1:00 -
Rule Morocco 2012 only - Sep 30 3:00 0 -
Rule Morocco 2013 only - Jul 7 3:00 0 -
Rule Morocco 2013 only - Aug 10 2:00 1:00 -
Rule Morocco 2013 2017 - Oct lastSun 3:00 0 -
Rule Morocco 2013 2018 - Oct lastSun 3:00 0 -
Rule Morocco 2014 2018 - Mar lastSun 2:00 1:00 -
Rule Morocco 2014 only - Jun 28 3:00 0 -
Rule Morocco 2014 only - Aug 2 2:00 1:00 -
Expand All @@ -953,53 +953,53 @@ Rule Morocco 2017 only - May 21 3:00 0 -
Rule Morocco 2017 only - Jul 2 2:00 1:00 -
Rule Morocco 2018 only - May 13 3:00 0 -
Rule Morocco 2018 only - Jun 17 2:00 1:00 -
Rule Morocco 2019 only - May 5 3:00 0 -
Rule Morocco 2019 only - Jun 9 2:00 1:00 -
Rule Morocco 2020 only - Apr 19 3:00 0 -
Rule Morocco 2020 only - May 24 2:00 1:00 -
Rule Morocco 2021 only - Apr 11 3:00 0 -
Rule Morocco 2021 only - May 16 2:00 1:00 -
Rule Morocco 2022 only - Mar 27 3:00 0 -
Rule Morocco 2022 only - May 8 2:00 1:00 -
Rule Morocco 2023 only - Mar 19 3:00 0 -
Rule Morocco 2023 only - Apr 23 2:00 1:00 -
Rule Morocco 2024 only - Mar 10 3:00 0 -
Rule Morocco 2024 only - Apr 14 2:00 1:00 -
Rule Morocco 2025 only - Feb 23 3:00 0 -
Rule Morocco 2025 only - Apr 6 2:00 1:00 -
Rule Morocco 2026 only - Feb 15 3:00 0 -
Rule Morocco 2026 only - Mar 22 2:00 1:00 -
Rule Morocco 2027 only - Feb 7 3:00 0 -
Rule Morocco 2027 only - Mar 14 2:00 1:00 -
Rule Morocco 2028 only - Jan 23 3:00 0 -
Rule Morocco 2028 only - Feb 27 2:00 1:00 -
Rule Morocco 2029 only - Jan 14 3:00 0 -
Rule Morocco 2029 only - Feb 18 2:00 1:00 -
Rule Morocco 2029 only - Dec 30 3:00 0 -
Rule Morocco 2030 only - Feb 10 2:00 1:00 -
Rule Morocco 2030 only - Dec 22 3:00 0 -
Rule Morocco 2031 only - Jan 26 2:00 1:00 -
Rule Morocco 2031 only - Dec 14 3:00 0 -
Rule Morocco 2032 only - Jan 18 2:00 1:00 -
Rule Morocco 2032 only - Nov 28 3:00 0 -
Rule Morocco 2033 only - Jan 9 2:00 1:00 -
Rule Morocco 2033 only - Nov 20 3:00 0 -
Rule Morocco 2033 only - Dec 25 2:00 1:00 -
Rule Morocco 2034 only - Nov 5 3:00 0 -
Rule Morocco 2034 only - Dec 17 2:00 1:00 -
Rule Morocco 2035 only - Oct 28 3:00 0 -
Rule Morocco 2035 only - Dec 2 2:00 1:00 -
Rule Morocco 2036 only - Oct 19 3:00 0 -
Rule Morocco 2036 only - Nov 23 2:00 1:00 -
Rule Morocco 2037 only - Oct 4 3:00 0 -
Rule Morocco 2037 only - Nov 15 2:00 1:00 -
Rule Morocco 2019 only - May 5 3:00 -1:00 -
Rule Morocco 2019 only - Jun 9 2:00 0 -
Rule Morocco 2020 only - Apr 19 3:00 -1:00 -
Rule Morocco 2020 only - May 24 2:00 0 -
Rule Morocco 2021 only - Apr 11 3:00 -1:00 -
Rule Morocco 2021 only - May 16 2:00 0 -
Rule Morocco 2022 only - Mar 27 3:00 -1:00 -
Rule Morocco 2022 only - May 8 2:00 0 -
Rule Morocco 2023 only - Mar 19 3:00 -1:00 -
Rule Morocco 2023 only - Apr 23 2:00 0 -
Rule Morocco 2024 only - Mar 10 3:00 -1:00 -
Rule Morocco 2024 only - Apr 14 2:00 0 -
Rule Morocco 2025 only - Feb 23 3:00 -1:00 -
Rule Morocco 2025 only - Apr 6 2:00 0 -
Rule Morocco 2026 only - Feb 15 3:00 -1:00 -
Rule Morocco 2026 only - Mar 22 2:00 0 -
Rule Morocco 2027 only - Feb 7 3:00 -1:00 -
Rule Morocco 2027 only - Mar 14 2:00 0 -
Rule Morocco 2028 only - Jan 23 3:00 -1:00 -
Rule Morocco 2028 only - Feb 27 2:00 0 -
Rule Morocco 2029 only - Jan 14 3:00 -1:00 -
Rule Morocco 2029 only - Feb 18 2:00 0 -
Rule Morocco 2029 only - Dec 30 3:00 -1:00 -
Rule Morocco 2030 only - Feb 10 2:00 0 -
Rule Morocco 2030 only - Dec 22 3:00 -1:00 -
Rule Morocco 2031 only - Jan 26 2:00 0 -
Rule Morocco 2031 only - Dec 14 3:00 -1:00 -
Rule Morocco 2032 only - Jan 18 2:00 0 -
Rule Morocco 2032 only - Nov 28 3:00 -1:00 -
Rule Morocco 2033 only - Jan 9 2:00 0 -
Rule Morocco 2033 only - Nov 20 3:00 -1:00 -
Rule Morocco 2033 only - Dec 25 2:00 0 -
Rule Morocco 2034 only - Nov 5 3:00 -1:00 -
Rule Morocco 2034 only - Dec 17 2:00 0 -
Rule Morocco 2035 only - Oct 28 3:00 -1:00 -
Rule Morocco 2035 only - Dec 2 2:00 0 -
Rule Morocco 2036 only - Oct 19 3:00 -1:00 -
Rule Morocco 2036 only - Nov 23 2:00 0 -
Rule Morocco 2037 only - Oct 4 3:00 -1:00 -
Rule Morocco 2037 only - Nov 15 2:00 0 -

# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Casablanca -0:30:20 - LMT 1913 Oct 26
0:00 Morocco +00/+01 1984 Mar 16
1:00 - +01 1986
0:00 Morocco +00/+01 2018 Oct 28 3:00
0:00 Morocco +00/+01
1:00 Morocco +01/+00

# Western Sahara
#
Expand All @@ -1015,7 +1015,7 @@ Zone Africa/Casablanca -0:30:20 - LMT 1913 Oct 26
Zone Africa/El_Aaiun -0:52:48 - LMT 1934 Jan # El Aaiún
-1:00 - -01 1976 Apr 14
0:00 Morocco +00/+01 2018 Oct 28 3:00
0:00 Morocco +00/+01
1:00 Morocco +01/+00

# Mozambique
#
Expand Down Expand Up @@ -1087,13 +1087,13 @@ Link Africa/Maputo Africa/Lusaka # Zambia

# RULE NAME FROM TO TYPE IN ON AT SAVE LETTER/S
# Vanguard section, for zic and other parsers that support negative DST.
#Rule Namibia 1994 only - Mar 21 0:00 -1:00 WAT
#Rule Namibia 1994 2017 - Sep Sun>=1 2:00 0 CAT
#Rule Namibia 1995 2017 - Apr Sun>=1 2:00 -1:00 WAT
Rule Namibia 1994 only - Mar 21 0:00 -1:00 WAT
Rule Namibia 1994 2017 - Sep Sun>=1 2:00 0 CAT
Rule Namibia 1995 2017 - Apr Sun>=1 2:00 -1:00 WAT
# Rearguard section, for parsers that do not support negative DST.
Rule Namibia 1994 only - Mar 21 0:00 0 WAT
Rule Namibia 1994 2017 - Sep Sun>=1 2:00 1:00 CAT
Rule Namibia 1995 2017 - Apr Sun>=1 2:00 0 WAT
#Rule Namibia 1994 only - Mar 21 0:00 0 WAT
#Rule Namibia 1994 2017 - Sep Sun>=1 2:00 1:00 CAT
#Rule Namibia 1995 2017 - Apr Sun>=1 2:00 0 WAT
# End of rearguard section.

# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Expand All @@ -1103,14 +1103,14 @@ Zone Africa/Windhoek 1:08:24 - LMT 1892 Feb 8
2:00 1:00 SAST 1943 Mar 21 2:00
2:00 - SAST 1990 Mar 21 # independence
# Vanguard section, for zic and other parsers that support negative DST.
# 2:00 Namibia %s
2:00 Namibia %s
# Rearguard section, for parsers that do not support negative DST.
2:00 - CAT 1994 Mar 21 0:00
# 2:00 - CAT 1994 Mar 21 0:00
# From Paul Eggert (2017-04-07):
# The official date of the 2017 rule change was 2017-10-24. See:
# http://www.lac.org.na/laws/annoSTAT/Namibian%20Time%20Act%209%20of%202017.pdf
1:00 Namibia %s 2017 Oct 24
2:00 - CAT
# 1:00 Namibia %s 2017 Oct 24
# 2:00 - CAT
# End of rearguard section.

# Niger
Expand Down
2 changes: 1 addition & 1 deletion make/data/tzdata/asia
Original file line number Diff line number Diff line change
Expand Up @@ -1881,7 +1881,7 @@ Zone Asia/Jerusalem 2:20:54 - LMT 1880

# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Japan 1948 only - May Sat>=1 24:00 1:00 D
Rule Japan 1948 1951 - Sep Sun>=9 1:00 0 S
Rule Japan 1948 1951 - Sep Sat>=8 25:00 0 S
Rule Japan 1949 only - Apr Sat>=1 24:00 1:00 D
Rule Japan 1950 1951 - May Sat>=1 24:00 1:00 D

Expand Down
26 changes: 13 additions & 13 deletions make/data/tzdata/europe
Original file line number Diff line number Diff line change
Expand Up @@ -553,13 +553,13 @@ Link Europe/London Europe/Isle_of_Man
# summer and negative daylight saving time in winter. It is for when
# negative SAVE values are used.
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
#Rule Eire 1971 only - Oct 31 2:00u -1:00 -
#Rule Eire 1972 1980 - Mar Sun>=16 2:00u 0 -
#Rule Eire 1972 1980 - Oct Sun>=23 2:00u -1:00 -
#Rule Eire 1981 max - Mar lastSun 1:00u 0 -
#Rule Eire 1981 1989 - Oct Sun>=23 1:00u -1:00 -
#Rule Eire 1990 1995 - Oct Sun>=22 1:00u -1:00 -
#Rule Eire 1996 max - Oct lastSun 1:00u -1:00 -
Rule Eire 1971 only - Oct 31 2:00u -1:00 -
Rule Eire 1972 1980 - Mar Sun>=16 2:00u 0 -
Rule Eire 1972 1980 - Oct Sun>=23 2:00u -1:00 -
Rule Eire 1981 max - Mar lastSun 1:00u 0 -
Rule Eire 1981 1989 - Oct Sun>=23 1:00u -1:00 -
Rule Eire 1990 1995 - Oct Sun>=22 1:00u -1:00 -
Rule Eire 1996 max - Oct lastSun 1:00u -1:00 -

# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Europe/Dublin -0:25:00 - LMT 1880 Aug 2
Expand All @@ -573,11 +573,11 @@ Zone Europe/Dublin -0:25:00 - LMT 1880 Aug 2
0:00 - GMT 1948 Apr 18 2:00s
0:00 GB-Eire GMT/IST 1968 Oct 27
# The next line is for when negative SAVE values are used.
# 1:00 Eire IST/GMT
1:00 Eire IST/GMT
# These three lines are for when SAVE values are always nonnegative.
1:00 - IST 1971 Oct 31 2:00u
0:00 GB-Eire GMT/IST 1996
0:00 EU GMT/IST
# 1:00 - IST 1971 Oct 31 2:00u
# 0:00 GB-Eire GMT/IST 1996
# 0:00 EU GMT/IST


###############################################################################
Expand Down Expand Up @@ -1015,9 +1015,9 @@ Zone Europe/Prague 0:57:44 - LMT 1850
1:00 C-Eur CE%sT 1945 May 9
1:00 Czech CE%sT 1946 Dec 1 3:00
# Vanguard section, for zic and other parsers that support negative DST.
# 1:00 -1:00 GMT 1947 Feb 23 2:00
1:00 -1:00 GMT 1947 Feb 23 2:00
# Rearguard section, for parsers that do not support negative DST.
0:00 - GMT 1947 Feb 23 2:00
# 0:00 - GMT 1947 Feb 23 2:00
# End of rearguard section.
1:00 Czech CE%sT 1979
1:00 EU CE%sT
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2019, 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
Expand Down Expand Up @@ -264,7 +264,7 @@ private void outputFile(Path dstFile, String version,
for (ZoneRules rules : rulesList) {
baos.reset();
DataOutputStream dataos = new DataOutputStream(baos);
rules.writeExternal(dataos);
Ser.write(rules, dataos);
dataos.close();
byte[] bytes = baos.toByteArray();
out.writeShort(bytes.length);
Expand Down
Loading

0 comments on commit c1a479a

Please sign in to comment.