changeset 10759:6ed3821c212a jdk8u60-b16

Merge
author lana
date Thu, 14 May 2015 20:11:36 -0700
parents f4bb5ff96bc5 28826749de15
children c30db4c968f6 133fcf8ccc7d
files
diffstat 69 files changed, 1951 insertions(+), 985 deletions(-) [+]
line wrap: on
line diff
--- a/make/data/tzdata/VERSION	Wed May 13 12:50:09 2015 -0700
+++ b/make/data/tzdata/VERSION	Thu May 14 20:11:36 2015 -0700
@@ -21,4 +21,4 @@
 # or visit www.oracle.com if you need additional information or have any
 # questions.
 #
-tzdata2015b
+tzdata2015d
--- a/make/data/tzdata/africa	Wed May 13 12:50:09 2015 -0700
+++ b/make/data/tzdata/africa	Thu May 14 20:11:36 2015 -0700
@@ -342,35 +342,29 @@
 # above) says DST had no affect on electricity consumption.  There is
 # no information about when DST will end this fall.  See:
 # http://abcnews.go.com/International/wireStory/el-sissi-pushes-egyptians-line-23614833
+
+# From Steffen Thorsen (2015-04-08):
+# Egypt will start DST on midnight after Thursday, April 30, 2015.
+# This is based on a law (no 35) from May 15, 2014 saying it starts the last
+# 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
+
+# From Ahmed Nazmy (2015-04-20):
+# Egypt's ministers cabinet just announced ... that it will cancel DST at
+# least for 2015.
 #
-# For now, guess that later spring and fall transitions will use
-# 2010's rules, and guess that Egypt will switch to standard time at
-# 24:00 the last Thursday before Ramadan, and back to DST at 00:00 the
-# first Friday after Ramadan.  To implement this,
-# transition dates for 2015 through 2037 were determined by running
-# the following program under GNU Emacs 24.3, with the results integrated
-# by hand into the table below.  Ramadan again intrudes on the guessed
-# DST starting in 2038, but that's beyond our somewhat-arbitrary cutoff.
-# (let ((islamic-year 1436))
-#   (while (< islamic-year 1460)
-#     (let ((a (calendar-islamic-to-absolute (list 9 1 islamic-year)))
-#           (b (calendar-islamic-to-absolute (list 10 1 islamic-year)))
-#           (friday 5))
-#       (while (/= friday (mod a 7))
-#         (setq a (1- a)))
-#       (while (/= friday (mod b 7))
-#         (setq b (1+ b)))
-#       (setq a (1- a))
-#       (setq b (1- b))
-#       (setq a (calendar-gregorian-from-absolute a))
-#       (setq b (calendar-gregorian-from-absolute b))
-#       (insert
-#        (format
-#         (concat "Rule\tEgypt\t%d\tonly\t-\t%s\t%2d\t24:00\t0\t-\n"
-#                 "Rule\tEgypt\t%d\tonly\t-\t%s\t%2d\t24:00\t1:00\tS\n")
-#         (car (cdr (cdr a))) (calendar-month-name (car a) t) (car (cdr a))
-#         (car (cdr (cdr b))) (calendar-month-name (car b) t) (car (cdr b)))))
-#     (setq islamic-year (+ 1 islamic-year))))
+# From Tim Parenti (2015-04-20):
+# http://english.ahram.org.eg/WriterArticles/NewsContentP/1/128195/Egypt/No-daylight-saving-this-summer-Egypts-prime-minist.aspx
+# "Egypt's cabinet agreed on Monday not to switch clocks for daylight saving
+# time this summer, and carry out studies on the possibility of canceling the
+# practice altogether in future years."
+#
+# From Paul Eggert (2015-04-20):
+# For now, assume DST will be canceled.  Any resumption would likely
+# use different rules anyway.
+
 Rule	Egypt	2008	only	-	Aug	lastThu	24:00	0	-
 Rule	Egypt	2009	only	-	Aug	20	24:00	0	-
 Rule	Egypt	2010	only	-	Aug	10	24:00	0	-
@@ -379,22 +373,7 @@
 Rule	Egypt	2014	only	-	May	15	24:00	1:00	S
 Rule	Egypt	2014	only	-	Jun	26	24:00	0	-
 Rule	Egypt	2014	only	-	Jul	31	24:00	1:00	S
-Rule	Egypt	2014	max	-	Sep	lastThu	24:00	0	-
-Rule	Egypt	2015	2019	-	Apr	lastFri	 0:00s	1:00	S
-Rule	Egypt	2015	only	-	Jun	11	24:00	0	-
-Rule	Egypt	2015	only	-	Jul	23	24:00	1:00	S
-Rule	Egypt	2016	only	-	Jun	 2	24:00	0	-
-Rule	Egypt	2016	only	-	Jul	 7	24:00	1:00	S
-Rule	Egypt	2017	only	-	May	25	24:00	0	-
-Rule	Egypt	2017	only	-	Jun	29	24:00	1:00	S
-Rule	Egypt	2018	only	-	May	10	24:00	0	-
-Rule	Egypt	2018	only	-	Jun	14	24:00	1:00	S
-Rule	Egypt	2019	only	-	May	 2	24:00	0	-
-Rule	Egypt	2019	only	-	Jun	 6	24:00	1:00	S
-Rule	Egypt	2020	only	-	May	28	24:00	1:00	S
-Rule	Egypt	2021	only	-	May	13	24:00	1:00	S
-Rule	Egypt	2022	only	-	May	 5	24:00	1:00	S
-Rule	Egypt	2023	max	-	Apr	lastFri	 0:00s	1:00	S
+Rule	Egypt	2014	only	-	Sep	lastThu	24:00	0	-
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Africa/Cairo	2:05:09 -	LMT	1900 Oct
--- a/make/data/tzdata/antarctica	Wed May 13 12:50:09 2015 -0700
+++ b/make/data/tzdata/antarctica	Thu May 14 20:11:36 2015 -0700
@@ -38,41 +38,6 @@
 # I made up all time zone abbreviations mentioned here; corrections welcome!
 # FORMAT is 'zzz' and GMTOFF is 0 for locations while uninhabited.
 
-# These rules are stolen from the 'southamerica' file.
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	ArgAQ	1964	1966	-	Mar	 1	0:00	0	-
-Rule	ArgAQ	1964	1966	-	Oct	15	0:00	1:00	S
-Rule	ArgAQ	1967	only	-	Apr	 2	0:00	0	-
-Rule	ArgAQ	1967	1968	-	Oct	Sun>=1	0:00	1:00	S
-Rule	ArgAQ	1968	1969	-	Apr	Sun>=1	0:00	0	-
-Rule	ArgAQ	1974	only	-	Jan	23	0:00	1:00	S
-Rule	ArgAQ	1974	only	-	May	 1	0:00	0	-
-Rule	ChileAQ	1972	1986	-	Mar	Sun>=9	3:00u	0	-
-Rule	ChileAQ	1974	1987	-	Oct	Sun>=9	4:00u	1:00	S
-Rule	ChileAQ	1987	only	-	Apr	12	3:00u	0	-
-Rule	ChileAQ	1988	1989	-	Mar	Sun>=9	3:00u	0	-
-Rule	ChileAQ	1988	only	-	Oct	Sun>=1	4:00u	1:00	S
-Rule	ChileAQ	1989	only	-	Oct	Sun>=9	4:00u	1:00	S
-Rule	ChileAQ	1990	only	-	Mar	18	3:00u	0	-
-Rule	ChileAQ	1990	only	-	Sep	16	4:00u	1:00	S
-Rule	ChileAQ	1991	1996	-	Mar	Sun>=9	3:00u	0	-
-Rule	ChileAQ	1991	1997	-	Oct	Sun>=9	4:00u	1:00	S
-Rule	ChileAQ	1997	only	-	Mar	30	3:00u	0	-
-Rule	ChileAQ	1998	only	-	Mar	Sun>=9	3:00u	0	-
-Rule	ChileAQ	1998	only	-	Sep	27	4:00u	1:00	S
-Rule	ChileAQ	1999	only	-	Apr	 4	3:00u	0	-
-Rule	ChileAQ	1999	2010	-	Oct	Sun>=9	4:00u	1:00	S
-Rule	ChileAQ	2000	2007	-	Mar	Sun>=9	3:00u	0	-
-# N.B.: the end of March 29 in Chile is March 30 in Universal time,
-# which is used below in specifying the transition.
-Rule	ChileAQ	2008	only	-	Mar	30	3:00u	0	-
-Rule	ChileAQ	2009	only	-	Mar	Sun>=9	3:00u	0	-
-Rule	ChileAQ	2010	only	-	Apr	Sun>=1	3:00u	0	-
-Rule	ChileAQ	2011	only	-	May	Sun>=2	3:00u	0	-
-Rule	ChileAQ	2011	only	-	Aug	Sun>=16	4:00u	1:00	S
-Rule	ChileAQ	2012	2015	-	Apr	Sun>=23	3:00u	0	-
-Rule	ChileAQ	2012	2014	-	Sep	Sun>=2	4:00u	1:00	S
-
 # Argentina - year-round bases
 # Belgrano II, Confin Coast, -770227-0343737, since 1972-02-05
 # Carlini, Potter Cove, King George Island, -6414-0602320, since 1982-01
@@ -367,21 +332,7 @@
 # USA - year-round bases
 #
 # Palmer, Anvers Island, since 1965 (moved 2 miles in 1968)
-#
-# From Ethan Dicks (1996-10-06):
-# It keeps the same time as Punta Arenas, Chile, because, just like us
-# and the South Pole, that's the other end of their supply line....
-# I verified with someone who was there that since 1980,
-# Palmer has followed Chile.  Prior to that, before the Falklands War,
-# Palmer used to be supplied from Argentina.
-#
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Antarctica/Palmer	0	-	zzz	1965
-			-4:00	ArgAQ	AR%sT	1969 Oct  5
-			-3:00	ArgAQ	AR%sT	1982 May
-			-4:00	ChileAQ	CL%sT	2015 Apr 26 3:00u
-			-3:00	-	CLT
-#
+# See 'southamerica' for Antarctica/Palmer, since it uses South American DST.
 #
 # McMurdo Station, Ross Island, since 1955-12
 # Amundsen-Scott South Pole Station, continuously occupied since 1956-11-20
--- a/make/data/tzdata/backward	Wed May 13 12:50:09 2015 -0700
+++ b/make/data/tzdata/backward	Thu May 14 20:11:36 2015 -0700
@@ -43,6 +43,7 @@
 Link	America/Indiana/Knox	America/Knox_IN
 Link	America/Kentucky/Louisville	America/Louisville
 Link	America/Argentina/Mendoza	America/Mendoza
+Link	America/Toronto		America/Montreal
 Link	America/Rio_Branco	America/Porto_Acre
 Link	America/Argentina/Cordoba	America/Rosario
 Link	America/Denver		America/Shiprock
--- a/make/data/tzdata/europe	Wed May 13 12:50:09 2015 -0700
+++ b/make/data/tzdata/europe	Thu May 14 20:11:36 2015 -0700
@@ -99,7 +99,7 @@
 #        1:00:14    SET           Swedish (1879-1899)*
 #        2:00       EET EEST      Eastern Europe
 #        3:00       FET           Further-eastern Europe (2011-2014)*
-#        3:00       MSK MSD  MSM* Moscow
+#        3:00       MSK MSD  MSM* Minsk, Moscow
 
 # From Peter Ilieve (1994-12-04),
 # The original six [EU members]: Belgium, France, (West) Germany, Italy,
--- a/make/data/tzdata/northamerica	Wed May 13 12:50:09 2015 -0700
+++ b/make/data/tzdata/northamerica	Thu May 14 20:11:36 2015 -0700
@@ -250,9 +250,14 @@
 # The law doesn't give abbreviations.
 #
 # From Paul Eggert (2000-01-08), following a heads-up from Rives McDow:
-# Public law 106-564 (2000-12-23) introduced the abbreviation
-# "Chamorro Standard Time" for time in Guam and the Northern Marianas.
-# See the file "australasia".
+# Public law 106-564 (2000-12-23) introduced ... "Chamorro Standard Time"
+# for time in Guam and the Northern Marianas.  See the file "australasia".
+#
+# From Paul Eggert (2015-04-17):
+# 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
 
 # From Arthur David Olson, 2005-08-09
 # The following was signed into law on 2005-08-08.
@@ -559,7 +564,7 @@
 			-11:00	-	BST	1969
 			-11:00	US	B%sT	1983 Oct 30  2:00
 			-10:00	US	AH%sT	1983 Nov 30
-			-10:00	US	HA%sT
+			-10:00	US	H%sT
 # The following switches don't quite make our 1970 cutoff.
 #
 # Shanks writes that part of southwest Alaska (e.g. Aniak)
@@ -1354,14 +1359,9 @@
 
 # Quebec
 
-# From Paul Eggert (2013-08-30):
-# Since 1970 most of Quebec has been like Toronto.
-# However, because earlier versions of the tz database mistakenly relied on data
-# from Shanks & Pottenger saying that Quebec differed from Ontario after 1970,
-# a separate entry was created for most of Quebec.  We're loath to lose
-# its pre-1970 info, even though the tz database is normally limited to
-# zones that differ after 1970, so keep this otherwise out-of-scope entry.
-
+# From Paul Eggert (2015-03-24):
+# See America/Toronto for most of Quebec, including Montreal.
+#
 # Matthews and Vincent (1998) also write that Quebec east of the -63
 # meridian is supposed to observe AST, but residents as far east as
 # Natashquan use EST/EDT, and residents east of Natashquan use AST.
@@ -1375,39 +1375,10 @@
 # For lack of better info, guess this practice began around 1970, contra to
 # Shanks & Pottenger who have this region observing AST/ADT.
 
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Mont	1917	only	-	Mar	25	2:00	1:00	D
-Rule	Mont	1917	only	-	Apr	24	0:00	0	S
-Rule	Mont	1919	only	-	Mar	31	2:30	1:00	D
-Rule	Mont	1919	only	-	Oct	25	2:30	0	S
-Rule	Mont	1920	only	-	May	 2	2:30	1:00	D
-Rule	Mont	1920	1922	-	Oct	Sun>=1	2:30	0	S
-Rule	Mont	1921	only	-	May	 1	2:00	1:00	D
-Rule	Mont	1922	only	-	Apr	30	2:00	1:00	D
-Rule	Mont	1924	only	-	May	17	2:00	1:00	D
-Rule	Mont	1924	1926	-	Sep	lastSun	2:30	0	S
-Rule	Mont	1925	1926	-	May	Sun>=1	2:00	1:00	D
-Rule	Mont	1927	1937	-	Apr	lastSat	24:00	1:00	D
-Rule	Mont	1927	1937	-	Sep	lastSat	24:00	0	S
-Rule	Mont	1938	1940	-	Apr	lastSun	0:00	1:00	D
-Rule	Mont	1938	1939	-	Sep	lastSun	0:00	0	S
-Rule	Mont	1946	1973	-	Apr	lastSun	2:00	1:00	D
-Rule	Mont	1945	1948	-	Sep	lastSun	2:00	0	S
-Rule	Mont	1949	1950	-	Oct	lastSun	2:00	0	S
-Rule	Mont	1951	1956	-	Sep	lastSun	2:00	0	S
-Rule	Mont	1957	1973	-	Oct	lastSun	2:00	0	S
-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone America/Blanc-Sablon -3:48:28 -	LMT	1884
 			-4:00	Canada	A%sT	1970
 			-4:00	-	AST
-Zone America/Montreal	-4:54:16 -	LMT	1884
-			-5:00	Mont	E%sT	1918
-			-5:00	Canada	E%sT	1919
-			-5:00	Mont	E%sT	1942 Feb  9  2:00s
-			-5:00	Canada	E%sT	1946
-			-5:00	Mont	E%sT	1974
-			-5:00	Canada	E%sT
 
 # Ontario
 
@@ -1898,17 +1869,115 @@
 # Dawson switched to PST in 1973.  Inuvik switched to MST in 1979.
 # Mathew Englander (1996-10-07) gives the following refs:
 #	* 1967. Paragraph 28(34)(g) of the Interpretation Act, S.C. 1967-68,
-#	c. 7 defines Yukon standard time as UTC-9.  This is still valid;
+#	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]
 #	* 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.
-# Shanks & Pottenger say Yukon's 1973-10-28 switch was at 2:00; go
-# with Englander.
-# From Chris Walton (2006-06-26):
-# Here is a link to the old daylight saving portion of the interpretation
-# act which was last updated in 1987:
-# http://www.gov.yk.ca/legislation/regs/oic1987_056.pdf
+
+# From Brian Inglis (2015-04-14):
+#
+# I tried to trace the history of Yukon time and found the following
+# regulations, giving the reference title and URL if found, regulation name,
+# and relevant quote if available.  Each regulation specifically revokes its
+# predecessor.  The final reference is to the current Interpretation Act
+# authorizing and resulting from these regulatory changes.
+#
+# Only recent regulations were retrievable via Yukon government site search or
+# index, and only some via Canadian legal sources.  Other sources used include
+# articles titled "Standard Time and Time Zones in Canada" from JRASC via ADS
+# Abstracts, cited by ADO for 1932 ..., and updated versions from 1958 and
+# 1970 quoted below; each article includes current extracts from provincial
+# and territorial ST and DST regulations at the end, summaries and details of
+# standard times and daylight saving time at many locations across Canada,
+# with time zone maps, tables and calculations for Canadian Sunrise, Sunset,
+# and LMST; they also cover many countries and global locations, with a chart
+# and table showing current Universal Time offsets, and may be useful as
+# another source of information for 1970 and earlier.
+#
+# * Standard Time and Time Zones in Canada; Smith, C.C.; JRASC, Vol. 26,
+#   pp.49-77; February 1932; SAO/NASA Astrophysics Data System (ADS)
+#   http://adsabs.harvard.edu/abs/1932JRASC..26...49S from p.75:
+#   Yukon Interpretation Ordinance
+#   Yukon standard time is the local mean time at the one hundred and
+#   thirty-fifth meridian.
+#
+# * Standard Time and Time Zones in Canada; Smith, C.C.; Thomson, Malcolm M.;
+#   JRASC, Vol. 52, pp.193-223; October 1958; SAO/NASA Astrophysics Data System
+#   (ADS) http://adsabs.harvard.edu/abs/1958JRASC..52..193S from pp.220-1:
+#   Yukon Interpretation Ordinance, 1955, Chap. 16.
+#
+#     (1) Subject to this section, standard time shall be reckoned as nine
+#     hours behind Greenwich Time and called Yukon Standard Time.
+#
+#     (2) Notwithstanding subsection (1), the Commissioner may make regulations
+#     varying the manner of reckoning standard time.
+#
+# * Yukon Territory Commissioner's Order 1966-20 Interpretation Ordinance
+#   http://? - no online source found
+#
+# * Standard Time and Time Zones in Canada; Thomson, Malcolm M.; JRASC,
+#   Vol. 64, pp.129-162; June 1970; SAO/NASA Astrophysics Data System (ADS)
+#   http://adsabs.harvard.edu/abs/1970JRASC..64..129T from p.156: Yukon
+#   Territory Commissioner's Order 1967-59 Interpretation Ordinance ...
+#
+#     1. Commissioner's Order 1966-20 dated at Whitehorse in the Yukon
+#     Territory on 27th January, 1966, is hereby revoked.
+#
+#     2. Yukon (East) Standard Time as defined by section 36 of the
+#     Interpretation Ordinance from and after mid-night on the 28th day of May,
+#     1967 shall be reckoned in the same manner as Pacific Standard Time, that
+#     is to say, eight hours behind Greenwich Time in the area of the Yukon
+#     Territory lying east of the 138th degree longitude west.
+#
+#     3. In the remainder of the Territory, lying west of the 138th degree
+#     longitude west, Yukon (West) Standard Time shall be reckoned as nine
+#     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
+#   C.O. 1973/214 INTERPRETATION ACT ...
+#
+#     1. Effective October 28, 1973 Commissioner's Order 1967/59 is hereby
+#     revoked.
+#
+#     2. Yukon Standard Time as defined by section 36 of the Interpretation
+#     Act from and after midnight on the twenty-eighth day of October, 1973
+#     shall be reckoned in the same manner as Pacific Standard Time, that is
+#     to say eight hours behind Greenwich Time.
+#
+# * O.I.C. 1980/02 INTERPRETATION ACT
+#   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
+#   O.I.C. 1987/056 INTERPRETATION ACT ...
+#
+#   In every year between
+#     (a) two o'clock in the morning in the first Sunday in April, and
+#     (b) two o'clock in the morning in the last Sunday in October,
+#   Standard Time shall be reckoned as seven hours behind Greenwich Time and
+#   called Yukon Daylight Saving Time.
+#   ...
+#   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
+#   O.I.C. 2006/127 INTERPRETATION ACT ...
+#
+#     1. In Yukon each year the time for general purposes shall be 7 hours
+#     behind Greenwich mean time during the period commencing at two o'clock
+#     in the forenoon on the second Sunday of March and ending at two o'clock
+#     in the forenoon on the first Sunday of November and shall be called
+#     Yukon Daylight Saving Time.
+#
+#     2. Order-in-Council 1987/56 is revoked.
+#
+#     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
 
 # From Rives McDow (1999-09-04):
 # Nunavut ... moved ... to incorporate the whole territory into one time zone.
@@ -2134,7 +2203,7 @@
 			-7:00	NT_YK	M%sT	1980
 			-7:00	Canada	M%sT
 Zone America/Whitehorse	-9:00:12 -	LMT	1900 Aug 20
-			-9:00	NT_YK	Y%sT	1966 Jul  1  2:00
+			-9:00	NT_YK	Y%sT	1967 May 28  0:00
 			-8:00	NT_YK	P%sT	1980
 			-8:00	Canada	P%sT
 Zone America/Dawson	-9:17:40 -	LMT	1900 Aug 20
--- a/make/data/tzdata/southamerica	Wed May 13 12:50:09 2015 -0700
+++ b/make/data/tzdata/southamerica	Thu May 14 20:11:36 2015 -0700
@@ -1121,6 +1121,60 @@
 
 # Chile
 
+# From Paul Eggert (2015-04-03):
+# Shanks & Pottenger says America/Santiago introduced standard time in
+# 1890 and rounds its UTC offset to 70W40; guess that in practice this
+# was the same offset as in 1916-1919.  It also says Pacific/Easter
+# standardized on 109W22 in 1890; assume this didn't change the clocks.
+#
+# Dates for America/Santiago from 1910 to 2004 are primarily from
+# 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:
+# 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
+# [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
+# 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
+# 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:
+#
+#  - [1] says the 1910 transition was Jan 1, [2] says Jan 10 and cites
+#    Boletín Nº 1, Aviso Nº 1 (1910).  Go with [2].
+#
+#  - [1] says SMT was -4:42:45, [2] says Chile's official time from
+#    1916 to 1919 was -4:42:46.3, the meridian of Chile's National
+#    Astronomical Observatory (OAN), then located in what is now
+#    Quinta Normal in Santiago.  Go with [2], rounding it to -4:42:46.
+#
+#  - [1] says the 1918 transition was Sep 1, [2] says Sep 10 and cites
+#    Boletín Nº 22, Aviso Nº 129/1918 (1918-08-23).  Go with [2].
+#
+#  - [1] does not give times for transitions; assume they occur
+#    at midnight mainland time, the current common practice.  However,
+#    go with [2]'s specification of 23:00 for the 1947-05-21 transition.
+#
+# Another correction to [1] is from Jesper Nørgaard Welen, who
+# wrote (2006-10-08), "I think that there are some obvious mistakes in
+# the suggested link from Oscar van Vlijmen,... for instance entry 66
+# says that GMT-4 ended 1990-09-12 while entry 67 only begins GMT-3 at
+# 1990-09-15 (they should have been 1990-09-15 and 1990-09-16
+# respectively), but anyhow it clears up some doubts too."
+#
+# Data for Pacific/Easter from 1910 through 1967 come from Shanks &
+# Pottenger.  After that, for lack of better info assume
+# Pacific/Easter is always two hours behind America/Santiago;
+# this is known to work for DST transitions starting in 2008 and
+# may well be true for earlier transitions.
+
 # From Eduardo Krell (1995-10-19):
 # The law says to switch to DST at midnight [24:00] on the second SATURDAY
 # of October....  The law is the same for March and October.
@@ -1133,78 +1187,35 @@
 # Because of the same drought, the government decided to end DST later,
 # on April 3, (one-time change).
 
-# From Oscar van Vlijmen (2006-10-08):
-# http://www.horaoficial.cl/cambio.htm
-
-# From Jesper Nørgaard Welen (2006-10-08):
-# I think that there are some obvious mistakes in the suggested link
-# from Oscar van Vlijmen,... for instance entry 66 says that GMT-4
-# ended 1990-09-12 while entry 67 only begins GMT-3 at 1990-09-15
-# (they should have been 1990-09-15 and 1990-09-16 respectively), but
-# anyhow it clears up some doubts too.
-
-# From Paul Eggert (2014-08-12):
-# The following data entries for Chile and America/Santiago are from
-# <http://www.horaoficial.cl/horaof.htm> (2006-09-20), transcribed by
-# Jesper Nørgaard Welen.  The data entries for Pacific/Easter are from Shanks
-# & Pottenger, except with DST transitions after 1932 cloned from
-# America/Santiago.  The pre-1980 Pacific/Easter data entries are dubious,
-# but we have no other source.
-
 # From Germán Poo-Caamaño (2008-03-03):
 # Due to drought, Chile extends Daylight Time in three weeks.  This
 # is one-time change (Saturday 3/29 at 24:00 for America/Santiago
 # and Saturday 3/29 at 22:00 for Pacific/Easter)
 # The Supreme Decree is located at
 # http://www.shoa.cl/servicios/supremo316.pdf
-# and the instructions for 2008 are located in:
-# http://www.horaoficial.cl/cambio.htm
-
+#
 # From José Miguel Garrido (2008-03-05):
-# ...
-# You could see the announces of the change on
 # http://www.shoa.cl/noticias/2008/04hora/hora.htm
 
 # From Angel Chiang (2010-03-04):
 # Subject: DST in Chile exceptionally extended to 3 April due to earthquake
 # http://www.gobiernodechile.cl/viewNoticia.aspx?idArticulo=30098
-# (in Spanish, last paragraph).
 #
-# This is breaking news. There should be more information available later.
-
 # From Arthur David Olson (2010-03-06):
 # Angel Chiang's message confirmed by Julio Pacheco; Julio provided a patch.
 
