From 6a9a00c61c69776a433827fab03e97e3060440ad Mon Sep 17 00:00:00 2001 From: Jesper Wilhelmsson Date: Tue, 7 Nov 2017 23:18:16 +0100 Subject: [PATCH 01/28] 8190865: Require jtreg 4.2 b10 Reviewed-by: dcubed, erikj --- make/conf/jib-profiles.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/make/conf/jib-profiles.js b/make/conf/jib-profiles.js index 7a6ee1dd275..03943e2ebfc 100644 --- a/make/conf/jib-profiles.js +++ b/make/conf/jib-profiles.js @@ -824,7 +824,7 @@ var getJibProfilesDependencies = function (input, common) { jtreg: { server: "javare", revision: "4.2", - build_number: "b09", + build_number: "b10", checksum_file: "MD5_VALUES", file: "jtreg_bin-4.2.zip", environment_name: "JT_HOME", From 6c99853a4c399714cf72f9af6dc538446c2a5fee Mon Sep 17 00:00:00 2001 From: Ramanand Patil Date: Thu, 9 Nov 2017 14:38:54 +0530 Subject: [PATCH 02/28] 8190258: (tz) Support tzdata2017c 8190259: test tck.java.time.zone.TCKZoneRules is broken by tzdata2017c Reviewed-by: naoto, martin --- make/data/tzdata/VERSION | 2 +- make/data/tzdata/africa | 99 ++++++---- make/data/tzdata/antarctica | 8 +- make/data/tzdata/asia | 144 ++++++++++----- make/data/tzdata/australasia | 67 ++++--- make/data/tzdata/backward | 4 +- make/data/tzdata/europe | 88 ++++----- make/data/tzdata/leapseconds | 17 +- make/data/tzdata/northamerica | 169 +++++++++++------- make/data/tzdata/southamerica | 32 ++-- make/data/tzdata/zone.tab | 4 +- .../classes/java/time/format/ZoneName.java | 7 +- .../sun/util/resources/TimeZoneNames.java | 7 +- .../util/resources/ext/TimeZoneNames_de.java | 7 +- .../util/resources/ext/TimeZoneNames_es.java | 7 +- .../util/resources/ext/TimeZoneNames_fr.java | 7 +- .../util/resources/ext/TimeZoneNames_it.java | 7 +- .../util/resources/ext/TimeZoneNames_ja.java | 7 +- .../util/resources/ext/TimeZoneNames_ko.java | 7 +- .../resources/ext/TimeZoneNames_pt_BR.java | 7 +- .../util/resources/ext/TimeZoneNames_sv.java | 7 +- .../resources/ext/TimeZoneNames_zh_CN.java | 7 +- .../resources/ext/TimeZoneNames_zh_TW.java | 7 +- .../time/tck/java/time/zone/TCKZoneRules.java | 16 +- .../time/test/java/time/format/ZoneName.java | 5 +- test/jdk/sun/util/calendar/zi/tzdata/VERSION | 2 +- test/jdk/sun/util/calendar/zi/tzdata/africa | 99 ++++++---- .../sun/util/calendar/zi/tzdata/antarctica | 8 +- test/jdk/sun/util/calendar/zi/tzdata/asia | 144 ++++++++++----- .../sun/util/calendar/zi/tzdata/australasia | 67 ++++--- test/jdk/sun/util/calendar/zi/tzdata/backward | 4 +- test/jdk/sun/util/calendar/zi/tzdata/europe | 88 ++++----- .../sun/util/calendar/zi/tzdata/leapseconds | 17 +- .../sun/util/calendar/zi/tzdata/northamerica | 169 +++++++++++------- .../sun/util/calendar/zi/tzdata/southamerica | 32 ++-- test/jdk/sun/util/calendar/zi/tzdata/zone.tab | 4 +- 36 files changed, 838 insertions(+), 535 deletions(-) diff --git a/make/data/tzdata/VERSION b/make/data/tzdata/VERSION index eb5b4595f3e..66429083107 100644 --- a/make/data/tzdata/VERSION +++ b/make/data/tzdata/VERSION @@ -21,4 +21,4 @@ # or visit www.oracle.com if you need additional information or have any # questions. # -tzdata2017b +tzdata2017c diff --git a/make/data/tzdata/africa b/make/data/tzdata/africa index d3de96d1431..10d4dfaabbc 100644 --- a/make/data/tzdata/africa +++ b/make/data/tzdata/africa @@ -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: ) # 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 -# agrees +# 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 # 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 diff --git a/make/data/tzdata/antarctica b/make/data/tzdata/antarctica index c88c0b4107b..c78ef7ed503 100644 --- a/make/data/tzdata/antarctica +++ b/make/data/tzdata/antarctica @@ -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 -# (2005-12-05) +# (2005-12-05) # # Another base at Port-Martin, 50km east, began operation in 1947. # It was destroyed by fire on 1952-01-14. diff --git a/make/data/tzdata/asia b/make/data/tzdata/asia index 306a2aa8bc2..71f5d0cfc83 100644 --- a/make/data/tzdata/asia +++ b/make/data/tzdata/asia @@ -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 -# (1999-12-26/31): +# (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 diff --git a/make/data/tzdata/australasia b/make/data/tzdata/australasia index db7e7f7bcb2..6726ef33816 100644 --- a/make/data/tzdata/australasia +++ b/make/data/tzdata/australasia @@ -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, -# , page 65, says Tokelau +# , 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 (2005-08-31): +# From Wikipedia (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 diff --git a/make/data/tzdata/backward b/make/data/tzdata/backward index b4cf3be2d34..fca4ed18816 100644 --- a/make/data/tzdata/backward +++ b/make/data/tzdata/backward @@ -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 diff --git a/make/data/tzdata/europe b/make/data/tzdata/europe index 0d8a40e4f37..6359279d2fa 100644 --- a/make/data/tzdata/europe +++ b/make/data/tzdata/europe @@ -60,14 +60,14 @@ # [PDF] (1914-03) # # Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94 -# . He writes: +# . 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 . @@ -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 (1999-09-09) +# From The Baltic Times (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. # -# says that the meteorologists +# 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) @@ -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 diff --git a/make/data/tzdata/leapseconds b/make/data/tzdata/leapseconds index 3823c9abc4c..9b4ec9ad474 100644 --- a/make/data/tzdata/leapseconds +++ b/make/data/tzdata/leapseconds @@ -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 does not work, -# you should be able to pick up leap-seconds.list from a secondary NIST server. -# See 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 . +# 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 diff --git a/make/data/tzdata/northamerica b/make/data/tzdata/northamerica index d59d2705b99..99dcc938fa9 100644 --- a/make/data/tzdata/northamerica +++ b/make/data/tzdata/northamerica @@ -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 -# . +# . # # 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 +# From # 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 diff --git a/make/data/tzdata/southamerica b/make/data/tzdata/southamerica index 44dbd957566..d15e8344db0 100644 --- a/make/data/tzdata/southamerica +++ b/make/data/tzdata/southamerica @@ -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: diff --git a/make/data/tzdata/zone.tab b/make/data/tzdata/zone.tab index 8d6247d21a7..b1a7f077242 100644 --- a/make/data/tzdata/zone.tab +++ b/make/data/tzdata/zone.tab @@ -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 diff --git a/src/java.base/share/classes/java/time/format/ZoneName.java b/src/java.base/share/classes/java/time/format/ZoneName.java index 645241360d4..b76e6949939 100644 --- a/src/java.base/share/classes/java/time/format/ZoneName.java +++ b/src/java.base/share/classes/java/time/format/ZoneName.java @@ -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", diff --git a/src/java.base/share/classes/sun/util/resources/TimeZoneNames.java b/src/java.base/share/classes/sun/util/resources/TimeZoneNames.java index e9459d95fb7..0636a445760 100644 --- a/src/java.base/share/classes/sun/util/resources/TimeZoneNames.java +++ b/src/java.base/share/classes/sun/util/resources/TimeZoneNames.java @@ -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}, diff --git a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_de.java b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_de.java index ba542688025..67ae3596ff9 100644 --- a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_de.java +++ b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_de.java @@ -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}, diff --git a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_es.java b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_es.java index 100ac3356e1..36326e49f8c 100644 --- a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_es.java +++ b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_es.java @@ -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}, diff --git a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_fr.java b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_fr.java index 8407be0b035..d5475e34615 100644 --- a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_fr.java +++ b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_fr.java @@ -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}, diff --git a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_it.java b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_it.java index 6653a6241df..c1334d06b28 100644 --- a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_it.java +++ b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_it.java @@ -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}, diff --git a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_ja.java b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_ja.java index 0f70da38c91..6661bfdc837 100644 --- a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_ja.java +++ b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_ja.java @@ -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}, diff --git a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_ko.java b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_ko.java index 1f6a3585da8..665ea8bb6ab 100644 --- a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_ko.java +++ b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_ko.java @@ -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}, diff --git a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_pt_BR.java b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_pt_BR.java index 3a03cda7ecc..ea890dd6ebc 100644 --- a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_pt_BR.java +++ b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_pt_BR.java @@ -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}, diff --git a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_sv.java b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_sv.java index 7a13b7e87e3..ced9600226a 100644 --- a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_sv.java +++ b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_sv.java @@ -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}, diff --git a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_zh_CN.java b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_zh_CN.java index 6c6e647d3bd..f0a99da1625 100644 --- a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_zh_CN.java +++ b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_zh_CN.java @@ -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}, diff --git a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_zh_TW.java b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_zh_TW.java index fa62d62ba04..bb6ac9fcf5c 100644 --- a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_zh_TW.java +++ b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_zh_TW.java @@ -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}, diff --git a/test/jdk/java/time/tck/java/time/zone/TCKZoneRules.java b/test/jdk/java/time/tck/java/time/zone/TCKZoneRules.java index 19f8239c230..8c36b38fe30 100644 --- a/test/jdk/java/time/tck/java/time/zone/TCKZoneRules.java +++ b/test/jdk/java/time/tck/java/time/zone/TCKZoneRules.java @@ -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)); } //------------------------------------------------------------------------- diff --git a/test/jdk/java/time/test/java/time/format/ZoneName.java b/test/jdk/java/time/test/java/time/format/ZoneName.java index 1fbb913acd4..591626d1981 100644 --- a/test/jdk/java/time/test/java/time/format/ZoneName.java +++ b/test/jdk/java/time/test/java/time/format/ZoneName.java @@ -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", diff --git a/test/jdk/sun/util/calendar/zi/tzdata/VERSION b/test/jdk/sun/util/calendar/zi/tzdata/VERSION index eb5b4595f3e..66429083107 100644 --- a/test/jdk/sun/util/calendar/zi/tzdata/VERSION +++ b/test/jdk/sun/util/calendar/zi/tzdata/VERSION @@ -21,4 +21,4 @@ # or visit www.oracle.com if you need additional information or have any # questions. # -tzdata2017b +tzdata2017c diff --git a/test/jdk/sun/util/calendar/zi/tzdata/africa b/test/jdk/sun/util/calendar/zi/tzdata/africa index d3de96d1431..10d4dfaabbc 100644 --- a/test/jdk/sun/util/calendar/zi/tzdata/africa +++ b/test/jdk/sun/util/calendar/zi/tzdata/africa @@ -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: ) # 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 -# agrees +# 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 # 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 diff --git a/test/jdk/sun/util/calendar/zi/tzdata/antarctica b/test/jdk/sun/util/calendar/zi/tzdata/antarctica index c88c0b4107b..c78ef7ed503 100644 --- a/test/jdk/sun/util/calendar/zi/tzdata/antarctica +++ b/test/jdk/sun/util/calendar/zi/tzdata/antarctica @@ -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 -# (2005-12-05) +# (2005-12-05) # # Another base at Port-Martin, 50km east, began operation in 1947. # It was destroyed by fire on 1952-01-14. diff --git a/test/jdk/sun/util/calendar/zi/tzdata/asia b/test/jdk/sun/util/calendar/zi/tzdata/asia index 306a2aa8bc2..71f5d0cfc83 100644 --- a/test/jdk/sun/util/calendar/zi/tzdata/asia +++ b/test/jdk/sun/util/calendar/zi/tzdata/asia @@ -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 -# (1999-12-26/31): +# (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 diff --git a/test/jdk/sun/util/calendar/zi/tzdata/australasia b/test/jdk/sun/util/calendar/zi/tzdata/australasia index db7e7f7bcb2..6726ef33816 100644 --- a/test/jdk/sun/util/calendar/zi/tzdata/australasia +++ b/test/jdk/sun/util/calendar/zi/tzdata/australasia @@ -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, -# , page 65, says Tokelau +# , 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 (2005-08-31): +# From Wikipedia (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 diff --git a/test/jdk/sun/util/calendar/zi/tzdata/backward b/test/jdk/sun/util/calendar/zi/tzdata/backward index b4cf3be2d34..fca4ed18816 100644 --- a/test/jdk/sun/util/calendar/zi/tzdata/backward +++ b/test/jdk/sun/util/calendar/zi/tzdata/backward @@ -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 diff --git a/test/jdk/sun/util/calendar/zi/tzdata/europe b/test/jdk/sun/util/calendar/zi/tzdata/europe index 0d8a40e4f37..6359279d2fa 100644 --- a/test/jdk/sun/util/calendar/zi/tzdata/europe +++ b/test/jdk/sun/util/calendar/zi/tzdata/europe @@ -60,14 +60,14 @@ # [PDF] (1914-03) # # Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94 -# . He writes: +# . 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 . @@ -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 (1999-09-09) +# From The Baltic Times (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. # -# says that the meteorologists +# 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) @@ -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 diff --git a/test/jdk/sun/util/calendar/zi/tzdata/leapseconds b/test/jdk/sun/util/calendar/zi/tzdata/leapseconds index 3823c9abc4c..9b4ec9ad474 100644 --- a/test/jdk/sun/util/calendar/zi/tzdata/leapseconds +++ b/test/jdk/sun/util/calendar/zi/tzdata/leapseconds @@ -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 does not work, -# you should be able to pick up leap-seconds.list from a secondary NIST server. -# See 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 . +# 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 diff --git a/test/jdk/sun/util/calendar/zi/tzdata/northamerica b/test/jdk/sun/util/calendar/zi/tzdata/northamerica index d59d2705b99..99dcc938fa9 100644 --- a/test/jdk/sun/util/calendar/zi/tzdata/northamerica +++ b/test/jdk/sun/util/calendar/zi/tzdata/northamerica @@ -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 -# . +# . # # 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 +# From # 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 diff --git a/test/jdk/sun/util/calendar/zi/tzdata/southamerica b/test/jdk/sun/util/calendar/zi/tzdata/southamerica index 44dbd957566..d15e8344db0 100644 --- a/test/jdk/sun/util/calendar/zi/tzdata/southamerica +++ b/test/jdk/sun/util/calendar/zi/tzdata/southamerica @@ -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: diff --git a/test/jdk/sun/util/calendar/zi/tzdata/zone.tab b/test/jdk/sun/util/calendar/zi/tzdata/zone.tab index 8d6247d21a7..b1a7f077242 100644 --- a/test/jdk/sun/util/calendar/zi/tzdata/zone.tab +++ b/test/jdk/sun/util/calendar/zi/tzdata/zone.tab @@ -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 From ccdb0ef8e22bf9d4e21a2beb795a6905b0b17ae0 Mon Sep 17 00:00:00 2001 From: Daniel Fuchs Date: Thu, 9 Nov 2017 20:51:37 +0000 Subject: [PATCH 03/28] 8189953: FileHandler constructor throws NoSuchFileException with absolute path Reviewed-by: mchung --- .../java/util/logging/FileHandler.java | 137 ++++++----- .../logging/FileHandlerPatternGeneration.java | 232 ++++++++++++++++++ 2 files changed, 309 insertions(+), 60 deletions(-) create mode 100644 test/jdk/java/util/logging/FileHandlerPatternGeneration.java diff --git a/src/java.logging/share/classes/java/util/logging/FileHandler.java b/src/java.logging/share/classes/java/util/logging/FileHandler.java index f7d2660b94c..d2c663e5fe3 100644 --- a/src/java.logging/share/classes/java/util/logging/FileHandler.java +++ b/src/java.logging/share/classes/java/util/logging/FileHandler.java @@ -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; } /** diff --git a/test/jdk/java/util/logging/FileHandlerPatternGeneration.java b/test/jdk/java/util/logging/FileHandlerPatternGeneration.java new file mode 100644 index 00000000000..1b0dc866cb7 --- /dev/null +++ b/test/jdk/java/util/logging/FileHandlerPatternGeneration.java @@ -0,0 +1,232 @@ +/* + * 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. + */ + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.security.*; +import java.util.*; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.logging.FileHandler; +import java.util.logging.LogManager; + +/** + * @test + * @bug 8189953 + * @summary tests the pattern generation algorithm + * @modules java.logging/java.util.logging:open + * @run main/othervm FileHandlerPatternGeneration + * @author danielfuchs + */ +public class FileHandlerPatternGeneration { + + /** + * An array of strings where the elements at even indices are the input + * to give to FileHandler::generate(pattern, count, generation, unique), + * and the elements at the next odd index are a partially computed expected + * output, where %t, %h, %u, %g and file separator still need to be replaced. + * The final expected output is obtained by passing the partially computed + * output to FileHandlerPatternGeneration::generateExpected + *

+ * The test verifies that {@code + * FileHandler.generate(PATTERN[i], c, g, u).toString() + * } + * is equal to {@code + * FileHandlerPatternGeneration.generateExpected(PATTERN[i], + * PATTERN[i+1], + * c, g, u) + * } + */ + static final String[] PATTERNS = { + "C:/Workspace/hoge.log", "C:/Workspace/hoge.log", + "C:/Workspace%g/hoge.log", "C:/Workspace%g/hoge.log", + "C:/%uWorkspace/hoge.log", "C:/%uWorkspace/hoge.log", + "C:/%uWorkspace%g/hoge.log", "C:/%uWorkspace%g/hoge.log", + "C:/Workspace/%ghoge.log", "C:/Workspace/%ghoge.log", + "C:/Workspace/%ghoge%u.log", "C:/Workspace/%ghoge%u.log", + "C:/Workspace-%g/hoge.log", "C:/Workspace-%g/hoge.log", + "C:/Work%hspace/hoge.log", "%h/space/hoge.log", + "C:/Works%tpace%g/hoge.log", "%t/pace%g/hoge.log", + "C:/%uWork%hspace/hoge.log", "%h/space/hoge.log", + "C:/%uWorkspace%g/%thoge.log", "%t/hoge.log", + "C:/Workspace/%g%h%%hoge.log", "%h/%%hoge.log", + "C:/Work%h%%hspace/hoge.log", "%h/%%hspace/hoge.log", + "C:/Works%t%%hpace%g/hoge.log", "%t/%%hpace%g/hoge.log", + "C:/%uWork%h%%tspace/hoge.log", "%h/%%tspace/hoge.log", + "C:/%uWorkspace%g/%t%%hoge.log", "%t/%%hoge.log", + "C:/Workspace/%g%h%%hoge.log", "%h/%%hoge.log", + "ahaha", "ahaha", + "ahaha/ahabe", "ahaha/ahabe", + "../ahaha/ahabe", "../ahaha/ahabe", + "/x%ty/w/hoge.log", "%t/y/w/hoge.log", + "/x/%ty/w/hoge.log", "%t/y/w/hoge.log", + "/x%t/y/w/hoge.log", "%t/y/w/hoge.log", + "/x/%t/y/w/hoge.log", "%t/y/w/hoge.log", + "%ty/w/hoge.log", "%t/y/w/hoge.log", + "%t/y/w/hoge.log", "%t/y/w/hoge.log", + "/x%hy/w/hoge.log", "%h/y/w/hoge.log", + "/x/%hy/w/hoge.log", "%h/y/w/hoge.log", + "/x%h/y/w/hoge.log", "%h/y/w/hoge.log", + "/x/%h/y/w/hoge.log", "%h/y/w/hoge.log", + "%hy/w/hoge.log", "%h/y/w/hoge.log", + "%h/y/w/hoge.log", "%h/y/w/hoge.log", + "ahaha-%u-%g", "ahaha-%u-%g", + "ahaha-%g/ahabe-%u", "ahaha-%g/ahabe-%u", + "../ahaha-%u/ahabe", "../ahaha-%u/ahabe", + "/x%ty/w/hoge-%g.log", "%t/y/w/hoge-%g.log", + "/x/%ty/w/hoge-%u.log", "%t/y/w/hoge-%u.log", + "%u-%g/x%t/y/w/hoge.log", "%t/y/w/hoge.log", + "/x/%g%t%u/y/w/hoge.log", "%t/%u/y/w/hoge.log", + "%ty/w-%g/hoge.log", "%t/y/w-%g/hoge.log", + "%t/y/w-%u/hoge.log", "%t/y/w-%u/hoge.log", + "/x%hy/%u-%g-w/hoge.log", "%h/y/%u-%g-w/hoge.log", + "/x/%hy/w-%u-%g/hoge.log", "%h/y/w-%u-%g/hoge.log", + "/x%h/y/w/%u-%ghoge.log", "%h/y/w/%u-%ghoge.log", + "/x/%h/y/w/hoge-%u-%g.log", "%h/y/w/hoge-%u-%g.log", + "%hy/w/%u-%g-hoge.log", "%h/y/w/%u-%g-hoge.log", + "%h/y/w/hoge-%u-%g.log", "%h/y/w/hoge-%u-%g.log", + "/x/y/z/hoge-%u.log", "/x/y/z/hoge-%u.log", + }; + + // the (count, generation, unique) parameters to pass to + // FileHandler.generate(pattern, count, generation, unique) + static final int[][] GENERATIONS = { + {0, 0, 0}, + {0, 1, 0}, + {0, 1, 1}, + {1, 1, 0}, + {1, 1, 1}, + {1, 1, 2}, + {1, 2, 3}, + {3, 4, 0}, + {3, 4, 1}, + {3, 4, 2}, + {3, 0, 5}, + {3, 1, 5}, + {3, 2, 5}, + }; + + static final Class FILE_HANDLER_CLASS = FileHandler.class; + static final Method GENERATE; + static final String USER_HOME; + static final String TMP; + static { + Method generate; + try { + generate = FILE_HANDLER_CLASS.getDeclaredMethod("generate", + String.class, + int.class, + int.class, + int.class); + generate.setAccessible(true); + } catch (Exception e) { + throw new ExceptionInInitializerError(e); + } + GENERATE = generate; + USER_HOME = System.getProperty("user.home"); + TMP = System.getProperty("java.io.tmpdir", USER_HOME); + } + + public static void main(String... args) throws Throwable { + + for (int i=0; i < PATTERNS.length; i+=2) { + String s = PATTERNS[i]; + String partial = PATTERNS[i+1]; + System.out.println("generate: " + s); + for (int[] gen : GENERATIONS) { + String expected = generateExpected(s, partial, gen[0], gen[1], gen[2]); + String output = generate(s, gen[0], gen[1], gen[2]).toString(); + System.out.println("\t" + Arrays.toString(gen)+ ": " + output); + if (!expected.equals(output)) { + throw new RuntimeException("test failed for \"" + + s +"\" " + Arrays.toString(gen) + ": " + + "\n\tgenerated: \"" + output +"\"" + + "\n\t expected: \"" + expected +"\""); + } + } + } + + } + + // Strip the trailing separator from the string, if present + static String stripTrailingSeparator(String s) { + if (s.endsWith("/")) { + return s.substring(0, s.length() -1); + } else if (s.endsWith(File.separator)) { + return s.substring(0, s.length() - File.separator.length()); + } else { + return s; + } + } + + /** + * Compute the final expected output from a partially computed output found + * at PATTERNS[i+1] + * @param s The pattern string, found at PATTERN[i] + * (with i % 2 == 0) + * @param partial The partially computed output, found at PATTERN[i+1] + * @param count The count parameter given to FileHandler::generate + * @param generation The generation parameter given to FileHandler::generate + * @param unique The unique parameter given to FileHandler::generate + * @return The expected output that FileHandler.generate(s, count, gen, unique) + * should produce. + */ + static String generateExpected(String s, String partial, + int count, int generation, int unique) + { + boolean sawu = s.replace("%%", "$$$$").contains("%u"); + boolean sawg = s.replace("%%", "$$$$").contains("%g"); + String result = partial.replace("%%", "$$$$"); + String tmp = stripTrailingSeparator(TMP); + String home = stripTrailingSeparator(USER_HOME); + result = result.replace("%h", home); + result = result.replace("%t", tmp); + result = result.replace("%g", String.valueOf(generation)); + result = result.replace("%u", String.valueOf(unique)); + result = result.replace("$$$$", "%"); + result = result.replace("/", File.separator); + if (count > 1 && !sawg) { + result = result + "." + generation; + } + if (unique > 0 && !sawu) { + result = result + "." + unique; + } + return result; + } + + // Calls FileHandler.generate(s, count, generation, unique) through reflection + static File generate(String s, int count, int generation, int unique) + throws Throwable + { + try { + return (File) GENERATE.invoke(null, s, count, generation, unique); + } catch (InvocationTargetException e) { + throw e.getCause(); + } + } +} From 1ca74d0d2eef6e5cc9eb9d45f07e1ccb47084fb8 Mon Sep 17 00:00:00 2001 From: Brian Burkhalter Date: Thu, 9 Nov 2017 13:30:03 -0800 Subject: [PATCH 04/28] 8191025: (ch) Scattering reads to a subsequence of buffers ignores length Use length parameter instead of the buffer array length Reviewed-by: rriggs, alanb --- .../share/classes/sun/nio/ch/IOUtil.java | 2 +- .../nio/channels/SocketChannel/VectorIO.java | 26 +++++++++++++++++-- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/src/java.base/share/classes/sun/nio/ch/IOUtil.java b/src/java.base/share/classes/sun/nio/ch/IOUtil.java index d60f3a7a03c..cb30ca32efe 100644 --- a/src/java.base/share/classes/sun/nio/ch/IOUtil.java +++ b/src/java.base/share/classes/sun/nio/ch/IOUtil.java @@ -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, diff --git a/test/jdk/java/nio/channels/SocketChannel/VectorIO.java b/test/jdk/java/nio/channels/SocketChannel/VectorIO.java index 4e5f17d27c8..4bf66411f52 100644 --- a/test/jdk/java/nio/channels/SocketChannel/VectorIO.java +++ b/test/jdk/java/nio/channels/SocketChannel/VectorIO.java @@ -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) { From f2eb80c063e8418f792898735da174f55b598477 Mon Sep 17 00:00:00 2001 From: Doug Lea Date: Thu, 9 Nov 2017 16:03:37 -0800 Subject: [PATCH 05/28] 8190747: ExecutorService/Invoke.java fails intermittently Reviewed-by: martin, psandoz, dholmes --- .../java/util/concurrent/ExecutorService/Invoke.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/jdk/java/util/concurrent/ExecutorService/Invoke.java b/test/jdk/java/util/concurrent/ExecutorService/Invoke.java index 6e9ee7e82ee..918c9acdde0 100644 --- a/test/jdk/java/util/concurrent/ExecutorService/Invoke.java +++ b/test/jdk/java/util/concurrent/ExecutorService/Invoke.java @@ -35,6 +35,7 @@ import java.util.List; import java.util.stream.Collectors; import java.util.stream.IntStream; import java.util.concurrent.Callable; +import java.util.concurrent.CountDownLatch; import java.util.concurrent.CyclicBarrier; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; @@ -140,13 +141,17 @@ public class Invoke { final boolean timed = rnd.nextBoolean(); final ExecutorService pool = Executors.newSingleThreadExecutor(); final AtomicLong count = new AtomicLong(0); + final CountDownLatch invokeAnyDone = new CountDownLatch(1); class Task implements Callable { public Long call() throws Exception { long x = count.incrementAndGet(); check(x <= 2); - if (x == 2) - // wait for main thread to interrupt us + if (x == 2) { + // wait for main thread to interrupt us ... awaitInterrupt(timeoutSeconds); + // ... and then for invokeAny to return + check(invokeAnyDone.await(timeoutSeconds, SECONDS)); + } return x; } } @@ -166,6 +171,7 @@ public class Invoke { else val = pool.invokeAny(tasks); check(val == 1); + invokeAnyDone.countDown(); // inherent race between main thread interrupt and // start of second task From 42ad4ec2ddf778aec840a21c762327f853153054 Mon Sep 17 00:00:00 2001 From: Doug Lea Date: Thu, 9 Nov 2017 16:07:21 -0800 Subject: [PATCH 06/28] 8179314: CountedCompleterTest.testForkHelpQuiesce fails with expected:<21> but was:<13> Reviewed-by: martin, psandoz, dholmes --- test/jdk/java/util/concurrent/tck/CountedCompleterTest.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/jdk/java/util/concurrent/tck/CountedCompleterTest.java b/test/jdk/java/util/concurrent/tck/CountedCompleterTest.java index d2aa5ec53f3..1ed37669f96 100644 --- a/test/jdk/java/util/concurrent/tck/CountedCompleterTest.java +++ b/test/jdk/java/util/concurrent/tck/CountedCompleterTest.java @@ -758,6 +758,8 @@ public class CountedCompleterTest extends JSR166TestCase { CCF f = new LCCF(8); assertSame(f, f.fork()); helpQuiesce(); + while (!f.isDone()) // wait out race + ; assertEquals(21, f.number); assertEquals(0, getQueuedTaskCount()); checkCompletedNormally(f); From e2cbace23d9ec6b46417511b1f671a13912b701a Mon Sep 17 00:00:00 2001 From: Doug Lea Date: Thu, 9 Nov 2017 16:10:46 -0800 Subject: [PATCH 07/28] 8189387: ConcurrentLinkedDeque linearizability continued .. Reviewed-by: martin, psandoz, dholmes --- .../concurrent/ConcurrentLinkedDeque.java | 51 +++++++------ .../tck/ConcurrentLinkedDequeTest.java | 73 +++++++++++++------ 2 files changed, 80 insertions(+), 44 deletions(-) diff --git a/src/java.base/share/classes/java/util/concurrent/ConcurrentLinkedDeque.java b/src/java.base/share/classes/java/util/concurrent/ConcurrentLinkedDeque.java index 3885370dbc9..64b6bf1fa80 100644 --- a/src/java.base/share/classes/java/util/concurrent/ConcurrentLinkedDeque.java +++ b/src/java.base/share/classes/java/util/concurrent/ConcurrentLinkedDeque.java @@ -695,8 +695,9 @@ public class ConcurrentLinkedDeque * stale pointer that is now off the list. */ final Node pred(Node p) { - Node q = p.prev; - return (p == q) ? last() : q; + if (p == (p = p.prev)) + p = last(); + return p; } /** @@ -867,31 +868,31 @@ public class ConcurrentLinkedDeque public E peekFirst() { restart: for (;;) { - for (Node 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 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 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 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 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 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; + } } } } diff --git a/test/jdk/java/util/concurrent/tck/ConcurrentLinkedDequeTest.java b/test/jdk/java/util/concurrent/tck/ConcurrentLinkedDequeTest.java index ad17d9b01aa..5431db36039 100644 --- a/test/jdk/java/util/concurrent/tck/ConcurrentLinkedDequeTest.java +++ b/test/jdk/java/util/concurrent/tck/ConcurrentLinkedDequeTest.java @@ -936,6 +936,14 @@ public class ConcurrentLinkedDequeTest extends JSR166TestCase { } } + void runAsync(Runnable r1, Runnable r2) { + boolean b = ThreadLocalRandom.current().nextBoolean(); + CompletableFuture f1 = CompletableFuture.runAsync(b ? r1 : r2); + CompletableFuture f2 = CompletableFuture.runAsync(b ? r2 : r1); + f1.join(); + f2.join(); + } + /** * Non-traversing Deque operations are linearizable. * https://bugs.openjdk.java.net/browse/JDK-8188900 @@ -959,18 +967,9 @@ public class ConcurrentLinkedDequeTest extends JSR166TestCase { x, nulls.sum(), zeros.sum())); }; - Runnable adder = () -> { - d.addFirst(0); - d.addLast(42); - }; + Runnable adder = () -> { d.addFirst(0); d.addLast(42); }; - boolean b = rnd.nextBoolean(); - Runnable r1 = b ? getter : adder; - Runnable r2 = b ? adder : getter; - CompletableFuture f1 = CompletableFuture.runAsync(r1); - CompletableFuture f2 = CompletableFuture.runAsync(r2); - f1.join(); - f2.join(); + runAsync(getter, adder); } } @@ -995,18 +994,48 @@ public class ConcurrentLinkedDequeTest extends JSR166TestCase { x, nulls.sum(), zeros.sum())); }; - Runnable adder = () -> { - d.addLast(0); - d.addFirst(42); - }; + Runnable adder = () -> { d.addLast(0); d.addFirst(42); }; - boolean b = rnd.nextBoolean(); - Runnable r1 = b ? getter : adder; - Runnable r2 = b ? adder : getter; - CompletableFuture f1 = CompletableFuture.runAsync(r1); - CompletableFuture f2 = CompletableFuture.runAsync(r2); - f1.join(); - f2.join(); + runAsync(getter, adder); + } + } + + T chooseRandomly(T... choices) { + return choices[ThreadLocalRandom.current().nextInt(choices.length)]; + } + + /** + * Non-traversing Deque operations (that return null) are linearizable. + * Don't return null when the deque is observably never empty. + * https://bugs.openjdk.java.net/browse/JDK-8189387 + * ant -Djsr166.expensiveTests=true -Djsr166.tckTestClass=ConcurrentLinkedDequeTest -Djsr166.methodFilter=testBug8189387 tck + */ + public void testBug8189387() { + final ThreadLocalRandom rnd = ThreadLocalRandom.current(); + Object x = new Object(); + for (int n = expensiveTests ? 100_000 : 10; n--> 0; ) { + ConcurrentLinkedDeque d = new ConcurrentLinkedDeque<>(); + Runnable add = chooseRandomly( + () -> d.addFirst(x), + () -> d.offerFirst(x), + () -> d.addLast(x), + () -> d.offerLast(x)); + + Runnable get = chooseRandomly( + () -> assertFalse(d.isEmpty()), + () -> assertSame(x, d.peekFirst()), + () -> assertSame(x, d.peekLast()), + () -> assertSame(x, d.pollFirst()), + () -> assertSame(x, d.pollLast())); + + Runnable addRemove = chooseRandomly( + () -> { d.addFirst(x); d.pollLast(); }, + () -> { d.offerFirst(x); d.removeFirst(); }, + () -> { d.offerLast(x); d.removeLast(); }, + () -> { d.addLast(x); d.pollFirst(); }); + + add.run(); + runAsync(get, addRemove); } } } From 5d5334f3052b4010f953ae89a59f9b7ed17784f1 Mon Sep 17 00:00:00 2001 From: Doug Lea Date: Thu, 9 Nov 2017 16:14:45 -0800 Subject: [PATCH 08/28] 8189764: Miscellaneous changes imported from jsr166 CVS 2017-11 Reviewed-by: martin, psandoz, dholmes --- .../util/AbstractList/FailFastIterator.java | 2 +- .../util/AbstractSequentialList/AddAll.java | 2 +- .../Collection/IteratorMicroBenchmark.java | 2 +- test/jdk/java/util/Collection/MOAT.java | 10 +- .../util/Collection/RemoveMicroBenchmark.java | 2 +- test/jdk/java/util/Collections/AddAll.java | 2 +- .../BinarySearchNullComparator.java | 2 +- .../util/Collections/CheckedListBash.java | 7 +- .../java/util/Collections/CheckedMapBash.java | 1 - .../java/util/Collections/CheckedSetBash.java | 5 +- test/jdk/java/util/Collections/Disjoint.java | 2 +- .../util/Collections/EmptyNavigableMap.java | 2 +- .../util/Collections/EmptyNavigableSet.java | 2 +- test/jdk/java/util/Collections/Enum.java | 2 +- .../java/util/Collections/FindSubList.java | 22 +- test/jdk/java/util/Collections/Frequency.java | 2 +- .../java/util/Collections/NullComparator.java | 4 +- .../jdk/java/util/Collections/ReplaceAll.java | 4 +- test/jdk/java/util/Collections/Rotate.java | 4 +- .../java/util/Collections/RotateEmpty.java | 2 +- test/jdk/java/util/Collections/Ser.java | 2 +- test/jdk/java/util/Collections/Swap.java | 2 +- test/jdk/java/util/Collections/ViewSynch.java | 2 +- .../java/util/Collections/WrappedNull.java | 268 +++++++++--------- test/jdk/java/util/HashMap/KeySetRemove.java | 6 +- test/jdk/java/util/HashMap/SetValue.java | 4 +- test/jdk/java/util/HashMap/ToString.java | 2 +- test/jdk/java/util/Hashtable/EqualsCast.java | 2 +- test/jdk/java/util/Hashtable/HashCode.java | 2 +- .../util/Hashtable/IllegalLoadFactor.java | 175 ++++++------ test/jdk/java/util/Hashtable/SelfRef.java | 2 +- test/jdk/java/util/LinkedHashMap/Basic.java | 2 +- test/jdk/java/util/LinkedHashMap/Cache.java | 2 +- .../util/LinkedHashMap/EmptyMapIterator.java | 4 +- test/jdk/java/util/LinkedHashSet/Basic.java | 7 +- test/jdk/java/util/LinkedList/AddAll.java | 2 +- test/jdk/java/util/NavigableMap/LockStep.java | 10 +- .../util/Random/NextIntPowerOfTwoMod.java | 2 +- .../java/util/TreeMap/HeadTailTypeError.java | 2 +- test/jdk/java/util/TreeMap/SubMap.java | 2 +- test/jdk/java/util/TreeMap/SubMapClear.java | 2 +- .../util/Vector/IllegalConstructorArgs.java | 8 +- test/jdk/java/util/Vector/LastIndexOf.java | 2 +- .../jdk/java/util/Vector/SyncLastIndexOf.java | 2 +- .../java/util/WeakHashMap/ZeroInitCap.java | 4 +- .../concurrent/ConcurrentHashMap/ToArray.java | 2 +- .../util/concurrent/CountDownLatch/Basic.java | 6 +- .../FlakyThreadFactory.java | 14 +- .../concurrent/locks/Lock/FlakyMutex.java | 1 + .../util/concurrent/tck/NonNestmates.java | 1 - .../tck/SubmissionPublisherTest.java | 5 +- 51 files changed, 315 insertions(+), 313 deletions(-) diff --git a/test/jdk/java/util/AbstractList/FailFastIterator.java b/test/jdk/java/util/AbstractList/FailFastIterator.java index 2fd77e79e29..6d13a7c5f8f 100644 --- a/test/jdk/java/util/AbstractList/FailFastIterator.java +++ b/test/jdk/java/util/AbstractList/FailFastIterator.java @@ -21,7 +21,7 @@ * questions. */ -/** +/* * @test * @bug 4189896 * @summary AbstractList iterators previously checked for co-modification diff --git a/test/jdk/java/util/AbstractSequentialList/AddAll.java b/test/jdk/java/util/AbstractSequentialList/AddAll.java index a2e753530d7..e21d8c3c989 100644 --- a/test/jdk/java/util/AbstractSequentialList/AddAll.java +++ b/test/jdk/java/util/AbstractSequentialList/AddAll.java @@ -21,7 +21,7 @@ * questions. */ -/** +/* * @test * @bug 4295163 * @summary AddAll(int, Collection) intersperses the Collection with this List. diff --git a/test/jdk/java/util/Collection/IteratorMicroBenchmark.java b/test/jdk/java/util/Collection/IteratorMicroBenchmark.java index 742fb09ec4f..dfe4f1f65cc 100644 --- a/test/jdk/java/util/Collection/IteratorMicroBenchmark.java +++ b/test/jdk/java/util/Collection/IteratorMicroBenchmark.java @@ -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) diff --git a/test/jdk/java/util/Collection/MOAT.java b/test/jdk/java/util/Collection/MOAT.java index 2f89b2ddd1d..b250759939f 100644 --- a/test/jdk/java/util/Collection/MOAT.java +++ b/test/jdk/java/util/Collection/MOAT.java @@ -1584,11 +1584,11 @@ public class MOAT { } interface Fun {void f() throws Throwable;} private static void THROWS(Class 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(); diff --git a/test/jdk/java/util/Collection/RemoveMicroBenchmark.java b/test/jdk/java/util/Collection/RemoveMicroBenchmark.java index 6cff3ae8126..c6eb8956827 100644 --- a/test/jdk/java/util/Collection/RemoveMicroBenchmark.java +++ b/test/jdk/java/util/Collection/RemoveMicroBenchmark.java @@ -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) diff --git a/test/jdk/java/util/Collections/AddAll.java b/test/jdk/java/util/Collections/AddAll.java index 254e3d16b51..c1b33272ba5 100644 --- a/test/jdk/java/util/Collections/AddAll.java +++ b/test/jdk/java/util/Collections/AddAll.java @@ -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()); test(new LinkedList()); test(new HashSet()); diff --git a/test/jdk/java/util/Collections/BinarySearchNullComparator.java b/test/jdk/java/util/Collections/BinarySearchNullComparator.java index 1e7e5aa5e1d..436747987ec 100644 --- a/test/jdk/java/util/Collections/BinarySearchNullComparator.java +++ b/test/jdk/java/util/Collections/BinarySearchNullComparator.java @@ -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); diff --git a/test/jdk/java/util/Collections/CheckedListBash.java b/test/jdk/java/util/Collections/CheckedListBash.java index 55ff7163158..9dc92ba01d8 100644 --- a/test/jdk/java/util/Collections/CheckedListBash.java +++ b/test/jdk/java/util/Collections/CheckedListBash.java @@ -209,15 +209,14 @@ public class CheckedListBash { } static void AddRandoms(List s, int n) { - for (int i=0; i void assertInstance(T actual, Class expected) { - assertInstance(expected.isInstance(actual), null); + assertInstance(actual, expected, null); } public static void assertInstance(T actual, Class expected, String message) { diff --git a/test/jdk/java/util/Collections/EmptyNavigableSet.java b/test/jdk/java/util/Collections/EmptyNavigableSet.java index 7ee13b80c1e..c9ca5026a0b 100644 --- a/test/jdk/java/util/Collections/EmptyNavigableSet.java +++ b/test/jdk/java/util/Collections/EmptyNavigableSet.java @@ -50,7 +50,7 @@ import static org.testng.Assert.assertTrue; public class EmptyNavigableSet { public static void assertInstance(T actual, Class expected) { - assertInstance(expected.isInstance(actual), null); + assertInstance(actual, expected, null); } public static void assertInstance(T actual, Class expected, String message) { diff --git a/test/jdk/java/util/Collections/Enum.java b/test/jdk/java/util/Collections/Enum.java index 234a3f587db..a3784a06228 100644 --- a/test/jdk/java/util/Collections/Enum.java +++ b/test/jdk/java/util/Collections/Enum.java @@ -21,7 +21,7 @@ * questions. */ -/** +/* * @test * @bug 4323074 * @summary Basic test for new Enumeration -> List converter diff --git a/test/jdk/java/util/Collections/FindSubList.java b/test/jdk/java/util/Collections/FindSubList.java index 5aa97e9e09d..48ad2428fca 100644 --- a/test/jdk/java/util/Collections/FindSubList.java +++ b/test/jdk/java/util/Collections/FindSubList.java @@ -21,7 +21,7 @@ * questions. */ -/** +/* * @test * @bug 4323074 * @summary Basic test for Collections.indexOfSubList/lastIndexOfSubList @@ -33,8 +33,8 @@ public class FindSubList { public static void main(String[] args) throws Exception { int N = 500; List source = new ArrayList(3 * N); - List target[]= new List[N+1]; - int index[] = new int[N+1]; + List[] target = new List[N+1]; + int[] index = new int[N+1]; for (int i=0; i<=N; i++) { List t = new ArrayList(); String s = Integer.toString(i, 2); @@ -50,8 +50,12 @@ public class FindSubList { } } - List src[] = {source, new LinkedList(source), new Vector(source), - Arrays.asList(source.toArray())}; + List[] src = { + source, + new LinkedList(source), + new Vector(source), + Arrays.asList(source.toArray()) + }; for (int j=0; j()); test(new LinkedList()); } diff --git a/test/jdk/java/util/Collections/NullComparator.java b/test/jdk/java/util/Collections/NullComparator.java index 5b671ac6269..2efb5b46ed3 100644 --- a/test/jdk/java/util/Collections/NullComparator.java +++ b/test/jdk/java/util/Collections/NullComparator.java @@ -21,7 +21,7 @@ * questions. */ -/** +/* * @test * @bug 4224271 * @summary A null Comparator is now specified to indicate natural ordering. @@ -37,7 +37,7 @@ public class NullComparator { List sorted = new ArrayList(list); Collections.shuffle(list); - Object a[] = list.toArray(); + Object[] a = list.toArray(); Arrays.sort(a, null); if (!Arrays.asList(a).equals(sorted)) throw new Exception("Arrays.sort"); diff --git a/test/jdk/java/util/Collections/ReplaceAll.java b/test/jdk/java/util/Collections/ReplaceAll.java index 24ca0d602f2..1ce61071378 100644 --- a/test/jdk/java/util/Collections/ReplaceAll.java +++ b/test/jdk/java/util/Collections/ReplaceAll.java @@ -21,7 +21,7 @@ * questions. */ -/** +/* * @test * @bug 4323074 * @summary Basic test for new replaceAll algorithm @@ -33,7 +33,7 @@ public class ReplaceAll { static final int SIZE = 20; public static void main(String[] args) throws Exception { - List a[] = {new ArrayList(), new LinkedList(), new Vector()}; + List[] a = {new ArrayList(), new LinkedList(), new Vector()}; for (int i=0; i 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(); diff --git a/test/jdk/java/util/Random/NextIntPowerOfTwoMod.java b/test/jdk/java/util/Random/NextIntPowerOfTwoMod.java index 1fe375ee774..f822b4f4246 100644 --- a/test/jdk/java/util/Random/NextIntPowerOfTwoMod.java +++ b/test/jdk/java/util/Random/NextIntPowerOfTwoMod.java @@ -21,7 +21,7 @@ * questions. */ -/** +/* * @test * @bug 4187412 * @summary The FCS release of 1.2 did not special case the Random.nextInt diff --git a/test/jdk/java/util/TreeMap/HeadTailTypeError.java b/test/jdk/java/util/TreeMap/HeadTailTypeError.java index 88d5ed814bf..69f378dcd4f 100644 --- a/test/jdk/java/util/TreeMap/HeadTailTypeError.java +++ b/test/jdk/java/util/TreeMap/HeadTailTypeError.java @@ -31,7 +31,7 @@ import java.util.*; public class HeadTailTypeError { - public static void main(String argv[]) throws Exception { + public static void main(String[] args) throws Exception { try { SortedMap m = new TreeMap(); m.headMap(new Object()); diff --git a/test/jdk/java/util/TreeMap/SubMap.java b/test/jdk/java/util/TreeMap/SubMap.java index 95d0c75f69b..6dcd211a4e5 100644 --- a/test/jdk/java/util/TreeMap/SubMap.java +++ b/test/jdk/java/util/TreeMap/SubMap.java @@ -30,7 +30,7 @@ import java.util.*; public class SubMap { - public static void main(String args[]) throws Exception { + public static void main(String[] args) throws Exception { SortedMap m = new TreeMap(); m.put(new Integer(1), new Integer(1)); m.put(new Integer(2), new Integer(2)); diff --git a/test/jdk/java/util/TreeMap/SubMapClear.java b/test/jdk/java/util/TreeMap/SubMapClear.java index 89ccbeddf9a..95d611df0e3 100644 --- a/test/jdk/java/util/TreeMap/SubMapClear.java +++ b/test/jdk/java/util/TreeMap/SubMapClear.java @@ -39,7 +39,7 @@ public class SubMapClear { Set subSet = treeSet.subSet(new Integer(4),new Integer(10)); subSet.clear(); // Used to throw exception - int a[] = new int[] {1, 2, 3, 10}; + int[] a = { 1, 2, 3, 10 }; Set s = new TreeSet(); for (int i = 0; i < a.length; i++) s.add(new Integer(a[i])); diff --git a/test/jdk/java/util/Vector/IllegalConstructorArgs.java b/test/jdk/java/util/Vector/IllegalConstructorArgs.java index 7f9be9d093a..bfce2ca072f 100644 --- a/test/jdk/java/util/Vector/IllegalConstructorArgs.java +++ b/test/jdk/java/util/Vector/IllegalConstructorArgs.java @@ -36,12 +36,12 @@ import java.util.*; */ public class IllegalConstructorArgs { - public static void main(String argv[]) { - int testSucceeded=0; + public static void main(String[] args) { + int testSucceeded=0; try { - // this should generate an IllegalArgumentException - Vector bad1 = new Vector(-100, 10); + // this should generate an IllegalArgumentException + Vector bad1 = new Vector(-100, 10); } catch (IllegalArgumentException e1) { testSucceeded =1; diff --git a/test/jdk/java/util/Vector/LastIndexOf.java b/test/jdk/java/util/Vector/LastIndexOf.java index 1a783bd2093..67e8ac338cf 100644 --- a/test/jdk/java/util/Vector/LastIndexOf.java +++ b/test/jdk/java/util/Vector/LastIndexOf.java @@ -31,7 +31,7 @@ import java.util.*; public class LastIndexOf { - public static void main(String argv[]) throws Exception { + public static void main(String[] args) throws Exception { Vector v = new Vector(10); try { diff --git a/test/jdk/java/util/Vector/SyncLastIndexOf.java b/test/jdk/java/util/Vector/SyncLastIndexOf.java index 18616e7c5e7..8f18fe7062a 100644 --- a/test/jdk/java/util/Vector/SyncLastIndexOf.java +++ b/test/jdk/java/util/Vector/SyncLastIndexOf.java @@ -46,7 +46,7 @@ public class SyncLastIndexOf { } } - public static void main(String args[]) { + public static void main(String[] args) { Integer x = new Integer(1); v.addElement(x); new RemovingThread().start(); diff --git a/test/jdk/java/util/WeakHashMap/ZeroInitCap.java b/test/jdk/java/util/WeakHashMap/ZeroInitCap.java index 099d51bcfb3..618b89ee5a7 100644 --- a/test/jdk/java/util/WeakHashMap/ZeroInitCap.java +++ b/test/jdk/java/util/WeakHashMap/ZeroInitCap.java @@ -23,7 +23,7 @@ import java.util.*; -/** +/* * @test * @bug 4503146 * @summary Zero initial capacity should be legal @@ -31,7 +31,7 @@ import java.util.*; */ public class ZeroInitCap { - public static void main(String[] argv) { + public static void main(String[] args) { Map map = new WeakHashMap(0); map.put("a","b"); } diff --git a/test/jdk/java/util/concurrent/ConcurrentHashMap/ToArray.java b/test/jdk/java/util/concurrent/ConcurrentHashMap/ToArray.java index dca07084162..a200d47b5dc 100644 --- a/test/jdk/java/util/concurrent/ConcurrentHashMap/ToArray.java +++ b/test/jdk/java/util/concurrent/ConcurrentHashMap/ToArray.java @@ -43,7 +43,7 @@ public class ToArray { } static void executeTest() throws Throwable { - final Throwable throwable[] = new Throwable[1]; + final Throwable[] throwable = new Throwable[1]; final ConcurrentHashMap m = new ConcurrentHashMap<>(); // Number of workers equal to the number of processors diff --git a/test/jdk/java/util/concurrent/CountDownLatch/Basic.java b/test/jdk/java/util/concurrent/CountDownLatch/Basic.java index 1553bb85e0b..61fa4776784 100644 --- a/test/jdk/java/util/concurrent/CountDownLatch/Basic.java +++ b/test/jdk/java/util/concurrent/CountDownLatch/Basic.java @@ -96,7 +96,7 @@ public class Basic { int count = 0; Basic test = new Basic(); CountDownLatch latch = new CountDownLatch(3); - Awaiter a[] = new Awaiter[12]; + Awaiter[] a = new Awaiter[12]; for (int i = 0; i < 3; i++) { CountDownLatch gate = new CountDownLatch(4); @@ -125,7 +125,7 @@ public class Basic { int count = 0; Basic test = new Basic(); CountDownLatch latch = new CountDownLatch(3); - Awaiter a[] = new Awaiter[12]; + Awaiter[] a = new Awaiter[12]; for (int i = 0; i < 3; i++) { CountDownLatch gate = new CountDownLatch(4); @@ -156,7 +156,7 @@ public class Basic { int count =0; Basic test = new Basic(); CountDownLatch latch = new CountDownLatch(3); - Awaiter a[] = new Awaiter[12]; + Awaiter[] a = new Awaiter[12]; long[] timeout = { 0L, 5L, 10L }; diff --git a/test/jdk/java/util/concurrent/ThreadPoolExecutor/FlakyThreadFactory.java b/test/jdk/java/util/concurrent/ThreadPoolExecutor/FlakyThreadFactory.java index bb327e817c2..df30367f59a 100644 --- a/test/jdk/java/util/concurrent/ThreadPoolExecutor/FlakyThreadFactory.java +++ b/test/jdk/java/util/concurrent/ThreadPoolExecutor/FlakyThreadFactory.java @@ -57,12 +57,14 @@ public class FlakyThreadFactory { }}); test(OutOfMemoryError.class, new ThreadFactory() { - public Thread newThread(Runnable r) { - new Thread(null, r, "a natural OOME", 1L << 60); - // """On some platforms, the value of the stackSize - // parameter may have no effect whatsoever.""" - throw new OutOfMemoryError("artificial OOME"); - }}); + @SuppressWarnings("DeadThread") + public Thread newThread(Runnable r) { + // We expect this to throw OOME, but ... + new Thread(null, r, "a natural OOME", 1L << 60); + // """On some platforms, the value of the stackSize + // parameter may have no effect whatsoever.""" + throw new OutOfMemoryError("artificial OOME"); + }}); test(null, new ThreadFactory() { public Thread newThread(Runnable r) { diff --git a/test/jdk/java/util/concurrent/locks/Lock/FlakyMutex.java b/test/jdk/java/util/concurrent/locks/Lock/FlakyMutex.java index 104091e2551..b85203c66ab 100644 --- a/test/jdk/java/util/concurrent/locks/Lock/FlakyMutex.java +++ b/test/jdk/java/util/concurrent/locks/Lock/FlakyMutex.java @@ -108,6 +108,7 @@ public class FlakyMutex implements Lock { case 0: throw new MyError(); case 1: throw new MyRuntimeException(); case 2: FlakyMutex.uncheckedThrow(new MyException()); + // fall through ... NOT! default: return compareAndSetState(0, 1); } } diff --git a/test/jdk/java/util/concurrent/tck/NonNestmates.java b/test/jdk/java/util/concurrent/tck/NonNestmates.java index 129aa9e27df..9aac8d31298 100644 --- a/test/jdk/java/util/concurrent/tck/NonNestmates.java +++ b/test/jdk/java/util/concurrent/tck/NonNestmates.java @@ -35,7 +35,6 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; import static org.junit.Assert.assertSame; import static org.junit.Assert.assertTrue; diff --git a/test/jdk/java/util/concurrent/tck/SubmissionPublisherTest.java b/test/jdk/java/util/concurrent/tck/SubmissionPublisherTest.java index 915cef8cdb8..337cd0e00cf 100644 --- a/test/jdk/java/util/concurrent/tck/SubmissionPublisherTest.java +++ b/test/jdk/java/util/concurrent/tck/SubmissionPublisherTest.java @@ -593,7 +593,7 @@ public class SubmissionPublisherTest extends JSR166TestCase { /** * estimateMinimumDemand reports 0 until request, nonzero after - * request, and zero again after delivery + * request */ public void testEstimateMinimumDemand() { TestSubscriber s = new TestSubscriber(); @@ -604,9 +604,6 @@ public class SubmissionPublisherTest extends JSR166TestCase { assertEquals(0, p.estimateMinimumDemand()); s.sn.request(1); assertEquals(1, p.estimateMinimumDemand()); - p.submit(1); - s.awaitNext(1); - assertEquals(0, p.estimateMinimumDemand()); } /** From a71d840954697562c841bafcdc4c732883d5855e Mon Sep 17 00:00:00 2001 From: Lana Steuck Date: Fri, 10 Nov 2017 03:26:50 +0000 Subject: [PATCH 09/28] Added tag jdk-10+31 for changeset e6278add9ff2 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 0ce6f1acaf9..58e232d224b 100644 --- a/.hgtags +++ b/.hgtags @@ -455,3 +455,4 @@ b87d7b5d5dedc1185e5929470f945b7378cdb3ad jdk-10+27 92f08900cb3c0d694e5c529a676c1c9e5909193f jdk-10+28 a6e591e12f122768f675428e1e5a838fd0e9c7ec jdk-10+29 8fee80b92e65149f7414250fd5e34b6f35d417b4 jdk-10+30 +e6278add9ff28fab70fe1cc4c1d65f7363dc9445 jdk-10+31 From 2245db7522ec8aa86fe7a6fcb2bc1c75fde35053 Mon Sep 17 00:00:00 2001 From: Vyom Tewari Date: Mon, 13 Nov 2017 14:03:36 +0530 Subject: [PATCH 10/28] 8145635: Add TCP_QUICKACK socket option Reviewed-by: chegar, rriggs, clanger --- make/lib/Lib-jdk.net.gmk | 25 ++++- make/mapfiles/libextnet/mapfile-linux | 33 +++++++ .../{mapfile-vers => mapfile-solaris} | 2 +- .../java/net/PlainDatagramSocketImpl.java | 12 ++- .../classes/jdk/net/LinuxSocketOptions.java | 64 ++++++++++++ .../native/libextnet/LinuxSocketOptions.c | 99 +++++++++++++++++++ .../jdk/net/ExtendedSocketOptions.java | 78 +++++++++++++-- .../share/classes/jdk/net/Sockets.java | 21 +++- test/jdk/jdk/net/Sockets/QuickAckTest.java | 74 ++++++++++++++ 9 files changed, 394 insertions(+), 14 deletions(-) create mode 100644 make/mapfiles/libextnet/mapfile-linux rename make/mapfiles/libextnet/{mapfile-vers => mapfile-solaris} (95%) create mode 100644 src/jdk.net/linux/classes/jdk/net/LinuxSocketOptions.java create mode 100644 src/jdk.net/linux/native/libextnet/LinuxSocketOptions.c create mode 100644 test/jdk/jdk/net/Sockets/QuickAckTest.java diff --git a/make/lib/Lib-jdk.net.gmk b/make/lib/Lib-jdk.net.gmk index b0859339f95..d1e35e82d4d 100644 --- a/make/lib/Lib-jdk.net.gmk +++ b/make/lib/Lib-jdk.net.gmk @@ -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 + + ################################################################################ diff --git a/make/mapfiles/libextnet/mapfile-linux b/make/mapfiles/libextnet/mapfile-linux new file mode 100644 index 00000000000..7e47c863824 --- /dev/null +++ b/make/mapfiles/libextnet/mapfile-linux @@ -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: + *; +}; diff --git a/make/mapfiles/libextnet/mapfile-vers b/make/mapfiles/libextnet/mapfile-solaris similarity index 95% rename from make/mapfiles/libextnet/mapfile-vers rename to make/mapfiles/libextnet/mapfile-solaris index 5dbc5b960aa..d43f9280c26 100644 --- a/make/mapfiles/libextnet/mapfile-vers +++ b/make/mapfiles/libextnet/mapfile-solaris @@ -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 diff --git a/src/java.base/unix/classes/java/net/PlainDatagramSocketImpl.java b/src/java.base/unix/classes/java/net/PlainDatagramSocketImpl.java index 32640dff272..22e96848050 100644 --- a/src/java.base/unix/classes/java/net/PlainDatagramSocketImpl.java +++ b/src/java.base/unix/classes/java/net/PlainDatagramSocketImpl.java @@ -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> supportedOptions() { HashSet> options = new HashSet<>(super.supportedOptions()); - options.addAll(extendedOptions.options()); + addExtSocketOptions(extendedOptions.options(), options); return options; } + private void addExtSocketOptions(Set> extOptions, + Set> 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)) { diff --git a/src/jdk.net/linux/classes/jdk/net/LinuxSocketOptions.java b/src/jdk.net/linux/classes/jdk/net/LinuxSocketOptions.java new file mode 100644 index 00000000000..353dd5e6b8c --- /dev/null +++ b/src/jdk.net/linux/classes/jdk/net/LinuxSocketOptions.java @@ -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) () -> { + System.loadLibrary("extnet"); + return null; + }); + } +} diff --git a/src/jdk.net/linux/native/libextnet/LinuxSocketOptions.c b/src/jdk.net/linux/native/libextnet/LinuxSocketOptions.c new file mode 100644 index 00000000000..2beee6a5290 --- /dev/null +++ b/src/jdk.net/linux/native/libextnet/LinuxSocketOptions.c @@ -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 +#include +#include +#include + +#include +#include +#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; +} diff --git a/src/jdk.net/share/classes/jdk/net/ExtendedSocketOptions.java b/src/jdk.net/share/classes/jdk/net/ExtendedSocketOptions.java index bcae6ce2251..784d018e3a3 100644 --- a/src/jdk.net/share/classes/jdk/net/ExtendedSocketOptions.java +++ b/src/jdk.net/share/classes/jdk/net/ExtendedSocketOptions.java @@ -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 SO_FLOW_SLA = new ExtSocketOption("SO_FLOW_SLA", SocketFlow.class); + /** + * Disable Delayed Acknowledgements. + * + *

+ * 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. + * + *

+ * 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 TCP_QUICKACK = + new ExtSocketOption("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> extendedOptions = options(); static Set> 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.>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; + } } } diff --git a/src/jdk.net/share/classes/jdk/net/Sockets.java b/src/jdk.net/share/classes/jdk/net/Sockets.java index 983fe38956f..b1d003da4ac 100644 --- a/src/jdk.net/share/classes/jdk/net/Sockets.java +++ b/src/jdk.net/share/classes/jdk/net/Sockets.java @@ -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> s = new Socket().supportedOptions(); + available = s.contains(ExtendedSocketOptions.TCP_QUICKACK); + } + } } diff --git a/test/jdk/jdk/net/Sockets/QuickAckTest.java b/test/jdk/jdk/net/Sockets/QuickAckTest.java new file mode 100644 index 00000000000..b1d9f899c24 --- /dev/null +++ b/test/jdk/jdk/net/Sockets/QuickAckTest.java @@ -0,0 +1,74 @@ +/* + * 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 + * @bug 8145635 + * @summary Add TCP_QUICKACK socket option + * @modules jdk.net + * @run main QuickAckTest + */ +import java.io.IOException; +import java.net.DatagramSocket; +import java.net.MulticastSocket; +import java.net.ServerSocket; +import java.net.Socket; +import jdk.net.ExtendedSocketOptions; +import jdk.net.Sockets; + +public class QuickAckTest { + + private static final String LOCAL_HOST = "127.0.0.1"; + + public static void main(String args[]) throws IOException { + + try (ServerSocket ss = new ServerSocket(0); + Socket s = new Socket(LOCAL_HOST, ss.getLocalPort()); + DatagramSocket ds = new DatagramSocket(0); + MulticastSocket mc = new MulticastSocket(0)) { + + if (ss.supportedOptions().contains(ExtendedSocketOptions.TCP_QUICKACK)) { + Sockets.setOption(ss, ExtendedSocketOptions.TCP_QUICKACK, true); + if (!ss.getOption(ExtendedSocketOptions.TCP_QUICKACK)) { + throw new RuntimeException("Test failed, TCP_QUICKACK should" + + " have been set"); + } + } + if (s.supportedOptions().contains(ExtendedSocketOptions.TCP_QUICKACK)) { + Sockets.setOption(s, ExtendedSocketOptions.TCP_QUICKACK, true); + if (!s.getOption(ExtendedSocketOptions.TCP_QUICKACK)) { + throw new RuntimeException("Test failed, TCP_QUICKACK should" + + " have been set"); + } + } + if (ds.supportedOptions().contains(ExtendedSocketOptions.TCP_QUICKACK)) { + throw new RuntimeException("Test failed, TCP_QUICKACK is applicable" + + " for TCP Sockets only."); + } + if (mc.supportedOptions().contains(ExtendedSocketOptions.TCP_QUICKACK)) { + throw new RuntimeException("Test failed, TCP_QUICKACK is applicable" + + " for TCP Sockets only"); + } + } + } +} From c9944644fd0cf304af6ba9a14fa72694848f2cc3 Mon Sep 17 00:00:00 2001 From: Priya Lakshmi Muthuswamy Date: Mon, 13 Nov 2017 15:54:20 +0100 Subject: [PATCH 11/28] 8190391: nashorn "!!" of nonzero even integer var becomes false when returned Reviewed-by: sundar, hannesw --- .../internal/codegen/types/IntType.java | 2 +- .../jdk/nashorn/internal/runtime/JSType.java | 14 +++++++ test/nashorn/script/basic/JDK-8190391.js | 37 +++++++++++++++++++ .../script/basic/JDK-8190391.js.EXPECTED | 3 ++ 4 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 test/nashorn/script/basic/JDK-8190391.js create mode 100644 test/nashorn/script/basic/JDK-8190391.js.EXPECTED diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/types/IntType.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/types/IntType.java index ffad71e4e5f..c5ee415d4d9 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/types/IntType.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/types/IntType.java @@ -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()) { diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/JSType.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/JSType.java index cdb360f6af1..eb0f67b0f43 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/JSType.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/JSType.java @@ -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 diff --git a/test/nashorn/script/basic/JDK-8190391.js b/test/nashorn/script/basic/JDK-8190391.js new file mode 100644 index 00000000000..7dc27bb3bb7 --- /dev/null +++ b/test/nashorn/script/basic/JDK-8190391.js @@ -0,0 +1,37 @@ +/* + * 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. + */ + +/** + * JDK-8190391 : nashorn: "!!" of nonzero even integer var becomes false when returned + * + * @test + * @run + */ + + +function func(x){ + return !!x; +} +print(func(0)); +print(func(2)); +print(func(3)); diff --git a/test/nashorn/script/basic/JDK-8190391.js.EXPECTED b/test/nashorn/script/basic/JDK-8190391.js.EXPECTED new file mode 100644 index 00000000000..dac32ecf1d7 --- /dev/null +++ b/test/nashorn/script/basic/JDK-8190391.js.EXPECTED @@ -0,0 +1,3 @@ +false +true +true From 50547a87343a124c5c7880d25e5dd80231ee4c8f Mon Sep 17 00:00:00 2001 From: Erik Joelsson Date: Mon, 13 Nov 2017 16:32:30 +0100 Subject: [PATCH 12/28] 8190725: Freetype license file provided with configure not included in images Reviewed-by: ihse, tbell --- make/CreateJmods.gmk | 4 ++-- make/common/Modules.gmk | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/make/CreateJmods.gmk b/make/CreateJmods.gmk index e987e162311..d1e05718dcf 100644 --- a/make/CreateJmods.gmk +++ b/make/CreateJmods.gmk @@ -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)) diff --git a/make/common/Modules.gmk b/make/common/Modules.gmk index cdbb01b0761..752deb4082d 100644 --- a/make/common/Modules.gmk +++ b/make/common/Modules.gmk @@ -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))) \ + )) ################################################################################ From 768db55a4d7d380f441a683c312ad0bb62444ef0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20Walln=C3=B6fer?= Date: Mon, 13 Nov 2017 18:14:33 +0100 Subject: [PATCH 13/28] 8191131: Nashorn test comparator breaks comparator contract Reviewed-by: sundar, jlaskey --- .../internal/test/framework/TestReorderInterceptor.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/nashorn/src/jdk/nashorn/internal/test/framework/TestReorderInterceptor.java b/test/nashorn/src/jdk/nashorn/internal/test/framework/TestReorderInterceptor.java index 51da19c9136..6a134ddf0d4 100644 --- a/test/nashorn/src/jdk/nashorn/internal/test/framework/TestReorderInterceptor.java +++ b/test/nashorn/src/jdk/nashorn/internal/test/framework/TestReorderInterceptor.java @@ -47,6 +47,10 @@ public final class TestReorderInterceptor implements IMethodInterceptor { final Object o2 = mi2.getInstance(); if (o1 instanceof ITest && o2 instanceof ITest) { return ((ITest)o1).getTestName().compareTo(((ITest)o2).getTestName()); + } else if (o1 instanceof ITest) { + return 1; + } else if (o2 instanceof ITest) { + return -1; } // something else, don't care about the order return 0; From 65735f0d7e1243c20e9d5d394a051811e285679a Mon Sep 17 00:00:00 2001 From: Athijegannathan Sundararajan Date: Tue, 14 Nov 2017 08:59:19 +0530 Subject: [PATCH 14/28] 8177471: jlink should use the version from java.base.jmod to find modules Reviewed-by: mchung, alanb --- .../jdk/tools/jlink/internal/JarArchive.java | 6 +- .../jdk/tools/jlink/internal/JlinkTask.java | 36 +++- .../jlink/internal/ModularJarArchive.java | 4 +- .../multireleasejar/CheckRuntimeVersion.java | 51 ++++++ .../JLinkMRJavaBaseVersionTest.java | 163 ++++++++++++++++++ 5 files changed, 254 insertions(+), 6 deletions(-) create mode 100644 test/jdk/tools/jlink/multireleasejar/CheckRuntimeVersion.java create mode 100644 test/jdk/tools/jlink/multireleasejar/JLinkMRJavaBaseVersionTest.java diff --git a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JarArchive.java b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JarArchive.java index 0ff88bf1f3e..39963ce6ec9 100644 --- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JarArchive.java +++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JarArchive.java @@ -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() { diff --git a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JlinkTask.java b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JlinkTask.java index a30089d4d7f..1efcffa110f 100644 --- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JlinkTask.java +++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JlinkTask.java @@ -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 paths, Set 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 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 signatures = modularJarArchive.entries().filter((entry) -> { String name = entry.name().toUpperCase(Locale.ENGLISH); diff --git a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ModularJarArchive.java b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ModularJarArchive.java index c4d78cc412c..ff05abc89b0 100644 --- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ModularJarArchive.java +++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ModularJarArchive.java @@ -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); diff --git a/test/jdk/tools/jlink/multireleasejar/CheckRuntimeVersion.java b/test/jdk/tools/jlink/multireleasejar/CheckRuntimeVersion.java new file mode 100644 index 00000000000..9c9eb12527d --- /dev/null +++ b/test/jdk/tools/jlink/multireleasejar/CheckRuntimeVersion.java @@ -0,0 +1,51 @@ +/* + * 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. + */ + +import java.lang.module.ModuleDescriptor; +import java.lang.module.ModuleFinder; +import java.lang.module.ModuleReference; +import java.util.Arrays; +import java.util.Set; +import java.util.stream.Collectors; + +public class CheckRuntimeVersion { + public static void main(String... args) { + int version = Integer.parseInt(args[0]); + if (Runtime.version().major() != version) { + throw new RuntimeException(version + " != current runtime version " + + Runtime.version()); + } + + Set expected = Arrays.stream(args, 1, args.length) + .collect(Collectors.toSet()); + Set modules = ModuleFinder.ofSystem().findAll().stream() + .map(ModuleReference::descriptor) + .map(ModuleDescriptor::name) + .collect(Collectors.toSet()); + + if (!modules.equals(expected)) { + throw new RuntimeException("Expected: " + expected + + " observable modules: " + modules); + } + } +} diff --git a/test/jdk/tools/jlink/multireleasejar/JLinkMRJavaBaseVersionTest.java b/test/jdk/tools/jlink/multireleasejar/JLinkMRJavaBaseVersionTest.java new file mode 100644 index 00000000000..dd8d66391e3 --- /dev/null +++ b/test/jdk/tools/jlink/multireleasejar/JLinkMRJavaBaseVersionTest.java @@ -0,0 +1,163 @@ +/* + * 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 + * @bug 8177471 + * @summary jlink should use the version from java.base.jmod to find modules + * @modules java.base/jdk.internal.module + * @library /test/lib + * @build jdk.test.lib.process.* CheckRuntimeVersion + * @run testng/othervm JLinkMRJavaBaseVersionTest + */ + +import java.io.ByteArrayInputStream; +import java.io.File; +import java.io.IOException; +import java.lang.module.ModuleFinder; +import java.lang.module.ModuleReference; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.List; +import java.util.jar.JarFile; +import java.util.spi.ToolProvider; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import jdk.internal.module.ModulePath; +import jdk.test.lib.process.ProcessTools; +import org.testng.Assert; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +public class JLinkMRJavaBaseVersionTest { + private static final ToolProvider JAR_TOOL = ToolProvider.findFirst("jar") + .orElseThrow(() -> new RuntimeException("jar tool not found")); + private static final ToolProvider JAVAC_TOOL = ToolProvider.findFirst("javac") + .orElseThrow(() -> new RuntimeException("javac tool not found")); + private static final ToolProvider JLINK_TOOL = ToolProvider.findFirst("jlink") + .orElseThrow(() -> new RuntimeException("jlink tool not found")); + + private static final Path javaHome = Paths.get(System.getProperty("java.home")); + + // resource text for version 9 + private byte[] resource9 = ("9 resource file").getBytes(); + // resource text for current version + private byte[] resource = (Runtime.version().major() + " resource file").getBytes(); + + static Path getJmods() { + Path jmods = Paths.get(System.getProperty("java9.home", javaHome.toString())).resolve("jmods"); + if (Files.notExists(jmods)) { + throw new RuntimeException(jmods + " not found"); + } + return jmods; + } + + @BeforeClass + public void initialize() throws IOException { + Path srcdir = Paths.get(System.getProperty("test.src")); + + // create class files from source + Path base = srcdir.resolve("base"); + Path mr9 = Paths.get("mr9"); + javac(base, mr9, base.toString()); + + // current version + Path rt = srcdir.resolve("rt"); + Path rtmods = Paths.get("rtmods"); + javac(rt, rtmods, rt.toString()); + + // build multi-release jar file with different module-info.class + String[] args = { + "-cf", "m1.jar", + "-C", rtmods.resolve("m1").toString(), ".", + "--release ", "9", + "-C", mr9.resolve("m1").toString(), "." + + }; + JAR_TOOL.run(System.out, System.err, args); + } + + private void javac(Path source, Path destination, String srcpath) throws IOException { + String[] args = Stream.concat( + Stream.of("-d", destination.toString(), "--release", "9", + "--module-source-path", srcpath), + Files.walk(source) + .map(Path::toString) + .filter(s -> s.endsWith(".java")) + ).toArray(String[]::new); + int rc = JAVAC_TOOL.run(System.out, System.err, args); + Assert.assertEquals(rc, 0); + } + + @Test + public void basicTest() throws Throwable { + if (Files.notExists(javaHome.resolve("lib").resolve("modules"))) { + // exploded image + return; + } + + Runtime.Version version = targetRuntimeVersion(); + System.out.println("Testing jlink with " + getJmods() + " of target version " + version); + + // use jlink to build image from multi-release jar + jlink("m1.jar", "myimage"); + + // validate runtime image + Path java = Paths.get("myimage", "bin", "java"); + ProcessTools.executeProcess(java.toString(), "-m", "m1/p.Main"); + + // validate the image linked with the proper MR version + + if (version.equalsIgnoreOptional(Runtime.version())) { + ProcessTools.executeProcess(java.toString(), "-cp", System.getProperty("test.classes"), + "CheckRuntimeVersion", String.valueOf(version.major()), + "java.base", "java.logging", "m1") + .shouldHaveExitValue(0); + } else { + ProcessTools.executeProcess(java.toString(), "-cp", System.getProperty("test.classes"), + "CheckRuntimeVersion", String.valueOf(version.major()), + "java.base", "m1") + .shouldHaveExitValue(0); + } + } + + private Runtime.Version targetRuntimeVersion() { + ModuleReference mref = ModulePath.of(Runtime.version(), true, getJmods()) + .find("java.base") + .orElseThrow(() -> new RuntimeException("java.base not found from " + getJmods())); + + return Runtime.Version.parse(mref.descriptor().version().get().toString()); + } + + private void jlink(String jar, String image) { + List args = List.of("--output", image, + "--add-modules", "m1", + "--module-path", + getJmods().toString() + File.pathSeparator + jar); + System.out.println("jlink " + args.stream().collect(Collectors.joining(" "))); + int exitCode = JLINK_TOOL.run(System.out, System.err, args.toArray(new String[0])); + Assert.assertEquals(exitCode, 0); + } +} From 239fdbbca67bf897e946e30179113f8b81698fe0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20Walln=C3=B6fer?= Date: Tue, 14 Nov 2017 10:04:45 +0100 Subject: [PATCH 15/28] 8185119: Uninitialized const when using multiple threads Reviewed-by: jlaskey, sundar --- .../internal/runtime/ScriptObject.java | 4 +- .../linker/NashornCallSiteDescriptor.java | 9 +++ .../script/nosecurity/es6/JDK-8185119.js | 58 +++++++++++++++++++ 3 files changed, 69 insertions(+), 2 deletions(-) create mode 100644 test/nashorn/script/nosecurity/es6/JDK-8185119.js diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptObject.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptObject.java index 19f1a2214e3..2b0ac1b7f55 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptObject.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptObject.java @@ -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. } diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/linker/NashornCallSiteDescriptor.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/linker/NashornCallSiteDescriptor.java index 71f9f47b2f6..f01faa921a8 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/linker/NashornCallSiteDescriptor.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/linker/NashornCallSiteDescriptor.java @@ -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 diff --git a/test/nashorn/script/nosecurity/es6/JDK-8185119.js b/test/nashorn/script/nosecurity/es6/JDK-8185119.js new file mode 100644 index 00000000000..42e332a1597 --- /dev/null +++ b/test/nashorn/script/nosecurity/es6/JDK-8185119.js @@ -0,0 +1,58 @@ +/* + * 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. + */ + +/** + * JDK-8185119: Uninitialized const when using multiple threads + * + * @test + * @option --language=es6 + * @run + */ + +function f() { + let a; + const b = {}; + b.crash; // b is sometimes undefined + + function c() { + a; b; + } +} + +let count = new java.util.concurrent.atomic.AtomicInteger(); + +let T = Java.extend(Java.type('java.lang.Thread'), { + run: function() { + for (let j = 0; j < 100; j++) { + f(); + } + count.getAndIncrement(); + } +}); + +const threads = [new T(), new T(), new T(), new T()]; +threads.forEach(t => t.start()); +threads.forEach(t => t.join()); + +Assert.assertEquals(count.intValue(), 4); + From 60b42446d8e90e3905f386386a3e04481a34a561 Mon Sep 17 00:00:00 2001 From: Felix Yang Date: Tue, 14 Nov 2017 03:58:40 -0600 Subject: [PATCH 16/28] 8191172: Problem list java/net/httpclient/websocket/ConnectionHandover.java Reviewed-by: chegar --- test/jdk/ProblemList.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index 46a8037349c..b95dcbe9952 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -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 From 6ceb45969c16e58817c822ff577025853b057970 Mon Sep 17 00:00:00 2001 From: Magnus Ihse Bursie Date: Tue, 14 Nov 2017 12:10:28 +0100 Subject: [PATCH 17/28] 8190410: Help.gmk is not updated after consolidation Reviewed-by: erikj --- make/Help.gmk | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/make/Help.gmk b/make/Help.gmk index 4514eb08b8d..e7f0bfa29de 100644 --- a/make/Help.gmk +++ b/make/Help.gmk @@ -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 -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 -image # Build just the image for any of: ) + $(info $(_) # jdk, jre, test, docs, symbols, profiles) $(info $(_) make # 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- # Build just the specified jvm variant) $(info $(_) make hotspot-gensrc # Only build the gensrc part of hotspot) - $(info $(_) make hotspot-- # Build the specified phase for the specified module) + $(info $(_) make hotspot-- # Build the specified phase for the variant) $(info ) $(info Targets for specific modules) $(info $(_) make # Build and everything it depends on) From 8d84df14e1006b73dd16158216832449a45ce0e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20Walln=C3=B6fer?= Date: Tue, 14 Nov 2017 14:18:23 +0100 Subject: [PATCH 18/28] 8191133: Ant task to fetch underscore.js requires gzip decoding option Reviewed-by: sundar, jlaskey --- make/nashorn/build.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/make/nashorn/build.xml b/make/nashorn/build.xml index e384fea1eb5..410c6712ccb 100644 --- a/make/nashorn/build.xml +++ b/make/nashorn/build.xml @@ -830,8 +830,8 @@ grant codeBase "file:/${basedir}/${test.script.dir}/basic/JDK-8158467.js" { - - + + From 525a4b19771ccafc02f47aaf13478a8d9eaf6363 Mon Sep 17 00:00:00 2001 From: Sean Mullan Date: Tue, 14 Nov 2017 08:24:27 -0500 Subject: [PATCH 19/28] 8175091: Mark the deprecated java.security.{Certificate,Identity,IdentityScope,Signer} APIs with forRemoval=true Reviewed-by: weijun --- .../share/classes/java/security/Certificate.java | 9 ++++----- .../share/classes/java/security/Identity.java | 11 ++++++----- .../share/classes/java/security/IdentityScope.java | 11 ++++++----- src/java.base/share/classes/java/security/Signer.java | 11 ++++++----- 4 files changed, 22 insertions(+), 20 deletions(-) diff --git a/src/java.base/share/classes/java/security/Certificate.java b/src/java.base/share/classes/java/security/Certificate.java index d56446925b1..28690e2669b 100644 --- a/src/java.base/share/classes/java/security/Certificate.java +++ b/src/java.base/share/classes/java/security/Certificate.java @@ -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 { /** diff --git a/src/java.base/share/classes/java/security/Identity.java b/src/java.base/share/classes/java/security/Identity.java index 4d79e2d751a..c1163cdb45d 100644 --- a/src/java.base/share/classes/java/security/Identity.java +++ b/src/java.base/share/classes/java/security/Identity.java @@ -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 */ diff --git a/src/java.base/share/classes/java/security/IdentityScope.java b/src/java.base/share/classes/java/security/IdentityScope.java index 5b6ec8212f7..49c7c180322 100644 --- a/src/java.base/share/classes/java/security/IdentityScope.java +++ b/src/java.base/share/classes/java/security/IdentityScope.java @@ -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 { diff --git a/src/java.base/share/classes/java/security/Signer.java b/src/java.base/share/classes/java/security/Signer.java index 88852b2e4be..d7922b2205f 100644 --- a/src/java.base/share/classes/java/security/Signer.java +++ b/src/java.base/share/classes/java/security/Signer.java @@ -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; From cf35c06daa5f8b7bb346b88b4980cf99b132532b Mon Sep 17 00:00:00 2001 From: Weijun Wang Date: Tue, 14 Nov 2017 21:43:15 +0800 Subject: [PATCH 20/28] 8191137: keytool fails to format resource strings for keys for some languages after JDK-8171319 Reviewed-by: mullan --- .../sun/security/tools/keytool/Resources.java | 14 +++++++------- .../sun/security/tools/jarsigner/Resources.java | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/java.base/share/classes/sun/security/tools/keytool/Resources.java b/src/java.base/share/classes/sun/security/tools/keytool/Resources.java index 5213b1a7903..485129086c7 100644 --- a/src/java.base/share/classes/sun/security/tools/keytool/Resources.java +++ b/src/java.base/share/classes/sun/security/tools/keytool/Resources.java @@ -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\"..."}, diff --git a/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Resources.java b/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Resources.java index 23f7f578ca3..0bb599d93a0 100644 --- a/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Resources.java +++ b/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Resources.java @@ -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", From b4a427a82b39a0431c50caf6590e35142af371bf Mon Sep 17 00:00:00 2001 From: Sean Mullan Date: Tue, 14 Nov 2017 09:15:12 -0500 Subject: [PATCH 21/28] 8175094: Mark the deprecated java.security.acl APIs with forRemoval=true Reviewed-by: weijun --- src/java.base/share/classes/java/security/acl/Acl.java | 8 +++++--- .../share/classes/java/security/acl/AclEntry.java | 8 +++++--- .../classes/java/security/acl/AclNotFoundException.java | 7 ++++--- src/java.base/share/classes/java/security/acl/Group.java | 7 ++++--- .../classes/java/security/acl/LastOwnerException.java | 7 ++++--- .../classes/java/security/acl/NotOwnerException.java | 7 ++++--- src/java.base/share/classes/java/security/acl/Owner.java | 8 +++++--- .../share/classes/java/security/acl/Permission.java | 7 ++++--- .../share/classes/java/security/acl/package-info.java | 3 ++- 9 files changed, 37 insertions(+), 25 deletions(-) diff --git a/src/java.base/share/classes/java/security/acl/Acl.java b/src/java.base/share/classes/java/security/acl/Acl.java index 423afdd695e..938407823e8 100644 --- a/src/java.base/share/classes/java/security/acl/Acl.java +++ b/src/java.base/share/classes/java/security/acl/Acl.java @@ -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 { /** diff --git a/src/java.base/share/classes/java/security/acl/AclEntry.java b/src/java.base/share/classes/java/security/acl/AclEntry.java index 242470876a6..1d64eb0cbb2 100644 --- a/src/java.base/share/classes/java/security/acl/AclEntry.java +++ b/src/java.base/share/classes/java/security/acl/AclEntry.java @@ -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 { /** diff --git a/src/java.base/share/classes/java/security/acl/AclNotFoundException.java b/src/java.base/share/classes/java/security/acl/AclNotFoundException.java index 1585f93637d..882bfdf135e 100644 --- a/src/java.base/share/classes/java/security/acl/AclNotFoundException.java +++ b/src/java.base/share/classes/java/security/acl/AclNotFoundException.java @@ -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; diff --git a/src/java.base/share/classes/java/security/acl/Group.java b/src/java.base/share/classes/java/security/acl/Group.java index 6ce62330d87..534f6cb0937 100644 --- a/src/java.base/share/classes/java/security/acl/Group.java +++ b/src/java.base/share/classes/java/security/acl/Group.java @@ -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 { /** diff --git a/src/java.base/share/classes/java/security/acl/LastOwnerException.java b/src/java.base/share/classes/java/security/acl/LastOwnerException.java index 3d655d7bf48..3582e0ad9b0 100644 --- a/src/java.base/share/classes/java/security/acl/LastOwnerException.java +++ b/src/java.base/share/classes/java/security/acl/LastOwnerException.java @@ -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; diff --git a/src/java.base/share/classes/java/security/acl/NotOwnerException.java b/src/java.base/share/classes/java/security/acl/NotOwnerException.java index cf3b5975a7a..fc5b155d6ae 100644 --- a/src/java.base/share/classes/java/security/acl/NotOwnerException.java +++ b/src/java.base/share/classes/java/security/acl/NotOwnerException.java @@ -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; diff --git a/src/java.base/share/classes/java/security/acl/Owner.java b/src/java.base/share/classes/java/security/acl/Owner.java index 0ba70035057..b7af16df085 100644 --- a/src/java.base/share/classes/java/security/acl/Owner.java +++ b/src/java.base/share/classes/java/security/acl/Owner.java @@ -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 { /** diff --git a/src/java.base/share/classes/java/security/acl/Permission.java b/src/java.base/share/classes/java/security/acl/Permission.java index 2c867490b6b..78457f82c2e 100644 --- a/src/java.base/share/classes/java/security/acl/Permission.java +++ b/src/java.base/share/classes/java/security/acl/Permission.java @@ -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 { /** diff --git a/src/java.base/share/classes/java/security/acl/package-info.java b/src/java.base/share/classes/java/security/acl/package-info.java index 25c17392241..003aa72fbfe 100644 --- a/src/java.base/share/classes/java/security/acl/package-info.java +++ b/src/java.base/share/classes/java/security/acl/package-info.java @@ -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 */ From 304348561fcf29486ab3fc98fed24aefa0413227 Mon Sep 17 00:00:00 2001 From: Ivan Gerasimov Date: Tue, 14 Nov 2017 13:31:43 -0800 Subject: [PATCH 22/28] 8189631: Missing space in the javadoc for InetAddress.createNameService() Reviewed-by: rriggs, wetmore --- src/java.base/share/classes/java/net/InetAddress.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/java.base/share/classes/java/net/InetAddress.java b/src/java.base/share/classes/java/net/InetAddress.java index 692c1e829f5..84a0c578f5f 100644 --- a/src/java.base/share/classes/java/net/InetAddress.java +++ b/src/java.base/share/classes/java/net/InetAddress.java @@ -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. * *

The default NameService is the PlatformNameService, which typically * delegates name and address resolution calls to the underlying From 616491477f8122fd5256e1df9d3058be51aa8333 Mon Sep 17 00:00:00 2001 From: Bhavesh Patel Date: Tue, 14 Nov 2017 13:44:07 -0800 Subject: [PATCH 23/28] 8185371: Support for multiple stylesheets in javadoc Reviewed-by: jjg, ksrini --- .../formats/html/FrameOutputWriter.java | 2 +- .../formats/html/HtmlConfiguration.java | 30 ++++++++- .../doclets/formats/html/HtmlDoclet.java | 3 + .../formats/html/HtmlDocletWriter.java | 1 + .../formats/html/IndexRedirectWriter.java | 2 +- .../formats/html/SourceToHTMLConverter.java | 23 +++++-- .../formats/html/markup/HtmlDocWriter.java | 20 +++++- .../html/resources/standard.properties | 10 ++- .../doclet/testHelpOption/TestHelpOption.java | 3 +- .../doclet/testOptions/TestOptions.java | 63 ++++++++++++++++++- .../testOptions/additional-stylesheet-1.css | 5 ++ .../testOptions/additional-stylesheet-2.css | 5 ++ .../testOptions/additional-stylesheet-3.css | 5 ++ 13 files changed, 156 insertions(+), 16 deletions(-) create mode 100644 test/langtools/jdk/javadoc/doclet/testOptions/additional-stylesheet-1.css create mode 100644 test/langtools/jdk/javadoc/doclet/testOptions/additional-stylesheet-2.css create mode 100644 test/langtools/jdk/javadoc/doclet/testOptions/additional-stylesheet-3.css diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/FrameOutputWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/FrameOutputWriter.java index 8578ed93423..0fc3f2ecbc1 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/FrameOutputWriter.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/FrameOutputWriter.java @@ -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); diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlConfiguration.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlConfiguration.java index 45e38fa269d..48d7beb83c2 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlConfiguration.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlConfiguration.java @@ -132,6 +132,11 @@ public class HtmlConfiguration extends BaseConfiguration { */ public String stylesheetfile = ""; + /** + * Argument for command line option "--add-stylesheet". + */ + public List 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 getSupportedOptions() { Resources resources = getResources(); Doclet.Option[] options = { + new Option(resources, "--add-stylesheet", 1) { + @Override + public boolean process(String opt, List args) { + additionalStylesheets.add(args.get(0)); + return true; + } + }, new Option(resources, "-bottom", 1) { @Override public boolean process(String opt, List 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 args) { stylesheetfile = args.get(0); diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDoclet.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDoclet.java index d125f395238..571dbba5b07 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDoclet.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDoclet.java @@ -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); diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java index f8214c6322d..a4e545c2438 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java @@ -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(), diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/IndexRedirectWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/IndexRedirectWriter.java index 635f0452747..e3bb424fd34 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/IndexRedirectWriter.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/IndexRedirectWriter.java @@ -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( diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SourceToHTMLConverter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SourceToHTMLConverter.java index f1a4e60b1ed..c8882e10b96 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SourceToHTMLConverter.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SourceToHTMLConverter.java @@ -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 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); + }); + } } /** diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlDocWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlDocWriter.java index e504f959518..b58318f0326 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlDocWriter.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlDocWriter.java @@ -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 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) { diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard.properties b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard.properties index 789134a3d56..bfc2b3249ae 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard.properties +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard.properties @@ -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=\ + +doclet.usage.add-stylesheet.description=\ + Additional stylesheet file for the generated documentation doclet.usage.d.parameters=\ 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=\ - -doclet.usage.stylesheetfile.description=\ +doclet.usage.main-stylesheet.parameters=\ + +doclet.usage.main-stylesheet.description=\ File to change style of the generated documentation doclet.usage.docencoding.parameters=\ diff --git a/test/langtools/jdk/javadoc/doclet/testHelpOption/TestHelpOption.java b/test/langtools/jdk/javadoc/doclet/testHelpOption/TestHelpOption.java index 67509447503..b65aa17f32e 100644 --- a/test/langtools/jdk/javadoc/doclet/testHelpOption/TestHelpOption.java +++ b/test/langtools/jdk/javadoc/doclet/testHelpOption/TestHelpOption.java @@ -23,7 +23,7 @@ /* * @test - * @bug 4934778 4777599 6553182 8146427 8146475 8175055 + * @bug 4934778 4777599 6553182 8146427 8146475 8175055 8185371 * @summary Make sure that -help, -helpfile and -nohelp options work correctly. * @author jamieh * @library ../lib @@ -161,6 +161,7 @@ public class TestHelpOption extends JavadocTester { "-sourcetab ", "-keywords ", "-stylesheetfile ", + "--add-stylesheet ", "-docencoding ", "-html4 ", "-html5 ", diff --git a/test/langtools/jdk/javadoc/doclet/testOptions/TestOptions.java b/test/langtools/jdk/javadoc/doclet/testOptions/TestOptions.java index 384c465cd19..dd3442861c7 100644 --- a/test/langtools/jdk/javadoc/doclet/testOptions/TestOptions.java +++ b/test/langtools/jdk/javadoc/doclet/testOptions/TestOptions.java @@ -23,8 +23,9 @@ /* * @test - * @bug 4749567 8071982 8175200 8186332 - * @summary Test the output for -header, -footer, -nooverview, -nodeprecatedlist, -nonavbar, -notree, -stylesheetfile options. + * @bug 4749567 8071982 8175200 8186332 8185371 + * @summary Test the output for -header, -footer, -nooverview, -nodeprecatedlist, -nonavbar, -notree, + * -stylesheetfile, --main-stylesheet, --add-stylesheet options. * @author Bhavesh Patel * @library ../lib * @modules jdk.javadoc/jdk.javadoc.internal.tool @@ -117,6 +118,64 @@ public class TestOptions extends JavadocTester { + "href=\"../custom-stylesheet.css\" title=\"Style\">"); } + @Test + void testStylesheetFileAltOption() { + javadoc("-d", "out-stylesheet-file", + "--main-stylesheet", new File(testSrc, "custom-stylesheet.css").getAbsolutePath(), + "-sourcepath", testSrc, + "pkg"); + checkExit(Exit.OK); + + checkOutput("custom-stylesheet.css", true, "Custom javadoc style sheet"); + checkOutput("pkg/Foo.html", true, ""); + } + + @Test + void testAdditionalStylesheetFile() { + javadoc("-d", "out-additional-css", + "--add-stylesheet", new File(testSrc, "additional-stylesheet-1.css").getAbsolutePath(), + "--add-stylesheet", new File(testSrc, "additional-stylesheet-2.css").getAbsolutePath(), + "--add-stylesheet", new File(testSrc, "additional-stylesheet-3.css").getAbsolutePath(), + "-sourcepath", testSrc, + "pkg"); + checkExit(Exit.OK); + + checkOutput("additional-stylesheet-1.css", true, "Additional javadoc style sheet 1"); + checkOutput("additional-stylesheet-2.css", true, "Additional javadoc style sheet 2"); + checkOutput("additional-stylesheet-3.css", true, "Additional javadoc style sheet 3"); + checkOutput("pkg/Foo.html", true, + "\n" + + "\n" + + ""); + } + + @Test + void testInvalidStylesheetFile() { + javadoc("-d", "out-invalid-css", + "--main-stylesheet", new File(testSrc, "custom-stylesheet-1.css").getAbsolutePath(), + "-sourcepath", testSrc, + "pkg"); + checkExit(Exit.ERROR); + + checkOutput(Output.OUT, true, + "javadoc: error - File not found:", + "custom-stylesheet-1.css"); + } + + @Test + void testInvalidAdditionalStylesheetFiles() { + javadoc("-d", "out-invalid-additional-css", + "--add-stylesheet", new File(testSrc, "additional-stylesheet-4.css").getAbsolutePath(), + "-sourcepath", testSrc, + "pkg"); + checkExit(Exit.ERROR); + + checkOutput(Output.OUT, true, + "javadoc: error - File not found:", + "additional-stylesheet-4.css"); + } + @Test void testLinkSource() { javadoc("-d", "out-9", diff --git a/test/langtools/jdk/javadoc/doclet/testOptions/additional-stylesheet-1.css b/test/langtools/jdk/javadoc/doclet/testOptions/additional-stylesheet-1.css new file mode 100644 index 00000000000..8d8192ee55f --- /dev/null +++ b/test/langtools/jdk/javadoc/doclet/testOptions/additional-stylesheet-1.css @@ -0,0 +1,5 @@ +/* Additional javadoc style sheet 1 */ + +body { + background-color:#f8f8ff; +} diff --git a/test/langtools/jdk/javadoc/doclet/testOptions/additional-stylesheet-2.css b/test/langtools/jdk/javadoc/doclet/testOptions/additional-stylesheet-2.css new file mode 100644 index 00000000000..ff012563725 --- /dev/null +++ b/test/langtools/jdk/javadoc/doclet/testOptions/additional-stylesheet-2.css @@ -0,0 +1,5 @@ +/* Additional javadoc style sheet 2 */ + +.subNav { + background-color:#fafad2; +} diff --git a/test/langtools/jdk/javadoc/doclet/testOptions/additional-stylesheet-3.css b/test/langtools/jdk/javadoc/doclet/testOptions/additional-stylesheet-3.css new file mode 100644 index 00000000000..f3019c1d86d --- /dev/null +++ b/test/langtools/jdk/javadoc/doclet/testOptions/additional-stylesheet-3.css @@ -0,0 +1,5 @@ +/* Additional javadoc style sheet 3 */ + +a:link, a:visited { + color:#8b0000; +} From f441abcff12e64cb65af01914c5908311f561ff8 Mon Sep 17 00:00:00 2001 From: Athijegannathan Sundararajan Date: Wed, 15 Nov 2017 19:55:21 +0530 Subject: [PATCH 24/28] 8191306: Math.abs corner case with optimistic typing Reviewed-by: jlaskey, hannesw --- .../nashorn/internal/objects/NativeMath.java | 4 +-- test/nashorn/script/basic/JDK-8191306.js | 32 +++++++++++++++++++ .../script/basic/JDK-8191306.js.EXPECTED | 2 ++ 3 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 test/nashorn/script/basic/JDK-8191306.js create mode 100644 test/nashorn/script/basic/JDK-8191306.js.EXPECTED diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeMath.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeMath.java index 83b336cac0a..d73fb8afe24 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeMath.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeMath.java @@ -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); } /** diff --git a/test/nashorn/script/basic/JDK-8191306.js b/test/nashorn/script/basic/JDK-8191306.js new file mode 100644 index 00000000000..088c737cefc --- /dev/null +++ b/test/nashorn/script/basic/JDK-8191306.js @@ -0,0 +1,32 @@ +/* + * 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. + */ + +/** + * JDK-8191306 Math.abs corner case with optimistic typing + * + * @test + * @run + */ + +print(Math.abs(-2147483648)) +print(Math.abs(java.lang.Integer.MIN_VALUE)) diff --git a/test/nashorn/script/basic/JDK-8191306.js.EXPECTED b/test/nashorn/script/basic/JDK-8191306.js.EXPECTED new file mode 100644 index 00000000000..3fa24300a40 --- /dev/null +++ b/test/nashorn/script/basic/JDK-8191306.js.EXPECTED @@ -0,0 +1,2 @@ +2147483648 +2147483648 From d6cf9ab9cd3b0b1974d271c46781ee5a38aa1747 Mon Sep 17 00:00:00 2001 From: Athijegannathan Sundararajan Date: Wed, 15 Nov 2017 23:25:40 +0530 Subject: [PATCH 25/28] 8068741: javax.script.ScriptEngineFactory.getMethodCallSyntax() spec allows null passed as an object Reviewed-by: hannesw --- .../javax/script/ScriptEngineFactory.java | 2 + .../scripting/NashornScriptEngineFactory.java | 8 ++- .../api/scripting/test/JDK_8068741_Test.java | 60 +++++++++++++++++++ 3 files changed, 67 insertions(+), 3 deletions(-) create mode 100644 test/nashorn/src/jdk/nashorn/api/scripting/test/JDK_8068741_Test.java diff --git a/src/java.scripting/share/classes/javax/script/ScriptEngineFactory.java b/src/java.scripting/share/classes/javax/script/ScriptEngineFactory.java index 27c70ef2dfe..3e0b92d1c6b 100644 --- a/src/java.scripting/share/classes/javax/script/ScriptEngineFactory.java +++ b/src/java.scripting/share/classes/javax/script/ScriptEngineFactory.java @@ -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); diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/NashornScriptEngineFactory.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/NashornScriptEngineFactory.java index abd3689c663..a510d8e0339 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/NashornScriptEngineFactory.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/NashornScriptEngineFactory.java @@ -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(')'); diff --git a/test/nashorn/src/jdk/nashorn/api/scripting/test/JDK_8068741_Test.java b/test/nashorn/src/jdk/nashorn/api/scripting/test/JDK_8068741_Test.java new file mode 100644 index 00000000000..4bfab53ac0e --- /dev/null +++ b/test/nashorn/src/jdk/nashorn/api/scripting/test/JDK_8068741_Test.java @@ -0,0 +1,60 @@ +/* + * 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.nashorn.api.scripting.test; + +import javax.script.ScriptEngineFactory; +import jdk.nashorn.api.scripting.NashornScriptEngineFactory; +import org.testng.Assert; +import org.testng.annotations.Test; + +/** + * @test + * @run testng jdk.nashorn.api.scripting.test.JDK_8068741_Test + * @bug 8068741 + * @summary javax.script.ScriptEngineFactory.getMethodCallSyntax() spec allows null passed as an object + */ +public class JDK_8068741_Test { + @Test + public void testGetMethodCallSyntax() { + ScriptEngineFactory fac = new NashornScriptEngineFactory(); + checkThrowsNPE(() -> fac.getMethodCallSyntax(null, "foo")); + checkThrowsNPE(() -> fac.getMethodCallSyntax("obj", null)); + checkThrowsNPE(() -> fac.getMethodCallSyntax("obj", "foo", (String[])null)); + checkThrowsNPE(() -> fac.getMethodCallSyntax("obj", "foo", null, "xyz")); + checkThrowsNPE(() -> fac.getMethodCallSyntax("obj", "foo", "xyz", null)); + } + + private void checkThrowsNPE(Runnable r) { + boolean gotNPE = false; + try { + r.run(); + } catch (NullPointerException npe) { + gotNPE = true; + System.err.println("Got NPE as expected: " + npe); + } + Assert.assertTrue(gotNPE); + } +} From 1644953c273f0301f237bd8dd79421b11b840c35 Mon Sep 17 00:00:00 2001 From: Erik Joelsson Date: Wed, 15 Nov 2017 11:50:55 -0800 Subject: [PATCH 26/28] 8190702: JMC packaging causing errors in JDK 10 consolidated repo (macOS) Reviewed-by: tbell --- make/common/MakeBase.gmk | 35 ++++++++++++++++++++++++++--------- test/make/TestCopyFiles.gmk | 22 ++++++++++++++++++++-- 2 files changed, 46 insertions(+), 11 deletions(-) diff --git a/make/common/MakeBase.gmk b/make/common/MakeBase.gmk index 6a384bca8ef..69dc9fbffe1 100644 --- a/make/common/MakeBase.gmk +++ b/make/common/MakeBase.gmk @@ -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 diff --git a/test/make/TestCopyFiles.gmk b/test/make/TestCopyFiles.gmk index 922a57177a0..31283daacc6 100644 --- a/test/make/TestCopyFiles.gmk +++ b/test/make/TestCopyFiles.gmk @@ -44,6 +44,7 @@ SRC_DIR := $(OUTPUT_DIR)/src DEST_DIR := $(OUTPUT_DIR)/dest $(OUTPUT_DIR)/_src_created: $(DEPS) + $(RM) -r $(DEST_DIR) $(RM) -r $(SRC_DIR) $(MKDIR) -p $(SRC_DIR) $(MKDIR) -p $(SRC_DIR)/foo @@ -51,7 +52,7 @@ $(OUTPUT_DIR)/_src_created: $(DEPS) $(TOUCH) $(SRC_DIR)/foo/foofile $(TOUCH) "$(SRC_DIR)/foo/foo file" # Spaces in directories only works with gnu make 4.0 or later - ifeq (4.0, $(firstword $(sort 4.0 $(MAKE_VERSION)))) + ifeq (4.0dfd, $(firstword $(sort 4.0 $(MAKE_VERSION)))) $(MKDIR) -p "$(SRC_DIR)/foo bar" $(TOUCH) "$(SRC_DIR)/foo bar/foobarfile" $(TOUCH) "$(SRC_DIR)/foo bar/foo bar file" @@ -65,15 +66,32 @@ $(eval $(call SetupCopyFiles, COPY_1, \ FILES := $(call CacheFind, $(SRC_DIR)), \ )) +# Optionally define a rule that deletes all the target files after the makefile +# has been parsed. GNU make has specific problems with this in combination with +# spaces in directory names. +ifeq ($(DELETE_FIRST), true) + delete-targets: + $(RM) -r $(DEST_DIR) + $(ECHO) '$(DEST_DIR)/foo' '$(wildcard $(DEST_DIR)/foo)' + + $(COPY_1): delete-targets +endif + do-copy1: $(COPY_1) run-test1: $(OUTPUT_DIR)/_src_created + $(ECHO) "Copy 1 first time" +$(MAKE) -f $(THIS_FILE) do-copy1 $(DIFF) -r $(SRC_DIR) $(DEST_DIR) + # Rerun the copy a second time, with the targets present at make parse + # time, but then deleted by a prerequisite rule. + $(ECHO) "Copy 1 second time" + +$(MAKE) -f $(THIS_FILE) do-copy1 DELETE_FIRST=true + $(DIFF) -r $(SRC_DIR) $(DEST_DIR) TEST_TARGETS += run-test1 -.PHONY: do-copy1 run-test1 +.PHONY: do-copy1 run-test1 delete-targets ################################################################################ From cc59ccb7d4f990ad882439b5174066a31bb9604c Mon Sep 17 00:00:00 2001 From: Paul Sandoz Date: Wed, 8 Nov 2017 10:27:10 -0800 Subject: [PATCH 27/28] 8190974: Parallel stream execution within a custom ForkJoinPool should obey the parallelism Reviewed-by: martin, tvaleev --- .../java/util/stream/AbstractTask.java | 29 +++- .../classes/java/util/stream/ForEachOps.java | 5 +- .../java/util/stream/StreamSpliterators.java | 6 +- .../java/util/stream/CustomFJPoolTest.java | 154 ++++++++++++++++++ 4 files changed, 179 insertions(+), 15 deletions(-) create mode 100644 test/jdk/java/util/stream/CustomFJPoolTest.java diff --git a/src/java.base/share/classes/java/util/stream/AbstractTask.java b/src/java.base/share/classes/java/util/stream/AbstractTask.java index f6bd8f5fc00..44c2656157b 100644 --- a/src/java.base/share/classes/java/util/stream/AbstractTask.java +++ b/src/java.base/share/classes/java/util/stream/AbstractTask.java @@ -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> extends CountedCompleter { - /** - * 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 helper; @@ -156,6 +151,22 @@ abstract class AbstractTask 0L ? est : 1L; } diff --git a/src/java.base/share/classes/java/util/stream/ForEachOps.java b/src/java.base/share/classes/java/util/stream/ForEachOps.java index df2cb1e4508..69714ca3f85 100644 --- a/src/java.base/share/classes/java/util/stream/ForEachOps.java +++ b/src/java.base/share/classes/java/util/stream/ForEachOps.java @@ -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; } diff --git a/src/java.base/share/classes/java/util/stream/StreamSpliterators.java b/src/java.base/share/classes/java/util/stream/StreamSpliterators.java index 4606ce30306..7c44076f5af 100644 --- a/src/java.base/share/classes/java/util/stream/StreamSpliterators.java +++ b/src/java.base/share/classes/java/util/stream/StreamSpliterators.java @@ -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> { 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); } diff --git a/test/jdk/java/util/stream/CustomFJPoolTest.java b/test/jdk/java/util/stream/CustomFJPoolTest.java new file mode 100644 index 00000000000..d8de8596688 --- /dev/null +++ b/test/jdk/java/util/stream/CustomFJPoolTest.java @@ -0,0 +1,154 @@ +/* + * 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. + */ + +/* + * @test + * @summary Tests stream execution in a custom ForkJoinPool + * @bug 8190974 + * @run testng/othervm CustomFJPoolTest + * @run testng/othervm -Djava.util.concurrent.ForkJoinPool.common.parallelism=0 CustomFJPoolTest + */ + +import org.testng.annotations.Test; + +import java.util.Comparator; +import java.util.Spliterator; +import java.util.concurrent.ForkJoinPool; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.function.Consumer; +import java.util.stream.IntStream; +import java.util.stream.StreamSupport; + +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertTrue; + +@Test +public class CustomFJPoolTest { + + // A Spliterator that counts the number of spliterators created + // including itself, thus the count starts at 1 + static class SplitCountingSpliterator implements Spliterator { + final Spliterator s; + final AtomicInteger nsplits; + + // Top-level constructor + public SplitCountingSpliterator(Spliterator s) { + this.s = s; + nsplits = new AtomicInteger(1); + } + + // Splitting constructor + SplitCountingSpliterator(Spliterator s, AtomicInteger nsplits) { + this.s = s; + this.nsplits = nsplits; + } + + int splits() { + return nsplits.get(); + } + + @Override + + public boolean tryAdvance(Consumer action) { + return s.tryAdvance(action); + } + + @Override + public void forEachRemaining(Consumer action) { + s.forEachRemaining(action); + } + + @Override + public Spliterator trySplit() { + var split = s.trySplit(); + if (split != null) { + nsplits.incrementAndGet(); + return new SplitCountingSpliterator<>(split, nsplits); + } + else { + return null; + } + } + + @Override + public long estimateSize() { + return s.estimateSize(); + } + + @Override + public long getExactSizeIfKnown() { + return s.getExactSizeIfKnown(); + } + + @Override + public int characteristics() { + return s.characteristics(); + } + + @Override + public boolean hasCharacteristics(int characteristics) { + return s.hasCharacteristics(characteristics); + } + + @Override + public Comparator getComparator() { + return s.getComparator(); + } + } + + public void testCustomPools() throws Exception { + int splitsForP1 = countSplits(new ForkJoinPool(1)); + int splitsForP2 = countSplits(new ForkJoinPool(2)); + assertEquals(splitsForP2, splitsForP1 * 2); + + int commonParallelism = ForkJoinPool.getCommonPoolParallelism(); + if (commonParallelism > 1 && commonParallelism < 128) { + int splitsForPHalfC = countSplits(new ForkJoinPool(commonParallelism / 2)); + int splitsForPC = countSplits(ForkJoinPool.commonPool()); + + assertTrue(splitsForPHalfC < splitsForPC); + assertEquals(splitsForPC / splitsForPHalfC, + nearestPowerOfTwo(commonParallelism) / nearestPowerOfTwo(commonParallelism / 2)); + } + } + + static int countSplits(ForkJoinPool fjp) throws Exception { + // The number of splits will be equivalent to the number of leaf nodes + // and will be a power of 2 + var fInteger = fjp.submit(() -> { + var s = IntStream.range(0, 1024).boxed().parallel().spliterator(); + var cs = new SplitCountingSpliterator<>(s); + StreamSupport.stream(cs, true).forEach(e -> {}); + return cs.splits(); + }); + return fInteger.get(); + } + + static int nearestPowerOfTwo(int i) { + return (i & (i - 1)) == 0 + ? i + : 1 << (32 - Integer.numberOfLeadingZeros(i)); + } +} From 433bf8ab6507be962521090fc91009054d48b8f7 Mon Sep 17 00:00:00 2001 From: Claes Redestad Date: Thu, 16 Nov 2017 00:58:50 +0100 Subject: [PATCH 28/28] 8184777: Factor out species generation logic from BoundMethodHandle Co-authored-by: John Rose Reviewed-by: vlivanov --- .../java/lang/invoke/BoundMethodHandle.java | 787 +++---------- .../java/lang/invoke/ClassSpecializer.java | 1030 +++++++++++++++++ .../lang/invoke/GenerateJLIClassesHelper.java | 26 +- .../lang/invoke/InvokerBytecodeGenerator.java | 5 +- .../classes/java/lang/invoke/LambdaForm.java | 35 +- .../java/lang/invoke/LambdaFormBuffer.java | 10 +- .../java/lang/invoke/LambdaFormEditor.java | 7 +- .../java/lang/invoke/MethodHandleImpl.java | 10 +- .../java/lang/invoke/SimpleMethodHandle.java | 23 +- .../plugins/GenerateJLIClassesPlugin.java | 12 +- .../lang/invoke/ClassSpecializerTest.java | 82 ++ .../lang/invoke/ClassSpecializerHelper.java | 155 +++ .../plugins/GenerateJLIClassesPluginTest.java | 23 +- 13 files changed, 1550 insertions(+), 655 deletions(-) create mode 100644 src/java.base/share/classes/java/lang/invoke/ClassSpecializer.java create mode 100644 test/jdk/java/lang/invoke/ClassSpecializerTest.java create mode 100644 test/jdk/java/lang/invoke/java.base/java/lang/invoke/ClassSpecializerHelper.java diff --git a/src/java.base/share/classes/java/lang/invoke/BoundMethodHandle.java b/src/java.base/share/classes/java/lang/invoke/BoundMethodHandle.java index f4675e15905..377be1dbbff 100644 --- a/src/java.base/share/classes/java/lang/invoke/BoundMethodHandle.java +++ b/src/java.base/share/classes/java/lang/invoke/BoundMethodHandle.java @@ -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 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.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 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> deriveFieldTypes(String key) { + ArrayList> 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 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 CACHE = new ConcurrentHashMap<>(); - private static final boolean INIT_DONE; // set after finishes... - - SpeciesData extendWith(byte type) { - return extendWith(BasicType.basicType(type)); + @Override + protected List deriveTransformHelperArguments(MemberName transform, int whichtm, List args, List 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() { - @Override - public SpeciesData apply(String types) { - Class 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 rootCls = BoundMethodHandle.class; - for (Class c : rootCls.getDeclaredClasses()) { - if (rootCls.isAssignableFrom(c)) { - final Class 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 { + + 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> 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 getConcreteBMHClass(String types) { - // CHM.computeIfAbsent ensures generateConcreteBMHClass is called - // only once per key. - return CLASS_CACHE.computeIfAbsent( - types, new Function>() { - @Override - public Class 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: - * - *

-         * class Species_[[types]] extends BoundMethodHandle {
-         *     [[fields]]
-         *     final SpeciesData speciesData() { return SpeciesData.get("[[types]]"); }
-         * }
-         * 
- * - * 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: - * - *
-         * 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; }
-         *     @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);
-         *     }
-         * }
-         * 
- * - * @param types the type signature, wherein reference types are erased to 'L' - * @return the generated concrete BMH class - */ - static Class generateConcreteBMHClass(String shortTypes, - String types) { - final String className = speciesInternalClassName(shortTypes); - byte[] classFile = generateConcreteBMHClassBytes(shortTypes, types, className); - - // load class - InvokerBytecodeGenerator.maybeDump(className, classFile); - Class 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, "", 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, "", 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, "", 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, "", 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 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 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 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 BMH_TRANSFORMS; + static final int TN_COPY_NO_EXTEND = V_TYPE_NUM; + static { + final Class 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 cbmh, String types) { - try { - return LOOKUP.findStatic(cbmh, "make", makeConstructorType(types)); - } catch (NoSuchMethodException | IllegalAccessException | IllegalArgumentException | TypeNotPresentException e) { - throw newInternalError(e); + class Factory extends ClassSpecializer.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"); } } diff --git a/src/java.base/share/classes/java/lang/invoke/ClassSpecializer.java b/src/java.base/share/classes/java/lang/invoke/ClassSpecializer.java new file mode 100644 index 00000000000..5756a775dee --- /dev/null +++ b/src/java.base/share/classes/java/lang/invoke/ClassSpecializer.java @@ -0,0 +1,1030 @@ +/* + * 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 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.BytecodeName; + +import java.lang.reflect.*; +import java.security.AccessController; +import java.security.PrivilegedAction; +import java.security.ProtectionDomain; +import java.util.*; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; +import java.util.function.Function; + +import static java.lang.invoke.LambdaForm.*; +import static java.lang.invoke.MethodHandleNatives.Constants.REF_getStatic; +import static java.lang.invoke.MethodHandleNatives.Constants.REF_putStatic; +import static java.lang.invoke.MethodHandleStatics.*; +import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP; +import static jdk.internal.org.objectweb.asm.Opcodes.*; + +/** + * Class specialization code. + * @param top class under which species classes are created. + * @param key which identifies individual specializations. + * @param species data type. + */ +/*non-public*/ +abstract class ClassSpecializer.SpeciesData> { + private final Class topClass; + private final Class keyType; + private final Class metaType; + private final MemberName sdAccessor; + private final String sdFieldName; + private final List transformMethods; + private final MethodType baseConstructorType; + private final S topSpecies; + private final ConcurrentMap cache = new ConcurrentHashMap<>(); + private final Factory factory; + private @Stable boolean topClassIsSuper; + + /** Return the top type mirror, for type {@code T} */ + public final Class topClass() { return topClass; } + + /** Return the key type mirror, for type {@code K} */ + public final Class keyType() { return keyType; } + + /** Return the species metadata type mirror, for type {@code S} */ + public final Class metaType() { return metaType; } + + /** Report the leading arguments (if any) required by every species factory. + * Every species factory adds its own field types as additional arguments, + * but these arguments always come first, in every factory method. + */ + protected MethodType baseConstructorType() { return baseConstructorType; } + + /** Return the trivial species for the null sequence of arguments. */ + protected final S topSpecies() { return topSpecies; } + + /** Return the list of transform methods originally given at creation of this specializer. */ + protected final List transformMethods() { return transformMethods; } + + /** Return the factory object used to build and load concrete species code. */ + protected final Factory factory() { return factory; } + + /** + * Constructor for this class specializer. + * @param topClass type mirror for T + * @param keyType type mirror for K + * @param metaType type mirror for S + * @param baseConstructorType principal constructor type + * @param sdAccessor the method used to get the speciesData + * @param sdFieldName the name of the species data field, inject the speciesData object + * @param transformMethods optional list of transformMethods + */ + protected ClassSpecializer(Class topClass, + Class keyType, + Class metaType, + MethodType baseConstructorType, + MemberName sdAccessor, + String sdFieldName, + List transformMethods) { + this.topClass = topClass; + this.keyType = keyType; + this.metaType = metaType; + this.sdAccessor = sdAccessor; + // FIXME: use List.copyOf once 8177290 is in + this.transformMethods = List.of(transformMethods.toArray(new MemberName[transformMethods.size()])); + this.sdFieldName = sdFieldName; + this.baseConstructorType = baseConstructorType.changeReturnType(void.class); + this.factory = makeFactory(); + K tsk = topSpeciesKey(); + S topSpecies = null; + if (tsk != null && topSpecies == null) { + // if there is a key, build the top species if needed: + topSpecies = findSpecies(tsk); + } + this.topSpecies = topSpecies; + } + + // Utilities for subclass constructors: + protected static Constructor reflectConstructor(Class defc, Class... ptypes) { + try { + return defc.getDeclaredConstructor(ptypes); + } catch (NoSuchMethodException ex) { + throw newIAE(defc.getName()+"("+MethodType.methodType(void.class, ptypes)+")", ex); + } + } + + protected static Field reflectField(Class defc, String name) { + try { + return defc.getDeclaredField(name); + } catch (NoSuchFieldException ex) { + throw newIAE(defc.getName()+"."+name, ex); + } + } + + private static RuntimeException newIAE(String message, Throwable cause) { + return new IllegalArgumentException(message, cause); + } + + public final S findSpecies(K key) { + S speciesData = cache.computeIfAbsent(key, new Function<>() { + @Override + public S apply(K key1) { + return factory.loadSpecies(newSpeciesData(key1)); + } + }); + // Note: Species instantiation may throw VirtualMachineError because of + // code cache overflow. If this happens the species bytecode may be + // loaded but not linked to its species metadata (with MH's etc). + // That will cause a throw out of CHM.computeIfAbsent, + // which will shut down the caller thread. + // + // In a latter attempt to get the same species, the already-loaded + // class will be present in the system dictionary, causing an + // error when the species generator tries to reload it. + // We try to detect this case and link the pre-existing code. + // + // Although it would be better to start fresh by loading a new + // copy, we have to salvage the previously loaded but broken code. + // (As an alternative, we might spin a new class with a new name, + // or use the anonymous class mechanism.) + // + // In the end, as long as everybody goes through the same CHM, + // CHM.computeIfAbsent will ensure only one SpeciesData will be set + // successfully on a concrete class if ever. + // The concrete class is published via SpeciesData instance + // returned here only after the class and species data are linked together. + assert(speciesData != null); + return speciesData; + } + + /** + * Meta-data wrapper for concrete subtypes of the top class. + * Each concrete subtype corresponds to a given sequence of basic field types (LIJFD). + * The fields are immutable; their values are fully specified at object construction. + * Each species supplies an array of getter functions which may be used in lambda forms. + * A concrete value is always constructed from the full tuple of its field values, + * accompanied by the required constructor parameters. + * There *may* also be transforms which cloning a species instance and + * either replace a constructor parameter or add one or more new field values. + * The shortest possible species has zero fields. + * Subtypes are not interrelated among themselves by subtyping, even though + * it would appear that a shorter species could serve as a supertype of a + * longer one which extends it. + */ + public abstract class SpeciesData { + // Bootstrapping requires circular relations Class -> SpeciesData -> Class + // Therefore, we need non-final links in the chain. Use @Stable fields. + private final K key; + private final List> fieldTypes; + @Stable private Class speciesCode; + @Stable private List factories; + @Stable private List getters; + @Stable private List nominalGetters; + @Stable private final MethodHandle[] transformHelpers = new MethodHandle[transformMethods.size()]; + + protected SpeciesData(K key) { + this.key = keyType.cast(Objects.requireNonNull(key)); + List> types = deriveFieldTypes(key); + // TODO: List.copyOf + int arity = types.size(); + this.fieldTypes = List.of(types.toArray(new Class[arity])); + } + + public final K key() { + return key; + } + + protected final List> fieldTypes() { + return fieldTypes; + } + + protected final int fieldCount() { + return fieldTypes.size(); + } + + protected ClassSpecializer outer() { + return ClassSpecializer.this; + } + + protected final boolean isResolved() { + return speciesCode != null && factories != null && !factories.isEmpty(); + } + + @Override public String toString() { + return metaType.getSimpleName() + "[" + key.toString() + " => " + (isResolved() ? speciesCode.getSimpleName() : "UNRESOLVED") + "]"; + } + + @Override + public int hashCode() { + return key.hashCode(); + } + + @Override + public boolean equals(Object obj) { + if (!(obj instanceof ClassSpecializer.SpeciesData)) { + return false; + } + @SuppressWarnings("rawtypes") + ClassSpecializer.SpeciesData that = (ClassSpecializer.SpeciesData) obj; + return this.outer() == that.outer() && this.key.equals(that.key); + } + + /** Throws NPE if this species is not yet resolved. */ + protected final Class speciesCode() { + return Objects.requireNonNull(speciesCode); + } + + /** + * Return a {@link MethodHandle} which can get the indexed field of this species. + * The return type is the type of the species field it accesses. + * The argument type is the {@code fieldHolder} class of this species. + */ + protected MethodHandle getter(int i) { + return getters.get(i); + } + + /** + * 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. + */ + protected LambdaForm.NamedFunction getterFunction(int i) { + LambdaForm.NamedFunction nf = nominalGetters.get(i); + assert(nf.memberDeclaringClassOrNull() == speciesCode()); + assert(nf.returnType() == BasicType.basicType(fieldTypes.get(i))); + return nf; + } + + protected List getterFunctions() { + return nominalGetters; + } + + protected List getters() { + return getters; + } + + protected MethodHandle factory() { + return factories.get(0); + } + + protected MethodHandle transformHelper(int whichtm) { + MethodHandle mh = transformHelpers[whichtm]; + if (mh != null) return mh; + mh = deriveTransformHelper(transformMethods().get(whichtm), whichtm); + // Do a little type checking before we start using the MH. + // (It will be called with invokeBasic, so this is our only chance.) + final MethodType mt = transformHelperType(whichtm); + mh = mh.asType(mt); + return transformHelpers[whichtm] = mh; + } + + private final MethodType transformHelperType(int whichtm) { + MemberName tm = transformMethods().get(whichtm); + ArrayList> args = new ArrayList<>(); + ArrayList> fields = new ArrayList<>(); + Collections.addAll(args, tm.getParameterTypes()); + fields.addAll(fieldTypes()); + List> helperArgs = deriveTransformHelperArguments(tm, whichtm, args, fields); + return MethodType.methodType(tm.getReturnType(), helperArgs); + } + + // Hooks for subclasses: + + /** + * Given a key, derive the list of field types, which all instances of this + * species must store. + */ + protected abstract List> deriveFieldTypes(K key); + + /** + * Given the index of a method in the transforms list, supply a factory + * method that takes the arguments of the transform, plus the local fields, + * and produce a value of the required type. + * You can override this to return null or throw if there are no transforms. + * This method exists so that the transforms can be "grown" lazily. + * This is necessary if the transform *adds* a field to an instance, + * which sometimtes requires the creation, on the fly, of an extended species. + * This method is only called once for any particular parameter. + * The species caches the result in a private array. + * + * @param transform the transform being implemented + * @param whichtm the index of that transform in the original list of transforms + * @return the method handle which creates a new result from a mix of transform + * arguments and field values + */ + protected abstract MethodHandle deriveTransformHelper(MemberName transform, int whichtm); + + /** + * During code generation, this method is called once per transform to determine + * what is the mix of arguments to hand to the transform-helper. The bytecode + * which marshals these arguments is open-coded in the species-specific transform. + * The two lists are of opaque objects, which you shouldn't do anything with besides + * reordering them into the output list. (They are both mutable, to make editing + * easier.) The imputed types of the args correspond to the transform's parameter + * list, while the imputed types of the fields correspond to the species field types. + * After code generation, this method may be called occasionally by error-checking code. + * + * @param transform the transform being implemented + * @param whichtm the index of that transform in the original list of transforms + * @param args a list of opaque objects representing the incoming transform arguments + * @param fields a list of opaque objects representing the field values of the receiver + * @param the common element type of the various lists + * @return a new list + */ + protected abstract List deriveTransformHelperArguments(MemberName transform, int whichtm, + List args, List fields); + + /** Given a key, generate the name of the class which implements the species for that key. + * This algorithm must be stable. + * + * @return class name, which by default is {@code outer().topClass().getName() + "$Species_" + deriveTypeString(key)} + */ + protected String deriveClassName() { + return outer().topClass().getName() + "$Species_" + deriveTypeString(); + } + + /** + * Default implementation collects basic type characters, + * plus possibly type names, if some types don't correspond + * to basic types. + * + * @return a string suitable for use in a class name + */ + protected String deriveTypeString() { + List> types = fieldTypes(); + StringBuilder buf = new StringBuilder(); + StringBuilder end = new StringBuilder(); + for (Class type : types) { + BasicType basicType = BasicType.basicType(type); + if (basicType.basicTypeClass() == type) { + buf.append(basicType.basicTypeChar()); + } else { + buf.append('V'); + end.append(classSig(type)); + } + } + String typeString; + if (end.length() > 0) { + typeString = BytecodeName.toBytecodeName(buf.append("_").append(end).toString()); + } else { + typeString = buf.toString(); + } + return LambdaForm.shortenSignature(typeString); + } + + /** + * Report what immediate super-class to use for the concrete class of this species. + * Normally this is {@code topClass}, but if that is an interface, the factory must override. + * The super-class must provide a constructor which takes the {@code baseConstructorType} arguments, if any. + * This hook also allows the code generator to use more than one canned supertype for species. + * + * @return the super-class of the class to be generated + */ + protected Class deriveSuperClass() { + final Class topc = topClass(); + if (!topClassIsSuper) { + try { + final Constructor con = reflectConstructor(topc, baseConstructorType().parameterArray()); + if (!topc.isInterface() && !Modifier.isPrivate(con.getModifiers())) { + topClassIsSuper = true; + } + } catch (Exception|InternalError ex) { + // fall through... + } + if (!topClassIsSuper) { + throw newInternalError("must override if the top class cannot serve as a super class"); + } + } + return topc; + } + } + + protected abstract S newSpeciesData(K key); + + protected K topSpeciesKey() { + return null; // null means don't report a top species + } + + /** + * Code generation support for instances. + * Subclasses can modify the behavior. + */ + public class Factory { + /** + * Get a concrete subclass of the top class for a given combination of bound types. + * + * @param speciesData the species requiring the class, not yet linked + * @return a linked version of the same species + */ + S loadSpecies(S speciesData) { + String className = speciesData.deriveClassName(); + assert(className.indexOf('/') < 0) : className; + Class salvage = null; + try { + salvage = BootLoader.loadClassOrNull(className); + if (TRACE_RESOLVE && salvage != null) { + // Used by jlink species pregeneration plugin, see + // jdk.tools.jlink.internal.plugins.GenerateJLIClassesPlugin + System.out.println("[SPECIES_RESOLVE] " + className + " (salvaged)"); + } + } catch (Error ex) { + if (TRACE_RESOLVE) { + System.out.println("[SPECIES_FRESOLVE] " + className + " (Error) " + ex.getMessage()); + } + } + final Class speciesCode; + if (salvage != null) { + speciesCode = salvage.asSubclass(topClass()); + factory.linkSpeciesDataToCode(speciesData, speciesCode); + factory.linkCodeToSpeciesData(speciesCode, speciesData, true); + } else { + // Not pregenerated, generate the class + try { + speciesCode = generateConcreteSpeciesCode(className, speciesData); + if (TRACE_RESOLVE) { + // Used by jlink species pregeneration plugin, see + // jdk.tools.jlink.internal.plugins.GenerateJLIClassesPlugin + System.out.println("[SPECIES_RESOLVE] " + className + " (generated)"); + } + // This operation causes a lot of churn: + linkSpeciesDataToCode(speciesData, speciesCode); + // This operation commits the relation, but causes little churn: + linkCodeToSpeciesData(speciesCode, speciesData, false); + } catch (Error ex) { + if (TRACE_RESOLVE) { + System.out.println("[SPECIES_RESOLVE] " + className + " (Error #2)" ); + } + // We can get here if there is a race condition loading a class. + // Or maybe we are out of resources. Back out of the CHM.get and retry. + throw ex; + } + } + + if (!speciesData.isResolved()) { + throw newInternalError("bad species class linkage for " + className + ": " + speciesData); + } + assert(speciesData == factory.loadSpeciesDataFromCode(speciesCode)); + return speciesData; + } + + /** + * Generate a concrete subclass of the top class for a given combination of bound types. + * + * A concrete species subclass roughly matches the following schema: + * + *
+         * class Species_[[types]] extends [[T]] {
+         *     final [[S]] speciesData() { return ... }
+         *     static [[T]] make([[fields]]) { return ... }
+         *     [[fields]]
+         *     final [[T]] transform([[args]]) { return ... }
+         * }
+         * 
+ * + * The {@code [[types]]} signature is precisely the key for the species. + * + * 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 #chooseFieldName}. + * + * For example, a concrete species for two references and one integral bound value + * has a shape like the following: + * + *
+         * class TopClass { ... private static
+         * final class Species_LLI extends TopClass {
+         *     final Object argL0;
+         *     final Object argL1;
+         *     final int argI2;
+         *     private Species_LLI(CT ctarg, ..., Object argL0, Object argL1, int argI2) {
+         *         super(ctarg, ...);
+         *         this.argL0 = argL0;
+         *         this.argL1 = argL1;
+         *         this.argI2 = argI2;
+         *     }
+         *     final SpeciesData speciesData() { return BMH_SPECIES; }
+         *     @Stable static SpeciesData BMH_SPECIES; // injected afterwards
+         *     static TopClass make(CT ctarg, ..., Object argL0, Object argL1, int argI2) {
+         *         return new Species_LLI(ctarg, ..., argL0, argL1, argI2);
+         *     }
+         *     final TopClass copyWith(CT ctarg, ...) {
+         *         return new Species_LLI(ctarg, ..., argL0, argL1, argI2);
+         *     }
+         *     // two transforms, for the sake of illustration:
+         *     final TopClass copyWithExtendL(CT ctarg, ..., Object narg) {
+         *         return BMH_SPECIES.transform(L_TYPE).invokeBasic(ctarg, ..., argL0, argL1, argI2, narg);
+         *     }
+         *     final TopClass copyWithExtendI(CT ctarg, ..., int narg) {
+         *         return BMH_SPECIES.transform(I_TYPE).invokeBasic(ctarg, ..., argL0, argL1, argI2, narg);
+         *     }
+         * }
+         * 
+ * + * @param className of the species + * @param speciesData what species we are generating + * @return the generated concrete TopClass class + */ + Class generateConcreteSpeciesCode(String className, ClassSpecializer.SpeciesData speciesData) { + byte[] classFile = generateConcreteSpeciesCodeFile(className, speciesData); + + // load class + InvokerBytecodeGenerator.maybeDump(classBCName(className), classFile); + Class speciesCode; + + ClassLoader cl = topClass().getClassLoader(); + ProtectionDomain pd = null; + if (cl != null) { + pd = AccessController.doPrivileged( + new PrivilegedAction<>() { + @Override + public ProtectionDomain run() { + return topClass().getProtectionDomain(); + } + }); + } + try { + speciesCode = UNSAFE.defineClass(className, classFile, 0, classFile.length, cl, pd); + } catch (Exception ex) { + throw newInternalError(ex); + } + + return speciesCode.asSubclass(topClass()); + } + + // These are named like constants because there is only one per specialization scheme: + private final String SPECIES_DATA = classBCName(metaType); + private final String SPECIES_DATA_SIG = classSig(SPECIES_DATA); + private final String SPECIES_DATA_NAME = sdAccessor.getName(); + private final int SPECIES_DATA_MODS = sdAccessor.getModifiers(); + private final List TRANSFORM_NAMES; // derived from transformMethods + private final List TRANSFORM_TYPES; + private final List TRANSFORM_MODS; + { + // Tear apart transformMethods to get the names, types, and modifiers. + List tns = new ArrayList<>(); + List tts = new ArrayList<>(); + List tms = new ArrayList<>(); + for (int i = 0; i < transformMethods.size(); i++) { + MemberName tm = transformMethods.get(i); + tns.add(tm.getName()); + final MethodType tt = tm.getMethodType(); + tts.add(tt); + tms.add(tm.getModifiers()); + } + TRANSFORM_NAMES = List.of(tns.toArray(new String[0])); + TRANSFORM_TYPES = List.of(tts.toArray(new MethodType[0])); + TRANSFORM_MODS = List.of(tms.toArray(new Integer[0])); + } + private static final int ACC_PPP = ACC_PUBLIC | ACC_PRIVATE | ACC_PROTECTED; + + /*non-public*/ byte[] generateConcreteSpeciesCodeFile(String className0, ClassSpecializer.SpeciesData speciesData) { + final String className = classBCName(className0); + final String superClassName = classBCName(speciesData.deriveSuperClass()); + + 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, superClassName, null); + + final String sourceFile = className.substring(className.lastIndexOf('.')+1); + cw.visitSource(sourceFile, null); + + // emit static types and BMH_SPECIES fields + FieldVisitor fw = cw.visitField(NOT_ACC_PUBLIC + ACC_STATIC, sdFieldName, SPECIES_DATA_SIG, null, null); + fw.visitAnnotation(STABLE_SIG, true); + fw.visitEnd(); + + // handy holder for dealing with groups of typed values (ctor arguments and fields) + class Var { + final int index; + final String name; + final Class type; + final String desc; + final BasicType basicType; + final int slotIndex; + Var(int index, int slotIndex) { + this.index = index; + this.slotIndex = slotIndex; + name = null; type = null; desc = null; + basicType = BasicType.V_TYPE; + } + Var(String name, Class type, Var prev) { + int slotIndex = prev.nextSlotIndex(); + int index = prev.nextIndex(); + if (name == null) name = "x"; + if (name.endsWith("#")) + name = name.substring(0, name.length()-1) + index; + assert(!type.equals(void.class)); + String desc = classSig(type); + BasicType basicType = BasicType.basicType(type); + this.index = index; + this.name = name; + this.type = type; + this.desc = desc; + this.basicType = basicType; + this.slotIndex = slotIndex; + } + Var lastOf(List vars) { + int n = vars.size(); + return (n == 0 ? this : vars.get(n-1)); + } + List fromTypes(List types) { + Var prev = this; + ArrayList result = new ArrayList<>(types.size()); + int i = 0; + for (X x : types) { + String vn = name; + Class vt; + if (x instanceof Class) { + vt = (Class) x; + // make the names friendlier if debugging + assert((vn = vn + "_" + (i++)) != null); + } else { + @SuppressWarnings("unchecked") + Var v = (Var) x; + vn = v.name; + vt = v.type; + } + prev = new Var(vn, vt, prev); + result.add(prev); + } + return result; + } + + int slotSize() { return basicType.basicTypeSlots(); } + int nextIndex() { return index + (slotSize() == 0 ? 0 : 1); } + int nextSlotIndex() { return slotIndex >= 0 ? slotIndex + slotSize() : slotIndex; } + boolean isInHeap() { return slotIndex < 0; } + void emitVarInstruction(int asmop, MethodVisitor mv) { + if (asmop == ALOAD) + asmop = typeLoadOp(basicType.basicTypeChar()); + else + throw new AssertionError("bad op="+asmop+" for desc="+desc); + mv.visitVarInsn(asmop, slotIndex); + } + public void emitFieldInsn(int asmop, MethodVisitor mv) { + mv.visitFieldInsn(asmop, className, name, desc); + } + } + + final Var NO_THIS = new Var(0, 0), + AFTER_THIS = new Var(0, 1), + IN_HEAP = new Var(0, -1); + + // figure out the field types + final List> fieldTypes = speciesData.fieldTypes(); + final List fields = new ArrayList<>(fieldTypes.size()); + { + Var nextF = IN_HEAP; + for (Class ft : fieldTypes) { + String fn = chooseFieldName(ft, nextF.nextIndex()); + nextF = new Var(fn, ft, nextF); + fields.add(nextF); + } + } + + // emit bound argument fields + for (Var field : fields) { + cw.visitField(ACC_FINAL, field.name, field.desc, null, null).visitEnd(); + } + + MethodVisitor mv; + + // emit implementation of speciesData() + mv = cw.visitMethod((SPECIES_DATA_MODS & ACC_PPP) + ACC_FINAL, + SPECIES_DATA_NAME, "()" + SPECIES_DATA_SIG, null, null); + mv.visitCode(); + mv.visitFieldInsn(GETSTATIC, className, sdFieldName, SPECIES_DATA_SIG); + mv.visitInsn(ARETURN); + mv.visitMaxs(0, 0); + mv.visitEnd(); + + // figure out the constructor arguments + MethodType superCtorType = ClassSpecializer.this.baseConstructorType(); + MethodType thisCtorType = superCtorType.appendParameterTypes(fieldTypes); + + // emit constructor + { + mv = cw.visitMethod(ACC_PRIVATE, + "", methodSig(thisCtorType), null, null); + mv.visitCode(); + mv.visitVarInsn(ALOAD, 0); // this + + final List ctorArgs = AFTER_THIS.fromTypes(superCtorType.parameterList()); + for (Var ca : ctorArgs) { + ca.emitVarInstruction(ALOAD, mv); + } + + // super(ca...) + mv.visitMethodInsn(INVOKESPECIAL, superClassName, + "", methodSig(superCtorType), false); + + // store down fields + Var lastFV = AFTER_THIS.lastOf(ctorArgs); + for (Var f : fields) { + // this.argL1 = argL1 + mv.visitVarInsn(ALOAD, 0); // this + lastFV = new Var(f.name, f.type, lastFV); + lastFV.emitVarInstruction(ALOAD, mv); + f.emitFieldInsn(PUTFIELD, mv); + } + + mv.visitInsn(RETURN); + mv.visitMaxs(0, 0); + mv.visitEnd(); + } + + // emit make() ...factory method wrapping constructor + { + MethodType ftryType = thisCtorType.changeReturnType(topClass()); + mv = cw.visitMethod(NOT_ACC_PUBLIC + ACC_STATIC, + "make", methodSig(ftryType), null, null); + mv.visitCode(); + // make instance + mv.visitTypeInsn(NEW, className); + mv.visitInsn(DUP); + // load factory method arguments: ctarg... and arg... + for (Var v : NO_THIS.fromTypes(ftryType.parameterList())) { + v.emitVarInstruction(ALOAD, mv); + } + + // finally, invoke the constructor and return + mv.visitMethodInsn(INVOKESPECIAL, className, + "", methodSig(thisCtorType), false); + mv.visitInsn(ARETURN); + mv.visitMaxs(0, 0); + mv.visitEnd(); + } + + // For each transform, emit the customized override of the transform method. + // This method mixes together some incoming arguments (from the transform's + // static type signature) with the field types themselves, and passes + // the resulting mish-mosh of values to a method handle produced by + // the species itself. (Typically this method handle is the factory + // method of this species or a related one.) + for (int whichtm = 0; whichtm < TRANSFORM_NAMES.size(); whichtm++) { + final String TNAME = TRANSFORM_NAMES.get(whichtm); + final MethodType TTYPE = TRANSFORM_TYPES.get(whichtm); + final int TMODS = TRANSFORM_MODS.get(whichtm); + mv = cw.visitMethod((TMODS & ACC_PPP) | ACC_FINAL, + TNAME, TTYPE.toMethodDescriptorString(), null, E_THROWABLE); + mv.visitCode(); + // return a call to the corresponding "transform helper", something like this: + // MY_SPECIES.transformHelper(whichtm).invokeBasic(ctarg, ..., argL0, ..., xarg) + mv.visitFieldInsn(GETSTATIC, className, + sdFieldName, SPECIES_DATA_SIG); + emitIntConstant(whichtm, mv); + mv.visitMethodInsn(INVOKEVIRTUAL, SPECIES_DATA, + "transformHelper", "(I)" + MH_SIG, false); + + List targs = AFTER_THIS.fromTypes(TTYPE.parameterList()); + List tfields = new ArrayList<>(fields); + // mix them up and load them for the transform helper: + List helperArgs = speciesData.deriveTransformHelperArguments(transformMethods.get(whichtm), whichtm, targs, tfields); + List> helperTypes = new ArrayList<>(helperArgs.size()); + for (Var ha : helperArgs) { + helperTypes.add(ha.basicType.basicTypeClass()); + if (ha.isInHeap()) { + assert(tfields.contains(ha)); + mv.visitVarInsn(ALOAD, 0); + ha.emitFieldInsn(GETFIELD, mv); + } else { + assert(targs.contains(ha)); + ha.emitVarInstruction(ALOAD, mv); + } + } + + // jump into the helper (which is probably a factory method) + final Class rtype = TTYPE.returnType(); + final BasicType rbt = BasicType.basicType(rtype); + MethodType invokeBasicType = MethodType.methodType(rbt.basicTypeClass(), helperTypes); + mv.visitMethodInsn(INVOKEVIRTUAL, MH, + "invokeBasic", methodSig(invokeBasicType), false); + if (rbt == BasicType.L_TYPE) { + mv.visitTypeInsn(CHECKCAST, classBCName(rtype)); + mv.visitInsn(ARETURN); + } else { + throw newInternalError("NYI: transform of type "+rtype); + } + mv.visitMaxs(0, 0); + mv.visitEnd(); + } + + cw.visitEnd(); + + return cw.toByteArray(); + } + + private 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 void emitIntConstant(int con, MethodVisitor mv) { + if (ICONST_M1 - ICONST_0 <= con && con <= ICONST_5 - ICONST_0) + mv.visitInsn(ICONST_0 + con); + else if (con == (byte) con) + mv.visitIntInsn(BIPUSH, con); + else if (con == (short) con) + mv.visitIntInsn(SIPUSH, con); + else { + mv.visitLdcInsn(con); + } + + } + + // + // Getter MH generation. + // + + private MethodHandle findGetter(Class speciesCode, List> types, int index) { + Class fieldType = types.get(index); + String fieldName = chooseFieldName(fieldType, index); + try { + return IMPL_LOOKUP.findGetter(speciesCode, fieldName, fieldType); + } catch (NoSuchFieldException | IllegalAccessException e) { + throw newInternalError(e); + } + } + + private List findGetters(Class speciesCode, List> types) { + MethodHandle[] mhs = new MethodHandle[types.size()]; + for (int i = 0; i < mhs.length; ++i) { + mhs[i] = findGetter(speciesCode, types, i); + assert(mhs[i].internalMemberName().getDeclaringClass() == speciesCode); + } + return List.of(mhs); + } + + private List findFactories(Class speciesCode, List> types) { + MethodHandle[] mhs = new MethodHandle[1]; + mhs[0] = findFactory(speciesCode, types); + return List.of(mhs); + } + + List makeNominalGetters(List> types, List getters) { + LambdaForm.NamedFunction[] nfs = new LambdaForm.NamedFunction[types.size()]; + for (int i = 0; i < nfs.length; ++i) { + nfs[i] = new LambdaForm.NamedFunction(getters.get(i)); + } + return List.of(nfs); + } + + // + // Auxiliary methods. + // + + protected void linkSpeciesDataToCode(ClassSpecializer.SpeciesData speciesData, Class speciesCode) { + speciesData.speciesCode = speciesCode.asSubclass(topClass); + final List> types = speciesData.fieldTypes; + speciesData.factories = this.findFactories(speciesCode, types); + speciesData.getters = this.findGetters(speciesCode, types); + speciesData.nominalGetters = this.makeNominalGetters(types, speciesData.getters); + } + + private Field reflectSDField(Class speciesCode) { + final Field field = reflectField(speciesCode, sdFieldName); + assert(field.getType() == metaType); + assert(Modifier.isStatic(field.getModifiers())); + return field; + } + + private S readSpeciesDataFromCode(Class speciesCode) { + try { + MemberName sdField = IMPL_LOOKUP.resolveOrFail(REF_getStatic, speciesCode, sdFieldName, metaType); + Object base = MethodHandleNatives.staticFieldBase(sdField); + long offset = MethodHandleNatives.staticFieldOffset(sdField); + UNSAFE.loadFence(); + return metaType.cast(UNSAFE.getObject(base, offset)); + } catch (Error err) { + throw err; + } catch (Exception ex) { + throw newInternalError("Failed to load speciesData from speciesCode: " + speciesCode.getName(), ex); + } catch (Throwable t) { + throw uncaughtException(t); + } + } + + protected S loadSpeciesDataFromCode(Class speciesCode) { + if (speciesCode == topClass()) { + return topSpecies; + } + S result = readSpeciesDataFromCode(speciesCode); + if (result.outer() != ClassSpecializer.this) { + throw newInternalError("wrong class"); + } + return result; + } + + protected void linkCodeToSpeciesData(Class speciesCode, ClassSpecializer.SpeciesData speciesData, boolean salvage) { + try { + assert(readSpeciesDataFromCode(speciesCode) == null || + (salvage && readSpeciesDataFromCode(speciesCode).equals(speciesData))); + + MemberName sdField = IMPL_LOOKUP.resolveOrFail(REF_putStatic, speciesCode, sdFieldName, metaType); + Object base = MethodHandleNatives.staticFieldBase(sdField); + long offset = MethodHandleNatives.staticFieldOffset(sdField); + UNSAFE.storeFence(); + UNSAFE.putObject(base, offset, speciesData); + UNSAFE.storeFence(); + } catch (Error err) { + throw err; + } catch (Exception ex) { + throw newInternalError("Failed to link speciesData to speciesCode: " + speciesCode.getName(), ex); + } catch (Throwable t) { + throw uncaughtException(t); + } + } + + /** + * Field names in concrete species classes adhere to this pattern: + * type + index, where type is a single character (L, I, J, F, D). + * The factory subclass can customize this. + * The name is purely cosmetic, since it applies to a private field. + */ + protected String chooseFieldName(Class type, int index) { + BasicType bt = BasicType.basicType(type); + return "" + bt.basicTypeChar() + index; + } + + MethodHandle findFactory(Class speciesCode, List> types) { + final MethodType type = baseConstructorType().changeReturnType(topClass()).appendParameterTypes(types); + try { + return IMPL_LOOKUP.findStatic(speciesCode, "make", type); + } catch (NoSuchMethodException | IllegalAccessException | IllegalArgumentException | TypeNotPresentException e) { + throw newInternalError(e); + } + } + } + + /** Hook that virtualizes the Factory class, allowing subclasses to extend it. */ + protected Factory makeFactory() { + return new Factory(); + } + + + // Other misc helpers: + private static final String MH = "java/lang/invoke/MethodHandle"; + private static final String MH_SIG = "L" + MH + ";"; + private static final String STABLE = "jdk/internal/vm/annotation/Stable"; + private static final String STABLE_SIG = "L" + STABLE + ";"; + private static final String[] E_THROWABLE = new String[] { "java/lang/Throwable" }; + static { + assert(MH_SIG.equals(classSig(MethodHandle.class))); + assert(MH.equals(classBCName(MethodHandle.class))); + } + + static String methodSig(MethodType mt) { + return mt.toMethodDescriptorString(); + } + static String classSig(Class cls) { + if (cls.isPrimitive() || cls.isArray()) + return MethodType.methodType(cls).toMethodDescriptorString().substring(2); + return classSig(classBCName(cls)); + } + static String classSig(String bcName) { + assert(bcName.indexOf('.') < 0); + assert(!bcName.endsWith(";")); + assert(!bcName.startsWith("[")); + return "L" + bcName + ";"; + } + static String classBCName(Class cls) { + return classBCName(className(cls)); + } + static String classBCName(String str) { + assert(str.indexOf('/') < 0) : str; + return str.replace('.', '/'); + } + static String className(Class cls) { + assert(!cls.isArray() && !cls.isPrimitive()); + return cls.getName(); + } +} diff --git a/src/java.base/share/classes/java/lang/invoke/GenerateJLIClassesHelper.java b/src/java.base/share/classes/java/lang/invoke/GenerateJLIClassesHelper.java index d8e6dcd5ed0..b0af88804d6 100644 --- a/src/java.base/share/classes/java/lang/invoke/GenerateJLIClassesHelper.java +++ b/src/java.base/share/classes/java/lang/invoke/GenerateJLIClassesHelper.java @@ -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 generateConcreteBMHClassBytes( - final String types) { + @SuppressWarnings({"rawtypes", "unchecked"}) + static Map.Entry 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); } } diff --git a/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java b/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java index 7349ea2bec4..b18ecda3361 100644 --- a/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java +++ b/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java @@ -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); diff --git a/src/java.base/share/classes/java/lang/invoke/LambdaForm.java b/src/java.base/share/classes/java/lang/invoke/LambdaForm.java index efb7e9490dd..49e99f396cb 100644 --- a/src/java.base/share/classes/java/lang/invoke/LambdaForm.java +++ b/src/java.base/share/classes/java/lang/invoke/LambdaForm.java @@ -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); diff --git a/src/java.base/share/classes/java/lang/invoke/LambdaFormBuffer.java b/src/java.base/share/classes/java/lang/invoke/LambdaFormBuffer.java index bcf1733461b..e627ad896a2 100644 --- a/src/java.base/share/classes/java/lang/invoke/LambdaFormBuffer.java +++ b/src/java.base/share/classes/java/lang/invoke/LambdaFormBuffer.java @@ -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 oldFns, List 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; diff --git a/src/java.base/share/classes/java/lang/invoke/LambdaFormEditor.java b/src/java.base/share/classes/java/lang/invoke/LambdaFormEditor.java index 868e82fe67a..4ebcd51dcd6 100644 --- a/src/java.base/share/classes/java/lang/invoke/LambdaFormEditor.java +++ b/src/java.base/share/classes/java/lang/invoke/LambdaFormEditor.java @@ -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); diff --git a/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java b/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java index bf3b30443a6..c1a3ddd70b8 100644 --- a/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java +++ b/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java @@ -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); @@ -1885,7 +1885,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); @@ -2128,7 +2128,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); diff --git a/src/java.base/share/classes/java/lang/invoke/SimpleMethodHandle.java b/src/java.base/share/classes/java/lang/invoke/SimpleMethodHandle.java index c9e37a81ff4..99a8020aee6 100644 --- a/src/java.base/share/classes/java/lang/invoke/SimpleMethodHandle.java +++ b/src/java.base/share/classes/java/lang/invoke/SimpleMethodHandle.java @@ -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); } diff --git a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/GenerateJLIClassesPlugin.java b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/GenerateJLIClassesPlugin.java index 99771fe4965..a5c4597efef 100644 --- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/GenerateJLIClassesPlugin.java +++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/GenerateJLIClassesPlugin.java @@ -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; diff --git a/test/jdk/java/lang/invoke/ClassSpecializerTest.java b/test/jdk/java/lang/invoke/ClassSpecializerTest.java new file mode 100644 index 00000000000..671cf39e217 --- /dev/null +++ b/test/jdk/java/lang/invoke/ClassSpecializerTest.java @@ -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 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 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(); + } +} diff --git a/test/jdk/java/lang/invoke/java.base/java/lang/invoke/ClassSpecializerHelper.java b/test/jdk/java/lang/invoke/java.base/java/lang/invoke/ClassSpecializerHelper.java new file mode 100644 index 00000000000..3de9a04a3a9 --- /dev/null +++ b/test/jdk/java/lang/invoke/java.base/java/lang/invoke/ClassSpecializerHelper.java @@ -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 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 asList() { + final List getters = kind().getters(); + ArrayList 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.SpeciesData { + public Kind(SpecTest outer, Byte key) { + outer.super(key); + } + + public MethodHandle factory() { + return super.factory(); + } + + public List getters() { + return super.getters(); + } + + private static final List> 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> deriveFieldTypes(Byte key) { + return FIELD_TYPES.subList(0, key); + } + + @Override + protected Class deriveSuperClass() { + return FrobImpl.class; + } + + @Override + protected MethodHandle deriveTransformHelper(MemberName transform, int whichtm) { + throw new AssertionError(); + } + + @Override + protected List deriveTransformHelperArguments(MemberName transform, int whichtm, List args, List fields) { + throw new AssertionError(); + } + } + + class SpecTest extends ClassSpecializer { + 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(); + +} + diff --git a/test/jdk/tools/jlink/plugins/GenerateJLIClassesPluginTest.java b/test/jdk/tools/jlink/plugins/GenerateJLIClassesPluginTest.java index d1510affb5e..cd7bfd38b4e 100644 --- a/test/jdk/tools/jlink/plugins/GenerateJLIClassesPluginTest.java +++ b/test/jdk/tools/jlink/plugins/GenerateJLIClassesPluginTest.java @@ -21,6 +21,8 @@ * questions. */ +import java.nio.charset.Charset; +import java.nio.file.Files; import java.nio.file.Path; import java.util.Collection; import java.util.List; @@ -74,11 +76,30 @@ public class GenerateJLIClassesPluginTest { classFilesForSpecies(GenerateJLIClassesPlugin.defaultSpecies()), List.of()); + // Check that --generate-jli-classes=@file works as intended + Path baseFile = Files.createTempFile("base", "trace"); + String species = "LLLLLLLLLLLLLLLLLLL"; + String fileString = "[SPECIES_RESOLVE] java.lang.invoke.BoundMethodHandle$Species_" + species + " (salvaged)\n"; + Files.write(baseFile, fileString.getBytes(Charset.defaultCharset())); + result = JImageGenerator.getJLinkTask() + .modulePath(helper.defaultModulePath()) + .output(helper.createNewImageDir("generate-jli-file")) + .option("--generate-jli-classes=@" + baseFile.toString()) + .addMods("java.base") + .call(); + + image = result.assertSuccess(); + + JImageValidator.validate( + image.resolve("lib").resolve("modules"), + classFilesForSpecies(List.of(species)), // species should be in the image + classFilesForSpecies(List.of(species.substring(1)))); // but not it's immediate parent } private static List classFilesForSpecies(Collection species) { return species.stream() - .map(s -> "/java.base/java/lang/invoke/BoundMethodHandle$Species_" + s + ".class") + .map(s -> "/java.base/java/lang/invoke/BoundMethodHandle$Species_" + + GenerateJLIClassesPlugin.expandSignature(s) + ".class") .collect(Collectors.toList()); } }