This commit is contained in:
Jesper Wilhelmsson 2017-11-16 01:11:32 +01:00
commit 88d610826b
177 changed files with 4477 additions and 1750 deletions

View File

@ -455,3 +455,4 @@ b87d7b5d5dedc1185e5929470f945b7378cdb3ad jdk-10+27
92f08900cb3c0d694e5c529a676c1c9e5909193f jdk-10+28
a6e591e12f122768f675428e1e5a838fd0e9c7ec jdk-10+29
8fee80b92e65149f7414250fd5e34b6f35d417b4 jdk-10+30
e6278add9ff28fab70fe1cc4c1d65f7363dc9445 jdk-10+31

View File

@ -80,8 +80,8 @@ ifneq ($(MAN_DIR), )
endif
LEGAL_NOTICES := \
$(SUPPORT_OUTPUTDIR)/modules_legal/java.base \
$(call FindModuleLegalDirs, $(MODULE)) \
$(call uniq, $(SUPPORT_OUTPUTDIR)/modules_legal/java.base \
$(call FindModuleLegalDirs, $(MODULE))) \
#
LEGAL_NOTICES_PATH := $(call PathList, $(LEGAL_NOTICES))

View File

@ -36,15 +36,18 @@ help:
$(info =====================)
$(info )
$(info Common make targets)
$(info $(_) make [default] # Compile all modules in langtools, hotspot, jdk, jaxws,)
$(info $(_) # jaxp and corba, and create a runnable "exploded" image)
$(info $(_) make all # Compile everything, all repos, docs and images)
$(info $(_) make images # Create complete jdk and jre images (alias for product-images))
$(info $(_) make <name>-image # Build just the image (jdk, jre, test, docs etc))
$(info $(_) make [default] # Compile all modules and create a runnable "exploded")
$(info $(_) # image (alias for jdk or exploded-image))
$(info $(_) make all # Create all images: product, test, docs)
$(info $(_) # (alias for all-images))
$(info $(_) make images # Create complete jdk and jre images)
$(info $(_) # (alias for product-images))
$(info $(_) make <name>-image # Build just the image for any of: )
$(info $(_) # jdk, jre, test, docs, symbols, profiles)
$(info $(_) make <phase> # Build the specified phase and everything it depends on)
$(info $(_) # (gensrc, java, copy, libs, launchers, gendata, rmic))
$(info $(_) make *-only # Applies to most targets and disables compling the)
$(info $(_) # dependencies for the target. This is faster but may)
$(info $(_) make *-only # Applies to most targets and disables building the)
$(info $(_) # dependencies for that target. This is faster but may)
$(info $(_) # result in incorrect build results!)
$(info $(_) make docs # Create all docs)
$(info $(_) make docs-jdk-api # Create just JDK javadocs)
@ -74,7 +77,7 @@ help:
$(info $(_) make hotspot # Build all of hotspot)
$(info $(_) make hotspot-<variant> # Build just the specified jvm variant)
$(info $(_) make hotspot-gensrc # Only build the gensrc part of hotspot)
$(info $(_) make hotspot-<variant>-<phase> # Build the specified phase for the specified module)
$(info $(_) make hotspot-<variant>-<phase> # Build the specified phase for the variant)
$(info )
$(info Targets for specific modules)
$(info $(_) make <module> # Build <module> and everything it depends on)

View File

@ -473,15 +473,32 @@ EncodeSpace = \
$(subst $(SPACE),?,$(strip $1))
################################################################################
# Make directory without forking mkdir if not needed
# Make directory without forking mkdir if not needed.
#
# If a directory with an encoded space is provided, the wildcard function
# sometimes returns false answers (typically if the dir existed when the
# makefile was parsed, but was deleted by a previous rule). In that case, always
# call mkdir regardless of what wildcard says.
#
# 1: List of directories to create
MakeDir = \
$(strip \
$(eval MakeDir_dirs_to_make := $(strip $(foreach d, $1, $(if $(wildcard $d), , \
"$(call DecodeSpace, $d)")))) \
$(eval MakeDir_dirs_to_make := $(strip $(foreach d, $1, \
$(if $(findstring ?, $d), '$(call DecodeSpace, $d)', \
$(if $(wildcard $d), , $d) \
) \
))) \
$(if $(MakeDir_dirs_to_make), $(shell $(MKDIR) -p $(MakeDir_dirs_to_make))) \
)
# Make directory for target file. Should handle spaces in filenames. Just
# calling $(call MakeDir $(@D)) will not work if the directory contains a space
# and the target file already exists. In that case, the target file will have
# its wildcard ? resolved and the $(@D) will evaluate each space separated dir
# part on its own.
MakeTargetDir = \
$(call MakeDir, $(dir $(call EncodeSpace, $@)))
################################################################################
# Assign a variable only if it is empty
# Param 1 - Variable to assign
@ -499,7 +516,7 @@ ifeq ($(OPENJDK_TARGET_OS),solaris)
# If the source and target parent directories are the same, recursive copy doesn't work
# so we fall back on regular copy, which isn't preserving symlinks.
define install-file
$(call MakeDir, $(@D))
$(call MakeTargetDir)
$(RM) '$(call DecodeSpace, $@)'
if [ '$(call DecodeSpace, $(dir $@))' != \
'$(call DecodeSpace, $(dir $(call EncodeSpace, $<)))' ]; then \
@ -526,21 +543,21 @@ else ifeq ($(OPENJDK_TARGET_OS),macosx)
# If copying a soft link to a directory, need to delete the target first to avoid
# weird errors.
define install-file
$(call MakeDir, $(@D))
$(call MakeTargetDir)
$(RM) '$(call DecodeSpace, $@)'
$(CP) -fRP '$(call DecodeSpace, $<)' '$(call DecodeSpace, $@)'
if [ -n "`$(XATTR) -ls '$(call DecodeSpace, $@)'`" ]; then $(XATTR) -cs '$(call DecodeSpace, $@)'; fi
endef
else
define install-file
$(call MakeDir, $(@D))
$(call MakeTargetDir)
$(CP) -fP '$(call DecodeSpace, $<)' '$(call DecodeSpace, $@)'
endef
endif
# Variant of install file that does not preserve symlinks
define install-file-nolink
$(call MakeDir, $(@D))
$(call MakeTargetDir)
$(CP) -f '$(call DecodeSpace, $<)' '$(call DecodeSpace, $@)'
endef
@ -590,13 +607,13 @@ RelativePath = \
# careful when using this on Windows since the symlink created is only valid in
# the unix emulation environment.
define link-file-relative
$(call MakeDir, $(@D))
$(call MakeTargetDir)
$(RM) '$(call DecodeSpace, $@)'
$(LN) -s '$(call DecodeSpace, $(call RelativePath, $<, $(@D)))' '$(call DecodeSpace, $@)'
endef
define link-file-absolute
$(call MakeDir, $(@D))
$(call MakeTargetDir)
$(RM) '$(call DecodeSpace, $@)'
$(LN) -s '$(call DecodeSpace, $<)' '$(call DecodeSpace, $@)'
endef

View File

@ -409,8 +409,10 @@ LEGAL_SUBDIRS += share/legal
# $1 - Module to find legal dirs for
FindModuleLegalDirs = \
$(strip $(wildcard \
$(addsuffix /$(strip $1), $(IMPORT_MODULES_LEGAL)) \
$(foreach sub, $(LEGAL_SUBDIRS), $(addsuffix /$(strip $1)/$(sub), $(TOP_SRC_DIRS)))))
$(addsuffix /$(strip $1), $(SUPPORT_OUTPUTDIR)/modules_legal \
$(IMPORT_MODULES_LEGAL)) \
$(foreach sub, $(LEGAL_SUBDIRS), $(addsuffix /$(strip $1)/$(sub), $(TOP_SRC_DIRS))) \
))
################################################################################

View File

@ -21,4 +21,4 @@
# or visit www.oracle.com if you need additional information or have any
# questions.
#
tzdata2017b
tzdata2017c

View File

@ -49,7 +49,7 @@
#
# For data circa 1899, a common source is:
# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94.
# http://www.jstor.org/stable/1774359
# https://www.jstor.org/stable/1774359
#
# A reliable and entertaining source about time zones is
# Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997).
@ -241,7 +241,7 @@ Rule Egypt 2006 only - Sep 21 24:00 0 -
# saving time in Egypt will end in the night of 2007-09-06 to 2007-09-07.
# From Jesper Nørgaard Welen (2007-08-15): [The following agree:]
# http://www.nentjes.info/Bill/bill5.htm
# http://www.timeanddate.com/worldclock/city.html?n=53
# https://www.timeanddate.com/worldclock/city.html?n=53
# From Steffen Thorsen (2007-09-04): The official information...:
# http://www.sis.gov.eg/En/EgyptOnline/Miscellaneous/000002/0207000000000000001580.htm
Rule Egypt 2007 only - Sep Thu>=1 24:00 0 -
@ -279,8 +279,8 @@ Rule Egypt 2007 only - Sep Thu>=1 24:00 0 -
# timeanddate[2] and another site I've found[3] also support that.
#
# [1] https://bugzilla.redhat.com/show_bug.cgi?id=492263
# [2] http://www.timeanddate.com/worldclock/clockchange.html?n=53
# [3] http://wwp.greenwichmeantime.com/time-zone/africa/egypt/
# [2] https://www.timeanddate.com/worldclock/clockchange.html?n=53
# [3] https://wwp.greenwichmeantime.com/time-zone/africa/egypt/
# From Arthur David Olson (2009-04-20):
# In 2009 (and for the next several years), Ramadan ends before the fourth
@ -290,10 +290,10 @@ Rule Egypt 2007 only - Sep Thu>=1 24:00 0 -
# From Steffen Thorsen (2009-08-11):
# We have been able to confirm the August change with the Egyptian Cabinet
# Information and Decision Support Center:
# http://www.timeanddate.com/news/time/egypt-dst-ends-2009.html
# https://www.timeanddate.com/news/time/egypt-dst-ends-2009.html
#
# The Middle East News Agency
# http://www.mena.org.eg/index.aspx
# https://www.mena.org.eg/index.aspx
# also reports "Egypt starts winter time on August 21"
# today in article numbered "71, 11/08/2009 12:25 GMT."
# Only the title above is available without a subscription to their service,
@ -343,7 +343,7 @@ Rule Egypt 2007 only - Sep Thu>=1 24:00 0 -
# Thursday of April.... Clocks will still be turned back for Ramadan, but
# dates not yet announced....
# http://almogaz.com/news/weird-news/2015/04/05/1947105 ...
# http://www.timeanddate.com/news/time/egypt-starts-dst-2015.html
# https://www.timeanddate.com/news/time/egypt-starts-dst-2015.html
# From Ahmed Nazmy (2015-04-20):
# Egypt's ministers cabinet just announced ... that it will cancel DST at
@ -470,11 +470,11 @@ Zone Africa/Monrovia -0:43:08 - LMT 1882
# From Even Scharning (2012-11-10):
# Libya set their time one hour back at 02:00 on Saturday November 10.
# http://www.libyaherald.com/2012/11/04/clocks-to-go-back-an-hour-on-saturday/
# https://www.libyaherald.com/2012/11/04/clocks-to-go-back-an-hour-on-saturday/
# Here is an official source [in Arabic]: http://ls.ly/fb6Yc
#
# Steffen Thorsen forwarded a translation (2012-11-10) in
# http://mm.icann.org/pipermail/tz/2012-November/018451.html
# https://mm.icann.org/pipermail/tz/2012-November/018451.html
#
# From Tim Parenti (2012-11-11):
# Treat the 2012-11-10 change as a zone change from UTC+2 to UTC+1.
@ -485,7 +485,7 @@ Zone Africa/Monrovia -0:43:08 - LMT 1882
# From Even Scharning (2013-10-25):
# The scheduled end of DST in Libya on Friday, October 25, 2013 was
# cancelled yesterday....
# http://www.libyaherald.com/2013/10/24/correction-no-time-change-tomorrow/
# https://www.libyaherald.com/2013/10/24/correction-no-time-change-tomorrow/
#
# From Paul Eggert (2013-10-25):
# For now, assume they're reverting to the pre-2012 rules of permanent UT +02.
@ -538,7 +538,7 @@ Zone Africa/Tripoli 0:52:44 - LMT 1920
# basis....
# It seems that Mauritius observed daylight saving time from 1982-10-10 to
# 1983-03-20 as well, but that was not successful....
# http://www.timeanddate.com/news/time/mauritius-daylight-saving-time.html
# https://www.timeanddate.com/news/time/mauritius-daylight-saving-time.html
# From Alex Krivenyshev (2008-06-25):
# http://economicdevelopment.gov.mu/portal/site/Mainhomepage/menuitem.a42b24128104d9845dabddd154508a0c/?content_id=0a7cee8b5d69a110VgnVCM1000000a04a8c0RCRD
@ -606,7 +606,7 @@ Zone Africa/Tripoli 0:52:44 - LMT 1920
# http://lexpress.mu/Story/3398~Beebeejaun---Les-objectifs-d-%C3%A9conomie-d-%C3%A9nergie-de-l-heure-d-%C3%A9t%C3%A9-ont-%C3%A9t%C3%A9-atteints-
#
# Our wrap-up:
# http://www.timeanddate.com/news/time/mauritius-dst-will-not-repeat.html
# https://www.timeanddate.com/news/time/mauritius-dst-will-not-repeat.html
# From Arthur David Olson (2009-07-11):
# The "mauritius-dst-will-not-repeat" wrapup includes this:
@ -638,7 +638,7 @@ Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis
# be one hour ahead of GMT between 1 June and 27 September, according to
# Communication Minister and Government Spokesman, Khalid Naciri...."
#
# http://www.worldtimezone.net/dst_news/dst_news_morocco01.html
# http://www.worldtimezone.com/dst_news/dst_news_morocco01.html
# http://en.afrik.com/news11892.html
# From Alex Krivenyshev (2008-05-09):
@ -651,7 +651,7 @@ Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis
# From Patrice Scattolin (2008-05-09):
# According to this article:
# http://www.avmaroc.com/actualite/heure-dete-comment-a127896.html
# https://www.avmaroc.com/actualite/heure-dete-comment-a127896.html
# (and republished here: <http://www.actu.ma/heure-dete-comment_i127896_0.html>)
# the changes occur at midnight:
#
@ -673,7 +673,7 @@ Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis
# posted in English).
#
# The following Google query will generate many relevant hits:
# http://www.google.com/search?hl=en&q=Conseil+de+gouvernement+maroc+heure+avance&btnG=Search
# https://www.google.com/search?hl=en&q=Conseil+de+gouvernement+maroc+heure+avance&btnG=Search
# From Steffen Thorsen (2008-08-27):
# Morocco will change the clocks back on the midnight between August 31
@ -684,7 +684,7 @@ Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis
# http://www.menara.ma/fr/Actualites/Maroc/Societe/ci.retour_a_l_heure_gmt_a_partir_du_dimanche_31_aout_a_minuit_officiel_.default
#
# We have some further details posted here:
# http://www.timeanddate.com/news/time/morocco-ends-dst-early-2008.html
# https://www.timeanddate.com/news/time/morocco-ends-dst-early-2008.html
# From Steffen Thorsen (2009-03-17):
# Morocco will observe DST from 2009-06-01 00:00 to 2009-08-21 00:00 according
@ -694,7 +694,7 @@ Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis
# (French)
#
# Our summary:
# http://www.timeanddate.com/news/time/morocco-starts-dst-2009.html
# https://www.timeanddate.com/news/time/morocco-starts-dst-2009.html
# From Alexander Krivenyshev (2009-03-17):
# Here is a link to official document from Royaume du Maroc Premier Ministre,
@ -717,7 +717,7 @@ Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis
# http://www.lavieeco.com/actualites/4099-le-maroc-passera-a-l-heure-d-ete-gmt1-le-2-mai.html
# (French)
# Our page:
# http://www.timeanddate.com/news/time/morocco-starts-dst-2010.html
# https://www.timeanddate.com/news/time/morocco-starts-dst-2010.html
# From Dan Abitol (2011-03-30):
# ...Rules for Africa/Casablanca are the following (24h format)
@ -734,7 +734,7 @@ Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis
# They said that the decision was already taken.
#
# More articles in the press
# http://www.yabiladi.com/articles/details/5058/secret-l-heure-d-ete-maroc-leve.html
# https://www.yabiladi.com/articles/details/5058/secret-l-heure-d-ete-maroc-leve.html
# http://www.lematin.ma/Actualite/Express/Article.asp?id=148923
# http://www.lavieeco.com/actualite/Le-Maroc-passe-sur-GMT%2B1-a-partir-de-dim
@ -826,7 +826,7 @@ Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis
# 1433 (18 April 2012) and the decision of the Head of Government of
# 16 N. 3-29-15 Chaaban 1435 (4 June 2015).
# Source (french):
# http://lnt.ma/le-maroc-reculera-dune-heure-le-dimanche-14-juin/
# https://lnt.ma/le-maroc-reculera-dune-heure-le-dimanche-14-juin/
#
# From Milamber (2015-06-09):
# http://www.mmsp.gov.ma/fr/actualites.aspx?id=863
@ -835,7 +835,7 @@ Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis
# [The gov.ma announcement] would (probably) make the switch on 2015-07-19 go
# from 03:00 to 04:00 rather than from 02:00 to 03:00, as in the patch....
# I think the patch is correct and the quoted text is wrong; the text in
# <http://lnt.ma/le-maroc-reculera-dune-heure-le-dimanche-14-juin/> agrees
# <https://lnt.ma/le-maroc-reculera-dune-heure-le-dimanche-14-juin/> agrees
# with the patch.
# From Paul Eggert (2015-06-08):
@ -960,9 +960,17 @@ Link Africa/Maputo Africa/Kigali # Rwanda
Link Africa/Maputo Africa/Lubumbashi # E Dem. Rep. of Congo
Link Africa/Maputo Africa/Lusaka # Zambia
# Namibia
# The 1994-04-03 transition is from Shanks & Pottenger.
# Shanks & Pottenger report no DST after 1998-04; go with IATA.
# From Arthur David Olson (2017-08-09):
# The text of the "Namibia Time Act, 1994" is available online at
# www.lac.org.na/laws/1994/811.pdf
# and includes this nugget:
# Notwithstanding the provisions of subsection (2) of section 1, the
# first winter period after the commencement of this Act shall
# commence at OOhOO on Monday 21 March 1994 and shall end at 02h00 on
# Sunday 4 September 1994.
# From Petronella Sibeene (2007-03-30):
# http://allafrica.com/stories/200703300178.html
@ -978,19 +986,30 @@ Link Africa/Maputo Africa/Lusaka # Zambia
# observes Botswana time, we have no details about historical practice.
# In the meantime people there can use Africa/Gaborone.
# See: Immanuel S. The Namibian. 2017-02-23.
# http://www.namibian.com.na/51480/read/Time-change-divides-lawmakers
# https://www.namibian.com.na/51480/read/Time-change-divides-lawmakers
# From Steffen Thorsen (2017-08-09):
# Namibia is going to change their time zone to what is now their DST:
# https://www.newera.com.na/2017/02/23/namibias-winter-time-might-be-repealed/
# This video is from the government decision:
# https://www.nbc.na/news/na-passes-namibia-time-bill-repealing-1994-namibia-time-act.8665
# We have made the assumption so far that they will change their time zone at
# the same time they would normally start DST, the first Sunday in September:
# https://www.timeanddate.com/news/time/namibia-new-time-zone.html
# RULE NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Namibia 1994 max - Sep Sun>=1 2:00 1:00 S
Rule Namibia 1995 max - Apr Sun>=1 2:00 0 -
Rule Namibia 1994 only - Mar 21 0:00 0 -
Rule Namibia 1994 2016 - Sep Sun>=1 2:00 1:00 S
Rule Namibia 1995 2017 - Apr Sun>=1 2:00 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Windhoek 1:08:24 - LMT 1892 Feb 8
1:30 - +0130 1903 Mar
2:00 - SAST 1942 Sep 20 2:00
2:00 1:00 SAST 1943 Mar 21 2:00
2:00 - SAST 1990 Mar 21 # independence
2:00 - CAT 1994 Apr 3
1:00 Namibia WA%sT
2:00 - CAT 1994 Mar 21 0:00
1:00 Namibia WA%sT 2017 Sep 3 2:00
2:00 - CAT
# Niger
# See Africa/Lagos.
@ -1077,14 +1096,24 @@ Link Africa/Johannesburg Africa/Mbabane # Swaziland
# no information
# Sudan
#
# From <http://www.sunanews.net/sn13jane.html>
# Sudan News Agency (2000-01-13),
# also reported by Michaël De Beukelaer-Dossche via Steffen Thorsen:
# Clocks will be moved ahead for 60 minutes all over the Sudan as of noon
# Saturday.... This was announced Thursday by Caretaker State Minister for
# Manpower Abdul-Rahman Nur-Eddin.
# From Ahmed Atyya, National Telecommunications Corp. (NTC), Sudan (2017-10-17):
# ... the Republic of Sudan is going to change the time zone from (GMT+3:00)
# to (GMT+ 2:00) starting from Wednesday 1 November 2017.
#
# From Paul Eggert (2017-10-18):
# A scanned copy (in Arabic) of Cabinet Resolution No. 352 for the
# year 2017 can be found as an attachment in email today from Yahia
# Abdalla of NTC, archived at:
# https://mm.icann.org/pipermail/tz/2017-October/025333.html
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Sudan 1970 only - May 1 0:00 1:00 S
Rule Sudan 1970 1985 - Oct 15 0:00 0 -
@ -1093,10 +1122,14 @@ Rule Sudan 1972 1985 - Apr lastSun 0:00 1:00 S
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Khartoum 2:10:08 - LMT 1931
2:00 Sudan CA%sT 2000 Jan 15 12:00
3:00 - EAT
3:00 - EAT 2017 Nov 1
2:00 - CAT
# South Sudan
Link Africa/Khartoum Africa/Juba
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Juba 2:06:28 - LMT 1931
2:00 Sudan CA%sT 2000 Jan 15 12:00
3:00 - EAT
# Swaziland
# See Africa/Johannesburg.
@ -1134,11 +1167,11 @@ Link Africa/Khartoum Africa/Juba
# According to several news sources, Tunisia will not observe DST this year.
# (Arabic)
# http://www.elbashayer.com/?page=viewn&nid=42546
# http://www.babnet.net/kiwidetail-15295.asp
# https://www.babnet.net/kiwidetail-15295.asp
#
# We have also confirmed this with the US embassy in Tunisia.
# We have a wrap-up about this on the following page:
# http://www.timeanddate.com/news/time/tunisia-cancels-dst-2009.html
# https://www.timeanddate.com/news/time/tunisia-cancels-dst-2009.html
# From Alexander Krivenyshev (2009-03-17):
# Here is a link to Tunis Afrique Presse News Agency

View File

@ -49,7 +49,7 @@
# Heard Island, McDonald Islands (uninhabited)
# previously sealers and scientific personnel wintered
# Margaret Turner reports
# http://web.archive.org/web/20021204222245/http://www.dstc.qut.edu.au/DST/marg/daylight.html
# https://web.archive.org/web/20021204222245/http://www.dstc.qut.edu.au/DST/marg/daylight.html
# (1999-09-30) that they're UT +05, with no DST;
# presumably this is when they have visitors.
#
@ -70,7 +70,7 @@
# http://www.aad.gov.au/default.asp?casid=37079
#
# We have more background information here:
# http://www.timeanddate.com/news/time/antarctica-new-times.html
# https://www.timeanddate.com/news/time/antarctica-new-times.html
# From Steffen Thorsen (2010-03-10):
# We got these changes from the Australian Antarctic Division: ...
@ -85,7 +85,7 @@
# - Mawson station stays on UTC+5.
#
# Background:
# http://www.timeanddate.com/news/time/antartica-time-changes-2010.html
# https://www.timeanddate.com/news/time/antartica-time-changes-2010.html
# From Steffen Thorsen (2016-10-28):
# Australian Antarctica Division informed us that Casey changed time
@ -168,7 +168,7 @@ Zone Indian/Kerguelen 0 - -00 1950 # Port-aux-Français
#
# year-round base in the main continent
# Dumont d'Urville, Île des Pétrels, -6640+14001, since 1956-11
# <http://en.wikipedia.org/wiki/Dumont_d'Urville_Station> (2005-12-05)
# <https://en.wikipedia.org/wiki/Dumont_d'Urville_Station> (2005-12-05)
#
# Another base at Port-Martin, 50km east, began operation in 1947.
# It was destroyed by fire on 1952-01-14.

View File

@ -49,7 +49,7 @@
#
# For data circa 1899, a common source is:
# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94.
# http://www.jstor.org/stable/1774359
# https://www.jstor.org/stable/1774359
#
# For Russian data circa 1919, a source is:
# Byalokoz EL. New Counting of Time in Russia since July 1, 1919.
@ -98,8 +98,8 @@ Rule E-EurAsia 1996 max - Oct lastSun 0:00 0 -
Rule RussiaAsia 1981 1984 - Apr 1 0:00 1:00 S
Rule RussiaAsia 1981 1983 - Oct 1 0:00 0 -
Rule RussiaAsia 1984 1995 - Sep lastSun 2:00s 0 -
Rule RussiaAsia 1985 2011 - Mar lastSun 2:00s 1:00 S
Rule RussiaAsia 1996 2011 - Oct lastSun 2:00s 0 -
Rule RussiaAsia 1985 2010 - Mar lastSun 2:00s 1:00 S
Rule RussiaAsia 1996 2010 - Oct lastSun 2:00s 0 -
# Afghanistan
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
@ -132,13 +132,17 @@ Zone Asia/Kabul 4:36:48 - LMT 1890
# or
# (brief)
# http://www.worldtimezone.com/dst_news/dst_news_armenia03.html
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Armenia 2011 only - Mar lastSun 2:00s 1:00 S
Rule Armenia 2011 only - Oct lastSun 2:00s 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Yerevan 2:58:00 - LMT 1924 May 2
3:00 - +03 1957 Mar
4:00 RussiaAsia +04/+05 1991 Mar 31 2:00s
3:00 RussiaAsia +03/+04 1995 Sep 24 2:00s
4:00 - +04 1997
4:00 RussiaAsia +04/+05
4:00 RussiaAsia +04/+05 2011
4:00 Armenia +04/+05
# Azerbaijan
@ -150,7 +154,7 @@ Zone Asia/Yerevan 2:58:00 - LMT 1924 May 2
# From Steffen Thorsen (2016-03-17):
# ... the Azerbaijani Cabinet of Ministers has cancelled switching to
# daylight saving time....
# http://www.azernews.az/azerbaijan/94137.html
# https://www.azernews.az/azerbaijan/94137.html
# http://vestnikkavkaza.net/news/Azerbaijani-Cabinet-of-Ministers-cancels-daylight-saving-time.html
# http://en.apa.az/xeber_azerbaijan_abolishes_daylight_savings_ti_240862.html
@ -191,11 +195,11 @@ Zone Asia/Baku 3:19:24 - LMT 1924 May 2
# the 19th and 20th, and they have not set the end date yet.
#
# Some sources:
# http://in.reuters.com/article/southAsiaNews/idINIndia-40017620090601
# https://in.reuters.com/article/southAsiaNews/idINIndia-40017620090601
# http://bdnews24.com/details.php?id=85889&cid=2
#
# Our wrap-up:
# http://www.timeanddate.com/news/time/bangladesh-daylight-saving-2009.html
# https://www.timeanddate.com/news/time/bangladesh-daylight-saving-2009.html
# From A. N. M. Kamrus Saadat (2009-06-15):
# Finally we've got the official mail regarding DST start time where DST start
@ -281,9 +285,15 @@ Zone Asia/Brunei 7:39:40 - LMT 1926 Mar # Bandar Seri Begawan
# Milne says 6:24:40 was the meridian of the time ball observatory at Rangoon.
# From Paul Eggert (2017-04-20):
# Page 27 of Reed & Low (cited for Asia/Kolkata) says "Rangoon local time is
# used upon the railways and telegraphs of Burma, and is 6h. 24m. 47s. ahead
# of Greenwich." This refers to the period before Burma's transition to +0630,
# a transition for which Shanks is the only source.
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Yangon 6:24:40 - LMT 1880 # or Rangoon
6:24:40 - RMT 1920 # Rangoon Mean Time?
Zone Asia/Yangon 6:24:47 - LMT 1880 # or Rangoon
6:24:47 - RMT 1920 # Rangoon local time
6:30 - +0630 1942 May
9:00 - +09 1945 May 3
6:30 - +0630
@ -340,7 +350,7 @@ Rule PRC 1987 1991 - Apr Sun>=10 0:00 1:00 D
#
# From Jesper Nørgaard Welen (2006-07-14):
# I have investigated the timezones around 1970 on the
# http://www.astro.com/atlas site [with provinces and county
# https://www.astro.com/atlas site [with provinces and county
# boundaries summarized below].... A few other exceptions were two
# counties on the Sichuan side of the Xizang-Sichuan border,
# counties Dege and Baiyu which lies on the Sichuan side and are
@ -492,7 +502,7 @@ Rule PRC 1987 1991 - Apr Sun>=10 0:00 1:00 D
# From David Cochrane (2014-03-26):
# Just a confirmation that Ürümqi time was implemented in Ürümqi on 1 Feb 1986:
# http://content.time.com/time/magazine/article/0,9171,960684,00.html
# https://content.time.com/time/magazine/article/0,9171,960684,00.html
# From Luther Ma (2014-04-22):
# I have interviewed numerous people of various nationalities and from
@ -649,7 +659,7 @@ Zone Asia/Hong_Kong 7:36:42 - LMT 1904 Oct 30
# (both in Okinawa) adopt the Western Standard Time which is based on
# 120E. The adoption began from Jan 1, 1896. The original text can be
# found on Wikisource:
# http://ja.wikisource.org/wiki/標準時ニ關スル件_(公布時)
# https://ja.wikisource.org/wiki/標準時ニ關スル件_(公布時)
# ... This could be the first adoption of time zone in Taiwan, because
# during the Qing Dynasty, it seems that there was no time zone
# declared officially.
@ -662,7 +672,7 @@ Zone Asia/Hong_Kong 7:36:42 - LMT 1904 Oct 30
# territory, including later occupations, adopt Japan Central Time
# (UTC+9). The adoption began on Oct 1, 1937. The original text can
# be found on Wikisource:
# http://ja.wikisource.org/wiki/明治二十八年勅令第百六十七號標準時ニ關スル件中改正ノ件
# https://ja.wikisource.org/wiki/明治二十八年勅令第百六十七號標準時ニ關スル件中改正ノ件
#
# That is, the time zone of Taipei switched to UTC+9 on Oct 1, 1937.
@ -798,6 +808,12 @@ Zone Asia/Macau 7:34:20 - LMT 1912 Jan 1
# Looks like the time zone split in Cyprus went through last night.
# http://cyprus-mail.com/2016/10/30/cyprus-new-division-two-time-zones-now-reality/
# From Paul Eggert (2017-10-18):
# Northern Cyprus will reinstate winter time on October 29, thus
# staying in sync with the rest of Cyprus. See: Anastasiou A.
# Cyprus to remain united in time. Cyprus Mail 2017-10-17.
# https://cyprus-mail.com/2017/10/17/cyprus-remain-united-time/
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Cyprus 1975 only - Apr 13 0:00 1:00 S
Rule Cyprus 1975 only - Oct 12 0:00 0 -
@ -815,7 +831,8 @@ Zone Asia/Nicosia 2:13:28 - LMT 1921 Nov 14
Zone Asia/Famagusta 2:15:48 - LMT 1921 Nov 14
2:00 Cyprus EE%sT 1998 Sep
2:00 EUAsia EE%sT 2016 Sep 8
3:00 - +03
3:00 - +03 2017 Oct 29 1:00u
2:00 EUAsia EE%sT
# Classically, Cyprus belongs to Asia; e.g. see Herodotus, Histories, I.72.
# However, for various reasons many users expect to find it under Europe.
@ -875,7 +892,7 @@ Zone Asia/Tbilisi 2:59:11 - LMT 1880
# From João Carrascalão, brother of the former governor of East Timor, in
# East Timor may be late for its millennium
# <http://etan.org/et99c/december/26-31/30ETMAY.htm> (1999-12-26/31):
# <https://etan.org/et99c/december/26-31/30ETMAY.htm> (1999-12-26/31):
# Portugal tried to change the time forward in 1974 because the sun
# rises too early but the suggestion raised a lot of problems with the
# Timorese and I still don't think it would work today because it
@ -903,21 +920,62 @@ Zone Asia/Dili 8:22:20 - LMT 1912 Jan 1
# India
# From Ian P. Beacock, in "A brief history of (modern) time", The Atlantic
# http://www.theatlantic.com/technology/archive/2015/12/the-creation-of-modern-time/421419/
# https://www.theatlantic.com/technology/archive/2015/12/the-creation-of-modern-time/421419/
# (2015-12-22):
# In January 1906, several thousand cotton-mill workers rioted on the
# outskirts of Bombay.... They were protesting the proposed abolition of
# local time in favor of Indian Standard Time.... Journalists called this
# dispute the "Battle of the Clocks." It lasted nearly half a century.
# From Paul Eggert (2017-04-20):
# Good luck trying to nail down old timekeeping records in India.
# "... in the nineteenth century ... Madras Observatory took its magnetic
# measurements on Göttingen time, its meteorological measurements on Madras
# (local) time, dropped its time ball on Greenwich (ocean navigator's) time,
# and distributed civil (local time)." -- Bartky IR. Selling the true time:
# 19th-century timekeeping in america. Stanford U Press (2000), 247 note 19.
# "A more potent cause of resistance to the general adoption of the present
# standard time lies in the fact that it is Madras time. The citizen of
# Bombay, proud of being 'primus in Indis' and of Calcutta, equally proud of
# his city being the Capital of India, and - for a part of the year - the Seat
# of the Supreme Government, alike look down on Madras, and refuse to change
# the time they are using, for that of what they regard as a benighted
# Presidency; while Madras, having for long given the standard time to the
# rest of India, would resist the adoption of any other Indian standard in its
# place." -- Oldham RD. On Time in India: a suggestion for its improvement.
# Proceedings of the Asiatic Society of Bengal (April 1899), 49-55.
#
# "In 1870 ... Madras time - 'now used by the telegraph and regulated from the
# only government observatory' - was suggested as a standard railway time,
# first to be adopted on the Great Indian Peninsular Railway (GIPR)....
# Calcutta, Bombay, and Karachi, were to be allowed to continue with their
# local time for civil purposes." - Prasad R. Tracks of Change: Railways and
# Everyday Life in Colonial India. Cambridge University Press (2016), 145.
#
# Reed S, Low F. The Indian Year Book 1936-37. Bennett, Coleman, pp 27-8.
# https://archive.org/details/in.ernet.dli.2015.282212
# This lists +052110 as Madras local time used in railways, and says that on
# 1906-01-01 railways and telegraphs in India switched to +0530. Some
# municipalities retained their former time, and the time in Calcutta
# continued to depend on whether you were at the railway station or at
# government offices. Government time was at +055320 (according to Shanks) or
# at +0554 (according to the Indian Year Book). Railway time is more
# appropriate for our purposes, as it was better documented, it is what we do
# elsewhere (e.g., Europe/London before 1880), and after 1906 it was
# consistent in the region now identified by Asia/Kolkata. So, use railway
# time for 1870-1941. Shanks is our only (and dubious) source for the
# 1941-1945 data.
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Kolkata 5:53:28 - LMT 1880 # Kolkata
5:53:20 - HMT 1941 Oct # Howrah Mean Time?
6:30 - +0630 1942 May 15
Zone Asia/Kolkata 5:53:28 - LMT 1854 Jun 28 # Kolkata
5:53:20 - HMT 1870 # Howrah Mean Time?
5:21:10 - MMT 1906 Jan 1 # Madras local time
5:30 - IST 1941 Oct
5:30 1:00 +0630 1942 May 15
5:30 - IST 1942 Sep
5:30 1:00 +0630 1945 Oct 15
5:30 - IST
# The following are like Asia/Kolkata:
# Since 1970 the following are like Asia/Kolkata:
# Andaman Is
# Lakshadweep (Laccadive, Minicoy and Amindivi Is)
# Nicobar Is
@ -1059,7 +1117,7 @@ Zone Asia/Jayapura 9:22:48 - LMT 1932 Nov
# From Reuters (2007-09-16), with a heads-up from Jesper Nørgaard Welen:
# ... the Guardian Council ... approved a law on Sunday to re-introduce
# daylight saving time ...
# http://uk.reuters.com/article/oilRpt/idUKBLA65048420070916
# https://uk.reuters.com/article/oilRpt/idUKBLA65048420070916
#
# From Roozbeh Pournader (2007-11-05):
# This is quoted from Official Gazette of the Islamic Republic of
@ -1158,7 +1216,7 @@ Zone Asia/Tehran 3:25:44 - LMT 1916
# http://www.aswataliraq.info/look/article.tpl?id=2047&IdLanguage=17&IdPublication=4&NrArticle=71743&NrIssue=1&NrSection=10
#
# We have published a short article in English about the change:
# http://www.timeanddate.com/news/time/iraq-dumps-daylight-saving.html
# https://www.timeanddate.com/news/time/iraq-dumps-daylight-saving.html
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Iraq 1982 only - May 1 0:00 1:00 D
@ -1466,12 +1524,12 @@ Rule Japan 1950 1951 - May Sun>=1 2:00 1:00 D
# From Yu-Cheng Chuang (2013-07-12):
# ...the Meiji Emperor announced Ordinance No. 167 of Meiji Year 28 "The clause
# about standard time" ... The adoption began from Jan 1, 1896.
# http://ja.wikisource.org/wiki/標準時ニ關スル件_(公布時)
# https://ja.wikisource.org/wiki/標準時ニ關スル件_(公布時)
#
# ...the Showa Emperor announced Ordinance No. 529 of Showa Year 12 ... which
# means the whole Japan territory, including later occupations, adopt Japan
# Central Time (UTC+9). The adoption began on Oct 1, 1937.
# http://ja.wikisource.org/wiki/明治二十八年勅令第百六十七號標準時ニ關スル件中改正ノ件
# https://ja.wikisource.org/wiki/明治二十八年勅令第百六十七號標準時ニ關スル件中改正ノ件
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Tokyo 9:18:59 - LMT 1887 Dec 31 15:00u
@ -1533,7 +1591,7 @@ Zone Asia/Tokyo 9:18:59 - LMT 1887 Dec 31 15:00u
# Official, in Arabic:
# http://www.petra.gov.jo/public_news/Nws_NewsDetails.aspx?Menu_ID=&Site_Id=2&lang=1&NewsID=133230&CatID=14
# ... Our background/permalink about it
# http://www.timeanddate.com/news/time/jordan-reverses-dst-decision.html
# https://www.timeanddate.com/news/time/jordan-reverses-dst-decision.html
# ...
# http://www.petra.gov.jo/Public_News/Nws_NewsDetails.aspx?lang=2&site_id=1&NewsID=133313&Type=P
# ... says midnight for the coming one and 1:00 for the ones in the future
@ -1891,9 +1949,9 @@ Zone Asia/Bishkek 4:58:24 - LMT 1924 May 2
# between 1987 and 1988 ...
# From Sanghyuk Jung (2014-10-29):
# http://mm.icann.org/pipermail/tz/2014-October/021830.html
# https://mm.icann.org/pipermail/tz/2014-October/021830.html
# According to the Korean Wikipedia
# http://ko.wikipedia.org/wiki/한국_표준시
# https://ko.wikipedia.org/wiki/한국_표준시
# [oldid=12896437 2014-09-04 08:03 UTC]
# DST in Republic of Korea was as follows.... And I checked old
# newspapers in Korean, all articles correspond with data in Wikipedia.
@ -2115,7 +2173,7 @@ Zone Indian/Maldives 4:54:00 - LMT 1880 # Male
# +08:00 instead. Different sources appear to disagree with the tz
# database on this, e.g.:
#
# http://www.timeanddate.com/worldclock/city.html?n=1026
# https://www.timeanddate.com/worldclock/city.html?n=1026
# http://www.worldtimeserver.com/current_time_in_MN.aspx
#
# both say GMT+08:00.
@ -2245,7 +2303,7 @@ Zone Asia/Kathmandu 5:41:16 - LMT 1920
# help reduce load shedding by approving the closure of commercial centres at
# 9pm and moving clocks forward by one hour for the next three months. ...."
#
# http://www.worldtimezone.net/dst_news/dst_news_pakistan01.html
# http://www.worldtimezone.com/dst_news/dst_news_pakistan01.html
# http://www.dailytimes.com.pk/default.asp?page=2008%5C05%5C15%5Cstory_15-5-2008_pg1_4
# From Arthur David Olson (2008-05-19):
@ -2311,7 +2369,7 @@ Zone Asia/Kathmandu 5:41:16 - LMT 1920
#
# We have confirmed this year's end date with both with the Ministry of
# Water and Power and the Pakistan Electric Power Company:
# http://www.timeanddate.com/news/time/pakistan-ends-dst09.html
# https://www.timeanddate.com/news/time/pakistan-ends-dst09.html
# From Christoph Göhre (2009-10-01):
# [T]he German Consulate General in Karachi reported me today that Pakistan
@ -2493,7 +2551,7 @@ Zone Asia/Karachi 4:28:12 - LMT 1907
#
# We are not sure if Gaza will do the same, last year they had a different
# end date, we will keep this page updated:
# http://www.timeanddate.com/news/time/westbank-gaza-dst-2009.html
# https://www.timeanddate.com/news/time/westbank-gaza-dst-2009.html
# From Alexander Krivenyshev (2009-09-02):
# Seems that Gaza Strip will go back to Winter Time same date as West Bank.
@ -2531,7 +2589,7 @@ Zone Asia/Karachi 4:28:12 - LMT 1907
# the clocks were set back one hour at 2010-08-11 00:00:00 local time in
# Gaza and the West Bank.
# Some more background info:
# http://www.timeanddate.com/news/time/westbank-gaza-end-dst-2010.html
# https://www.timeanddate.com/news/time/westbank-gaza-end-dst-2010.html
# From Steffen Thorsen (2011-08-26):
# Gaza and the West Bank did go back to standard time in the beginning of
@ -2541,7 +2599,7 @@ Zone Asia/Karachi 4:28:12 - LMT 1907
#
# http://www.maannews.net/eng/ViewDetails.aspx?ID=416217
# Additional info:
# http://www.timeanddate.com/news/time/palestine-dst-2011.html
# https://www.timeanddate.com/news/time/palestine-dst-2011.html
# From Alexander Krivenyshev (2011-08-27):
# According to the article in The Jerusalem Post:
@ -2551,7 +2609,7 @@ Zone Asia/Karachi 4:28:12 - LMT 1907
# The Hamas government said on Saturday that it won't observe summertime after
# the Muslim feast of Id al-Fitr, which begins on Tuesday..."
# ...
# http://www.jpost.com/MiddleEast/Article.aspx?id=235650
# https://www.jpost.com/MiddleEast/Article.aspx?id=235650
# http://www.worldtimezone.com/dst_news/dst_news_gazastrip05.html
# The rules for Egypt are stolen from the 'africa' file.
@ -2572,7 +2630,7 @@ Zone Asia/Karachi 4:28:12 - LMT 1907
# http://safa.ps/details/news/74352/%D8%A8%D8%AF%D8%A1-%D8%A7%D9%84%D8%AA%D9%88%D9%82%D9%8A%D8%AA-%D8%A7%D9%84%D8%B5%D9%8A%D9%81%D9%8A-%D8%A8%D8%A7%D9%84%D8%B6%D9%81%D8%A9-%D9%88%D8%BA%D8%B2%D8%A9-%D9%84%D9%8A%D9%84%D8%A9-%D8%A7%D9%84%D8%AC%D9%85%D8%B9%D8%A9.html
#
# Our brief summary:
# http://www.timeanddate.com/news/time/gaza-west-bank-dst-2012.html
# https://www.timeanddate.com/news/time/gaza-west-bank-dst-2012.html
# From Steffen Thorsen (2013-03-26):
# The following news sources tells that Palestine will "start daylight saving
@ -2592,11 +2650,11 @@ Zone Asia/Karachi 4:28:12 - LMT 1907
# From Steffen Thorsen (2015-03-03):
# Sources such as http://www.alquds.com/news/article/view/id/548257
# and http://www.raya.ps/ar/news/890705.html say Palestine areas will
# and https://www.raya.ps/ar/news/890705.html say Palestine areas will
# start DST on 2015-03-28 00:00 which is one day later than expected.
#
# From Paul Eggert (2015-03-03):
# http://www.timeanddate.com/time/change/west-bank/ramallah?year=2014
# https://www.timeanddate.com/time/change/west-bank/ramallah?year=2014
# says that the fall 2014 transition was Oct 23 at 24:00.
# From Hannah Kreitem (2016-03-09):
@ -2620,8 +2678,8 @@ Zone Asia/Karachi 4:28:12 - LMT 1907
#
# From Paul Eggert (2016-10-19):
# It's also consistent with predictions in the following URLs today:
# http://www.timeanddate.com/time/change/gaza-strip/gaza
# http://www.timeanddate.com/time/change/west-bank/hebron
# https://www.timeanddate.com/time/change/gaza-strip/gaza
# https://www.timeanddate.com/time/change/west-bank/hebron
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule EgyptAsia 1957 only - May 10 0:00 1:00 S
@ -2684,7 +2742,7 @@ Zone Asia/Hebron 2:20:23 - LMT 1900 Oct
# Philippines, issued a proclamation announcing that 1844-12-30 was to
# be immediately followed by 1845-01-01; see R.H. van Gent's
# History of the International Date Line
# http://www.staff.science.uu.nl/~gent0113/idl/idl_philippines.htm
# https://www.staff.science.uu.nl/~gent0113/idl/idl_philippines.htm
# The rest of the data entries are from Shanks & Pottenger.
# From Jesper Nørgaard Welen (2006-04-26):
@ -2948,7 +3006,7 @@ Rule Syria 2007 only - Nov Fri>=1 0:00 0 -
# We have not found any sources saying anything about when DST ends this year.
#
# Our summary
# http://www.timeanddate.com/news/time/syria-dst-starts-march-27-2009.html
# https://www.timeanddate.com/news/time/syria-dst-starts-march-27-2009.html
# From Steffen Thorsen (2009-10-27):
# The Syrian Arab News Network on 2009-09-29 reported that Syria will
@ -2975,7 +3033,7 @@ Rule Syria 2007 only - Nov Fri>=1 0:00 0 -
# http://www.sana.sy/ara/2/2012/03/26/408215.htm
#
# Our brief summary:
# http://www.timeanddate.com/news/time/syria-dst-2012.html
# https://www.timeanddate.com/news/time/syria-dst-2012.html
# From Arthur David Olson (2012-03-27):
# Assume last Friday in March going forward XXX.
@ -3058,7 +3116,7 @@ Zone Asia/Tashkent 4:37:11 - LMT 1924 May 2
# is quoted verbatim in:
# http://www.thoigian.com.vn/?mPage=P80D01
# is translated by Brian Inglis in:
# http://mm.icann.org/pipermail/tz/2014-October/021654.html
# https://mm.icann.org/pipermail/tz/2014-October/021654.html
# and is the basis for the information below.
#
# The 1906 transition was effective July 1 and standardized Indochina to

View File

@ -316,7 +316,7 @@ Zone Indian/Cocos 6:27:40 - LMT 1900
# http://www.fiji.gov.fj/index.php?option=com_content&view=article&id=1096:3310-cabinet-approves-change-in-daylight-savings-dates&catid=49:cabinet-releases&Itemid=166
#
# A bit more background info here:
# http://www.timeanddate.com/news/time/fiji-dst-ends-march-2010.html
# https://www.timeanddate.com/news/time/fiji-dst-ends-march-2010.html
# From Alexander Krivenyshev (2010-10-24):
# According to Radio Fiji and Fiji Times online, Fiji will end DST 3
@ -380,9 +380,12 @@ Zone Indian/Cocos 6:27:40 - LMT 1900
# clocks go forward an hour at 2am to 3am.... Daylight Saving will
# end at 3.00am on Sunday 15th January 2017."
# From Paul Eggert (2016-10-03):
# For now, guess DST from 02:00 the first Sunday in November to
# 03:00 the third Sunday in January. Although ad hoc, it matches
# From Paul Eggert (2017-08-21):
# Dominic Fok writes (2017-08-20) that DST ends 2018-01-14, citing
# Extraordinary Government of Fiji Gazette Supplement No. 21 (2017-08-27),
# [Legal Notice No. 41] of an order of the previous day by J Usamate.
# For now, guess DST from 02:00 the first Sunday in November to 03:00
# the first Sunday on or after January 14. Although ad hoc, it matches
# transitions since late 2014 and seems more likely to match future
# practice than guessing no DST.
@ -396,7 +399,7 @@ Rule Fiji 2011 only - Mar Sun>=1 3:00 0 -
Rule Fiji 2012 2013 - Jan Sun>=18 3:00 0 -
Rule Fiji 2014 only - Jan Sun>=18 2:00 0 -
Rule Fiji 2014 max - Nov Sun>=1 2:00 1:00 S
Rule Fiji 2015 max - Jan Sun>=15 3:00 0 -
Rule Fiji 2015 max - Jan Sun>=14 3:00 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Pacific/Fiji 11:55:44 - LMT 1915 Oct 26 # Suva
12:00 Fiji +12/+13
@ -580,7 +583,7 @@ Zone Pacific/Port_Moresby 9:48:40 - LMT 1880
# The World War II entries below are instead based on Arawa-Kieta.
# The Japanese occupied Kieta in July 1942,
# according to the Pacific War Online Encyclopedia
# http://pwencycl.kgbudge.com/B/o/Bougainville.htm
# https://pwencycl.kgbudge.com/B/o/Bougainville.htm
# and seem to have controlled it until their 1945-08-21 surrender.
#
# The Autonomous Region of Bougainville switched from UT +10 to +11
@ -602,7 +605,7 @@ Zone Pacific/Pitcairn -8:40:20 - LMT 1901 # Adamstown
-8:00 - -08
# American Samoa
Zone Pacific/Pago_Pago 12:37:12 - LMT 1879 Jul 5
Zone Pacific/Pago_Pago 12:37:12 - LMT 1892 Jul 5
-11:22:48 - LMT 1911
-11:00 - SST # S=Samoa
Link Pacific/Pago_Pago Pacific/Midway # in US minor outlying islands
@ -618,7 +621,7 @@ Link Pacific/Pago_Pago Pacific/Midway # in US minor outlying islands
# Sunday of April 2011."
#
# Background info:
# http://www.timeanddate.com/news/time/samoa-dst-plan-2009.html
# https://www.timeanddate.com/news/time/samoa-dst-plan-2009.html
#
# Samoa's Daylight Saving Time Act 2009 is available here, but does not
# contain any dates:
@ -682,7 +685,7 @@ Rule WS 2011 only - Sep lastSat 3:00 1 D
Rule WS 2012 max - Apr Sun>=1 4:00 0 S
Rule WS 2012 max - Sep lastSun 3:00 1 D
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Pacific/Apia 12:33:04 - LMT 1879 Jul 5
Zone Pacific/Apia 12:33:04 - LMT 1892 Jul 5
-11:26:56 - LMT 1911
-11:30 - -1130 1950
-11:00 WS -11/-10 2011 Dec 29 24:00
@ -709,7 +712,7 @@ Zone Pacific/Guadalcanal 10:39:48 - LMT 1912 Oct # Honiara
# From Paul Eggert (2012-07-25)
# A Google Books snippet of Appendix to the Journals of the House of
# Representatives of New Zealand, Session 1948,
# <http://books.google.com/books?id=ZaVCAQAAIAAJ>, page 65, says Tokelau
# <https://books.google.com/books?id=ZaVCAQAAIAAJ>, page 65, says Tokelau
# was "11 hours slow on G.M.T." Go with Thorsen and assume Shanks & Pottenger
# are off by an hour starting in 1901.
@ -724,8 +727,8 @@ Rule Tonga 1999 only - Oct 7 2:00s 1:00 S
Rule Tonga 2000 only - Mar 19 2:00s 0 -
Rule Tonga 2000 2001 - Nov Sun>=1 2:00 1:00 S
Rule Tonga 2001 2002 - Jan lastSun 2:00 0 -
Rule Tonga 2016 max - Nov Sun>=1 2:00 1:00 S
Rule Tonga 2017 max - Jan Sun>=15 3:00 0 -
Rule Tonga 2016 only - Nov Sun>=1 2:00 1:00 S
Rule Tonga 2017 only - Jan Sun>=15 3:00 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Pacific/Tongatapu 12:19:20 - LMT 1901
12:20 - +1220 1941
@ -779,7 +782,7 @@ Zone Pacific/Funafuti 11:56:52 - LMT 1901
# Operation Fishbowl shot (Tightrope, 1962-11-04).... [See] Herman Hoerlin,
# "The United States High-Altitude Test Experience: A Review Emphasizing the
# Impact on the Environment", Los Alamos LA-6405, Oct 1976.
# http://www.fas.org/sgp/othergov/doe/lanl/docs1/00322994.pdf
# https://www.fas.org/sgp/othergov/doe/lanl/docs1/00322994.pdf
# See the table on page 4 where he lists GMT and local times for the tests; a
# footnote for the JI tests reads that local time is "JI time = Hawaii Time
# Minus One Hour".
@ -845,7 +848,7 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901
#
# For data circa 1899, a common source is:
# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94.
# http://www.jstor.org/stable/1774359
# https://www.jstor.org/stable/1774359
#
# A reliable and entertaining source about time zones is
# Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997).
@ -992,7 +995,7 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901
# AEST ACST AWST AEDT ACDT
#
# Parliamentary Library (2008-11-10)
# http://www.aph.gov.au/binaries/library/pubs/rp/2008-09/09rp14.pdf
# https://www.aph.gov.au/binaries/library/pubs/rp/2008-09/09rp14.pdf
# EST CST WST preferred for standard time; AEST AEDT ACST ACDT also used
#
# The Transport Safety Bureau has an extensive series of accident reports,
@ -1028,13 +1031,13 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901
#
# NSW (including LHI and Broken Hill):
# Standard Time Act 1987 (updated 1995-04-04)
# http://www.austlii.edu.au/au/legis/nsw/consol_act/sta1987137/index.html
# https://www.austlii.edu.au/au/legis/nsw/consol_act/sta1987137/index.html
# ACT
# Standard Time and Summer Time Act 1972
# http://www.austlii.edu.au/au/legis/act/consol_act/stasta1972279/index.html
# https://www.austlii.edu.au/au/legis/act/consol_act/stasta1972279/index.html
# SA
# Standard Time Act, 1898
# http://www.austlii.edu.au/au/legis/sa/consol_act/sta1898137/index.html
# https://www.austlii.edu.au/au/legis/sa/consol_act/sta1898137/index.html
# From David Grosz (2005-06-13):
# It was announced last week that Daylight Saving would be extended by
@ -1329,7 +1332,7 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901
# http://abc.net.au/news/regionals/neweng/monthly/regeng-22jul1999-1.htm
# (1999-07-22). For now, we'll wait to see if this really happens.
#
# Victoria will following NSW. See:
# Victoria will follow NSW. See:
# Vic to extend daylight saving (1999-07-28)
# http://abc.net.au/local/news/olympics/1999/07/item19990728112314_1.htm
#
@ -1432,7 +1435,7 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901
# the ACT for all 52 weeks of the year...
#
# We have a wrap-up here:
# http://www.timeanddate.com/news/time/south-australia-extends-dst.html
# https://www.timeanddate.com/news/time/south-australia-extends-dst.html
###############################################################################
# New Zealand
@ -1486,7 +1489,7 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901
# From Paul Eggert (2014-07-14):
# Chatham Island time was formally standardized on 1957-01-01 by
# New Zealand's Standard Time Amendment Act 1956 (1956-10-26).
# http://www.austlii.edu.au/nz/legis/hist_act/staa19561956n100244.pdf
# https://www.austlii.edu.au/nz/legis/hist_act/staa19561956n100244.pdf
# According to Google Books snippet view, a speaker in the New Zealand
# parliamentary debates in 1956 said "Clause 78 makes provision for standard
# time in the Chatham Islands. The time there is 45 minutes in advance of New
@ -1601,7 +1604,7 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901
# the Norfolk Island Museum and the Australian Bureau of Meteorology's
# Norfolk Island station, and found no record of Norfolk observing DST
# other than in 1974/5. See:
# http://www.timeanddate.com/time/australia/norfolk-island.html
# https://www.timeanddate.com/time/australia/norfolk-island.html
# Pitcairn
@ -1629,11 +1632,13 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901
# (Western) Samoa and American Samoa
# Howse writes (p 153, citing p 10 of the 1883-11-18 New York Herald)
# that in 1879 the King of Samoa decided to change
# Howse writes (p 153) that after the 1879 standardization on Antipodean
# time by the British governor of Fiji, the King of Samoa decided to change
# "the date in his kingdom from the Antipodean to the American system,
# ordaining - by a masterpiece of diplomatic flattery - that
# the Fourth of July should be celebrated twice in that year."
# This happened in 1892, according to the Evening News (Sydney) of 1892-07-20.
# https://www.staff.science.uu.nl/~gent0113/idl/idl.htm
# Although Shanks & Pottenger says they both switched to UT -11:30
# in 1911, and to -11 in 1950. many earlier sources give -11
@ -1644,6 +1649,7 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901
# day in 2011. Assume also that the Samoas follow the US and New
# Zealand's "ST"/"DT" style of daylight-saving abbreviations.
# Tonga
# From Paul Eggert (1996-01-22):
@ -1738,6 +1744,15 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901
# Assume Tonga will observe DST from the first Sunday in November at 02:00
# through the third Sunday in January at 03:00, like Fiji, for now.
# From David Wade (2017-10-18):
# In August government was disolved by the King. The current prime minister
# continued in office in care taker mode. It is easy to see that few
# decisions will be made until elections 16th November.
#
# From Paul Eggert (2017-10-18):
# For now, guess that DST is discontinued. That's what the IATA is guessing.
# Wake
# From Vernice Anderson, Personal Secretary to Philip Jessup,
@ -1750,7 +1765,7 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901
# making calculation of time in Washington difficult if not almost
# impossible.
#
# http://www.trumanlibrary.org/wake/meeting.htm
# https://www.trumanlibrary.org/oralhist/andrsonv.htm
# From Paul Eggert (2003-03-23):
# We have no other report of DST in Wake Island, so omit this info for now.
@ -1778,7 +1793,7 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901
# an international standard, there are some places on the high seas where the
# correct date is ambiguous.
# From Wikipedia <http://en.wikipedia.org/wiki/Time_zone> (2005-08-31):
# From Wikipedia <https://en.wikipedia.org/wiki/Time_zone> (2005-08-31):
# Before 1920, all ships kept local apparent time on the high seas by setting
# their clocks at night or at the morning sight so that, given the ship's
# speed and direction, it would be 12 o'clock when the Sun crossed the ship's

View File

@ -84,7 +84,9 @@ Link America/Sao_Paulo Brazil/East
Link America/Manaus Brazil/West
Link America/Halifax Canada/Atlantic
Link America/Winnipeg Canada/Central
Link America/Regina Canada/East-Saskatchewan
# This line is commented out, as the name exceeded the 14-character limit
# and was an unused misnomer.
#Link America/Regina Canada/East-Saskatchewan
Link America/Toronto Canada/Eastern
Link America/Edmonton Canada/Mountain
Link America/St_Johns Canada/Newfoundland

View File

@ -60,14 +60,14 @@
# [PDF] (1914-03)
#
# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94
# <http://www.jstor.org/stable/1774359>. He writes:
# <https://www.jstor.org/stable/1774359>. He writes:
# "It is requested that corrections and additions to these tables
# may be sent to Mr. John Milne, Royal Geographical Society,
# Savile Row, London." Nowadays please email them to tz@iana.org.
#
# Byalokoz EL. New Counting of Time in Russia since July 1, 1919.
# This Russian-language source was consulted by Vladimir Karpinsky; see
# http://mm.icann.org/pipermail/tz/2014-August/021320.html
# https://mm.icann.org/pipermail/tz/2014-August/021320.html
# The full Russian citation is:
# Бялокоз, Евгений Людвигович. Новый счет времени в течении суток
# введенный декретом Совета народных комиссаров для всей России с 1-го
@ -210,7 +210,7 @@
# foundations of civilization throughout the world.
# -- "A Silent Toast to William Willett", Pictorial Weekly;
# republished in Finest Hour (Spring 2002) 1(114):26
# http://www.winstonchurchill.org/images/finesthour/Vol.01%20No.114.pdf
# https://www.winstonchurchill.org/publications/finest-hour/finest-hour-114/a-silent-toast-to-william-willett-by-winston-s-churchill
# From Paul Eggert (2015-08-08):
# The OED Supplement says that the English originally said "Daylight Saving"
@ -248,8 +248,8 @@
# official designation; the reply of the 21st was that there wasn't
# but he couldn't think of anything better than the "Double British
# Summer Time" that the BBC had been using informally.
# http://www.polyomino.org.uk/british-time/bbc-19410418.png
# http://www.polyomino.org.uk/british-time/ho-19410421.png
# https://www.polyomino.org.uk/british-time/bbc-19410418.png
# https://www.polyomino.org.uk/british-time/ho-19410421.png
# From Sir Alexander Maxwell in the above-mentioned letter (1941-04-21):
# [N]o official designation has as far as I know been adopted for the time
@ -266,13 +266,13 @@
# the history of summer time legislation in the United Kingdom.
# Since 1998 Joseph S. Myers has been updating
# and extending this list, which can be found in
# http://www.polyomino.org.uk/british-time/
# https://www.polyomino.org.uk/british-time/
# From Joseph S. Myers (1998-01-06):
#
# The legal time in the UK outside of summer time is definitely GMT, not UTC;
# see Lord Tanlaw's speech
# http://www.publications.parliament.uk/pa/ld199798/ldhansrd/vo970611/text/70611-10.htm#70611-10_head0
# https://www.publications.parliament.uk/pa/ld199798/ldhansrd/vo970611/text/70611-10.htm#70611-10_head0
# (Lords Hansard 11 June 1997 columns 964 to 976).
# From Paul Eggert (2006-03-22):
@ -318,7 +318,7 @@
# Irish 'public feeling (was) outraged by forcing of English time on us'."
# -- Parsons M. Dublin lost its time zone - and 25 minutes - after 1916 Rising.
# Irish Times 2014-10-27.
# http://www.irishtimes.com/news/politics/dublin-lost-its-time-zone-and-25-minutes-after-1916-rising-1.1977411
# https://www.irishtimes.com/news/politics/dublin-lost-its-time-zone-and-25-minutes-after-1916-rising-1.1977411
# From Joseph S. Myers (2005-01-26):
# Irish laws are available online at <http://www.irishstatutebook.ie>.
@ -371,6 +371,12 @@
# Justice (tel +353 1 678 9711) who confirmed to me that the correct name is
# "Irish Summer Time", abbreviated to "IST".
# Michael Deckers (2017-06-01) gave the following URLs for Ireland's
# Summer Time Act, 1925 and Summer Time Orders, 1926 and 1947:
# http://www.irishstatutebook.ie/eli/1925/act/8/enacted/en/print.html
# http://www.irishstatutebook.ie/eli/1926/sro/919/made/en/print.html
# http://www.irishstatutebook.ie/eli/1947/sro/71/made/en/print.html
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
# Summer Time Act, 1916
Rule GB-Eire 1916 only - May 21 2:00s 1:00 BST
@ -495,14 +501,14 @@ Link Europe/London Europe/Isle_of_Man
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Europe/Dublin -0:25:00 - LMT 1880 Aug 2
-0:25:21 - DMT 1916 May 21 2:00 # Dublin MT
-0:25:21 - DMT 1916 May 21 2:00s # Dublin MT
-0:25:21 1:00 IST 1916 Oct 1 2:00s
0:00 GB-Eire %s 1921 Dec 6 # independence
0:00 GB-Eire GMT/IST 1940 Feb 25 2:00
0:00 1:00 IST 1946 Oct 6 2:00
0:00 - GMT 1947 Mar 16 2:00
0:00 1:00 IST 1947 Nov 2 2:00
0:00 - GMT 1948 Apr 18 2:00
0:00 GB-Eire GMT/IST 1940 Feb 25 2:00s
0:00 1:00 IST 1946 Oct 6 2:00s
0:00 - GMT 1947 Mar 16 2:00s
0:00 1:00 IST 1947 Nov 2 2:00s
0:00 - GMT 1948 Apr 18 2:00s
0:00 GB-Eire GMT/IST 1968 Oct 27
1:00 - IST 1971 Oct 31 2:00u
0:00 GB-Eire GMT/IST 1996
@ -648,7 +654,7 @@ Rule Russia 1996 2010 - Oct lastSun 2:00s 0 -
# Council of Ministers of the USSR from 1989-03-14 No. 227.
#
# I did not find full texts of these acts. For the 1989 one we have
# title at http://base.garant.ru/70754136/ :
# title at https://base.garant.ru/70754136/ :
# "About change in calculation of time on the territories of
# Lithuanian SSR, Latvian SSR and Estonian SSR, Astrakhan,
# Kaliningrad, Kirov, Kuybyshev, Ulyanovsk and Uralsk oblasts".
@ -679,7 +685,7 @@ Rule Russia 1996 2010 - Oct lastSun 2:00s 0 -
# http://bmockbe.ru/events/?ID=7583
#
# Medvedev signed a law on the calculation of the time (in russian):
# http://www.regnum.ru/news/polit/1413906.html
# https://www.regnum.ru/news/polit/1413906.html
# From Arthur David Olson (2011-06-15):
# Take "abolishing daylight saving time" to mean that time is now considered
@ -806,7 +812,7 @@ Zone Europe/Vienna 1:05:21 - LMT 1893 Apr
# Sources (Russian language):
# http://www.belta.by/ru/all_news/society/V-Belarusi-otmenjaetsja-perexod-na-sezonnoe-vremja_i_572952.html
# http://naviny.by/rubrics/society/2011/09/16/ic_articles_116_175144/
# http://news.tut.by/society/250578.html
# https://news.tut.by/society/250578.html
#
# From Alexander Bokovoy (2014-10-09):
# Belarussian government decided against changing to winter time....
@ -1127,7 +1133,7 @@ Zone America/Thule -4:35:08 - LMT 1916 Jul 28 # Pituffik air base
# for their standard and summer times. He says no, they use "suveaeg"
# (summer time) and "talveaeg" (winter time).
# From The Baltic Times <http://www.baltictimes.com/> (1999-09-09)
# From The Baltic Times <https://www.baltictimes.com/> (1999-09-09)
# via Steffen Thorsen:
# This year will mark the last time Estonia shifts to summer time,
# a council of the ruling coalition announced Sept. 6....
@ -1179,7 +1185,7 @@ Zone Europe/Tallinn 1:39:00 - LMT 1880
# This is documented in Heikki Oja: Aikakirja 2007, published by The Almanac
# Office of University of Helsinki, ISBN 952-10-3221-9, available online (in
# Finnish) at
# http://almanakka.helsinki.fi/aikakirja/Aikakirja2007kokonaan.pdf
# https://almanakka.helsinki.fi/aikakirja/Aikakirja2007kokonaan.pdf
#
# Page 105 (56 in PDF version) has a handy table of all past daylight savings
# transitions. It is easy enough to interpret without Finnish skills.
@ -1192,7 +1198,7 @@ Zone Europe/Tallinn 1:39:00 - LMT 1880
# From Konstantin Hyppönen (2014-06-13):
# [Heikki Oja's book Aikakirja 2013]
# http://almanakka.helsinki.fi/images/aikakirja/Aikakirja2013kokonaan.pdf
# https://almanakka.helsinki.fi/images/aikakirja/Aikakirja2013kokonaan.pdf
# pages 104-105, including a scan from a newspaper published on Apr 2 1942
# say that ... [o]n Apr 2 1942, 24 o'clock (which means Apr 3 1942,
# 00:00), clocks were moved one hour forward. The newspaper
@ -1322,7 +1328,7 @@ Zone Europe/Paris 0:09:21 - LMT 1891 Mar 15 0:01
# From Jörg Schilling (2002-10-23):
# In 1945, Berlin was switched to Moscow Summer time (GMT+4) by
# http://www.dhm.de/lemo/html/biografien/BersarinNikolai/
# https://www.dhm.de/lemo/html/biografien/BersarinNikolai/
# General [Nikolai] Bersarin.
# From Paul Eggert (2003-03-08):
@ -1547,7 +1553,7 @@ Zone Atlantic/Reykjavik -1:28 - LMT 1908
# From Paul Eggert (2016-10-27):
# Go with INRiM for DST rules, except as corrected by Inglis for 1944
# for the Kingdom of Italy. This is consistent with Renzo Baldini.
# Model Rome's occupation by using using C-Eur rules from 1943-09-10
# Model Rome's occupation by using C-Eur rules from 1943-09-10
# to 1944-06-04; although Rome was an open city during this period, it
# was effectively controlled by Germany.
#
@ -1862,14 +1868,14 @@ Zone Europe/Malta 0:58:04 - LMT 1893 Nov 2 0:00s # Valletta
# Following Moldova and neighboring Ukraine- Transnistria (Pridnestrovie)-
# Tiraspol will go back to winter time on October 30, 2011.
# News from Moldova (in russian):
# http://ru.publika.md/link_317061.html
# https://ru.publika.md/link_317061.html
# From Roman Tudos (2015-07-02):
# http://lex.justice.md/index.php?action=view&view=doc&lang=1&id=355077
# From Paul Eggert (2015-07-01):
# The abovementioned official link to IGO1445-868/2014 states that
# 2014-10-26's fallback transition occurred at 03:00 local time. Also,
# http://www.trm.md/en/social/la-30-martie-vom-trece-la-ora-de-vara
# https://www.trm.md/en/social/la-30-martie-vom-trece-la-ora-de-vara
# says the 2014-03-30 spring-forward transition was at 02:00 local time.
# Guess that since 1997 Moldova has switched one hour before the EU.
@ -1941,7 +1947,7 @@ Zone Europe/Monaco 0:29:32 - LMT 1891 Mar 15
# Amsterdam mean time.
# The data entries before 1945 are taken from
# http://www.staff.science.uu.nl/~gent0113/wettijd/wettijd.htm
# https://www.staff.science.uu.nl/~gent0113/wettijd/wettijd.htm
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Neth 1916 only - May 1 0:00 1:00 NST # Netherlands Summer Time
@ -2022,7 +2028,7 @@ Zone Europe/Oslo 0:43:00 - LMT 1895 Jan 1
# so it must have diverged from Oslo time during the war, as Oslo was
# keeping Berlin time.
#
# <http://home.no.net/janmayen/history.htm> says that the meteorologists
# <https://www.jan-mayen.no/history.htm> says that the meteorologists
# burned down their station in 1940 and left the island, but returned in
# 1941 with a small Norwegian garrison and continued operations despite
# frequent air attacks from Germans. In 1943 the Americans established a
@ -2060,7 +2066,7 @@ Rule Poland 1945 only - Apr 29 0:00 1:00 S
Rule Poland 1945 only - Nov 1 0:00 0 -
# For 1946 on the source is Kazimierz Borkowski,
# Toruń Center for Astronomy, Dept. of Radio Astronomy, Nicolaus Copernicus U.,
# http://www.astro.uni.torun.pl/~kb/Artykuly/U-PA/Czas2.htm#tth_tAb1
# https://www.astro.uni.torun.pl/~kb/Artykuly/U-PA/Czas2.htm#tth_tAb1
# Thanks to Przemysław Augustyniak (2005-05-28) for this reference.
# He also gives these further references:
# Mon Pol nr 13, poz 162 (1995) <http://www.abc.com.pl/serwis/mp/1995/0162.htm>
@ -2094,7 +2100,7 @@ Zone Europe/Warsaw 1:24:00 - LMT 1880
#
# From Paul Eggert (2014-08-11), after a heads-up from Stephen Colebourne:
# According to a Portuguese decree (1911-05-26)
# http://dre.pt/pdf1sdip/1911/05/12500/23132313.pdf
# https://dre.pt/application/dir/pdf1sdip/1911/05/12500/23132313.pdf
# Lisbon was at -0:36:44.68, but switched to GMT on 1912-01-01 at 00:00.
# Round the old offset to -0:36:45. This agrees with Willett but disagrees
# with Shanks, who says the transition occurred on 1911-05-24 at 00:00 for
@ -2276,7 +2282,7 @@ Zone Europe/Bucharest 1:44:24 - LMT 1891 Oct
# 2011 No. 725" and contains no other dates or "effective date" information.
#
# Another source is
# http://www.rg.ru/2011/09/06/chas-zona-dok.html
# https://rg.ru/2011/09/06/chas-zona-dok.html
# which, according to translate.google.com, begins "Resolution of the
# Government of the Russian Federation on August 31, 2011 N 725" and also
# contains "Date first official publication: September 6, 2011 Posted on:
@ -2284,7 +2290,7 @@ Zone Europe/Bucharest 1:44:24 - LMT 1891 Oct
# does not contain any "effective date" information.
#
# Another source is
# http://en.wikipedia.org/wiki/Oymyakonsky_District#cite_note-RuTime-7
# https://en.wikipedia.org/wiki/Oymyakonsky_District#cite_note-RuTime-7
# which, in note 8, contains "Resolution No. 725 of August 31, 2011...
# Effective as of after 7 days following the day of the official publication"
# but which does not contain any reference to September 6, 2011.
@ -2320,7 +2326,7 @@ Zone Europe/Bucharest 1:44:24 - LMT 1891 Oct
# http://itar-tass.com/obschestvo/1333711
# http://www.pravo.gov.ru:8080/page.aspx?111660
# http://www.kremlin.ru/acts/46279
# From October 26, 2014 the new Russian time zone map will looks like this:
# From October 26, 2014 the new Russian time zone map will look like this:
# http://www.worldtimezone.com/dst_news/dst_news_russia-map-2014-07.html
# From Paul Eggert (2006-03-22):
@ -2367,7 +2373,7 @@ Zone Europe/Bucharest 1:44:24 - LMT 1891 Oct
# with maintenance only and represent our best guesses as to which regions
# are covered by each zone. They are not meant to be taken as an authoritative
# listing. The region codes listed come from
# http://en.wikipedia.org/w/?title=Federal_subjects_of_Russia&oldid=611810498
# https://en.wikipedia.org/w/?title=Federal_subjects_of_Russia&oldid=611810498
# and are used for convenience only; no guarantees are made regarding their
# future stability. ISO 3166-2:RU codes are also listed for first-level
# divisions where available.
@ -2532,7 +2538,7 @@ Zone Europe/Kaliningrad 1:22:00 - LMT 1893 Apr
# http://www.kaliningradka.ru/site_pc/cherez/index.php?ELEMENT_ID=40091
# says that Kaliningrad decided not to be an exception 2 days before the
# 1991-03-31 switch and one person at
# http://izhevsk.ru/forum_light_message/50/682597-m8369040.html
# https://izhevsk.ru/forum_light_message/50/682597-m8369040.html
# says he remembers that Samara opted out of the 1992-01-19 exception
# 2 days before the switch.
#
@ -2604,7 +2610,7 @@ Zone Europe/Simferopol 2:16:24 - LMT 1880
3:00 - MSK 1997 Mar lastSun 1:00u
# From Alexander Krivenyshev (2014-03-17):
# time change at 2:00 (2am) on March 30, 2014
# http://vz.ru/news/2014/3/17/677464.html
# https://vz.ru/news/2014/3/17/677464.html
# From Paul Eggert (2014-03-30):
# Simferopol and Sevastopol reportedly changed their central town clocks
# late the previous day, but this appears to have been ceremonial
@ -2787,7 +2793,7 @@ Zone Asia/Omsk 4:53:30 - LMT 1919 Nov 14
# suggests that Altai Republic transitioned to Moscow+3 on
# 1995-05-28.
#
# http://regnum.ru/news/society/1957270.html
# https://regnum.ru/news/society/1957270.html
# has some historical data for Altai Krai:
# before 1957: west part on UTC+6, east on UTC+7
# after 1957: UTC+7
@ -3161,8 +3167,8 @@ Zone Asia/Magadan 10:03:12 - LMT 1924 May 2
# districts, but have very similar populations. In fact, Wikipedia currently
# lists them both as having 3528 people, exactly 1668 males and 1860 females
# each! (Yikes!)
# http://en.wikipedia.org/w/?title=Srednekolymsky_District&oldid=603435276
# http://en.wikipedia.org/w/?title=Verkhnekolymsky_District&oldid=594378493
# https://en.wikipedia.org/w/?title=Srednekolymsky_District&oldid=603435276
# https://en.wikipedia.org/w/?title=Verkhnekolymsky_District&oldid=594378493
# Assume this is a mistake, albeit an amusing one.
#
# Looking at censuses, the populations of the two municipalities seem to have
@ -3483,7 +3489,7 @@ Zone Europe/Stockholm 1:12:12 - LMT 1879 Jan 1
#
# From Alois Treindl (2013-09-11):
# The Federal regulations say
# http://www.admin.ch/opc/de/classified-compilation/20071096/index.html
# https://www.admin.ch/opc/de/classified-compilation/20071096/index.html
# ... the meridian for Bern mean time ... is 7 degrees 26' 22.50".
# Expressed in time, it is 0h29m45.5s.
@ -3560,9 +3566,9 @@ Zone Europe/Zurich 0:34:08 - LMT 1853 Jul 16 # See above comment.
# According to the articles linked below, Turkey will change into summer
# time zone (GMT+3) on March 28, 2011 at 3:00 a.m. instead of March 27.
# This change is due to a nationwide exam on 27th.
# http://www.worldbulletin.net/?aType=haber&ArticleID=70872
# https://www.worldbulletin.net/?aType=haber&ArticleID=70872
# Turkish:
# http://www.hurriyet.com.tr/ekonomi/17230464.asp?gid=373
# https://www.hurriyet.com.tr/yaz-saati-uygulamasi-bir-gun-ileri-alindi-17230464
# From Faruk Pasin (2014-02-14):
# The DST for Turkey has been changed for this year because of the
@ -3698,7 +3704,7 @@ Link Europe/Istanbul Asia/Istanbul # Istanbul is in both continents.
# http://www.segodnya.ua/news/14290482.html
#
# Deputies cancelled the winter time (in Russian)
# http://www.pravda.com.ua/rus/news/2011/09/20/6600616/
# https://www.pravda.com.ua/rus/news/2011/09/20/6600616/
#
# From Philip Pizzey (2011-10-18):
# Today my Ukrainian colleagues have informed me that the

View File

@ -26,19 +26,18 @@
# This file is in the public domain.
# This file is generated automatically from the data in the public-domain
# leap-seconds.list file available from most NIST time servers.
# If the URL <ftp://time.nist.gov/pub/leap-seconds.list> does not work,
# you should be able to pick up leap-seconds.list from a secondary NIST server.
# See <http://tf.nist.gov/tf-cgi/servers.cgi> for a list of secondary servers.
# leap-seconds.list file, which is copied from:
# ftp://ftp.nist.gov/pub/time/leap-seconds.list
# For more about leap-seconds.list, please see
# The NTP Timescale and Leap Seconds
# http://www.eecis.udel.edu/~mills/leap.html
# https://www.eecis.udel.edu/~mills/leap.html
# The International Earth Rotation and Reference Systems Service
# periodically uses leap seconds to keep UTC to within 0.9 s of UT1
# (which measures the true angular orientation of the earth in space); see
# Terry J Quinn, The BIPM and the accurate measure of time,
# Proc IEEE 79, 7 (July 1991), 894-905 <http://dx.doi.org/10.1109/5.84965>.
# Levine J. Coordinated Universal Time and the leap second.
# URSI Radio Sci Bull. 2016;89(4):30-6. doi:10.23919/URSIRSB.2016.7909995
# http://ieeexplore.ieee.org/document/7909995/
# There were no leap seconds before 1972, because the official mechanism
# accounting for the discrepancy between atomic time and the earth's rotation
# did not exist until the early 1970s.
@ -81,5 +80,5 @@ Leap 2012 Jun 30 23:59:60 + S
Leap 2015 Jun 30 23:59:60 + S
Leap 2016 Dec 31 23:59:60 + S
# Updated through IERS Bulletin C53
# File expires on: 28 December 2017
# Updated through IERS Bulletin C54
# File expires on: 28 June 2018

View File

@ -128,10 +128,13 @@
# Last night I heard part of a rebroadcast of a 1945 Arch Oboler radio drama.
# In the introduction, Oboler spoke of "Eastern Peace Time."
# An AltaVista search turned up:
# http://rowayton.org/rhs/hstaug45.html
# https://web.archive.org/web/20000926032210/http://rowayton.org/rhs/hstaug45.html
# "When the time is announced over the radio now, it is 'Eastern Peace
# Time' instead of the old familiar 'Eastern War Time.' Peace is wonderful."
# (August 1945) by way of confirmation.
#
# From Paul Eggert (2017-09-23):
# This was the V-J Day issue of the Clamdigger, a Rowayton, CT newsletter.
# From Joseph Gallant citing
# George H. Douglas, _The Early Days of Radio Broadcasting_ (1987):
@ -280,7 +283,7 @@ Zone PST8PDT -8:00 US P%sT
# HST and HDT are standardized abbreviations for Hawaii-Aleutian
# standard and daylight times. See section 9.47 (p 234) of the
# U.S. Government Printing Office Style Manual (2008)
# http://www.gpo.gov/fdsys/pkg/GPO-STYLEMANUAL-2008/pdf/GPO-STYLEMANUAL-2008.pdf
# https://www.gpo.gov/fdsys/pkg/GPO-STYLEMANUAL-2008/pdf/GPO-STYLEMANUAL-2008.pdf
# From Arthur David Olson, 2005-08-09
# The following was signed into law on 2005-08-08.
@ -369,7 +372,7 @@ Zone America/New_York -4:56:02 - LMT 1883 Nov 18 12:03:58
# western Tennessee, most of Texas, Wisconsin
# From Larry M. Smith (2006-04-26) re Wisconsin:
# http://www.legis.state.wi.us/statutes/Stat0175.pdf ...
# https://docs.legis.wisconsin.gov/statutes/statutes/175.pdf
# is currently enforced at the 01:00 time of change. Because the local
# "bar time" in the state corresponds to 02:00, a number of citations
# are issued for the "sale of class 'B' alcohol after prohibited
@ -378,7 +381,7 @@ Zone America/New_York -4:56:02 - LMT 1883 Nov 18 12:03:58
# From Douglas R. Bomberg (2007-03-12):
# Wisconsin has enacted (nearly eleventh-hour) legislation to get WI
# Statue 175 closer in synch with the US Congress' intent....
# http://www.legis.state.wi.us/2007/data/acts/07Act3.pdf
# https://docs.legis.wisconsin.gov/2007/related/acts/3
# From an email administrator of the City of Fort Pierre, SD (2015-12-21):
# Fort Pierre is technically located in the Mountain time zone as is
@ -425,7 +428,7 @@ Zone America/North_Dakota/New_Salem -6:45:39 - LMT 1883 Nov 18 12:14:21
# ...it appears that Mercer County, North Dakota, changed from the
# mountain time zone to the central time zone at the last transition from
# daylight-saving to standard time (on Nov. 7, 2010):
# http://www.gpo.gov/fdsys/pkg/FR-2010-09-29/html/2010-24376.htm
# https://www.gpo.gov/fdsys/pkg/FR-2010-09-29/html/2010-24376.htm
# http://www.bismarcktribune.com/news/local/article_1eb1b588-c758-11df-b472-001cc4c03286.html
# From Andy Lipscomb (2011-01-24):
@ -476,7 +479,7 @@ Zone America/Denver -6:59:56 - LMT 1883 Nov 18 12:00:04
# legal time, and is not part of the data here.) See:
# Ross SA. An energy crisis from the past: Northern California in 1948.
# Working Paper No. 8, Institute of Governmental Studies, UC Berkeley,
# 1973-11. http://escholarship.org/uc/item/8x22k30c
# 1973-11. https://escholarship.org/uc/item/8x22k30c
#
# In another measure to save electricity, DST was instituted from 1948-03-14
# at 02:01 to 1949-01-16 at 02:00, with the governor having the option to move
@ -497,8 +500,8 @@ Zone America/Denver -6:59:56 - LMT 1883 Nov 18 12:00:04
# which established DST from April's last Sunday at 01:00 until September's
# last Sunday at 02:00. This was amended by 1962's Proposition 6, which changed
# the fall-back date to October's last Sunday. See:
# http://repository.uchastings.edu/cgi/viewcontent.cgi?article=1501&context=ca_ballot_props
# http://repository.uchastings.edu/cgi/viewcontent.cgi?article=1636&context=ca_ballot_props
# https://repository.uchastings.edu/cgi/viewcontent.cgi?article=1501&context=ca_ballot_props
# https://repository.uchastings.edu/cgi/viewcontent.cgi?article=1636&context=ca_ballot_props
#
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER
Rule CA 1948 only - Mar 14 2:01 1:00 D
@ -515,20 +518,31 @@ Zone America/Los_Angeles -7:52:58 - LMT 1883 Nov 18 12:07:02
# Alaska
# AK%sT is the modern abbreviation for -09 per USNO.
#
# From Paul Eggert (2001-05-30):
# From Paul Eggert (2017-06-15):
# Howse writes that Alaska switched from the Julian to the Gregorian calendar,
# and from east-of-GMT to west-of-GMT days, when the US bought it from Russia.
# This was on 1867-10-18, a Friday; the previous day was 1867-10-06 Julian,
# also a Friday. Include only the time zone part of this transition,
# ignoring the switch from Julian to Gregorian, since we can't represent
# the Julian calendar.
# On Friday, 1867-10-18 (Gregorian), at precisely 15:30 local time, the
# Russian forts and fleet at Sitka fired salutes to mark the ceremony of
# formal transfer. See the Sacramento Daily Union (1867-11-14), p 3, col 2.
# https://cdnc.ucr.edu/cgi-bin/cdnc?a=d&d=SDU18671114.2.12.1
# Sitka workers did not change their calendars until Sunday, 1867-10-20,
# and so celebrated two Sundays that week. See: Ahllund T (tr Hallamaa P).
# From the memoirs of a Finnish workman. Alaska History. 2006 Fall;21(2):1-25.
# http://alaskahistoricalsociety.org/wp-content/uploads/2016/12/Ahllund-2006-Memoirs-of-a-Finnish-Workman.pdf
# Include only the time zone part of this transition, ignoring the switch
# from Julian to Gregorian, since we can't represent the Julian calendar.
#
# As far as we know, none of the exact locations mentioned below were
# As far as we know, of the locations mentioned below only Sitka was
# permanently inhabited in 1867 by anyone using either calendar.
# (Yakutat was colonized by the Russians in 1799, but the settlement
# was destroyed in 1805 by a Yakutat-kon war party.) However, there
# were nearby inhabitants in some cases and for our purposes perhaps
# it's best to simply use the official transition.
# (Yakutat was colonized by the Russians in 1799, but the settlement was
# destroyed in 1805 by a Yakutat-kon war party.) Many of Alaska's inhabitants
# were unaware of the US acquisition of Alaska, much less of any calendar or
# time change. However, the Russian-influenced part of Alaska did observe
# Russian time, and it is more accurate to model this than to ignore it.
# The database format requires an exact transition time; use the Russian
# salute as a somewhat-arbitrary time for the formal transfer of control for
# all of Alaska. Sitka's UTC offset is -9:01:13; adjust its 15:30 to the
# local times of other Alaskan locations so that they change simultaneously.
# From Paul Eggert (2014-07-18):
# One opinion of the early-1980s turmoil in Alaska over time zones and
@ -581,10 +595,10 @@ Zone America/Los_Angeles -7:52:58 - LMT 1883 Nov 18 12:07:02
# It seems Metlakatla did go off PST on Sunday, November 1, changing
# their time to AKST and are going to follow Alaska's DST, switching
# between AKST and AKDT from now on....
# http://www.krbd.org/2015/10/30/annette-island-times-they-are-a-changing/
# https://www.krbd.org/2015/10/30/annette-island-times-they-are-a-changing/
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone America/Juneau 15:02:19 - LMT 1867 Oct 18
Zone America/Juneau 15:02:19 - LMT 1867 Oct 19 15:33:32
-8:57:41 - LMT 1900 Aug 20 12:00
-8:00 - PST 1942
-8:00 US P%sT 1946
@ -594,7 +608,7 @@ Zone America/Juneau 15:02:19 - LMT 1867 Oct 18
-8:00 US P%sT 1983 Oct 30 2:00
-9:00 US Y%sT 1983 Nov 30
-9:00 US AK%sT
Zone America/Sitka 14:58:47 - LMT 1867 Oct 18
Zone America/Sitka 14:58:47 - LMT 1867 Oct 19 15:30
-9:01:13 - LMT 1900 Aug 20 12:00
-8:00 - PST 1942
-8:00 US P%sT 1946
@ -602,7 +616,7 @@ Zone America/Sitka 14:58:47 - LMT 1867 Oct 18
-8:00 US P%sT 1983 Oct 30 2:00
-9:00 US Y%sT 1983 Nov 30
-9:00 US AK%sT
Zone America/Metlakatla 15:13:42 - LMT 1867 Oct 18
Zone America/Metlakatla 15:13:42 - LMT 1867 Oct 19 15:44:55
-8:46:18 - LMT 1900 Aug 20 12:00
-8:00 - PST 1942
-8:00 US P%sT 1946
@ -610,14 +624,14 @@ Zone America/Metlakatla 15:13:42 - LMT 1867 Oct 18
-8:00 US P%sT 1983 Oct 30 2:00
-8:00 - PST 2015 Nov 1 2:00
-9:00 US AK%sT
Zone America/Yakutat 14:41:05 - LMT 1867 Oct 18
Zone America/Yakutat 14:41:05 - LMT 1867 Oct 19 15:12:18
-9:18:55 - LMT 1900 Aug 20 12:00
-9:00 - YST 1942
-9:00 US Y%sT 1946
-9:00 - YST 1969
-9:00 US Y%sT 1983 Nov 30
-9:00 US AK%sT
Zone America/Anchorage 14:00:24 - LMT 1867 Oct 18
Zone America/Anchorage 14:00:24 - LMT 1867 Oct 19 14:31:37
-9:59:36 - LMT 1900 Aug 20 12:00
-10:00 - AST 1942
-10:00 US A%sT 1967 Apr
@ -625,7 +639,7 @@ Zone America/Anchorage 14:00:24 - LMT 1867 Oct 18
-10:00 US AH%sT 1983 Oct 30 2:00
-9:00 US Y%sT 1983 Nov 30
-9:00 US AK%sT
Zone America/Nome 12:58:21 - LMT 1867 Oct 18
Zone America/Nome 12:58:22 - LMT 1867 Oct 19 13:29:35
-11:01:38 - LMT 1900 Aug 20 12:00
-11:00 - NST 1942
-11:00 US N%sT 1946
@ -634,7 +648,7 @@ Zone America/Nome 12:58:21 - LMT 1867 Oct 18
-11:00 US B%sT 1983 Oct 30 2:00
-9:00 US Y%sT 1983 Nov 30
-9:00 US AK%sT
Zone America/Adak 12:13:21 - LMT 1867 Oct 18
Zone America/Adak 12:13:22 - LMT 1867 Oct 19 12:44:35
-11:46:38 - LMT 1900 Aug 20 12:00
-11:00 - NST 1942
-11:00 US N%sT 1946
@ -670,7 +684,7 @@ Zone America/Adak 12:13:21 - LMT 1867 Oct 18
# "Hawaiian Time" by Robert C. Schmitt and Doak C. Cox appears on pages 207-225
# of volume 26 of The Hawaiian Journal of History (1992). As of 2010-12-09,
# the article is available at
# http://evols.library.manoa.hawaii.edu/bitstream/10524/239/2/JL26215.pdf
# https://evols.library.manoa.hawaii.edu/bitstream/10524/239/2/JL26215.pdf
# and indicates that standard time was adopted effective noon, January
# 13, 1896 (page 218), that in "1933, the Legislature decreed daylight
# saving for the period between the last Sunday of each April and the
@ -769,7 +783,7 @@ Zone America/Boise -7:44:49 - LMT 1883 Nov 18 12:15:11
# Indiana
#
# For a map of Indiana's time zone regions, see:
# http://en.wikipedia.org/wiki/Time_in_Indiana
# https://en.wikipedia.org/wiki/Time_in_Indiana
#
# From Paul Eggert (2007-08-17):
# Since 1970, most of Indiana has been like America/Indiana/Indianapolis,
@ -996,7 +1010,7 @@ Zone America/Kentucky/Louisville -5:43:02 - LMT 1883 Nov 18 12:16:58
# From Paul Eggert (2001-07-16):
# The final rule was published in the
# Federal Register 65, 160 (2000-08-17), pp 50154-50158.
# http://frwebgate.access.gpo.gov/cgi-bin/getdoc.cgi?dbname=2000_register&docid=fr17au00-22
# https://www.gpo.gov/fdsys/pkg/FR-2000-08-17/html/00-20854.htm
#
Zone America/Kentucky/Monticello -5:39:24 - LMT 1883 Nov 18 12:20:36
-6:00 US C%sT 1946
@ -1022,7 +1036,7 @@ Zone America/Kentucky/Monticello -5:39:24 - LMT 1883 Nov 18 12:20:36
# West Wendover, NV officially switched from Pacific to mountain time on
# 1999-10-31. See the
# Federal Register 64, 203 (1999-10-21), pp 56705-56707.
# http://frwebgate.access.gpo.gov/cgi-bin/getdoc.cgi?dbname=1999_register&docid=fr21oc99-15
# https://www.gpo.gov/fdsys/pkg/FR-1999-10-21/html/99-27240.htm
# However, the Federal Register says that West Wendover already operated
# on mountain time, and the rule merely made this official;
# hence a separate tz entry is not needed.
@ -1052,12 +1066,23 @@ Zone America/Kentucky/Monticello -5:39:24 - LMT 1883 Nov 18 12:20:36
# one hour in 1914." This change is not in Shanks. We have no more
# info, so omit this for now.
#
# From Paul Eggert (2017-07-26):
# Although Shanks says Detroit observed DST in 1967 from 06-14 00:01
# until 10-29 00:01, I now see multiple reports that this is incorrect.
# For example, according to a 50-year anniversary report about the 1967
# Detroit riots and a major-league doubleheader on 1967-07-23, "By the time
# the last fly ball of the doubleheader settled into the glove of leftfielder
# Lenny Green, it was after 7 p.m. Detroit did not observe daylight saving
# time, so light was already starting to fail. Twilight was made even deeper
# by billowing columns of smoke that ascended in an unbroken wall north of the
# ballpark." See: Dow B. Detroit '67: As violence unfolded, Tigers played two
# at home vs. Yankees. Detroit Free Press 2017-07-23.
# https://www.freep.com/story/sports/mlb/tigers/2017/07/23/detroit-tigers-1967-riot-new-york-yankees/499951001/
#
# Most of Michigan observed DST from 1973 on, but was a bit late in 1975.
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER
Rule Detroit 1948 only - Apr lastSun 2:00 1:00 D
Rule Detroit 1948 only - Sep lastSun 2:00 0 S
Rule Detroit 1967 only - Jun 14 2:00 1:00 D
Rule Detroit 1967 only - Oct lastSun 2:00 0 S
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone America/Detroit -5:32:11 - LMT 1905
-6:00 - CST 1915 May 15 2:00
@ -1121,7 +1146,7 @@ Zone America/Menominee -5:50:27 - LMT 1885 Sep 18 12:00
# [PDF] (1914-03)
#
# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94
# <http://www.jstor.org/stable/1774359>.
# <https://www.jstor.org/stable/1774359>.
#
# See the 'europe' file for Greenland.
@ -1167,19 +1192,19 @@ Zone America/Menominee -5:50:27 - LMT 1885 Sep 18 12:00
# The British Columbia government announced yesterday that it will
# adjust daylight savings next year to align with changes in the
# U.S. and the rest of Canada....
# http://www2.news.gov.bc.ca/news_releases_2005-2009/2006AG0014-000330.htm
# https://archive.news.gov.bc.ca/releases/news_releases_2005-2009/2006AG0014-000330.htm
# ...
# Nova Scotia
# Daylight saving time will be extended by four weeks starting in 2007....
# http://www.gov.ns.ca/just/regulations/rg2/2006/ma1206.pdf
# https://www.novascotia.ca/just/regulations/rg2/2006/ma1206.pdf
#
# [For New Brunswick] the new legislation dictates that the time change is to
# be done at 02:00 instead of 00:01.
# http://www.gnb.ca/0062/acts/BBA-2006/Chap-19.pdf
# https://www.gnb.ca/0062/acts/BBA-2006/Chap-19.pdf
# ...
# Manitoba has traditionally changed the clock every fall at 03:00.
# As of 2006, the transition is to take place one hour earlier at 02:00.
# http://web2.gov.mb.ca/laws/statutes/ccsm/o030e.php
# https://web2.gov.mb.ca/laws/statutes/ccsm/o030e.php
# ...
# [Alberta, Ontario, Quebec] will follow US rules.
# http://www.qp.gov.ab.ca/documents/spring/CH03_06.CFM
@ -1193,7 +1218,7 @@ Zone America/Menominee -5:50:27 - LMT 1885 Sep 18 12:00
# http://www.hoa.gov.nl.ca/hoa/bills/Bill0634.htm
# ...
# Yukon
# http://www.gov.yk.ca/legislation/regs/oic2006_127.pdf
# https://www.gov.yk.ca/legislation/regs/oic2006_127.pdf
# ...
# N.W.T. will follow US rules. Whoever maintains the government web site
# does not seem to believe in bookmarks. To see the news release, click the
@ -1214,8 +1239,8 @@ Zone America/Menominee -5:50:27 - LMT 1885 Sep 18 12:00
# time and daylight saving time arrangements in Canada circa 1998.
#
# National Research Council Canada maintains info about time zones and DST.
# http://www.nrc-cnrc.gc.ca/eng/services/time/time_zones.html
# http://www.nrc-cnrc.gc.ca/eng/services/time/faq/index.html#Q5
# https://www.nrc-cnrc.gc.ca/eng/services/time/time_zones.html
# https://www.nrc-cnrc.gc.ca/eng/services/time/faq/index.html#Q5
# Its unofficial information is often taken from Matthews and Vincent.
# From Paul Eggert (2006-06-27):
@ -1252,11 +1277,13 @@ Rule Canada 2007 max - Nov Sun>=1 2:00 0 S
# Newfoundland and Labrador
# From Paul Eggert (2000-10-02):
# Matthews and Vincent (1998) write that Labrador should use NST/NDT,
# but the only part of Labrador that follows the rules is the
# southeast corner, including Port Hope Simpson and Mary's Harbour,
# but excluding, say, Black Tickle.
# From Paul Eggert (2017-10-14):
# Legally Labrador should observe Newfoundland time; see:
# McLeod J. Labrador time - legal or not? St. John's Telegram, 2017-10-07
# http://www.thetelegram.com/news/local/labrador-time--legal-or-not-154860/
# Matthews and Vincent (1998) write that the only part of Labrador
# that follows the rules is the southeast corner, including Port Hope
# Simpson and Mary's Harbour, but excluding, say, Black Tickle.
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule StJohns 1917 only - Apr 8 2:00 1:00 D
@ -1456,7 +1483,7 @@ Zone America/Moncton -4:19:08 - LMT 1883 Dec 9
# http://www.justice.gouv.qc.ca/english/publications/generale/temps-minganie-a.htm
# that the coastal strip from just east of Natashquan to Blanc-Sablon
# observes Atlantic standard time all year round.
# http://www.assnat.qc.ca/Media/Process.aspx?MediaId=ANQ.Vigie.Bll.DocumentGenerique_8845en
# https://www.assnat.qc.ca/Media/Process.aspx?MediaId=ANQ.Vigie.Bll.DocumentGenerique_8845en
# says this common practice was codified into law as of 2007.
# For lack of better info, guess this practice began around 1970, contra to
# Shanks & Pottenger who have this region observing AST/ADT.
@ -1488,6 +1515,11 @@ Zone America/Blanc-Sablon -3:48:28 - LMT 1884
# earlier in June).
#
# Kenora, Ontario, was to abandon DST on 1914-06-01 (-05-21).
#
# From Paul Eggert (2017-07-08):
# For more on Orillia, see: Daubs K. Bold attempt at daylight saving
# time became a comic failure in Orillia. Toronto Star 2017-07-08.
# https://www.thestar.com/news/insight/2017/07/08/bold-attempt-at-daylight-saving-time-became-a-comic-failure-in-orillia.html
# From Paul Eggert (1997-10-17):
# Mark Brader writes that an article in the 1997-10-14 Toronto Star
@ -1979,7 +2011,7 @@ Zone America/Creston -7:46:04 - LMT 1884
# * 1967. Paragraph 28(34)(g) of the Interpretation Act, S.C. 1967-68,
# c. 7 defines Yukon standard time as UTC-9....
# see Interpretation Act, R.S.C. 1985, c. I-21, s. 35(1).
# [http://canlii.ca/t/7vhg]
# [https://www.canlii.org/en/ca/laws/stat/rsc-1985-c-i-21/latest/rsc-1985-c-i-21.html]
# * C.O. 1973/214 switched Yukon to PST on 1973-10-28 00:00.
# * O.I.C. 1980/02 established DST.
# * O.I.C. 1987/056 changed DST to Apr firstSun 2:00 to Oct lastSun 2:00.
@ -2044,7 +2076,7 @@ Zone America/Creston -7:46:04 - LMT 1884
# hours behind Greenwich Time.
#
# * Yukon Standard Time defined as Pacific Standard Time, YCO 1973/214
# http://www.canlii.org/en/yk/laws/regu/yco-1973-214/latest/yco-1973-214.html
# https://www.canlii.org/en/yk/laws/regu/yco-1973-214/latest/yco-1973-214.html
# C.O. 1973/214 INTERPRETATION ACT ...
#
# 1. Effective October 28, 1973 Commissioner's Order 1967/59 is hereby
@ -2059,7 +2091,7 @@ Zone America/Creston -7:46:04 - LMT 1884
# http://? - no online source found
#
# * Yukon Daylight Saving Time, YOIC 1987/56
# http://www.canlii.org/en/yk/laws/regu/yoic-1987-56/latest/yoic-1987-56.html
# https://www.canlii.org/en/yk/laws/regu/yoic-1987-56/latest/yoic-1987-56.html
# O.I.C. 1987/056 INTERPRETATION ACT ...
#
# In every year between
@ -2071,7 +2103,7 @@ Zone America/Creston -7:46:04 - LMT 1884
# Dated ... 9th day of March, A.D., 1987.
#
# * Yukon Daylight Saving Time 2006, YOIC 2006/127
# http://www.canlii.org/en/yk/laws/regu/yoic-2006-127/latest/yoic-2006-127.html
# https://www.canlii.org/en/yk/laws/regu/yoic-2006-127/latest/yoic-2006-127.html
# O.I.C. 2006/127 INTERPRETATION ACT ...
#
# 1. In Yukon each year the time for general purposes shall be 7 hours
@ -2085,7 +2117,7 @@ Zone America/Creston -7:46:04 - LMT 1884
# 3. This order comes into force January 1, 2007.
#
# * Interpretation Act, RSY 2002, c 125
# http://www.canlii.org/en/yk/laws/stat/rsy-2002-c-125/latest/rsy-2002-c-125.html
# https://www.canlii.org/en/yk/laws/stat/rsy-2002-c-125/latest/rsy-2002-c-125.html
# From Rives McDow (1999-09-04):
# Nunavut ... moved ... to incorporate the whole territory into one time zone.
@ -2128,7 +2160,7 @@ Zone America/Creston -7:46:04 - LMT 1884
# From Michaela Rodrigue, writing in the
# Nunatsiaq News (1999-11-19):
# http://www.nunatsiaq.com/archives/nunavut991130/nvt91119_17.html
# http://www.nunatsiaqonline.ca/archives/nunavut991130/nvt91119_17.html
# Clyde River, Pangnirtung and Sanikiluaq now operate with two time zones,
# central - or Nunavut time - for government offices, and eastern time
# for municipal offices and schools.... Igloolik [was similar but then]
@ -2146,7 +2178,7 @@ Zone America/Creston -7:46:04 - LMT 1884
# Central Time and Southampton Island [in the Central zone] is not
# required to use daylight savings.
# From <http://www.nunatsiaq.com/archives/nunavut001130/nvt21110_02.html>
# From <http://www.nunatsiaqonline.ca/archives/nunavut001130/nvt21110_02.html>
# Nunavut now has two time zones (2000-11-10):
# The Nunavut government would allow its employees in Kugluktuk and
# Cambridge Bay to operate on central time year-round, putting them
@ -2477,7 +2509,7 @@ Zone America/Dawson -9:17:40 - LMT 1900 Aug 20
# http://gaceta.diputados.gob.mx/Gaceta/61/2009/dic/V2-101209.html
#
# Our page:
# http://www.timeanddate.com/news/time/north-mexico-dst-change.html
# https://www.timeanddate.com/news/time/north-mexico-dst-change.html
# From Arthur David Olson (2010-01-20):
# The page
@ -2896,7 +2928,7 @@ Zone America/Costa_Rica -5:36:13 - LMT 1890 # San José
# http://www.nnc.cubaweb.cu/marzo-2008/cien-1-11-3-08.htm
#
# Some more background information is posted here:
# http://www.timeanddate.com/news/time/cuba-starts-dst-march-16.html
# https://www.timeanddate.com/news/time/cuba-starts-dst-march-16.html
#
# The article also says that Cuba has been observing DST since 1963,
# while Shanks (and tzdata) has 1965 as the first date (except in the
@ -2943,7 +2975,7 @@ Zone America/Costa_Rica -5:36:13 - LMT 1890 # San José
# http://granma.co.cu/2011/03/08/nacional/artic01.html
#
# Our info:
# http://www.timeanddate.com/news/time/cuba-starts-dst-2011.html
# https://www.timeanddate.com/news/time/cuba-starts-dst-2011.html
#
# From Steffen Thorsen (2011-10-30)
# Cuba will end DST two weeks later this year. Instead of going back
@ -2953,7 +2985,7 @@ Zone America/Costa_Rica -5:36:13 - LMT 1890 # San José
# http://www.radioangulo.cu/noticias/cuba/17105-cuba-restablecera-el-horario-del-meridiano-de-greenwich.html
#
# Our page:
# http://www.timeanddate.com/news/time/cuba-time-changes-2011.html
# https://www.timeanddate.com/news/time/cuba-time-changes-2011.html
#
# From Steffen Thorsen (2012-03-01)
# According to Radio Reloj, Cuba will start DST on Midnight between March
@ -2963,7 +2995,7 @@ Zone America/Costa_Rica -5:36:13 - LMT 1890 # San José
# http://www.radioreloj.cu/index.php/noticias-radio-reloj/71-miscelaneas/7529-cuba-aplicara-el-horario-de-verano-desde-el-1-de-abril
#
# Our info on it:
# http://www.timeanddate.com/news/time/cuba-starts-dst-2012.html
# https://www.timeanddate.com/news/time/cuba-starts-dst-2012.html
# From Steffen Thorsen (2012-11-03):
# Radio Reloj and many other sources report that Cuba is changing back
@ -3158,8 +3190,8 @@ Zone America/Guatemala -6:02:04 - LMT 1918 Oct 5
# From Steffen Thorsen (2016-03-12):
# Jean Antoine, editor of www.haiti-reference.com informed us that Haiti
# are not going on DST this year. Several other resources confirm this: ...
# http://www.radiotelevisioncaraibes.com/presse/heure_d_t_pas_de_changement_d_heure_pr_vu_pour_cet_ann_e.html
# http://www.vantbefinfo.com/changement-dheure-pas-pour-haiti/
# https://www.radiotelevisioncaraibes.com/presse/heure_d_t_pas_de_changement_d_heure_pr_vu_pour_cet_ann_e.html
# https://www.vantbefinfo.com/changement-dheure-pas-pour-haiti/
# http://news.anmwe.com/haiti-lheure-nationale-ne-sera-ni-avancee-ni-reculee-cette-annee/
# From Steffen Thorsen (2017-03-12):
@ -3358,7 +3390,7 @@ Zone America/Miquelon -3:44:40 - LMT 1911 May 15 # St Pierre
# Turks and Caicos
#
# From Chris Dunn in
# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=415007
# https://bugs.debian.org/415007
# (2007-03-15): In the Turks & Caicos Islands (America/Grand_Turk) the
# daylight saving dates for time changes have been adjusted to match
# the recent U.S. change of dates.
@ -3380,12 +3412,25 @@ Zone America/Miquelon -3:44:40 - LMT 1911 May 15 # St Pierre
# "permanent daylight saving time" by one year....
# http://tcweeklynews.com/time-change-to-go-ahead-this-november-p5437-127.htm
#
# From the Turks & Caicos Cabinet (2017-07-20), heads-up from Steffen Thorsen:
# ... agreed to the reintroduction in TCI of Daylight Saving Time (DST)
# during the summer months and Standard Time, also known as Local
# Time, during the winter months with effect from April 2018 ...
# https://www.gov.uk/government/news/turks-and-caicos-post-cabinet-meeting-statement--3
#
# From Paul Eggert (2017-08-26):
# The date of effect of the spring 2018 change appears to be March 11,
# which makes more sense. See: Hamilton D. Time change back
# by March 2018 for TCI. Magnetic Media. 2017-08-25.
# http://magneticmediatv.com/2017/08/time-change-back-by-march-2018-for-tci/
#
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone America/Grand_Turk -4:44:32 - LMT 1890
-5:07:11 - KMT 1912 Feb # Kingston Mean Time
-5:00 - EST 1979
-5:00 US E%sT 2015 Nov Sun>=1 2:00
-4:00 - AST
-4:00 - AST 2018 Mar 11 3:00
-5:00 US E%sT
# British Virgin Is
# Virgin Is

View File

@ -45,7 +45,7 @@
#
# For data circa 1899, a common source is:
# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94.
# http://www.jstor.org/stable/1774359
# https://www.jstor.org/stable/1774359
#
# These tables use numeric abbreviations like -03 and -0330 for
# integer hour and minute UTC offsets. Although earlier editions used
@ -288,8 +288,8 @@ Rule Arg 2008 only - Oct Sun>=15 0:00 1:00 S
#
# Es inminente que en San Luis atrasen una hora los relojes
# (It is imminent in San Luis clocks one hour delay)
# http://www.lagaceta.com.ar/nota/253414/Economia/Es-inminente-que-en-San-Luis-atrasen-una-hora-los-relojes.html
# http://www.worldtimezone.net/dst_news/dst_news_argentina02.html
# https://www.lagaceta.com.ar/nota/253414/Economia/Es-inminente-que-en-San-Luis-atrasen-una-hora-los-relojes.html
# http://www.worldtimezone.com/dst_news/dst_news_argentina02.html
# From Jesper Nørgaard Welen (2008-01-18):
# The page of the San Luis provincial government
@ -408,7 +408,7 @@ Rule Arg 2008 only - Oct Sun>=15 0:00 1:00 S
# Perhaps San Luis operates on the legal fiction that it is at -04
# with perpetual summer time, but ordinary usage typically seems to
# just say it's at -03; see, for example,
# http://es.wikipedia.org/wiki/Hora_oficial_argentina
# https://es.wikipedia.org/wiki/Hora_oficial_argentina
# We've documented similar situations as being plain changes to
# standard time, so let's do that here too. This does not change UTC
# offsets, only tm_isdst and the time zone abbreviations. One minor
@ -739,7 +739,7 @@ Zone America/La_Paz -4:32:36 - LMT 1890
# (Portuguese)
#
# We have a written a short article about it as well:
# http://www.timeanddate.com/news/time/brazil-dst-2008-2009.html
# https://www.timeanddate.com/news/time/brazil-dst-2008-2009.html
#
# From Alexander Krivenyshev (2011-10-04):
# State Bahia will return to Daylight savings time this year after 8 years off.
@ -748,7 +748,7 @@ Zone America/La_Paz -4:32:36 - LMT 1890
# In Portuguese:
# http://g1.globo.com/bahia/noticia/2011/10/governador-jaques-wagner-confirma-horario-de-verao-na-bahia.html
# http://noticias.terra.com.br/brasil/noticias/0,,OI5390887-EI8139,00-Bahia+volta+a+ter+horario+de+verao+apos+oito+anos.html
# https://noticias.terra.com.br/brasil/noticias/0,,OI5390887-EI8139,00-Bahia+volta+a+ter+horario+de+verao+apos+oito+anos.html
# From Guilherme Bernardes Rodrigues (2011-10-07):
# There is news in the media, however there is still no decree about it.
@ -774,16 +774,16 @@ Zone America/La_Paz -4:32:36 - LMT 1890
# From Rodrigo Severo (2012-10-16):
# Tocantins state will have DST.
# http://noticias.terra.com.br/brasil/noticias/0,,OI6232536-EI306.html
# https://noticias.terra.com.br/brasil/noticias/0,,OI6232536-EI306.html
# From Steffen Thorsen (2013-09-20):
# Tocantins in Brazil is very likely not to observe DST from October....
# http://conexaoto.com.br/2013/09/18/ministerio-confirma-que-tocantins-esta-fora-do-horario-de-verao-em-2013-mas-falta-publicacao-de-decreto
# We will keep this article updated when this is confirmed:
# http://www.timeanddate.com/news/time/brazil-starts-dst-2013.html
# https://www.timeanddate.com/news/time/brazil-starts-dst-2013.html
# From Steffen Thorsen (2013-10-17):
# http://www.timeanddate.com/news/time/acre-amazonas-change-time-zone.html
# https://www.timeanddate.com/news/time/acre-amazonas-change-time-zone.html
# Senator Jorge Viana announced that Acre will change time zone on November 10.
# He did not specify the time of the change, nor if western parts of Amazonas
# will change as well.
@ -1099,18 +1099,18 @@ Zone America/Rio_Branco -4:31:12 - LMT 1914
# the following source, cited by Oscar van Vlijmen (2006-10-08):
# [1] Chile Law
# http://www.webexhibits.org/daylightsaving/chile.html
# This contains a copy of a this official table:
# This contains a copy of this official table:
# Cambios en la hora oficial de Chile desde 1900 (retrieved 2008-03-30)
# http://web.archive.org/web/20080330200901/http://www.horaoficial.cl/cambio.htm
# https://web.archive.org/web/20080330200901/http://www.horaoficial.cl/cambio.htm
# [1] needs several corrections, though.
#
# The first set of corrections is from:
# [2] History of the Official Time of Chile
# http://www.horaoficial.cl/ing/horaof_ing.html (retrieved 2012-03-06). See:
# http://web.archive.org/web/20120306042032/http://www.horaoficial.cl/ing/horaof_ing.html
# https://web.archive.org/web/20120306042032/http://www.horaoficial.cl/ing/horaof_ing.html
# This is an English translation of:
# Historia de la hora oficial de Chile (retrieved 2012-10-24). See:
# http://web.archive.org/web/20121024234627/http://www.horaoficial.cl/horaof.htm
# https://web.archive.org/web/20121024234627/http://www.horaoficial.cl/horaof.htm
# A fancier Spanish version (requiring mouse-clicking) is at:
# http://www.horaoficial.cl/historia_hora.html
# Conflicts between [1] and [2] were resolved as follows:
@ -1386,10 +1386,10 @@ Link America/Curacao America/Kralendijk # Caribbean Netherlands
# Milne says the Central and South American Telegraph Company used -5:24:15.
#
# From Alois Treindl (2016-12-15):
# http://www.elcomercio.com/actualidad/hora-sixto-1993.html
# https://www.elcomercio.com/actualidad/hora-sixto-1993.html
# ... Whether the law applied also to Galápagos, I do not know.
# From Paul Eggert (2016-12-15):
# http://www.elcomercio.com/afull/modificacion-husohorario-ecuador-presidentes-decreto.html
# https://www.elcomercio.com/afull/modificacion-husohorario-ecuador-presidentes-decreto.html
# This says President Sixto Durán Ballén signed decree No. 285, which
# established DST from 1992-11-28 to 1993-02-05; it does not give transition
# times. The people called it "hora de Sixto" ("Sixto hour"). The change did
@ -1801,7 +1801,7 @@ Zone America/Montevideo -3:44:44 - LMT 1898 Jun 28
# hours of presidential broadcasts, hours of lines,' quipped comedian
# Jean Mary Curró ...". See: Cawthorne A, Kai D. Venezuela scraps
# half-hour time difference set by Chavez. Reuters 2016-04-15 14:50 -0400
# http://www.reuters.com/article/us-venezuela-timezone-idUSKCN0XC2BE
# https://www.reuters.com/article/us-venezuela-timezone-idUSKCN0XC2BE
#
# From Matt Johnson (2016-04-20):
# ... published in the official Gazette [2016-04-18], here:

View File

@ -209,7 +209,7 @@ GB +513030-0000731 Europe/London
GD +1203-06145 America/Grenada
GE +4143+04449 Asia/Tbilisi
GF +0456-05220 America/Cayenne
GG +4927-00232 Europe/Guernsey
GG +492717-0023210 Europe/Guernsey
GH +0533-00013 Africa/Accra
GI +3608-00521 Europe/Gibraltar
GL +6411-05144 America/Godthab Greenland (most areas)
@ -244,7 +244,7 @@ IQ +3321+04425 Asia/Baghdad
IR +3540+05126 Asia/Tehran
IS +6409-02151 Atlantic/Reykjavik
IT +4154+01229 Europe/Rome
JE +4912-00207 Europe/Jersey
JE +491101-0020624 Europe/Jersey
JM +175805-0764736 America/Jamaica
JO +3157+03556 Asia/Amman
JP +353916+1394441 Asia/Tokyo

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2016, 2017, 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
@ -35,7 +35,7 @@ ifeq ($(OPENJDK_TARGET_OS), solaris)
SRC := $(TOPDIR)/src/jdk.net/solaris/native/libextnet, \
OPTIMIZATION := LOW, \
CFLAGS := $(CFLAGS_JDKLIB) -I$(SUPPORT_OUTPUTDIR)/headers/jdk.net, \
MAPFILE := $(TOPDIR)/make/mapfiles/libextnet/mapfile-vers, \
MAPFILE := $(TOPDIR)/make/mapfiles/libextnet/mapfile-solaris, \
LDFLAGS := $(LDFLAGS_JDKLIB) \
$(call SET_SHARED_LIBRARY_ORIGIN), \
LIBS := -lsocket -lc -ljava, \
@ -48,4 +48,25 @@ ifeq ($(OPENJDK_TARGET_OS), solaris)
endif
ifeq ($(OPENJDK_TARGET_OS), linux)
$(eval $(call SetupNativeCompilation, BUILD_LIBEXTNET, \
LIBRARY := extnet, \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
SRC := $(TOPDIR)/src/jdk.net/linux/native/libextnet, \
OPTIMIZATION := LOW, \
CFLAGS := $(CFLAGS_JDKLIB) -I$(SUPPORT_OUTPUTDIR)/headers/jdk.net, \
MAPFILE := $(TOPDIR)/make/mapfiles/libextnet/mapfile-linux, \
LDFLAGS := $(LDFLAGS_JDKLIB) \
$(call SET_SHARED_LIBRARY_ORIGIN), \
LIBS := -ljvm -ljava -lc, \
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libextnet, \
))
$(BUILD_LIBEXTNET): $(call FindLib, java.base, java)
TARGETS += $(BUILD_LIBEXTNET)
endif
################################################################################

View File

@ -0,0 +1,33 @@
#
# Copyright (c) 2017, 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.
#
SUNWprivate_1.1 {
global:
Java_jdk_net_LinuxSocketOptions_setQuickAck0;
Java_jdk_net_LinuxSocketOptions_getQuickAck0;
Java_jdk_net_LinuxSocketOptions_quickAckSupported0;
local:
*;
};

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2017, 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

View File

@ -830,8 +830,8 @@ grant codeBase "file:/${basedir}/${test.script.dir}/basic/JDK-8158467.js" {
<!-- underscorejs -->
<mkdir dir="${test.external.dir}/underscore"/>
<get src="http://underscorejs.org/underscore.js" dest="${test.external.dir}/underscore" skipexisting="true" ignoreerrors="true"/>
<get src="http://underscorejs.org/underscore-min.js" dest="${test.external.dir}/underscore" skipexisting="true" ignoreerrors="true"/>
<get src="http://underscorejs.org/underscore.js" dest="${test.external.dir}/underscore" skipexisting="true" ignoreerrors="true" tryGzipEncoding="true"/>
<get src="http://underscorejs.org/underscore-min.js" dest="${test.external.dir}/underscore" skipexisting="true" ignoreerrors="true" tryGzipEncoding="true"/>
<!-- yui -->
<mkdir dir="${test.external.dir}/yui"/>

View File

@ -25,25 +25,21 @@
package java.lang.invoke;
import jdk.internal.loader.BootLoader;
import jdk.internal.org.objectweb.asm.ClassWriter;
import jdk.internal.org.objectweb.asm.FieldVisitor;
import jdk.internal.org.objectweb.asm.MethodVisitor;
import jdk.internal.vm.annotation.Stable;
import sun.invoke.util.ValueConversions;
import sun.invoke.util.Wrapper;
import java.lang.invoke.LambdaForm.NamedFunction;
import java.lang.invoke.MethodHandles.Lookup;
import java.lang.reflect.Field;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.function.Function;
import java.util.ArrayList;
import java.util.List;
import static java.lang.invoke.LambdaForm.BasicType;
import static java.lang.invoke.LambdaForm.BasicType.*;
import static java.lang.invoke.MethodHandleStatics.*;
import static jdk.internal.org.objectweb.asm.Opcodes.*;
import static java.lang.invoke.LambdaForm.BasicType.V_TYPE_NUM;
import static java.lang.invoke.LambdaForm.BasicType.V_TYPE_NUM;
import static java.lang.invoke.LambdaForm.BasicType.V_TYPE_NUM;
import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
import static java.lang.invoke.MethodHandleNatives.Constants.*;
import static java.lang.invoke.MethodHandleStatics.newInternalError;
import static java.lang.invoke.MethodHandleStatics.uncaughtException;
/**
* The flavor of method handle which emulates an invoke instruction
@ -56,7 +52,7 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
/*non-public*/ BoundMethodHandle(MethodType type, LambdaForm form) {
super(type, form);
assert(speciesData() == speciesData(form));
assert(speciesData() == speciesDataFor(form));
}
//
@ -70,13 +66,13 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
case L_TYPE:
return bindSingle(type, form, x); // Use known fast path.
case I_TYPE:
return (BoundMethodHandle) SpeciesData.EMPTY.extendWith(I_TYPE).constructor().invokeBasic(type, form, ValueConversions.widenSubword(x));
return (BoundMethodHandle) SPECIALIZER.topSpecies().extendWith(I_TYPE_NUM).factory().invokeBasic(type, form, ValueConversions.widenSubword(x));
case J_TYPE:
return (BoundMethodHandle) SpeciesData.EMPTY.extendWith(J_TYPE).constructor().invokeBasic(type, form, (long) x);
return (BoundMethodHandle) SPECIALIZER.topSpecies().extendWith(J_TYPE_NUM).factory().invokeBasic(type, form, (long) x);
case F_TYPE:
return (BoundMethodHandle) SpeciesData.EMPTY.extendWith(F_TYPE).constructor().invokeBasic(type, form, (float) x);
return (BoundMethodHandle) SPECIALIZER.topSpecies().extendWith(F_TYPE_NUM).factory().invokeBasic(type, form, (float) x);
case D_TYPE:
return (BoundMethodHandle) SpeciesData.EMPTY.extendWith(D_TYPE).constructor().invokeBasic(type, form, (double) x);
return (BoundMethodHandle) SPECIALIZER.topSpecies().extendWith(D_TYPE_NUM).factory().invokeBasic(type, form, (double) x);
default : throw newInternalError("unexpected xtype: " + xtype);
}
} catch (Throwable t) {
@ -98,6 +94,7 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
BoundMethodHandle bindArgumentL(int pos, Object value) {
return editor().bindArgumentL(this, pos, value);
}
/*non-public*/
BoundMethodHandle bindArgumentI(int pos, int value) {
return editor().bindArgumentI(this, pos, value);
@ -114,7 +111,6 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
BoundMethodHandle bindArgumentD(int pos, double value) {
return editor().bindArgumentD(this, pos, value);
}
@Override
BoundMethodHandle rebind() {
if (!tooComplex()) {
@ -137,28 +133,29 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
static BoundMethodHandle makeReinvoker(MethodHandle target) {
LambdaForm form = DelegatingMethodHandle.makeReinvokerForm(
target, MethodTypeForm.LF_REBIND,
Species_L.SPECIES_DATA, Species_L.SPECIES_DATA.getterFunction(0));
Species_L.BMH_SPECIES, Species_L.BMH_SPECIES.getterFunction(0));
return Species_L.make(target.type(), form, target);
}
/**
* Return the {@link SpeciesData} instance representing this BMH species. All subclasses must provide a
* Return the {@link BoundMethodHandle.SpeciesData} instance representing this BMH species. All subclasses must provide a
* static field containing this value, and they must accordingly implement this method.
*/
/*non-public*/ abstract SpeciesData speciesData();
/*non-public*/ abstract BoundMethodHandle.SpeciesData speciesData();
/*non-public*/ static SpeciesData speciesData(LambdaForm form) {
/*non-public*/ static BoundMethodHandle.SpeciesData speciesDataFor(LambdaForm form) {
Object c = form.names[0].constraint;
if (c instanceof SpeciesData)
if (c instanceof SpeciesData) {
return (SpeciesData) c;
}
// if there is no BMH constraint, then use the null constraint
return SpeciesData.EMPTY;
return SPECIALIZER.topSpecies();
}
/**
* Return the number of fields in this BMH. Equivalent to speciesData().fieldCount().
*/
/*non-public*/ abstract int fieldCount();
/*non-public*/ final int fieldCount() { return speciesData().fieldCount(); }
@Override
Object internalProperties() {
@ -167,7 +164,7 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
@Override
final String internalValues() {
int count = speciesData().fieldCount();
int count = fieldCount();
if (count == 1) {
return "[" + arg(0) + "]";
}
@ -180,17 +177,18 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
/*non-public*/ final Object arg(int i) {
try {
switch (speciesData().fieldType(i)) {
case L_TYPE: return speciesData().getters[i].invokeBasic(this);
case I_TYPE: return (int) speciesData().getters[i].invokeBasic(this);
case J_TYPE: return (long) speciesData().getters[i].invokeBasic(this);
case F_TYPE: return (float) speciesData().getters[i].invokeBasic(this);
case D_TYPE: return (double) speciesData().getters[i].invokeBasic(this);
Class<?> fieldType = speciesData().fieldTypes().get(i);
switch (BasicType.basicType(fieldType)) {
case L_TYPE: return speciesData().getter(i).invokeBasic(this);
case I_TYPE: return (int) speciesData().getter(i).invokeBasic(this);
case J_TYPE: return (long) speciesData().getter(i).invokeBasic(this);
case F_TYPE: return (float) speciesData().getter(i).invokeBasic(this);
case D_TYPE: return (double) speciesData().getter(i).invokeBasic(this);
}
} catch (Throwable ex) {
throw uncaughtException(ex);
}
throw new InternalError("unexpected type: " + speciesData().typeChars+"."+i);
throw new InternalError("unexpected type: " + speciesData().key()+"."+i);
}
//
@ -210,20 +208,21 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
private // make it private to force users to access the enclosing class first
static final class Species_L extends BoundMethodHandle {
final Object argL0;
private Species_L(MethodType mt, LambdaForm lf, Object argL0) {
super(mt, lf);
this.argL0 = argL0;
}
@Override
/*non-public*/ SpeciesData speciesData() {
return SPECIES_DATA;
return BMH_SPECIES;
}
@Override
/*non-public*/ int fieldCount() {
return 1;
}
/*non-public*/ static final SpeciesData SPECIES_DATA = new SpeciesData("L", Species_L.class);
/*non-public*/ static @Stable SpeciesData BMH_SPECIES;
/*non-public*/ static BoundMethodHandle make(MethodType mt, LambdaForm lf, Object argL0) {
return new Species_L(mt, lf, argL0);
}
@ -234,7 +233,7 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
@Override
/*non-public*/ final BoundMethodHandle copyWithExtendL(MethodType mt, LambdaForm lf, Object narg) {
try {
return (BoundMethodHandle) SPECIES_DATA.extendWith(L_TYPE).constructor().invokeBasic(mt, lf, argL0, narg);
return (BoundMethodHandle) BMH_SPECIES.extendWith(L_TYPE_NUM).factory().invokeBasic(mt, lf, argL0, narg);
} catch (Throwable ex) {
throw uncaughtException(ex);
}
@ -242,7 +241,7 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
@Override
/*non-public*/ final BoundMethodHandle copyWithExtendI(MethodType mt, LambdaForm lf, int narg) {
try {
return (BoundMethodHandle) SPECIES_DATA.extendWith(I_TYPE).constructor().invokeBasic(mt, lf, argL0, narg);
return (BoundMethodHandle) BMH_SPECIES.extendWith(I_TYPE_NUM).factory().invokeBasic(mt, lf, argL0, narg);
} catch (Throwable ex) {
throw uncaughtException(ex);
}
@ -250,7 +249,7 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
@Override
/*non-public*/ final BoundMethodHandle copyWithExtendJ(MethodType mt, LambdaForm lf, long narg) {
try {
return (BoundMethodHandle) SPECIES_DATA.extendWith(J_TYPE).constructor().invokeBasic(mt, lf, argL0, narg);
return (BoundMethodHandle) BMH_SPECIES.extendWith(J_TYPE_NUM).factory().invokeBasic(mt, lf, argL0, narg);
} catch (Throwable ex) {
throw uncaughtException(ex);
}
@ -258,7 +257,7 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
@Override
/*non-public*/ final BoundMethodHandle copyWithExtendF(MethodType mt, LambdaForm lf, float narg) {
try {
return (BoundMethodHandle) SPECIES_DATA.extendWith(F_TYPE).constructor().invokeBasic(mt, lf, argL0, narg);
return (BoundMethodHandle) BMH_SPECIES.extendWith(F_TYPE_NUM).factory().invokeBasic(mt, lf, argL0, narg);
} catch (Throwable ex) {
throw uncaughtException(ex);
}
@ -266,7 +265,7 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
@Override
/*non-public*/ final BoundMethodHandle copyWithExtendD(MethodType mt, LambdaForm lf, double narg) {
try {
return (BoundMethodHandle) SPECIES_DATA.extendWith(D_TYPE).constructor().invokeBasic(mt, lf, argL0, narg);
return (BoundMethodHandle) BMH_SPECIES.extendWith(D_TYPE_NUM).factory().invokeBasic(mt, lf, argL0, narg);
} catch (Throwable ex) {
throw uncaughtException(ex);
}
@ -277,601 +276,177 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
// BMH species meta-data
//
/**
* Meta-data wrapper for concrete BMH types.
* Each BMH type corresponds to a given sequence of basic field types (LIJFD).
* The fields are immutable; their values are fully specified at object construction.
* Each BMH type supplies an array of getter functions which may be used in lambda forms.
* A BMH is constructed by cloning a shorter BMH and adding one or more new field values.
* The shortest possible BMH has zero fields; its class is SimpleMethodHandle.
* BMH species are not interrelated by subtyping, even though it would appear that
* a shorter BMH could serve as a supertype of a longer one which extends it.
*/
static class SpeciesData {
private final String typeChars;
private final BasicType[] typeCodes;
private final Class<? extends BoundMethodHandle> clazz;
// Bootstrapping requires circular relations MH -> BMH -> SpeciesData -> MH
// Therefore, we need a non-final link in the chain. Use array elements.
@Stable private final MethodHandle[] constructor;
@Stable private final MethodHandle[] getters;
@Stable private final NamedFunction[] nominalGetters;
@Stable private final SpeciesData[] extensions;
/*non-public*/
static final class SpeciesData extends ClassSpecializer<BoundMethodHandle, String, SpeciesData>.SpeciesData {
// This array is filled in lazily, as new species come into being over time.
@Stable final private SpeciesData[] extensions = new SpeciesData[ARG_TYPE_LIMIT];
/*non-public*/ int fieldCount() {
return typeCodes.length;
}
/*non-public*/ BasicType fieldType(int i) {
return typeCodes[i];
}
/*non-public*/ char fieldTypeChar(int i) {
return typeChars.charAt(i);
}
String fieldSignature() {
return typeChars;
}
public Class<? extends BoundMethodHandle> fieldHolder() {
return clazz;
}
public String toString() {
return "SpeciesData<"+fieldSignature()+">";
public SpeciesData(Specializer outer, String key) {
outer.super(key);
}
/**
* Return a {@link LambdaForm.Name} containing a {@link LambdaForm.NamedFunction} that
* represents a MH bound to a generic invoker, which in turn forwards to the corresponding
* getter.
*/
NamedFunction getterFunction(int i) {
NamedFunction nf = nominalGetters[i];
assert(nf.memberDeclaringClassOrNull() == fieldHolder());
assert(nf.returnType() == fieldType(i));
return nf;
@Override
protected String deriveClassName() {
String typeString = deriveTypeString();
if (typeString.isEmpty()) {
return SimpleMethodHandle.class.getName();
}
return BoundMethodHandle.class.getName() + "$Species_" + typeString;
}
NamedFunction[] getterFunctions() {
return nominalGetters;
@Override
protected List<Class<?>> deriveFieldTypes(String key) {
ArrayList<Class<?>> types = new ArrayList<>(key.length());
for (int i = 0; i < key.length(); i++) {
types.add(basicType(key.charAt(i)).basicTypeClass());
}
return types;
}
MethodHandle[] getterHandles() { return getters; }
MethodHandle constructor() {
return constructor[0];
@Override
protected String deriveTypeString() {
// (If/when we have to add nominal types, just inherit the more complex default.)
return key();
}
static final SpeciesData EMPTY = new SpeciesData("", BoundMethodHandle.class);
SpeciesData(String types, Class<? extends BoundMethodHandle> clazz) {
this.typeChars = types;
this.typeCodes = basicTypes(types);
this.clazz = clazz;
if (!INIT_DONE) {
this.constructor = new MethodHandle[1]; // only one ctor
this.getters = new MethodHandle[types.length()];
this.nominalGetters = new NamedFunction[types.length()];
@Override
protected MethodHandle deriveTransformHelper(MemberName transform, int whichtm) {
if (whichtm == Specializer.TN_COPY_NO_EXTEND) {
return factory();
} else if (whichtm < ARG_TYPE_LIMIT) {
return extendWith((byte) whichtm).factory();
} else {
this.constructor = Factory.makeCtors(clazz, types, null);
this.getters = Factory.makeGetters(clazz, types, null);
this.nominalGetters = Factory.makeNominalGetters(types, null, this.getters);
}
this.extensions = new SpeciesData[ARG_TYPE_LIMIT];
}
private void initForBootstrap() {
assert(!INIT_DONE);
if (constructor() == null) {
String types = typeChars;
CACHE.put(types, this);
Factory.makeCtors(clazz, types, this.constructor);
Factory.makeGetters(clazz, types, this.getters);
Factory.makeNominalGetters(types, this.nominalGetters, this.getters);
throw newInternalError("bad transform");
}
}
private static final ConcurrentMap<String, SpeciesData> CACHE = new ConcurrentHashMap<>();
private static final boolean INIT_DONE; // set after <clinit> finishes...
SpeciesData extendWith(byte type) {
return extendWith(BasicType.basicType(type));
@Override
protected <X> List<X> deriveTransformHelperArguments(MemberName transform, int whichtm, List<X> args, List<X> fields) {
assert(verifyTHAargs(transform, whichtm, args, fields));
// The rule is really simple: Keep the first two arguments
// the same, then put in the fields, then put any other argument.
args.addAll(2, fields);
return args;
}
SpeciesData extendWith(BasicType type) {
int ord = type.ordinal();
SpeciesData d = extensions[ord];
if (d != null) return d;
extensions[ord] = d = get(typeChars+type.basicTypeChar());
return d;
}
private static SpeciesData get(String types) {
return CACHE.computeIfAbsent(types, new Function<String, SpeciesData>() {
@Override
public SpeciesData apply(String types) {
Class<? extends BoundMethodHandle> bmhcl = Factory.getConcreteBMHClass(types);
// SpeciesData instantiation may throw VirtualMachineError because of
// code cache overflow...
SpeciesData speciesData = new SpeciesData(types, bmhcl);
// CHM.computeIfAbsent ensures only one SpeciesData will be set
// successfully on the concrete BMH class if ever
Factory.setSpeciesDataToConcreteBMHClass(bmhcl, speciesData);
// the concrete BMH class is published via SpeciesData instance
// returned here only after it's SPECIES_DATA field is set
return speciesData;
}
});
}
/**
* This is to be called when assertions are enabled. It checks whether SpeciesData for all of the statically
* defined species subclasses of BoundMethodHandle has been added to the SpeciesData cache. See below in the
* static initializer for
*/
static boolean speciesDataCachePopulated() {
Class<BoundMethodHandle> rootCls = BoundMethodHandle.class;
for (Class<?> c : rootCls.getDeclaredClasses()) {
if (rootCls.isAssignableFrom(c)) {
final Class<? extends BoundMethodHandle> cbmh = c.asSubclass(BoundMethodHandle.class);
SpeciesData d = Factory.getSpeciesDataFromConcreteBMHClass(cbmh);
assert(d != null) : cbmh.getName();
assert(d.clazz == cbmh);
assert(CACHE.get(d.typeChars) == d);
}
private boolean verifyTHAargs(MemberName transform, int whichtm, List<?> args, List<?> fields) {
assert(transform == Specializer.BMH_TRANSFORMS.get(whichtm));
assert(args.size() == transform.getMethodType().parameterCount());
assert(fields.size() == this.fieldCount());
final int MH_AND_LF = 2;
if (whichtm == Specializer.TN_COPY_NO_EXTEND) {
assert(transform.getMethodType().parameterCount() == MH_AND_LF);
} else if (whichtm < ARG_TYPE_LIMIT) {
assert(transform.getMethodType().parameterCount() == MH_AND_LF+1);
final BasicType type = basicType((byte) whichtm);
assert(transform.getParameterTypes()[MH_AND_LF] == type.basicTypeClass());
} else {
return false;
}
return true;
}
/*non-public*/ SpeciesData extendWith(byte typeNum) {
SpeciesData sd = extensions[typeNum];
if (sd != null) return sd;
sd = SPECIALIZER.findSpecies(key() + BasicType.basicType(typeNum).basicTypeChar());
extensions[typeNum] = sd;
return sd;
}
}
/*non-public*/
static final Specializer SPECIALIZER = new Specializer();
static {
SimpleMethodHandle.BMH_SPECIES = BoundMethodHandle.SPECIALIZER.findSpecies("");
Species_L.BMH_SPECIES = BoundMethodHandle.SPECIALIZER.findSpecies("L");
}
/*non-public*/
static final class Specializer extends ClassSpecializer<BoundMethodHandle, String, SpeciesData> {
private static final MemberName SPECIES_DATA_ACCESSOR;
static {
// Pre-fill the BMH species-data cache with EMPTY and all BMH's inner subclasses.
EMPTY.initForBootstrap();
Species_L.SPECIES_DATA.initForBootstrap();
// check that all static SpeciesData instances have been initialized
assert speciesDataCachePopulated();
// Note: Do not simplify this, because INIT_DONE must not be
// a compile-time constant during bootstrapping.
INIT_DONE = Boolean.TRUE;
}
}
static SpeciesData getSpeciesData(String types) {
return SpeciesData.get(types);
}
/**
* Generation of concrete BMH classes.
*
* A concrete BMH species is fit for binding a number of values adhering to a
* given type pattern. Reference types are erased.
*
* BMH species are cached by type pattern.
*
* A BMH species has a number of fields with the concrete (possibly erased) types of
* bound values. Setters are provided as an API in BMH. Getters are exposed as MHs,
* which can be included as names in lambda forms.
*/
static class Factory {
private static final String JLO_SIG = "Ljava/lang/Object;";
private static final String MH = "java/lang/invoke/MethodHandle";
private static final String MH_SIG = "L"+MH+";";
private static final String BMH = "java/lang/invoke/BoundMethodHandle";
private static final String BMH_NAME = "java.lang.invoke.BoundMethodHandle";
private static final String BMH_SIG = "L"+BMH+";";
private static final String SPECIES_DATA = "java/lang/invoke/BoundMethodHandle$SpeciesData";
private static final String SPECIES_DATA_SIG = "L"+SPECIES_DATA+";";
private static final String STABLE_SIG = "Ljdk/internal/vm/annotation/Stable;";
private static final String SPECIES_PREFIX_NAME = "Species_";
private static final String SPECIES_PREFIX_PATH = BMH + "$" + SPECIES_PREFIX_NAME;
private static final String SPECIES_CLASS_PREFIX = BMH_NAME + "$" + SPECIES_PREFIX_NAME;
private static final String BMHSPECIES_DATA_EWI_SIG = "(B)" + SPECIES_DATA_SIG;
private static final String MYSPECIES_DATA_SIG = "()" + SPECIES_DATA_SIG;
private static final String INT_SIG = "()I";
private static final String SIG_INCIPIT = "(Ljava/lang/invoke/MethodType;Ljava/lang/invoke/LambdaForm;";
private static final String[] E_THROWABLE = new String[] { "java/lang/Throwable" };
private static final ConcurrentMap<String, Class<? extends BoundMethodHandle>> CLASS_CACHE = new ConcurrentHashMap<>();
/**
* Get a concrete subclass of BMH for a given combination of bound types.
*
* @param types the type signature, wherein reference types are erased to 'L'
* @return the concrete BMH class
*/
static Class<? extends BoundMethodHandle> getConcreteBMHClass(String types) {
// CHM.computeIfAbsent ensures generateConcreteBMHClass is called
// only once per key.
return CLASS_CACHE.computeIfAbsent(
types, new Function<String, Class<? extends BoundMethodHandle>>() {
@Override
public Class<? extends BoundMethodHandle> apply(String types) {
String shortTypes = LambdaForm.shortenSignature(types);
String className = SPECIES_CLASS_PREFIX + shortTypes;
Class<?> c = BootLoader.loadClassOrNull(className);
if (TRACE_RESOLVE) {
System.out.println("[BMH_RESOLVE] " + shortTypes +
(c != null ? " (success)" : " (fail)") );
}
if (c != null) {
return c.asSubclass(BoundMethodHandle.class);
} else {
// Not pregenerated, generate the class
return generateConcreteBMHClass(shortTypes, types);
}
}
});
}
/**
* Generate a concrete subclass of BMH for a given combination of bound types.
*
* A concrete BMH species adheres to the following schema:
*
* <pre>
* class Species_[[types]] extends BoundMethodHandle {
* [[fields]]
* final SpeciesData speciesData() { return SpeciesData.get("[[types]]"); }
* }
* </pre>
*
* The {@code [[types]]} signature is precisely the string that is passed to this
* method.
*
* The {@code [[fields]]} section consists of one field definition per character in
* the type signature, adhering to the naming schema described in the definition of
* {@link #makeFieldName}.
*
* For example, a concrete BMH species for two reference and one integral bound values
* would have the following shape:
*
* <pre>
* class BoundMethodHandle { ... private static
* final class Species_LLI extends BoundMethodHandle {
* final Object argL0;
* final Object argL1;
* final int argI2;
* private Species_LLI(MethodType mt, LambdaForm lf, Object argL0, Object argL1, int argI2) {
* super(mt, lf);
* this.argL0 = argL0;
* this.argL1 = argL1;
* this.argI2 = argI2;
* }
* final SpeciesData speciesData() { return SPECIES_DATA; }
* final int fieldCount() { return 3; }
* &#64;Stable static SpeciesData SPECIES_DATA; // injected afterwards
* static BoundMethodHandle make(MethodType mt, LambdaForm lf, Object argL0, Object argL1, int argI2) {
* return new Species_LLI(mt, lf, argL0, argL1, argI2);
* }
* final BoundMethodHandle copyWith(MethodType mt, LambdaForm lf) {
* return new Species_LLI(mt, lf, argL0, argL1, argI2);
* }
* final BoundMethodHandle copyWithExtendL(MethodType mt, LambdaForm lf, Object narg) {
* return SPECIES_DATA.extendWith(L_TYPE).constructor().invokeBasic(mt, lf, argL0, argL1, argI2, narg);
* }
* final BoundMethodHandle copyWithExtendI(MethodType mt, LambdaForm lf, int narg) {
* return SPECIES_DATA.extendWith(I_TYPE).constructor().invokeBasic(mt, lf, argL0, argL1, argI2, narg);
* }
* final BoundMethodHandle copyWithExtendJ(MethodType mt, LambdaForm lf, long narg) {
* return SPECIES_DATA.extendWith(J_TYPE).constructor().invokeBasic(mt, lf, argL0, argL1, argI2, narg);
* }
* final BoundMethodHandle copyWithExtendF(MethodType mt, LambdaForm lf, float narg) {
* return SPECIES_DATA.extendWith(F_TYPE).constructor().invokeBasic(mt, lf, argL0, argL1, argI2, narg);
* }
* public final BoundMethodHandle copyWithExtendD(MethodType mt, LambdaForm lf, double narg) {
* return SPECIES_DATA.extendWith(D_TYPE).constructor().invokeBasic(mt, lf, argL0, argL1, argI2, narg);
* }
* }
* </pre>
*
* @param types the type signature, wherein reference types are erased to 'L'
* @return the generated concrete BMH class
*/
static Class<? extends BoundMethodHandle> generateConcreteBMHClass(String shortTypes,
String types) {
final String className = speciesInternalClassName(shortTypes);
byte[] classFile = generateConcreteBMHClassBytes(shortTypes, types, className);
// load class
InvokerBytecodeGenerator.maybeDump(className, classFile);
Class<? extends BoundMethodHandle> bmhClass =
UNSAFE.defineClass(className, classFile, 0, classFile.length,
BoundMethodHandle.class.getClassLoader(), null)
.asSubclass(BoundMethodHandle.class);
return bmhClass;
}
static String speciesInternalClassName(String shortTypes) {
return SPECIES_PREFIX_PATH + shortTypes;
}
static byte[] generateConcreteBMHClassBytes(final String shortTypes,
final String types, final String className) {
final String sourceFile = SPECIES_PREFIX_NAME + shortTypes;
final ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS + ClassWriter.COMPUTE_FRAMES);
final int NOT_ACC_PUBLIC = 0; // not ACC_PUBLIC
cw.visit(V1_6, NOT_ACC_PUBLIC + ACC_FINAL + ACC_SUPER, className, null, BMH, null);
cw.visitSource(sourceFile, null);
// emit static types and SPECIES_DATA fields
FieldVisitor fw = cw.visitField(NOT_ACC_PUBLIC + ACC_STATIC, "SPECIES_DATA", SPECIES_DATA_SIG, null, null);
fw.visitAnnotation(STABLE_SIG, true);
fw.visitEnd();
// emit bound argument fields
for (int i = 0; i < types.length(); ++i) {
final char t = types.charAt(i);
final String fieldName = makeFieldName(types, i);
final String fieldDesc = t == 'L' ? JLO_SIG : String.valueOf(t);
cw.visitField(ACC_FINAL, fieldName, fieldDesc, null, null).visitEnd();
}
MethodVisitor mv;
// emit constructor
mv = cw.visitMethod(ACC_PRIVATE, "<init>", makeSignature(types, true), null, null);
mv.visitCode();
mv.visitVarInsn(ALOAD, 0); // this
mv.visitVarInsn(ALOAD, 1); // type
mv.visitVarInsn(ALOAD, 2); // form
mv.visitMethodInsn(INVOKESPECIAL, BMH, "<init>", makeSignature("", true), false);
for (int i = 0, j = 0; i < types.length(); ++i, ++j) {
// i counts the arguments, j counts corresponding argument slots
char t = types.charAt(i);
mv.visitVarInsn(ALOAD, 0);
mv.visitVarInsn(typeLoadOp(t), j + 3); // parameters start at 3
mv.visitFieldInsn(PUTFIELD, className, makeFieldName(types, i), typeSig(t));
if (t == 'J' || t == 'D') {
++j; // adjust argument register access
}
}
mv.visitInsn(RETURN);
mv.visitMaxs(0, 0);
mv.visitEnd();
// emit implementation of speciesData()
mv = cw.visitMethod(NOT_ACC_PUBLIC + ACC_FINAL, "speciesData", MYSPECIES_DATA_SIG, null, null);
mv.visitCode();
mv.visitFieldInsn(GETSTATIC, className, "SPECIES_DATA", SPECIES_DATA_SIG);
mv.visitInsn(ARETURN);
mv.visitMaxs(0, 0);
mv.visitEnd();
// emit implementation of fieldCount()
mv = cw.visitMethod(NOT_ACC_PUBLIC + ACC_FINAL, "fieldCount", INT_SIG, null, null);
mv.visitCode();
int fc = types.length();
if (fc <= (ICONST_5 - ICONST_0)) {
mv.visitInsn(ICONST_0 + fc);
} else {
mv.visitIntInsn(SIPUSH, fc);
}
mv.visitInsn(IRETURN);
mv.visitMaxs(0, 0);
mv.visitEnd();
// emit make() ...factory method wrapping constructor
mv = cw.visitMethod(NOT_ACC_PUBLIC + ACC_STATIC, "make", makeSignature(types, false), null, null);
mv.visitCode();
// make instance
mv.visitTypeInsn(NEW, className);
mv.visitInsn(DUP);
// load mt, lf
mv.visitVarInsn(ALOAD, 0); // type
mv.visitVarInsn(ALOAD, 1); // form
// load factory method arguments
for (int i = 0, j = 0; i < types.length(); ++i, ++j) {
// i counts the arguments, j counts corresponding argument slots
char t = types.charAt(i);
mv.visitVarInsn(typeLoadOp(t), j + 2); // parameters start at 3
if (t == 'J' || t == 'D') {
++j; // adjust argument register access
}
}
// finally, invoke the constructor and return
mv.visitMethodInsn(INVOKESPECIAL, className, "<init>", makeSignature(types, true), false);
mv.visitInsn(ARETURN);
mv.visitMaxs(0, 0);
mv.visitEnd();
// emit copyWith()
mv = cw.visitMethod(NOT_ACC_PUBLIC + ACC_FINAL, "copyWith", makeSignature("", false), null, null);
mv.visitCode();
// make instance
mv.visitTypeInsn(NEW, className);
mv.visitInsn(DUP);
// load mt, lf
mv.visitVarInsn(ALOAD, 1);
mv.visitVarInsn(ALOAD, 2);
// put fields on the stack
emitPushFields(types, className, mv);
// finally, invoke the constructor and return
mv.visitMethodInsn(INVOKESPECIAL, className, "<init>", makeSignature(types, true), false);
mv.visitInsn(ARETURN);
mv.visitMaxs(0, 0);
mv.visitEnd();
// for each type, emit copyWithExtendT()
for (BasicType type : BasicType.ARG_TYPES) {
int ord = type.ordinal();
char btChar = type.basicTypeChar();
mv = cw.visitMethod(NOT_ACC_PUBLIC + ACC_FINAL, "copyWithExtend" + btChar, makeSignature(String.valueOf(btChar), false), null, E_THROWABLE);
mv.visitCode();
// return SPECIES_DATA.extendWith(t).constructor().invokeBasic(mt, lf, argL0, ..., narg)
// obtain constructor
mv.visitFieldInsn(GETSTATIC, className, "SPECIES_DATA", SPECIES_DATA_SIG);
int iconstInsn = ICONST_0 + ord;
assert(iconstInsn <= ICONST_5);
mv.visitInsn(iconstInsn);
mv.visitMethodInsn(INVOKEVIRTUAL, SPECIES_DATA, "extendWith", BMHSPECIES_DATA_EWI_SIG, false);
mv.visitMethodInsn(INVOKEVIRTUAL, SPECIES_DATA, "constructor", "()" + MH_SIG, false);
// load mt, lf
mv.visitVarInsn(ALOAD, 1);
mv.visitVarInsn(ALOAD, 2);
// put fields on the stack
emitPushFields(types, className, mv);
// put narg on stack
mv.visitVarInsn(typeLoadOp(btChar), 3);
// finally, invoke the constructor and return
mv.visitMethodInsn(INVOKEVIRTUAL, MH, "invokeBasic", makeSignature(types + btChar, false), false);
mv.visitInsn(ARETURN);
mv.visitMaxs(0, 0);
mv.visitEnd();
}
cw.visitEnd();
return cw.toByteArray();
}
private static int typeLoadOp(char t) {
switch (t) {
case 'L': return ALOAD;
case 'I': return ILOAD;
case 'J': return LLOAD;
case 'F': return FLOAD;
case 'D': return DLOAD;
default : throw newInternalError("unrecognized type " + t);
}
}
private static void emitPushFields(String types, String className, MethodVisitor mv) {
for (int i = 0; i < types.length(); ++i) {
char tc = types.charAt(i);
mv.visitVarInsn(ALOAD, 0);
mv.visitFieldInsn(GETFIELD, className, makeFieldName(types, i), typeSig(tc));
}
}
static String typeSig(char t) {
return t == 'L' ? JLO_SIG : String.valueOf(t);
}
//
// Getter MH generation.
//
private static MethodHandle makeGetter(Class<?> cbmhClass, String types, int index) {
String fieldName = makeFieldName(types, index);
Class<?> fieldType = Wrapper.forBasicType(types.charAt(index)).primitiveType();
try {
return LOOKUP.findGetter(cbmhClass, fieldName, fieldType);
} catch (NoSuchFieldException | IllegalAccessException e) {
throw newInternalError(e);
}
}
static MethodHandle[] makeGetters(Class<?> cbmhClass, String types, MethodHandle[] mhs) {
if (mhs == null) mhs = new MethodHandle[types.length()];
for (int i = 0; i < mhs.length; ++i) {
mhs[i] = makeGetter(cbmhClass, types, i);
assert(mhs[i].internalMemberName().getDeclaringClass() == cbmhClass);
}
return mhs;
}
static MethodHandle[] makeCtors(Class<? extends BoundMethodHandle> cbmh, String types, MethodHandle mhs[]) {
if (mhs == null) mhs = new MethodHandle[1];
if (types.equals("")) return mhs; // hack for empty BMH species
mhs[0] = makeCbmhCtor(cbmh, types);
return mhs;
}
static NamedFunction[] makeNominalGetters(String types, NamedFunction[] nfs, MethodHandle[] getters) {
if (nfs == null) nfs = new NamedFunction[types.length()];
for (int i = 0; i < nfs.length; ++i) {
nfs[i] = new NamedFunction(getters[i]);
}
return nfs;
}
//
// Auxiliary methods.
//
static SpeciesData getSpeciesDataFromConcreteBMHClass(Class<? extends BoundMethodHandle> cbmh) {
try {
Field F_SPECIES_DATA = cbmh.getDeclaredField("SPECIES_DATA");
return (SpeciesData) F_SPECIES_DATA.get(null);
SPECIES_DATA_ACCESSOR = IMPL_LOOKUP.resolveOrFail(REF_invokeVirtual, BoundMethodHandle.class,
"speciesData", MethodType.methodType(BoundMethodHandle.SpeciesData.class));
} catch (ReflectiveOperationException ex) {
throw newInternalError(ex);
throw newInternalError("Bootstrap link error", ex);
}
}
static void setSpeciesDataToConcreteBMHClass(Class<? extends BoundMethodHandle> cbmh, SpeciesData speciesData) {
private Specializer() {
super( // Reified type parameters:
BoundMethodHandle.class, String.class, BoundMethodHandle.SpeciesData.class,
// Principal constructor type:
MethodType.methodType(void.class, MethodType.class, LambdaForm.class),
// Required linkage between class and species:
SPECIES_DATA_ACCESSOR,
"BMH_SPECIES",
BMH_TRANSFORMS);
}
@Override
protected String topSpeciesKey() {
return "";
}
@Override
protected BoundMethodHandle.SpeciesData newSpeciesData(String key) {
return new BoundMethodHandle.SpeciesData(this, key);
}
static final List<MemberName> BMH_TRANSFORMS;
static final int TN_COPY_NO_EXTEND = V_TYPE_NUM;
static {
final Class<BoundMethodHandle> BMH = BoundMethodHandle.class;
// copyWithExtendLIJFD + copyWith
try {
Field F_SPECIES_DATA = cbmh.getDeclaredField("SPECIES_DATA");
// ## FIXME: annotation parser can't create proxy classes until module system is fully initialzed
// assert F_SPECIES_DATA.getDeclaredAnnotation(Stable.class) != null;
F_SPECIES_DATA.set(null, speciesData);
BMH_TRANSFORMS = List.of(
IMPL_LOOKUP.resolveOrFail(REF_invokeVirtual, BMH, "copyWithExtendL", MethodType.methodType(BMH, MethodType.class, LambdaForm.class, Object.class)),
IMPL_LOOKUP.resolveOrFail(REF_invokeVirtual, BMH, "copyWithExtendI", MethodType.methodType(BMH, MethodType.class, LambdaForm.class, int.class)),
IMPL_LOOKUP.resolveOrFail(REF_invokeVirtual, BMH, "copyWithExtendJ", MethodType.methodType(BMH, MethodType.class, LambdaForm.class, long.class)),
IMPL_LOOKUP.resolveOrFail(REF_invokeVirtual, BMH, "copyWithExtendF", MethodType.methodType(BMH, MethodType.class, LambdaForm.class, float.class)),
IMPL_LOOKUP.resolveOrFail(REF_invokeVirtual, BMH, "copyWithExtendD", MethodType.methodType(BMH, MethodType.class, LambdaForm.class, double.class)),
IMPL_LOOKUP.resolveOrFail(REF_invokeVirtual, BMH, "copyWith", MethodType.methodType(BMH, MethodType.class, LambdaForm.class))
);
} catch (ReflectiveOperationException ex) {
throw newInternalError(ex);
throw newInternalError("Failed resolving copyWith methods", ex);
}
// as it happens, there is one transform per BasicType including V_TYPE
assert(BMH_TRANSFORMS.size() == TYPE_LIMIT);
}
/**
* Field names in concrete BMHs adhere to this pattern:
* arg + type + index
* where type is a single character (L, I, J, F, D).
* Generation of concrete BMH classes.
*
* A concrete BMH species is fit for binding a number of values adhering to a
* given type pattern. Reference types are erased.
*
* BMH species are cached by type pattern.
*
* A BMH species has a number of fields with the concrete (possibly erased) types of
* bound values. Setters are provided as an API in BMH. Getters are exposed as MHs,
* which can be included as names in lambda forms.
*/
private static String makeFieldName(String types, int index) {
assert index >= 0 && index < types.length();
return "arg" + types.charAt(index) + index;
}
private static String makeSignature(String types, boolean ctor) {
StringBuilder buf = new StringBuilder(SIG_INCIPIT);
int len = types.length();
for (int i = 0; i < len; i++) {
buf.append(typeSig(types.charAt(i)));
}
return buf.append(')').append(ctor ? "V" : BMH_SIG).toString();
}
private static MethodType makeConstructorType(String types) {
int length = types.length();
Class<?> ptypes[] = new Class<?>[length + 2];
ptypes[0] = MethodType.class;
ptypes[1] = LambdaForm.class;
for (int i = 0; i < length; i++) {
ptypes[i + 2] = BasicType.basicType(types.charAt(i)).basicTypeClass();
}
return MethodType.makeImpl(BoundMethodHandle.class, ptypes, true);
}
static MethodHandle makeCbmhCtor(Class<? extends BoundMethodHandle> cbmh, String types) {
try {
return LOOKUP.findStatic(cbmh, "make", makeConstructorType(types));
} catch (NoSuchMethodException | IllegalAccessException | IllegalArgumentException | TypeNotPresentException e) {
throw newInternalError(e);
class Factory extends ClassSpecializer<BoundMethodHandle, String, BoundMethodHandle.SpeciesData>.Factory {
@Override
protected String chooseFieldName(Class<?> type, int index) {
return "arg" + super.chooseFieldName(type, index);
}
}
}
static final Lookup LOOKUP = Lookup.IMPL_LOOKUP;
@Override
protected Factory makeFactory() {
return new Factory();
}
}
/**
* All subclasses must provide such a value describing their type signature.
*/
static final SpeciesData SPECIES_DATA = SpeciesData.EMPTY;
private static final SpeciesData[] SPECIES_DATA_CACHE = new SpeciesData[6];
private static SpeciesData checkCache(int size, String types) {
int idx = size - 1;
SpeciesData data = SPECIES_DATA_CACHE[idx];
if (data != null) return data;
SPECIES_DATA_CACHE[idx] = data = getSpeciesData(types);
return data;
}
static SpeciesData speciesData_L() { return checkCache(1, "L"); }
static SpeciesData speciesData_LL() { return checkCache(2, "LL"); }
static SpeciesData speciesData_LLL() { return checkCache(3, "LLL"); }
static SpeciesData speciesData_LLLL() { return checkCache(4, "LLLL"); }
static SpeciesData speciesData_LLLLL() { return checkCache(5, "LLLLL"); }
static SpeciesData speciesData_L() { return Species_L.BMH_SPECIES; }
static SpeciesData speciesData_LL() { return SPECIALIZER.findSpecies("LL"); }
static SpeciesData speciesData_LLL() { return SPECIALIZER.findSpecies("LLL"); }
static SpeciesData speciesData_LLLL() { return SPECIALIZER.findSpecies("LLLL"); }
static SpeciesData speciesData_LLLLL() { return SPECIALIZER.findSpecies("LLLLL"); }
}

File diff suppressed because it is too large Load Diff

View File

@ -25,14 +25,14 @@
package java.lang.invoke;
import java.util.Map;
import jdk.internal.org.objectweb.asm.ClassWriter;
import jdk.internal.org.objectweb.asm.Opcodes;
import java.util.ArrayList;
import java.util.HashSet;
import sun.invoke.util.Wrapper;
import static java.lang.invoke.MethodHandleNatives.Constants.*;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
/**
* Helper class to assist the GenerateJLIClassesPlugin to get access to
@ -118,8 +118,7 @@ class GenerateJLIClassesHelper {
// require an even more complex naming scheme
LambdaForm reinvoker = makeReinvokerFor(methodTypes[i]);
forms.add(reinvoker);
String speciesSig = BoundMethodHandle
.speciesData(reinvoker).fieldSignature();
String speciesSig = BoundMethodHandle.speciesDataFor(reinvoker).key();
assert(speciesSig.equals("L"));
names.add(reinvoker.kind.defaultLambdaName + "_" + speciesSig);
@ -205,20 +204,19 @@ class GenerateJLIClassesHelper {
DelegatingMethodHandle.NF_getTarget);
}
static Map.Entry<String, byte[]> generateConcreteBMHClassBytes(
final String types) {
@SuppressWarnings({"rawtypes", "unchecked"})
static Map.Entry<String, byte[]> generateConcreteBMHClassBytes(final String types) {
for (char c : types.toCharArray()) {
if ("LIJFD".indexOf(c) < 0) {
throw new IllegalArgumentException("All characters must "
+ "correspond to a basic field type: LIJFD");
}
}
String shortTypes = LambdaForm.shortenSignature(types);
final String className =
BoundMethodHandle.Factory.speciesInternalClassName(shortTypes);
return Map.entry(className,
BoundMethodHandle.Factory.generateConcreteBMHClassBytes(
shortTypes, types, className));
final BoundMethodHandle.SpeciesData species = BoundMethodHandle.SPECIALIZER.findSpecies(types);
final String className = species.speciesCode().getName();
final ClassSpecializer.Factory factory = BoundMethodHandle.SPECIALIZER.factory();
final byte[] code = factory.generateConcreteSpeciesCodeFile(className, species);
return Map.entry(className.replace('.', '/'), code);
}
}

View File

@ -183,8 +183,7 @@ class InvokerBytecodeGenerator {
new java.security.PrivilegedAction<>() {
public Void run() {
try {
String dumpName = className;
//dumpName = dumpName.replace('/', '-');
String dumpName = className.replace('.','/');
File dumpFile = new File(DUMP_CLASS_FILES_DIR, dumpName+".class");
System.out.println("dump: " + dumpFile);
dumpFile.getParentFile().mkdirs();
@ -630,7 +629,7 @@ class InvokerBytecodeGenerator {
String name = form.kind.methodName;
switch (form.kind) {
case BOUND_REINVOKER: {
name = name + "_" + BoundMethodHandle.speciesData(form).fieldSignature();
name = name + "_" + BoundMethodHandle.speciesDataFor(form).key();
return resolveFrom(name, invokerType, DelegatingMethodHandle.Holder.class);
}
case DELEGATE: return resolveFrom(name, invokerType, DelegatingMethodHandle.Holder.class);

View File

@ -143,12 +143,22 @@ class LambdaForm {
D_TYPE('D', double.class, Wrapper.DOUBLE), // all primitive types
V_TYPE('V', void.class, Wrapper.VOID); // not valid in all contexts
static final BasicType[] ALL_TYPES = BasicType.values();
static final BasicType[] ARG_TYPES = Arrays.copyOf(ALL_TYPES, ALL_TYPES.length-1);
static final @Stable BasicType[] ALL_TYPES = BasicType.values();
static final @Stable BasicType[] ARG_TYPES = Arrays.copyOf(ALL_TYPES, ALL_TYPES.length-1);
static final int ARG_TYPE_LIMIT = ARG_TYPES.length;
static final int TYPE_LIMIT = ALL_TYPES.length;
// Derived int constants, which (unlike the enums) can be constant folded.
// We can remove them when JDK-8161245 is fixed.
static final byte
L_TYPE_NUM = (byte) L_TYPE.ordinal(),
I_TYPE_NUM = (byte) I_TYPE.ordinal(),
J_TYPE_NUM = (byte) J_TYPE.ordinal(),
F_TYPE_NUM = (byte) F_TYPE.ordinal(),
D_TYPE_NUM = (byte) D_TYPE.ordinal(),
V_TYPE_NUM = (byte) V_TYPE.ordinal();
final char btChar;
final Class<?> btClass;
final Wrapper btWrapper;
@ -679,6 +689,9 @@ class LambdaForm {
Class<?> rtype = signatureReturn(sig).btClass;
return MethodType.makeImpl(rtype, ptypes, true);
}
static MethodType basicMethodType(MethodType mt) {
return signatureType(basicTypeSignature(mt));
}
/**
* Check if i-th name is a call to MethodHandleImpl.selectAlternative.
@ -1291,14 +1304,28 @@ class LambdaForm {
assert(sigp == sig.length);
return String.valueOf(sig);
}
/** Hack to make signatures more readable when they show up in method names.
* Signature should start with a sequence of uppercase ASCII letters.
* Runs of three or more are replaced by a single letter plus a decimal repeat count.
* A tail of anything other than uppercase ASCII is passed through unchanged.
* @param signature sequence of uppercase ASCII letters with possible repetitions
* @return same sequence, with repetitions counted by decimal numerals
*/
public static String shortenSignature(String signature) {
// Hack to make signatures more readable when they show up in method names.
final int NO_CHAR = -1, MIN_RUN = 3;
int c0, c1 = NO_CHAR, c1reps = 0;
StringBuilder buf = null;
int len = signature.length();
if (len < MIN_RUN) return signature;
for (int i = 0; i <= len; i++) {
if (c1 != NO_CHAR && !('A' <= c1 && c1 <= 'Z')) {
// wrong kind of char; bail out here
if (buf != null) {
buf.append(signature.substring(i - c1reps, len));
}
break;
}
// shift in the next char:
c0 = c1; c1 = (i == len ? NO_CHAR : signature.charAt(i));
if (c1 == c0) { ++c1reps; continue; }
@ -1342,7 +1369,7 @@ class LambdaForm {
this.arguments = that.arguments;
this.constraint = constraint;
assert(constraint == null || isParam()); // only params have constraints
assert(constraint == null || constraint instanceof BoundMethodHandle.SpeciesData || constraint instanceof Class);
assert(constraint == null || constraint instanceof ClassSpecializer.SpeciesData || constraint instanceof Class);
}
Name(MethodHandle function, Object... arguments) {
this(new NamedFunction(function), arguments);

View File

@ -27,6 +27,8 @@ package java.lang.invoke;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import static java.lang.invoke.LambdaForm.*;
import static java.lang.invoke.LambdaForm.BasicType.*;
@ -325,15 +327,15 @@ final class LambdaFormBuffer {
* whose function is in the corresponding position in newFns.
* Only do this if the arguments are exactly equal to the given.
*/
LambdaFormBuffer replaceFunctions(NamedFunction[] oldFns, NamedFunction[] newFns,
LambdaFormBuffer replaceFunctions(List<NamedFunction> oldFns, List<NamedFunction> newFns,
Object... forArguments) {
assert(inTrans());
if (oldFns.length == 0) return this;
if (oldFns.isEmpty()) return this;
for (int i = arity; i < length; i++) {
Name n = names[i];
int nfi = indexOf(n.function, oldFns);
int nfi = oldFns.indexOf(n.function);
if (nfi >= 0 && Arrays.equals(n.arguments, forArguments)) {
changeName(i, new Name(newFns[nfi], n.arguments));
changeName(i, new Name(newFns.get(nfi), n.arguments));
}
}
return this;

View File

@ -381,10 +381,11 @@ class LambdaFormEditor {
/// Editing methods for method handles. These need to have fast paths.
private BoundMethodHandle.SpeciesData oldSpeciesData() {
return BoundMethodHandle.speciesData(lambdaForm);
return BoundMethodHandle.speciesDataFor(lambdaForm);
}
private BoundMethodHandle.SpeciesData newSpeciesData(BasicType type) {
return oldSpeciesData().extendWith(type);
return oldSpeciesData().extendWith((byte) type.ordinal());
}
BoundMethodHandle bindArgumentL(BoundMethodHandle mh, int pos, Object value) {
@ -461,7 +462,7 @@ class LambdaFormEditor {
buf.replaceParameterByNewExpression(pos, new Name(getter, newBaseAddress));
} else {
// cannot bind the MH arg itself, unless oldData is empty
assert(oldData == BoundMethodHandle.SpeciesData.EMPTY);
assert(oldData == BoundMethodHandle.SPECIALIZER.topSpecies());
newBaseAddress = new Name(L_TYPE).withConstraint(newData);
buf.replaceParameterByNewExpression(0, new Name(getter, newBaseAddress));
buf.insertParameter(0, newBaseAddress);

View File

@ -776,11 +776,11 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
if (PROFILE_GWT) {
int[] counts = new int[2];
mh = (BoundMethodHandle)
BoundMethodHandle.speciesData_LLLL().constructor().invokeBasic(type, form,
BoundMethodHandle.speciesData_LLLL().factory().invokeBasic(type, form,
(Object) test, (Object) profile(target), (Object) profile(fallback), counts);
} else {
mh = (BoundMethodHandle)
BoundMethodHandle.speciesData_LLL().constructor().invokeBasic(type, form,
BoundMethodHandle.speciesData_LLL().factory().invokeBasic(type, form,
(Object) test, (Object) profile(target), (Object) profile(fallback));
}
} catch (Throwable ex) {
@ -1089,7 +1089,7 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
BoundMethodHandle.SpeciesData data = BoundMethodHandle.speciesData_LLLLL();
BoundMethodHandle mh;
try {
mh = (BoundMethodHandle) data.constructor().invokeBasic(type, form, (Object) target, (Object) exType,
mh = (BoundMethodHandle) data.factory().invokeBasic(type, form, (Object) target, (Object) exType,
(Object) catcher, (Object) collectArgs, (Object) unboxResult);
} catch (Throwable ex) {
throw uncaughtException(ex);
@ -1890,7 +1890,7 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
BoundMethodHandle.SpeciesData data = BoundMethodHandle.speciesData_LLL();
BoundMethodHandle mh;
try {
mh = (BoundMethodHandle) data.constructor().invokeBasic(type, form, (Object) clauseData,
mh = (BoundMethodHandle) data.factory().invokeBasic(type, form, (Object) clauseData,
(Object) collectArgs, (Object) unboxResult);
} catch (Throwable ex) {
throw uncaughtException(ex);
@ -2133,7 +2133,7 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
BoundMethodHandle.SpeciesData data = BoundMethodHandle.speciesData_LLLL();
BoundMethodHandle mh;
try {
mh = (BoundMethodHandle) data.constructor().invokeBasic(type, form, (Object) target, (Object) cleanup,
mh = (BoundMethodHandle) data.factory().invokeBasic(type, form, (Object) target, (Object) cleanup,
(Object) collectArgs, (Object) unboxResult);
} catch (Throwable ex) {
throw uncaughtException(ex);

View File

@ -25,6 +25,8 @@
package java.lang.invoke;
import jdk.internal.vm.annotation.Stable;
import static java.lang.invoke.LambdaForm.BasicType.*;
import static java.lang.invoke.MethodHandleStatics.*;
@ -33,6 +35,7 @@ import static java.lang.invoke.MethodHandleStatics.*;
* @author jrose
*/
final class SimpleMethodHandle extends BoundMethodHandle {
private SimpleMethodHandle(MethodType type, LambdaForm form) {
super(type, form);
}
@ -41,10 +44,11 @@ final class SimpleMethodHandle extends BoundMethodHandle {
return new SimpleMethodHandle(type, form);
}
/*non-public*/ static final SpeciesData SPECIES_DATA = SpeciesData.EMPTY;
/*non-public*/ static @Stable BoundMethodHandle.SpeciesData BMH_SPECIES;
/*non-public*/ public SpeciesData speciesData() {
return SPECIES_DATA;
@Override
/*non-public*/ BoundMethodHandle.SpeciesData speciesData() {
return BMH_SPECIES;
}
@Override
@ -57,11 +61,6 @@ final class SimpleMethodHandle extends BoundMethodHandle {
return "\n& Class="+getClass().getSimpleName();
}
@Override
/*non-public*/ public int fieldCount() {
return 0;
}
@Override
/*non-public*/ final BoundMethodHandle copyWithExtendL(MethodType mt, LambdaForm lf, Object narg) {
return BoundMethodHandle.bindSingle(mt, lf, narg); // Use known fast path.
@ -69,7 +68,7 @@ final class SimpleMethodHandle extends BoundMethodHandle {
@Override
/*non-public*/ final BoundMethodHandle copyWithExtendI(MethodType mt, LambdaForm lf, int narg) {
try {
return (BoundMethodHandle) SPECIES_DATA.extendWith(I_TYPE).constructor().invokeBasic(mt, lf, narg);
return (BoundMethodHandle) BMH_SPECIES.extendWith(I_TYPE_NUM).factory().invokeBasic(mt, lf, narg);
} catch (Throwable ex) {
throw uncaughtException(ex);
}
@ -77,7 +76,7 @@ final class SimpleMethodHandle extends BoundMethodHandle {
@Override
/*non-public*/ final BoundMethodHandle copyWithExtendJ(MethodType mt, LambdaForm lf, long narg) {
try {
return (BoundMethodHandle) SPECIES_DATA.extendWith(J_TYPE).constructor().invokeBasic(mt, lf, narg);
return (BoundMethodHandle) BMH_SPECIES.extendWith(J_TYPE_NUM).factory().invokeBasic(mt, lf, narg);
} catch (Throwable ex) {
throw uncaughtException(ex);
}
@ -85,7 +84,7 @@ final class SimpleMethodHandle extends BoundMethodHandle {
@Override
/*non-public*/ final BoundMethodHandle copyWithExtendF(MethodType mt, LambdaForm lf, float narg) {
try {
return (BoundMethodHandle) SPECIES_DATA.extendWith(F_TYPE).constructor().invokeBasic(mt, lf, narg);
return (BoundMethodHandle) BMH_SPECIES.extendWith(F_TYPE_NUM).factory().invokeBasic(mt, lf, narg);
} catch (Throwable ex) {
throw uncaughtException(ex);
}
@ -93,7 +92,7 @@ final class SimpleMethodHandle extends BoundMethodHandle {
@Override
/*non-public*/ final BoundMethodHandle copyWithExtendD(MethodType mt, LambdaForm lf, double narg) {
try {
return (BoundMethodHandle) SPECIES_DATA.extendWith(D_TYPE).constructor().invokeBasic(mt, lf, narg);
return (BoundMethodHandle) BMH_SPECIES.extendWith(D_TYPE_NUM).factory().invokeBasic(mt, lf, narg);
} catch (Throwable ex) {
throw uncaughtException(ex);
}

View File

@ -1133,7 +1133,7 @@ class InetAddress implements java.io.Serializable {
/**
* Create an instance of the NameService interface based on
* the setting of the {@codejdk.net.hosts.file} system property.
* the setting of the {@code jdk.net.hosts.file} system property.
*
* <p>The default NameService is the PlatformNameService, which typically
* delegates name and address resolution calls to the underlying

View File

@ -57,13 +57,12 @@ import java.util.Date;
*
* @author Benjamin Renaud
* @since 1.1
* @deprecated A new certificate handling package is created in the Java platform.
* This Certificate interface is entirely deprecated and
* is here to allow for a smooth transition to the new
* package.
* @deprecated This class is deprecated and subject to removal in a future
* version of Java SE. It has been replaced by
* {@code java.security.cert.Certificate} and related classes.
* @see java.security.cert.Certificate
*/
@Deprecated(since="1.2")
@Deprecated(since="1.2", forRemoval=true)
public interface Certificate {
/**

View File

@ -52,12 +52,13 @@ import java.util.*;
*
* @author Benjamin Renaud
* @since 1.1
* @deprecated This class is no longer used. Its functionality has been
* replaced by {@code java.security.KeyStore}, the
* {@code java.security.cert} package, and
* {@code java.security.Principal}.
* @deprecated This class is deprecated and subject to removal in a future
* version of Java SE. It has been replaced by
* {@code java.security.KeyStore}, the {@code java.security.cert} package,
* and {@code java.security.Principal}.
*/
@Deprecated(since="1.2")
@Deprecated(since="1.2", forRemoval=true)
@SuppressWarnings("removal")
public abstract class Identity implements Principal, Serializable {
/** use serialVersionUID from JDK 1.1.x for interoperability */

View File

@ -57,12 +57,13 @@ import java.util.Properties;
* @author Benjamin Renaud
* @since 1.1
*
* @deprecated This class is no longer used. Its functionality has been
* replaced by {@code java.security.KeyStore}, the
* {@code java.security.cert} package, and
* {@code java.security.Principal}.
* @deprecated This class is deprecated and subject to removal in a future
* version of Java SE. It has been replaced by
* {@code java.security.KeyStore}, the {@code java.security.cert} package,
* and {@code java.security.Principal}.
*/
@Deprecated(since="1.2")
@Deprecated(since="1.2", forRemoval=true)
@SuppressWarnings("removal")
public abstract
class IdentityScope extends Identity {

View File

@ -40,12 +40,13 @@ import java.io.*;
* @author Benjamin Renaud
* @since 1.1
*
* @deprecated This class is no longer used. Its functionality has been
* replaced by {@code java.security.KeyStore}, the
* {@code java.security.cert} package, and
* {@code java.security.Principal}.
* @deprecated This class is deprecated and subject to removal in a future
* version of Java SE. It has been replaced by
* {@code java.security.KeyStore}, the {@code java.security.cert} package,
* and {@code java.security.Principal}.
*/
@Deprecated(since="1.2")
@Deprecated(since="1.2", forRemoval=true)
@SuppressWarnings("removal")
public abstract class Signer extends Identity {
private static final long serialVersionUID = -1763464102261361480L;

View File

@ -84,11 +84,13 @@ import java.security.Principal;
* @author Satish Dharmaraj
* @since 1.1
*
* @deprecated This package has been replaced by {@code java.security.Policy}
* and related classes since 1.2.
* @deprecated This class is deprecated and subject to removal in a future
* version of Java SE. It has been replaced by {@code java.security.Policy}
* and related classes since 1.2.
*/
@Deprecated(since="9")
@Deprecated(since="9", forRemoval=true)
@SuppressWarnings("removal")
public interface Acl extends Owner {
/**

View File

@ -52,10 +52,12 @@ import java.security.Principal;
* @author Satish Dharmaraj
* @since 1.1
*
* @deprecated This package has been replaced by {@code java.security.Policy}
* and related classes since 1.2.
* @deprecated This class is deprecated and subject to removal in a future
* version of Java SE. It has been replaced by {@code java.security.Policy}
* and related classes since 1.2.
*/
@Deprecated(since="9")
@Deprecated(since="9", forRemoval=true)
@SuppressWarnings("removal")
public interface AclEntry extends Cloneable {
/**

View File

@ -32,10 +32,11 @@ package java.security.acl;
* @author Satish Dharmaraj
* @since 1.1
*
* @deprecated This package has been replaced by {@code java.security.Policy}
* and related classes since 1.2.
* @deprecated This class is deprecated and subject to removal in a future
* version of Java SE. It has been replaced by {@code java.security.Policy}
* and related classes since 1.2.
*/
@Deprecated(since="9")
@Deprecated(since="9", forRemoval=true)
public class AclNotFoundException extends Exception {
private static final long serialVersionUID = 5684295034092681791L;

View File

@ -41,10 +41,11 @@ import java.security.Principal;
* @author Satish Dharmaraj
* @since 1.1
*
* @deprecated This package has been replaced by {@code java.security.Policy}
* and related classes since 1.2.
* @deprecated This class is deprecated and subject to removal in a future
* version of Java SE. It has been replaced by {@code java.security.Policy}
* and related classes since 1.2.
*/
@Deprecated(since="9")
@Deprecated(since="9", forRemoval=true)
public interface Group extends Principal {
/**

View File

@ -34,10 +34,11 @@ package java.security.acl;
* @author Satish Dharmaraj
* @since 1.1
*
* @deprecated This package has been replaced by {@code java.security.Policy}
* and related classes since 1.2.
* @deprecated This class is deprecated and subject to removal in a future
* version of Java SE. It has been replaced by {@code java.security.Policy}
* and related classes since 1.2.
*/
@Deprecated(since="9")
@Deprecated(since="9", forRemoval=true)
public class LastOwnerException extends Exception {
private static final long serialVersionUID = -5141997548211140359L;

View File

@ -33,10 +33,11 @@ package java.security.acl;
* @author Satish Dharmaraj
* @since 1.1
*
* @deprecated This package has been replaced by {@code java.security.Policy}
* and related classes since 1.2.
* @deprecated This class is deprecated and subject to removal in a future
* version of Java SE. It has been replaced by {@code java.security.Policy}
* and related classes since 1.2.
*/
@Deprecated(since="9")
@Deprecated(since="9", forRemoval=true)
public class NotOwnerException extends Exception {
private static final long serialVersionUID = -5555597911163362399L;

View File

@ -37,10 +37,12 @@ import java.security.Principal;
* @since 1.1
* @see java.security.acl.Acl
*
* @deprecated This package has been replaced by {@code java.security.Policy}
* and related classes since 1.2.
* @deprecated This class is deprecated and subject to removal in a future
* version of Java SE. It has been replaced by {@code java.security.Policy}
* and related classes since 1.2.
*/
@Deprecated(since="9")
@Deprecated(since="9", forRemoval=true)
@SuppressWarnings("removal")
public interface Owner {
/**

View File

@ -33,10 +33,11 @@ package java.security.acl;
* @author Satish Dharmaraj
* @since 1.1
*
* @deprecated This package has been replaced by {@code java.security.Policy}
* and related classes since 1.2.
* @deprecated This class is deprecated and subject to removal in a future
* version of Java SE. It has been replaced by {@code java.security.Policy}
* and related classes since 1.2.
*/
@Deprecated(since="9")
@Deprecated(since="9", forRemoval=true)
public interface Permission {
/**

View File

@ -27,7 +27,8 @@
* The classes and interfaces in this package have been deprecated. New
* classes should not be added to this package. The {@code java.security}
* package contains suitable replacements. See {@link java.security.Policy}
* and related classes for details.
* and related classes for details. This package is subject to removal in a
* future version of Java SE.
*
* @since 1.1
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2017, 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
@ -192,7 +192,7 @@ class ZoneName {
"Africa/Ndjamena", "Africa_Western", "Africa/Lagos",
"Asia/Macau", "China", "Asia/Shanghai",
"America/Lima", "Peru", "America/Lima",
"Africa/Windhoek", "Africa_Western", "Africa/Lagos",
"Africa/Windhoek", "Africa_Central", "Africa/Maputo",
"America/Sitka", "Alaska", "America/Juneau",
"America/Mazatlan", "America_Mountain", "America/Denver",
"Asia/Saigon", "Indochina", "Asia/Saigon",
@ -324,7 +324,7 @@ class ZoneName {
"Atlantic/Faroe", "Europe_Western", "Atlantic/Canary",
"America/Cambridge_Bay", "America_Mountain", "America/Denver",
"America/Los_Angeles", "America_Pacific", "America/Los_Angeles",
"Africa/Khartoum", "Africa_Eastern", "Africa/Nairobi",
"Africa/Khartoum", "Africa_Central", "Africa/Maputo",
"Europe/Simferopol", "Europe_Eastern", "Europe/Bucharest",
"Australia/Currie", "Australia_Eastern", "Australia/Sydney",
"Europe/Guernsey", "GMT", "Atlantic/Reykjavik",
@ -744,7 +744,6 @@ class ZoneName {
"UTC", "Etc/UTC",
"Canada/Newfoundland", "America/St_Johns",
"Europe/Skopje", "Europe/Belgrade",
"Canada/East-Saskatchewan", "America/Regina",
"PRC", "Asia/Shanghai",
"UCT", "Etc/UCT",
"America/Mendoza", "America/Argentina/Mendoza",

View File

@ -695,8 +695,9 @@ public class ConcurrentLinkedDeque<E>
* stale pointer that is now off the list.
*/
final Node<E> pred(Node<E> p) {
Node<E> q = p.prev;
return (p == q) ? last() : q;
if (p == (p = p.prev))
p = last();
return p;
}
/**
@ -867,31 +868,31 @@ public class ConcurrentLinkedDeque<E>
public E peekFirst() {
restart: for (;;) {
for (Node<E> first = first(), p = first;;) {
final E item;
if ((item = p.item) != null) {
// recheck for linearizability
if (first.prev != null) continue restart;
return item;
}
if ((p = succ(p)) == null)
return null;
E item;
Node<E> first = first(), p = first;
while ((item = p.item) == null) {
if (p == (p = p.next)) continue restart;
if (p == null)
break;
}
// recheck for linearizability
if (first.prev != null) continue restart;
return item;
}
}
public E peekLast() {
restart: for (;;) {
for (Node<E> last = last(), p = last;;) {
final E item;
if ((item = p.item) != null) {
// recheck for linearizability
if (last.next != null) continue restart;
return item;
}
if ((p = pred(p)) == null)
return null;
E item;
Node<E> last = last(), p = last;
while ((item = p.item) == null) {
if (p == (p = p.prev)) continue restart;
if (p == null)
break;
}
// recheck for linearizability
if (last.next != null) continue restart;
return item;
}
}
@ -921,8 +922,11 @@ public class ConcurrentLinkedDeque<E>
return item;
}
}
if ((p = succ(p)) == null)
if (p == (p = p.next)) continue restart;
if (p == null) {
if (first.prev != null) continue restart;
return null;
}
}
}
}
@ -939,8 +943,11 @@ public class ConcurrentLinkedDeque<E>
return item;
}
}
if ((p = pred(p)) == null)
if (p == (p = p.prev)) continue restart;
if (p == null) {
if (last.next != null) continue restart;
return null;
}
}
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2017, 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,7 @@ package java.util.stream;
import java.util.Spliterator;
import java.util.concurrent.CountedCompleter;
import java.util.concurrent.ForkJoinPool;
import java.util.concurrent.ForkJoinWorkerThread;
/**
* Abstract base class for most fork-join tasks used to implement stream ops.
@ -88,13 +89,7 @@ abstract class AbstractTask<P_IN, P_OUT, R,
K extends AbstractTask<P_IN, P_OUT, R, K>>
extends CountedCompleter<R> {
/**
* Default target factor of leaf tasks for parallel decomposition.
* To allow load balancing, we over-partition, currently to approximately
* four tasks per processor, which enables others to help out
* if leaf tasks are uneven or some processors are otherwise busy.
*/
static final int LEAF_TARGET = ForkJoinPool.getCommonPoolParallelism() << 2;
private static final int LEAF_TARGET = ForkJoinPool.getCommonPoolParallelism() << 2;
/** The pipeline helper, common to all tasks in a computation */
protected final PipelineHelper<P_OUT> helper;
@ -156,6 +151,22 @@ abstract class AbstractTask<P_IN, P_OUT, R,
this.targetSize = parent.targetSize;
}
/**
* Default target of leaf tasks for parallel decomposition.
* To allow load balancing, we over-partition, currently to approximately
* four tasks per processor, which enables others to help out
* if leaf tasks are uneven or some processors are otherwise busy.
*/
public static int getLeafTarget() {
Thread t = Thread.currentThread();
if (t instanceof ForkJoinWorkerThread) {
return ((ForkJoinWorkerThread) t).getPool().getParallelism() << 2;
}
else {
return LEAF_TARGET;
}
}
/**
* Constructs a new node of type T whose parent is the receiver; must call
* the AbstractTask(T, Spliterator) constructor with the receiver and the
@ -181,7 +192,7 @@ abstract class AbstractTask<P_IN, P_OUT, R,
* @return suggested target leaf size
*/
public static long suggestTargetSize(long sizeEstimate) {
long est = sizeEstimate / LEAF_TARGET;
long est = sizeEstimate / getLeafTarget();
return est > 0L ? est : 1L;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2017, 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
@ -28,7 +28,6 @@ import java.util.Objects;
import java.util.Spliterator;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CountedCompleter;
import java.util.concurrent.ForkJoinTask;
import java.util.function.Consumer;
import java.util.function.DoubleConsumer;
import java.util.function.IntConsumer;
@ -378,7 +377,7 @@ final class ForEachOps {
this.spliterator = spliterator;
this.targetSize = AbstractTask.suggestTargetSize(spliterator.estimateSize());
// Size map to avoid concurrent re-sizes
this.completionMap = new ConcurrentHashMap<>(Math.max(16, AbstractTask.LEAF_TARGET << 1));
this.completionMap = new ConcurrentHashMap<>(Math.max(16, AbstractTask.getLeafTarget() << 1));
this.action = action;
this.leftPredecessor = null;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2017, 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
@ -897,7 +897,7 @@ class StreamSpliterators {
* Note: The source spliterator may report {@code ORDERED} since that
* spliterator be the result of a previous pipeline stage that was
* collected to a {@code Node}. It is the order of the pipeline stage
* that governs whether the this slice spliterator is to be used or not.
* that governs whether this slice spliterator is to be used or not.
*/
abstract static class UnorderedSliceSpliterator<T, T_SPLITR extends Spliterator<T>> {
static final int CHUNK_SIZE = 1 << 7;
@ -914,7 +914,7 @@ class StreamSpliterators {
this.unlimited = limit < 0;
this.skipThreshold = limit >= 0 ? limit : 0;
this.chunkSize = limit >= 0 ? (int)Math.min(CHUNK_SIZE,
((skip + limit) / AbstractTask.LEAF_TARGET) + 1) : CHUNK_SIZE;
((skip + limit) / AbstractTask.getLeafTarget()) + 1) : CHUNK_SIZE;
this.permits = new AtomicLong(limit >= 0 ? skip + limit : skip);
}

View File

@ -297,7 +297,7 @@ public class IOUtil {
NativeDispatcher nd)
throws IOException
{
return read(fd, bufs, offset, bufs.length, false, -1, nd);
return read(fd, bufs, offset, length, false, -1, nd);
}
static long read(FileDescriptor fd, ByteBuffer[] bufs, int offset, int length,

View File

@ -456,21 +456,21 @@ public class Resources extends java.util.ListResourceBundle {
{"the.tsa.certificate", "The TSA certificate"},
{"the.input", "The input"},
{"reply", "Reply"},
{"one.in.many", "%s #%d of %d"},
{"one.in.many", "%1$s #%2$d of %3$d"},
{"alias.in.cacerts", "Issuer <%s> in cacerts"},
{"alias.in.keystore", "Issuer <%s>"},
{"with.weak", "%s (weak)"},
{"key.bit", "%d-bit %s key"},
{"key.bit.weak", "%d-bit %s key (weak)"},
{"key.bit", "%1$d-bit %2$s key"},
{"key.bit.weak", "%1$d-bit %2$s key (weak)"},
{"unknown.size.1", "unknown size %s key"},
{".PATTERN.printX509Cert.with.weak",
"Owner: {0}\nIssuer: {1}\nSerial number: {2}\nValid from: {3} until: {4}\nCertificate fingerprints:\n\t SHA1: {5}\n\t SHA256: {6}\nSignature algorithm name: {7}\nSubject Public Key Algorithm: {8}\nVersion: {9}"},
{"PKCS.10.with.weak",
"PKCS #10 Certificate Request (Version 1.0)\n" +
"Subject: %s\nFormat: %s\nPublic Key: %s\nSignature algorithm: %s\n"},
{"verified.by.s.in.s.weak", "Verified by %s in %s with a %s"},
{"whose.sigalg.risk", "%s uses the %s signature algorithm which is considered a security risk."},
{"whose.key.risk", "%s uses a %s which is considered a security risk."},
"Subject: %1$s\nFormat: %2$s\nPublic Key: %3$s\nSignature algorithm: %4$s\n"},
{"verified.by.s.in.s.weak", "Verified by %1$s in %2$s with a %3$s"},
{"whose.sigalg.risk", "%1$s uses the %2$s signature algorithm which is considered a security risk."},
{"whose.key.risk", "%1$s uses a %2$s which is considered a security risk."},
{"jks.storetype.warning", "The %1$s keystore uses a proprietary format. It is recommended to migrate to PKCS12 which is an industry standard format using \"keytool -importkeystore -srckeystore %2$s -destkeystore %2$s -deststoretype pkcs12\"."},
{"migrate.keystore.warning", "Migrated \"%1$s\" to %4$s. The %2$s keystore is backed up as \"%3$s\"."},
{"backup.keystore.warning", "The original keystore \"%1$s\" is backed up as \"%3$s\"..."},

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2017, 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
@ -349,7 +349,7 @@ public final class TimeZoneNames extends TimeZoneNamesBundle {
{"Africa/Johannesburg", SAST},
{"Africa/Juba", EAT},
{"Africa/Kampala", EAT},
{"Africa/Khartoum", EAT},
{"Africa/Khartoum", CAT},
{"Africa/Kigali", CAT},
{"Africa/Kinshasa", WAT},
{"Africa/Lagos", WAT},
@ -374,7 +374,7 @@ public final class TimeZoneNames extends TimeZoneNamesBundle {
{"Africa/Timbuktu", GMT},
{"Africa/Tripoli", EET},
{"Africa/Tunis", CET},
{"Africa/Windhoek", WAT},
{"Africa/Windhoek", CAT},
{"America/Adak", HST},
{"America/Anguilla", AST},
{"America/Antigua", AST},
@ -777,7 +777,6 @@ public final class TimeZoneNames extends TimeZoneNamesBundle {
{"Brazil/West", AMT},
{"Canada/Atlantic", AST},
{"Canada/Central", CST},
{"Canada/East-Saskatchewan", CST},
{"Canada/Eastern", EST},
{"Canada/Mountain", MST},
{"Canada/Newfoundland", NST},

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2017, 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
@ -85,10 +85,18 @@ class PlainDatagramSocketImpl extends AbstractPlainDatagramSocketImpl
protected Set<SocketOption<?>> supportedOptions() {
HashSet<SocketOption<?>> options = new HashSet<>(super.supportedOptions());
options.addAll(extendedOptions.options());
addExtSocketOptions(extendedOptions.options(), options);
return options;
}
private void addExtSocketOptions(Set<SocketOption<?>> extOptions,
Set<SocketOption<?>> options) {
// TCP_QUICKACK is applicable for TCP Sockets only.
extOptions.stream()
.filter((option) -> !option.name().equals("TCP_QUICKACK"))
.forEach((option) -> options.add(option));
}
protected void socketSetOption(int opt, Object val) throws SocketException {
if (opt == SocketOptions.SO_REUSEPORT &&
!supportedOptions().contains(StandardSocketOptions.SO_REUSEPORT)) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2017, 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
@ -616,79 +616,96 @@ public class FileHandler extends StreamHandler {
* @throws IOException
*/
private File generate(String pattern, int generation, int unique)
throws IOException {
File file = null;
String word = "";
int ix = 0;
throws IOException
{
return generate(pattern, count, generation, unique);
}
// The static method here is provided for whitebox testing of the algorithm.
static File generate(String pat, int count, int generation, int unique)
throws IOException
{
Path path = Paths.get(pat);
Path result = null;
boolean sawg = false;
boolean sawu = false;
while (ix < pattern.length()) {
char ch = pattern.charAt(ix);
ix++;
char ch2 = 0;
if (ix < pattern.length()) {
ch2 = Character.toLowerCase(pattern.charAt(ix));
StringBuilder word = new StringBuilder();
Path prev = null;
for (Path elem : path) {
if (prev != null) {
prev = prev.resolveSibling(word.toString());
result = result == null ? prev : result.resolve(prev);
}
if (ch == '/') {
if (file == null) {
file = new File(word);
} else {
file = new File(file, word);
String pattern = elem.toString();
int ix = 0;
word.setLength(0);
while (ix < pattern.length()) {
char ch = pattern.charAt(ix);
ix++;
char ch2 = 0;
if (ix < pattern.length()) {
ch2 = Character.toLowerCase(pattern.charAt(ix));
}
word = "";
continue;
} else if (ch == '%') {
if (ch2 == 't') {
String tmpDir = System.getProperty("java.io.tmpdir");
if (tmpDir == null) {
tmpDir = System.getProperty("user.home");
if (ch == '%') {
if (ch2 == 't') {
String tmpDir = System.getProperty("java.io.tmpdir");
if (tmpDir == null) {
tmpDir = System.getProperty("user.home");
}
result = Paths.get(tmpDir);
ix++;
word.setLength(0);
continue;
} else if (ch2 == 'h') {
result = Paths.get(System.getProperty("user.home"));
if (jdk.internal.misc.VM.isSetUID()) {
// Ok, we are in a set UID program. For safety's sake
// we disallow attempts to open files relative to %h.
throw new IOException("can't use %h in set UID program");
}
ix++;
word.setLength(0);
continue;
} else if (ch2 == 'g') {
word = word.append(generation);
sawg = true;
ix++;
continue;
} else if (ch2 == 'u') {
word = word.append(unique);
sawu = true;
ix++;
continue;
} else if (ch2 == '%') {
word = word.append('%');
ix++;
continue;
}
file = new File(tmpDir);
ix++;
word = "";
continue;
} else if (ch2 == 'h') {
file = new File(System.getProperty("user.home"));
if (jdk.internal.misc.VM.isSetUID()) {
// Ok, we are in a set UID program. For safety's sake
// we disallow attempts to open files relative to %h.
throw new IOException("can't use %h in set UID program");
}
ix++;
word = "";
continue;
} else if (ch2 == 'g') {
word = word + generation;
sawg = true;
ix++;
continue;
} else if (ch2 == 'u') {
word = word + unique;
sawu = true;
ix++;
continue;
} else if (ch2 == '%') {
word = word + "%";
ix++;
continue;
}
word = word.append(ch);
}
word = word + ch;
prev = elem;
}
if (count > 1 && !sawg) {
word = word + "." + generation;
word = word.append('.').append(generation);
}
if (unique > 0 && !sawu) {
word = word + "." + unique;
word = word.append('.').append(unique);
}
if (word.length() > 0) {
if (file == null) {
file = new File(word);
} else {
file = new File(file, word);
}
String n = word.toString();
Path p = prev == null ? Paths.get(n) : prev.resolveSibling(n);
result = result == null ? p : result.resolve(p);
} else if (result == null) {
result = Paths.get("");
}
if (path.getRoot() == null) {
return result.toFile();
} else {
return path.getRoot().resolve(result).toFile();
}
return file;
}
/**

View File

@ -176,6 +176,8 @@ public interface ScriptEngineFactory {
* @param args names of the arguments in the method call.
*
* @return The String used to invoke the method in the syntax of the scripting language.
*
* @throws NullPointerException if obj or m or args or any of the elements of args is null.
*/
public String getMethodCallSyntax(String obj, String m, String... args);

View File

@ -270,7 +270,7 @@ public class Resources extends java.util.ListResourceBundle {
{"The.1.algorithm.specified.for.the.2.option.is.considered.a.security.risk.",
"The %1$s algorithm specified for the %2$s option is considered a security risk."},
{"The.1.signing.key.has.a.keysize.of.2.which.is.considered.a.security.risk.",
"The %s signing key has a keysize of %d which is considered a security risk."},
"The %1$s signing key has a keysize of %2$d which is considered a security risk."},
{"This.jar.contains.entries.whose.certificate.chain.is.invalid.reason.1",
"This jar contains entries whose certificate chain is invalid. Reason: %s"},
{"This.jar.contains.entries.whose.tsa.certificate.chain.is.invalid.reason.1",

View File

@ -139,7 +139,7 @@ public class FrameOutputWriter extends HtmlDocletWriter {
head.addContent(windowTitle);
Content meta = HtmlTree.META("Content-Type", CONTENT_TYPE, configuration.charset);
head.addContent(meta);
head.addContent(getStyleSheetProperties(configuration));
addStyleSheetProperties(configuration, head);
head.addContent(getFramesJavaScript());
Content htmlTree = HtmlTree.HTML(configuration.getLocale().getLanguage(),
head, body);

View File

@ -132,6 +132,11 @@ public class HtmlConfiguration extends BaseConfiguration {
*/
public String stylesheetfile = "";
/**
* Argument for command line option "--add-stylesheet".
*/
public List<String> additionalStylesheets = new ArrayList<>();
/**
* Argument for command line option "-Xdocrootparent".
*/
@ -304,6 +309,22 @@ public class HtmlConfiguration extends BaseConfiguration {
return false;
}
}
// check if stylesheetfile exists
if (!stylesheetfile.isEmpty()) {
DocFile stylesheet = DocFile.createFileForInput(this, stylesheetfile);
if (!stylesheet.exists()) {
reporter.print(ERROR, getText("doclet.File_not_found", stylesheetfile));
return false;
}
}
// check if additional stylesheets exists
for (String ssheet : additionalStylesheets) {
DocFile ssfile = DocFile.createFileForInput(this, ssheet);
if (!ssfile.exists()) {
reporter.print(ERROR, getText("doclet.File_not_found", ssheet));
return false;
}
}
// In a more object-oriented world, this would be done by methods on the Option objects.
// Note that -windowtitle silently removes any and all HTML elements, and so does not need
@ -554,6 +575,13 @@ public class HtmlConfiguration extends BaseConfiguration {
public Set<Doclet.Option> getSupportedOptions() {
Resources resources = getResources();
Doclet.Option[] options = {
new Option(resources, "--add-stylesheet", 1) {
@Override
public boolean process(String opt, List<String> args) {
additionalStylesheets.add(args.get(0));
return true;
}
},
new Option(resources, "-bottom", 1) {
@Override
public boolean process(String opt, List<String> args) {
@ -722,7 +750,7 @@ public class HtmlConfiguration extends BaseConfiguration {
return true;
}
},
new Option(resources, "-stylesheetfile", 1) {
new Option(resources, "--main-stylesheet -stylesheetfile", 1) {
@Override
public boolean process(String opt, List<String> args) {
stylesheetfile = args.get(0);

View File

@ -125,6 +125,9 @@ public class HtmlDoclet extends AbstractDoclet {
boolean nodeprecated = configuration.nodeprecated;
performCopy(configuration.helpfile);
performCopy(configuration.stylesheetfile);
for (String stylesheet : configuration.additionalStylesheets) {
performCopy(stylesheet);
}
// do early to reduce memory footprint
if (configuration.classuse) {
ClassUseWriter.generate(configuration, classtree);

View File

@ -2162,6 +2162,7 @@ public class HtmlDocletWriter extends HtmlDocWriter {
pathToRoot.resolve(stylesheet).getPath(),
"Style");
head.addContent(link);
addStylesheets(configuration, head);
if (configuration.createindex) {
HtmlTree jq_link = HtmlTree.LINK("stylesheet", "text/css",
pathToRoot.resolve(DocPaths.JQUERY_FILES.resolve(DocPaths.JQUERY_STYLESHEET_FILE)).getPath(),

View File

@ -94,7 +94,7 @@ public class IndexRedirectWriter extends HtmlDocletWriter {
head.addContent(metaRefresh);
}
head.addContent(getStyleSheetProperties(configuration));
addStyleSheetProperties(configuration, head);
ContentBuilder bodyContent = new ContentBuilder();
bodyContent.addContent(HtmlTree.NOSCRIPT(

View File

@ -26,6 +26,7 @@
package jdk.javadoc.internal.doclets.formats.html;
import java.io.*;
import java.util.List;
import javax.lang.model.element.Element;
import javax.lang.model.element.PackageElement;
@ -210,7 +211,7 @@ public class SourceToHTMLConverter {
Content head = new HtmlTree(HtmlTag.HEAD);
head.addContent(HtmlTree.TITLE(new StringContent(
configuration.getText("doclet.Window_Source_title"))));
head.addContent(getStyleSheetProperties());
addStyleSheetProperties(head);
Content htmlTree = HtmlTree.HTML(configuration.getLocale().getLanguage(),
head, body);
Content htmlDocument = new HtmlDocument(htmlDocType, htmlTree);
@ -227,9 +228,9 @@ public class SourceToHTMLConverter {
/**
* Returns a link to the stylesheet file.
*
* @return an HtmlTree for the lINK tag which provides the stylesheet location
* @param head an HtmlTree to which the stylesheet links will be added
*/
public HtmlTree getStyleSheetProperties() {
public void addStyleSheetProperties(Content head) {
String filename = configuration.stylesheetfile;
DocPath stylesheet;
if (filename.length() > 0) {
@ -240,7 +241,21 @@ public class SourceToHTMLConverter {
}
DocPath p = relativePath.resolve(stylesheet);
HtmlTree link = HtmlTree.LINK("stylesheet", "text/css", p.getPath(), "Style");
return link;
head.addContent(link);
addStylesheets(head);
}
protected void addStylesheets(Content tree) {
List<String> stylesheets = configuration.additionalStylesheets;
if (!stylesheets.isEmpty()) {
stylesheets.forEach((ssheet) -> {
DocFile file = DocFile.createFileForInput(configuration, ssheet);
DocPath ssheetPath = DocPath.create(file.getName());
HtmlTree slink = HtmlTree.LINK("stylesheet", "text/css", relativePath.resolve(ssheetPath).getPath(),
"Style");
tree.addContent(slink);
});
}
}
/**

View File

@ -311,9 +311,9 @@ public abstract class HtmlDocWriter extends HtmlWriter {
* Returns a link to the stylesheet file.
*
* @param configuration the configuration for this doclet
* @return an HtmlTree for the lINK tag which provides the stylesheet location
* @param head HtmlTree to which the stylesheet links will be added
*/
public HtmlTree getStyleSheetProperties(HtmlConfiguration configuration) {
public void addStyleSheetProperties(HtmlConfiguration configuration, Content head) {
String stylesheetfile = configuration.stylesheetfile;
DocPath stylesheet;
if (stylesheetfile.isEmpty()) {
@ -325,7 +325,21 @@ public abstract class HtmlDocWriter extends HtmlWriter {
HtmlTree link = HtmlTree.LINK("stylesheet", "text/css",
pathToRoot.resolve(stylesheet).getPath(),
"Style");
return link;
head.addContent(link);
addStylesheets(configuration, head);
}
protected void addStylesheets(HtmlConfiguration configuration, Content tree) {
List<String> stylesheets = configuration.additionalStylesheets;
if (!stylesheets.isEmpty()) {
stylesheets.forEach((ssheet) -> {
DocFile file = DocFile.createFileForInput(configuration, ssheet);
DocPath ssheetPath = DocPath.create(file.getName());
HtmlTree slink = HtmlTree.LINK("stylesheet", "text/css", pathToRoot.resolve(ssheetPath).getPath(),
"Style");
tree.addContent(slink);
});
}
}
protected Comment getGeneratedBy(boolean timestamp) {

View File

@ -175,6 +175,10 @@ doclet.Groupname_already_used=In -group option, group name already used: {0}
doclet.Same_element_name_used=Element name or pattern used twice: {0}
# option specifiers
doclet.usage.add-stylesheet.parameters=\
<file>
doclet.usage.add-stylesheet.description=\
Additional stylesheet file for the generated documentation
doclet.usage.d.parameters=\
<directory>
doclet.usage.d.description=\
@ -329,9 +333,9 @@ doclet.usage.sourcetab.description=\
doclet.usage.keywords.description=\
Include HTML meta tags with package, class and member info
doclet.usage.stylesheetfile.parameters=\
<path>
doclet.usage.stylesheetfile.description=\
doclet.usage.main-stylesheet.parameters=\
<file>
doclet.usage.main-stylesheet.description=\
File to change style of the generated documentation
doclet.usage.docencoding.parameters=\

View File

@ -74,14 +74,16 @@ public abstract class JarArchive implements Archive {
private final Path file;
private final String moduleName;
private final Runtime.Version version;
// currently processed JarFile
private JarFile jarFile;
protected JarArchive(String mn, Path file) {
protected JarArchive(String mn, Path file, Runtime.Version version) {
Objects.requireNonNull(mn);
Objects.requireNonNull(file);
this.moduleName = mn;
this.file = file;
this.version = Objects.requireNonNull(version);
}
@Override
@ -126,7 +128,7 @@ public abstract class JarArchive implements Archive {
if (jarFile != null) {
jarFile.close();
}
jarFile = new JarFile(file.toFile(), true, ZipFile.OPEN_READ, JarFile.runtimeVersion());
jarFile = new JarFile(file.toFile(), true, ZipFile.OPEN_READ, version);
}
protected JarFile getJarFile() {

View File

@ -421,6 +421,9 @@ public class JlinkTask {
* the observable modules to those in the transitive closure of
* the modules specified in {@code limitMods} plus other modules
* specified in the {@code roots} set.
*
* @throws IllegalArgumentException if java.base module is present
* but its descriptor has no version
*/
public static ModuleFinder newModuleFinder(List<Path> paths,
Set<String> limitMods,
@ -429,8 +432,25 @@ public class JlinkTask {
if (Objects.requireNonNull(paths).isEmpty()) {
throw new IllegalArgumentException("Empty module path");
}
Path[] entries = paths.toArray(new Path[0]);
ModuleFinder finder = ModulePath.of(Runtime.version(), true, entries);
Runtime.Version version = Runtime.version();
ModuleFinder finder = ModulePath.of(version, true, entries);
if (finder.find("java.base").isPresent()) {
// use the version of java.base module, if present, as
// the release version for multi-release JAR files
ModuleDescriptor.Version v = finder.find("java.base").get()
.descriptor().version().orElseThrow(() ->
new IllegalArgumentException("No version in java.base descriptor")
);
// java.base version is different than the current runtime version
version = Runtime.Version.parse(v.toString());
if (Runtime.version().major() != version.major()) {
finder = ModulePath.of(version, true, entries);
}
}
// if limitmods is specified then limit the universe
if (limitMods != null && !limitMods.isEmpty()) {
@ -744,6 +764,7 @@ public class JlinkTask {
final ByteOrder order;
final Path packagedModulesPath;
final boolean ignoreSigning;
final Runtime.Version version;
final Set<Archive> archives;
ImageHelper(Configuration cf,
@ -754,6 +775,17 @@ public class JlinkTask {
this.order = order;
this.packagedModulesPath = packagedModulesPath;
this.ignoreSigning = ignoreSigning;
// use the version of java.base module, if present, as
// the release version for multi-release JAR files
this.version = cf.findModule("java.base")
.map(ResolvedModule::reference)
.map(ModuleReference::descriptor)
.flatMap(ModuleDescriptor::version)
.map(ModuleDescriptor.Version::toString)
.map(Runtime.Version::parse)
.orElse(Runtime.version());
this.archives = modsPaths.entrySet().stream()
.map(e -> newArchive(e.getKey(), e.getValue()))
.collect(Collectors.toSet());
@ -763,7 +795,7 @@ public class JlinkTask {
if (path.toString().endsWith(".jmod")) {
return new JmodArchive(module, path);
} else if (path.toString().endsWith(".jar")) {
ModularJarArchive modularJarArchive = new ModularJarArchive(module, path);
ModularJarArchive modularJarArchive = new ModularJarArchive(module, path, version);
Stream<Archive.Entry> signatures = modularJarArchive.entries().filter((entry) -> {
String name = entry.name().toUpperCase(Locale.ENGLISH);

View File

@ -39,8 +39,8 @@ public class ModularJarArchive extends JarArchive {
private static final String JAR_EXT = ".jar";
private static final String MODULE_INFO = "module-info.class";
public ModularJarArchive(String mn, Path jmod) {
super(mn, jmod);
public ModularJarArchive(String mn, Path jmod, Runtime.Version version) {
super(mn, jmod, version);
String filename = Objects.requireNonNull(jmod.getFileName()).toString();
if (!filename.endsWith(JAR_EXT)) {
throw new UnsupportedOperationException("Unsupported format: " + filename);

View File

@ -242,8 +242,14 @@ public final class GenerateJLIClassesPlugin implements Plugin {
lines.map(line -> line.split(" "))
.forEach(parts -> {
switch (parts[0]) {
case "[BMH_RESOLVE]":
speciesTypes.add(expandSignature(parts[1]));
case "[SPECIES_RESOLVE]":
// Allow for new types of species data classes being resolved here
if (parts.length == 3 && parts[1].startsWith("java.lang.invoke.BoundMethodHandle$Species_")) {
String species = parts[1].substring("java.lang.invoke.BoundMethodHandle$Species_".length());
if (!"L".equals(species)) {
speciesTypes.add(expandSignature(species));
}
}
break;
case "[LF_RESOLVE]":
String methodType = parts[3];
@ -449,7 +455,7 @@ public final class GenerateJLIClassesPlugin implements Plugin {
"/java.base/" + INVOKERS_HOLDER + ".class";
// Convert LL -> LL, L3 -> LLL
private static String expandSignature(String signature) {
public static String expandSignature(String signature) {
StringBuilder sb = new StringBuilder();
char last = 'X';
int count = 0;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2017, 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
@ -350,7 +350,7 @@ public final class TimeZoneNames_de extends TimeZoneNamesBundle {
{"Africa/Johannesburg", SAST},
{"Africa/Juba", EAT},
{"Africa/Kampala", EAT},
{"Africa/Khartoum", EAT},
{"Africa/Khartoum", CAT},
{"Africa/Kigali", CAT},
{"Africa/Kinshasa", WAT},
{"Africa/Lagos", WAT},
@ -375,7 +375,7 @@ public final class TimeZoneNames_de extends TimeZoneNamesBundle {
{"Africa/Timbuktu", GMT},
{"Africa/Tripoli", EET},
{"Africa/Tunis", CET},
{"Africa/Windhoek", WAT},
{"Africa/Windhoek", CAT},
{"America/Adak", HST},
{"America/Anguilla", AST},
{"America/Antigua", AST},
@ -778,7 +778,6 @@ public final class TimeZoneNames_de extends TimeZoneNamesBundle {
{"Brazil/West", AMT},
{"Canada/Atlantic", AST},
{"Canada/Central", CST},
{"Canada/East-Saskatchewan", CST},
{"Canada/Eastern", EST},
{"Canada/Mountain", MST},
{"Canada/Newfoundland", NST},

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2017, 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
@ -350,7 +350,7 @@ public final class TimeZoneNames_es extends TimeZoneNamesBundle {
{"Africa/Johannesburg", SAST},
{"Africa/Juba", EAT},
{"Africa/Kampala", EAT},
{"Africa/Khartoum", EAT},
{"Africa/Khartoum", CAT},
{"Africa/Kigali", CAT},
{"Africa/Kinshasa", WAT},
{"Africa/Lagos", WAT},
@ -375,7 +375,7 @@ public final class TimeZoneNames_es extends TimeZoneNamesBundle {
{"Africa/Timbuktu", GMT},
{"Africa/Tripoli", EET},
{"Africa/Tunis", CET},
{"Africa/Windhoek", WAT},
{"Africa/Windhoek", CAT},
{"America/Adak", HST},
{"America/Anguilla", AST},
{"America/Antigua", AST},
@ -778,7 +778,6 @@ public final class TimeZoneNames_es extends TimeZoneNamesBundle {
{"Brazil/West", AMT},
{"Canada/Atlantic", AST},
{"Canada/Central", CST},
{"Canada/East-Saskatchewan", CST},
{"Canada/Eastern", EST},
{"Canada/Mountain", MST},
{"Canada/Newfoundland", NST},

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2017, 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
@ -350,7 +350,7 @@ public final class TimeZoneNames_fr extends TimeZoneNamesBundle {
{"Africa/Johannesburg", SAST},
{"Africa/Juba", EAT},
{"Africa/Kampala", EAT},
{"Africa/Khartoum", EAT},
{"Africa/Khartoum", CAT},
{"Africa/Kigali", CAT},
{"Africa/Kinshasa", WAT},
{"Africa/Lagos", WAT},
@ -375,7 +375,7 @@ public final class TimeZoneNames_fr extends TimeZoneNamesBundle {
{"Africa/Timbuktu", GMT},
{"Africa/Tripoli", EET},
{"Africa/Tunis", CET},
{"Africa/Windhoek", WAT},
{"Africa/Windhoek", CAT},
{"America/Adak", HST},
{"America/Anguilla", AST},
{"America/Antigua", AST},
@ -778,7 +778,6 @@ public final class TimeZoneNames_fr extends TimeZoneNamesBundle {
{"Brazil/West", AMT},
{"Canada/Atlantic", AST},
{"Canada/Central", CST},
{"Canada/East-Saskatchewan", CST},
{"Canada/Eastern", EST},
{"Canada/Mountain", MST},
{"Canada/Newfoundland", NST},

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2017, 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
@ -350,7 +350,7 @@ public final class TimeZoneNames_it extends TimeZoneNamesBundle {
{"Africa/Johannesburg", SAST},
{"Africa/Juba", EAT},
{"Africa/Kampala", EAT},
{"Africa/Khartoum", EAT},
{"Africa/Khartoum", CAT},
{"Africa/Kigali", CAT},
{"Africa/Kinshasa", WAT},
{"Africa/Lagos", WAT},
@ -375,7 +375,7 @@ public final class TimeZoneNames_it extends TimeZoneNamesBundle {
{"Africa/Timbuktu", GMT},
{"Africa/Tripoli", EET},
{"Africa/Tunis", CET},
{"Africa/Windhoek", WAT},
{"Africa/Windhoek", CAT},
{"America/Adak", HST},
{"America/Anguilla", AST},
{"America/Antigua", AST},
@ -778,7 +778,6 @@ public final class TimeZoneNames_it extends TimeZoneNamesBundle {
{"Brazil/West", AMT},
{"Canada/Atlantic", AST},
{"Canada/Central", CST},
{"Canada/East-Saskatchewan", CST},
{"Canada/Eastern", EST},
{"Canada/Mountain", MST},
{"Canada/Newfoundland", NST},

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2017, 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
@ -350,7 +350,7 @@ public final class TimeZoneNames_ja extends TimeZoneNamesBundle {
{"Africa/Johannesburg", SAST},
{"Africa/Juba", EAT},
{"Africa/Kampala", EAT},
{"Africa/Khartoum", EAT},
{"Africa/Khartoum", CAT},
{"Africa/Kigali", CAT},
{"Africa/Kinshasa", WAT},
{"Africa/Lagos", WAT},
@ -375,7 +375,7 @@ public final class TimeZoneNames_ja extends TimeZoneNamesBundle {
{"Africa/Timbuktu", GMT},
{"Africa/Tripoli", EET},
{"Africa/Tunis", CET},
{"Africa/Windhoek", WAT},
{"Africa/Windhoek", CAT},
{"America/Adak", HST},
{"America/Anguilla", AST},
{"America/Antigua", AST},
@ -778,7 +778,6 @@ public final class TimeZoneNames_ja extends TimeZoneNamesBundle {
{"Brazil/West", AMT},
{"Canada/Atlantic", AST},
{"Canada/Central", CST},
{"Canada/East-Saskatchewan", CST},
{"Canada/Eastern", EST},
{"Canada/Mountain", MST},
{"Canada/Newfoundland", NST},

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2017, 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
@ -350,7 +350,7 @@ public final class TimeZoneNames_ko extends TimeZoneNamesBundle {
{"Africa/Johannesburg", SAST},
{"Africa/Juba", EAT},
{"Africa/Kampala", EAT},
{"Africa/Khartoum", EAT},
{"Africa/Khartoum", CAT},
{"Africa/Kigali", CAT},
{"Africa/Kinshasa", WAT},
{"Africa/Lagos", WAT},
@ -375,7 +375,7 @@ public final class TimeZoneNames_ko extends TimeZoneNamesBundle {
{"Africa/Timbuktu", GMT},
{"Africa/Tripoli", EET},
{"Africa/Tunis", CET},
{"Africa/Windhoek", WAT},
{"Africa/Windhoek", CAT},
{"America/Adak", HST},
{"America/Anguilla", AST},
{"America/Antigua", AST},
@ -778,7 +778,6 @@ public final class TimeZoneNames_ko extends TimeZoneNamesBundle {
{"Brazil/West", AMT},
{"Canada/Atlantic", AST},
{"Canada/Central", CST},
{"Canada/East-Saskatchewan", CST},
{"Canada/Eastern", EST},
{"Canada/Mountain", MST},
{"Canada/Newfoundland", NST},

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2017, 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
@ -350,7 +350,7 @@ public final class TimeZoneNames_pt_BR extends TimeZoneNamesBundle {
{"Africa/Johannesburg", SAST},
{"Africa/Juba", EAT},
{"Africa/Kampala", EAT},
{"Africa/Khartoum", EAT},
{"Africa/Khartoum", CAT},
{"Africa/Kigali", CAT},
{"Africa/Kinshasa", WAT},
{"Africa/Lagos", WAT},
@ -375,7 +375,7 @@ public final class TimeZoneNames_pt_BR extends TimeZoneNamesBundle {
{"Africa/Timbuktu", GMT},
{"Africa/Tripoli", EET},
{"Africa/Tunis", CET},
{"Africa/Windhoek", WAT},
{"Africa/Windhoek", CAT},
{"America/Adak", HST},
{"America/Anguilla", AST},
{"America/Antigua", AST},
@ -778,7 +778,6 @@ public final class TimeZoneNames_pt_BR extends TimeZoneNamesBundle {
{"Brazil/West", AMT},
{"Canada/Atlantic", AST},
{"Canada/Central", CST},
{"Canada/East-Saskatchewan", CST},
{"Canada/Eastern", EST},
{"Canada/Mountain", MST},
{"Canada/Newfoundland", NST},

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2017, 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
@ -350,7 +350,7 @@ public final class TimeZoneNames_sv extends TimeZoneNamesBundle {
{"Africa/Johannesburg", SAST},
{"Africa/Juba", EAT},
{"Africa/Kampala", EAT},
{"Africa/Khartoum", EAT},
{"Africa/Khartoum", CAT},
{"Africa/Kigali", CAT},
{"Africa/Kinshasa", WAT},
{"Africa/Lagos", WAT},
@ -375,7 +375,7 @@ public final class TimeZoneNames_sv extends TimeZoneNamesBundle {
{"Africa/Timbuktu", GMT},
{"Africa/Tripoli", EET},
{"Africa/Tunis", CET},
{"Africa/Windhoek", WAT},
{"Africa/Windhoek", CAT},
{"America/Adak", HST},
{"America/Anguilla", AST},
{"America/Antigua", AST},
@ -778,7 +778,6 @@ public final class TimeZoneNames_sv extends TimeZoneNamesBundle {
{"Brazil/West", AMT},
{"Canada/Atlantic", AST},
{"Canada/Central", CST},
{"Canada/East-Saskatchewan", CST},
{"Canada/Eastern", EST},
{"Canada/Mountain", MST},
{"Canada/Newfoundland", NST},

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2017, 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
@ -350,7 +350,7 @@ public final class TimeZoneNames_zh_CN extends TimeZoneNamesBundle {
{"Africa/Johannesburg", SAST},
{"Africa/Juba", EAT},
{"Africa/Kampala", EAT},
{"Africa/Khartoum", EAT},
{"Africa/Khartoum", CAT},
{"Africa/Kigali", CAT},
{"Africa/Kinshasa", WAT},
{"Africa/Lagos", WAT},
@ -375,7 +375,7 @@ public final class TimeZoneNames_zh_CN extends TimeZoneNamesBundle {
{"Africa/Timbuktu", GMT},
{"Africa/Tripoli", EET},
{"Africa/Tunis", CET},
{"Africa/Windhoek", WAT},
{"Africa/Windhoek", CAT},
{"America/Adak", HST},
{"America/Anguilla", AST},
{"America/Antigua", AST},
@ -778,7 +778,6 @@ public final class TimeZoneNames_zh_CN extends TimeZoneNamesBundle {
{"Brazil/West", AMT},
{"Canada/Atlantic", AST},
{"Canada/Central", CST},
{"Canada/East-Saskatchewan", CST},
{"Canada/Eastern", EST},
{"Canada/Mountain", MST},
{"Canada/Newfoundland", NST},

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2017, 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
@ -350,7 +350,7 @@ public final class TimeZoneNames_zh_TW extends TimeZoneNamesBundle {
{"Africa/Johannesburg", SAST},
{"Africa/Juba", EAT},
{"Africa/Kampala", EAT},
{"Africa/Khartoum", EAT},
{"Africa/Khartoum", CAT},
{"Africa/Kigali", CAT},
{"Africa/Kinshasa", WAT},
{"Africa/Lagos", WAT},
@ -375,7 +375,7 @@ public final class TimeZoneNames_zh_TW extends TimeZoneNamesBundle {
{"Africa/Timbuktu", GMT},
{"Africa/Tripoli", EET},
{"Africa/Tunis", CET},
{"Africa/Windhoek", WAT},
{"Africa/Windhoek", CAT},
{"America/Adak", HST},
{"America/Anguilla", AST},
{"America/Antigua", AST},
@ -780,7 +780,6 @@ public final class TimeZoneNames_zh_TW extends TimeZoneNamesBundle {
{"Brazil/West", AMT},
{"Canada/Atlantic", AST},
{"Canada/Central", CST},
{"Canada/East-Saskatchewan", CST},
{"Canada/Eastern", EST},
{"Canada/Mountain", MST},
{"Canada/Newfoundland", NST},

View File

@ -0,0 +1,64 @@
/*
* Copyright (c) 2017, 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.
*/
package jdk.net;
import java.net.SocketException;
import java.security.AccessController;
import java.security.PrivilegedAction;
import jdk.net.ExtendedSocketOptions.PlatformSocketOptions;
class LinuxSocketOptions extends PlatformSocketOptions {
public LinuxSocketOptions() {
}
@Override
void setQuickAck(int fd, boolean on) throws SocketException {
setQuickAck0(fd, on);
}
@Override
boolean getQuickAck(int fd) throws SocketException {
return getQuickAck0(fd);
}
@Override
public boolean quickAckSupported() {
return quickAckSupported0();
}
native static private void setQuickAck0(int fd, boolean on) throws SocketException;
native static private boolean getQuickAck0(int fd) throws SocketException;
native static private boolean quickAckSupported0();
static {
AccessController.doPrivileged((PrivilegedAction<Void>) () -> {
System.loadLibrary("extnet");
return null;
});
}
}

View File

@ -0,0 +1,99 @@
/*
* Copyright (c) 2017, 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.
*/
#include <sys/socket.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <jni.h>
#include <netinet/tcp.h>
#include "jni_util.h"
/*
* Class: jdk_net_LinuxSocketOptions
* Method: setQuickAck
* Signature: (II)V
*/
JNIEXPORT void JNICALL Java_jdk_net_LinuxSocketOptions_setQuickAck0
(JNIEnv *env, jobject unused, jint fd, jboolean on) {
int optval;
int rv;
optval = (on ? 1 : 0);
rv = setsockopt(fd, SOL_SOCKET, TCP_QUICKACK, &optval, sizeof (optval));
if (rv < 0) {
if (errno == ENOPROTOOPT) {
JNU_ThrowByName(env, "java/lang/UnsupportedOperationException",
"unsupported socket option");
} else {
JNU_ThrowByNameWithLastError(env, "java/net/SocketException",
"set option TCP_QUICKACK failed");
}
}
}
/*
* Class: jdk_net_LinuxSocketOptions
* Method: getQuickAck
* Signature: (I)Z;
*/
JNIEXPORT jboolean JNICALL Java_jdk_net_LinuxSocketOptions_getQuickAck0
(JNIEnv *env, jobject unused, jint fd) {
int on;
socklen_t sz = sizeof (on);
int rv = getsockopt(fd, SOL_SOCKET, TCP_QUICKACK, &on, &sz);
if (rv < 0) {
if (errno == ENOPROTOOPT) {
JNU_ThrowByName(env, "java/lang/UnsupportedOperationException",
"unsupported socket option");
} else {
JNU_ThrowByNameWithLastError(env, "java/net/SocketException",
"get option TCP_QUICKACK failed");
}
}
return on != 0;
}
/*
* Class: jdk_net_LinuxSocketOptions
* Method: quickAckSupported
* Signature: ()Z
*/
JNIEXPORT jboolean JNICALL Java_jdk_net_LinuxSocketOptions_quickAckSupported0
(JNIEnv *env, jobject unused) {
int one = 1;
int rv, s;
s = socket(PF_INET, SOCK_STREAM, 0);
if (s < 0) {
return JNI_FALSE;
}
rv = setsockopt(s, SOL_SOCKET, TCP_QUICKACK, (void *) &one, sizeof (one));
if (rv != 0 && errno == ENOPROTOOPT) {
rv = JNI_FALSE;
} else {
rv = JNI_TRUE;
}
close(s);
return rv;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2017, 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
@ -67,20 +67,53 @@ public final class ExtendedSocketOptions {
public static final SocketOption<SocketFlow> SO_FLOW_SLA = new
ExtSocketOption<SocketFlow>("SO_FLOW_SLA", SocketFlow.class);
/**
* Disable Delayed Acknowledgements.
*
* <p>
* This socket option can be used to reduce or disable delayed
* acknowledgments (ACKs). When {@code TCP_QUICKACK} is enabled, ACKs are
* sent immediately, rather than delayed if needed in accordance to normal
* TCP operation. This option is not permanent, it only enables a switch to
* or from {@code TCP_QUICKACK} mode. Subsequent operations of the TCP
* protocol will once again disable/enable {@code TCP_QUICKACK} mode
* depending on internal protocol processing and factors such as delayed ACK
* timeouts occurring and data transfer, therefore this option needs to be
* set with {@code setOption} after each operation of TCP on a given socket.
*
* <p>
* The value of this socket option is a {@code Boolean} that represents
* whether the option is enabled or disabled. The socket option is specific
* to stream-oriented sockets using the TCP/IP protocol. The exact semantics
* of this socket option are socket type and system dependent.
*
* @since 10
*/
public static final SocketOption<Boolean> TCP_QUICKACK =
new ExtSocketOption<Boolean>("TCP_QUICKACK", Boolean.class);
private static final PlatformSocketOptions platformSocketOptions =
PlatformSocketOptions.get();
private static final boolean flowSupported =
platformSocketOptions.flowSupported();
private static final boolean quickAckSupported =
platformSocketOptions.quickAckSupported();
private static final Set<SocketOption<?>> extendedOptions = options();
static Set<SocketOption<?>> options() {
if (flowSupported)
return Set.of(SO_FLOW_SLA);
else
if (flowSupported) {
if (quickAckSupported) {
return Set.of(SO_FLOW_SLA, TCP_QUICKACK);
} else {
return Set.of(SO_FLOW_SLA);
}
} else if (quickAckSupported) {
return Set.of(TCP_QUICKACK);
} else {
return Collections.<SocketOption<?>>emptySet();
}
}
static {
@ -105,6 +138,8 @@ public final class ExtendedSocketOptions {
assert flowSupported;
SocketFlow flow = checkValueType(value, option.type());
setFlowOption(fd, flow);
} else if (option == TCP_QUICKACK) {
setQuickAckOption(fd, (boolean) value);
} else {
throw new InternalError("Unexpected option " + option);
}
@ -127,6 +162,8 @@ public final class ExtendedSocketOptions {
SocketFlow flow = SocketFlow.create();
getFlowOption(fd, flow);
return flow;
} else if (option == TCP_QUICKACK) {
return getQuickAckOption(fd);
} else {
throw new InternalError("Unexpected option " + option);
}
@ -156,12 +193,21 @@ public final class ExtendedSocketOptions {
}
private static void getFlowOption(FileDescriptor fd, SocketFlow f)
throws SocketException
{
throws SocketException {
int status = platformSocketOptions.getFlowOption(fdAccess.get(fd), f);
f.status(status); // augment the given flow with the status
}
private static void setQuickAckOption(FileDescriptor fd, boolean enable)
throws SocketException {
platformSocketOptions.setQuickAck(fdAccess.get(fd), enable);
}
private static Object getQuickAckOption(FileDescriptor fd)
throws SocketException {
return platformSocketOptions.getQuickAck(fdAccess.get(fd));
}
static class PlatformSocketOptions {
protected PlatformSocketOptions() {}
@ -184,9 +230,13 @@ public final class ExtendedSocketOptions {
return System.getProperty("os.name");
}
});
if ("SunOS".equals(osname))
if ("SunOS".equals(osname)) {
return newInstance("jdk.net.SolarisSocketOptions");
return new PlatformSocketOptions();
} else if ("Linux".equals(osname)) {
return newInstance("jdk.net.LinuxSocketOptions");
} else {
return new PlatformSocketOptions();
}
}
private static final PlatformSocketOptions instance = create();
@ -208,5 +258,17 @@ public final class ExtendedSocketOptions {
boolean flowSupported() {
return false;
}
void setQuickAck(int fd, boolean on) throws SocketException {
throw new UnsupportedOperationException("unsupported TCP_QUICKACK option");
}
boolean getQuickAck(int fd) throws SocketException {
throw new UnsupportedOperationException("unsupported TCP_QUICKACK option");
}
boolean quickAckSupported() {
return false;
}
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2017, 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
@ -279,6 +279,9 @@ public class Sockets {
if (flowsupported) {
set.add(ExtendedSocketOptions.SO_FLOW_SLA);
}
if (QuickAck.available) {
set.add(ExtendedSocketOptions.TCP_QUICKACK);
}
set = Collections.unmodifiableSet(set);
options.put(Socket.class, set);
@ -290,6 +293,9 @@ public class Sockets {
if (reuseportsupported) {
set.add(StandardSocketOptions.SO_REUSEPORT);
}
if (QuickAck.available) {
set.add(ExtendedSocketOptions.TCP_QUICKACK);
}
set.add(StandardSocketOptions.IP_TOS);
set = Collections.unmodifiableSet(set);
options.put(ServerSocket.class, set);
@ -331,4 +337,17 @@ public class Sockets {
return Collections.unmodifiableMap(options);
}
/**
* Tells whether TCP_QUICKACK is supported.
*/
static class QuickAck {
static final boolean available;
static {
Set<SocketOption<?>> s = new Socket().supportedOptions();
available = s.contains(ExtendedSocketOptions.TCP_QUICKACK);
}
}
}

View File

@ -76,14 +76,16 @@ public final class NashornScriptEngineFactory implements ScriptEngineFactory {
@Override
public String getMethodCallSyntax(final String obj, final String method, final String... args) {
final StringBuilder sb = new StringBuilder().append(obj).append('.').append(method).append('(');
final StringBuilder sb = new StringBuilder().
append(Objects.requireNonNull(obj)).append('.').
append(Objects.requireNonNull(method)).append('(');
final int len = args.length;
if (len > 0) {
sb.append(args[0]);
sb.append(Objects.requireNonNull(args[0]));
}
for (int i = 1; i < len; i++) {
sb.append(',').append(args[i]);
sb.append(',').append(Objects.requireNonNull(args[i]));
}
sb.append(')');

View File

@ -138,7 +138,7 @@ class IntType extends BitwiseType {
} else if (to.isLong()) {
method.visitInsn(I2L);
} else if (to.isBoolean()) {
//nop
invokestatic(method, JSType.TO_BOOLEAN_I);
} else if (to.isString()) {
invokestatic(method, TO_STRING);
} else if (to.isObject()) {

View File

@ -105,8 +105,8 @@ public final class NativeMath extends ScriptObject {
* @return abs of argument
*/
@SpecializedFunction
public static int abs(final Object self, final int x) {
return Math.abs(x);
public static double abs(final Object self, final int x) {
return x == Integer.MIN_VALUE? Math.abs((double)x) : Math.abs(x);
}
/**

View File

@ -89,6 +89,9 @@ public enum JSType {
/** JavaScript compliant conversion function from number to boolean */
public static final Call TO_BOOLEAN_D = staticCall(JSTYPE_LOOKUP, JSType.class, "toBoolean", boolean.class, double.class);
/** JavaScript compliant conversion function from int to boolean */
public static final Call TO_BOOLEAN_I = staticCall(JSTYPE_LOOKUP, JSType.class, "toBoolean", boolean.class, int.class);
/** JavaScript compliant conversion function from Object to integer */
public static final Call TO_INTEGER = staticCall(JSTYPE_LOOKUP, JSType.class, "toInteger", int.class, Object.class);
@ -547,6 +550,17 @@ public enum JSType {
return num != 0 && !Double.isNaN(num);
}
/**
* JavaScript compliant conversion of int to boolean
*
* @param num an int
*
* @return a boolean
*/
public static boolean toBoolean(final int num) {
return num != 0;
}
/**
* JavaScript compliant conversion of Object to boolean
* See ECMA 9.2 ToBoolean

View File

@ -2050,7 +2050,7 @@ public abstract class ScriptObject implements PropertyAccess, Cloneable {
final PropertyMap newMap = oldMap.replaceProperty(property, property.removeFlags(Property.NEEDS_DECLARATION));
setMap(newMap);
set(key, value, 0);
set(key, value, NashornCallSiteDescriptor.CALLSITE_DECLARE);
}
/**
@ -3071,7 +3071,7 @@ public abstract class ScriptObject implements PropertyAccess, Cloneable {
}
if (f != null) {
if (!f.getProperty().isWritable() || !f.getProperty().hasNativeSetter()) {
if ((!f.getProperty().isWritable() && !NashornCallSiteDescriptor.isDeclaration(callSiteFlags)) || !f.getProperty().hasNativeSetter()) {
if (isScopeFlag(callSiteFlags) && f.getProperty().isLexicalBinding()) {
throw typeError("assign.constant", key.toString()); // Overwriting ES6 const should throw also in non-strict mode.
}

View File

@ -504,6 +504,15 @@ public final class NashornCallSiteDescriptor extends CallSiteDescriptor {
return (flags & CALLSITE_SCOPE) != 0;
}
/**
* Returns true if {@code flags} has the {@link #CALLSITE_DECLARE} bit set.
* @param flags the flags
* @return true if the flag is set, false otherwise.
*/
public static boolean isDeclaration(final int flags) {
return (flags & CALLSITE_DECLARE) != 0;
}
/**
* Get a program point from a descriptor (must be optimistic)
* @param desc descriptor

View File

@ -174,6 +174,8 @@ java/net/MulticastSocket/Test.java 7145658 macosx-a
java/net/DatagramSocket/SendDatagramToBadAddress.java 7143960 macosx-all
java/net/httpclient/websocket/ConnectionHandover.java 8188895 windows-all
############################################################################
# jdk_nio

View File

@ -0,0 +1,82 @@
/*
* Copyright (c) 2017, 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.
*
* 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.
*/
/* @test
* @summary Smoke-test class specializer, used to create BoundMethodHandle classes
* @compile/module=java.base java/lang/invoke/ClassSpecializerHelper.java
* @run testng/othervm/timeout=250 -ea -esa ClassSpecializerTest
*/
// Useful diagnostics to try:
// -Djava.lang.invoke.MethodHandle.TRACE_RESOLVE=true
// -Djava.lang.invoke.MethodHandle.DUMP_CLASS_FILES=true
import org.testng.annotations.*;
import java.lang.invoke.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import static java.lang.invoke.ClassSpecializerHelper.*;
public class ClassSpecializerTest {
@Test
public void testFindSpecies() throws Throwable {
System.out.println("testFindSpecies");
System.out.println("test = " + SPEC_TEST);
ArrayList<Object> args = new ArrayList<>();
for (int key = 0; key <= Kind.MAX_KEY; key++) {
Kind k = SpecTest.kind(key);
System.out.println("k = " + k);
MethodHandle mh = k.factory();
System.out.println("k.f = " + mh);
args.clear();
for (Class<?> pt : mh.type().parameterList()) {
args.add(coughUpA(pt));
}
args.set(0, key * 1000 + 42);
Frob f = (Frob) mh.invokeWithArguments(args.toArray());
assert(f.kind() == k);
System.out.println("k.f(...) = " + f.toString());
List<Object> l = f.asList();
System.out.println("f.l = " + l);
args.subList(0,1).clear(); // drop label
assert(args.equals(l));
}
}
private static Object coughUpA(Class<?> pt) throws Throwable {
if (pt == String.class) return "foo";
if (pt.isArray()) return java.lang.reflect.Array.newInstance(pt.getComponentType(), 2);
if (pt == Integer.class) return 42;
if (pt == Double.class) return 3.14;
if (pt.isAssignableFrom(List.class))
return Arrays.asList("hello", "world", "from", pt.getSimpleName());
return MethodHandles.zero(pt).invoke();
}
public static void main(String... av) throws Throwable {
System.out.println("TEST: ClassSpecializerTest");
new ClassSpecializerTest().testFindSpecies();
}
}

View File

@ -0,0 +1,155 @@
/*
* Copyright (c) 2017, 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.
*
* 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.
*/
package java.lang.invoke;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import static java.lang.invoke.MethodHandleNatives.Constants.*;
/**
* Helper class, injected into java.lang.invoke,
* that bridges to the private ClassSpecializer mechanism.
*/
public interface ClassSpecializerHelper {
interface Frob {
Kind kind();
int label();
List<Object> asList();
}
abstract class FrobImpl implements Frob {
private final int label;
public FrobImpl(int label) {
this.label = label;
}
public int label() { return label; }
@Override public abstract Kind kind();
public String toString() {
final StringBuilder buf = new StringBuilder();
buf.append("Frob[label=").append(label);
final Kind k = kind();
if (k != null) {
for (MethodHandle mh : k.getters()) {
Object x = "?";
try {
x = mh.invoke(this);
} catch (Throwable ex) {
x = "<<"+ex.getMessage()+">>";
}
buf.append(", ").append(x);
}
}
buf.append("]");
return buf.toString();
}
public List<Object> asList() {
final List<MethodHandle> getters = kind().getters();
ArrayList<Object> res = new ArrayList<>(getters.size());
for (MethodHandle getter : getters) {
try {
res.add(getter.invoke(this));
} catch (Throwable ex) {
throw new AssertionError(ex);
}
}
return res;
}
}
public static class Kind extends ClassSpecializer<Frob, Byte, Kind>.SpeciesData {
public Kind(SpecTest outer, Byte key) {
outer.super(key);
}
public MethodHandle factory() {
return super.factory();
}
public List<MethodHandle> getters() {
return super.getters();
}
private static final List<Class<?>> FIELD_TYPES
= Arrays.asList(String.class, float.class, Double.class, boolean.class, Object[].class, Object.class);
public static int MAX_KEY = FIELD_TYPES.size();
@Override
protected List<Class<?>> deriveFieldTypes(Byte key) {
return FIELD_TYPES.subList(0, key);
}
@Override
protected Class<? extends Frob> deriveSuperClass() {
return FrobImpl.class;
}
@Override
protected MethodHandle deriveTransformHelper(MemberName transform, int whichtm) {
throw new AssertionError();
}
@Override
protected <X> List<X> deriveTransformHelperArguments(MemberName transform, int whichtm, List<X> args, List<X> fields) {
throw new AssertionError();
}
}
class SpecTest extends ClassSpecializer<Frob, Byte, Kind> {
private static final MemberName SPECIES_DATA_ACCESSOR;
static {
try {
SPECIES_DATA_ACCESSOR = MethodHandles.publicLookup()
.resolveOrFail(REF_invokeVirtual, FrobImpl.class, "kind", MethodType.methodType(Kind.class));
} catch (ReflectiveOperationException ex) {
throw new AssertionError("Bootstrap link error", ex);
}
}
public SpecTest() {
super(Frob.class, Byte.class, Kind.class,
MethodType.methodType(void.class, int.class),
SPECIES_DATA_ACCESSOR,
"KIND",
Arrays.asList());
}
@Override
protected Kind newSpeciesData(Byte key) {
return new Kind(this, key);
}
public static Kind kind(int key) {
return (Kind) SPEC_TEST.findSpecies((byte)key);
}
}
static final SpecTest SPEC_TEST = new SpecTest();
}

View File

@ -22,6 +22,7 @@
*/
/* @test
* @bug 8191025
* @summary Test socketchannel vector IO (use -Dseed=X to set PRNG seed)
* @library .. /test/lib
* @build jdk.test.lib.RandomFactory
@ -42,11 +43,16 @@ public class VectorIO {
static int testSize;
// whether to use the write/read variant with a length parameter
static boolean setLength;
public static void main(String[] args) throws Exception {
testSize = 1;
setLength = false;
runTest();
for(int i=15; i<18; i++) {
testSize = i;
setLength = !setLength;
runTest();
}
}
@ -75,6 +81,9 @@ public class VectorIO {
total += bufs[i].remaining();
}
ByteBuffer[] bufsPlus1 = new ByteBuffer[bufs.length + 1];
System.arraycopy(bufs, 0, bufsPlus1, 0, bufs.length);
// Get a connection to the server
InetAddress lh = InetAddress.getLocalHost();
InetSocketAddress isa = new InetSocketAddress(lh, port);
@ -85,7 +94,12 @@ public class VectorIO {
// Write the data out
long rem = total;
while (rem > 0L) {
long bytesWritten = sc.write(bufs);
long bytesWritten;
if (setLength) {
bytesWritten = sc.write(bufsPlus1, 0, bufs.length);
} else {
bytesWritten = sc.write(bufs);
}
if (bytesWritten == 0) {
if (sc.isBlocking()) {
throw new RuntimeException("write did not block");
@ -134,6 +148,9 @@ public class VectorIO {
total += bufs[i].capacity();
}
ByteBuffer[] bufsPlus1 = new ByteBuffer[bufs.length + 1];
System.arraycopy(bufs, 0, bufsPlus1, 0, bufs.length);
// Get a connection from client
SocketChannel sc = null;
@ -155,7 +172,12 @@ public class VectorIO {
// Read data into multiple buffers
long avail = total;
while (avail > 0) {
long bytesRead = sc.read(bufs);
long bytesRead;
if (setLength) {
bytesRead = sc.read(bufsPlus1, 0, bufs.length);
} else {
bytesRead = sc.read(bufs);
}
if (bytesRead < 0)
break;
if (bytesRead == 0) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2017, 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
@ -941,21 +941,21 @@ public class TCKZoneRules {
}
public void test_Apia_jumpForwardOverInternationalDateLine_P12_to_M12() {
// transition occurred at 1879-07-04T00:00+12:33:04
// transition occurred at 1892-07-04T00:00+12:33:04
ZoneRules test = pacificApia();
Instant instantBefore = LocalDate.of(1879, 7, 2).atStartOfDay(ZoneOffset.UTC).toInstant();
Instant instantBefore = LocalDate.of(1892, 7, 2).atStartOfDay(ZoneOffset.UTC).toInstant();
ZoneOffsetTransition trans = test.nextTransition(instantBefore);
assertEquals(trans.getDateTimeBefore(), LocalDateTime.of(1879, 7, 5, 0, 0));
assertEquals(trans.getDateTimeAfter(), LocalDateTime.of(1879, 7, 4, 0, 0));
assertEquals(trans.getDateTimeBefore(), LocalDateTime.of(1892, 7, 5, 0, 0));
assertEquals(trans.getDateTimeAfter(), LocalDateTime.of(1892, 7, 4, 0, 0));
assertEquals(trans.isGap(), false);
assertEquals(trans.isOverlap(), true);
assertEquals(trans.isValidOffset(ZoneOffset.ofHoursMinutesSeconds(+12, 33, 4)), true);
assertEquals(trans.isValidOffset(ZoneOffset.ofHoursMinutesSeconds(-11, -26, -56)), true);
assertEquals(trans.getDuration(), Duration.ofHours(-24));
assertEquals(trans.getInstant(), LocalDateTime.of(1879, 7, 4, 0, 0).toInstant(ZoneOffset.ofHoursMinutesSeconds(-11, -26, -56)));
assertEquals(trans.getInstant(), LocalDateTime.of(1892, 7, 4, 0, 0).toInstant(ZoneOffset.ofHoursMinutesSeconds(-11, -26, -56)));
ZonedDateTime zdt = ZonedDateTime.of(1879, 7, 4, 23, 0, 0, 0, ZoneId.of("Pacific/Apia"));
assertEquals(zdt.plusHours(2).toLocalDateTime(), LocalDateTime.of(1879, 7, 4, 1, 0, 0));
ZonedDateTime zdt = ZonedDateTime.of(1892, 7, 4, 23, 0, 0, 0, ZoneId.of("Pacific/Apia"));
assertEquals(zdt.plusHours(2).toLocalDateTime(), LocalDateTime.of(1892, 7, 4, 1, 0, 0));
}
//-------------------------------------------------------------------------

View File

@ -104,7 +104,7 @@ class ZoneName {
"Pacific/Chuuk", "Truk", "Pacific/Truk",
"Africa/Gaborone", "Africa_Central", "Africa/Maputo",
"Africa/Tunis", "Europe_Central", "Europe/Paris",
"Africa/Khartoum", "Africa_Eastern", "Africa/Nairobi",
"Africa/Khartoum", "Africa_Central", "Africa/Maputo",
"Europe/Isle_of_Man", "GMT", "Atlantic/Reykjavik",
"Europe/Skopje", "Europe_Central", "Europe/Paris",
"America/Merida", "America_Central", "America/Chicago",
@ -221,7 +221,7 @@ class ZoneName {
"Africa/Algiers", "Europe_Central", "Europe/Paris",
"America/Miquelon", "Pierre_Miquelon", "America/Miquelon",
"Asia/Tokyo", "Japan", "Asia/Tokyo",
"Africa/Windhoek", "Africa_Western", "Africa/Lagos",
"Africa/Windhoek", "Africa_Central", "Africa/Maputo",
"Africa/Bujumbura", "Africa_Central", "Africa/Maputo",
"America/Guatemala", "America_Central", "America/Chicago",
"Africa/Dakar", "GMT", "Atlantic/Reykjavik",
@ -662,7 +662,6 @@ class ZoneName {
"America/Rosario", "America/Argentina/Cordoba",
"Jamaica", "America/Jamaica",
"Asia/Katmandu", "Asia/Kathmandu",
"Canada/East-Saskatchewan", "America/Regina",
"ROK", "Asia/Seoul",
"Asia/Macao", "Asia/Macau",
"Australia/South", "Australia/Adelaide",

View File

@ -21,7 +21,7 @@
* questions.
*/
/**
/*
* @test
* @bug 4189896
* @summary AbstractList iterators previously checked for co-modification

View File

@ -21,7 +21,7 @@
* questions.
*/
/**
/*
* @test
* @bug 4295163
* @summary AddAll(int, Collection) intersperses the Collection with this List.

View File

@ -233,7 +233,7 @@ public class IteratorMicroBenchmark {
}
// Checks for correctness *and* prevents loop optimizations
class Check {
static class Check {
private int sum;
public void sum(int sum) {
if (this.sum == 0)

View File

@ -1584,11 +1584,11 @@ public class MOAT {
}
interface Fun {void f() throws Throwable;}
private static void THROWS(Class<? extends Throwable> k, Fun... fs) {
for (Fun f : fs)
try { f.f(); fail("Expected " + k.getName() + " not thrown"); }
catch (Throwable t) {
if (k.isAssignableFrom(t.getClass())) pass();
else unexpected(t);}}
for (Fun f : fs)
try { f.f(); fail("Expected " + k.getName() + " not thrown"); }
catch (Throwable t) {
if (k.isAssignableFrom(t.getClass())) pass();
else unexpected(t);}}
static byte[] serializedForm(Object obj) {
try {
ByteArrayOutputStream baos = new ByteArrayOutputStream();

View File

@ -230,7 +230,7 @@ public class RemoveMicroBenchmark {
}
// Checks for correctness *and* prevents loop optimizations
class Check {
static class Check {
private int sum;
public void sum(int sum) {
if (this.sum == 0)

View File

@ -33,7 +33,7 @@ import java.util.*;
public class AddAll {
static final int N = 100;
public static void main(String args[]) {
public static void main(String[] args) {
test(new ArrayList<Integer>());
test(new LinkedList<Integer>());
test(new HashSet<Integer>());

View File

@ -30,7 +30,7 @@
import java.util.*;
public class BinarySearchNullComparator {
public static void main(String args[]) throws Exception {
public static void main(String[] args) throws Exception {
List list = Arrays.asList(new String[] {"I", "Love", "You"});
int result = Collections.binarySearch(list, "You", null);

Some files were not shown because too many files have changed in this diff Show More