-# From Glenn Eychaner (2011-03-02):
-# It appears that the Chilean government has decided to postpone the
-# change from summer time to winter time again, by three weeks to April
-# 2nd:
-# http://www.emol.com/noticias/nacional/detalle/detallenoticias.asp?idnoticia=467651
-#
-# This is not yet reflected in the official "cambio de hora" site, but
-# probably will be soon:
-# http://www.horaoficial.cl/cambio.htm
-
-# From Arthur David Olson (2011-03-02):
-# The emol.com article mentions a water shortage as the cause of the
-# postponement, which may mean that it's not a permanent change.
-
 # From Glenn Eychaner (2011-03-28):
-# The article:
 # http://diario.elmercurio.com/2011/03/28/_portada/_portada/noticias/7565897A-CA86-49E6-9E03-660B21A4883E.htm?id=3D{7565897A-CA86-49E6-9E03-660B21A4883E}
-#
 # In English:
 # Chile's clocks will go back an hour this year on the 7th of May instead
 # of this Saturday. They will go forward again the 3rd Saturday in
-# August, not in October as they have since 1968. This is a pilot plan
-# which will be reevaluated in 2012.
+# August, not in October as they have since 1968.
 
 # From Mauricio Parada (2012-02-22), translated by Glenn Eychaner (2012-02-23):
 # As stated in the website of the Chilean Energy Ministry
 # http://www.minenergia.cl/ministerio/noticias/generales/gobierno-anuncia-fechas-de-cambio-de.html
 # The Chilean Government has decided to postpone the entrance into winter time
-# (to leave DST) from March 11 2012 to April 28th 2012. The decision has not
-# been yet formalized but it will within the next days.
+# (to leave DST) from March 11 2012 to April 28th 2012....
 # Quote from the website communication:
 #
 # 6. For the year 2012, the dates of entry into winter time will be as follows:
@@ -1237,17 +1248,9 @@
 # From Paul Eggert (2015-03-03):
 # For now, assume that the extension will persist indefinitely.
 
-# NOTE: ChileAQ rules for Antarctic bases are stored separately in the
-# 'antarctica' file.
-
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Chile	1927	1932	-	Sep	 1	0:00	1:00	S
+Rule	Chile	1927	1931	-	Sep	 1	0:00	1:00	S
 Rule	Chile	1928	1932	-	Apr	 1	0:00	0	-
-Rule	Chile	1942	only	-	Jun	 1	4:00u	0	-
-Rule	Chile	1942	only	-	Aug	 1	5:00u	1:00	S
-Rule	Chile	1946	only	-	Jul	15	4:00u	1:00	S
-Rule	Chile	1946	only	-	Sep	 1	3:00u	0:00	-
-Rule	Chile	1947	only	-	Apr	 1	4:00u	0	-
 Rule	Chile	1968	only	-	Nov	 3	4:00u	1:00	S
 Rule	Chile	1969	only	-	Mar	30	3:00u	0	-
 Rule	Chile	1969	only	-	Nov	23	4:00u	1:00	S
@@ -1258,10 +1261,8 @@
 Rule	Chile	1973	only	-	Sep	30	4:00u	1:00	S
 Rule	Chile	1974	1987	-	Oct	Sun>=9	4:00u	1:00	S
 Rule	Chile	1987	only	-	Apr	12	3:00u	0	-
-Rule	Chile	1988	1989	-	Mar	Sun>=9	3:00u	0	-
-Rule	Chile	1988	only	-	Oct	Sun>=1	4:00u	1:00	S
-Rule	Chile	1989	only	-	Oct	Sun>=9	4:00u	1:00	S
-Rule	Chile	1990	only	-	Mar	18	3:00u	0	-
+Rule	Chile	1988	1990	-	Mar	Sun>=9	3:00u	0	-
+Rule	Chile	1988	1989	-	Oct	Sun>=9	4:00u	1:00	S
 Rule	Chile	1990	only	-	Sep	16	4:00u	1:00	S
 Rule	Chile	1991	1996	-	Mar	Sun>=9	3:00u	0	-
 Rule	Chile	1991	1997	-	Oct	Sun>=9	4:00u	1:00	S
@@ -1284,15 +1285,21 @@
 # (1996-09) says 1998-03-08.  Ignore these.
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone America/Santiago	-4:42:46 -	LMT	1890
-			-4:42:46 -	SMT	1910        # Santiago Mean Time
+			-4:42:46 -	SMT	1910 Jan 10 # Santiago Mean Time
 			-5:00	-	CLT	1916 Jul  1 # Chile Time
-			-4:42:46 -	SMT	1918 Sep  1 # Santiago Mean Time
-			-4:00	-	CLT	1919 Jul  1 # Chile Time
-			-4:42:46 -	SMT	1927 Sep  1 # Santiago Mean Time
-			-5:00	Chile	CL%sT	1947 May 22 # Chile Time
+			-4:42:46 -	SMT	1918 Sep 10
+			-4:00	-	CLT	1919 Jul  1
+			-4:42:46 -	SMT	1927 Sep  1
+			-5:00	Chile	CL%sT	1932 Sep  1
+			-4:00	-	CLT	1942 Jun  1
+			-5:00	-	CLT	1942 Aug  1
+			-4:00	-	CLT	1946 Jul 15
+			-4:00	1:00	CLST	1946 Sep  1 # central Chile
+			-4:00	-	CLT	1947 Apr  1
+			-5:00	-	CLT	1947 May 21 23:00
 			-4:00	Chile	CL%sT	2015 Apr 26  3:00u
 			-3:00	-	CLT
-Zone Pacific/Easter	-7:17:44 -	LMT	1890
+Zone Pacific/Easter	-7:17:28 -	LMT	1890
 			-7:17:28 -	EMT	1932 Sep    # Easter Mean Time
 			-7:00	Chile	EAS%sT	1982 Mar 14 3:00u # Easter Time
 			-6:00	Chile	EAS%sT	2015 Apr 26 3:00u
@@ -1302,6 +1309,25 @@
 # Other Chilean locations, including Juan Fernández Is, Desventuradas Is,
 # and Antarctic bases, are like America/Santiago.
 
+# Antarctic base using South American rules
+# (See the file 'antarctica' for more.)
+#
+# Palmer, Anvers Island, since 1965 (moved 2 miles in 1968)
+#
+# From Ethan Dicks (1996-10-06):
+# It keeps the same time as Punta Arenas, Chile, because, just like us
+# and the South Pole, that's the other end of their supply line....
+# I verified with someone who was there that since 1980,
+# Palmer has followed Chile.  Prior to that, before the Falklands War,
+# Palmer used to be supplied from Argentina.
+#
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone Antarctica/Palmer	0	-	zzz	1965
+			-4:00	Arg	AR%sT	1969 Oct  5
+			-3:00	Arg	AR%sT	1982 May
+			-4:00	Chile	CL%sT	2015 Apr 26 3:00u
+			-3:00	-	CLT
+
 # Colombia
 
 # Milne gives 4:56:16.4 for Bogotá time in 1899; round to nearest.  He writes,
--- a/make/gensrc/GensrcLocaleDataMetaInfo.gmk	Wed May 13 12:50:09 2015 -0700
+++ b/make/gensrc/GensrcLocaleDataMetaInfo.gmk	Thu May 14 20:11:36 2015 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2015, 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
@@ -34,7 +34,8 @@
     -name "TimeZoneNames_*.java" -o -name "TimeZoneNames_*.properties" -o \
     -name "LocaleNames_*.java" -o -name "LocaleNames_*.properties" -o \
     -name "CurrencyNames_*.java" -o -name "CurrencyNames_*.properties" -o \
-    -name "CalendarData_*.java" -o -name "CalendarData_*.properties")
+    -name "CalendarData_*.java" -o -name "CalendarData_*.properties" -o \
+    -name "BreakIteratorInfo_*.java" -o -name "BreakIteratorRules_*.java")
 
 # Then translate the locale files into for example: FormatData_sv
 LOCALE_RESOURCES := $(sort $(subst .properties,,$(subst .java,,$(notdir $(LOCALE_FILES)))))
@@ -79,6 +80,12 @@
 #sun.text.resources.CollationData
 $(eval $(call CaptureLocale,CollationData))
 
+#sun.text.resources.BreakIteratorInfo
+$(eval $(call CaptureLocale,BreakIteratorInfo))
+
+#sun.text.resources.BreakIteratorRules
+$(eval $(call CaptureLocale,BreakIteratorRules))
+
 #sun.util.resources.TimeZoneNames
 $(eval $(call CaptureLocale,TimeZoneNames))
 
--- a/src/share/classes/java/util/concurrent/ForkJoinPool.java	Wed May 13 12:50:09 2015 -0700
+++ b/src/share/classes/java/util/concurrent/ForkJoinPool.java	Thu May 14 20:11:36 2015 -0700
@@ -2406,7 +2406,7 @@
                 int j = ((am & s) << ASHIFT) + ABASE;
                 U.putOrderedObject(a, j, task);
                 U.putOrderedInt(q, QTOP, s + 1);
-                U.putOrderedInt(q, QLOCK, 0);
+                U.putIntVolatile(q, QLOCK, 0);
                 if (n <= 1)
                     signalWork(ws, q);
                 return;
--- a/src/share/classes/javax/swing/plaf/basic/BasicRadioButtonUI.java	Wed May 13 12:50:09 2015 -0700
+++ b/src/share/classes/javax/swing/plaf/basic/BasicRadioButtonUI.java	Thu May 14 20:11:36 2015 -0700
@@ -438,7 +438,7 @@
         // to the button group or not
         Component getFocusTransferBaseComponent(boolean next){
             Component focusBaseComp = activeBtn;
-            Window container = SwingUtilities.getWindowAncestor(activeBtn);
+            Container container = focusBaseComp.getFocusCycleRootAncestor();
             if (container != null) {
                 FocusTraversalPolicy policy = container.getFocusTraversalPolicy();
                 Component comp = next ? policy.getComponentAfter(container, activeBtn)
--- a/src/share/classes/javax/swing/plaf/nimbus/AbstractRegionPainter.java	Wed May 13 12:50:09 2015 -0700
+++ b/src/share/classes/javax/swing/plaf/nimbus/AbstractRegionPainter.java	Thu May 14 20:11:36 2015 -0700
@@ -625,6 +625,9 @@
         // check if we can scale to the requested size
         Dimension canvas = ctx.canvasSize;
         Insets insets = ctx.stretchingInsets;
+        if (insets.left + insets.right > w || insets.top + insets.bottom > h) {
+            return;
+        }
 
         if (w <= (canvas.width * ctx.maxHorizontalScaleFactor) && h <= (canvas.height * ctx.maxVerticalScaleFactor)) {
             // get image at canvas size
--- a/src/share/classes/sun/security/jgss/GSSUtil.java	Wed May 13 12:50:09 2015 -0700
+++ b/src/share/classes/sun/security/jgss/GSSUtil.java	Thu May 14 20:11:36 2015 -0700
@@ -59,6 +59,8 @@
                 GSSUtil.createOid("1.2.840.113554.1.2.2");
     public static final Oid GSS_KRB5_MECH_OID2 =
                 GSSUtil.createOid("1.3.5.1.5.2");
+    public static final Oid GSS_KRB5_MECH_OID_MS =
+                GSSUtil.createOid("1.2.840.48018.1.2.2");
 
     public static final Oid GSS_SPNEGO_MECH_OID =
                 GSSUtil.createOid("1.3.6.1.5.5.2");
@@ -101,7 +103,8 @@
 
     public static boolean isKerberosMech(Oid oid) {
         return (GSS_KRB5_MECH_OID.equals(oid) ||
-                GSS_KRB5_MECH_OID2.equals(oid));
+                GSS_KRB5_MECH_OID2.equals(oid) ||
+                GSS_KRB5_MECH_OID_MS.equals(oid));
 
     }
 
--- a/src/share/classes/sun/security/jgss/spnego/SpNegoContext.java	Wed May 13 12:50:09 2015 -0700
+++ b/src/share/classes/sun/security/jgss/spnego/SpNegoContext.java	Thu May 14 20:11:36 2015 -0700
@@ -540,14 +540,21 @@
                 // get the token for mechanism
                 byte[] accept_token;
 
-                if (mechList[0].equals(mech_wanted)) {
+                if (mechList[0].equals(mech_wanted) ||
+                        (GSSUtil.isKerberosMech(mechList[0]) &&
+                         GSSUtil.isKerberosMech(mech_wanted))) {
                     // get the mechanism token
+                    if (DEBUG && !mech_wanted.equals(mechList[0])) {
+                        System.out.println("SpNegoContext.acceptSecContext: " +
+                                "negotiated mech adjusted to " + mechList[0]);
+                    }
                     byte[] mechToken = initToken.getMechToken();
                     if (mechToken == null) {
                         throw new GSSException(GSSException.FAILURE, -1,
                                 "mechToken is missing");
                     }
                     accept_token = GSS_acceptSecContext(mechToken);
+                    mech_wanted = mechList[0];
                 } else {
                     accept_token = null;
                 }
--- a/src/share/classes/sun/security/pkcs12/PKCS12KeyStore.java	Wed May 13 12:50:09 2015 -0700
+++ b/src/share/classes/sun/security/pkcs12/PKCS12KeyStore.java	Thu May 14 20:11:36 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, 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
@@ -1600,23 +1600,22 @@
             Entry entry = entries.get(alias);
 
             // certificate chain
-            int chainLen = 1;
-            Certificate[] certs = null;
+            Certificate[] certs;
 
             if (entry instanceof PrivateKeyEntry) {
                 PrivateKeyEntry keyEntry = (PrivateKeyEntry) entry;
-                    if (keyEntry.chain == null) {
-                        chainLen = 0;
-                    } else {
-                        chainLen = keyEntry.chain.length;
-                    }
-                certs = keyEntry.chain;
-
+                if (keyEntry.chain != null) {
+                    certs = keyEntry.chain;
+                } else {
+                    certs = new Certificate[0];
+                }
             } else if (entry instanceof CertEntry) {
-               certs = new Certificate[]{((CertEntry) entry).cert};
+                certs = new Certificate[]{((CertEntry) entry).cert};
+            } else {
+                certs = new Certificate[0];
             }
 
-            for (int i = 0; i < chainLen; i++) {
+            for (int i = 0; i < certs.length; i++) {
                 // create SafeBag of Type CertBag
                 DerOutputStream safeBag = new DerOutputStream();
                 safeBag.putOID(CertBag_OID);
--- a/src/share/classes/sun/util/cldr/CLDRLocaleProviderAdapter.java	Wed May 13 12:50:09 2015 -0700
+++ b/src/share/classes/sun/util/cldr/CLDRLocaleProviderAdapter.java	Thu May 14 20:11:36 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2015, 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
@@ -30,6 +30,7 @@
 import java.security.PrivilegedAction;
 import java.text.spi.BreakIteratorProvider;
 import java.text.spi.CollatorProvider;
+import java.util.Collections;
 import java.util.HashSet;
 import java.util.Locale;
 import java.util.ResourceBundle;
@@ -103,6 +104,9 @@
     protected Set<String> createLanguageTagSet(String category) {
         ResourceBundle rb = ResourceBundle.getBundle("sun.util.cldr.CLDRLocaleDataMetaInfo", Locale.ROOT);
         String supportedLocaleString = rb.getString(category);
+        if (supportedLocaleString == null) {
+            return Collections.emptySet();
+        }
         Set<String> tagset = new HashSet<>();
         StringTokenizer tokens = new StringTokenizer(supportedLocaleString);
         while (tokens.hasMoreTokens()) {
--- a/src/share/classes/sun/util/locale/provider/JRELocaleProviderAdapter.java	Wed May 13 12:50:09 2015 -0700
+++ b/src/share/classes/sun/util/locale/provider/JRELocaleProviderAdapter.java	Thu May 14 20:11:36 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2015, 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
@@ -34,6 +34,7 @@
 import java.text.spi.DateFormatSymbolsProvider;
 import java.text.spi.DecimalFormatSymbolsProvider;
 import java.text.spi.NumberFormatProvider;
+import java.util.Collections;
 import java.util.HashSet;
 import java.util.Locale;
 import java.util.Set;
@@ -356,6 +357,9 @@
 
     protected Set<String> createLanguageTagSet(String category) {
         String supportedLocaleString = LocaleDataMetaInfo.getSupportedLocaleString(category);
+        if (supportedLocaleString == null) {
+            return Collections.emptySet();
+        }
         Set<String> tagset = new HashSet<>();
         StringTokenizer tokens = new StringTokenizer(supportedLocaleString);
         while (tokens.hasMoreTokens()) {
--- a/src/share/classes/sun/util/locale/provider/LocaleDataMetaInfo-XLocales.java.template	Wed May 13 12:50:09 2015 -0700
+++ b/src/share/classes/sun/util/locale/provider/LocaleDataMetaInfo-XLocales.java.template	Thu May 14 20:11:36 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2015, 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
@@ -57,6 +57,12 @@
         resourceNameToLocales.put("CollationData",
                                   " #CollationData_ENLocales# | #CollationData_NonENLocales# ");
 
+        resourceNameToLocales.put("BreakIteratorInfo",
+                                  " #BreakIteratorInfo_ENLocales# | #BreakIteratorInfo_NonENLocales# ");
+
+        resourceNameToLocales.put("BreakIteratorRules",
+                                  " #BreakIteratorRules_ENLocales# | #BreakIteratorRules_NonENLocales# ");
+
         resourceNameToLocales.put("TimeZoneNames",
                                   " #TimeZoneNames_ENLocales# | #TimeZoneNames_NonENLocales# ");
 
--- a/src/share/classes/sun/util/locale/provider/LocaleProviderAdapter.java	Wed May 13 12:50:09 2015 -0700
+++ b/src/share/classes/sun/util/locale/provider/LocaleProviderAdapter.java	Thu May 14 20:11:36 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2015, 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
@@ -295,7 +295,7 @@
      * A utility method for implementing the default LocaleServiceProvider.isSupportedLocale
      * for the JRE, CLDR, and FALLBACK adapters.
      */
-    static boolean isSupportedLocale(Locale locale, LocaleProviderAdapter.Type type, Set<String> langtags) {
+    public static boolean isSupportedLocale(Locale locale, LocaleProviderAdapter.Type type, Set<String> langtags) {
         assert type == Type.JRE || type == Type.CLDR || type == Type.FALLBACK;
         if (Locale.ROOT.equals(locale)) {
             return true;
--- a/src/share/classes/sun/util/resources/LocaleData.java	Wed May 13 12:50:09 2015 -0700
+++ b/src/share/classes/sun/util/resources/LocaleData.java	Thu May 14 20:11:36 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2015, 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
@@ -48,8 +48,11 @@
 import java.util.Locale;
 import java.util.MissingResourceException;
 import java.util.ResourceBundle;
+import java.util.Set;
+import sun.util.locale.provider.JRELocaleProviderAdapter;
 import sun.util.locale.provider.LocaleDataMetaInfo;
 import sun.util.locale.provider.LocaleProviderAdapter;
+import static sun.util.locale.provider.LocaleProviderAdapter.Type.CLDR;
 import static sun.util.locale.provider.LocaleProviderAdapter.Type.JRE;
 
 /**
@@ -204,35 +207,23 @@
         @Override
          public List<Locale> getCandidateLocales(String baseName, Locale locale) {
             List<Locale> candidates = super.getCandidateLocales(baseName, locale);
-            /* Get the locale string list from LocaleDataMetaInfo class. */
-            String localeString = LocaleDataMetaInfo.getSupportedLocaleString(baseName);
-
-            if (localeString != null && localeString.length() != 0) {
-                for (Iterator<Locale> l = candidates.iterator(); l.hasNext();) {
-                    Locale loc = l.next();
-                    String lstr;
-                    if (loc.getScript().length() > 0) {
-                        lstr = loc.toLanguageTag().replace('-', '_');
-                    } else {
-                        lstr = loc.toString();
-                        int idx = lstr.indexOf("_#");
-                        if (idx >= 0) {
-                            lstr = lstr.substring(0, idx);
-                        }
-                    }
-                    /* Every locale string in the locale string list returned from
-                     the above getSupportedLocaleString is enclosed
-                     within two white spaces so that we could check some locale
-                     such as "en".
-                     */
-                    if (lstr.length() != 0 && localeString.indexOf(" " + lstr + " ") == -1) {
-                        l.remove();
+            // Weed out Locales which are known to have no resource bundles
+            int lastDot = baseName.lastIndexOf('.');
+            String category = (lastDot >= 0) ? baseName.substring(lastDot + 1) : baseName;
+            LocaleProviderAdapter.Type type = baseName.contains(DOTCLDR) ? CLDR : JRE;
+            LocaleProviderAdapter adapter = LocaleProviderAdapter.forType(type);
+            Set<String> langtags = ((JRELocaleProviderAdapter)adapter).getLanguageTagSet(category);
+            if (!langtags.isEmpty()) {
+                for (Iterator<Locale> itr = candidates.iterator(); itr.hasNext();) {
+                    if (!LocaleProviderAdapter.isSupportedLocale(itr.next(), type, langtags)) {
+                        itr.remove();
                     }
                 }
             }
+
             // Force fallback to Locale.ENGLISH for CLDR time zone names support
             if (locale.getLanguage() != "en"
-                    && baseName.contains(CLDR) && baseName.endsWith("TimeZoneNames")) {
+                    && type == CLDR && category.equals("TimeZoneNames")) {
                 candidates.add(candidates.size() - 1, Locale.ENGLISH);
             }
             return candidates;
@@ -254,7 +245,7 @@
             return null;
         }
 
-        private static final String CLDR      = ".cldr";
+        private static final String DOTCLDR      = ".cldr";
 
         /**
          * Changes baseName to its per-language package name and
@@ -275,8 +266,8 @@
                     assert JRE.getUtilResourcesPackage().length()
                         == JRE.getTextResourcesPackage().length();
                     int index = JRE.getUtilResourcesPackage().length();
-                    if (baseName.indexOf(CLDR, index) > 0) {
-                        index += CLDR.length();
+                    if (baseName.indexOf(DOTCLDR, index) > 0) {
+                        index += DOTCLDR.length();
                     }
                     newBaseName = baseName.substring(0, index + 1) + lang
                                       + baseName.substring(index);
--- a/src/share/classes/sun/util/resources/TimeZoneNames.java	Wed May 13 12:50:09 2015 -0700
+++ b/src/share/classes/sun/util/resources/TimeZoneNames.java	Thu May 14 20:11:36 2015 -0700
@@ -152,9 +152,6 @@
         String GST[] = new String[] {"Gulf Standard Time", "GST",
                                      "Gulf Daylight Time", "GDT",
                                      "Gulf Time", "GT"};
-        String HAST[] = new String[] {"Hawaii-Aleutian Standard Time", "HAST",
-                                      "Hawaii-Aleutian Daylight Time", "HADT",
-                                      "Hawaii-Aleutian Time", "HAT"};
         String HKT[] =  new String[] {"Hong Kong Time", "HKT",
                                       "Hong Kong Summer Time", "HKST",
                                       "Hong Kong Time", "HKT"};
@@ -371,7 +368,7 @@
             {"Africa/Tripoli", EET},
             {"Africa/Tunis", CET},
             {"Africa/Windhoek", WAT},
-            {"America/Adak", HAST},
+            {"America/Adak", HST},
             {"America/Anguilla", AST},
             {"America/Antigua", AST},
             {"America/Araguaina", BRT},
@@ -393,7 +390,7 @@
                                                "Paraguay Summer Time", "PYST",
                                                "Paraguay Time", "PYT"}},
             {"America/Atikokan", EST},
-            {"America/Atka", HAST},
+            {"America/Atka", HST},
             {"America/Bahia", BRT},
             {"America/Bahia_Banderas", CST},
             {"America/Barbados", AST},
@@ -1024,7 +1021,7 @@
             {"UCT", UTC},
             {"Universal", UTC},
             {"US/Alaska", AKST},
-            {"US/Aleutian", HAST},
+            {"US/Aleutian", HST},
             {"US/Arizona", MST},
             {"US/Central", CST},
             {"US/Eastern", EST},
--- a/src/share/classes/sun/util/resources/de/TimeZoneNames_de.java	Wed May 13 12:50:09 2015 -0700
+++ b/src/share/classes/sun/util/resources/de/TimeZoneNames_de.java	Thu May 14 20:11:36 2015 -0700
@@ -153,9 +153,6 @@
         String GST[] = new String[] {"Golf Normalzeit", "GST",
                                      "Golf Sommerzeit", "GDT",
                                      "Zeitzone f\u00FCr Persischen Golf", "GT"};
-        String HAST[] = new String[] {"Hawaii-Aleutische Normalzeit", "HAST",
-                                      "Hawaii-Aleutische Sommerzeit", "HADT",
-                                      "Zeitzone f\u00FCr Hawaii und Al\u00EButen", "HAT"};
         String HKT[] =  new String[] {"Hongkong Zeit", "HKT",
                                       "Hongkong Sommerzeit", "HKST",
                                       "Hongkong Zeit", "HKT"};
@@ -372,7 +369,7 @@
             {"Africa/Tripoli", EET},
             {"Africa/Tunis", CET},
             {"Africa/Windhoek", WAT},
-            {"America/Adak", HAST},
+            {"America/Adak", HST},
             {"America/Anguilla", AST},
             {"America/Antigua", AST},
             {"America/Araguaina", BRT},
@@ -394,7 +391,7 @@
                                                "Paraguay Sommerzeit", "PYST",
                                                "Paraguay Zeit", "PYT"}},
             {"America/Atikokan", EST},
-            {"America/Atka", HAST},
+            {"America/Atka", HST},
             {"America/Bahia", BRT},
             {"America/Bahia_Banderas", CST},
             {"America/Barbados", AST},
@@ -1024,7 +1021,7 @@
             {"UCT", UTC},
             {"Universal", UTC},
             {"US/Alaska", AKST},
-            {"US/Aleutian", HAST},
+            {"US/Aleutian", HST},
             {"US/Arizona", MST},
             {"US/Central", CST},
             {"US/Eastern", EST},
--- a/src/share/classes/sun/util/resources/es/TimeZoneNames_es.java	Wed May 13 12:50:09 2015 -0700
+++ b/src/share/classes/sun/util/resources/es/TimeZoneNames_es.java	Thu May 14 20:11:36 2015 -0700
@@ -153,9 +153,6 @@
         String GST[] = new String[] {"Hora est\u00e1ndar del Golfo", "GST",
                                      "Hora de verano del Golfo", "GDT",
                                      "Hora del Golfo", "GT"};
-        String HAST[] = new String[] {"Hora est\u00e1ndar de Hawaii-Aleutianas", "HAST",
-                                      "Hora de verano de Hawaii-Aleutianas", "HADT",
-                                      "Hora de Hawaii-Aleutian", "HAT"};
         String HKT[] =  new String[] {"Hora de Hong Kong", "HKT",
                                       "Hora de verano de Hong Kong", "HKST",
                                       "Hora de Hong Kong", "HKT"};
@@ -372,7 +369,7 @@
             {"Africa/Tripoli", EET},
             {"Africa/Tunis", CET},
             {"Africa/Windhoek", WAT},
-            {"America/Adak", HAST},
+            {"America/Adak", HST},
             {"America/Anguilla", AST},
             {"America/Antigua", AST},
             {"America/Araguaina", BRT},
@@ -394,7 +391,7 @@
                                                "Hora de verano de Paraguay", "PYST",
                                                "Hora de Paraguay", "PYT"}},
             {"America/Atikokan", EST},
-            {"America/Atka", HAST},
+            {"America/Atka", HST},
             {"America/Bahia", BRT},
             {"America/Bahia_Banderas", CST},
             {"America/Barbados", AST},
@@ -1024,7 +1021,7 @@
             {"UCT", UTC},
             {"Universal", UTC},
             {"US/Alaska", AKST},
-            {"US/Aleutian", HAST},
+            {"US/Aleutian", HST},
             {"US/Arizona", MST},
             {"US/Central", CST},
             {"US/Eastern", EST},
--- a/src/share/classes/sun/util/resources/fr/TimeZoneNames_fr.java	Wed May 13 12:50:09 2015 -0700
+++ b/src/share/classes/sun/util/resources/fr/TimeZoneNames_fr.java	Thu May 14 20:11:36 2015 -0700
@@ -153,9 +153,6 @@
         String GST[] = new String[] {"Heure normale du Golfe", "GST",
                                      "Heure avanc\u00e9e du Golfe", "GDT",
                                      "Golfe", "GT"} ;
-        String HAST[] = new String[] {"Heure normale d'Hawa\u00ef-Al\u00e9outiennes", "HAST",
-                                      "Heure avanc\u00e9e d'Hawa\u00ef-Al\u00e9outiennes", "HADT",
-                                      "Hawa\u00EF-Iles Al\u00E9outiennes", "HAT"} ;
         String HKT[] =  new String[] {"Heure de Hong Kong", "HKT",
                                       "Heure d'\u00e9t\u00e9 de Hong Kong", "HKST",
                                       "Heure de Hong-Kong", "HKT"};
@@ -372,7 +369,7 @@
             {"Africa/Tripoli", EET},
             {"Africa/Tunis", CET},
             {"Africa/Windhoek", WAT},
-            {"America/Adak", HAST},
+            {"America/Adak", HST},
             {"America/Anguilla", AST},
             {"America/Antigua", AST},
             {"America/Araguaina", BRT},
@@ -394,7 +391,7 @@
                                                "Heure d'\u00e9t\u00e9 du Paraguay", "PYST",
                                                "Heure du Paraguay", "PYT"}},
             {"America/Atikokan", EST},
-            {"America/Atka", HAST},
+            {"America/Atka", HST},
             {"America/Bahia", BRT},
             {"America/Bahia_Banderas", CST},
             {"America/Barbados", AST},
@@ -1024,7 +1021,7 @@
             {"UCT", UTC},
             {"Universal", UTC},
             {"US/Alaska", AKST},
-            {"US/Aleutian", HAST},
+            {"US/Aleutian", HST},
             {"US/Arizona", MST},
             {"US/Central", CST},
             {"US/Eastern", EST},
--- a/src/share/classes/sun/util/resources/it/TimeZoneNames_it.java	Wed May 13 12:50:09 2015 -0700
+++ b/src/share/classes/sun/util/resources/it/TimeZoneNames_it.java	Thu May 14 20:11:36 2015 -0700
@@ -153,9 +153,6 @@
         String GST[] = new String[] {"Ora solare del golfo", "GST",
                                      "Ora legale del golfo", "GDT",
                                      "Ora del golfo", "GT"};
-        String HAST[] = new String[] {"Ora solare delle Isole Hawaii-Aleutine", "HAST",
-                                      "Ora solare delle Isole Hawaii-Aleutine", "HADT",
-                                      "Ora Hawaii-Aleutine", "HAT"};
         String HKT[] =  new String[] {"Ora di Hong Kong", "HKT",
                                       "Ora estiva di Hong Kong", "HKST",
                                       "Ora di Hong Kong", "HKT"};
@@ -372,7 +369,7 @@
             {"Africa/Tripoli", EET},
             {"Africa/Tunis", CET},
             {"Africa/Windhoek", WAT},
-            {"America/Adak", HAST},
+            {"America/Adak", HST},
             {"America/Anguilla", AST},
             {"America/Antigua", AST},
             {"America/Araguaina", BRT},
@@ -394,7 +391,7 @@
                                                "Ora estiva del Paraguay", "PYST",
                                                "Ora del Paraguay", "PYT"}},
             {"America/Atikokan", EST},
-            {"America/Atka", HAST},
+            {"America/Atka", HST},
             {"America/Bahia", BRT},
             {"America/Bahia_Banderas", CST},
             {"America/Barbados", AST},
@@ -1024,7 +1021,7 @@
             {"UCT", UTC},
             {"Universal", UTC},
             {"US/Alaska", AKST},
-            {"US/Aleutian", HAST},
+            {"US/Aleutian", HST},
             {"US/Arizona", MST},
             {"US/Central", CST},
             {"US/Eastern", EST},
--- a/src/share/classes/sun/util/resources/ja/TimeZoneNames_ja.java	Wed May 13 12:50:09 2015 -0700
+++ b/src/share/classes/sun/util/resources/ja/TimeZoneNames_ja.java	Thu May 14 20:11:36 2015 -0700
@@ -153,9 +153,6 @@
         String GST[] = new String[] {"\u6e7e\u5cb8\u6a19\u6e96\u6642", "GST",
                                      "\u6e7e\u5cb8\u590f\u6642\u9593", "GDT",
                                      "\u6E7E\u5CB8\u6642\u9593", "GT"};
-        String HAST[] = new String[] {"\u30cf\u30ef\u30a4 - \u30a2\u30ea\u30e5\u30fc\u30b7\u30e3\u30f3\u6a19\u6e96\u6642", "HAST",
-                                      "\u30cf\u30ef\u30a4 - \u30a2\u30ea\u30e5\u30fc\u30b7\u30e3\u30f3\u590f\u6642\u9593", "HADT",
-                                      "\u30CF\u30EF\u30A4\u30FB\u30A2\u30EA\u30E5\u30FC\u30B7\u30E3\u30F3\u6642\u9593", "HAT"};
         String HKT[] =  new String[] {"\u9999\u6e2f\u6642\u9593", "HKT",
                                       "\u9999\u6e2f\u590f\u6642\u9593", "HKST",
                                       "\u9999\u6E2F\u6642\u9593", "HKT"};
@@ -372,7 +369,7 @@
             {"Africa/Tripoli", EET},
             {"Africa/Tunis", CET},
             {"Africa/Windhoek", WAT},
-            {"America/Adak", HAST},
+            {"America/Adak", HST},
             {"America/Anguilla", AST},
             {"America/Antigua", AST},
             {"America/Araguaina", BRT},
@@ -394,7 +391,7 @@
                                                "\u30d1\u30e9\u30b0\u30a2\u30a4\u590f\u6642\u9593", "PYST",
                                                "\u30D1\u30E9\u30B0\u30A2\u30A4\u6642\u9593", "PYT"}},
             {"America/Atikokan", EST},
-            {"America/Atka", HAST},
+            {"America/Atka", HST},
             {"America/Bahia", BRT},
             {"America/Bahia_Banderas", CST},
             {"America/Barbados", AST},
@@ -1024,7 +1021,7 @@
             {"UCT", UTC},
             {"Universal", UTC},
             {"US/Alaska", AKST},
-            {"US/Aleutian", HAST},
+            {"US/Aleutian", HST},
             {"US/Arizona", MST},
             {"US/Central", CST},
             {"US/Eastern", EST},
--- a/src/share/classes/sun/util/resources/ko/TimeZoneNames_ko.java	Wed May 13 12:50:09 2015 -0700
+++ b/src/share/classes/sun/util/resources/ko/TimeZoneNames_ko.java	Thu May 14 20:11:36 2015 -0700
@@ -153,9 +153,6 @@
         String GST[] = new String[] {"\uac78\ud504\ub9cc \ud45c\uc900\uc2dc", "GST",
                                      "\uac78\ud504\ub9cc \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "GDT",
                                      "\uAC78\uD504\uB9CC \uD45C\uC900\uC2DC", "GT"};
-        String HAST[] = new String[] {"\ud558\uc640\uc774 \uc54c\ub958\uc0e8 \ud45c\uc900\uc2dc", "HAST",
-                                      "\ud558\uc640\uc774 \uc54c\ub958\uc0e8 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "HADT",
-                                      "\uD558\uC640\uC774-\uC54C\uB8E8\uC0E8 \uD45C\uC900\uC2DC", "HAT"};
         String HKT[] =  new String[] {"\ud64d\ucf69 \uc2dc\uac04", "HKT",
                                       "\ud64d\ucf69 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "HKST",
                                       "\uD64D\uCF69 \uD45C\uC900\uC2DC", "HKT"};
@@ -372,7 +369,7 @@
             {"Africa/Tripoli", EET},
             {"Africa/Tunis", CET},
             {"Africa/Windhoek", WAT},
-            {"America/Adak", HAST},
+            {"America/Adak", HST},
             {"America/Anguilla", AST},
             {"America/Antigua", AST},
             {"America/Araguaina", BRT},
@@ -394,7 +391,7 @@
                                                "\ud30c\ub77c\uacfc\uc774 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "PYST",
                                                "\uD30C\uB77C\uACFC\uC774 \uD45C\uC900\uC2DC", "PYT"}},
             {"America/Atikokan", EST},
-            {"America/Atka", HAST},
+            {"America/Atka", HST},
             {"America/Bahia", BRT},
             {"America/Bahia_Banderas", CST},
             {"America/Barbados", AST},
@@ -1024,7 +1021,7 @@
             {"UCT", UTC},
             {"Universal", UTC},
             {"US/Alaska", AKST},
-            {"US/Aleutian", HAST},
+            {"US/Aleutian", HST},
             {"US/Arizona", MST},
             {"US/Central", CST},
             {"US/Eastern", EST},
--- a/src/share/classes/sun/util/resources/pt/TimeZoneNames_pt_BR.java	Wed May 13 12:50:09 2015 -0700
+++ b/src/share/classes/sun/util/resources/pt/TimeZoneNames_pt_BR.java	Thu May 14 20:11:36 2015 -0700
@@ -150,9 +150,6 @@
         String GST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o do golfo", "GST",
                                      "Hor\u00e1rio de luz natural do golfo", "GDT",
                                      "Hor\u00E1rio do Golfo", "GT"};
-        String HAST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o do Hava\u00ed-Aleutian", "HAST",
-                                      "Hor\u00e1rio de luz natural do Hava\u00ed-Aleutian", "HADT",
-                                      "Hor\u00E1rio do Hava\u00ED-Aleutas", "HAT"};
         String HKT[] =  new String[] {"Fuso hor\u00e1rio de Hong Kong", "HKT",
                                       "Fuso hor\u00e1rio de ver\u00e3o de Hong Kong", "HKST",
                                       "Hor\u00E1rio de Hong Kong", "HKT"};
@@ -372,7 +369,7 @@
             {"Africa/Tripoli", EET},
             {"Africa/Tunis", CET},
             {"Africa/Windhoek", WAT},
-            {"America/Adak", HAST},
+            {"America/Adak", HST},
             {"America/Anguilla", AST},
             {"America/Antigua", AST},
             {"America/Araguaina", BRT},
@@ -394,7 +391,7 @@
                                                "Fuso hor\u00e1rio de ver\u00e3o do Paraguai", "PYST",
                                                "Hor\u00E1rio do Paraguai", "PYT"}},
             {"America/Atikokan", EST},
-            {"America/Atka", HAST},
+            {"America/Atka", HST},
             {"America/Bahia", BRT},
             {"America/Bahia_Banderas", CST},
             {"America/Barbados", AST},
@@ -1024,7 +1021,7 @@
             {"UCT", UTC},
             {"Universal", UTC},
             {"US/Alaska", AKST},
-            {"US/Aleutian", HAST},
+            {"US/Aleutian", HST},
             {"US/Arizona", MST},
             {"US/Central", CST},
             {"US/Eastern", EST},
--- a/src/share/classes/sun/util/resources/sv/TimeZoneNames_sv.java	Wed May 13 12:50:09 2015 -0700
+++ b/src/share/classes/sun/util/resources/sv/TimeZoneNames_sv.java	Thu May 14 20:11:36 2015 -0700
@@ -153,9 +153,6 @@
         String GST[] = new String[] {"Gulf-normaltid", "GST",
                                      "Gulf-sommartid", "GDT",
                                      "Golfens tid", "GT"};
-        String HAST[] = new String[] {"Hawaii-Aleuterna, normaltid", "HAST",
-                                      "Hawaii-Aleuterna, sommartid", "HADT",
-                                      "Hawaiiansk-aleutisk tid", "HAT"};
         String HKT[] =  new String[] {"Hong Kong, normaltid", "HKT",
                                       "Hong Kong, sommartid", "HKST",
                                       "Hongkong-tid", "HKT"};
@@ -372,7 +369,7 @@
             {"Africa/Tripoli", EET},
             {"Africa/Tunis", CET},
             {"Africa/Windhoek", WAT},
-            {"America/Adak", HAST},
+            {"America/Adak", HST},
             {"America/Anguilla", AST},
             {"America/Antigua", AST},
             {"America/Araguaina", BRT},
@@ -394,7 +391,7 @@
                                                "Paraguay, sommartid", "PYST",
                                                "Paraguayansk tid", "PYT"}},
             {"America/Atikokan", EST},
-            {"America/Atka", HAST},
+            {"America/Atka", HST},
             {"America/Bahia", BRT},
             {"America/Bahia_Banderas", CST},
             {"America/Barbados", AST},
@@ -1024,7 +1021,7 @@
             {"UCT", UTC},
             {"Universal", UTC},
             {"US/Alaska", AKST},
-            {"US/Aleutian", HAST},
+            {"US/Aleutian", HST},
             {"US/Arizona", MST},
             {"US/Central", CST},
             {"US/Eastern", EST},
--- a/src/share/classes/sun/util/resources/zh/TimeZoneNames_zh_CN.java	Wed May 13 12:50:09 2015 -0700
+++ b/src/share/classes/sun/util/resources/zh/TimeZoneNames_zh_CN.java	Thu May 14 20:11:36 2015 -0700
@@ -153,9 +153,6 @@
         String GST[] = new String[] {"\u6ce2\u65af\u6e7e\u6807\u51c6\u65f6\u95f4", "GST",
                                      "\u6ce2\u65af\u6e7e\u590f\u4ee4\u65f6", "GDT",
                                      "\u6D77\u6E7E\u65F6\u95F4", "GT"};
-        String HAST[] = new String[] {"\u590f\u5a01\u5937-\u963f\u7559\u7533\u7fa4\u5c9b\u6807\u51c6\u65f6\u95f4", "HAST",
-                                      "\u590f\u5a01\u5937-\u963f\u7559\u7533\u7fa4\u5c9b\u590f\u4ee4\u65f6", "HADT",
-                                      "\u590F\u5A01\u5937-\u963F\u7559\u7533\u65F6\u95F4", "HAT"};
         String HKT[] =  new String[] {"\u9999\u6e2f\u65f6\u95f4", "HKT",
                                       "\u9999\u6e2f\u590f\u4ee4\u65f6", "HKST",
                                       "\u9999\u6E2F\u65F6\u95F4", "HKT"};
@@ -372,7 +369,7 @@
             {"Africa/Tripoli", EET},
             {"Africa/Tunis", CET},
             {"Africa/Windhoek", WAT},
-            {"America/Adak", HAST},
+            {"America/Adak", HST},
             {"America/Anguilla", AST},
             {"America/Antigua", AST},
             {"America/Araguaina", BRT},
@@ -394,7 +391,7 @@
                                                "\u5df4\u62c9\u572d\u590f\u4ee4\u65f6", "PYST",
                                                "\u5DF4\u62C9\u572D\u65F6\u95F4", "PYT"}},
             {"America/Atikokan", EST},
-            {"America/Atka", HAST},
+            {"America/Atka", HST},
             {"America/Bahia", BRT},
             {"America/Bahia_Banderas", CST},
             {"America/Barbados", AST},
@@ -1024,7 +1021,7 @@
             {"UCT", UTC},
             {"Universal", UTC},
             {"US/Alaska", AKST},
-            {"US/Aleutian", HAST},
+            {"US/Aleutian", HST},
             {"US/Arizona", MST},
             {"US/Central", CST},
             {"US/Eastern", EST},
--- a/src/share/classes/sun/util/resources/zh/TimeZoneNames_zh_TW.java	Wed May 13 12:50:09 2015 -0700
+++ b/src/share/classes/sun/util/resources/zh/TimeZoneNames_zh_TW.java	Thu May 14 20:11:36 2015 -0700
@@ -153,9 +153,6 @@
         String GST[] = new String[] {"\u6ce2\u65af\u7063\u6a19\u6e96\u6642\u9593", "GST",
                                      "\u6ce2\u65af\u7063\u65e5\u5149\u7bc0\u7d04\u6642\u9593", "GDT",
                                      "\u6CE2\u65AF\u7063\u6642\u9593", "GT"};
-        String HAST[] = new String[] {"\u590f\u5a01\u5937-\u963f\u7559\u7533\u7fa4\u5cf6\u6a19\u6e96\u6642\u9593", "HAST",
-                                      "\u590f\u5a01\u5937-\u963f\u7559\u7533\u7fa4\u5cf6\u65e5\u5149\u7bc0\u7d04\u6642\u9593", "HADT",
-                                      "\u590F\u5A01\u5937-\u963F\u7559\u7533\u6642\u9593", "HAT"};
         String HKT[] =  new String[] {"\u9999\u6e2f\u6642\u9593", "HKT",
                                       "\u9999\u6e2f\u590f\u4ee4\u6642\u9593", "HKST",
                                       "\u9999\u6E2F\u6642\u9593", "HKT"};
@@ -372,7 +369,7 @@
             {"Africa/Tripoli", EET},
             {"Africa/Tunis", CET},
             {"Africa/Windhoek", WAT},
-            {"America/Adak", HAST},
+            {"America/Adak", HST},
             {"America/Anguilla", AST},
             {"America/Antigua", AST},
             {"America/Araguaina", BRT},
@@ -394,7 +391,7 @@
                                                "\u5df4\u62c9\u572d\u590f\u4ee4\u6642\u9593", "PYST",
                                                "\u5DF4\u62C9\u572D\u6642\u9593", "PYT"}},
             {"America/Atikokan", EST},
-            {"America/Atka", HAST},
+            {"America/Atka", HST},
             {"America/Bahia", BRT},
             {"America/Bahia_Banderas", CST},
             {"America/Barbados", AST},
@@ -1026,7 +1023,7 @@
             {"UCT", UTC},
             {"Universal", UTC},
             {"US/Alaska", AKST},
-            {"US/Aleutian", HAST},
+            {"US/Aleutian", HST},
             {"US/Arizona", MST},
             {"US/Central", CST},
             {"US/Eastern", EST},
--- a/src/share/native/sun/java2d/cmm/lcms/cmscgats.c	Wed May 13 12:50:09 2015 -0700
+++ b/src/share/native/sun/java2d/cmm/lcms/cmscgats.c	Thu May 14 20:11:36 2015 -0700
@@ -353,7 +353,7 @@
         "XYZ_X",          // X component of tristimulus data
         "XYZ_Y",          // Y component of tristimulus data
         "XYZ_Z",          // Z component of tristimulus data
-        "XYY_X"           // x component of chromaticity data
+        "XYY_X",          // x component of chromaticity data
         "XYY_Y",          // y component of chromaticity data
         "XYY_CAPY",       // Y component of tristimulus data
         "LAB_L",          // L* component of Lab data
--- a/src/share/native/sun/java2d/cmm/lcms/cmscnvrt.c	Wed May 13 12:50:09 2015 -0700
+++ b/src/share/native/sun/java2d/cmm/lcms/cmscnvrt.c	Thu May 14 20:11:36 2015 -0700
@@ -298,6 +298,8 @@
 {
     cmsMAT3 Scale, m1, m2, m3, m4;
 
+    // TODO: Follow Marc Mahy's recommendation to check if CHAD is same by using M1*M2 == M2*M1. If so, do nothing.
+
     // Adaptation state
     if (AdaptationState == 1.0) {
 
@@ -559,7 +561,7 @@
     cmsHPROFILE hProfile;
     cmsMAT3 m;
     cmsVEC3 off;
-    cmsColorSpaceSignature ColorSpaceIn, ColorSpaceOut, CurrentColorSpace;
+    cmsColorSpaceSignature ColorSpaceIn, ColorSpaceOut = cmsSigLabData, CurrentColorSpace;
     cmsProfileClassSignature ClassSig;
     cmsUInt32Number  i, Intent;
 
@@ -661,6 +663,22 @@
         CurrentColorSpace = ColorSpaceOut;
     }
 
+    // Check for non-negatives clip
+    if (dwFlags & cmsFLAGS_NONEGATIVES) {
+
+           if (ColorSpaceOut == cmsSigGrayData ||
+                  ColorSpaceOut == cmsSigRgbData ||
+                  ColorSpaceOut == cmsSigCmykData) {
+
+                  cmsStage* clip = _cmsStageClipNegatives(Result->ContextID, cmsChannelsOf(ColorSpaceOut));
+                  if (clip == NULL) goto Error;
+
+                  if (!cmsPipelineInsertStage(Result, cmsAT_END, clip))
+                         goto Error;
+           }
+
+    }
+
     return Result;
 
 Error:
@@ -1074,7 +1092,7 @@
         if (TheIntents[i] == INTENT_PERCEPTUAL || TheIntents[i] == INTENT_SATURATION) {
 
             // Force BPC for V4 profiles in perceptual and saturation
-            if (cmsGetProfileVersion(hProfiles[i]) >= 4.0)
+            if (cmsGetEncodedICCversion(hProfiles[i]) >= 0x4000000)
                 BPC[i] = TRUE;
         }
     }
--- a/src/share/native/sun/java2d/cmm/lcms/cmserr.c	Wed May 13 12:50:09 2015 -0700
+++ b/src/share/native/sun/java2d/cmm/lcms/cmserr.c	Thu May 14 20:11:36 2015 -0700
@@ -30,7 +30,7 @@
 //---------------------------------------------------------------------------------
 //
 //  Little Color Management System
-//  Copyright (c) 1998-2012 Marti Maria Saguer
+//  Copyright (c) 1998-2015 Marti Maria Saguer
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the "Software"),
@@ -54,6 +54,13 @@
 
 #include "lcms2_internal.h"
 
+
+// This function is here to help applications to prevent mixing lcms versions on header and shared objects.
+int CMSEXPORT cmsGetEncodedCMMversion(void)
+{
+       return LCMS_VERSION;
+}
+
 // I am so tired about incompatibilities on those functions that here are some replacements
 // that hopefully would be fully portable.
 
--- a/src/share/native/sun/java2d/cmm/lcms/cmsintrp.c	Wed May 13 12:50:09 2015 -0700
+++ b/src/share/native/sun/java2d/cmm/lcms/cmsintrp.c	Thu May 14 20:11:36 2015 -0700
@@ -958,7 +958,7 @@
 
                             Rest = c1 * rx + c2 * ry + c3 * rz;
 
-                            Tmp1[OutChan] = (cmsUInt16Number) c0 + ROUND_FIXED_TO_INT(_cmsToFixedDomain(Rest));
+                            Tmp1[OutChan] = (cmsUInt16Number) ( c0 + ROUND_FIXED_TO_INT(_cmsToFixedDomain(Rest)));
     }
 
 
@@ -1022,7 +1022,7 @@
 
                             Rest = c1 * rx + c2 * ry + c3 * rz;
 
-                            Tmp2[OutChan] = (cmsUInt16Number) c0 + ROUND_FIXED_TO_INT(_cmsToFixedDomain(Rest));
+                            Tmp2[OutChan] = (cmsUInt16Number) (c0 + ROUND_FIXED_TO_INT(_cmsToFixedDomain(Rest)));
     }
 
 
--- a/src/share/native/sun/java2d/cmm/lcms/cmsio0.c	Wed May 13 12:50:09 2015 -0700
+++ b/src/share/native/sun/java2d/cmm/lcms/cmsio0.c	Thu May 14 20:11:36 2015 -0700
@@ -482,6 +482,14 @@
 
 // -------------------------------------------------------------------------------------------------------
 
+cmsIOHANDLER* CMSEXPORT cmsGetProfileIOhandler(cmsHPROFILE hProfile)
+{
+        _cmsICCPROFILE* Icc = (_cmsICCPROFILE*)hProfile;
+
+        if (Icc == NULL) return NULL;
+        return Icc->IOhandler;
+}
+
 // Creates an empty structure holding all required parameters
 cmsHPROFILE CMSEXPORT cmsCreateProfilePlaceholder(cmsContext ContextID)
 {
@@ -651,25 +659,26 @@
        return _cmsSearchTag(Icc, sig, FALSE) >= 0;
 }
 
-/*
- * Enforces that the profile version is per. spec.
- * Operates on the big endian bytes from the profile.
- * Called before converting to platform endianness.
- * Byte 0 is BCD major version, so max 9.
- * Byte 1 is 2 BCD digits, one per nibble.
- * Reserved bytes 2 & 3 must be 0.
- */
-static cmsUInt32Number _validatedVersion(cmsUInt32Number DWord)
+
+
+// Enforces that the profile version is per. spec.
+// Operates on the big endian bytes from the profile.
+// Called before converting to platform endianness.
+// Byte 0 is BCD major version, so max 9.
+// Byte 1 is 2 BCD digits, one per nibble.
+// Reserved bytes 2 & 3 must be 0.
+static
+cmsUInt32Number _validatedVersion(cmsUInt32Number DWord)
 {
-    cmsUInt8Number* pByte = (cmsUInt8Number*)&DWord;
+    cmsUInt8Number* pByte = (cmsUInt8Number*) &DWord;
     cmsUInt8Number temp1;
     cmsUInt8Number temp2;
 
-    if (*pByte > 0x09) *pByte = (cmsUInt8Number)9;
+    if (*pByte > 0x09) *pByte = (cmsUInt8Number) 0x09;
     temp1 = *(pByte+1) & 0xf0;
     temp2 = *(pByte+1) & 0x0f;
     if (temp1 > 0x90) temp1 = 0x90;
-    if (temp2 > 9) temp2 = 0x09;
+    if (temp2 > 0x09) temp2 = 0x09;
     *(pByte+1) = (cmsUInt8Number)(temp1 | temp2);
     *(pByte+2) = (cmsUInt8Number)0;
     *(pByte+3) = (cmsUInt8Number)0;
@@ -1167,33 +1176,7 @@
     return cmsOpenProfileFromMemTHR(NULL, MemPtr, dwSize);
 }
 
-static
-cmsBool SanityCheck(_cmsICCPROFILE* profile)
-{
-    cmsIOHANDLER* io;
 
-    if (!profile) {
-        return FALSE;
-    }
-
-    io = profile->IOhandler;
-    if (!io) {
-        return FALSE;
-    }
-
-    if (!io->Seek ||
-        !(io->Seek==NULLSeek || io->Seek==MemorySeek || io->Seek==FileSeek))
-    {
-        return FALSE;
-    }
-    if (!io->Read ||
-        !(io->Read==NULLRead || io->Read==MemoryRead || io->Read==FileRead))
-    {
-        return FALSE;
-    }
-
-    return TRUE;
-}
 
 // Dump tag contents. If the profile is being modified, untouched tags are copied from FileOrig
 static
@@ -1225,7 +1208,7 @@
 
             // Reach here if we are copying a tag from a disk-based ICC profile which has not been modified by user.
             // In this case a blind copy of the block data is performed
-            if (SanityCheck(FileOrig) && Icc -> TagOffsets[i]) {
+            if (FileOrig != NULL && Icc -> TagOffsets[i]) {
 
                 cmsUInt32Number TagSize   = FileOrig -> TagSizes[i];
                 cmsUInt32Number TagOffset = FileOrig -> TagOffsets[i];
@@ -1874,7 +1857,7 @@
 
 // Similar to the anterior. This function allows to write directly to the ICC profile any data, without
 // checking anything. As a rule, mixing Raw with cooked doesn't work, so writting a tag as raw and then reading
-// it as cooked without serializing does result into an error. If that is wha you want, you will need to dump
+// it as cooked without serializing does result into an error. If that is what you want, you will need to dump
 // the profile to memry or disk and then reopen it.
 cmsBool CMSEXPORT cmsWriteRawTag(cmsHPROFILE hProfile, cmsTagSignature sig, const void* data, cmsUInt32Number Size)
 {
@@ -1898,6 +1881,11 @@
     Icc ->TagSizes[i] = Size;
 
     _cmsUnlockMutex(Icc->ContextID, Icc ->UsrMutex);
+
+    if (Icc->TagPtrs[i] == NULL) {
+           Icc->TagNames[i] = 0;
+           return FALSE;
+    }
     return TRUE;
 }
 
--- a/src/share/native/sun/java2d/cmm/lcms/cmsio1.c	Wed May 13 12:50:09 2015 -0700
+++ b/src/share/native/sun/java2d/cmm/lcms/cmsio1.c	Thu May 14 20:11:36 2015 -0700
@@ -339,8 +339,8 @@
 cmsPipeline* _cmsReadInputLUT(cmsHPROFILE hProfile, int Intent)
 {
     cmsTagTypeSignature OriginalType;
-    cmsTagSignature tag16    = Device2PCS16[Intent];
-    cmsTagSignature tagFloat = Device2PCSFloat[Intent];
+    cmsTagSignature tag16;
+    cmsTagSignature tagFloat;
     cmsContext ContextID = cmsGetProfileContextID(hProfile);
 
     // On named color, take the appropiate tag
@@ -369,6 +369,9 @@
     // matter other LUT are present and have precedence. Intent = -1 means just this.
     if (Intent != -1) {
 
+        tag16 = Device2PCS16[Intent];
+        tagFloat = Device2PCSFloat[Intent];
+
         if (cmsIsTag(hProfile, tagFloat)) {  // Float tag takes precedence
 
             // Floating point LUT are always V4, but the encoding range is no
@@ -611,13 +614,16 @@
 cmsPipeline* _cmsReadOutputLUT(cmsHPROFILE hProfile, int Intent)
 {
     cmsTagTypeSignature OriginalType;
-    cmsTagSignature tag16    = PCS2Device16[Intent];
-    cmsTagSignature tagFloat = PCS2DeviceFloat[Intent];
-    cmsContext ContextID     = cmsGetProfileContextID(hProfile);
+    cmsTagSignature tag16;
+    cmsTagSignature tagFloat;
+    cmsContext ContextID  = cmsGetProfileContextID(hProfile);
 
 
     if (Intent != -1) {
 
+        tag16 = PCS2Device16[Intent];
+        tagFloat = PCS2DeviceFloat[Intent];
+
         if (cmsIsTag(hProfile, tagFloat)) {  // Float tag takes precedence
 
             // Floating point LUT are always V4
@@ -935,7 +941,7 @@
 {
     if (!cmsWriteTag(hProfile, cmsSigProfileSequenceDescTag, seq)) return FALSE;
 
-    if (cmsGetProfileVersion(hProfile) >= 4.0) {
+    if (cmsGetEncodedICCversion(hProfile) >= 0x4000000) {
 
             if (!cmsWriteTag(hProfile, cmsSigProfileSequenceIdTag, seq)) return FALSE;
     }
--- a/src/share/native/sun/java2d/cmm/lcms/cmslut.c	Wed May 13 12:50:09 2015 -0700
+++ b/src/share/native/sun/java2d/cmm/lcms/cmslut.c	Thu May 14 20:11:36 2015 -0700
@@ -1154,7 +1154,23 @@
     return mpe;
 }
 
+// Clips values smaller than zero
+static
+void Clipper(const cmsFloat32Number In[], cmsFloat32Number Out[], const cmsStage *mpe)
+{
+       cmsUInt32Number i;
+       for (i = 0; i < mpe->InputChannels; i++) {
 
+              cmsFloat32Number n = In[i];
+              Out[i] = n < 0 ? 0 : n;
+       }
+}
+
+cmsStage*  _cmsStageClipNegatives(cmsContext ContextID, int nChannels)
+{
+       return _cmsStageAllocPlaceholder(ContextID, cmsSigClipNegativesElemType,
+              nChannels, nChannels, Clipper, NULL, NULL, NULL);
+}
 
 // ********************************************************************************
 // Type cmsSigXYZ2LabElemType
--- a/src/share/native/sun/java2d/cmm/lcms/cmsnamed.c	Wed May 13 12:50:09 2015 -0700
+++ b/src/share/native/sun/java2d/cmm/lcms/cmsnamed.c	Thu May 14 20:11:36 2015 -0700
@@ -543,8 +543,9 @@
     v ->nColors   = 0;
     v ->ContextID  = ContextID;
 
-    while (v -> Allocated < n)
-        GrowNamedColorList(v);
+    while (v -> Allocated < n){
+        if (!GrowNamedColorList(v)) return NULL;
+    }
 
     strncpy(v ->Prefix, Prefix, sizeof(v ->Prefix)-1);
     strncpy(v ->Suffix, Suffix, sizeof(v ->Suffix)-1);
@@ -573,8 +574,9 @@
     if (NewNC == NULL) return NULL;
 
     // For really large tables we need this
-    while (NewNC ->Allocated < v ->Allocated)
-        GrowNamedColorList(NewNC);
+    while (NewNC ->Allocated < v ->Allocated){
+        if (!GrowNamedColorList(NewNC)) return NULL;
+    }
 
     memmove(NewNC ->Prefix, v ->Prefix, sizeof(v ->Prefix));
     memmove(NewNC ->Suffix, v ->Suffix, sizeof(v ->Suffix));
--- a/src/share/native/sun/java2d/cmm/lcms/cmsopt.c	Wed May 13 12:50:09 2015 -0700
+++ b/src/share/native/sun/java2d/cmm/lcms/cmsopt.c	Thu May 14 20:11:36 2015 -0700
@@ -192,6 +192,88 @@
     return AnyOpt;
 }
 
+
+static
+cmsBool CloseEnoughFloat(cmsFloat64Number a, cmsFloat64Number b)
+{
+       return fabs(b - a) < 0.00001f;
+}
+
+static
+cmsBool  isFloatMatrixIdentity(const cmsMAT3* a)
+{
+       cmsMAT3 Identity;
+       int i, j;
+
+       _cmsMAT3identity(&Identity);
+
+       for (i = 0; i < 3; i++)
+              for (j = 0; j < 3; j++)
+                     if (!CloseEnoughFloat(a->v[i].n[j], Identity.v[i].n[j])) return FALSE;
+
+       return TRUE;
+}
+// if two adjacent matrices are found, multiply them.
+static
+cmsBool _MultiplyMatrix(cmsPipeline* Lut)
+{
+       cmsStage** pt1;
+       cmsStage** pt2;
+       cmsStage*  chain;
+       cmsBool AnyOpt = FALSE;
+
+       pt1 = &Lut->Elements;
+       if (*pt1 == NULL) return AnyOpt;
+
+       while (*pt1 != NULL) {
+
+              pt2 = &((*pt1)->Next);
+              if (*pt2 == NULL) return AnyOpt;
+
+              if ((*pt1)->Implements == cmsSigMatrixElemType && (*pt2)->Implements == cmsSigMatrixElemType) {
+
+                     // Get both matrices
+                     _cmsStageMatrixData* m1 = (_cmsStageMatrixData*) cmsStageData(*pt1);
+                     _cmsStageMatrixData* m2 = (_cmsStageMatrixData*) cmsStageData(*pt2);
+                     cmsMAT3 res;
+
+                     // Input offset and output offset should be zero to use this optimization
+                     if (m1->Offset != NULL || m2 ->Offset != NULL ||
+                            cmsStageInputChannels(*pt1) != 3 || cmsStageOutputChannels(*pt1) != 3 ||
+                            cmsStageInputChannels(*pt2) != 3 || cmsStageOutputChannels(*pt2) != 3)
+                            return FALSE;
+
+                     // Multiply both matrices to get the result
+                     _cmsMAT3per(&res, (cmsMAT3*)m2->Double, (cmsMAT3*)m1->Double);
+
+                     // Get the next in chain afer the matrices
+                     chain = (*pt2)->Next;
+
+                     // Remove both matrices
+                     _RemoveElement(pt2);
+                     _RemoveElement(pt1);
+
+                     // Now what if the result is a plain identity?
+                     if (!isFloatMatrixIdentity(&res)) {
+
+                            // We can not get rid of full matrix
+                            cmsStage* Multmat = cmsStageAllocMatrix(Lut->ContextID, 3, 3, (const cmsFloat64Number*) &res, NULL);
+
+                            // Recover the chain
+                            Multmat->Next = chain;
+                            *pt1 = Multmat;
+                     }
+
+                     AnyOpt = TRUE;
+              }
+              else
+                     pt1 = &((*pt1)->Next);
+       }
+
+       return AnyOpt;
+}
+
+
 // Preoptimize just gets rif of no-ops coming paired. Conversion from v2 to v4 followed
 // by a v4 to v2 and vice-versa. The elements are then discarded.
 static
@@ -224,6 +306,9 @@
         // Remove float pcs Lab conversions
         Opt |= _Remove2Op(Lut, cmsSigXYZ2FloatPCS, cmsSigFloatPCS2XYZ);
 
+        // Simplify matrix.
+        Opt |= _MultiplyMatrix(Lut);
+
         if (Opt) AnyOpt = TRUE;
 
     } while (Opt);
@@ -280,12 +365,12 @@
 void* Prelin16dup(cmsContext ContextID, const void* ptr)
 {
     Prelin16Data* p16 = (Prelin16Data*) ptr;
-    Prelin16Data* Duped = _cmsDupMem(ContextID, p16, sizeof(Prelin16Data));
+    Prelin16Data* Duped = (Prelin16Data*) _cmsDupMem(ContextID, p16, sizeof(Prelin16Data));
 
     if (Duped == NULL) return NULL;
 
-    Duped ->EvalCurveOut16   = _cmsDupMem(ContextID, p16 ->EvalCurveOut16, p16 ->nOutputs * sizeof(_cmsInterpFn16));
-    Duped ->ParamsCurveOut16 = _cmsDupMem(ContextID, p16 ->ParamsCurveOut16, p16 ->nOutputs * sizeof(cmsInterpParams* ));
+    Duped->EvalCurveOut16 = (_cmsInterpFn16*) _cmsDupMem(ContextID, p16->EvalCurveOut16, p16->nOutputs * sizeof(_cmsInterpFn16));
+    Duped->ParamsCurveOut16 = (cmsInterpParams**)_cmsDupMem(ContextID, p16->ParamsCurveOut16, p16->nOutputs * sizeof(cmsInterpParams*));
 
     return Duped;
 }
@@ -298,7 +383,7 @@
                                int nOutputs, cmsToneCurve** Out )
 {
     int i;
-    Prelin16Data* p16 = _cmsMallocZero(ContextID, sizeof(Prelin16Data));
+    Prelin16Data* p16 = (Prelin16Data*)_cmsMallocZero(ContextID, sizeof(Prelin16Data));
     if (p16 == NULL) return NULL;
 
     p16 ->nInputs = nInputs;
@@ -787,7 +872,7 @@
     cmsS15Fixed16Number v1, v2, v3;
     Prelin8Data* p8;
 
-    p8 = _cmsMallocZero(ContextID, sizeof(Prelin8Data));
+    p8 = (Prelin8Data*)_cmsMallocZero(ContextID, sizeof(Prelin8Data));
     if (p8 == NULL) return NULL;
 
     // Since this only works for 8 bit input, values comes always as x * 257,
@@ -861,7 +946,7 @@
     Prelin8Data* p8 = (Prelin8Data*) D;
     register const cmsInterpParams* p = p8 ->p;
     int                    TotalOut = p -> nOutputs;
-    const cmsUInt16Number* LutTable = p -> Table;
+    const cmsUInt16Number* LutTable = (const cmsUInt16Number*) p->Table;
 
     r = Input[0] >> 8;
     g = Input[1] >> 8;
@@ -1180,15 +1265,15 @@
 static
 void* CurvesDup(cmsContext ContextID, const void* ptr)
 {
-    Curves16Data* Data = _cmsDupMem(ContextID, ptr, sizeof(Curves16Data));
+    Curves16Data* Data = (Curves16Data*)_cmsDupMem(ContextID, ptr, sizeof(Curves16Data));
     int i;
 
     if (Data == NULL) return NULL;
 
-    Data ->Curves = _cmsDupMem(ContextID, Data ->Curves, Data ->nCurves * sizeof(cmsUInt16Number*));
+    Data->Curves = (cmsUInt16Number**) _cmsDupMem(ContextID, Data->Curves, Data->nCurves * sizeof(cmsUInt16Number*));
 
     for (i=0; i < Data -> nCurves; i++) {
-        Data ->Curves[i] = _cmsDupMem(ContextID, Data ->Curves[i], Data -> nElements * sizeof(cmsUInt16Number));
+        Data->Curves[i] = (cmsUInt16Number*) _cmsDupMem(ContextID, Data->Curves[i], Data->nElements * sizeof(cmsUInt16Number));
     }
 
     return (void*) Data;
@@ -1201,18 +1286,18 @@
     int i, j;
     Curves16Data* c16;
 
-    c16 = _cmsMallocZero(ContextID, sizeof(Curves16Data));
+    c16 = (Curves16Data*)_cmsMallocZero(ContextID, sizeof(Curves16Data));
     if (c16 == NULL) return NULL;
 
     c16 ->nCurves = nCurves;
     c16 ->nElements = nElements;
 
-    c16 ->Curves = _cmsCalloc(ContextID, nCurves, sizeof(cmsUInt16Number*));
+    c16->Curves = (cmsUInt16Number**) _cmsCalloc(ContextID, nCurves, sizeof(cmsUInt16Number*));
     if (c16 ->Curves == NULL) return NULL;
 
     for (i=0; i < nCurves; i++) {
 
-        c16->Curves[i] = _cmsCalloc(ContextID, nElements, sizeof(cmsUInt16Number));
+        c16->Curves[i] = (cmsUInt16Number*) _cmsCalloc(ContextID, nElements, sizeof(cmsUInt16Number));
 
         if (c16->Curves[i] == NULL) {
 
@@ -1560,49 +1645,83 @@
 }
 
 //  8 bits on input allows matrix-shaper boot up to 25 Mpixels per second on RGB. That's fast!
-// TODO: Allow a third matrix for abs. colorimetric
 static
 cmsBool OptimizeMatrixShaper(cmsPipeline** Lut, cmsUInt32Number Intent, cmsUInt32Number* InputFormat, cmsUInt32Number* OutputFormat, cmsUInt32Number* dwFlags)
 {
-    cmsStage* Curve1, *Curve2;
-    cmsStage* Matrix1, *Matrix2;
-    _cmsStageMatrixData* Data1;
-    _cmsStageMatrixData* Data2;
-    cmsMAT3 res;
-    cmsBool IdentityMat;
-    cmsPipeline* Dest, *Src;
+       cmsStage* Curve1, *Curve2;
+       cmsStage* Matrix1, *Matrix2;
+       cmsMAT3 res;
+       cmsBool IdentityMat;
+       cmsPipeline* Dest, *Src;
+       cmsFloat64Number* Offset;
 
-    // Only works on RGB to RGB
-    if (T_CHANNELS(*InputFormat) != 3 || T_CHANNELS(*OutputFormat) != 3) return FALSE;
+       // Only works on RGB to RGB
+       if (T_CHANNELS(*InputFormat) != 3 || T_CHANNELS(*OutputFormat) != 3) return FALSE;
 
-    // Only works on 8 bit input
-    if (!_cmsFormatterIs8bit(*InputFormat)) return FALSE;
+       // Only works on 8 bit input
+       if (!_cmsFormatterIs8bit(*InputFormat)) return FALSE;
 
-    // Seems suitable, proceed
-    Src = *Lut;
+       // Seems suitable, proceed
+       Src = *Lut;
 
-    // Check for shaper-matrix-matrix-shaper structure, that is what this optimizer stands for
-    if (!cmsPipelineCheckAndRetreiveStages(Src, 4,
-        cmsSigCurveSetElemType, cmsSigMatrixElemType, cmsSigMatrixElemType, cmsSigCurveSetElemType,
-        &Curve1, &Matrix1, &Matrix2, &Curve2)) return FALSE;
+       // Check for:
+       //
+       //    shaper-matrix-matrix-shaper
+       //    shaper-matrix-shaper
+       //
+       // Both of those constructs are possible (first because abs. colorimetric).
+       // additionally, In the first case, the input matrix offset should be zero.
 
-    // Get both matrices
-    Data1 = (_cmsStageMatrixData*) cmsStageData(Matrix1);
-    Data2 = (_cmsStageMatrixData*) cmsStageData(Matrix2);
+       IdentityMat = FALSE;
+       if (cmsPipelineCheckAndRetreiveStages(Src, 4,
+              cmsSigCurveSetElemType, cmsSigMatrixElemType, cmsSigMatrixElemType, cmsSigCurveSetElemType,
+              &Curve1, &Matrix1, &Matrix2, &Curve2)) {
 
-    // Input offset should be zero
-    if (Data1 ->Offset != NULL) return FALSE;
+              // Get both matrices
+              _cmsStageMatrixData* Data1 = (_cmsStageMatrixData*)cmsStageData(Matrix1);
+              _cmsStageMatrixData* Data2 = (_cmsStageMatrixData*)cmsStageData(Matrix2);
 
-    // Multiply both matrices to get the result
-    _cmsMAT3per(&res, (cmsMAT3*) Data2 ->Double, (cmsMAT3*) Data1 ->Double);
+              // Input offset should be zero
+              if (Data1->Offset != NULL) return FALSE;
 
-    // Now the result is in res + Data2 -> Offset. Maybe is a plain identity?
-    IdentityMat = FALSE;
-    if (_cmsMAT3isIdentity(&res) && Data2 ->Offset == NULL) {
+              // Multiply both matrices to get the result
+              _cmsMAT3per(&res, (cmsMAT3*)Data2->Double, (cmsMAT3*)Data1->Double);
 
-        // We can get rid of full matrix
-        IdentityMat = TRUE;
-    }
+              // Only 2nd matrix has offset, or it is zero
+              Offset = Data2->Offset;
+
+              // Now the result is in res + Data2 -> Offset. Maybe is a plain identity?
+              if (_cmsMAT3isIdentity(&res) && Offset == NULL) {
+
+                     // We can get rid of full matrix
+                     IdentityMat = TRUE;
+              }
+
+       }
+       else {
+
+              if (cmsPipelineCheckAndRetreiveStages(Src, 3,
+                     cmsSigCurveSetElemType, cmsSigMatrixElemType, cmsSigCurveSetElemType,
+                     &Curve1, &Matrix1, &Curve2)) {
+
+                     _cmsStageMatrixData* Data = (_cmsStageMatrixData*)cmsStageData(Matrix1);
+
+                     // Copy the matrix to our result
+                     memcpy(&res, Data->Double, sizeof(res));
+
+                     // Preserve the Odffset (may be NULL as a zero offset)
+                     Offset = Data->Offset;
+
+                     if (_cmsMAT3isIdentity(&res) && Offset == NULL) {
+
+                            // We can get rid of full matrix
+                            IdentityMat = TRUE;
+                     }
+              }
+              else
+                     return FALSE; // Not optimizeable this time
+
+       }
 
       // Allocate an empty LUT
     Dest =  cmsPipelineAlloc(Src ->ContextID, Src ->InputChannels, Src ->OutputChannels);
@@ -1612,9 +1731,12 @@
     if (!cmsPipelineInsertStage(Dest, cmsAT_BEGIN, cmsStageDup(Curve1)))
         goto Error;
 
-    if (!IdentityMat)
-        if (!cmsPipelineInsertStage(Dest, cmsAT_END, cmsStageAllocMatrix(Dest ->ContextID, 3, 3, (const cmsFloat64Number*) &res, Data2 ->Offset)))
-            goto Error;
+    if (!IdentityMat) {
+
+           if (!cmsPipelineInsertStage(Dest, cmsAT_END, cmsStageAllocMatrix(Dest->ContextID, 3, 3, (const cmsFloat64Number*)&res, Offset)))
+                  goto Error;
+    }
+
     if (!cmsPipelineInsertStage(Dest, cmsAT_END, cmsStageDup(Curve2)))
         goto Error;
 
@@ -1632,7 +1754,7 @@
         *dwFlags |= cmsFLAGS_NOCACHE;
 
         // Setup the optimizarion routines
-        SetMatShaper(Dest, mpeC1 ->TheCurves, &res, (cmsVEC3*) Data2 ->Offset, mpeC2->TheCurves, OutputFormat);
+        SetMatShaper(Dest, mpeC1 ->TheCurves, &res, (cmsVEC3*) Offset, mpeC2->TheCurves, OutputFormat);
     }
 
     cmsPipelineFree(Src);
--- a/src/share/native/sun/java2d/cmm/lcms/cmspack.c	Wed May 13 12:50:09 2015 -0700
+++ b/src/share/native/sun/java2d/cmm/lcms/cmspack.c	Thu May 14 20:11:36 2015 -0700
@@ -2438,9 +2438,6 @@
             ((cmsFloat64Number*) output)[i + start] = v;
     }
 
-    if (!ExtraFirst) {
-        output += Extra * sizeof(cmsFloat64Number);
-    }
 
     if (Extra == 0 && SwapFirst) {
 
@@ -2451,7 +2448,7 @@
     if (T_PLANAR(info -> OutputFormat))
         return output + sizeof(cmsFloat64Number);
     else
-        return output + nChan * sizeof(cmsFloat64Number);
+        return output + (nChan + Extra) * sizeof(cmsFloat64Number);
 
 }
 
@@ -2462,50 +2459,47 @@
                                 register cmsUInt8Number* output,
                                 register cmsUInt32Number Stride)
 {
-    int nChan      = T_CHANNELS(info -> OutputFormat);
-    int DoSwap     = T_DOSWAP(info ->OutputFormat);
-    int Reverse    = T_FLAVOR(info ->OutputFormat);
-    int Extra      = T_EXTRA(info -> OutputFormat);
-    int SwapFirst  = T_SWAPFIRST(info -> OutputFormat);
-    int Planar     = T_PLANAR(info -> OutputFormat);
-    int ExtraFirst = DoSwap ^ SwapFirst;
-    cmsFloat64Number maximum = IsInkSpace(info ->OutputFormat) ? 655.35 : 65535.0;
-    cmsFloat64Number v = 0;
-    cmsFloat32Number* swap1 = (cmsFloat32Number*) output;
-    int i, start = 0;
-
-    if (ExtraFirst)
-        start = Extra;
-
-    for (i=0; i < nChan; i++) {
-
-        int index = DoSwap ? (nChan - i - 1) : i;
-
-        v = (cmsFloat64Number) wOut[index] / maximum;
-
-        if (Reverse)
-            v = maximum - v;
-
-        if (Planar)
-            ((cmsFloat32Number*) output)[(i + start ) * Stride]= (cmsFloat32Number) v;
-        else
-            ((cmsFloat32Number*) output)[i + start] = (cmsFloat32Number) v;
-    }
-
-    if (!ExtraFirst) {
-        output += Extra * sizeof(cmsFloat32Number);
-    }
-
-  if (Extra == 0 && SwapFirst) {
-
-         memmove(swap1 + 1, swap1, (nChan-1)* sizeof(cmsFloat32Number));
-        *swap1 = (cmsFloat32Number) v;
-    }
-
-    if (T_PLANAR(info -> OutputFormat))
-        return output + sizeof(cmsFloat32Number);
-    else
-        return output + nChan * sizeof(cmsFloat32Number);
+       int nChan = T_CHANNELS(info->OutputFormat);
+       int DoSwap = T_DOSWAP(info->OutputFormat);
+       int Reverse = T_FLAVOR(info->OutputFormat);
+       int Extra = T_EXTRA(info->OutputFormat);
+       int SwapFirst = T_SWAPFIRST(info->OutputFormat);
+       int Planar = T_PLANAR(info->OutputFormat);
+       int ExtraFirst = DoSwap ^ SwapFirst;
+       cmsFloat64Number maximum = IsInkSpace(info->OutputFormat) ? 655.35 : 65535.0;
+       cmsFloat64Number v = 0;
+       cmsFloat32Number* swap1 = (cmsFloat32Number*)output;
+       int i, start = 0;
+
+       if (ExtraFirst)
+              start = Extra;
+
+       for (i = 0; i < nChan; i++) {
+
+              int index = DoSwap ? (nChan - i - 1) : i;
+
+              v = (cmsFloat64Number)wOut[index] / maximum;
+
+              if (Reverse)
+                     v = maximum - v;
+
+              if (Planar)
+                     ((cmsFloat32Number*)output)[(i + start) * Stride] = (cmsFloat32Number)v;
+              else
+                     ((cmsFloat32Number*)output)[i + start] = (cmsFloat32Number)v;
+       }
+
+
+       if (Extra == 0 && SwapFirst) {
+
+              memmove(swap1 + 1, swap1, (nChan - 1)* sizeof(cmsFloat32Number));
+              *swap1 = (cmsFloat32Number)v;
+       }
+
+       if (T_PLANAR(info->OutputFormat))
+              return output + sizeof(cmsFloat32Number);
+       else
+              return output + (nChan + Extra) * sizeof(cmsFloat32Number);
 }
 
 
@@ -2518,50 +2512,47 @@
                                     cmsUInt8Number* output,
                                     cmsUInt32Number Stride)
 {
-    int nChan      = T_CHANNELS(info -> OutputFormat);
-    int DoSwap     = T_DOSWAP(info ->OutputFormat);
-    int Reverse    = T_FLAVOR(info ->OutputFormat);
-    int Extra      = T_EXTRA(info -> OutputFormat);
-    int SwapFirst  = T_SWAPFIRST(info -> OutputFormat);
-    int Planar     = T_PLANAR(info -> OutputFormat);
-    int ExtraFirst = DoSwap ^ SwapFirst;
-    cmsFloat64Number maximum = IsInkSpace(info ->OutputFormat) ? 100.0 : 1.0;
-    cmsFloat32Number* swap1 = (cmsFloat32Number*) output;
-    cmsFloat64Number v = 0;
-    int i, start = 0;
-
-    if (ExtraFirst)
-        start = Extra;
-
-    for (i=0; i < nChan; i++) {
-
-        int index = DoSwap ? (nChan - i - 1) : i;
-
-        v = wOut[index] * maximum;
-
-        if (Reverse)
-            v = maximum - v;
-
-        if (Planar)
-            ((cmsFloat32Number*) output)[(i + start)* Stride]= (cmsFloat32Number) v;
-        else
-            ((cmsFloat32Number*) output)[i + start] = (cmsFloat32Number) v;
-    }
-
-    if (!ExtraFirst) {
-        output += Extra * sizeof(cmsFloat32Number);
-    }
-
-   if (Extra == 0 && SwapFirst) {
-
-         memmove(swap1 + 1, swap1, (nChan-1)* sizeof(cmsFloat32Number));
-        *swap1 = (cmsFloat32Number) v;
-    }
-
-    if (T_PLANAR(info -> OutputFormat))
-        return output + sizeof(cmsFloat32Number);
-    else
-        return output + nChan * sizeof(cmsFloat32Number);
+       int nChan = T_CHANNELS(info->OutputFormat);
+       int DoSwap = T_DOSWAP(info->OutputFormat);
+       int Reverse = T_FLAVOR(info->OutputFormat);
+       int Extra = T_EXTRA(info->OutputFormat);
+       int SwapFirst = T_SWAPFIRST(info->OutputFormat);
+       int Planar = T_PLANAR(info->OutputFormat);
+       int ExtraFirst = DoSwap ^ SwapFirst;
+       cmsFloat64Number maximum = IsInkSpace(info->OutputFormat) ? 100.0 : 1.0;
+       cmsFloat32Number* swap1 = (cmsFloat32Number*)output;
+       cmsFloat64Number v = 0;
+       int i, start = 0;
+
+       if (ExtraFirst)
+              start = Extra;
+
+       for (i = 0; i < nChan; i++) {
+
+              int index = DoSwap ? (nChan - i - 1) : i;
+
+              v = wOut[index] * maximum;
+
+              if (Reverse)
+                     v = maximum - v;
+
+              if (Planar)
+                     ((cmsFloat32Number*)output)[(i + start)* Stride] = (cmsFloat32Number)v;
+              else
+                     ((cmsFloat32Number*)output)[i + start] = (cmsFloat32Number)v;
+       }
+
+
+       if (Extra == 0 && SwapFirst) {
+
+              memmove(swap1 + 1, swap1, (nChan - 1)* sizeof(cmsFloat32Number));
+              *swap1 = (cmsFloat32Number)v;
+       }
+
+       if (T_PLANAR(info->OutputFormat))
+              return output + sizeof(cmsFloat32Number);
+       else
+              return output + (nChan + Extra) * sizeof(cmsFloat32Number);
 }
 
 static
@@ -2570,51 +2561,47 @@
                                     cmsUInt8Number* output,
                                     cmsUInt32Number Stride)
 {
-    int nChan      = T_CHANNELS(info -> OutputFormat);
-    int DoSwap     = T_DOSWAP(info ->OutputFormat);
-    int Reverse    = T_FLAVOR(info ->OutputFormat);
-    int Extra      = T_EXTRA(info -> OutputFormat);
-    int SwapFirst  = T_SWAPFIRST(info -> OutputFormat);
-    int Planar     = T_PLANAR(info -> OutputFormat);
-    int ExtraFirst = DoSwap ^ SwapFirst;
-    cmsFloat64Number maximum = IsInkSpace(info ->OutputFormat) ? 100.0 : 1.0;
-    cmsFloat64Number v = 0;
-    cmsFloat64Number* swap1 = (cmsFloat64Number*) output;
-    int i, start = 0;
-
-    if (ExtraFirst)
-        start = Extra;
-
-    for (i=0; i < nChan; i++) {
-
-        int index = DoSwap ? (nChan - i - 1) : i;
-
-        v = wOut[index] * maximum;
-
-        if (Reverse)
-            v = maximum - v;
-
-        if (Planar)
-            ((cmsFloat64Number*) output)[(i + start) * Stride] =  v;
-        else
-            ((cmsFloat64Number*) output)[i + start] =  v;
-    }
-
-    if (!ExtraFirst) {
-        output += Extra * sizeof(cmsFloat64Number);
-    }
-
-   if (Extra == 0 && SwapFirst) {
-
-         memmove(swap1 + 1, swap1, (nChan-1)* sizeof(cmsFloat64Number));
-        *swap1 = v;
-    }
-
-
-    if (T_PLANAR(info -> OutputFormat))
-        return output + sizeof(cmsFloat64Number);
-    else
-        return output + nChan * sizeof(cmsFloat64Number);
+       int nChan = T_CHANNELS(info->OutputFormat);
+       int DoSwap = T_DOSWAP(info->OutputFormat);
+       int Reverse = T_FLAVOR(info->OutputFormat);
+       int Extra = T_EXTRA(info->OutputFormat);
+       int SwapFirst = T_SWAPFIRST(info->OutputFormat);
+       int Planar = T_PLANAR(info->OutputFormat);
+       int ExtraFirst = DoSwap ^ SwapFirst;
+       cmsFloat64Number maximum = IsInkSpace(info->OutputFormat) ? 100.0 : 1.0;
+       cmsFloat64Number v = 0;
+       cmsFloat64Number* swap1 = (cmsFloat64Number*)output;
+       int i, start = 0;
+
+       if (ExtraFirst)
+              start = Extra;
+
+       for (i = 0; i < nChan; i++) {
+
+              int index = DoSwap ? (nChan - i - 1) : i;
+
+              v = wOut[index] * maximum;
+
+              if (Reverse)
+                     v = maximum - v;
+
+              if (Planar)
+                     ((cmsFloat64Number*)output)[(i + start) * Stride] = v;
+              else
+                     ((cmsFloat64Number*)output)[i + start] = v;
+       }
+
+       if (Extra == 0 && SwapFirst) {
+
+              memmove(swap1 + 1, swap1, (nChan - 1)* sizeof(cmsFloat64Number));
+              *swap1 = v;
+       }
+
+
+       if (T_PLANAR(info->OutputFormat))
+              return output + sizeof(cmsFloat64Number);
+       else
+              return output + (nChan + Extra) * sizeof(cmsFloat64Number);
 
 }
 
@@ -2850,50 +2837,47 @@
                                 register cmsUInt8Number* output,
                                 register cmsUInt32Number Stride)
 {
-    int nChan      = T_CHANNELS(info -> OutputFormat);
-    int DoSwap     = T_DOSWAP(info ->OutputFormat);
-    int Reverse    = T_FLAVOR(info ->OutputFormat);
-    int Extra      = T_EXTRA(info -> OutputFormat);
-    int SwapFirst  = T_SWAPFIRST(info -> OutputFormat);
-    int Planar     = T_PLANAR(info -> OutputFormat);
-    int ExtraFirst = DoSwap ^ SwapFirst;
-    cmsFloat32Number maximum = IsInkSpace(info ->OutputFormat) ? 655.35F : 65535.0F;
-    cmsFloat32Number v = 0;
-    cmsUInt16Number* swap1 = (cmsUInt16Number*) output;
-    int i, start = 0;
-
-    if (ExtraFirst)
-        start = Extra;
-
-    for (i=0; i < nChan; i++) {
-
-        int index = DoSwap ? (nChan - i - 1) : i;
-
-        v = (cmsFloat32Number) wOut[index] / maximum;
-
-        if (Reverse)
-            v = maximum - v;
-
-        if (Planar)
-            ((cmsUInt16Number*) output)[(i + start ) * Stride]= _cmsFloat2Half(v);
-        else
-            ((cmsUInt16Number*) output)[i + start] =  _cmsFloat2Half(v);
-    }
-
-    if (!ExtraFirst) {
-        output += Extra * sizeof(cmsUInt16Number);
-    }
-
-  if (Extra == 0 && SwapFirst) {
-
-         memmove(swap1 + 1, swap1, (nChan-1)* sizeof(cmsUInt16Number));
-        *swap1 = _cmsFloat2Half(v);
-    }
-
-    if (T_PLANAR(info -> OutputFormat))
-        return output + sizeof(cmsUInt16Number);
-    else
-        return output + nChan * sizeof(cmsUInt16Number);
+       int nChan = T_CHANNELS(info->OutputFormat);
+       int DoSwap = T_DOSWAP(info->OutputFormat);
+       int Reverse = T_FLAVOR(info->OutputFormat);
+       int Extra = T_EXTRA(info->OutputFormat);
+       int SwapFirst = T_SWAPFIRST(info->OutputFormat);
+       int Planar = T_PLANAR(info->OutputFormat);
+       int ExtraFirst = DoSwap ^ SwapFirst;
+       cmsFloat32Number maximum = IsInkSpace(info->OutputFormat) ? 655.35F : 65535.0F;
+       cmsFloat32Number v = 0;
+       cmsUInt16Number* swap1 = (cmsUInt16Number*)output;
+       int i, start = 0;
+
+       if (ExtraFirst)
+              start = Extra;
+
+       for (i = 0; i < nChan; i++) {
+
+              int index = DoSwap ? (nChan - i - 1) : i;
+
+              v = (cmsFloat32Number)wOut[index] / maximum;
+
+              if (Reverse)
+                     v = maximum - v;
+
+              if (Planar)
+                     ((cmsUInt16Number*)output)[(i + start) * Stride] = _cmsFloat2Half(v);
+              else
+                     ((cmsUInt16Number*)output)[i + start] = _cmsFloat2Half(v);
+       }
+
+
+       if (Extra == 0 && SwapFirst) {
+
+              memmove(swap1 + 1, swap1, (nChan - 1)* sizeof(cmsUInt16Number));
+              *swap1 = _cmsFloat2Half(v);
+       }
+
+       if (T_PLANAR(info->OutputFormat))
+              return output + sizeof(cmsUInt16Number);
+       else
+              return output + (nChan + Extra) * sizeof(cmsUInt16Number);
 }
 
 
@@ -2904,50 +2888,47 @@
                                     cmsUInt8Number* output,
                                     cmsUInt32Number Stride)
 {
-    int nChan      = T_CHANNELS(info -> OutputFormat);
-    int DoSwap     = T_DOSWAP(info ->OutputFormat);
-    int Reverse    = T_FLAVOR(info ->OutputFormat);
-    int Extra      = T_EXTRA(info -> OutputFormat);
-    int SwapFirst  = T_SWAPFIRST(info -> OutputFormat);
-    int Planar     = T_PLANAR(info -> OutputFormat);
-    int ExtraFirst = DoSwap ^ SwapFirst;
-    cmsFloat32Number maximum = IsInkSpace(info ->OutputFormat) ? 100.0F : 1.0F;
-    cmsUInt16Number* swap1 = (cmsUInt16Number*) output;
-    cmsFloat32Number v = 0;
-    int i, start = 0;
-
-    if (ExtraFirst)
-        start = Extra;
-
-    for (i=0; i < nChan; i++) {
-
-        int index = DoSwap ? (nChan - i - 1) : i;
-
-        v = wOut[index] * maximum;
-
-        if (Reverse)
-            v = maximum - v;
-
-        if (Planar)
-            ((cmsUInt16Number*) output)[(i + start)* Stride]= _cmsFloat2Half( v );
-        else
-            ((cmsUInt16Number*) output)[i + start] = _cmsFloat2Half( v );
-    }
-
-    if (!ExtraFirst) {
-        output += Extra * sizeof(cmsUInt16Number);
-    }
-
-   if (Extra == 0 && SwapFirst) {
-
-         memmove(swap1 + 1, swap1, (nChan-1)* sizeof(cmsUInt16Number));
-        *swap1 = (cmsUInt16Number)  _cmsFloat2Half( v );
-    }
-
-    if (T_PLANAR(info -> OutputFormat))
-        return output + sizeof(cmsUInt16Number);
-    else
-        return output + nChan * sizeof(cmsUInt16Number);
+       int nChan = T_CHANNELS(info->OutputFormat);
+       int DoSwap = T_DOSWAP(info->OutputFormat);
+       int Reverse = T_FLAVOR(info->OutputFormat);
+       int Extra = T_EXTRA(info->OutputFormat);
+       int SwapFirst = T_SWAPFIRST(info->OutputFormat);
+       int Planar = T_PLANAR(info->OutputFormat);
+       int ExtraFirst = DoSwap ^ SwapFirst;
+       cmsFloat32Number maximum = IsInkSpace(info->OutputFormat) ? 100.0F : 1.0F;
+       cmsUInt16Number* swap1 = (cmsUInt16Number*)output;
+       cmsFloat32Number v = 0;
+       int i, start = 0;
+
+       if (ExtraFirst)
+              start = Extra;
+
+       for (i = 0; i < nChan; i++) {
+
+              int index = DoSwap ? (nChan - i - 1) : i;
+
+              v = wOut[index] * maximum;
+
+              if (Reverse)
+                     v = maximum - v;
+
+              if (Planar)
+                     ((cmsUInt16Number*)output)[(i + start)* Stride] = _cmsFloat2Half(v);
+              else
+                     ((cmsUInt16Number*)output)[i + start] = _cmsFloat2Half(v);
+       }
+
+
+       if (Extra == 0 && SwapFirst) {
+
+              memmove(swap1 + 1, swap1, (nChan - 1)* sizeof(cmsUInt16Number));
+              *swap1 = (cmsUInt16Number)_cmsFloat2Half(v);
+       }
+
+       if (T_PLANAR(info->OutputFormat))
+              return output + sizeof(cmsUInt16Number);
+       else
+              return output + (nChan + Extra)* sizeof(cmsUInt16Number);
 }
 
 #endif
--- a/src/share/native/sun/java2d/cmm/lcms/cmspcs.c	Wed May 13 12:50:09 2015 -0700
+++ b/src/share/native/sun/java2d/cmm/lcms/cmspcs.c	Thu May 14 20:11:36 2015 -0700
@@ -135,6 +135,15 @@
     Dest -> Z = ((1 - Source -> x - Source -> y) / Source -> y) * Source -> Y;
 }
 
+/*
+       The break point (24/116)^3 = (6/29)^3 is a very small amount of tristimulus
+       primary (0.008856).  Generally, this only happens for
+       nearly ideal blacks and for some orange / amber colors in transmission mode.
+       For example, the Z value of the orange turn indicator lamp lens on an
+       automobile will often be below this value.  But the Z does not
+       contribute to the perceived color directly.
+*/
+
 static
 cmsFloat64Number f(cmsFloat64Number t)
 {
--- a/src/share/native/sun/java2d/cmm/lcms/cmsplugin.c	Wed May 13 12:50:09 2015 -0700
+++ b/src/share/native/sun/java2d/cmm/lcms/cmsplugin.c	Thu May 14 20:11:36 2015 -0700
@@ -712,15 +712,21 @@
 
 
 // Internal: get the memory area associanted with each context client
-// Returns the block assigned to the specific zone.
+// Returns the block assigned to the specific zone. Never return NULL.
 void* _cmsContextGetClientChunk(cmsContext ContextID, _cmsMemoryClient mc)
 {
     struct _cmsContext_struct* ctx;
     void *ptr;
 
-    if (mc < 0 || mc >= MemoryClientMax) {
-        cmsSignalError(ContextID, cmsERROR_RANGE, "Bad context client");
-        return NULL;
+    if ((int) mc < 0 || mc >= MemoryClientMax) {
+
+           cmsSignalError(ContextID, cmsERROR_INTERNAL, "Bad context client -- possible corruption");
+
+           // This is catastrophic. Should never reach here
+           _cmsAssert(0);
+
+           // Reverts to global context
+           return globalContext.chunks[UserPtr];
     }
 
     ctx = _cmsGetContext(ContextID);
@@ -909,7 +915,7 @@
 }
 
 
-
+/*
 static
 struct _cmsContext_struct* FindPrev(struct _cmsContext_struct* id)
 {
@@ -926,6 +932,7 @@
 
     return NULL;  // List is empty or only one element!
 }
+*/
 
 // Frees any resources associated with the given context,
 // and destroys the context placeholder.
@@ -961,8 +968,8 @@
 
             // Search for previous
             for (prev = _cmsContextPoolHead;
-                prev != NULL;
-                prev = prev ->Next)
+                 prev != NULL;
+                 prev = prev ->Next)
             {
                 if (prev -> Next == ctx) {
                     prev -> Next = ctx ->Next;
--- a/src/share/native/sun/java2d/cmm/lcms/cmssamp.c	Wed May 13 12:50:09 2015 -0700
+++ b/src/share/native/sun/java2d/cmm/lcms/cmssamp.c	Thu May 14 20:11:36 2015 -0700
@@ -30,7 +30,7 @@
 //---------------------------------------------------------------------------------
 //
 //  Little Color Management System
-//  Copyright (c) 1998-2010 Marti Maria Saguer
+//  Copyright (c) 1998-2014 Marti Maria Saguer
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the "Software"),
@@ -369,28 +369,7 @@
 
 }
 
-/*
-static
-cmsBool IsMonotonic(int n, const cmsFloat64Number Table[])
-{
-    int i;
-    cmsFloat64Number last;
 
-    last = Table[n-1];
-
-    for (i = n-2; i >= 0; --i) {
-
-        if (Table[i] > last)
-
-            return FALSE;
-        else
-            last = Table[i];
-
-    }
-
-    return TRUE;
-}
-*/
 
 // Calculates the black point of a destination profile.
 // This algorithm comes from the Adobe paper disclosing its black point compensation method.
@@ -515,7 +494,6 @@
 
 
     // Test for mid range straight (only on relative colorimetric)
-
     NearlyStraightMidrange = TRUE;
     MinL = outRamp[0]; MaxL = outRamp[255];
     if (Intent == INTENT_RELATIVE_COLORIMETRIC) {
@@ -531,7 +509,6 @@
         // DestinationBlackPoint shall be the same as initialLab.
         // Otherwise, the DestinationBlackPoint shall be determined
         // using curve fitting.
-
         if (NearlyStraightMidrange) {
 
             cmsLab2XYZ(NULL, BlackPoint, &InitialLab);
@@ -543,14 +520,12 @@
 
     // curve fitting: The round-trip curve normally looks like a nearly constant section at the black point,
     // with a corner and a nearly straight line to the white point.
-
     for (l=0; l < 256; l++) {
 
         yRamp[l] = (outRamp[l] - MinL) / (MaxL - MinL);
     }
 
     // find the black point using the least squares error quadratic curve fitting
-
     if (Intent == INTENT_RELATIVE_COLORIMETRIC) {
         lo = 0.1;
         hi = 0.5;
--- a/src/share/native/sun/java2d/cmm/lcms/cmstypes.c	Wed May 13 12:50:09 2015 -0700
+++ b/src/share/native/sun/java2d/cmm/lcms/cmstypes.c	Thu May 14 20:11:36 2015 -0700
@@ -1718,10 +1718,7 @@
                 else
                     for (j=0; j < 256; j++) {
 
-                        if (Tables != NULL)
-                            val = (cmsUInt8Number) FROM_16_TO_8(Tables->TheCurves[i]->Table16[j]);
-                        else
-                            val = (cmsUInt8Number) j;
+                        val = (cmsUInt8Number) FROM_16_TO_8(Tables->TheCurves[i]->Table16[j]);
 
                         if (!_cmsWriteUInt8Number(io, val)) return FALSE;
                     }
--- a/src/share/native/sun/java2d/cmm/lcms/cmsvirt.c	Wed May 13 12:50:09 2015 -0700
+++ b/src/share/native/sun/java2d/cmm/lcms/cmsvirt.c	Thu May 14 20:11:36 2015 -0700
@@ -671,7 +671,7 @@
 // Create the ICC virtual profile for sRGB space
 cmsHPROFILE CMSEXPORT cmsCreate_sRGBProfileTHR(cmsContext ContextID)
 {
-       cmsCIExyY       D65;
+       cmsCIExyY       D65 = { 0.3127, 0.3290, 1.0 };
        cmsCIExyYTRIPLE Rec709Primaries = {
                                    {0.6400, 0.3300, 1.0},
                                    {0.3000, 0.6000, 1.0},
@@ -680,7 +680,7 @@
        cmsToneCurve* Gamma22[3];
        cmsHPROFILE  hsRGB;
 
-       cmsWhitePointFromTemp(&D65, 6504);
+      // cmsWhitePointFromTemp(&D65, 6504);
        Gamma22[0] = Gamma22[1] = Gamma22[2] = Build_sRGBGamma(ContextID);
        if (Gamma22[0] == NULL) return NULL;
 
@@ -708,6 +708,7 @@
                 cmsFloat64Number Contrast;
                 cmsFloat64Number Hue;
                 cmsFloat64Number Saturation;
+                cmsBool          lAdjustWP;
                 cmsCIEXYZ WPsrc, WPdest;
 
 } BCHSWADJUSTS, *LPBCHSWADJUSTS;
@@ -737,9 +738,10 @@
     cmsLCh2Lab(&LabOut, &LChOut);
 
     // Move white point in Lab
-
-    cmsLab2XYZ(&bchsw ->WPsrc,  &XYZ, &LabOut);
-    cmsXYZ2Lab(&bchsw ->WPdest, &LabOut, &XYZ);
+    if (bchsw->lAdjustWP) {
+           cmsLab2XYZ(&bchsw->WPsrc, &XYZ, &LabOut);
+           cmsXYZ2Lab(&bchsw->WPdest, &LabOut, &XYZ);
+    }
 
     // Back to encoded
 
@@ -773,18 +775,23 @@
     bchsw.Contrast   = Contrast;
     bchsw.Hue        = Hue;
     bchsw.Saturation = Saturation;
+    if (TempSrc == TempDest) {
 
-    cmsWhitePointFromTemp(&WhitePnt, TempSrc );
-    cmsxyY2XYZ(&bchsw.WPsrc, &WhitePnt);
+           bchsw.lAdjustWP = FALSE;
+    }
+    else {
+           bchsw.lAdjustWP = TRUE;
+           cmsWhitePointFromTemp(&WhitePnt, TempSrc);
+           cmsxyY2XYZ(&bchsw.WPsrc, &WhitePnt);
+           cmsWhitePointFromTemp(&WhitePnt, TempDest);
+           cmsxyY2XYZ(&bchsw.WPdest, &WhitePnt);
 
-    cmsWhitePointFromTemp(&WhitePnt, TempDest);
-    cmsxyY2XYZ(&bchsw.WPdest, &WhitePnt);
+    }
 
     hICC = cmsCreateProfilePlaceholder(ContextID);
     if (!hICC)                          // can't allocate
         return NULL;
 
-
     cmsSetDeviceClass(hICC,      cmsSigAbstractClass);
     cmsSetColorSpace(hICC,       cmsSigLabData);
     cmsSetPCS(hICC,              cmsSigLabData);
@@ -1017,12 +1024,14 @@
 
 } cmsAllowedLUT;
 
+#define cmsSig0 ((cmsTagSignature) 0)
+
 static const cmsAllowedLUT AllowedLUTTypes[] = {
 
-    { FALSE, 0,              cmsSigLut16Type,    4,  { cmsSigMatrixElemType,   cmsSigCurveSetElemType, cmsSigCLutElemType, cmsSigCurveSetElemType}},
-    { FALSE, 0,              cmsSigLut16Type,    3,  { cmsSigCurveSetElemType, cmsSigCLutElemType, cmsSigCurveSetElemType}},
-    { FALSE, 0,              cmsSigLut16Type,    2,  { cmsSigCurveSetElemType, cmsSigCLutElemType}},
-    { TRUE , 0,              cmsSigLutAtoBType,  1,  { cmsSigCurveSetElemType }},
+    { FALSE, cmsSig0,        cmsSigLut16Type, 4, { cmsSigMatrixElemType, cmsSigCurveSetElemType, cmsSigCLutElemType, cmsSigCurveSetElemType } },
+    { FALSE, cmsSig0,        cmsSigLut16Type, 3, { cmsSigCurveSetElemType, cmsSigCLutElemType, cmsSigCurveSetElemType } },
+    { FALSE, cmsSig0,        cmsSigLut16Type, 2, { cmsSigCurveSetElemType, cmsSigCLutElemType } },
+    { TRUE,  cmsSig0,        cmsSigLutAtoBType, 1, { cmsSigCurveSetElemType } },
     { TRUE , cmsSigAToB0Tag, cmsSigLutAtoBType,  3,  { cmsSigCurveSetElemType, cmsSigMatrixElemType, cmsSigCurveSetElemType } },
     { TRUE , cmsSigAToB0Tag, cmsSigLutAtoBType,  3,  { cmsSigCurveSetElemType, cmsSigCLutElemType, cmsSigCurveSetElemType   } },
     { TRUE , cmsSigAToB0Tag, cmsSigLutAtoBType,  5,  { cmsSigCurveSetElemType, cmsSigCLutElemType, cmsSigCurveSetElemType, cmsSigMatrixElemType, cmsSigCurveSetElemType }},
--- a/src/share/native/sun/java2d/cmm/lcms/cmsxform.c	Wed May 13 12:50:09 2015 -0700
+++ b/src/share/native/sun/java2d/cmm/lcms/cmsxform.c	Thu May 14 20:11:36 2015 -0700
@@ -621,46 +621,48 @@
      _cmsTransformPluginChunkType* ctx = ( _cmsTransformPluginChunkType*) _cmsContextGetClientChunk(ContextID, TransformPlugin);
      _cmsTransformCollection* Plugin;
 
-    // Allocate needed memory
-    _cmsTRANSFORM* p = (_cmsTRANSFORM*) _cmsMallocZero(ContextID, sizeof(_cmsTRANSFORM));
-    if (!p) return NULL;
+       // Allocate needed memory
+       _cmsTRANSFORM* p = (_cmsTRANSFORM*)_cmsMallocZero(ContextID, sizeof(_cmsTRANSFORM));
+       if (!p) return NULL;
 
-    // Store the proposed pipeline
-    p ->Lut = lut;
+       // Store the proposed pipeline
+       p->Lut = lut;
 
-    // Let's see if any plug-in want to do the transform by itself
-    for (Plugin = ctx ->TransformCollection;
-        Plugin != NULL;
-        Plugin = Plugin ->Next) {
+       // Let's see if any plug-in want to do the transform by itself
+       if (p->Lut != NULL) {
 
-            if (Plugin ->Factory(&p->xform, &p->UserData, &p ->FreeUserData, &p ->Lut, InputFormat, OutputFormat, dwFlags)) {
+              for (Plugin = ctx->TransformCollection;
+                     Plugin != NULL;
+                     Plugin = Plugin->Next) {
 
-                // Last plugin in the declaration order takes control. We just keep
-                // the original parameters as a logging.
-                // Note that cmsFLAGS_CAN_CHANGE_FORMATTER is not set, so by default
-                // an optimized transform is not reusable. The plug-in can, however, change
-                // the flags and make it suitable.
+                     if (Plugin->Factory(&p->xform, &p->UserData, &p->FreeUserData, &p->Lut, InputFormat, OutputFormat, dwFlags)) {
 
-                p ->ContextID       = ContextID;
-                p ->InputFormat     = *InputFormat;
-                p ->OutputFormat    = *OutputFormat;
-                p ->dwOriginalFlags = *dwFlags;
+                            // Last plugin in the declaration order takes control. We just keep
+                            // the original parameters as a logging.
+                            // Note that cmsFLAGS_CAN_CHANGE_FORMATTER is not set, so by default
+                            // an optimized transform is not reusable. The plug-in can, however, change
+                            // the flags and make it suitable.
 
-                // Fill the formatters just in case the optimized routine is interested.
-                // No error is thrown if the formatter doesn't exist. It is up to the optimization
-                // factory to decide what to do in those cases.
-                p ->FromInput      = _cmsGetFormatter(ContextID, *InputFormat,  cmsFormatterInput, CMS_PACK_FLAGS_16BITS).Fmt16;
-                p ->ToOutput       = _cmsGetFormatter(ContextID, *OutputFormat, cmsFormatterOutput, CMS_PACK_FLAGS_16BITS).Fmt16;
-                p ->FromInputFloat = _cmsGetFormatter(ContextID, *InputFormat,  cmsFormatterInput, CMS_PACK_FLAGS_FLOAT).FmtFloat;
-                p ->ToOutputFloat  = _cmsGetFormatter(ContextID, *OutputFormat, cmsFormatterOutput, CMS_PACK_FLAGS_FLOAT).FmtFloat;
+                            p->ContextID = ContextID;
+                            p->InputFormat = *InputFormat;
+                            p->OutputFormat = *OutputFormat;
+                            p->dwOriginalFlags = *dwFlags;
 
-                return p;
-            }
-    }
+                            // Fill the formatters just in case the optimized routine is interested.
+                            // No error is thrown if the formatter doesn't exist. It is up to the optimization
+                            // factory to decide what to do in those cases.
+                            p->FromInput = _cmsGetFormatter(ContextID, *InputFormat, cmsFormatterInput, CMS_PACK_FLAGS_16BITS).Fmt16;
+                            p->ToOutput = _cmsGetFormatter(ContextID, *OutputFormat, cmsFormatterOutput, CMS_PACK_FLAGS_16BITS).Fmt16;
+                            p->FromInputFloat = _cmsGetFormatter(ContextID, *InputFormat, cmsFormatterInput, CMS_PACK_FLAGS_FLOAT).FmtFloat;
+                            p->ToOutputFloat = _cmsGetFormatter(ContextID, *OutputFormat, cmsFormatterOutput, CMS_PACK_FLAGS_FLOAT).FmtFloat;
 
-    // Not suitable for the transform plug-in, let's check  the pipeline plug-in
-    if (p ->Lut != NULL)
-        _cmsOptimizePipeline(ContextID, &p->Lut, Intent, InputFormat, OutputFormat, dwFlags);
+                            return p;
+                     }
+              }
+
+              // Not suitable for the transform plug-in, let's check  the pipeline plug-in
+              _cmsOptimizePipeline(ContextID, &p->Lut, Intent, InputFormat, OutputFormat, dwFlags);
+       }
 
     // Check whatever this is a true floating point transform
     if (_cmsFormatterIsFloat(*InputFormat) && _cmsFormatterIsFloat(*OutputFormat)) {
--- a/src/share/native/sun/java2d/cmm/lcms/lcms2.h	Wed May 13 12:50:09 2015 -0700
+++ b/src/share/native/sun/java2d/cmm/lcms/lcms2.h	Thu May 14 20:11:36 2015 -0700
@@ -52,7 +52,7 @@
 //
 //---------------------------------------------------------------------------------
 //
-// Version 2.6
+// Version 2.7
 //
 
 #ifndef _lcms2_H
@@ -104,7 +104,7 @@
 #endif
 
 // Version/release
-#define LCMS_VERSION        2060
+#define LCMS_VERSION        2070
 
 // I will give the chance of redefining basic types for compilers that are not fully C99 compliant
 #ifndef CMS_BASIC_TYPES_ALREADY_DEFINED
@@ -213,27 +213,19 @@
 #   define CMS_USE_BIG_ENDIAN   1
 #endif
 
-#  ifdef TARGET_CPU_PPC
-#    if TARGET_CPU_PPC
-#      define CMS_USE_BIG_ENDIAN   1
-#    endif
-#  endif
 
 #if defined(__powerpc__) || defined(__ppc__) || defined(TARGET_CPU_PPC)
+#  if __powerpc__ || __ppc__ || TARGET_CPU_PPC
 #   define CMS_USE_BIG_ENDIAN   1
-#   if defined (__GNUC__) && defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN)
-#       if __BYTE_ORDER  == __LITTLE_ENDIAN
-//               // Don't use big endian for PowerPC little endian mode
+#   if defined (__GNUC__) && defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__)
+#       if __BYTE_ORDER__  == __ORDER_LITTLE_ENDIAN__
+                // Don't use big endian for PowerPC little endian mode
 #                undef CMS_USE_BIG_ENDIAN
 #       endif
+#     endif
 #   endif
 #endif
 
-// WORDS_BIGENDIAN takes precedence
-#if defined(_HOST_BIG_ENDIAN) || defined(__BIG_ENDIAN__) || defined(WORDS_BIGENDIAN)
-#   define CMS_USE_BIG_ENDIAN      1
-#endif
-
 #ifdef macintosh
 # ifdef __BIG_ENDIAN__
 #   define CMS_USE_BIG_ENDIAN      1
@@ -243,6 +235,12 @@
 # endif
 #endif
 
+// WORDS_BIGENDIAN takes precedence
+#if defined(_HOST_BIG_ENDIAN) || defined(__BIG_ENDIAN__) || defined(WORDS_BIGENDIAN)
+#   define CMS_USE_BIG_ENDIAN      1
+#endif
+
+
 // Calling convention -- this is hardly platform and compiler dependent
 #ifdef CMS_IS_WINDOWS_
 #  if defined(CMS_DLL) || defined(CMS_DLL_BUILD)
@@ -553,7 +551,8 @@
     cmsSigLab2FloatPCS                  = 0x64326C20,  // 'd2l '
     cmsSigFloatPCS2Lab                  = 0x6C326420,  // 'l2d '
     cmsSigXYZ2FloatPCS                  = 0x64327820,  // 'd2x '
-    cmsSigFloatPCS2XYZ                  = 0x78326420   // 'x2d '
+    cmsSigFloatPCS2XYZ                  = 0x78326420,  // 'x2d '
+    cmsSigClipNegativesElemType         = 0x636c7020   // 'clp '
 
 } cmsStageSignature;
 
@@ -1031,6 +1030,10 @@
 
     } cmsICCViewingConditions;
 
+// Get LittleCMS version (for shared objects) -----------------------------------------------------------------------------
+
+CMSAPI int               CMSEXPORT cmsGetEncodedCMMversion(void);
+
 // Support of non-standard functions --------------------------------------------------------------------------------------
 
 CMSAPI int               CMSEXPORT cmsstrcasecmp(const char* s1, const char* s2);
@@ -1509,7 +1512,7 @@
 
 CMSAPI cmsUInt32Number   CMSEXPORT cmsChannelsOf(cmsColorSpaceSignature ColorSpace);
 
-// Build a suitable formatter for the colorspace of this profile
+// Build a suitable formatter for the colorspace of this profile. nBytes=1 means 8 bits, nBytes=2 means 16 bits.
 CMSAPI cmsUInt32Number   CMSEXPORT cmsFormatterForColorspaceOfProfile(cmsHPROFILE hProfile, cmsUInt32Number nBytes, cmsBool lIsFloat);
 CMSAPI cmsUInt32Number   CMSEXPORT cmsFormatterForPCSOfProfile(cmsHPROFILE hProfile, cmsUInt32Number nBytes, cmsBool lIsFloat);
 
@@ -1538,6 +1541,7 @@
 CMSAPI cmsIOHANDLER*     CMSEXPORT cmsOpenIOhandlerFromStream(cmsContext ContextID, FILE* Stream);
 CMSAPI cmsIOHANDLER*     CMSEXPORT cmsOpenIOhandlerFromMem(cmsContext ContextID, void *Buffer, cmsUInt32Number size, const char* AccessMode);
 CMSAPI cmsIOHANDLER*     CMSEXPORT cmsOpenIOhandlerFromNULL(cmsContext ContextID);
+CMSAPI cmsIOHANDLER*     CMSEXPORT cmsGetProfileIOhandler(cmsHPROFILE hProfile);
 CMSAPI cmsBool           CMSEXPORT cmsCloseIOhandler(cmsIOHANDLER* io);
 
 // MD5 message digest --------------------------------------------------------------------------------------------------
@@ -1672,6 +1676,10 @@
 #define cmsFLAGS_CLUT_POST_LINEARIZATION  0x0001    // create postlinearization tables if possible
 #define cmsFLAGS_CLUT_PRE_LINEARIZATION   0x0010    // create prelinearization tables if possible
 
+// Specific to unbounded mode
+#define cmsFLAGS_NONEGATIVES              0x8000    // Prevent negative numbers in floating point transforms
+
+
 // Fine-tune control over number of gridpoints
 #define cmsFLAGS_GRIDPOINTS(n)           (((n) & 0xFF) << 16)
 
--- a/src/share/native/sun/java2d/cmm/lcms/lcms2_internal.h	Wed May 13 12:50:09 2015 -0700
+++ b/src/share/native/sun/java2d/cmm/lcms/lcms2_internal.h	Thu May 14 20:11:36 2015 -0700
@@ -223,11 +223,17 @@
 // Microsoft felt that it was necessary to keep it set at -1 for an unlocked critical
 // section, even when they changed the underlying algorithm to be more scalable.
 // The final parts of the critical section object are unimportant, and can be set
-// to zero for their defaults. This yields an initialization macro:
+// to zero for their defaults. This yields to an initialization macro:
 
 typedef CRITICAL_SECTION _cmsMutex;
 
-#define CMS_MUTEX_INITIALIZER {(void*) -1,-1,0,0,0,0}
+#define CMS_MUTEX_INITIALIZER {(PRTL_CRITICAL_SECTION_DEBUG) -1,-1,0,0,0,0}
+
+#ifdef _MSC_VER
+#    if (_MSC_VER >= 1800)
+#          pragma warning(disable : 26135)
+#    endif
+#endif
 
 cmsINLINE int _cmsLockPrimitive(_cmsMutex *m)
 {
@@ -313,38 +319,38 @@
 
 cmsINLINE int _cmsLockPrimitive(_cmsMutex *m)
 {
+    cmsUNUSED_PARAMETER(m);
         return 0;
-    cmsUNUSED_PARAMETER(m);
 }
 
 cmsINLINE int _cmsUnlockPrimitive(_cmsMutex *m)
 {
+    cmsUNUSED_PARAMETER(m);
         return 0;
-    cmsUNUSED_PARAMETER(m);
 }
 
 cmsINLINE int _cmsInitMutexPrimitive(_cmsMutex *m)
 {
+    cmsUNUSED_PARAMETER(m);
         return 0;
-    cmsUNUSED_PARAMETER(m);
 }
 
 cmsINLINE int _cmsDestroyMutexPrimitive(_cmsMutex *m)
 {
+    cmsUNUSED_PARAMETER(m);
         return 0;
-    cmsUNUSED_PARAMETER(m);
 }
 
 cmsINLINE int _cmsEnterCriticalSectionPrimitive(_cmsMutex *m)
 {
+    cmsUNUSED_PARAMETER(m);
         return 0;
-    cmsUNUSED_PARAMETER(m);
 }
 
 cmsINLINE int _cmsLeaveCriticalSectionPrimitive(_cmsMutex *m)
 {
+    cmsUNUSED_PARAMETER(m);
         return 0;
-    cmsUNUSED_PARAMETER(m);
 }
 #endif
 
@@ -852,6 +858,8 @@
 cmsStage*        _cmsStageNormalizeFromXyzFloat(cmsContext ContextID);
 cmsStage*        _cmsStageNormalizeToLabFloat(cmsContext ContextID);
 cmsStage*        _cmsStageNormalizeToXyzFloat(cmsContext ContextID);
+cmsStage*        _cmsStageClipNegatives(cmsContext ContextID, int nChannels);
+
 
 // For curve set only
 cmsToneCurve**     _cmsStageGetPtrToCurveSet(const cmsStage* mpe);
--- a/src/solaris/classes/sun/java2d/xr/XRSolidSrcPict.java	Wed May 13 12:50:09 2015 -0700
+++ b/src/solaris/classes/sun/java2d/xr/XRSolidSrcPict.java	Thu May 14 20:11:36 2015 -0700
@@ -1,6 +1,5 @@
 /*
- * Copyright (c) 2013, 2014 Oracle and/or its affiliates. All rights reserved.
-
+ * Copyright (c) 2013, 2014, 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
--- a/src/solaris/classes/sun/util/locale/provider/HostLocaleProviderAdapterImpl.java	Wed May 13 12:50:09 2015 -0700
+++ b/src/solaris/classes/sun/util/locale/provider/HostLocaleProviderAdapterImpl.java	Thu May 14 20:11:36 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2014 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, 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
--- a/src/windows/native/sun/windows/awt_TrayIcon.cpp	Wed May 13 12:50:09 2015 -0700
+++ b/src/windows/native/sun/windows/awt_TrayIcon.cpp	Thu May 14 20:11:36 2015 -0700
@@ -709,7 +709,7 @@
 {
     if (tooltip == NULL) {
         m_nid.szTip[0] = '\0';
-    } else if (lstrlen(tooltip) > TRAY_ICON_TOOLTIP_MAX_SIZE) {
+    } else if (lstrlen(tooltip) >= TRAY_ICON_TOOLTIP_MAX_SIZE) {
         _tcsncpy(m_nid.szTip, tooltip, TRAY_ICON_TOOLTIP_MAX_SIZE);
         m_nid.szTip[TRAY_ICON_TOOLTIP_MAX_SIZE - 1] = '\0';
     } else {
@@ -814,7 +814,7 @@
     if (caption[0] == '\0') {
         m_nid.szInfoTitle[0] = '\0';
 
-    } else if (lstrlen(caption) > TRAY_ICON_BALLOON_TITLE_MAX_SIZE) {
+    } else if (lstrlen(caption) >= TRAY_ICON_BALLOON_TITLE_MAX_SIZE) {
 
         _tcsncpy(m_nid.szInfoTitle, caption, TRAY_ICON_BALLOON_TITLE_MAX_SIZE);
         m_nid.szInfoTitle[TRAY_ICON_BALLOON_TITLE_MAX_SIZE - 1] = '\0';
@@ -827,7 +827,7 @@
         m_nid.szInfo[0] = ' ';
         m_nid.szInfo[1] = '\0';
 
-    } else if (lstrlen(text) > TRAY_ICON_BALLOON_INFO_MAX_SIZE) {
+    } else if (lstrlen(text) >= TRAY_ICON_BALLOON_INFO_MAX_SIZE) {
 
         _tcsncpy(m_nid.szInfo, text, TRAY_ICON_BALLOON_INFO_MAX_SIZE);
         m_nid.szInfo[TRAY_ICON_BALLOON_INFO_MAX_SIZE - 1] = '\0';
--- a/test/java/awt/SplashScreen/MultiResolutionSplash/MultiResolutionSplashTest.java	Wed May 13 12:50:09 2015 -0700
+++ b/test/java/awt/SplashScreen/MultiResolutionSplash/MultiResolutionSplashTest.java	Thu May 14 20:11:36 2015 -0700
@@ -40,7 +40,7 @@
 
 /**
  * @test
- * @bug 8043869 8075244
+ * @bug 8043869 8075244 8078082
  * @author Alexander Scherbatiy
  * @summary [macosx] java -splash does not honor 2x hi dpi notation for retina
  * support
@@ -115,6 +115,7 @@
         frame.setSize(100, 100);
         String test = "123";
         TextField textField = new TextField(test);
+        textField.selectAll();
         frame.add(textField);
         frame.setVisible(true);
         robot.waitForIdle();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/TrayIcon/8072769/bug8072769.java	Thu May 14 20:11:36 2015 -0700
@@ -0,0 +1,150 @@
+/*
+ * Copyright (c) 2015, 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 8072769
+   @summary System tray icon title freezes java
+   @author Semyon Sadetsky
+   @library ../../../../lib/testlibrary
+   @build jdk.testlibrary.OSInfo
+   @run main bug8072769
+  */
+
+import jdk.testlibrary.OSInfo;
+
+import javax.swing.*;
+import java.awt.*;
+import java.util.Arrays;
+
+public class bug8072769 {
+
+    public static void main(String[] args) throws Exception {
+        if (OSInfo.getOSType() == OSInfo.OSType.WINDOWS) {
+            if (SystemTray.isSupported()) {
+                test();
+            } else {
+                System.out.println("SystemTray not supported. " +
+                        "Test is skipped.");
+            }
+        } else {
+            System.out.println("Test will only run on Windows platform. " +
+                    "Test is skipped.");
+        }
+        System.out.println("ok");
+    }
+
+    private static void test() throws Exception {
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                final SystemTray tray = SystemTray.getSystemTray();
+                final TrayIcon trayIcon = new TrayIcon(icon.getImage());
+                try {
+                    tray.add(trayIcon);
+                } catch (AWTException e) {
+                    throw new RuntimeException(
+                            "TrayIcon could not be added.");
+                }
+
+
+                try {
+                    trayIcon.displayMessage(createString(63, 'A'),
+                            createString(255, 'C'), TrayIcon.MessageType.ERROR);
+
+                    trayIcon.setToolTip(createString(127, 'B'));
+
+                    trayIcon.displayMessage(createString(64, 'A'),
+                            createString(256, 'C'), TrayIcon.MessageType.ERROR);
+
+                    trayIcon.setToolTip(createString(128, 'B'));
+
+                    trayIcon.displayMessage(createString(65, 'A'),
+                            createString(257, 'C'), TrayIcon.MessageType.ERROR);
+
+                    trayIcon.setToolTip(createString(129, 'B'));
+                }
+                finally {
+                    tray.remove(trayIcon);
+                }
+            }
+        });
+    }
+
+    private static String createString(int len, char letter) {
+        char[] chars = new char[len];
+        Arrays.fill(chars, letter);
+        chars[len - 2] = '=';
+        chars[len - 1] = '>';
+        return new String(chars);
+    }
+
+    private static ImageIcon icon = new ImageIcon(
+            new byte[]{71, 73, 70, 56, 57, 97, 32, 0, 35, 0, -43, 0, 0, -1, -1,
+                    -1, -19, -101, 9, -18, -95, 24, -14, -76, 71, -4, -19, -46,
+                    -3, -13, -31, -17, -88, 40, -12, -63, 102, -10, -51, -124,
+                    -16, -82, 55, -11, -57, 117, -2, -7, -15, -7, -32, -77, -9,
+                    -45, -108, -5, -26, -62, -13, -70, 86, -8, -39, -94, 83,
+                    -126, -95, -8, -38, -93, -6, -26, -63, -9, -45, -109, -4,
+                    -14, -32, -15, -76, 70, -12, -58, 116, -17, -89, 39, 77,
+                    121, -106, -3, -8, -17, 104, -111, -84, 126, -95, -72, 93,
+                    -119, -90, -14, -70, 85, -13, -64, 101, -16, -83, 55, -109,
+                    -80, -60, -7, -33, -78, -100, -84, -85, 94, -127, -104, -32,
+                    -99, 39, 127, -120, -114, 83, 113, -124, -12, -9, -7, -16,
+                    -16, -16, -115, 108, 45, 57, 89, 110, -50, -41, -35, 104,
+                    -111, -83, 41, 65, 80, 72, 113, -116, 115, -103, -78, 88,
+                    106, 112, -82, -78, -82, -45, -38, -40, -5, -20, -48, -65,
+                    -48, -36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+                    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, -7, 4, 0, 0, 0,
+                    0, 0, 44, 0, 0, 0, 0, 32, 0, 35, 0, 0, 6, -1, 64, -128, 112,
+                    72, 4, 16, 0, 14, -57, 2, 1, 96, 30, -117, -48, 40, -78,
+                    -55, 96, 28, 28, -125, -62, 0, 96, 48, 74, -91, -116, 102,
+                    3, 97, 64, 4, 20, -25, -128, 68, -80, 16, 24, 11, 95, 98,
+                    -29, -64, 72, 11, 2, 120, -68, 96, -64, 39, 116, -29, 0, 12,
+                    13, 5, 1, 3, 121, -121, -120, 9, 2, 7, 5, 15, 82, 11, 11,
+                    92, 15, 6, -120, -107, -121, 7, 2, 18, 0, 112, 80, 3, 8,
+                    104, -106, -95, 122, 88, 97, 68, 5, 11, 4, -95, 32, 8, 16,
+                    19, 16, 8, 22, -106, -114, 79, 66, 5, 2, 15, 9, -120, 22,
+                    19, 81, 21, 31, -120, 7, 6, 10, 67, 71, 4, 119, -121, 20,
+                    -128, 16, -57, 120, 7, -101, -111, -58, 9, -108, 121, -55,
+                    -128, 0, 16, 121, 123, -117, 67, 5, -71, 121, 30, -42, 67,
+                    23, -121, 13, 66, 14, 6, 3, -34, 120, 21, -31, 66, 26, -39,
+                    3, 6, -50, 11, -96, 120, 31, -19, 67, 30, 121, 9, 14, 0, 13,
+                    124, -121, 68, -32, 19, 98, 6, 15, 58, 71, 18, 12, -27, 97,
+                    55, 80, 68, 54, 5, 5, 24, 40, 80, 23, 96, -96, -112, 9, -39,
+                    30, 52, -112, 72, -47, 34, 0, 10, 25, -53, 37, 60, -60, 16,
+                    -33, 56, 61, 16, -1, 41, -60, 83, 13, 31, -122, 60, 7, 1,
+                    -48, 59, -124, 65, 3, 62, -116, 48, -5, 57, 72, -112, -18,
+                    -48, 5, -103, 124, 32, -32, 37, 112, -74, -119, 98, 0, 8,
+                    -31, 64, -110, 35, 38, 64, 26, 34, -92, 113, 42, 48, -45,
+                    70, -76, 24, -77, 60, 80, -91, -60, -70, -12, 76, -120, 49,
+                    92, -120, 4, -40, -116, -126, 51, 79, -80, 97, -36, 80, 89,
+                    -6, 25, -91, 96, -98, 89, -99, 62, 33, -62, 32, -59, -83, 0,
+                    82, 80, 32, 1, -72, 53, 13, -113, -42, 102, -103, 54, -127,
+                    25, 84, 40, 15, -115, 40, 37, 20, 49, 34, 26, 103, 78, 29,
+                    52, 42, 88, 16, 65, 17, -94, -49, 31, 107, 97, 16, -116, 49,
+                    32, 35, -61, 6, 14, 33, 56, 68, -120, -80, -96, 11, 1, 78,
+                    -31, -6, 33, 96, 48, -93, -61, -122, 21, 46, 50, -116, -10,
+                    -30, -47, -117, -125, 24, 29, 94, -100, -112, 61, -94, 54,
+                    -108, 20, 38, 90, -112, -128, 81, -61, 90, 16, 0, 59},
+            "try icon");
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/util/concurrent/forkjoin/SubmissionTest.java	Thu May 14 20:11:36 2015 -0700
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2015, 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.util.concurrent.ForkJoinPool;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+/*
+ * @test
+ * @bug 8078490
+ * @summary Test submission and execution of task without joining
+ */
+public class SubmissionTest {
+    public static void main(String[] args) throws Throwable {
+        final ForkJoinPool e = new ForkJoinPool(1);
+        final AtomicBoolean b = new AtomicBoolean();
+        final Runnable setFalse = () -> b.set(false);
+        for (int i = 0; i < 100000; i++) {
+            b.set(true);
+            e.execute(setFalse);
+            long st = System.nanoTime();
+            while (b.get()) {
+                if (System.nanoTime() - st >= TimeUnit.SECONDS.toNanos(10)) {
+                    throw new RuntimeException("Submitted task failed to execute");
+                }
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/JRadioButton/8075609/bug8075609.java	Thu May 14 20:11:36 2015 -0700
@@ -0,0 +1,115 @@
+/*
+ * Copyright (c) 2015, 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
+ * @library ../../regtesthelpers
+ * @build Util
+ * @bug 8075609
+ * @summary  IllegalArgumentException when transferring focus from JRadioButton using tab
+ * @author Vivi An
+ * @run main bug8075609
+ */
+
+import javax.swing.*;
+import javax.swing.event.*;
+import java.awt.event.*;
+import java.awt.*;
+import sun.awt.SunToolkit;
+
+public class bug8075609 {
+    private static Robot robot;
+    private static SunToolkit toolkit;
+    private static JTextField textField;
+
+    public static void main(String args[]) throws Throwable {
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                createAndShowGUI();
+            }
+        });
+
+        robot = new Robot();
+        Thread.sleep(100);
+
+        robot.setAutoDelay(100);
+        toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
+
+        // Radio button group tab key test
+        runTest1();
+    }
+
+    private static void createAndShowGUI() {
+        JFrame mainFrame = new JFrame("Bug 8075609 - 1 test");
+
+        JPanel rootPanel = new JPanel();
+        rootPanel.setLayout(new BorderLayout());
+
+        JPanel formPanel = new JPanel();
+        formPanel.setFocusTraversalPolicy(new LayoutFocusTraversalPolicy());
+        formPanel.setFocusCycleRoot(true);
+
+        JRadioButton option1 = new JRadioButton("Option 1", true);
+        JRadioButton option2 = new JRadioButton("Option 2");
+
+        ButtonGroup radioButtonGroup = new ButtonGroup();
+        radioButtonGroup.add(option1);
+        radioButtonGroup.add(option2);
+
+        formPanel.add(option1);
+        formPanel.add(option2);
+        textField = new JTextField("Another focusable component");
+        formPanel.add(textField);
+
+        rootPanel.add(formPanel, BorderLayout.CENTER);
+
+        JButton okButton = new JButton("OK");
+        rootPanel.add(okButton, BorderLayout.SOUTH);
+
+        mainFrame.add(rootPanel);
+        mainFrame.pack();
+        mainFrame.setVisible(true);
+        mainFrame.toFront();
+    }
+
+    // Radio button Group as a single component when traversing through tab key
+    private static void runTest1() throws Exception{
+        hitKey(robot, KeyEvent.VK_TAB);
+
+        robot.setAutoDelay(1000 );
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                if (textField.hasFocus()) {
+                    System.out.println("Radio Button Group Go To Next Component through Tab Key failed");
+                    throw new RuntimeException("Focus is not on textField as Expected");
+                }
+            }
+        });
+    }
+
+    private static void hitKey(Robot robot, int keycode) {
+        robot.keyPress(keycode);
+        robot.keyRelease(keycode);
+        toolkit.realSync();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/plaf/nimbus/8041642/bug8041642.java	Thu May 14 20:11:36 2015 -0700
@@ -0,0 +1,95 @@
+/*
+ * Copyright (c) 2015, 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 8041642
+   @summary Incorrect paint of JProgressBar in Nimbus LF
+   @author Semyon Sadetsky
+*/
+
+import javax.swing.*;
+import java.awt.*;
+
+public class bug8041642 {
+
+    private static JFrame frame;
+    private static Point point;
+    private static JProgressBar bar;
+
+    public static void main(String[] args) throws Exception {
+        for (UIManager.LookAndFeelInfo info : UIManager
+                .getInstalledLookAndFeels()) {
+            if ("Nimbus".equals(info.getName())) {
+                try {
+                    UIManager.setLookAndFeel(info.getClassName());
+                } catch (Exception ex) {
+                }
+                break;
+            }
+        }
+        try {
+            SwingUtilities.invokeAndWait(new Runnable() {
+                public void run() {
+                    frame = new JFrame();
+                    frame.setUndecorated(true);
+                    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+                    setup(frame);
+                }
+            });
+            SwingUtilities.invokeAndWait(new Runnable() {
+                @Override
+                public void run() {
+                    point = bar.getLocationOnScreen();
+                }
+            });
+            final Robot robot = new Robot();
+            Color color = robot.getPixelColor(point.x + 1, point.y + 7);
+            System.out.println(color);
+            if (color.getGreen() < 150 || color.getBlue() > 30 ||
+                    color.getRed() > 200) {
+                throw new RuntimeException("Bar padding color should be green");
+            }
+
+        } finally {
+            SwingUtilities.invokeAndWait(new Runnable() {
+                @Override
+                public void run() {
+                    //frame.dispose();
+                }
+            });
+        }
+
+        System.out.println("ok");
+    }
+
+    static void setup(JFrame frame) {
+        bar = new JProgressBar();
+        bar.setBackground(Color.WHITE);
+        bar.setValue(2);
+        frame.getContentPane().add(bar, BorderLayout.NORTH);
+        frame.getContentPane().setBackground(Color.GREEN);
+        frame.setSize(200, 150);
+        frame.setLocation(100, 100);
+        frame.setVisible(true);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/xml/jaxp/transform/8062518/DocumentExtFunc.java	Thu May 14 20:11:36 2015 -0700
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2015, 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 org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+public class DocumentExtFunc {
+
+    public static String test(NodeList list) {
+        Node node = list.item(0);
+        return "["+node.getNodeName() + ":" + node.getNodeValue()+"]";
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/xml/jaxp/transform/8062518/XSLTFunctionsTest.java	Thu May 14 20:11:36 2015 -0700
@@ -0,0 +1,128 @@
+/*
+ * Copyright (c) 2015, 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 8062518
+ * @summary This class contains tests for XSLT functions
+ * @compile DocumentExtFunc.java
+ * @run testng/othervm XSLTFunctionsTest
+ */
+
+import java.io.StringReader;
+import java.io.StringWriter;
+
+import javax.xml.transform.Source;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.URIResolver;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+import static org.testng.Assert.assertEquals;
+
+public class XSLTFunctionsTest {
+
+    /**
+     * bug 8062518
+     * Verifies that a reference to the DTM created by XSLT document function is
+     * actually read from the DTM by an extension function.
+     * @param xml Content of xml file to process
+     * @param xsl stylesheet content that loads external document {@code externalDoc}
+     *        with XSLT 'document' function and then reads it with
+     *        DocumentExtFunc.test() function
+     * @param externalDoc Content of the external xml document
+     * @param expectedResult Expected transformation result
+     **/
+    @Test(dataProvider = "document")
+    public void testDocument(final String xml, final String xsl,
+                             final String externalDoc, final String expectedResult) throws Exception {
+        // Prepare sources for transormation
+        Source src = new StreamSource(new StringReader(xml));
+        Source xslsrc = new StreamSource(new StringReader(xsl));
+
+        // Create factory and transformer
+        TransformerFactory tf = TransformerFactory.newInstance();
+        Transformer t = tf.newTransformer( xslsrc );
+        t.setErrorListener(tf.getErrorListener());
+
+        // Set URI Resolver to return the newly constructed xml
+        // stream source object from xml test string
+        t.setURIResolver(new URIResolver() {
+            @Override
+            public Source resolve(String href, String base)
+                    throws TransformerException {
+                if (href.contains("externalDoc")) {
+                    return new StreamSource(new StringReader(externalDoc));
+                } else {
+                    return new StreamSource(new StringReader(xml));
+                }
+            }
+        });
+
+        // Prepare output stream
+        StringWriter xmlResultString = new StringWriter();
+        StreamResult xmlResultStream = new StreamResult(xmlResultString);
+
+        //Transform the xml
+        t.transform(src, xmlResultStream);
+
+        // If the document can't be accessed and the bug is in place then
+        // reported exception will be thrown during transformation
+        System.out.println("Transformation result:"+xmlResultString.toString().trim());
+
+        // Check the result - it should contain two (node name, node values) entries -
+        // one for original document, another for a document created with
+        // call to 'document' function
+        assertEquals(xmlResultString.toString().trim(), expectedResult);
+    }
+
+    @DataProvider(name = "document")
+    public static Object[][] documentTestData() {
+        return new Object[][] {
+            {documentTestXml, documentTestXsl, documentTestExternalDoc, documentTesteExpectedResult},
+        };
+    }
+
+    static final String documentTestXml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Test>Doc</Test>";
+
+    static final String documentTestExternalDoc = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Test>External Doc</Test>";
+
+    static final String documentTestXsl = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+            + "<xsl:transform version=\"1.0\""
+            + " xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" "
+            + " xmlns:cfunc=\"http://xml.apache.org/xalan/java/\">"
+            + "<xsl:template match=\"/\">"
+            + "<xsl:element name=\"root\">"
+            + "<xsl:variable name=\"other_doc\" select=\"document(&#39;externalDoc&#39;)\"/>"
+            + "<!-- Source -->"
+            + "<xsl:value-of select=\"cfunc:DocumentExtFunc.test(/Test)\"/>"
+            + "<!-- document() -->"
+            + "<xsl:value-of select=\"cfunc:DocumentExtFunc.test($other_doc/Test)\"/>"
+            + "</xsl:element></xsl:template></xsl:transform>";
+
+    static final String documentTesteExpectedResult = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+                                                    + "<root>[Test:Doc][Test:External Doc]</root>";
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/security/jgss/spnego/MSOID.java	Thu May 14 20:11:36 2015 -0700
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2015, 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 8078439
+ * @summary SPNEGO auth fails if client proposes MS krb5 OID
+ */
+
+import org.ietf.jgss.GSSContext;
+import org.ietf.jgss.GSSCredential;
+import org.ietf.jgss.GSSException;
+import org.ietf.jgss.GSSManager;
+
+import java.lang.Exception;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.Arrays;
+import java.util.Base64;
+
+public class MSOID {
+    public static void main(String[] args) throws Exception {
+
+        // msoid.txt is a NegTokenInit packet sent from Internet Explorer to
+        // IIS server on a test machine. No sensitive info included.
+        byte[] header = Files.readAllBytes(
+                Paths.get(System.getProperty("test.src"), "msoid.txt"));
+        byte[] token = Base64.getMimeDecoder().decode(
+                Arrays.copyOfRange(header, 10, header.length));
+
+        GSSCredential cred = null;
+        GSSContext ctx = GSSManager.getInstance().createContext(cred);
+
+        try {
+            ctx.acceptSecContext(token, 0, token.length);
+            // Before the fix, GSS_KRB5_MECH_OID_MS is not recognized
+            // and acceptor chooses another mech and goes on
+            throw new Exception("Should fail");
+        } catch (GSSException gsse) {
+            // After the fix, GSS_KRB5_MECH_OID_MS is recognized but the token
+            // cannot be accepted because we don't have any krb5 credential.
+            gsse.printStackTrace();
+            if (gsse.getMajor() != GSSException.NO_CRED) {
+                throw gsse;
+            }
+            for (StackTraceElement st: gsse.getStackTrace()) {
+                if (st.getClassName().startsWith("sun.security.jgss.krb5.")) {
+                    // Good, it is already in krb5 mech's hand.
+                    return;
+                }
+            }
+            throw gsse;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/security/jgss/spnego/msoid.txt	Thu May 14 20:11:36 2015 -0700
@@ -0,0 +1,27 @@
+Negotiate YIIGPAYGKwYBBQUCoIIGMDCCBiygMDAuBgkqhkiC9xIBAgIGCSqGSIb3EgECAgYKKwYBBA
+GCNwICHgYKKwYBBAGCNwICCqKCBfYEggXyYIIF7gYJKoZIhvcSAQICAQBuggXdMIIF2aADAgEFoQMCAQ
+6iBwMFACAAAACjggTIYYIExDCCBMCgAwIBBaEOGwxUV0VMVkUuVEhJTkuiIzAhoAMCAQKhGjAYGwRIVF
+RQGxBrZGMuVFdFTFZFLlRISU5Lo4IEgjCCBH6gAwIBEqEDAgEJooIEcASCBGyoIL0zQevk57pY6D25+1
+SQbAeldYXkpdn8JlKgSyz1cdiTpwqDt8B7pj7AoKMPHCiVss37XCEpBIuZClBK3Jmry+QWXCbQemKvyO
+Caz806RDNB7TA7l1NxUJ6LsCiQncNV1TEq37NM6H8il6PjnbcBoMcHH/+cFGVPNP3eP+Z5Kd+5DZELPV
+qQkYogXybmngmYy2168OsfyANzotUpm/HBwEHKujCPH9Gbhwhmx4tUcBvCetPNoXmHOQZLB4u7uyblKO
+c6R2yGTFCa8DBQNXx38RRHgsvlNGlx+UsSoF4/DixAreNRkZnpKabn1cRK/KZh6vHfbL2QVegr1hrp71
+IJwyVuR+RTGL/7WCSWFClJyWD3Cm4+eK46uVj4MKPUJBc0XVViV/Dsh4N9EomVDkovWU/v+0d+W4pQJk
+BFnJoNYuaG8UnLWrxMKGNwVOfsblcJtB7B5zuZzsWsUIdmMT1n8mtWrv0wYiwvotfT6z/suk+Vhg9MGd
+uDmeneeG9deMDUMwrwB8u5J2VEeWKurBfDB02jv/08qAZS2ovBfV2SiXCuky5z7llvQ8uPsoezVwYdhu
+HmBuPE7PqDIkmkEJRWpq95dqxllCXvlL4uINxFadkhcbzuCDjSGil78p6FJTKc4Dt/kuug1zJuXhJO1L
+2CgkMsYPTogoUvAtplzIDF0nSMwJUIJzQXIHCFasmDNJA1GAvQD+Qh7Mp4dYb2Uid+sSM2qlQn8bgR9S
+dlfL/olQ9GKPOBBGwsVoZKR3Brimc9LOJofPMEEa560KQNgtO1MyjoqEJKzFq+2wVZQahvpcV7VgixCq
+Nom3Wd4NdZ3QM0PHL7e9bl3/qCsWaiNlmRW7gupz8nNCtWNMf4UBqIeo9jPH9Cb96fOUM4c7XXp4iX6w
+ns1MsmPZ4VQDRU7VK+yTC81KGfMlSvrvqCJfGoxy0NaeXtmkN55oAhaj8ebiEBdKCXXF5wk0zqvt1ifE
+9ywYk/AbdFBPThyOT6Tu9x41gi6mCTiMtSdg7cFY+5yXd3UIgUwnbOG3IwAkdLXlepvnHwEXCXkbfbr9
+e1wjs5LMmYRunJ05FOx8iAibB8bWjgiFmYWbeyjyQF3KDs5cpvROXcapT1+KlFU4lEO8lnKM/Ipq81ED
+s+/DygXCvlskeKV57URx+XcMWnURu4hdGHbCPY/X7eOmox0mw5/V0rJMIjSjQNPyi4UM4dDTso6mt0XE
+h+YyCGmV67D8/nihO/NaRFEFxHlaGwh3Lqu/Tero88iuDb9U1uEWz8cF8wr+2azyOTmhi/ID/jfiEC8i
+b/hjYEcBI99x/CNmuuM7uCwTPIsJtBD3AnUdPa/yo41rCtm/K5HZCTzw2W93vaHqyttEC7c70rdAUB49
+CfSAVtH4gwxCDKMSJMlELfHGrIloEppEoUEc7LOdmzinvzcuajj0moBn5WUZHiVmopLjGjW7wunmMPQS
+H9FmCQf2I1N4E6nZfH+cUzBbHkIF5XHY4KXwmJQ3UdbUDp8z3npIH3MIH0oAMCARKigewEgenD23U6gQ
+aORjuWnT1nqadqR+E5fa/viohey4g6mn6uPfVRPz5a7OsDOurQV9wHR/VEwvjpdlZzMcANbt28Ut3YvQ
+SWWwqALoLtSLOTgXmK9Higb+NSSO7hKtqKgDWREfQisn3xE9PGkMUlanu2es34+k43AQmJf2InvFNNcy
+PcKllikoMOldVeoF1BIKvbDI0+vE3SwSrD0UhUdDeeZTN33b0Y8f3I1UYtidwxcRRkvCaNEhphtr8hp8
+hXWQkuxVvF2TiQyHF4PnJkgb1Zr6GXydOmMgMJE1anPFKFKWH6PZWGnp8mw0F5zw==
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/security/krb5/auto/MSOID2.java	Thu May 14 20:11:36 2015 -0700
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2015, 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 8078439
+ * @summary SPNEGO auth fails if client proposes MS krb5 OID
+ * @compile -XDignore.symbol.file MSOID2.java
+ * @run main/othervm MSOID2
+ */
+
+import sun.security.jgss.GSSUtil;
+
+// The basic krb5 test skeleton you can copy from
+public class MSOID2 {
+
+    public static void main(String[] args) throws Exception {
+
+        new OneKDC(null).writeJAASConf();
+
+        Context c, s;
+        c = Context.fromJAAS("client");
+        s = Context.fromJAAS("server");
+
+        c.startAsClient(OneKDC.SERVER, GSSUtil.GSS_SPNEGO_MECH_OID);
+        s.startAsServer(GSSUtil.GSS_SPNEGO_MECH_OID);
+
+        byte[] t = new byte[0];
+        boolean first = true;
+        while (true) {
+            if (t != null || !c.x().isEstablished()) t = c.take(t);
+            if (first) {
+                // Tweak the packet to append an extra OID
+                int len = t.length;
+                byte[] nt = new byte[len + 11];
+                System.arraycopy(t, 0, nt, 0, 0x23);
+                System.arraycopy(t, 0x18, nt, 0x23, 11);    // dup the OID
+                System.arraycopy(t, 0x23, nt, 0x2e, len-0x23);
+                nt[0x1d] = (byte)0x82;  // change the 1st to MS OID
+                // Length bytes to be tweaked
+                for (int pos: new int[] {3, 0xf, 0x13, 0x15, 0x17}) {
+                    nt[pos] = (byte)(nt[pos] + 11);
+                }
+                t = nt;
+                new sun.misc.HexDumpEncoder().encodeBuffer(t, System.out);
+            }
+            if (t != null || !s.x().isEstablished()) t = s.take(t);
+            if (c.x().isEstablished() && s.x().isEstablished()) break;
+            first = false;
+        }
+
+        Context.transmit("i say high --", c, s);
+        Context.transmit("   you say low", s, c);
+
+        s.dispose();
+        c.dispose();
+    }
+}
--- a/test/sun/security/pkcs12/StoreSecretKeyTest.java	Wed May 13 12:50:09 2015 -0700
+++ b/test/sun/security/pkcs12/StoreSecretKeyTest.java	Thu May 14 20:11:36 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015 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
@@ -23,12 +23,14 @@
 
 /*
  * @test
- * @bug 8005408
+ * @bug 8005408 8079129
  * @summary KeyStore API enhancements
  */
 
 import java.io.*;
 import java.security.*;
+import java.security.cert.*;
+import java.security.cert.Certificate;
 import java.util.*;
 import javax.crypto.*;
 import javax.crypto.spec.*;
@@ -39,7 +41,9 @@
     private final static String DIR = System.getProperty("test.src", ".");
     private static final char[] PASSWORD = "passphrase".toCharArray();
     private static final String KEYSTORE = "keystore.p12";
-    private static final String ALIAS = "my secret key";
+    private static final String CERT = DIR + "/trusted.pem";
+    private static final String ALIAS = "my trusted cert";
+    private static final String ALIAS2 = "my secret key";
 
     public static void main(String[] args) throws Exception {
 
@@ -56,8 +60,13 @@
         KeyStore keystore = KeyStore.getInstance("PKCS12");
         keystore.load(null, null);
 
-        // Set entry
+        // Set trusted certificate entry
+        Certificate cert = loadCertificate(CERT);
         keystore.setEntry(ALIAS,
+            new KeyStore.TrustedCertificateEntry(cert), null);
+
+        // Set secret key entry
+        keystore.setEntry(ALIAS2,
             new KeyStore.SecretKeyEntry(generateSecretKey("AES", 128)),
                 new KeyStore.PasswordProtection(PASSWORD));
 
@@ -73,7 +82,7 @@
                 " entries");
         }
 
-        KeyStore.Entry entry = keystore.getEntry(ALIAS,
+        KeyStore.Entry entry = keystore.getEntry(ALIAS2,
             new KeyStore.PasswordProtection(PASSWORD));
         System.out.println("Retrieved entry: " + entry);
 
@@ -101,4 +110,14 @@
         generator.init(size);
         return generator.generateKey();
     }
+
+    private static Certificate loadCertificate(String certFile)
+        throws Exception {
+        X509Certificate cert = null;
+        try (FileInputStream certStream = new FileInputStream(certFile)) {
+            CertificateFactory factory =
+                CertificateFactory.getInstance("X.509");
+            return factory.generateCertificate(certStream);
+        }
+    }
 }
--- a/test/sun/util/calendar/zi/tzdata/VERSION	Wed May 13 12:50:09 2015 -0700
+++ b/test/sun/util/calendar/zi/tzdata/VERSION	Thu May 14 20:11:36 2015 -0700
@@ -21,4 +21,4 @@
 # or visit www.oracle.com if you need additional information or have any
 # questions.
 #
-tzdata2015b
+tzdata2015d
--- a/test/sun/util/calendar/zi/tzdata/africa	Wed May 13 12:50:09 2015 -0700
+++ b/test/sun/util/calendar/zi/tzdata/africa	Thu May 14 20:11:36 2015 -0700
@@ -342,35 +342,29 @@
 # above) says DST had no affect on electricity consumption.  There is
 # no information about when DST will end this fall.  See:
 # http://abcnews.go.com/International/wireStory/el-sissi-pushes-egyptians-line-23614833
+
+# From Steffen Thorsen (2015-04-08):
+# Egypt will start DST on midnight after Thursday, April 30, 2015.
+# This is based on a law (no 35) from May 15, 2014 saying it starts the last
+# 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
+
+# From Ahmed Nazmy (2015-04-20):
+# Egypt's ministers cabinet just announced ... that it will cancel DST at
+# least for 2015.
 #
-# For now, guess that later spring and fall transitions will use
-# 2010's rules, and guess that Egypt will switch to standard time at
-# 24:00 the last Thursday before Ramadan, and back to DST at 00:00 the
-# first Friday after Ramadan.  To implement this,
-# transition dates for 2015 through 2037 were determined by running
-# the following program under GNU Emacs 24.3, with the results integrated
-# by hand into the table below.  Ramadan again intrudes on the guessed
-# DST starting in 2038, but that's beyond our somewhat-arbitrary cutoff.
-# (let ((islamic-year 1436))
-#   (while (< islamic-year 1460)
-#     (let ((a (calendar-islamic-to-absolute (list 9 1 islamic-year)))
-#           (b (calendar-islamic-to-absolute (list 10 1 islamic-year)))
-#           (friday 5))
-#       (while (/= friday (mod a 7))
-#         (setq a (1- a)))
-#       (while (/= friday (mod b 7))
-#         (setq b (1+ b)))
-#       (setq a (1- a))
-#       (setq b (1- b))
-#       (setq a (calendar-gregorian-from-absolute a))
-#       (setq b (calendar-gregorian-from-absolute b))
-#       (insert
-#        (format
-#         (concat "Rule\tEgypt\t%d\tonly\t-\t%s\t%2d\t24:00\t0\t-\n"
-#                 "Rule\tEgypt\t%d\tonly\t-\t%s\t%2d\t24:00\t1:00\tS\n")
-#         (car (cdr (cdr a))) (calendar-month-name (car a) t) (car (cdr a))
-#         (car (cdr (cdr b))) (calendar-month-name (car b) t) (car (cdr b)))))
-#     (setq islamic-year (+ 1 islamic-year))))
+# From Tim Parenti (2015-04-20):
+# http://english.ahram.org.eg/WriterArticles/NewsContentP/1/128195/Egypt/No-daylight-saving-this-summer-Egypts-prime-minist.aspx
+# "Egypt's cabinet agreed on Monday not to switch clocks for daylight saving
+# time this summer, and carry out studies on the possibility of canceling the
+# practice altogether in future years."
+#
+# From Paul Eggert (2015-04-20):
+# For now, assume DST will be canceled.  Any resumption would likely
+# use different rules anyway.
+
 Rule	Egypt	2008	only	-	Aug	lastThu	24:00	0	-
 Rule	Egypt	2009	only	-	Aug	20	24:00	0	-
 Rule	Egypt	2010	only	-	Aug	10	24:00	0	-
@@ -379,22 +373,7 @@
 Rule	Egypt	2014	only	-	May	15	24:00	1:00	S
 Rule	Egypt	2014	only	-	Jun	26	24:00	0	-
 Rule	Egypt	2014	only	-	Jul	31	24:00	1:00	S
-Rule	Egypt	2014	max	-	Sep	lastThu	24:00	0	-
-Rule	Egypt	2015	2019	-	Apr	lastFri	 0:00s	1:00	S
-Rule	Egypt	2015	only	-	Jun	11	24:00	0	-
-Rule	Egypt	2015	only	-	Jul	23	24:00	1:00	S
-Rule	Egypt	2016	only	-	Jun	 2	24:00	0	-
-Rule	Egypt	2016	only	-	Jul	 7	24:00	1:00	S
-Rule	Egypt	2017	only	-	May	25	24:00	0	-
-Rule	Egypt	2017	only	-	Jun	29	24:00	1:00	S
-Rule	Egypt	2018	only	-	May	10	24:00	0	-
-Rule	Egypt	2018	only	-	Jun	14	24:00	1:00	S
-Rule	Egypt	2019	only	-	May	 2	24:00	0	-
-Rule	Egypt	2019	only	-	Jun	 6	24:00	1:00	S
-Rule	Egypt	2020	only	-	May	28	24:00	1:00	S
-Rule	Egypt	2021	only	-	May	13	24:00	1:00	S
-Rule	Egypt	2022	only	-	May	 5	24:00	1:00	S
-Rule	Egypt	2023	max	-	Apr	lastFri	 0:00s	1:00	S
+Rule	Egypt	2014	only	-	Sep	lastThu	24:00	0	-
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Africa/Cairo	2:05:09 -	LMT	1900 Oct
--- a/test/sun/util/calendar/zi/tzdata/antarctica	Wed May 13 12:50:09 2015 -0700
+++ b/test/sun/util/calendar/zi/tzdata/antarctica	Thu May 14 20:11:36 2015 -0700
@@ -38,41 +38,6 @@
 # I made up all time zone abbreviations mentioned here; corrections welcome!
 # FORMAT is 'zzz' and GMTOFF is 0 for locations while uninhabited.
 
-# These rules are stolen from the 'southamerica' file.
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	ArgAQ	1964	1966	-	Mar	 1	0:00	0	-
-Rule	ArgAQ	1964	1966	-	Oct	15	0:00	1:00	S
-Rule	ArgAQ	1967	only	-	Apr	 2	0:00	0	-
-Rule	ArgAQ	1967	1968	-	Oct	Sun>=1	0:00	1:00	S
-Rule	ArgAQ	1968	1969	-	Apr	Sun>=1	0:00	0	-
-Rule	ArgAQ	1974	only	-	Jan	23	0:00	1:00	S
-Rule	ArgAQ	1974	only	-	May	 1	0:00	0	-
-Rule	ChileAQ	1972	1986	-	Mar	Sun>=9	3:00u	0	-
-Rule	ChileAQ	1974	1987	-	Oct	Sun>=9	4:00u	1:00	S
-Rule	ChileAQ	1987	only	-	Apr	12	3:00u	0	-
-Rule	ChileAQ	1988	1989	-	Mar	Sun>=9	3:00u	0	-
-Rule	ChileAQ	1988	only	-	Oct	Sun>=1	4:00u	1:00	S
-Rule	ChileAQ	1989	only	-	Oct	Sun>=9	4:00u	1:00	S
-Rule	ChileAQ	1990	only	-	Mar	18	3:00u	0	-
-Rule	ChileAQ	1990	only	-	Sep	16	4:00u	1:00	S
-Rule	ChileAQ	1991	1996	-	Mar	Sun>=9	3:00u	0	-
-Rule	ChileAQ	1991	1997	-	Oct	Sun>=9	4:00u	1:00	S
-Rule	ChileAQ	1997	only	-	Mar	30	3:00u	0	-
-Rule	ChileAQ	1998	only	-	Mar	Sun>=9	3:00u	0	-
-Rule	ChileAQ	1998	only	-	Sep	27	4:00u	1:00	S
-Rule	ChileAQ	1999	only	-	Apr	 4	3:00u	0	-
-Rule	ChileAQ	1999	2010	-	Oct	Sun>=9	4:00u	1:00	S
-Rule	ChileAQ	2000	2007	-	Mar	Sun>=9	3:00u	0	-
-# N.B.: the end of March 29 in Chile is March 30 in Universal time,
-# which is used below in specifying the transition.
-Rule	ChileAQ	2008	only	-	Mar	30	3:00u	0	-
-Rule	ChileAQ	2009	only	-	Mar	Sun>=9	3:00u	0	-
-Rule	ChileAQ	2010	only	-	Apr	Sun>=1	3:00u	0	-
-Rule	ChileAQ	2011	only	-	May	Sun>=2	3:00u	0	-
-Rule	ChileAQ	2011	only	-	Aug	Sun>=16	4:00u	1:00	S
-Rule	ChileAQ	2012	2015	-	Apr	Sun>=23	3:00u	0	-
-Rule	ChileAQ	2012	2014	-	Sep	Sun>=2	4:00u	1:00	S
-
 # Argentina - year-round bases
 # Belgrano II, Confin Coast, -770227-0343737, since 1972-02-05
 # Carlini, Potter Cove, King George Island, -6414-0602320, since 1982-01
@@ -367,21 +332,7 @@
 # USA - year-round bases
 #
 # Palmer, Anvers Island, since 1965 (moved 2 miles in 1968)
-#
-# From Ethan Dicks (1996-10-06):
-# It keeps the same time as Punta Arenas, Chile, because, just like us
-# and the South Pole, that's the other end of their supply line....
-# I verified with someone who was there that since 1980,
-# Palmer has followed Chile.  Prior to that, before the Falklands War,
-# Palmer used to be supplied from Argentina.
-#
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Antarctica/Palmer	0	-	zzz	1965
-			-4:00	ArgAQ	AR%sT	1969 Oct  5
-			-3:00	ArgAQ	AR%sT	1982 May
-			-4:00	ChileAQ	CL%sT	2015 Apr 26 3:00u
-			-3:00	-	CLT
-#
+# See 'southamerica' for Antarctica/Palmer, since it uses South American DST.
 #
 # McMurdo Station, Ross Island, since 1955-12
 # Amundsen-Scott South Pole Station, continuously occupied since 1956-11-20
--- a/test/sun/util/calendar/zi/tzdata/backward	Wed May 13 12:50:09 2015 -0700
+++ b/test/sun/util/calendar/zi/tzdata/backward	Thu May 14 20:11:36 2015 -0700
@@ -43,6 +43,7 @@
 Link	America/Indiana/Knox	America/Knox_IN
 Link	America/Kentucky/Louisville	America/Louisville
 Link	America/Argentina/Mendoza	America/Mendoza
+Link	America/Toronto		America/Montreal
 Link	America/Rio_Branco	America/Porto_Acre
 Link	America/Argentina/Cordoba	America/Rosario
 Link	America/Denver		America/Shiprock
--- a/test/sun/util/calendar/zi/tzdata/europe	Wed May 13 12:50:09 2015 -0700
+++ b/test/sun/util/calendar/zi/tzdata/europe	Thu May 14 20:11:36 2015 -0700
@@ -99,7 +99,7 @@
 #        1:00:14    SET           Swedish (1879-1899)*
 #        2:00       EET EEST      Eastern Europe
 #        3:00       FET           Further-eastern Europe (2011-2014)*
-#        3:00       MSK MSD  MSM* Moscow
+#        3:00       MSK MSD  MSM* Minsk, Moscow
 
 # From Peter Ilieve (1994-12-04),
 # The original six [EU members]: Belgium, France, (West) Germany, Italy,
--- a/test/sun/util/calendar/zi/tzdata/northamerica	Wed May 13 12:50:09 2015 -0700
+++ b/test/sun/util/calendar/zi/tzdata/northamerica	Thu May 14 20:11:36 2015 -0700
@@ -250,9 +250,14 @@
 # The law doesn't give abbreviations.
 #
 # From Paul Eggert (2000-01-08), following a heads-up from Rives McDow:
-# Public law 106-564 (2000-12-23) introduced the abbreviation
-# "Chamorro Standard Time" for time in Guam and the Northern Marianas.
-# See the file "australasia".
+# Public law 106-564 (2000-12-23) introduced ... "Chamorro Standard Time"
+# for time in Guam and the Northern Marianas.  See the file "australasia".
+#
+# From Paul Eggert (2015-04-17):
+# 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
 
 # From Arthur David Olson, 2005-08-09
 # The following was signed into law on 2005-08-08.
@@ -559,7 +564,7 @@
 			-11:00	-	BST	1969
 			-11:00	US	B%sT	1983 Oct 30  2:00
 			-10:00	US	AH%sT	1983 Nov 30
-			-10:00	US	HA%sT
+			-10:00	US	H%sT
 # The following switches don't quite make our 1970 cutoff.
 #
 # Shanks writes that part of southwest Alaska (e.g. Aniak)
@@ -1354,14 +1359,9 @@
 
 # Quebec
 
-# From Paul Eggert (2013-08-30):
-# Since 1970 most of Quebec has been like Toronto.
-# However, because earlier versions of the tz database mistakenly relied on data
-# from Shanks & Pottenger saying that Quebec differed from Ontario after 1970,
-# a separate entry was created for most of Quebec.  We're loath to lose
-# its pre-1970 info, even though the tz database is normally limited to
-# zones that differ after 1970, so keep this otherwise out-of-scope entry.
-
+# From Paul Eggert (2015-03-24):
+# See America/Toronto for most of Quebec, including Montreal.
+#
 # Matthews and Vincent (1998) also write that Quebec east of the -63
 # meridian is supposed to observe AST, but residents as far east as
 # Natashquan use EST/EDT, and residents east of Natashquan use AST.
@@ -1375,39 +1375,10 @@
 # For lack of better info, guess this practice began around 1970, contra to
 # Shanks & Pottenger who have this region observing AST/ADT.
 
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Mont	1917	only	-	Mar	25	2:00	1:00	D
-Rule	Mont	1917	only	-	Apr	24	0:00	0	S
-Rule	Mont	1919	only	-	Mar	31	2:30	1:00	D
-Rule	Mont	1919	only	-	Oct	25	2:30	0	S
-Rule	Mont	1920	only	-	May	 2	2:30	1:00	D
-Rule	Mont	1920	1922	-	Oct	Sun>=1	2:30	0	S
-Rule	Mont	1921	only	-	May	 1	2:00	1:00	D
-Rule	Mont	1922	only	-	Apr	30	2:00	1:00	D
-Rule	Mont	1924	only	-	May	17	2:00	1:00	D
-Rule	Mont	1924	1926	-	Sep	lastSun	2:30	0	S
-Rule	Mont	1925	1926	-	May	Sun>=1	2:00	1:00	D
-Rule	Mont	1927	1937	-	Apr	lastSat	24:00	1:00	D
-Rule	Mont	1927	1937	-	Sep	lastSat	24:00	0	S
-Rule	Mont	1938	1940	-	Apr	lastSun	0:00	1:00	D
-Rule	Mont	1938	1939	-	Sep	lastSun	0:00	0	S
-Rule	Mont	1946	1973	-	Apr	lastSun	2:00	1:00	D
-Rule	Mont	1945	1948	-	Sep	lastSun	2:00	0	S
-Rule	Mont	1949	1950	-	Oct	lastSun	2:00	0	S
-Rule	Mont	1951	1956	-	Sep	lastSun	2:00	0	S
-Rule	Mont	1957	1973	-	Oct	lastSun	2:00	0	S
-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone America/Blanc-Sablon -3:48:28 -	LMT	1884
 			-4:00	Canada	A%sT	1970
 			-4:00	-	AST
-Zone America/Montreal	-4:54:16 -	LMT	1884
-			-5:00	Mont	E%sT	1918
-			-5:00	Canada	E%sT	1919
-			-5:00	Mont	E%sT	1942 Feb  9  2:00s
-			-5:00	Canada	E%sT	1946
-			-5:00	Mont	E%sT	1974
-			-5:00	Canada	E%sT
 
 # Ontario
 
@@ -1898,17 +1869,115 @@
 # Dawson switched to PST in 1973.  Inuvik switched to MST in 1979.
 # Mathew Englander (1996-10-07) gives the following refs:
 #	* 1967. Paragraph 28(34)(g) of the Interpretation Act, S.C. 1967-68,
-#	c. 7 defines Yukon standard time as UTC-9.  This is still valid;
+#	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]
 #	* 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.
-# Shanks & Pottenger say Yukon's 1973-10-28 switch was at 2:00; go
-# with Englander.
-# From Chris Walton (2006-06-26):
-# Here is a link to the old daylight saving portion of the interpretation
-# act which was last updated in 1987:
-# http://www.gov.yk.ca/legislation/regs/oic1987_056.pdf
+
+# From Brian Inglis (2015-04-14):
+#
+# I tried to trace the history of Yukon time and found the following
+# regulations, giving the reference title and URL if found, regulation name,
+# and relevant quote if available.  Each regulation specifically revokes its
+# predecessor.  The final reference is to the current Interpretation Act
+# authorizing and resulting from these regulatory changes.
+#
+# Only recent regulations were retrievable via Yukon government site search or
+# index, and only some via Canadian legal sources.  Other sources used include
+# articles titled "Standard Time and Time Zones in Canada" from JRASC via ADS
+# Abstracts, cited by ADO for 1932 ..., and updated versions from 1958 and
+# 1970 quoted below; each article includes current extracts from provincial
+# and territorial ST and DST regulations at the end, summaries and details of
+# standard times and daylight saving time at many locations across Canada,
+# with time zone maps, tables and calculations for Canadian Sunrise, Sunset,
+# and LMST; they also cover many countries and global locations, with a chart
+# and table showing current Universal Time offsets, and may be useful as
+# another source of information for 1970 and earlier.
+#
+# * Standard Time and Time Zones in Canada; Smith, C.C.; JRASC, Vol. 26,
+#   pp.49-77; February 1932; SAO/NASA Astrophysics Data System (ADS)
+#   http://adsabs.harvard.edu/abs/1932JRASC..26...49S from p.75:
+#   Yukon Interpretation Ordinance
+#   Yukon standard time is the local mean time at the one hundred and
+#   thirty-fifth meridian.
+#
+# * Standard Time and Time Zones in Canada; Smith, C.C.; Thomson, Malcolm M.;
+#   JRASC, Vol. 52, pp.193-223; October 1958; SAO/NASA Astrophysics Data System
+#   (ADS) http://adsabs.harvard.edu/abs/1958JRASC..52..193S from pp.220-1:
+#   Yukon Interpretation Ordinance, 1955, Chap. 16.
+#
+#     (1) Subject to this section, standard time shall be reckoned as nine
+#     hours behind Greenwich Time and called Yukon Standard Time.
+#
+#     (2) Notwithstanding subsection (1), the Commissioner may make regulations
+#     varying the manner of reckoning standard time.
+#
+# * Yukon Territory Commissioner's Order 1966-20 Interpretation Ordinance
+#   http://? - no online source found
+#
+# * Standard Time and Time Zones in Canada; Thomson, Malcolm M.; JRASC,
+#   Vol. 64, pp.129-162; June 1970; SAO/NASA Astrophysics Data System (ADS)
+#   http://adsabs.harvard.edu/abs/1970JRASC..64..129T from p.156: Yukon
+#   Territory Commissioner's Order 1967-59 Interpretation Ordinance ...
+#
+#     1. Commissioner's Order 1966-20 dated at Whitehorse in the Yukon
+#     Territory on 27th January, 1966, is hereby revoked.
+#
+#     2. Yukon (East) Standard Time as defined by section 36 of the
+#     Interpretation Ordinance from and after mid-night on the 28th day of May,
+#     1967 shall be reckoned in the same manner as Pacific Standard Time, that
+#     is to say, eight hours behind Greenwich Time in the area of the Yukon
+#     Territory lying east of the 138th degree longitude west.
+#
+#     3. In the remainder of the Territory, lying west of the 138th degree
+#     longitude west, Yukon (West) Standard Time shall be reckoned as nine
+#     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
+#   C.O. 1973/214 INTERPRETATION ACT ...
+#
+#     1. Effective October 28, 1973 Commissioner's Order 1967/59 is hereby
+#     revoked.
+#
+#     2. Yukon Standard Time as defined by section 36 of the Interpretation
+#     Act from and after midnight on the twenty-eighth day of October, 1973
+#     shall be reckoned in the same manner as Pacific Standard Time, that is
+#     to say eight hours behind Greenwich Time.
+#
+# * O.I.C. 1980/02 INTERPRETATION ACT
+#   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
+#   O.I.C. 1987/056 INTERPRETATION ACT ...
+#
+#   In every year between
+#     (a) two o'clock in the morning in the first Sunday in April, and
+#     (b) two o'clock in the morning in the last Sunday in October,
+#   Standard Time shall be reckoned as seven hours behind Greenwich Time and
+#   called Yukon Daylight Saving Time.
+#   ...
+#   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
+#   O.I.C. 2006/127 INTERPRETATION ACT ...
+#
+#     1. In Yukon each year the time for general purposes shall be 7 hours
+#     behind Greenwich mean time during the period commencing at two o'clock
+#     in the forenoon on the second Sunday of March and ending at two o'clock
+#     in the forenoon on the first Sunday of November and shall be called
+#     Yukon Daylight Saving Time.
+#
+#     2. Order-in-Council 1987/56 is revoked.
+#
+#     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
 
 # From Rives McDow (1999-09-04):
 # Nunavut ... moved ... to incorporate the whole territory into one time zone.
@@ -2134,7 +2203,7 @@
 			-7:00	NT_YK	M%sT	1980
 			-7:00	Canada	M%sT
 Zone America/Whitehorse	-9:00:12 -	LMT	1900 Aug 20
-			-9:00	NT_YK	Y%sT	1966 Jul  1  2:00
+			-9:00	NT_YK	Y%sT	1967 May 28  0:00
 			-8:00	NT_YK	P%sT	1980
 			-8:00	Canada	P%sT
 Zone America/Dawson	-9:17:40 -	LMT	1900 Aug 20
--- a/test/sun/util/calendar/zi/tzdata/southamerica	Wed May 13 12:50:09 2015 -0700
+++ b/test/sun/util/calendar/zi/tzdata/southamerica	Thu May 14 20:11:36 2015 -0700
@@ -1121,6 +1121,60 @@
 
 # Chile
 
+# From Paul Eggert (2015-04-03):
+# Shanks & Pottenger says America/Santiago introduced standard time in
+# 1890 and rounds its UTC offset to 70W40; guess that in practice this
+# was the same offset as in 1916-1919.  It also says Pacific/Easter
+# standardized on 109W22 in 1890; assume this didn't change the clocks.
+#
+# Dates for America/Santiago from 1910 to 2004 are primarily from
+# 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:
+# 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
+# [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
+# 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
+# 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:
+#
+#  - [1] says the 1910 transition was Jan 1, [2] says Jan 10 and cites
+#    Boletín Nº 1, Aviso Nº 1 (1910).  Go with [2].
+#
+#  - [1] says SMT was -4:42:45, [2] says Chile's official time from
+#    1916 to 1919 was -4:42:46.3, the meridian of Chile's National
+#    Astronomical Observatory (OAN), then located in what is now
+#    Quinta Normal in Santiago.  Go with [2], rounding it to -4:42:46.
+#
+#  - [1] says the 1918 transition was Sep 1, [2] says Sep 10 and cites
+#    Boletín Nº 22, Aviso Nº 129/1918 (1918-08-23).  Go with [2].
+#
+#  - [1] does not give times for transitions; assume they occur
+#    at midnight mainland time, the current common practice.  However,
+#    go with [2]'s specification of 23:00 for the 1947-05-21 transition.
+#
+# Another correction to [1] is from Jesper Nørgaard Welen, who
+# wrote (2006-10-08), "I think that there are some obvious mistakes in
+# the suggested link from Oscar van Vlijmen,... for instance entry 66
+# says that GMT-4 ended 1990-09-12 while entry 67 only begins GMT-3 at
+# 1990-09-15 (they should have been 1990-09-15 and 1990-09-16
+# respectively), but anyhow it clears up some doubts too."
+#
+# Data for Pacific/Easter from 1910 through 1967 come from Shanks &
+# Pottenger.  After that, for lack of better info assume
+# Pacific/Easter is always two hours behind America/Santiago;
+# this is known to work for DST transitions starting in 2008 and
+# may well be true for earlier transitions.
+
 # From Eduardo Krell (1995-10-19):
 # The law says to switch to DST at midnight [24:00] on the second SATURDAY
 # of October....  The law is the same for March and October.
@@ -1133,78 +1187,35 @@
 # Because of the same drought, the government decided to end DST later,
 # on April 3, (one-time change).
 
-# From Oscar van Vlijmen (2006-10-08):
-# http://www.horaoficial.cl/cambio.htm
-
-# From Jesper Nørgaard Welen (2006-10-08):
-# I think that there are some obvious mistakes in the suggested link
-# from Oscar van Vlijmen,... for instance entry 66 says that GMT-4
-# ended 1990-09-12 while entry 67 only begins GMT-3 at 1990-09-15
-# (they should have been 1990-09-15 and 1990-09-16 respectively), but
-# anyhow it clears up some doubts too.
-
-# From Paul Eggert (2014-08-12):
-# The following data entries for Chile and America/Santiago are from
-# <http://www.horaoficial.cl/horaof.htm> (2006-09-20), transcribed by
-# Jesper Nørgaard Welen.  The data entries for Pacific/Easter are from Shanks
-# & Pottenger, except with DST transitions after 1932 cloned from
-# America/Santiago.  The pre-1980 Pacific/Easter data entries are dubious,
-# but we have no other source.
-
 # From Germán Poo-Caamaño (2008-03-03):
 # Due to drought, Chile extends Daylight Time in three weeks.  This
 # is one-time change (Saturday 3/29 at 24:00 for America/Santiago
 # and Saturday 3/29 at 22:00 for Pacific/Easter)
 # The Supreme Decree is located at
 # http://www.shoa.cl/servicios/supremo316.pdf
-# and the instructions for 2008 are located in:
-# http://www.horaoficial.cl/cambio.htm
-
+#
 # From José Miguel Garrido (2008-03-05):
-# ...
-# You could see the announces of the change on
 # http://www.shoa.cl/noticias/2008/04hora/hora.htm
 
 # From Angel Chiang (2010-03-04):
 # Subject: DST in Chile exceptionally extended to 3 April due to earthquake
 # http://www.gobiernodechile.cl/viewNoticia.aspx?idArticulo=30098
-# (in Spanish, last paragraph).
 #
-# This is breaking news. There should be more information available later.
-
 # From Arthur David Olson (2010-03-06):
 # Angel Chiang's message confirmed by Julio Pacheco; Julio provided a patch.
 
-# From Glenn Eychaner (2011-03-02):
-# It appears that the Chilean government has decided to postpone the
-# change from summer time to winter time again, by three weeks to April
-# 2nd:
-# http://www.emol.com/noticias/nacional/detalle/detallenoticias.asp?idnoticia=467651
-#
-# This is not yet reflected in the official "cambio de hora" site, but
-# probably will be soon:
-# http://www.horaoficial.cl/cambio.htm
-
-# From Arthur David Olson (2011-03-02):
-# The emol.com article mentions a water shortage as the cause of the
-# postponement, which may mean that it's not a permanent change.
-
 # From Glenn Eychaner (2011-03-28):
-# The article:
 # http://diario.elmercurio.com/2011/03/28/_portada/_portada/noticias/7565897A-CA86-49E6-9E03-660B21A4883E.htm?id=3D{7565897A-CA86-49E6-9E03-660B21A4883E}
-#
 # In English:
 # Chile's clocks will go back an hour this year on the 7th of May instead
 # of this Saturday. They will go forward again the 3rd Saturday in
-# August, not in October as they have since 1968. This is a pilot plan
-# which will be reevaluated in 2012.
+# August, not in October as they have since 1968.
 
 # From Mauricio Parada (2012-02-22), translated by Glenn Eychaner (2012-02-23):
 # As stated in the website of the Chilean Energy Ministry
 # http://www.minenergia.cl/ministerio/noticias/generales/gobierno-anuncia-fechas-de-cambio-de.html
 # The Chilean Government has decided to postpone the entrance into winter time
-# (to leave DST) from March 11 2012 to April 28th 2012. The decision has not
-# been yet formalized but it will within the next days.
+# (to leave DST) from March 11 2012 to April 28th 2012....
 # Quote from the website communication:
 #
 # 6. For the year 2012, the dates of entry into winter time will be as follows:
@@ -1237,17 +1248,9 @@
 # From Paul Eggert (2015-03-03):
 # For now, assume that the extension will persist indefinitely.
 
-# NOTE: ChileAQ rules for Antarctic bases are stored separately in the
-# 'antarctica' file.
-
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Chile	1927	1932	-	Sep	 1	0:00	1:00	S
+Rule	Chile	1927	1931	-	Sep	 1	0:00	1:00	S
 Rule	Chile	1928	1932	-	Apr	 1	0:00	0	-
-Rule	Chile	1942	only	-	Jun	 1	4:00u	0	-
-Rule	Chile	1942	only	-	Aug	 1	5:00u	1:00	S
-Rule	Chile	1946	only	-	Jul	15	4:00u	1:00	S
-Rule	Chile	1946	only	-	Sep	 1	3:00u	0:00	-
-Rule	Chile	1947	only	-	Apr	 1	4:00u	0	-
 Rule	Chile	1968	only	-	Nov	 3	4:00u	1:00	S
 Rule	Chile	1969	only	-	Mar	30	3:00u	0	-
 Rule	Chile	1969	only	-	Nov	23	4:00u	1:00	S
@@ -1258,10 +1261,8 @@
 Rule	Chile	1973	only	-	Sep	30	4:00u	1:00	S
 Rule	Chile	1974	1987	-	Oct	Sun>=9	4:00u	1:00	S
 Rule	Chile	1987	only	-	Apr	12	3:00u	0	-
-Rule	Chile	1988	1989	-	Mar	Sun>=9	3:00u	0	-
-Rule	Chile	1988	only	-	Oct	Sun>=1	4:00u	1:00	S
-Rule	Chile	1989	only	-	Oct	Sun>=9	4:00u	1:00	S
-Rule	Chile	1990	only	-	Mar	18	3:00u	0	-
+Rule	Chile	1988	1990	-	Mar	Sun>=9	3:00u	0	-
+Rule	Chile	1988	1989	-	Oct	Sun>=9	4:00u	1:00	S
 Rule	Chile	1990	only	-	Sep	16	4:00u	1:00	S
 Rule	Chile	1991	1996	-	Mar	Sun>=9	3:00u	0	-
 Rule	Chile	1991	1997	-	Oct	Sun>=9	4:00u	1:00	S
@@ -1284,15 +1285,21 @@
 # (1996-09) says 1998-03-08.  Ignore these.
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone America/Santiago	-4:42:46 -	LMT	1890
-			-4:42:46 -	SMT	1910        # Santiago Mean Time
+			-4:42:46 -	SMT	1910 Jan 10 # Santiago Mean Time
 			-5:00	-	CLT	1916 Jul  1 # Chile Time
-			-4:42:46 -	SMT	1918 Sep  1 # Santiago Mean Time
-			-4:00	-	CLT	1919 Jul  1 # Chile Time
-			-4:42:46 -	SMT	1927 Sep  1 # Santiago Mean Time
-			-5:00	Chile	CL%sT	1947 May 22 # Chile Time
+			-4:42:46 -	SMT	1918 Sep 10
+			-4:00	-	CLT	1919 Jul  1
+			-4:42:46 -	SMT	1927 Sep  1
+			-5:00	Chile	CL%sT	1932 Sep  1
+			-4:00	-	CLT	1942 Jun  1
+			-5:00	-	CLT	1942 Aug  1
+			-4:00	-	CLT	1946 Jul 15
+			-4:00	1:00	CLST	1946 Sep  1 # central Chile
+			-4:00	-	CLT	1947 Apr  1
+			-5:00	-	CLT	1947 May 21 23:00
 			-4:00	Chile	CL%sT	2015 Apr 26  3:00u
 			-3:00	-	CLT
-Zone Pacific/Easter	-7:17:44 -	LMT	1890
+Zone Pacific/Easter	-7:17:28 -	LMT	1890
 			-7:17:28 -	EMT	1932 Sep    # Easter Mean Time
 			-7:00	Chile	EAS%sT	1982 Mar 14 3:00u # Easter Time
 			-6:00	Chile	EAS%sT	2015 Apr 26 3:00u
@@ -1302,6 +1309,25 @@
 # Other Chilean locations, including Juan Fernández Is, Desventuradas Is,
 # and Antarctic bases, are like America/Santiago.
 
+# Antarctic base using South American rules
+# (See the file 'antarctica' for more.)
+#
+# Palmer, Anvers Island, since 1965 (moved 2 miles in 1968)
+#
+# From Ethan Dicks (1996-10-06):
+# It keeps the same time as Punta Arenas, Chile, because, just like us
+# and the South Pole, that's the other end of their supply line....
+# I verified with someone who was there that since 1980,
+# Palmer has followed Chile.  Prior to that, before the Falklands War,
+# Palmer used to be supplied from Argentina.
+#
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone Antarctica/Palmer	0	-	zzz	1965
+			-4:00	Arg	AR%sT	1969 Oct  5
+			-3:00	Arg	AR%sT	1982 May
+			-4:00	Chile	CL%sT	2015 Apr 26 3:00u
+			-3:00	-	CLT
+
 # Colombia
 
 # Milne gives 4:56:16.4 for Bogotá time in 1899; round to nearest.  He writes,