This commit is contained in:
Lana Steuck 2014-10-30 13:56:09 -07:00
commit bc97a50589
182 changed files with 3488 additions and 1173 deletions
jdk
make
src
java.base
java.desktop
java.management/share/classes/javax/management/loading
java.sql.rowset/share/classes/javax/sql/rowset
jdk.deploy.osx/macosx/classes/apple/security
jdk.localedata/share/classes/sun/util/resources
test

@ -48,22 +48,6 @@ $(INCLUDE_DST_OS_DIR)/%.h: \
################################################################################
CALENDARS_SRC := $(JDK_TOPDIR)/src/java.base/share/conf
$(LIB_DST_DIR)/calendars.properties: $(CALENDARS_SRC)/calendars.properties
$(call install-file)
BASE_CONF_FILES += $(LIB_DST_DIR)/calendars.properties
$(LIB_DST_DIR)/hijrah-config-umalqura.properties: $(CALENDARS_SRC)/hijrah-config-umalqura.properties
$(MKDIR) -p $(@D)
$(RM) $@
$(CP) $< $@
BASE_CONF_FILES += $(LIB_DST_DIR)/hijrah-config-umalqura.properties
################################################################################
ifneq ($(findstring $(OPENJDK_TARGET_OS), windows aix),)
TZMAPPINGS_SRC := $(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS)/conf

@ -67,8 +67,11 @@ ifneq ($(FREETYPE_BUNDLE_LIB_PATH), )
FREETYPE_TARGET_LIB := $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/$(call SHARED_LIBRARY,freetype).6
endif
# We can't use $(install-file) in this rule because it preserves symbolic links and
# libfreetype.so is usually a symbolic link to something like libfreetype.so.6 on Unix.
$(FREETYPE_TARGET_LIB): $(FREETYPE_BUNDLE_LIB_PATH)/$(call SHARED_LIBRARY,freetype)
$(install-file)
$(MKDIR) -p $(@D)
$(CP) $< $@
ifeq ($(OPENJDK_BUILD_OS), windows)
$(CHMOD) +rx $@
endif

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

@ -133,23 +133,13 @@ Zone Africa/Algiers 0:12:12 - LMT 1891 Mar 15 0:01
# See Africa/Lagos.
# Botswana
# From Paul Eggert (2013-02-21):
# Milne says they were regulated by the Cape Town Signal in 1899;
# assume they switched to 2:00 when Cape Town did.
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Gaborone 1:43:40 - LMT 1885
1:30 - SAST 1903 Mar
2:00 - CAT 1943 Sep 19 2:00
2:00 1:00 CAST 1944 Mar 19 2:00
2:00 - CAT
# See Africa/Maputo.
# Burkina Faso
# See Africa/Abidjan.
# Burundi
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Bujumbura 1:57:28 - LMT 1890
2:00 - CAT
# See Africa/Maputo.
# Cameroon
# See Africa/Lagos.
@ -184,10 +174,7 @@ Zone Indian/Comoro 2:53:04 - LMT 1911 Jul # Moroni, Gran Comoro
3:00 - EAT
# Democratic Republic of the Congo
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Lubumbashi 1:49:52 - LMT 1897 Nov 9
2:00 - CAT
# The above is for the eastern part; see Africa/Lagos for the western part.
# See Africa/Lagos for the western part and Africa/Maputo for the eastern.
# Republic of the Congo
# See Africa/Lagos.
@ -339,7 +326,7 @@ Rule Egypt 2007 only - Sep Thu>=1 24:00 0 -
# Egypt is to change back to Daylight system on May 15
# http://english.ahram.org.eg/NewsContent/1/64/100735/Egypt/Politics-/Egypts-government-to-reapply-daylight-saving-time-.aspx
# From Gunther Vermier (2015-05-13):
# From Gunther Vermier (2014-05-13):
# our Egypt office confirms that the change will be at 15 May "midnight" (24:00)
# From Imed Chihi (2014-06-04):
@ -489,11 +476,7 @@ Zone Africa/Nairobi 2:27:16 - LMT 1928 Jul
3:00 - EAT
# Lesotho
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Maseru 1:50:00 - LMT 1903 Mar
2:00 - SAST 1943 Sep 19 2:00
2:00 1:00 SAST 1944 Mar 19 2:00
2:00 - SAST
# See Africa/Johannesburg.
# Liberia
# From Paul Eggert (2006-03-22):
@ -575,9 +558,7 @@ Zone Indian/Antananarivo 3:10:04 - LMT 1911 Jul
3:00 - EAT
# Malawi
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Blantyre 2:20:00 - LMT 1903 Mar
2:00 - CAT
# See Africa/Maputo.
# Mali
# Mauritania
@ -987,6 +968,13 @@ Zone Africa/El_Aaiun -0:52:48 - LMT 1934 Jan # El Aaiún
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Maputo 2:10:20 - LMT 1903 Mar
2:00 - CAT
Link Africa/Maputo Africa/Blantyre # Malawi
Link Africa/Maputo Africa/Bujumbura # Burundi
Link Africa/Maputo Africa/Gaborone # Botswana
Link Africa/Maputo Africa/Harare # Zimbabwe
Link Africa/Maputo Africa/Kigali # Rwanda
Link Africa/Maputo Africa/Lubumbashi # E Dem. Rep. of Congo
Link Africa/Maputo Africa/Lusaka # Zambia
# Namibia
# The 1994-04-03 transition is from Shanks & Pottenger.
@ -1054,9 +1042,7 @@ Zone Indian/Reunion 3:41:52 - LMT 1911 Jun # Saint-Denis
# Tromelin - inhabited until at least 1958
# Rwanda
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Kigali 2:00:16 - LMT 1935 Jun
2:00 - CAT
# See Africa/Maputo.
# St Helena
# See Africa/Abidjan.
@ -1100,6 +1086,9 @@ Rule SA 1943 1944 - Mar Sun>=15 2:00 0 -
Zone Africa/Johannesburg 1:52:00 - LMT 1892 Feb 8
1:30 - SAST 1903 Mar
2:00 SA SAST
Link Africa/Johannesburg Africa/Maseru # Lesotho
Link Africa/Johannesburg Africa/Mbabane # Swaziland
#
# Marion and Prince Edward Is
# scientific station since 1947
# no information
@ -1127,9 +1116,7 @@ Zone Africa/Khartoum 2:10:08 - LMT 1931
Link Africa/Khartoum Africa/Juba
# Swaziland
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Mbabane 2:04:24 - LMT 1903 Mar
2:00 - SAST
# See Africa/Johannesburg.
# Tanzania
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
@ -1250,11 +1237,5 @@ Zone Africa/Kampala 2:09:40 - LMT 1928 Jul
3:00 - EAT
# Zambia
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Lusaka 1:53:08 - LMT 1903 Mar
2:00 - CAT
# Zimbabwe
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Harare 2:04:12 - LMT 1903 Mar
2:00 - CAT
# See Africa/Maputo.

@ -70,10 +70,11 @@
# 3:30 IRST IRDT Iran
# 4:00 GST Gulf*
# 5:30 IST India
# 7:00 ICT Indochina*
# 7:00 ICT Indochina, most times and locations*
# 7:00 WIB west Indonesia (Waktu Indonesia Barat)
# 8:00 WITA central Indonesia (Waktu Indonesia Tengah)
# 8:00 CST China
# 8:00 IDT Indochina, 1943-45, 1947-55, 1960-75 (some locations)*
# 8:00 JWST Western Standard Time (Japan, 1896/1937)*
# 9:00 JCST Central Standard Time (Japan, 1896/1937)
# 9:00 WIT east Indonesia (Waktu Indonesia Timur)
@ -294,12 +295,8 @@ Zone Asia/Rangoon 6:24:40 - LMT 1880 # or Yangon
6:30 - MMT # Myanmar Time
# Cambodia
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Phnom_Penh 6:59:40 - LMT 1906 Jun 9
7:06:20 - SMT 1911 Mar 11 0:01 # Saigon MT?
7:00 - ICT 1912 May
8:00 - ICT 1931 May
7:00 - ICT
# See Asia/Bangkok.
# China
@ -916,6 +913,10 @@ Zone Asia/Kolkata 5:53:28 - LMT 1880 # Kolkata
# Indonesia
#
# From Paul Eggert (2014-09-06):
# The 1876 Report of the Secretary of the [US] Navy, p 306 says that Batavia
# civil time was 7:07:12.5; round to even for Jakarta.
#
# From Gwillim Law (2001-05-28), overriding Shanks & Pottenger:
# http://www.sumatera-inc.com/go_to_invest/about_indonesia.asp#standtime
# says that Indonesia's time zones changed on 1988-01-01. Looking at some
@ -1733,12 +1734,8 @@ Zone Asia/Kuwait 3:11:56 - LMT 1950
3:00 - AST
# Laos
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Vientiane 6:50:24 - LMT 1906 Jun 9 # or Viangchan
7:06:20 - SMT 1911 Mar 11 0:01 # Saigon MT?
7:00 - ICT 1912 May
8:00 - ICT 1931 May
7:00 - ICT
# See Asia/Bangkok.
# Lebanon
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
@ -2751,6 +2748,8 @@ Zone Asia/Dushanbe 4:35:12 - LMT 1924 May 2
Zone Asia/Bangkok 6:42:04 - LMT 1880
6:42:04 - BMT 1920 Apr # Bangkok Mean Time
7:00 - ICT
Link Asia/Bangkok Asia/Phnom_Penh # Cambodia
Link Asia/Bangkok Asia/Vientiane # Laos
# Turkmenistan
# From Shanks & Pottenger.
@ -2788,22 +2787,65 @@ Zone Asia/Tashkent 4:37:11 - LMT 1924 May 2
# Vietnam
# From Paul Eggert (2013-02-21):
# From Paul Eggert (2014-10-04):
# Milne gives 7:16:56 for the meridian of Saigon in 1899, as being
# used in Lower Laos, Cambodia, and Annam. But this is quite a ways
# from Saigon's location. For now, ignore this and stick with Shanks
# and Pottenger.
# and Pottenger for LMT before 1906.
# From Arthur David Olson (2008-03-18):
# The English-language name of Vietnam's most populous city is "Ho Chi Minh
# City"; use Ho_Chi_Minh below to avoid a name of more than 14 characters.
# From Shanks & Pottenger:
# From Paul Eggert (2014-10-21) after a heads-up from Trần Ngọc Quân:
# Trần Tiến Bình's authoritative book "Lịch Việt Nam: thế kỷ XX-XXI (1901-2100)"
# (Nhà xuất bản Văn Hoá - Thông Tin, Hanoi, 2005), pp 49-50,
# is quoted verbatim in:
# http://www.thoigian.com.vn/?mPage=P80D01
# is translated by Brian Inglis in:
# http://mm.icann.org/pipermail/tz/2014-October/021654.html
# and is the basis for the information below.
#
# The 1906 transition was effective July 1 and standardized Indochina to
# Phù Liễn Observatory, legally 104 deg. 17'17" east of Paris.
# It's unclear whether this meant legal Paris Mean Time (00:09:21) or
# the Paris Meridian (2 deg. 20'14.03" E); the former yields 07:06:30.1333...
# and the latter 07:06:29.333... so either way it rounds to 07:06:30,
# which is used below even though the modern-day Phù Liễn Observatory
# is closer to 07:06:31. Abbreviate Phù Liễn Mean Time as PLMT.
#
# The following transitions occurred in Indochina in general (before 1954)
# and in South Vietnam in particular (after 1954):
# To 07:00 on 1911-05-01.
# To 08:00 on 1942-12-31 at 23:00.
# To 09:00 in 1945-03-14 at 23:00.
# To 07:00 on 1945-09-02 in Vietnam.
# To 08:00 on 1947-04-01 in French-controlled Indochina.
# To 07:00 on 1955-07-01 in South Vietnam.
# To 08:00 on 1959-12-31 at 23:00 in South Vietnam.
# To 07:00 on 1975-06-13 in South Vietnam.
#
# Trần cites the following sources; it's unclear which supplied the info above.
#
# Hoàng Xuân Hãn: "Lịch và lịch Việt Nam". Tập san Khoa học Xã hội,
# No. 9, Paris, February 1982.
#
# Lê Thành Lân: "Lịch và niên biểu lịch sử hai mươi thế kỷ (0001-2010)",
# NXB Thống kê, Hanoi, 2000.
#
# Lê Thành Lân: "Lịch hai thế kỷ (1802-2010) và các lịch vĩnh cửu",
# NXB Thuận Hoá, Huế, 1995.
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Ho_Chi_Minh 7:06:40 - LMT 1906 Jun 9
7:06:20 - SMT 1911 Mar 11 0:01 # Saigon MT?
7:00 - ICT 1912 May
8:00 - ICT 1931 May
Zone Asia/Ho_Chi_Minh 7:06:40 - LMT 1906 Jul 1
7:06:30 - PLMT 1911 May 1
7:00 - ICT 1942 Dec 31 23:00
8:00 - IDT 1945 Mar 14 23:00
9:00 - JST 1945 Sep 2
7:00 - ICT 1947 Apr 1
8:00 - IDT 1955 Jul 1
7:00 - ICT 1959 Dec 31 23:00
8:00 - IDT 1975 Jun 13
7:00 - ICT
# Yemen

@ -354,20 +354,27 @@ Zone Indian/Cocos 6:27:40 - LMT 1900
# Fiji will end DST on 2014-01-19 02:00:
# http://www.fiji.gov.fj/Media-Center/Press-Releases/DAYLIGHT-SAVINGS-TO-END-THIS-MONTH-%281%29.aspx
# From Paul Eggert (2014-01-10):
# For now, guess that Fiji springs forward the Sunday before the fourth
# Monday in October, and springs back the penultimate Sunday in January.
# This is ad hoc, but matches recent practice.
# From Ken Rylander (2014-10-20):
# DST will start Nov. 2 this year.
# http://www.fiji.gov.fj/Media-Center/Press-Releases/DAYLIGHT-SAVING-STARTS-ON-SUNDAY,-NOVEMBER-2ND.aspx
# From Paul Eggert (2014-10-20):
# For now, guess DST from 02:00 the first Sunday in November to
# 03:00 the first Sunday on or after January 18. Although ad hoc, it
# matches this year's plan and seems more likely to match future
# practice than guessing no DST.
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Fiji 1998 1999 - Nov Sun>=1 2:00 1:00 S
Rule Fiji 1999 2000 - Feb lastSun 3:00 0 -
Rule Fiji 2009 only - Nov 29 2:00 1:00 S
Rule Fiji 2010 only - Mar lastSun 3:00 0 -
Rule Fiji 2010 max - Oct Sun>=21 2:00 1:00 S
Rule Fiji 2010 2013 - Oct Sun>=21 2:00 1:00 S
Rule Fiji 2011 only - Mar Sun>=1 3:00 0 -
Rule Fiji 2012 2013 - Jan Sun>=18 3:00 0 -
Rule Fiji 2014 max - Jan Sun>=18 2:00 0 -
Rule Fiji 2014 only - Jan Sun>=18 2:00 0 -
Rule Fiji 2014 max - Nov Sun>=1 2:00 1:00 S
Rule Fiji 2015 max - Jan Sun>=18 3:00 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Pacific/Fiji 11:55:44 - LMT 1915 Oct 26 # Suva
12:00 Fiji FJ%sT # Fiji Time
@ -542,6 +549,30 @@ Zone Pacific/Palau 8:57:56 - LMT 1901 # Koror
Zone Pacific/Port_Moresby 9:48:40 - LMT 1880
9:48:32 - PMMT 1895 # Port Moresby Mean Time
10:00 - PGT # Papua New Guinea Time
#
# From Paul Eggert (2014-10-13):
# Base the Bougainville entry on the Arawa-Kieta region, which appears to have
# the most people even though it was devastated in the Bougainville Civil War.
#
# Although Shanks gives 1942-03-15 / 1943-11-01 for JST, these dates
# are apparently rough guesswork from the starts of military campaigns.
# The World War II entries below are instead based on Arawa-Kieta.
# The Japanese occupied Kieta in July 1942,
# according to the Pacific War Online Encyclopedia
# http://pwencycl.kgbudge.com/B/o/Bougainville.htm
# and seem to have controlled it until their 1945-08-21 surrender.
#
# The Autonomous Region of Bougainville plans to switch from UTC+10 to UTC+11
# on 2014-12-28 at 02:00. They call UTC+11 "Bougainville Standard Time";
# abbreviate this as BST. See:
# http://www.bougainville24.com/bougainville-issues/bougainville-gets-own-timezone/
#
Zone Pacific/Bougainville 10:22:16 - LMT 1880
9:48:32 - PMMT 1895
10:00 - PGT 1942 Jul
9:00 - JST 1945 Aug 21
10:00 - PGT 2014 Dec 28 2:00
11:00 - BST
# Pitcairn
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
@ -826,6 +857,7 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901
# 10:00 AEST AEDT Eastern Australia
# 10:00 ChST Chamorro
# 10:30 LHST LHDT Lord Howe*
# 11:00 BST Bougainville*
# 11:30 NZMT NZST New Zealand through 1945
# 12:00 NZST NZDT New Zealand 1946-present
# 12:15 CHAST Chatham through 1945*

@ -91,10 +91,11 @@
# 0:00 WET WEST WEMT Western Europe
# 0:19:32.13 AMT NST Amsterdam, Netherlands Summer (1835-1937)*
# 0:20 NET NEST Netherlands (1937-1940)*
# 1:00 BST British Standard (1968-1971)
# 1:00 CET CEST CEMT Central Europe
# 1:00:14 SET Swedish (1879-1899)*
# 2:00 EET EEST Eastern Europe
# 3:00 FET Further-eastern Europe*
# 3:00 FET Further-eastern Europe (2011-2014)*
# 3:00 MSK MSD MSM* Moscow
# From Peter Ilieve (1994-12-04),
@ -746,6 +747,13 @@ Zone Europe/Vienna 1:05:21 - LMT 1893 Apr
# http://www.belta.by/ru/all_news/society/V-Belarusi-otmenjaetsja-perexod-na-sezonnoe-vremja_i_572952.html
# http://naviny.by/rubrics/society/2011/09/16/ic_articles_116_175144/
# http://news.tut.by/society/250578.html
#
# From Alexander Bokovoy (2014-10-09):
# Belarussian government decided against changing to winter time....
# http://eng.belta.by/all_news/society/Belarus-decides-against-adjusting-time-in-Russias-wake_i_76335.html
# From Paul Eggert (2014-10-08):
# Hence Belarus can share time zone abbreviations with Moscow again.
#
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Europe/Minsk 1:50:16 - LMT 1880
1:50 - MMT 1924 May 2 # Minsk Mean Time
@ -758,7 +766,8 @@ Zone Europe/Minsk 1:50:16 - LMT 1880
2:00 - EET 1992 Mar 29 0:00s
2:00 1:00 EEST 1992 Sep 27 0:00s
2:00 Russia EE%sT 2011 Mar 27 2:00s
3:00 - FET
3:00 - FET 2014 Oct 26 1:00s
3:00 - MSK
# Belgium
#
@ -2524,7 +2533,7 @@ Zone Asia/Novosibirsk 5:31:40 - LMT 1919 Dec 14 6:00
# The Kemerovo region will remain at UTC+7 through the 2014-10-26 change, thus
# realigning itself with KRAT.
Zone Asia/Novokuznetsk 5:48:48 - NMT 1920 Jan 6
Zone Asia/Novokuznetsk 5:48:48 - LMT 1924 May 1
6:00 - KRAT 1930 Jun 21 # Krasnoyarsk Time
7:00 Russia KRA%sT 1991 Mar 31 2:00s
6:00 Russia KRA%sT 1992 Jan 19 2:00s

@ -300,6 +300,12 @@ Zone PST8PDT -8:00 US P%sT
# time zone, but we do go by the Eastern time zone because so many people work
# in Columbus."
# From Paul Eggert (2014-09-06):
# Monthly Notices of the Royal Astronomical Society 44, 4 (1884-02-08), 208
# says that New York City Hall time was 3 minutes 58.4 seconds fast of
# Eastern time (i.e., -4:56:01.6) just before the 1883 switch. Round to the
# nearest second.
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER
Rule NYC 1920 only - Mar lastSun 2:00 1:00 D
Rule NYC 1920 only - Oct lastSun 2:00 0 S
@ -1118,17 +1124,16 @@ Zone America/Menominee -5:50:27 - LMT 1885 Sep 18 12:00
# An amendment to the Interpretation Act was registered on February 19/2007....
# http://action.attavik.ca/home/justice-gn/attach/2007/gaz02part2.pdf
# From Paul Eggert (2006-04-25):
# From Paul Eggert (2014-10-18):
# H. David Matthews and Mary Vincent's map
# "It's about TIME", _Canadian Geographic_ (September-October 1998)
# http://www.canadiangeographic.ca/Magazine/SO98/geomap.asp
# http://www.canadiangeographic.ca/Magazine/SO98/alacarte.asp
# contains detailed boundaries for regions observing nonstandard
# time and daylight saving time arrangements in Canada circa 1998.
#
# INMS, the Institute for National Measurement Standards in Ottawa, has
# information about standard and daylight saving time zones in Canada.
# http://inms-ienm.nrc-cnrc.gc.ca/en/time_services/daylight_saving_e.php
# (updated periodically).
# National Research Council Canada maintains info about time zones and DST.
# http://www.nrc-cnrc.gc.ca/eng/services/time/time_zones.html
# http://www.nrc-cnrc.gc.ca/eng/services/time/faq/index.html#Q5
# Its unofficial information is often taken from Matthews and Vincent.
# From Paul Eggert (2006-06-27):
@ -1993,10 +1998,7 @@ Zone America/Creston -7:46:04 - LMT 1884
# [Also see <http://www.nunatsiaq.com/nunavut/nvt10309_06.html> (2001-03-09).]
# From Gwillim Law (2005-05-21):
# According to maps at
# http://inms-ienm.nrc-cnrc.gc.ca/images/time_services/TZ01SWE.jpg
# http://inms-ienm.nrc-cnrc.gc.ca/images/time_services/TZ01SSE.jpg
# (both dated 2003), and
# According to ...
# http://www.canadiangeographic.ca/Magazine/SO98/geomap.asp
# (from a 1998 Canadian Geographic article), the de facto and de jure time
# for Southampton Island (at the north end of Hudson Bay) is UTC-5 all year
@ -2005,9 +2007,11 @@ Zone America/Creston -7:46:04 - LMT 1884
# predates the creation of Nunavut, it probably goes back many years....
# The Inuktitut name of Coral Harbour is Sallit, but it's rarely used.
#
# From Paul Eggert (2005-07-26):
# From Paul Eggert (2014-10-17):
# For lack of better information, assume that Southampton Island observed
# daylight saving only during wartime.
# daylight saving only during wartime. Gwillim Law's email also
# mentioned maps now maintained by National Research Council Canada;
# see above for an up-to-date link.
# From Chris Walton (2007-03-01):
# ... the community of Resolute (located on Cornwallis Island in
@ -3008,10 +3012,21 @@ Zone America/Tegucigalpa -5:48:52 - LMT 1921 Apr
# Shanks & Pottenger give -5:07:12, but Milne records -5:07:10.41 from an
# unspecified official document, and says "This time is used throughout the
# island". Go with Milne. Round to the nearest second as required by zic.
#
# Shanks & Pottenger give April 28 for the 1974 spring-forward transition, but
# Lance Neita writes that Prime Minister Michael Manley decreed it January 5.
# Assume Neita meant Jan 6 02:00, the same as the US. Neita also writes that
# Manley's supporters associated this act with Manley's nickname "Joshua"
# (recall that in the Bible the sun stood still at Joshua's request),
# and with the Rod of Correction which Manley said he had received from
# Haile Selassie, Emperor of Ethiopia. See:
# Neita L. The politician in all of us. Jamaica Observer 2014-09-20
# http://www.jamaicaobserver.com/columns/The-politician-in-all-of-us_17573647
#
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone America/Jamaica -5:07:11 - LMT 1890 # Kingston
-5:07:11 - KMT 1912 Feb # Kingston Mean Time
-5:00 - EST 1974 Apr 28 2:00
-5:00 - EST 1974
-5:00 US E%sT 1984
-5:00 - EST

@ -330,7 +330,8 @@ PE -1203-07703 America/Lima
PF -1732-14934 Pacific/Tahiti Society Islands
PF -0900-13930 Pacific/Marquesas Marquesas Islands
PF -2308-13457 Pacific/Gambier Gambier Islands
PG -0930+14710 Pacific/Port_Moresby
PG -0930+14710 Pacific/Port_Moresby most locations
PG -0613+15534 Pacific/Bougainville Bougainville
PH +1435+12100 Asia/Manila
PK +2452+06703 Asia/Karachi
PL +5215+02100 Europe/Warsaw

@ -75,6 +75,7 @@ SUNWprivate_1.1 {
Java_java_io_FileDescriptor_initIDs;
Java_java_io_FileDescriptor_sync;
Java_java_io_FileDescriptor_getAppend;
Java_java_io_FileInputStream_available;
Java_java_io_FileInputStream_close0;
Java_java_io_FileInputStream_initIDs;

@ -54,14 +54,12 @@ PROFILE_1_JRE_LIB_FILES := \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/server/$(LIBRARY_PREFIX)jvm$(SHARED_LIBRARY_SUFFIX) \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/server/$(LIBRARY_PREFIX)jvm.diz \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/server/Xusage.txt \
calendars.properties \
classlist \
ext/localedata.jar \
ext/meta-index \
ext/sunec.jar \
ext/sunjce_provider.jar \
ext/sunpkcs11.jar \
hijrah-config-umalqura.properties \
jce.jar \
jsse.jar \
logging.properties \

@ -1588,7 +1588,7 @@ public class File
/**
* A convenience method to set the owner's read permission for this abstract
* pathname. On some platforms it may be possible to start the Java virtual
* machine with special privileges that allow it to read files that that are
* machine with special privileges that allow it to read files that are
* marked as unreadable.
*
* <p>An invocation of this method of the form <tt>file.setReadable(arg)</tt>

@ -26,6 +26,8 @@
package java.io;
import java.nio.channels.FileChannel;
import sun.misc.SharedSecrets;
import sun.misc.JavaIOFileDescriptorAccess;
import sun.nio.ch.FileChannelImpl;
@ -52,16 +54,17 @@ import sun.nio.ch.FileChannelImpl;
public
class FileOutputStream extends OutputStream
{
/**
* Access to FileDescriptor internals.
*/
private static final JavaIOFileDescriptorAccess fdAccess =
SharedSecrets.getJavaIOFileDescriptorAccess();
/**
* The system dependent file descriptor.
*/
private final FileDescriptor fd;
/**
* True if the file is opened for append.
*/
private final boolean append;
/**
* The associated channel, initialized lazily.
*/
@ -207,7 +210,6 @@ class FileOutputStream extends OutputStream
}
this.fd = new FileDescriptor();
fd.attach(this);
this.append = append;
this.path = name;
open(name, append);
@ -245,7 +247,6 @@ class FileOutputStream extends OutputStream
security.checkWrite(fdObj);
}
this.fd = fdObj;
this.append = false;
this.path = null;
fd.attach(this);
@ -287,7 +288,7 @@ class FileOutputStream extends OutputStream
* @exception IOException if an I/O error occurs.
*/
public void write(int b) throws IOException {
write(b, append);
write(b, fdAccess.getAppend(fd));
}
/**
@ -310,7 +311,7 @@ class FileOutputStream extends OutputStream
* @exception IOException if an I/O error occurs.
*/
public void write(byte b[]) throws IOException {
writeBytes(b, 0, b.length, append);
writeBytes(b, 0, b.length, fdAccess.getAppend(fd));
}
/**
@ -323,7 +324,7 @@ class FileOutputStream extends OutputStream
* @exception IOException if an I/O error occurs.
*/
public void write(byte b[], int off, int len) throws IOException {
writeBytes(b, off, len, append);
writeBytes(b, off, len, fdAccess.getAppend(fd));
}
/**
@ -395,7 +396,7 @@ class FileOutputStream extends OutputStream
public FileChannel getChannel() {
synchronized (this) {
if (channel == null) {
channel = FileChannelImpl.open(fd, path, false, true, append, this);
channel = FileChannelImpl.open(fd, path, false, true, this);
}
return channel;
}

@ -44,6 +44,10 @@ abstract class DelegatingMethodHandle extends MethodHandle {
super(type, chooseDelegatingForm(target));
}
protected DelegatingMethodHandle(MethodType type, LambdaForm form) {
super(type, form);
}
/** Define this to extract the delegated target which supplies the invocation behavior. */
abstract protected MethodHandle getTarget();
@ -88,14 +92,31 @@ abstract class DelegatingMethodHandle extends MethodHandle {
return makeReinvokerForm(target, MethodTypeForm.LF_DELEGATE, DelegatingMethodHandle.class, NF_getTarget);
}
/** Create a LF which simply reinvokes a target of the given basic type. */
static LambdaForm makeReinvokerForm(MethodHandle target,
int whichCache,
Object constraint,
NamedFunction getTargetFn) {
String debugString;
switch(whichCache) {
case MethodTypeForm.LF_REBIND: debugString = "BMH.reinvoke"; break;
case MethodTypeForm.LF_DELEGATE: debugString = "MH.delegate"; break;
default: debugString = "MH.reinvoke"; break;
}
// No pre-action needed.
return makeReinvokerForm(target, whichCache, constraint, debugString, true, getTargetFn, null);
}
/** Create a LF which simply reinvokes a target of the given basic type. */
static LambdaForm makeReinvokerForm(MethodHandle target,
int whichCache,
Object constraint,
String debugString,
boolean forceInline,
NamedFunction getTargetFn,
NamedFunction preActionFn) {
MethodType mtype = target.type().basicType();
boolean customized = (whichCache < 0 ||
mtype.parameterSlotCount() > MethodType.MAX_MH_INVOKER_ARITY);
boolean hasPreAction = (preActionFn != null);
LambdaForm form;
if (!customized) {
form = mtype.form().cachedLambdaForm(whichCache);
@ -105,12 +126,16 @@ abstract class DelegatingMethodHandle extends MethodHandle {
final int ARG_BASE = 1;
final int ARG_LIMIT = ARG_BASE + mtype.parameterCount();
int nameCursor = ARG_LIMIT;
final int PRE_ACTION = hasPreAction ? nameCursor++ : -1;
final int NEXT_MH = customized ? -1 : nameCursor++;
final int REINVOKE = nameCursor++;
LambdaForm.Name[] names = LambdaForm.arguments(nameCursor - ARG_LIMIT, mtype.invokerType());
assert(names.length == nameCursor);
names[THIS_DMH] = names[THIS_DMH].withConstraint(constraint);
Object[] targetArgs;
if (hasPreAction) {
names[PRE_ACTION] = new LambdaForm.Name(preActionFn, names[THIS_DMH]);
}
if (customized) {
targetArgs = Arrays.copyOfRange(names, ARG_BASE, ARG_LIMIT, Object[].class);
names[REINVOKE] = new LambdaForm.Name(target, targetArgs); // the invoker is the target itself
@ -120,20 +145,14 @@ abstract class DelegatingMethodHandle extends MethodHandle {
targetArgs[0] = names[NEXT_MH]; // overwrite this MH with next MH
names[REINVOKE] = new LambdaForm.Name(mtype, targetArgs);
}
String debugString;
switch(whichCache) {
case MethodTypeForm.LF_REBIND: debugString = "BMH.reinvoke"; break;
case MethodTypeForm.LF_DELEGATE: debugString = "MH.delegate"; break;
default: debugString = "MH.reinvoke"; break;
}
form = new LambdaForm(debugString, ARG_LIMIT, names);
form = new LambdaForm(debugString, ARG_LIMIT, names, forceInline);
if (!customized) {
form = mtype.form().setCachedLambdaForm(whichCache, form);
}
return form;
}
private static final NamedFunction NF_getTarget;
static final NamedFunction NF_getTarget;
static {
try {
NF_getTarget = new NamedFunction(DelegatingMethodHandle.class

@ -628,8 +628,13 @@ class InvokerBytecodeGenerator {
// Mark this method as a compiled LambdaForm
mv.visitAnnotation("Ljava/lang/invoke/LambdaForm$Compiled;", true);
// Force inlining of this invoker method.
mv.visitAnnotation("Ljava/lang/invoke/ForceInline;", true);
if (lambdaForm.forceInline) {
// Force inlining of this invoker method.
mv.visitAnnotation("Ljava/lang/invoke/ForceInline;", true);
} else {
mv.visitAnnotation("Ljava/lang/invoke/DontInline;", true);
}
// iterate over the form's names, generating bytecode instructions for each
// start iterating at the first name following the arguments

@ -119,6 +119,7 @@ import static java.lang.invoke.MethodHandleNatives.Constants.*;
class LambdaForm {
final int arity;
final int result;
final boolean forceInline;
@Stable final Name[] names;
final String debugName;
MemberName vmentry; // low-level behavior, or null if not yet prepared
@ -243,11 +244,16 @@ class LambdaForm {
LambdaForm(String debugName,
int arity, Name[] names, int result) {
this(debugName, arity, names, result, true);
}
LambdaForm(String debugName,
int arity, Name[] names, int result, boolean forceInline) {
assert(namesOK(arity, names));
this.arity = arity;
this.result = fixResult(result, names);
this.names = names.clone();
this.debugName = fixDebugName(debugName);
this.forceInline = forceInline;
int maxOutArity = normalize();
if (maxOutArity > MethodType.MAX_MH_INVOKER_ARITY) {
// Cannot use LF interpreter on very high arity expressions.
@ -255,17 +261,23 @@ class LambdaForm {
compileToBytecode();
}
}
LambdaForm(String debugName,
int arity, Name[] names) {
this(debugName,
arity, names, LAST_RESULT);
this(debugName, arity, names, LAST_RESULT, true);
}
LambdaForm(String debugName,
int arity, Name[] names, boolean forceInline) {
this(debugName, arity, names, LAST_RESULT, forceInline);
}
LambdaForm(String debugName,
Name[] formals, Name[] temps, Name result) {
this(debugName,
formals.length, buildNames(formals, temps, result), LAST_RESULT);
formals.length, buildNames(formals, temps, result), LAST_RESULT, true);
}
LambdaForm(String debugName,
Name[] formals, Name[] temps, Name result, boolean forceInline) {
this(debugName,
formals.length, buildNames(formals, temps, result), LAST_RESULT, forceInline);
}
private static Name[] buildNames(Name[] formals, Name[] temps, Name result) {
@ -279,6 +291,10 @@ class LambdaForm {
}
private LambdaForm(String sig) {
this(sig, true);
}
private LambdaForm(String sig, boolean forceInline) {
// Make a blank lambda form, which returns a constant zero or null.
// It is used as a template for managing the invocation of similar forms that are non-empty.
// Called only from getPreparedForm.
@ -287,6 +303,7 @@ class LambdaForm {
this.result = (signatureReturn(sig) == V_TYPE ? -1 : arity);
this.names = buildEmptyNames(arity, sig);
this.debugName = "LF.zero";
this.forceInline = forceInline;
assert(nameRefsAreLegal());
assert(isEmpty());
assert(sig.equals(basicTypeSignature())) : sig + " != " + basicTypeSignature();

@ -1438,10 +1438,9 @@ assertEquals("[three, thee, tee]", asListFix.invoke((Object)argv).toString());
/*non-public*/
void updateForm(LambdaForm newForm) {
if (form == newForm) return;
assert(this instanceof DirectMethodHandle && this.internalMemberName().isStatic());
// ISSUE: Should we have a memory fence here?
newForm.prepare(); // as in MethodHandle.<init>
UNSAFE.putObject(this, FORM_OFFSET, newForm);
this.form.prepare(); // as in MethodHandle.<init>
UNSAFE.fullFence();
}
private static final long FORM_OFFSET;

@ -30,6 +30,7 @@ import java.security.PrivilegedAction;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.function.Function;
import sun.invoke.empty.Empty;
import sun.invoke.util.ValueConversions;
@ -713,10 +714,11 @@ import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
LambdaForm form = makeGuardWithTestForm(basicType);
BoundMethodHandle.SpeciesData data = BoundMethodHandle.speciesData_LLL();
BoundMethodHandle mh;
try {
mh = (BoundMethodHandle)
data.constructor().invokeBasic(type, form,
(Object) test, (Object) target, (Object) fallback);
(Object) test, (Object) profile(target), (Object) profile(fallback));
} catch (Throwable ex) {
throw uncaughtException(ex);
}
@ -724,6 +726,129 @@ import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
return mh;
}
static
MethodHandle profile(MethodHandle target) {
if (DONT_INLINE_THRESHOLD >= 0) {
return makeBlockInlningWrapper(target);
} else {
return target;
}
}
/**
* Block inlining during JIT-compilation of a target method handle if it hasn't been invoked enough times.
* Corresponding LambdaForm has @DontInline when compiled into bytecode.
*/
static
MethodHandle makeBlockInlningWrapper(MethodHandle target) {
LambdaForm lform = PRODUCE_BLOCK_INLINING_FORM.apply(target);
return new CountingWrapper(target, lform,
PRODUCE_BLOCK_INLINING_FORM, PRODUCE_REINVOKER_FORM,
DONT_INLINE_THRESHOLD);
}
/** Constructs reinvoker lambda form which block inlining during JIT-compilation for a particular method handle */
private static final Function<MethodHandle, LambdaForm> PRODUCE_BLOCK_INLINING_FORM = new Function<MethodHandle, LambdaForm>() {
@Override
public LambdaForm apply(MethodHandle target) {
return DelegatingMethodHandle.makeReinvokerForm(target,
MethodTypeForm.LF_DELEGATE_BLOCK_INLINING, CountingWrapper.class, "reinvoker.dontInline", false,
DelegatingMethodHandle.NF_getTarget, CountingWrapper.NF_maybeStopCounting);
}
};
/** Constructs simple reinvoker lambda form for a particular method handle */
private static final Function<MethodHandle, LambdaForm> PRODUCE_REINVOKER_FORM = new Function<MethodHandle, LambdaForm>() {
@Override
public LambdaForm apply(MethodHandle target) {
return DelegatingMethodHandle.makeReinvokerForm(target,
MethodTypeForm.LF_DELEGATE, DelegatingMethodHandle.class, DelegatingMethodHandle.NF_getTarget);
}
};
/**
* Counting method handle. It has 2 states: counting and non-counting.
* It is in counting state for the first n invocations and then transitions to non-counting state.
* Behavior in counting and non-counting states is determined by lambda forms produced by
* countingFormProducer & nonCountingFormProducer respectively.
*/
static class CountingWrapper extends DelegatingMethodHandle {
private final MethodHandle target;
private int count;
private Function<MethodHandle, LambdaForm> countingFormProducer;
private Function<MethodHandle, LambdaForm> nonCountingFormProducer;
private volatile boolean isCounting;
private CountingWrapper(MethodHandle target, LambdaForm lform,
Function<MethodHandle, LambdaForm> countingFromProducer,
Function<MethodHandle, LambdaForm> nonCountingFormProducer,
int count) {
super(target.type(), lform);
this.target = target;
this.count = count;
this.countingFormProducer = countingFromProducer;
this.nonCountingFormProducer = nonCountingFormProducer;
this.isCounting = (count > 0);
}
@Hidden
@Override
protected MethodHandle getTarget() {
return target;
}
@Override
public MethodHandle asTypeUncached(MethodType newType) {
MethodHandle newTarget = target.asType(newType);
MethodHandle wrapper;
if (isCounting) {
LambdaForm lform;
lform = countingFormProducer.apply(target);
wrapper = new CountingWrapper(newTarget, lform, countingFormProducer, nonCountingFormProducer, DONT_INLINE_THRESHOLD);
} else {
wrapper = newTarget; // no need for a counting wrapper anymore
}
return (asTypeCache = wrapper);
}
boolean countDown() {
if (count <= 0) {
// Try to limit number of updates. MethodHandle.updateForm() doesn't guarantee LF update visibility.
if (isCounting) {
isCounting = false;
return true;
} else {
return false;
}
} else {
--count;
return false;
}
}
@Hidden
static void maybeStopCounting(Object o1) {
CountingWrapper wrapper = (CountingWrapper) o1;
if (wrapper.countDown()) {
// Reached invocation threshold. Replace counting behavior with a non-counting one.
LambdaForm lform = wrapper.nonCountingFormProducer.apply(wrapper.target);
lform.compileToBytecode(); // speed up warmup by avoiding LF interpretation again after transition
wrapper.updateForm(lform);
}
}
static final NamedFunction NF_maybeStopCounting;
static {
Class<?> THIS_CLASS = CountingWrapper.class;
try {
NF_maybeStopCounting = new NamedFunction(THIS_CLASS.getDeclaredMethod("maybeStopCounting", Object.class));
} catch (ReflectiveOperationException ex) {
throw newInternalError(ex);
}
}
}
static
LambdaForm makeGuardWithTestForm(MethodType basicType) {
LambdaForm lform = basicType.form().cachedLambdaForm(MethodTypeForm.LF_GWT);

@ -47,10 +47,11 @@ import sun.misc.Unsafe;
static final boolean TRACE_METHOD_LINKAGE;
static final boolean USE_LAMBDA_FORM_EDITOR;
static final int COMPILE_THRESHOLD;
static final int DONT_INLINE_THRESHOLD;
static final int PROFILE_LEVEL;
static {
final Object[] values = { false, false, false, false, false, null, null };
final Object[] values = new Object[8];
AccessController.doPrivileged(new PrivilegedAction<Void>() {
public Void run() {
values[0] = Boolean.getBoolean("java.lang.invoke.MethodHandle.DEBUG_NAMES");
@ -59,7 +60,8 @@ import sun.misc.Unsafe;
values[3] = Boolean.getBoolean("java.lang.invoke.MethodHandle.TRACE_METHOD_LINKAGE");
values[4] = Boolean.getBoolean("java.lang.invoke.MethodHandle.USE_LF_EDITOR");
values[5] = Integer.getInteger("java.lang.invoke.MethodHandle.COMPILE_THRESHOLD", 30);
values[6] = Integer.getInteger("java.lang.invoke.MethodHandle.PROFILE_LEVEL", 0);
values[6] = Integer.getInteger("java.lang.invoke.MethodHandle.DONT_INLINE_THRESHOLD", 30);
values[7] = Integer.getInteger("java.lang.invoke.MethodHandle.PROFILE_LEVEL", 0);
return null;
}
});
@ -69,7 +71,8 @@ import sun.misc.Unsafe;
TRACE_METHOD_LINKAGE = (Boolean) values[3];
USE_LAMBDA_FORM_EDITOR = (Boolean) values[4];
COMPILE_THRESHOLD = (Integer) values[5];
PROFILE_LEVEL = (Integer) values[6];
DONT_INLINE_THRESHOLD = (Integer) values[6];
PROFILE_LEVEL = (Integer) values[7];
}
/** Tell if any of the debugging switches are turned on.

@ -63,24 +63,25 @@ final class MethodTypeForm {
final @Stable LambdaForm[] lambdaForms;
// Indexes into lambdaForms:
static final int
LF_INVVIRTUAL = 0, // DMH invokeVirtual
LF_INVSTATIC = 1,
LF_INVSPECIAL = 2,
LF_NEWINVSPECIAL = 3,
LF_INVINTERFACE = 4,
LF_INVSTATIC_INIT = 5, // DMH invokeStatic with <clinit> barrier
LF_INTERPRET = 6, // LF interpreter
LF_REBIND = 7, // BoundMethodHandle
LF_DELEGATE = 8, // DelegatingMethodHandle
LF_EX_LINKER = 9, // invokeExact_MT (for invokehandle)
LF_EX_INVOKER = 10, // MHs.invokeExact
LF_GEN_LINKER = 11, // generic invoke_MT (for invokehandle)
LF_GEN_INVOKER = 12, // generic MHs.invoke
LF_CS_LINKER = 13, // linkToCallSite_CS
LF_MH_LINKER = 14, // linkToCallSite_MH
LF_GWC = 15, // guardWithCatch (catchException)
LF_GWT = 16, // guardWithTest
LF_LIMIT = 17;
LF_INVVIRTUAL = 0, // DMH invokeVirtual
LF_INVSTATIC = 1,
LF_INVSPECIAL = 2,
LF_NEWINVSPECIAL = 3,
LF_INVINTERFACE = 4,
LF_INVSTATIC_INIT = 5, // DMH invokeStatic with <clinit> barrier
LF_INTERPRET = 6, // LF interpreter
LF_REBIND = 7, // BoundMethodHandle
LF_DELEGATE = 8, // DelegatingMethodHandle
LF_DELEGATE_BLOCK_INLINING = 9, // Counting DelegatingMethodHandle w/ @DontInline
LF_EX_LINKER = 10, // invokeExact_MT (for invokehandle)
LF_EX_INVOKER = 11, // MHs.invokeExact
LF_GEN_LINKER = 12, // generic invoke_MT (for invokehandle)
LF_GEN_INVOKER = 13, // generic MHs.invoke
LF_CS_LINKER = 14, // linkToCallSite_CS
LF_MH_LINKER = 15, // linkToCallSite_MH
LF_GWC = 16, // guardWithCatch (catchException)
LF_GWT = 17, // guardWithTest
LF_LIMIT = 18;
/** Return the type corresponding uniquely (1-1) to this MT-form.
* It might have any primitive returns or arguments, but will have no references except Object.

@ -239,7 +239,7 @@ public abstract class Buffer {
* @throws IllegalArgumentException
* If the preconditions on <tt>newPosition</tt> do not hold
*/
public final Buffer position(int newPosition) {
public Buffer position(int newPosition) {
if ((newPosition > limit) || (newPosition < 0))
throw new IllegalArgumentException();
position = newPosition;
@ -270,7 +270,7 @@ public abstract class Buffer {
* @throws IllegalArgumentException
* If the preconditions on <tt>newLimit</tt> do not hold
*/
public final Buffer limit(int newLimit) {
public Buffer limit(int newLimit) {
if ((newLimit > capacity) || (newLimit < 0))
throw new IllegalArgumentException();
limit = newLimit;
@ -284,7 +284,7 @@ public abstract class Buffer {
*
* @return This buffer
*/
public final Buffer mark() {
public Buffer mark() {
mark = position;
return this;
}
@ -300,7 +300,7 @@ public abstract class Buffer {
* @throws InvalidMarkException
* If the mark has not been set
*/
public final Buffer reset() {
public Buffer reset() {
int m = mark;
if (m < 0)
throw new InvalidMarkException();
@ -325,7 +325,7 @@ public abstract class Buffer {
*
* @return This buffer
*/
public final Buffer clear() {
public Buffer clear() {
position = 0;
limit = capacity;
mark = -1;
@ -353,7 +353,7 @@ public abstract class Buffer {
*
* @return This buffer
*/
public final Buffer flip() {
public Buffer flip() {
limit = position;
position = 0;
mark = -1;
@ -375,7 +375,7 @@ public abstract class Buffer {
*
* @return This buffer
*/
public final Buffer rewind() {
public Buffer rewind() {
position = 0;
mark = -1;
return this;

@ -208,4 +208,76 @@ public abstract class MappedByteBuffer
private native boolean isLoaded0(long address, long length, int pageCount);
private native void load0(long address, long length);
private native void force0(FileDescriptor fd, long address, long length);
// -- Covariant return type overrides
/**
* {@inheritDoc}
* @since 1.9
*/
@Override
public final MappedByteBuffer position(int newPosition) {
super.position(newPosition);
return this;
}
/**
* {@inheritDoc}
* @since 1.9
*/
@Override
public final MappedByteBuffer limit(int newLimit) {
super.limit(newLimit);
return this;
}
/**
* {@inheritDoc}
* @since 1.9
*/
@Override
public final MappedByteBuffer mark() {
super.mark();
return this;
}
/**
* {@inheritDoc}
* @since 1.9
*/
@Override
public final MappedByteBuffer reset() {
super.reset();
return this;
}
/**
* {@inheritDoc}
* @since 1.9
*/
@Override
public final MappedByteBuffer clear() {
super.clear();
return this;
}
/**
* {@inheritDoc}
* @since 1.9
*/
@Override
public final MappedByteBuffer flip() {
super.flip();
return this;
}
/**
* {@inheritDoc}
* @since 1.9
*/
@Override
public final MappedByteBuffer rewind() {
super.rewind();
return this;
}
}

@ -1025,6 +1025,106 @@ public abstract class $Type$Buffer
return offset;
}
// -- Covariant return type overrides
/**
* {@inheritDoc}
* @since 1.9
*/
@Override
public
#if[!byte]
final
#end[!byte]
$Type$Buffer position(int newPosition) {
super.position(newPosition);
return this;
}
/**
* {@inheritDoc}
* @since 1.9
*/
@Override
public
#if[!byte]
final
#end[!byte]
$Type$Buffer limit(int newLimit) {
super.limit(newLimit);
return this;
}
/**
* {@inheritDoc}
* @since 1.9
*/
@Override
public
#if[!byte]
final
#end[!byte]
$Type$Buffer mark() {
super.mark();
return this;
}
/**
* {@inheritDoc}
* @since 1.9
*/
@Override
public
#if[!byte]
final
#end[!byte]
$Type$Buffer reset() {
super.reset();
return this;
}
/**
* {@inheritDoc}
* @since 1.9
*/
@Override
public
#if[!byte]
final
#end[!byte]
$Type$Buffer clear() {
super.clear();
return this;
}
/**
* {@inheritDoc}
* @since 1.9
*/
@Override
public
#if[!byte]
final
#end[!byte]
$Type$Buffer flip() {
super.flip();
return this;
}
/**
* {@inheritDoc}
* @since 1.9
*/
@Override
public
#if[!byte]
final
#end[!byte]
$Type$Buffer rewind() {
super.rewind();
return this;
}
/**
* Compacts this buffer&nbsp;&nbsp;<i>(optional operation)</i>.
*

@ -208,7 +208,7 @@ public abstract class FileStore {
* @param attribute
* the attribute to read
* @return the attribute value; {@code null} may be a valid for some
* @return the attribute value; {@code null} may be valid for some
* attributes
*
* @throws UnsupportedOperationException

@ -51,7 +51,7 @@
* <p> An attribute view provides a read-only or updatable view of the non-opaque
* values, or <em>metadata</em>, associated with objects in a file system.
* The {@link java.nio.file.attribute.FileAttributeView} interface is
* extended by several other interfaces that views to specific sets of file
* extended by several other interfaces that provide views to specific sets of file
* attributes. {@code FileAttributeViews} are selected by invoking the {@link
* java.nio.file.Files#getFileAttributeView} method with a
* <em>type-token</em> to identify the required view. Views can also be identified

@ -61,13 +61,14 @@ import static java.time.temporal.ChronoField.EPOCH_DAY;
import java.io.File;
import java.io.FileInputStream;
import java.io.FilePermission;
import java.io.IOException;
import java.io.InputStream;
import java.io.InvalidObjectException;
import java.io.ObjectInputStream;
import java.io.Serializable;
import java.security.AccessController;
import java.security.PrivilegedActionException;
import java.security.PrivilegedAction;
import java.time.Clock;
import java.time.DateTimeException;
import java.time.Instant;
@ -145,29 +146,8 @@ import sun.util.logging.PlatformLogger;
* property resource that defines the {@code ID}, the {@code calendar type},
* the start of the calendar, the alignment with the
* ISO calendar, and the length of each month for a range of years.
* The variants are identified in the {@code calendars.properties} file.
* The new properties are prefixed with {@code "calendars.hijrah."}:
* <table cellpadding="2" border="0" summary="Configuration of Hijrah Calendar Variants">
* <thead>
* <tr class="tableSubHeadingColor">
* <th class="colFirst" align="left">Property Name</th>
* <th class="colFirst" align="left">Property value</th>
* <th class="colLast" align="left">Description </th>
* </tr>
* </thead>
* <tbody>
* <tr class="altColor">
* <td>calendars.hijrah.{ID}</td>
* <td>The property resource defining the {@code {ID}} variant</td>
* <td>The property resource is located with the {@code calendars.properties} file</td>
* </tr>
* <tr class="rowColor">
* <td>calendars.hijrah.{ID}.type</td>
* <td>The calendar type</td>
* <td>LDML defines the calendar type names</td>
* </tr>
* </tbody>
* </table>
* The variants are loaded by HijrahChronology as a resource from
* hijrah-config-&lt;calendar type&gt;.properties.
* <p>
* The Hijrah property resource is a set of properties that describe the calendar.
* The syntax is defined by {@code java.util.Properties#load(Reader)}.
@ -279,91 +259,41 @@ public final class HijrahChronology extends AbstractChronology implements Serial
* Computed by {@link #createEpochMonths}.
*/
private transient int maxYearLength;
/**
* A reference to the properties stored in
* ${java.home}/lib/calendars.properties
*/
private final transient static Properties calendarProperties;
/**
* Prefix of property names for Hijrah calendar variants.
* Prefix of resource names for Hijrah calendar variants.
*/
private static final String PROP_PREFIX = "calendar.hijrah.";
/**
* Suffix of property names containing the calendar type of a variant.
*/
private static final String PROP_TYPE_SUFFIX = ".type";
private static final String RESOURCE_PREFIX = "hijrah-config-";
/**
* Static initialization of the predefined calendars found in the
* lib/calendars.properties file.
* Suffix of resource names for Hijrah calendar variants.
*/
private static final String RESOURCE_SUFFIX = ".properties";
/**
* Static initialization of the built-in calendars.
* The data is not loaded until it is used.
*/
static {
try {
calendarProperties = sun.util.calendar.BaseCalendar.getCalendarProperties();
} catch (IOException ioe) {
throw new InternalError("Can't initialize lib/calendars.properties", ioe);
}
try {
INSTANCE = new HijrahChronology("Hijrah-umalqura");
// Register it by its aliases
AbstractChronology.registerChrono(INSTANCE, "Hijrah");
AbstractChronology.registerChrono(INSTANCE, "islamic");
} catch (DateTimeException ex) {
// Absence of Hijrah calendar is fatal to initializing this class.
PlatformLogger logger = PlatformLogger.getLogger("java.time.chrono");
logger.severe("Unable to initialize Hijrah calendar: Hijrah-umalqura", ex);
throw new RuntimeException("Unable to initialize Hijrah-umalqura calendar", ex.getCause());
}
registerVariants();
INSTANCE = new HijrahChronology("Hijrah-umalqura", "islamic-umalqura");
// Register it by its aliases
AbstractChronology.registerChrono(INSTANCE, "Hijrah");
AbstractChronology.registerChrono(INSTANCE, "islamic");
}
/**
* For each Hijrah variant listed, create the HijrahChronology and register it.
* Exceptions during initialization are logged but otherwise ignored.
*/
private static void registerVariants() {
for (String name : calendarProperties.stringPropertyNames()) {
if (name.startsWith(PROP_PREFIX)) {
String id = name.substring(PROP_PREFIX.length());
if (id.indexOf('.') >= 0) {
continue; // no name or not a simple name of a calendar
}
if (id.equals(INSTANCE.getId())) {
continue; // do not duplicate the default
}
try {
// Create and register the variant
HijrahChronology chrono = new HijrahChronology(id);
AbstractChronology.registerChrono(chrono);
} catch (DateTimeException ex) {
// Log error and continue
PlatformLogger logger = PlatformLogger.getLogger("java.time.chrono");
logger.severe("Unable to initialize Hijrah calendar: " + id, ex);
}
}
}
}
/**
* Create a HijrahChronology for the named variant.
* The resource and calendar type are retrieved from properties
* in the {@code calendars.properties}.
* The property names are {@code "calendar.hijrah." + id}
* and {@code "calendar.hijrah." + id + ".type"}
* Create a HijrahChronology for the named variant and type.
*
* @param id the id of the calendar
* @throws DateTimeException if the calendar type is missing from the properties file.
* @throws IllegalArgumentException if the id is empty
* @param calType the typeId of the calendar
* @throws IllegalArgumentException if the id or typeId is empty
*/
private HijrahChronology(String id) throws DateTimeException {
private HijrahChronology(String id, String calType) {
if (id.isEmpty()) {
throw new IllegalArgumentException("calendar id is empty");
}
String propName = PROP_PREFIX + id + PROP_TYPE_SUFFIX;
String calType = calendarProperties.getProperty(propName);
if (calType == null || calType.isEmpty()) {
throw new DateTimeException("calendarType is missing or empty for: " + propName);
if (calType.isEmpty()) {
throw new IllegalArgumentException("calendar typeId is empty");
}
this.typeId = id;
this.calendarType = calType;
@ -866,30 +796,26 @@ public final class HijrahChronology extends AbstractChronology implements Serial
/**
* Return the configuration properties from the resource.
* <p>
* The default location of the variant configuration resource is:
* The location of the variant configuration resource is:
* <pre>
* "$java.home/lib/" + resource-name
* "/java/time/chrono/hijrah-config-" + calendarType + ".properties"
* </pre>
*
* @param resource the name of the calendar property resource
* @param calendarType the calendarType of the calendar variant
* @return a Properties containing the properties read from the resource.
* @throws Exception if access to the property resource fails
*/
private static Properties readConfigProperties(final String resource) throws Exception {
try {
return AccessController
.doPrivileged((java.security.PrivilegedExceptionAction<Properties>)
() -> {
String libDir = System.getProperty("java.home") + File.separator + "lib";
File file = new File(libDir, resource);
Properties props = new Properties();
try (InputStream is = new FileInputStream(file)) {
props.load(is);
}
return props;
});
} catch (PrivilegedActionException pax) {
throw pax.getException();
private Properties readConfigProperties(final String calendarType) throws Exception {
String resourceName = RESOURCE_PREFIX + calendarType + RESOURCE_SUFFIX;
PrivilegedAction<InputStream> getResourceAction = () -> HijrahChronology.class.getResourceAsStream(resourceName);
FilePermission perm = new FilePermission("<<ALL FILES>>", "read");
try (InputStream is = AccessController.doPrivileged(getResourceAction, null, perm)) {
if (is == null) {
throw new RuntimeException("Hijrah calendar resource not found: /java/time/chrono/" + resourceName);
}
Properties props = new Properties();
props.load(is);
return props;
}
}
@ -906,9 +832,7 @@ public final class HijrahChronology extends AbstractChronology implements Serial
*/
private void loadCalendarData() {
try {
String resourceName = calendarProperties.getProperty(PROP_PREFIX + typeId);
Objects.requireNonNull(resourceName, "Resource missing for calendar: " + PROP_PREFIX + typeId);
Properties props = readConfigProperties(resourceName);
Properties props = readConfigProperties(calendarType);
Map<Integer, int[]> years = new HashMap<>();
int minYear = Integer.MAX_VALUE;
@ -937,7 +861,7 @@ public final class HijrahChronology extends AbstractChronology implements Serial
default:
try {
// Everything else is either a year or invalid
int year = Integer.valueOf(key);
int year = Integer.parseInt(key);
int[] months = parseMonths((String) entry.getValue());
years.put(year, months);
maxYear = Math.max(maxYear, year);
@ -1045,7 +969,7 @@ public final class HijrahChronology extends AbstractChronology implements Serial
}
for (int i = 0; i < 12; i++) {
try {
months[i] = Integer.valueOf(numbers[i]);
months[i] = Integer.parseInt(numbers[i]);
} catch (NumberFormatException nfe) {
throw new IllegalArgumentException("bad key: " + numbers[i]);
}
@ -1067,9 +991,9 @@ public final class HijrahChronology extends AbstractChronology implements Serial
throw new IllegalArgumentException("date must be yyyy-MM-dd");
}
int[] ymd = new int[3];
ymd[0] = Integer.valueOf(string.substring(0, 4));
ymd[1] = Integer.valueOf(string.substring(5, 7));
ymd[2] = Integer.valueOf(string.substring(8, 10));
ymd[0] = Integer.parseInt(string, 0, 4, 10);
ymd[1] = Integer.parseInt(string, 5, 7, 10);
ymd[2] = Integer.parseInt(string, 8, 10, 10);
return ymd;
} catch (NumberFormatException ex) {
throw new IllegalArgumentException("date must be yyyy-MM-dd", ex);

@ -518,7 +518,7 @@ public interface Collection<E> extends Iterable<E> {
* <p>The default implementation should be overridden by subclasses that
* can return a more efficient spliterator. In order to
* preserve expected laziness behavior for the {@link #stream()} and
* {@link #parallelStream()}} methods, spliterators should either have the
* {@link #parallelStream()} methods, spliterators should either have the
* characteristic of {@code IMMUTABLE} or {@code CONCURRENT}, or be
* <em><a href="Spliterator.html#binding">late-binding</a></em>.
* If none of these is practical, the overriding class should describe the

@ -97,8 +97,7 @@ class JapaneseImperialCalendar extends Calendar {
*
* This implementation uses
* sun.util.calendar.LocalGregorianCalendar to perform most of the
* calendar calculations. LocalGregorianCalendar is configurable
* and reads <JRE_HOME>/lib/calendars.properties at the start-up.
* calendar calculations.
*/
/**

@ -33,6 +33,8 @@ import java.io.FileDescriptor;
public interface JavaIOFileDescriptorAccess {
public void set(FileDescriptor obj, int fd);
public int get(FileDescriptor fd);
public void setAppend(FileDescriptor obj, boolean append);
public boolean getAppend(FileDescriptor obj);
// Only valid on Windows
public void setHandle(FileDescriptor obj, long handle);

@ -44,6 +44,8 @@ import java.util.ArrayList;
import java.util.List;
import sun.misc.Cleaner;
import sun.misc.JavaIOFileDescriptorAccess;
import sun.misc.SharedSecrets;
import sun.security.action.GetPropertyAction;
public class FileChannelImpl
@ -52,6 +54,10 @@ public class FileChannelImpl
// Memory allocation size for mapping buffers
private static final long allocationGranularity;
// Access to FileDispatcher internals
private static final JavaIOFileDescriptorAccess fdAccess =
SharedSecrets.getJavaIOFileDescriptorAccess();
// Used to make native read and write calls
private final FileDispatcher nd;
@ -61,7 +67,6 @@ public class FileChannelImpl
// File access mode (immutable)
private final boolean writable;
private final boolean readable;
private final boolean append;
// Required to prevent finalization of creating stream (immutable)
private final Object parent;
@ -77,31 +82,23 @@ public class FileChannelImpl
private final Object positionLock = new Object();
private FileChannelImpl(FileDescriptor fd, String path, boolean readable,
boolean writable, boolean append, Object parent)
boolean writable, Object parent)
{
this.fd = fd;
this.readable = readable;
this.writable = writable;
this.append = append;
this.parent = parent;
this.path = path;
this.nd = new FileDispatcherImpl(append);
this.nd = new FileDispatcherImpl();
}
// Used by FileInputStream.getChannel() and RandomAccessFile.getChannel()
// Used by FileInputStream.getChannel(), FileOutputStream.getChannel
// and RandomAccessFile.getChannel()
public static FileChannel open(FileDescriptor fd, String path,
boolean readable, boolean writable,
Object parent)
{
return new FileChannelImpl(fd, path, readable, writable, false, parent);
}
// Used by FileOutputStream.getChannel
public static FileChannel open(FileDescriptor fd, String path,
boolean readable, boolean writable,
boolean append, Object parent)
{
return new FileChannelImpl(fd, path, readable, writable, append, parent);
return new FileChannelImpl(fd, path, readable, writable, parent);
}
private void ensureOpen() throws IOException {
@ -109,7 +106,6 @@ public class FileChannelImpl
throw new ClosedChannelException();
}
// -- Standard channel operations --
protected void implCloseChannel() throws IOException {
@ -258,6 +254,7 @@ public class FileChannelImpl
ti = threads.add();
if (!isOpen())
return 0;
boolean append = fdAccess.getAppend(fd);
do {
// in append-mode then position is advanced to end before writing
p = (append) ? nd.size(fd) : position0(fd, -1);
@ -284,7 +281,7 @@ public class FileChannelImpl
if (!isOpen())
return null;
do {
p = position0(fd, newPosition);
p = position0(fd, newPosition);
} while ((p == IOStatus.INTERRUPTED) && isOpen());
return this;
} finally {

@ -247,7 +247,7 @@ class ServerSocketChannelImpl
return null;
thread = NativeThread.current();
for (;;) {
n = accept0(this.fd, newfd, isaa);
n = accept(this.fd, newfd, isaa);
if ((n == IOStatus.INTERRUPTED) && isOpen())
continue;
break;
@ -410,6 +410,18 @@ class ServerSocketChannelImpl
return sb.toString();
}
/**
* Accept a connection on a socket.
*
* @implNote Wrap native call to allow instrumentation.
*/
private int accept(FileDescriptor ssfd, FileDescriptor newfd,
InetSocketAddress[] isaa)
throws IOException
{
return accept0(ssfd, newfd, isaa);
}
// -- Native methods --
// Accepts a new connection, setting the given file descriptor to refer to

@ -560,7 +560,7 @@ final class CipherBox {
+ newLen);
hd.encodeBuffer(
(ByteBuffer)bb.duplicate().position(pos), System.out);
bb.duplicate().position(pos), System.out);
} catch (IOException e) { }
}
@ -790,7 +790,7 @@ final class CipherBox {
// The padding data should be filled with the padding length value.
int[] results = checkPadding(
(ByteBuffer)bb.duplicate().position(offset + newLen),
bb.duplicate().position(offset + newLen),
(byte)(padLen & 0xFF));
if (protocolVersion.v >= ProtocolVersion.TLS10.v) {
if (results[0] != 0) { // padding data has invalid bytes

@ -349,8 +349,7 @@ final class EngineInputRecord extends InputRecord {
/*
* Copy data out of buffer, it's ready to go.
*/
ByteBuffer netBB = (ByteBuffer)
(ByteBuffer.allocate(len).put(buf, 0, len).flip());
ByteBuffer netBB = ByteBuffer.allocate(len).put(buf, 0, len).flip();
engine.writer.putOutboundDataSync(netBB);
}

@ -113,9 +113,7 @@ final class EngineOutputRecord extends OutputRecord {
/*
* Copy data out of buffer, it's ready to go.
*/
ByteBuffer netBB = (ByteBuffer)
ByteBuffer.allocate(len).put(buf, off, len).flip();
ByteBuffer netBB = ByteBuffer.allocate(len).put(buf, off, len).flip();
writer.putOutboundData(netBB);
}

@ -177,44 +177,6 @@ public abstract class CalendarSystem {
return (cs == null) ? cal : cs;
}
/**
* Returns a {@link Properties} loaded from lib/calendars.properties.
*
* @return a {@link Properties} loaded from lib/calendars.properties
* @throws IOException if an error occurred when reading from the input stream
* @throws IllegalArgumentException if the input stream contains any malformed
* Unicode escape sequences
*/
public static Properties getCalendarProperties() throws IOException {
Properties calendarProps = null;
try {
String homeDir = AccessController.doPrivileged(
new sun.security.action.GetPropertyAction("java.home"));
final String fname = homeDir + File.separator + "lib" + File.separator
+ "calendars.properties";
calendarProps = AccessController.doPrivileged(new PrivilegedExceptionAction<Properties>() {
@Override
public Properties run() throws IOException {
Properties props = new Properties();
try (FileInputStream fis = new FileInputStream(fname)) {
props.load(fis);
}
return props;
}
});
} catch (PrivilegedActionException e) {
Throwable cause = e.getCause();
if (cause instanceof IOException) {
throw (IOException) cause;
} else if (cause instanceof IllegalArgumentException) {
throw (IllegalArgumentException) cause;
}
// Should not happen
throw new InternalError(cause);
}
return calendarProps;
}
//////////////////////////////// Calendar API //////////////////////////////////
/**

@ -829,7 +829,7 @@ public final class TimeZoneNames extends TimeZoneNamesBundle {
{"Europe/Madrid", CET},
{"Europe/Malta", CET},
{"Europe/Mariehamn", EET},
{"Europe/Minsk", FET},
{"Europe/Minsk", MSK},
{"Europe/Monaco", CET},
{"Europe/Moscow", MSK},
{"Europe/Nicosia", EET},
@ -917,6 +917,9 @@ public final class TimeZoneNames extends TimeZoneNamesBundle {
{"PRT", AST},
{"Pacific/Apia", WST_SAMOA},
{"Pacific/Auckland", NZST},
{"Pacific/Bougainville", new String[] {"Bougainville Standard Time", "BST",
"Bougainville Daylight Time", "BST",
"Bougainville Time", "BT"}},
{"Pacific/Chatham", CHAST},
{"Pacific/Chuuk", CHUT},
{"Pacific/Easter", EASTER},

@ -1,29 +0,0 @@
# Copyright (c) 2005, 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
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
#
# Hijrah calendars
#
calendar.hijrah.Hijrah-umalqura: hijrah-config-umalqura.properties
calendar.hijrah.Hijrah-umalqura.type: islamic-umalqura

@ -28,6 +28,7 @@
extern jfieldID IO_fd_fdID;
extern jfieldID IO_handle_fdID;
extern jfieldID IO_append_fdID;
#ifdef _ALLBSD_SOURCE
#include <fcntl.h>

@ -51,16 +51,22 @@ public final class FileDescriptor {
private List<Closeable> otherParents;
private boolean closed;
/**
* true, if file is opened for appending.
*/
private boolean append;
/**
* Constructs an (invalid) FileDescriptor
* object.
*/
public /**/ FileDescriptor() {
public FileDescriptor() {
fd = -1;
}
private /* */ FileDescriptor(int fd) {
private FileDescriptor(int fd) {
this.fd = fd;
this.append = getAppend(fd);
}
/**
@ -149,6 +155,14 @@ public final class FileDescriptor {
return obj.fd;
}
public void setAppend(FileDescriptor obj, boolean append) {
obj.append = append;
}
public boolean getAppend(FileDescriptor obj) {
return obj.append;
}
public void setHandle(FileDescriptor obj, long handle) {
throw new UnsupportedOperationException();
}
@ -160,6 +174,11 @@ public final class FileDescriptor {
);
}
/**
* Returns true, if the file was opened for appending.
*/
private static native boolean getAppend(int fd);
/*
* Package private methods to track referents.
* If multiple streams point to the same FileDescriptor, we cycle

@ -35,10 +35,6 @@ class FileDispatcherImpl extends FileDispatcher
init();
}
FileDispatcherImpl(boolean append) {
/* append is ignored */
}
FileDispatcherImpl() {
}

@ -141,7 +141,7 @@ class UnixAsynchronousServerSocketChannelImpl
Throwable exc = null;
try {
begin();
int n = accept0(this.fd, newfd, isaa);
int n = accept(this.fd, newfd, isaa);
// spurious wakeup, is this possible?
if (n == IOStatus.UNAVAILABLE) {
@ -277,7 +277,7 @@ class UnixAsynchronousServerSocketChannelImpl
try {
begin();
int n = accept0(this.fd, newfd, isaa);
int n = accept(this.fd, newfd, isaa);
if (n == IOStatus.UNAVAILABLE) {
// need calling context when there is security manager as
@ -332,6 +332,18 @@ class UnixAsynchronousServerSocketChannelImpl
}
}
/**
* Accept a connection on a socket.
*
* @implNote Wrap native call to allow instrumentation.
*/
private int accept(FileDescriptor ssfd, FileDescriptor newfd,
InetSocketAddress[] isaa)
throws IOException
{
return accept0(ssfd, newfd, isaa);
}
// -- Native methods --
private static native void initIDs();

@ -134,7 +134,7 @@ class UnixChannelFactory {
throw new IllegalArgumentException("APPEND + TRUNCATE_EXISTING not allowed");
FileDescriptor fdObj = open(dfd, path, pathForPermissionCheck, flags, mode);
return FileChannelImpl.open(fdObj, path.toString(), flags.read, flags.write, flags.append, null);
return FileChannelImpl.open(fdObj, path.toString(), flags.read, flags.write, null);
}
/**
@ -288,6 +288,7 @@ class UnixChannelFactory {
// create java.io.FileDescriptor
FileDescriptor fdObj = new FileDescriptor();
fdAccess.set(fdObj, fd);
fdAccess.setAppend(fdObj, flags.append);
return fdObj;
}
}

@ -23,6 +23,9 @@
* questions.
*/
#include <unistd.h>
#include <fcntl.h>
#include "jvm.h"
#include "io_util_md.h"
@ -35,6 +38,9 @@
/* field id for jint 'fd' in java.io.FileDescriptor */
jfieldID IO_fd_fdID;
/* field id for jboolean 'append' in java.io.FileDescriptor */
jfieldID IO_append_fdID;
/**************************************************************
* static methods to store field ID's in initializers
*/
@ -42,6 +48,7 @@ jfieldID IO_fd_fdID;
JNIEXPORT void JNICALL
Java_java_io_FileDescriptor_initIDs(JNIEnv *env, jclass fdClass) {
IO_fd_fdID = (*env)->GetFieldID(env, fdClass, "fd", "I");
IO_append_fdID = (*env)->GetFieldID(env, fdClass, "append", "Z");
}
/**************************************************************
@ -55,3 +62,9 @@ Java_java_io_FileDescriptor_sync(JNIEnv *env, jobject this) {
JNU_ThrowByName(env, "java/io/SyncFailedException", "sync failed");
}
}
JNIEXPORT jboolean JNICALL
Java_java_io_FileDescriptor_getAppend(JNIEnv *env, jclass fdClass, jint fd) {
int flags = fcntl(fd, F_GETFL);
return ((flags & O_APPEND) == 0) ? JNI_FALSE : JNI_TRUE;
}

@ -107,7 +107,15 @@ fileOpen(JNIEnv *env, jobject this, jstring path, jfieldID fid, int flags)
#endif
fd = handleOpen(ps, flags, 0666);
if (fd != -1) {
jobject fdobj;
jboolean append;
SET_FD(this, fd, fid);
fdobj = (*env)->GetObjectField(env, this, fid);
if (fdobj != NULL) {
append = (flags & O_APPEND) == 0 ? JNI_FALSE : JNI_TRUE;
(*env)->SetBooleanField(env, fdobj, IO_append_fdID, append);
}
} else {
throwFileNotFoundException(env, path);
}

@ -50,6 +50,11 @@ public final class FileDescriptor {
private List<Closeable> otherParents;
private boolean closed;
/**
* true, if file is opened for appending.
*/
private boolean append;
/**
* Constructs an (invalid) FileDescriptor
* object.
@ -75,6 +80,14 @@ public final class FileDescriptor {
return obj.fd;
}
public void setAppend(FileDescriptor obj, boolean append) {
obj.append = append;
}
public boolean getAppend(FileDescriptor obj) {
return obj.append;
}
public void setHandle(FileDescriptor obj, long handle) {
obj.handle = handle;
}

@ -31,22 +31,14 @@ import sun.misc.JavaIOFileDescriptorAccess;
class FileDispatcherImpl extends FileDispatcher
{
private static final JavaIOFileDescriptorAccess fdAccess =
SharedSecrets.getJavaIOFileDescriptorAccess();
static {
IOUtil.load();
}
/**
* Indicates if the dispatcher should first advance the file position
* to the end of file when writing.
*/
private final boolean append;
FileDispatcherImpl(boolean append) {
this.append = append;
}
FileDispatcherImpl() {
this(false);
}
@Override
@ -71,7 +63,7 @@ class FileDispatcherImpl extends FileDispatcher
}
int write(FileDescriptor fd, long address, int len) throws IOException {
return write0(fd, address, len, append);
return write0(fd, address, len, fdAccess.getAppend(fd));
}
int pwrite(FileDescriptor fd, long address, int len, long position)
@ -81,7 +73,7 @@ class FileDispatcherImpl extends FileDispatcher
}
long writev(FileDescriptor fd, long address, int len) throws IOException {
return writev0(fd, address, len, append);
return writev0(fd, address, len, fdAccess.getAppend(fd));
}
int force(FileDescriptor fd, boolean metaData) throws IOException {
@ -112,8 +104,6 @@ class FileDispatcherImpl extends FileDispatcher
FileDescriptor duplicateForMapping(FileDescriptor fd) throws IOException {
// on Windows we need to keep a handle to the file
JavaIOFileDescriptorAccess fdAccess =
SharedSecrets.getJavaIOFileDescriptorAccess();
FileDescriptor result = new FileDescriptor();
long handle = duplicateHandle(fdAccess.getHandle(fd));
fdAccess.setHandle(result, handle);

@ -160,7 +160,7 @@ class WindowsChannelFactory {
throw new IllegalArgumentException("APPEND + TRUNCATE_EXISTING not allowed");
FileDescriptor fdObj = open(pathForWindows, pathToCheck, flags, pSecurityDescriptor);
return FileChannelImpl.open(fdObj, pathForWindows, flags.read, flags.write, flags.append, null);
return FileChannelImpl.open(fdObj, pathForWindows, flags.read, flags.write, null);
}
/**
@ -339,6 +339,7 @@ class WindowsChannelFactory {
// create FileDescriptor and return
FileDescriptor fdObj = new FileDescriptor();
fdAccess.setHandle(fdObj, handle);
fdAccess.setAppend(fdObj, flags.append);
return fdObj;
}
}

@ -42,6 +42,9 @@ jfieldID IO_fd_fdID;
/* field id for jlong 'handle' in java.io.FileDescriptor */
jfieldID IO_handle_fdID;
/* field id for jboolean 'append' in java.io.FileDescriptor */
jfieldID IO_append_fdID;
/**************************************************************
* static methods to store field IDs in initializers
*/
@ -50,6 +53,7 @@ JNIEXPORT void JNICALL
Java_java_io_FileDescriptor_initIDs(JNIEnv *env, jclass fdClass) {
CHECK_NULL(IO_fd_fdID = (*env)->GetFieldID(env, fdClass, "fd", "I"));
CHECK_NULL(IO_handle_fdID = (*env)->GetFieldID(env, fdClass, "handle", "J"));
CHECK_NULL(IO_append_fdID = (*env)->GetFieldID(env, fdClass, "append", "Z"));
}
JNIEXPORT jlong JNICALL

@ -275,7 +275,15 @@ fileOpen(JNIEnv *env, jobject this, jstring path, jfieldID fid, int flags)
{
FD h = winFileHandleOpen(env, path, flags);
if (h >= 0) {
jobject fdobj;
jboolean append;
SET_FD(this, h, fid);
fdobj = (*env)->GetObjectField(env, this, fid);
if (fdobj != NULL) {
append = (flags & O_APPEND) == 0 ? JNI_FALSE : JNI_TRUE;
(*env)->SetBooleanField(env, fdobj, IO_append_fdID, append);
}
}
}

@ -62,7 +62,7 @@ public class AquaIcon {
if (w <= 0 || h <= 0) return null;
// This could be any kind of icon, so we need to make a buffer for it, draw it and then pass the new image off to appkit.
final BufferedImage image = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
final BufferedImage image = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB_PRE);
final Graphics g = image.getGraphics();
i.paintIcon(null, g, 0, 0);
g.dispose();

@ -129,7 +129,7 @@ public class AquaImageFactory {
};
final BufferedImage image = new BufferedImage(scaledAlertIconSize,
scaledAlertIconSize, BufferedImage.TYPE_INT_ARGB);
scaledAlertIconSize, BufferedImage.TYPE_INT_ARGB_PRE);
final Graphics g = image.getGraphics();
g.drawImage(background, 0, 0,
scaledAlertIconSize, scaledAlertIconSize, null);

@ -67,11 +67,12 @@ public class AquaNativeResources {
}
static BufferedImage getRadioButtonSizerImage() {
final BufferedImage img = new BufferedImage(20, 20, BufferedImage.TYPE_INT_ARGB);
final BufferedImage img = new BufferedImage(20, 20, BufferedImage.TYPE_INT_ARGB_PRE);
Graphics g = img.getGraphics();
g.setColor(Color.pink);
g.fillRect(0, 0, 20, 20);
g.dispose();
return img;
}

@ -676,6 +676,13 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
@Override // PlatformWindow
public void toFront() {
final long nsWindowPtr = getNSWindowPtr();
LWCToolkit lwcToolkit = (LWCToolkit) Toolkit.getDefaultToolkit();
Window w = DefaultKeyboardFocusManager.getCurrentKeyboardFocusManager().getActiveWindow();
if( w != null
&& ((LWWindowPeer)w.getPeer()).getPeerType() == LWWindowPeer.PeerType.EMBEDDED_FRAME
&& !lwcToolkit.isApplicationActive()) {
lwcToolkit.activateApplicationIgnoringOtherApps();
}
updateFocusabilityForAutoRequestFocus(false);
nativePushNSWindowToFront(nsWindowPtr);
updateFocusabilityForAutoRequestFocus(true);

@ -811,6 +811,11 @@ public final class LWCToolkit extends LWToolkit {
*/
public static native boolean isEmbedded();
/*
* Activates application ignoring other apps.
*/
public native void activateApplicationIgnoringOtherApps();
/************************
* Native methods section
************************/

@ -606,6 +606,23 @@ JNF_COCOA_EXIT(env);
return active;
}
/*
* Class: sun_lwawt_macosx_LWCToolkit
* Method: activateApplicationIgnoringOtherApps
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_sun_lwawt_macosx_LWCToolkit_activateApplicationIgnoringOtherApps
(JNIEnv *env, jclass clazz)
{
JNF_COCOA_ENTER(env);
[ThreadUtilities performOnMainThreadWaiting:NO block:^(){
if(![NSApp isActive]){
[NSApp activateIgnoringOtherApps:YES];
}
}];
JNF_COCOA_EXIT(env);
}
/*
* Class: sun_awt_SunToolkit

@ -0,0 +1,2 @@
# Provider for Java Print Service
sun.print.PrintServiceLookupProvider

@ -3696,7 +3696,7 @@ public class Container extends Component {
private void writeObject(ObjectOutputStream s) throws IOException {
ObjectOutputStream.PutField f = s.putFields();
f.put("ncomponents", component.size());
f.put("component", getComponentsSync());
f.put("component", component.toArray(EMPTY_ARRAY));
f.put("layoutMgr", layoutMgr);
f.put("dispatcher", dispatcher);
f.put("maxSize", maxSize);

@ -48,6 +48,7 @@ import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FilePermission;
import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectInputStream;
@ -1857,7 +1858,13 @@ public class ICC_Profile implements Serializable {
* returns null.
*/
private static InputStream getStandardProfileInputStream(String fileName) {
return PCMM.class.getResourceAsStream("profiles/" + fileName);
return AccessController.doPrivileged(
new PrivilegedAction<InputStream>() {
public InputStream run () {
return
PCMM.class.getResourceAsStream("profiles/" + fileName);
}
}, null, new FilePermission("<<ALL FILES>>", "read"));
}
/**

@ -35,7 +35,7 @@ import javax.swing.border.*;
* possible, this factory will hand out references to shared
* <code>Border</code> instances.
* For further information and examples see
* <a href="http://docs.oracle.com/javase/tutorial/uiswing/components/border.htmll">How
* <a href="http://docs.oracle.com/javase/tutorial/uiswing/components/border.html">How
to Use Borders</a>,
* a section in <em>The Java Tutorial</em>.
*

@ -126,7 +126,7 @@ import sun.swing.UIClientPropertyKey;
* that includes double buffering and support for borders.
* For more information see <a
* href="http://www.oracle.com/technetwork/java/painting-140037.html#swing">Painting</a> and
* <a href="http://docs.oracle.com/javase/tutorial/uiswing/components/border.htmll">How
* <a href="http://docs.oracle.com/javase/tutorial/uiswing/components/border.html">How
* to Use Borders</a>,
* both of which are sections in <em>The Java Tutorial</em>.
* </ul>

@ -1141,14 +1141,15 @@ public class JInternalFrame extends JComponent implements
/**
* Sets an image to be displayed in the titlebar of this internal frame (usually
* in the top-left corner).
* Some look and feels might not support displaying an icon in the titlebar.
*
* This image is not the <code>desktopIcon</code> object, which
* is the image displayed in the <code>JDesktop</code> when
* this internal frame is iconified.
*
* Passing <code>null</code> to this function is valid,
* but the look and feel
* can choose the
* appropriate behavior for that situation, such as displaying no icon
* but the look and feel can choose the appropriate behavior
* for that situation, such as displaying no icon
* or a default icon for the look and feel.
*
* @param icon the <code>Icon</code> to display in the title bar

@ -325,23 +325,37 @@ public final class JLayer<V extends Component>
}
/**
* A non-{@code null} border, or non-zero insets, isn't supported, to prevent the geometry
* of this component from becoming complex enough to inhibit
* subclassing of {@code LayerUI} class. To create a {@code JLayer} with a border,
* add it to a {@code JPanel} that has a border.
* <p>Note: If {@code border} is non-{@code null}, this
* method will throw an exception as borders are not supported on
* a {@code JLayer}.
* Delegates its functionality to the {@code getView().setBorder(Border)} method,
* if the view component is an instance of {@code javax.swing.JComponent},
* otherwise this method is a no-op.
*
* @param border the {@code Border} to set
* @exception IllegalArgumentException this method is not supported
* @param border the border to be rendered for the {@code view} component
* @see #getView()
* @see javax.swing.JComponent#setBorder(Border)
*/
public void setBorder(Border border) {
if (border != null) {
throw new IllegalArgumentException("JLayer.setBorder() not supported");
if (view instanceof JComponent) {
((JComponent)view).setBorder(border);
}
}
/**
* Delegates its functionality to the {@code getView().getBorder()} method,
* if the view component is an instance of {@code javax.swing.JComponent},
* otherwise returns {@code null}.
*
* @return the border object for the {@code view} component
* @see #getView()
* @see #setBorder
* @see javax.swing.JComponent#getBorder()
*/
public Border getBorder() {
if (view instanceof JComponent) {
return ((JComponent) view).getBorder();
}
return null;
}
/**
* This method is not supported by {@code JLayer}
* and always throws {@code UnsupportedOperationException}

@ -33,7 +33,7 @@ import java.awt.Component;
* Interface describing an object capable of rendering a border
* around the edges of a swing component.
* For examples of using borders see
* <a href="http://docs.oracle.com/javase/tutorial/uiswing/components/border.htmll">How to Use Borders</a>,
* <a href="http://docs.oracle.com/javase/tutorial/uiswing/components/border.html">How to Use Borders</a>,
* a section in <em>The Java Tutorial.</em>
* <p>
* In the Swing component set, borders supercede Insets as the

@ -40,10 +40,10 @@ provided by the look-and-feel being used.
Most of the Swing API is <em>not</em> thread safe.
For details, see
<a
href="http://java.sun.com/docs/books/tutorial/uiswing/overview/threads.html"
target="_top">Threads and Swing</a>,
href="http://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html"
target="_top">Concurrency in Swing</a>,
a section in
<em><a href="http://java.sun.com/docs/books/tutorial/"
<em><a href="http://docs.oracle.com/javase/tutorial/"
target="_top">The Java Tutorial</a></em>.
@ -51,7 +51,7 @@ target="_top">The Java Tutorial</a></em>.
For overviews, tutorials, examples, guides, and tool documentation, please see:
<ul>
<li><a href="http://java.sun.com/docs/books/tutorial/uiswing/misc/border.html"
<li><a href="http://docs.oracle.com/javase/tutorial/uiswing/components/border.html"
target="_top">How to Use Borders</a>,
a section in <em>The Java Tutorial</em>
</ul>

@ -33,7 +33,8 @@ import javax.swing.plaf.*;
import javax.swing.text.View;
import sun.swing.SwingUtilities2;
import sun.awt.AppContext;
import java.util.Enumeration;
import java.util.HashSet;
/**
* RadioButtonUI implementation for BasicRadioButtonUI
@ -53,6 +54,8 @@ public class BasicRadioButtonUI extends BasicToggleButtonUI
private final static String propertyPrefix = "RadioButton" + ".";
private KeyListener keyListener = null;
// ********************************
// Create PLAF
// ********************************
@ -74,6 +77,7 @@ public class BasicRadioButtonUI extends BasicToggleButtonUI
return radioButtonUI;
}
@Override
protected String getPropertyPrefix() {
return propertyPrefix;
}
@ -81,7 +85,8 @@ public class BasicRadioButtonUI extends BasicToggleButtonUI
// ********************************
// Install PLAF
// ********************************
protected void installDefaults(AbstractButton b){
@Override
protected void installDefaults(AbstractButton b) {
super.installDefaults(b);
if(!defaults_initialized) {
icon = UIManager.getIcon(getPropertyPrefix() + "icon");
@ -92,7 +97,8 @@ public class BasicRadioButtonUI extends BasicToggleButtonUI
// ********************************
// Uninstall PLAF
// ********************************
protected void uninstallDefaults(AbstractButton b){
@Override
protected void uninstallDefaults(AbstractButton b) {
super.uninstallDefaults(b);
defaults_initialized = false;
}
@ -106,6 +112,65 @@ public class BasicRadioButtonUI extends BasicToggleButtonUI
return icon;
}
// ********************************
// Install Listeners
// ********************************
@Override
protected void installListeners(AbstractButton button) {
super.installListeners(button);
// Only for JRadioButton
if (!(button instanceof JRadioButton))
return;
keyListener = createKeyListener();
button.addKeyListener(keyListener);
// Need to get traversal key event
button.setFocusTraversalKeysEnabled(false);
// Map actions to the arrow keys
button.getActionMap().put("Previous", new SelectPreviousBtn());
button.getActionMap().put("Next", new SelectNextBtn());
button.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).
put(KeyStroke.getKeyStroke("UP"), "Previous");
button.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).
put(KeyStroke.getKeyStroke("DOWN"), "Next");
button.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).
put(KeyStroke.getKeyStroke("LEFT"), "Previous");
button.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).
put(KeyStroke.getKeyStroke("RIGHT"), "Next");
}
// ********************************
// UnInstall Listeners
// ********************************
@Override
protected void uninstallListeners(AbstractButton button) {
super.uninstallListeners(button);
// Only for JRadioButton
if (!(button instanceof JRadioButton))
return;
// Unmap actions from the arrow keys
button.getActionMap().remove("Previous");
button.getActionMap().remove("Next");
button.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT)
.remove(KeyStroke.getKeyStroke("UP"));
button.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT)
.remove(KeyStroke.getKeyStroke("DOWN"));
button.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT)
.remove(KeyStroke.getKeyStroke("LEFT"));
button.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT)
.remove(KeyStroke.getKeyStroke("RIGHT"));
if (keyListener != null) {
button.removeKeyListener(keyListener);
keyListener = null;
}
}
/* These Dimensions/Rectangles are allocated once for all
* RadioButtonUI.paint() calls. Re-using rectangles
@ -121,6 +186,7 @@ public class BasicRadioButtonUI extends BasicToggleButtonUI
/**
* paint the radio button
*/
@Override
public synchronized void paint(Graphics g, JComponent c) {
AbstractButton b = (AbstractButton) c;
ButtonModel model = b.getModel();
@ -217,7 +283,7 @@ public class BasicRadioButtonUI extends BasicToggleButtonUI
* @param textRect bounds
* @param size the size of radio button
*/
protected void paintFocus(Graphics g, Rectangle textRect, Dimension size){
protected void paintFocus(Graphics g, Rectangle textRect, Dimension size) {
}
@ -235,6 +301,7 @@ public class BasicRadioButtonUI extends BasicToggleButtonUI
/**
* The preferred size of the radio button
*/
@Override
public Dimension getPreferredSize(JComponent c) {
if(c.getComponentCount() > 0) {
return null;
@ -280,4 +347,262 @@ public class BasicRadioButtonUI extends BasicToggleButtonUI
height += prefInsets.top + prefInsets.bottom;
return new Dimension(width, height);
}
/////////////////////////// Private functions ////////////////////////
/**
* Creates the key listener to handle tab navigation in JRadioButton Group.
*/
private KeyListener createKeyListener() {
if (keyListener == null) {
keyListener = new KeyHandler();
}
return keyListener;
}
private boolean isValidRadioButtonObj(Object obj) {
return ((obj instanceof JRadioButton) &&
((JRadioButton) obj).isVisible() &&
((JRadioButton) obj).isEnabled());
}
/**
* Select radio button based on "Previous" or "Next" operation
*
* @param event, the event object.
* @param next, indicate if it's next one
*/
private void selectRadioButton(ActionEvent event, boolean next) {
// Get the source of the event.
Object eventSrc = event.getSource();
// Check whether the source is JRadioButton, it so, whether it is visible
if (!isValidRadioButtonObj(eventSrc))
return;
ButtonGroupInfo btnGroupInfo = new ButtonGroupInfo((JRadioButton)eventSrc);
btnGroupInfo.selectNewButton(next);
}
/////////////////////////// Inner Classes ////////////////////////
@SuppressWarnings("serial")
private class SelectPreviousBtn extends AbstractAction {
public SelectPreviousBtn() {
super("Previous");
}
public void actionPerformed(ActionEvent e) {
BasicRadioButtonUI.this.selectRadioButton(e, false);
}
}
@SuppressWarnings("serial")
private class SelectNextBtn extends AbstractAction{
public SelectNextBtn() {
super("Next");
}
public void actionPerformed(ActionEvent e) {
BasicRadioButtonUI.this.selectRadioButton(e, true);
}
}
/**
* ButtonGroupInfo, used to get related info in button group
* for given radio button
*/
private class ButtonGroupInfo {
JRadioButton activeBtn = null;
JRadioButton firstBtn = null;
JRadioButton lastBtn = null;
JRadioButton previousBtn = null;
JRadioButton nextBtn = null;
HashSet<JRadioButton> btnsInGroup = null;
boolean srcFound = false;
public ButtonGroupInfo(JRadioButton btn) {
activeBtn = btn;
btnsInGroup = new HashSet<JRadioButton>();
}
// Check if given object is in the button group
boolean containsInGroup(Object obj){
return btnsInGroup.contains(obj);
}
// Check if the next object to gain focus belongs
// to the button group or not
Component getFocusTransferBaseComponent(boolean next){
Component focusBaseComp = activeBtn;
Window container = SwingUtilities.getWindowAncestor(activeBtn);
if (container != null) {
FocusTraversalPolicy policy = container.getFocusTraversalPolicy();
Component comp = next ? policy.getComponentAfter(container, activeBtn)
: policy.getComponentBefore(container, activeBtn);
// If next component in the button group, use last/first button as base focus
// otherwise, use the activeBtn as the base focus
if (containsInGroup(comp)) {
focusBaseComp = next ? lastBtn : firstBtn;
}
}
return focusBaseComp;
}
boolean getButtonGroupInfo() {
if (activeBtn == null)
return false;
btnsInGroup.clear();
// Get the button model from the source.
ButtonModel model = activeBtn.getModel();
if (!(model instanceof DefaultButtonModel))
return false;
// If the button model is DefaultButtonModel, and use it, otherwise return.
DefaultButtonModel bm = (DefaultButtonModel) model;
// get the ButtonGroup of the button from the button model
ButtonGroup group = bm.getGroup();
if (group == null)
return false;
// Get all the buttons in the group
Enumeration<AbstractButton> e = group.getElements();
if (e == null)
return false;
while (e.hasMoreElements()) {
AbstractButton curElement = e.nextElement();
if (!isValidRadioButtonObj(curElement))
continue;
btnsInGroup.add((JRadioButton) curElement);
// If firstBtn is not set yet, curElement is that first button
if (null == firstBtn)
firstBtn = (JRadioButton) curElement;
if (activeBtn == curElement)
srcFound = true;
else if (!srcFound) {
// The source has not been yet found and the current element
// is the last previousBtn
previousBtn = (JRadioButton) curElement;
} else if (nextBtn == null) {
// The source has been found and the current element
// is the next valid button of the list
nextBtn = (JRadioButton) curElement;
}
// Set new last "valid" JRadioButton of the list
lastBtn = (JRadioButton) curElement;
}
return true;
}
/**
* Find the new radio button that focus needs to be
* moved to in the group, select the button
*
* @param next, indicate if it's arrow up/left or down/right
*/
void selectNewButton(boolean next) {
if (!getButtonGroupInfo())
return;
if (srcFound) {
JRadioButton newSelectedBtn = null;
if (next) {
// Select Next button. Cycle to the first button if the source
// button is the last of the group.
newSelectedBtn = (null == nextBtn) ? firstBtn : nextBtn;
} else {
// Select previous button. Cycle to the last button if the source
// button is the first button of the group.
newSelectedBtn = (null == previousBtn) ? lastBtn : previousBtn;
}
if (newSelectedBtn != null &&
(newSelectedBtn != activeBtn)) {
newSelectedBtn.requestFocusInWindow();
newSelectedBtn.setSelected(true);
}
}
}
/**
* Find the button group the passed in JRadioButton belongs to, and
* move focus to next component of the last button in the group
* or previous component of first button
*
* @param next, indicate if jump to next component or previous
*/
void jumpToNextComponent(boolean next) {
if (!getButtonGroupInfo()){
// In case the button does not belong to any group, it needs
// to be treated as a component
if (activeBtn != null){
lastBtn = activeBtn;
firstBtn = activeBtn;
}
else
return;
}
// Update the component we will use as base to transfer
// focus from
JComponent compTransferFocusFrom = activeBtn;
// If next component in the parent window is not in
// the button group, current active button will be
// base, otherwise, the base will be first or last
// button in the button group
Component focusBase = getFocusTransferBaseComponent(next);
if (focusBase != null){
if (next) {
KeyboardFocusManager.
getCurrentKeyboardFocusManager().focusNextComponent(focusBase);
} else {
KeyboardFocusManager.
getCurrentKeyboardFocusManager().focusPreviousComponent(focusBase);
}
}
}
}
/**
* Radiobutton KeyListener
*/
private class KeyHandler implements KeyListener {
// This listener checks if the key event is a KeyEvent.VK_TAB
// or shift + KeyEvent.VK_TAB event on a radio button, consume the event
// if so and move the focus to next/previous component
public void keyPressed(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_TAB) {
// Get the source of the event.
Object eventSrc = e.getSource();
// Check whether the source is a visible and enabled JRadioButton
if (isValidRadioButtonObj(eventSrc)) {
e.consume();
ButtonGroupInfo btnGroupInfo = new ButtonGroupInfo((JRadioButton)eventSrc);
btnGroupInfo.jumpToNextComponent(!e.isShiftDown());
}
}
}
public void keyReleased(KeyEvent e) {
}
public void keyTyped(KeyEvent e) {
}
}
}

@ -3249,6 +3249,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants {
}
}
tabScroller.tabPanel.setPreferredSize(new Dimension(totalWidth, totalHeight));
tabScroller.tabPanel.invalidate();
}
}
@ -3622,6 +3623,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants {
setFocusIndex(tabPane.getSelectedIndex(), false);
if (scrollableTabLayoutEnabled()) {
ensureCurrentLayout();
int index = tabPane.getSelectedIndex();
if (index < rects.length && index != -1) {
tabScroller.tabPanel.scrollRectToVisible(

@ -1400,8 +1400,13 @@ public class HTMLDocument extends DefaultStyledDocument {
Element parent = elem.getParentElement();
if (parent != null) {
// If we are going to insert the string into the body
// section, it is necessary to set the corrsponding flag.
if (HTML.Tag.BODY.name.equals(parent.getName())) {
insertInBody = true;
}
int offset = elem.getEndOffset();
if (offset > getLength()) {
if (offset > (getLength() + 1)) {
offset--;
}
else if (elem.isLeaf() && getText(offset - 1, 1).
@ -1409,6 +1414,10 @@ public class HTMLDocument extends DefaultStyledDocument {
offset--;
}
insertHTML(parent, offset, htmlText, false);
// Cleanup the flag, if any.
if (insertInBody) {
insertInBody = false;
}
}
}
}
@ -1846,6 +1855,11 @@ public class HTMLDocument extends DefaultStyledDocument {
private static char[] NEWLINE;
/**
* Indicates that direct insertion to body section takes place.
*/
private boolean insertInBody = false;
/**
* I18N property key.
*
@ -2610,7 +2624,9 @@ public class HTMLDocument extends DefaultStyledDocument {
// Assume content should be added.
foundInsertTag(false);
foundInsertTag = true;
inParagraph = impliedP = true;
// If content is added directly to the body, it should
// be wrapped by p-implied.
inParagraph = impliedP = !insertInBody;
}
if (data.length >= 1) {
addContent(data, 0, data.length);

@ -47,7 +47,7 @@ import sun.java2d.pipe.RenderQueue;
import static sun.java2d.pipe.BufferedOpCodes.*;
import java.lang.annotation.Native;
class OGLBlitLoops {
final class OGLBlitLoops {
static void register() {
Blit blitIntArgbPreToSurface =
@ -56,7 +56,9 @@ class OGLBlitLoops {
Blit blitIntArgbPreToTexture =
new OGLSwToTextureBlit(SurfaceType.IntArgbPre,
OGLSurfaceData.PF_INT_ARGB_PRE);
TransformBlit transformBlitIntArgbPreToSurface =
new OGLSwToSurfaceTransform(SurfaceType.IntArgbPre,
OGLSurfaceData.PF_INT_ARGB_PRE);
GraphicsPrimitive[] primitives = {
// surface->surface ops
new OGLSurfaceToSurfaceBlit(),
@ -100,7 +102,7 @@ class OGLBlitLoops {
CompositeType.AnyAlpha,
blitIntArgbPreToSurface),
new OGLAnyCompositeBlit(OGLSurfaceData.OpenGLSurface),
new OGLAnyCompositeBlit(),
new OGLSwToSurfaceScale(SurfaceType.IntRgb,
OGLSurfaceData.PF_INT_RGB),
@ -145,8 +147,9 @@ class OGLBlitLoops {
OGLSurfaceData.PF_BYTE_GRAY),
new OGLSwToSurfaceTransform(SurfaceType.UshortGray,
OGLSurfaceData.PF_USHORT_GRAY),
new OGLSwToSurfaceTransform(SurfaceType.IntArgbPre,
OGLSurfaceData.PF_INT_ARGB_PRE),
transformBlitIntArgbPreToSurface,
new OGLGeneralTransformedBlit(transformBlitIntArgbPreToSurface),
// texture->surface ops
new OGLTextureToSurfaceBlit(),
@ -178,9 +181,6 @@ class OGLBlitLoops {
new OGLGeneralBlit(OGLSurfaceData.OpenGLTexture,
CompositeType.SrcNoEa,
blitIntArgbPreToTexture),
new OGLAnyCompositeBlit(OGLSurfaceData.OpenGLTexture),
};
GraphicsPrimitiveMgr.register(primitives);
}
@ -781,11 +781,11 @@ class OGLTextureToSurfaceTransform extends TransformBlit {
* This general Blit implementation converts any source surface to an
* intermediate IntArgbPre surface, and then uses the more specific
* IntArgbPre->OpenGLSurface/Texture loop to get the intermediate
* (premultiplied) surface down to OpenGL.
* (premultiplied) surface down to OpenGL using simple blit.
*/
class OGLGeneralBlit extends Blit {
private Blit performop;
private final Blit performop;
private WeakReference<SurfaceData> srcTmp;
OGLGeneralBlit(SurfaceType dstType,
@ -826,12 +826,56 @@ class OGLGeneralBlit extends Blit {
}
}
class OGLAnyCompositeBlit extends Blit {
/**
* This general TransformedBlit implementation converts any source surface to an
* intermediate IntArgbPre surface, and then uses the more specific
* IntArgbPre->OpenGLSurface/Texture loop to get the intermediate
* (premultiplied) surface down to OpenGL using simple transformBlit.
*/
final class OGLGeneralTransformedBlit extends TransformBlit {
private final TransformBlit performop;
private WeakReference<SurfaceData> srcTmp;
OGLGeneralTransformedBlit(final TransformBlit performop) {
super(SurfaceType.Any, CompositeType.AnyAlpha,
OGLSurfaceData.OpenGLSurface);
this.performop = performop;
}
@Override
public synchronized void Transform(SurfaceData src, SurfaceData dst,
Composite comp, Region clip,
AffineTransform at, int hint, int srcx,
int srcy, int dstx, int dsty, int width,
int height){
Blit convertsrc = Blit.getFromCache(src.getSurfaceType(),
CompositeType.SrcNoEa,
SurfaceType.IntArgbPre);
// use cached intermediate surface, if available
final SurfaceData cachedSrc = srcTmp != null ? srcTmp.get() : null;
// convert source to IntArgbPre
src = convertFrom(convertsrc, src, srcx, srcy, width, height, cachedSrc,
BufferedImage.TYPE_INT_ARGB_PRE);
// transform IntArgbPre intermediate surface to OpenGL surface
performop.Transform(src, dst, comp, clip, at, hint, 0, 0, dstx, dsty,
width, height);
if (src != cachedSrc) {
// cache the intermediate surface
srcTmp = new WeakReference<>(src);
}
}
}
final class OGLAnyCompositeBlit extends Blit {
private WeakReference<SurfaceData> dstTmp;
public OGLAnyCompositeBlit(SurfaceType dstType) {
super(SurfaceType.Any, CompositeType.Any, dstType);
OGLAnyCompositeBlit() {
super(SurfaceType.Any, CompositeType.Any, OGLSurfaceData.OpenGLSurface);
}
public synchronized void Blit(SurfaceData src, SurfaceData dst,
Composite comp, Region clip,
int sx, int sy, int dx, int dy,
@ -848,15 +892,15 @@ class OGLAnyCompositeBlit extends Blit {
cachedDst = dstTmp.get();
}
// convert source to IntArgbPre
// convert destination to IntArgbPre
SurfaceData dstBuffer = convertFrom(convertdst, dst, dx, dy, w, h,
cachedDst, BufferedImage.TYPE_INT_ARGB_PRE);
Region bufferClip =
clip == null ? null : clip.getTranslatedRegion(-dx, -dy);
Blit performop = Blit.getFromCache(src.getSurfaceType(),
CompositeType.Any, dstBuffer.getSurfaceType());
performop.Blit(src, dstBuffer, comp, clip,
sx, sy, 0, 0, w, h);
performop.Blit(src, dstBuffer, comp, bufferClip, sx, sy, 0, 0, w, h);
if (dstBuffer != cachedDst) {
// cache the intermediate surface

@ -1,2 +0,0 @@
# Provider for Java Print Service
sun.print.UnixPrintServiceLookup

@ -595,8 +595,13 @@ final class XWM
return isNetWMName("Mutter") || isNetWMName("GNOME Shell");
}
static int awtWMNonReparenting = -1;
static boolean isNonReparentingWM() {
return (XWM.getWMID() == XWM.COMPIZ_WM || XWM.getWMID() == XWM.LG3D_WM || XWM.getWMID() == XWM.CWM_WM);
if (awtWMNonReparenting == -1) {
awtWMNonReparenting = (XToolkit.getEnv("_JAVA_AWT_WM_NONREPARENTING") != null) ? 1 : 0;
}
return (awtWMNonReparenting == 1 || XWM.getWMID() == XWM.COMPIZ_WM
|| XWM.getWMID() == XWM.LG3D_WM || XWM.getWMID() == XWM.CWM_WM);
}
/*

@ -324,8 +324,8 @@ public class CUPSPrinter {
* reported, exec lpstat -d which has all the Apple
* special behaviour for this built in.
*/
if (UnixPrintServiceLookup.isMac()) {
printerInfo[0] = UnixPrintServiceLookup.
if (PrintServiceLookupProvider.isMac()) {
printerInfo[0] = PrintServiceLookupProvider.
getDefaultPrinterNameSysV();
printerInfo[1] = null;
return printerInfo.clone();

@ -1047,7 +1047,7 @@ public class IPPPrintService implements PrintService, SunPrinterJobService {
setting like collation. Therefore, we temporarily exclude
Linux.
*/
if (!UnixPrintServiceLookup.isLinux()) {
if (!PrintServiceLookupProvider.isLinux()) {
catList.add(SheetCollate.class);
}
}
@ -1641,7 +1641,7 @@ public class IPPPrintService implements PrintService, SunPrinterJobService {
* Mac is using printer-info IPP attribute for its human-readable printer
* name and is also the identifier used in NSPrintInfo:setPrinter.
*/
if (UnixPrintServiceLookup.isMac()) {
if (PrintServiceLookupProvider.isMac()) {
PrintServiceAttributeSet psaSet = this.getAttributes();
if (psaSet != null) {
PrinterInfo pName = (PrinterInfo)psaSet.get(PrinterInfo.class);

@ -58,7 +58,7 @@ import java.nio.file.Files;
* Remind: This class uses solaris commands. We also need a linux
* version
*/
public class UnixPrintServiceLookup extends PrintServiceLookup
public class PrintServiceLookupProvider extends PrintServiceLookup
implements BackgroundServiceLookup, Runnable {
/* Remind: the current implementation is static, as its assumed
@ -70,7 +70,7 @@ public class UnixPrintServiceLookup extends PrintServiceLookup
private PrintService defaultPrintService;
private PrintService[] printServices; /* includes the default printer */
private Vector<BackgroundLookupListener> lookupListeners = null;
private static String debugPrefix = "UnixPrintServiceLookup>> ";
private static String debugPrefix = "PrintServiceLookupProvider>> ";
private static boolean pollServices = true;
private static final int DEFAULT_MINREFRESH = 120; // 2 minutes
private static int minRefreshTime = DEFAULT_MINREFRESH;
@ -208,7 +208,7 @@ public class UnixPrintServiceLookup extends PrintServiceLookup
}
public UnixPrintServiceLookup() {
public PrintServiceLookupProvider() {
// start the printer listener thread
if (pollServices) {
PrinterChangeListener thr = new PrinterChangeListener();

@ -122,7 +122,7 @@ public class UnixPrintJob implements CancelablePrintJob {
UnixPrintJob(PrintService service) {
this.service = service;
mDestination = service.getName();
if (UnixPrintServiceLookup.isMac()) {
if (PrintServiceLookupProvider.isMac()) {
mDestination = ((IPPPrintService)service).getDest();
}
mDestType = UnixPrintJob.DESTPRINTER;
@ -880,7 +880,7 @@ public class UnixPrintJob implements CancelablePrintJob {
pFlags |= NOSHEET;
ncomps+=1;
}
if (UnixPrintServiceLookup.osname.equals("SunOS")) {
if (PrintServiceLookupProvider.osname.equals("SunOS")) {
ncomps+=1; // lp uses 1 more arg than lpr (make a copy)
execCmd = new String[ncomps];
execCmd[n++] = "/usr/bin/lp";

@ -220,7 +220,7 @@ public class UnixPrintService implements PrintService, AttributeUpdater,
private PrinterIsAcceptingJobs getPrinterIsAcceptingJobsSysV() {
String command = "/usr/bin/lpstat -a " + printer;
String results[]= UnixPrintServiceLookup.execCmd(command);
String results[]= PrintServiceLookupProvider.execCmd(command);
if (results != null && results.length > 0) {
if (results[0].startsWith(printer + " accepting requests")) {
@ -244,20 +244,20 @@ public class UnixPrintService implements PrintService, AttributeUpdater,
}
private PrinterIsAcceptingJobs getPrinterIsAcceptingJobsBSD() {
if (UnixPrintServiceLookup.cmdIndex ==
UnixPrintServiceLookup.UNINITIALIZED) {
if (PrintServiceLookupProvider.cmdIndex ==
PrintServiceLookupProvider.UNINITIALIZED) {
UnixPrintServiceLookup.cmdIndex =
UnixPrintServiceLookup.getBSDCommandIndex();
PrintServiceLookupProvider.cmdIndex =
PrintServiceLookupProvider.getBSDCommandIndex();
}
String command = "/usr/sbin/lpc status " + printer
+ lpcStatusCom[UnixPrintServiceLookup.cmdIndex];
String results[]= UnixPrintServiceLookup.execCmd(command);
+ lpcStatusCom[PrintServiceLookupProvider.cmdIndex];
String results[]= PrintServiceLookupProvider.execCmd(command);
if (results != null && results.length > 0) {
if (UnixPrintServiceLookup.cmdIndex ==
UnixPrintServiceLookup.BSD_LPD_NG) {
if (PrintServiceLookupProvider.cmdIndex ==
PrintServiceLookupProvider.BSD_LPD_NG) {
if (results[0].startsWith("enabled enabled")) {
return PrinterIsAcceptingJobs.ACCEPTING_JOBS ;
}
@ -276,7 +276,7 @@ public class UnixPrintService implements PrintService, AttributeUpdater,
// Filter the list of possible AIX Printers and remove header lines
// and extra lines which have been added for remote printers.
// 'protected' because this method is also used from UnixPrintServiceLookup.
// 'protected' because this method is also used from PrintServiceLookupProvider.
protected static String[] filterPrinterNamesAIX(String[] posPrinters) {
ArrayList<String> printers = new ArrayList<>();
String [] splitPart;
@ -301,7 +301,7 @@ public class UnixPrintService implements PrintService, AttributeUpdater,
private PrinterIsAcceptingJobs getPrinterIsAcceptingJobsAIX() {
// On AIX there should not be a blank after '-a'.
String command = "/usr/bin/lpstat -a" + printer;
String results[]= UnixPrintServiceLookup.execCmd(command);
String results[]= PrintServiceLookupProvider.execCmd(command);
// Remove headers and bogus entries added by remote printers.
results = filterPrinterNamesAIX(results);
@ -320,11 +320,11 @@ public class UnixPrintService implements PrintService, AttributeUpdater,
}
private PrinterIsAcceptingJobs getPrinterIsAcceptingJobs() {
if (UnixPrintServiceLookup.isSysV()) {
if (PrintServiceLookupProvider.isSysV()) {
return getPrinterIsAcceptingJobsSysV();
} else if (UnixPrintServiceLookup.isBSD()) {
} else if (PrintServiceLookupProvider.isBSD()) {
return getPrinterIsAcceptingJobsBSD();
} else if (UnixPrintServiceLookup.isAIX()) {
} else if (PrintServiceLookupProvider.isAIX()) {
return getPrinterIsAcceptingJobsAIX();
} else {
return PrinterIsAcceptingJobs.ACCEPTING_JOBS;
@ -351,29 +351,29 @@ public class UnixPrintService implements PrintService, AttributeUpdater,
private QueuedJobCount getQueuedJobCountSysV() {
String command = "/usr/bin/lpstat -R " + printer;
String results[]= UnixPrintServiceLookup.execCmd(command);
String results[]= PrintServiceLookupProvider.execCmd(command);
int qlen = (results == null) ? 0 : results.length;
return new QueuedJobCount(qlen);
}
private QueuedJobCount getQueuedJobCountBSD() {
if (UnixPrintServiceLookup.cmdIndex ==
UnixPrintServiceLookup.UNINITIALIZED) {
if (PrintServiceLookupProvider.cmdIndex ==
PrintServiceLookupProvider.UNINITIALIZED) {
UnixPrintServiceLookup.cmdIndex =
UnixPrintServiceLookup.getBSDCommandIndex();
PrintServiceLookupProvider.cmdIndex =
PrintServiceLookupProvider.getBSDCommandIndex();
}
int qlen = 0;
String command = "/usr/sbin/lpc status " + printer
+ lpcQueueCom[UnixPrintServiceLookup.cmdIndex];
String results[] = UnixPrintServiceLookup.execCmd(command);
+ lpcQueueCom[PrintServiceLookupProvider.cmdIndex];
String results[] = PrintServiceLookupProvider.execCmd(command);
if (results != null && results.length > 0) {
String queued;
if (UnixPrintServiceLookup.cmdIndex ==
UnixPrintServiceLookup.BSD_LPD_NG) {
if (PrintServiceLookupProvider.cmdIndex ==
PrintServiceLookupProvider.BSD_LPD_NG) {
queued = results[0];
} else {
queued = results[3].trim();
@ -396,7 +396,7 @@ public class UnixPrintService implements PrintService, AttributeUpdater,
private QueuedJobCount getQueuedJobCountAIX() {
// On AIX there should not be a blank after '-a'.
String command = "/usr/bin/lpstat -a" + printer;
String results[]= UnixPrintServiceLookup.execCmd(command);
String results[]= PrintServiceLookupProvider.execCmd(command);
// Remove headers and bogus entries added by remote printers.
results = filterPrinterNamesAIX(results);
@ -413,11 +413,11 @@ public class UnixPrintService implements PrintService, AttributeUpdater,
}
private QueuedJobCount getQueuedJobCount() {
if (UnixPrintServiceLookup.isSysV()) {
if (PrintServiceLookupProvider.isSysV()) {
return getQueuedJobCountSysV();
} else if (UnixPrintServiceLookup.isBSD()) {
} else if (PrintServiceLookupProvider.isBSD()) {
return getQueuedJobCountBSD();
} else if (UnixPrintServiceLookup.isAIX()) {
} else if (PrintServiceLookupProvider.isAIX()) {
return getQueuedJobCountAIX();
} else {
return new QueuedJobCount(0);
@ -468,9 +468,9 @@ public class UnixPrintService implements PrintService, AttributeUpdater,
}
private PrintServiceAttributeSet getDynamicAttributes() {
if (UnixPrintServiceLookup.isSysV()) {
if (PrintServiceLookupProvider.isSysV()) {
return getSysVServiceAttributes();
} else if (UnixPrintServiceLookup.isAIX()) {
} else if (PrintServiceLookupProvider.isAIX()) {
return getAIXServiceAttributes();
} else {
return getBSDServiceAttributes();

@ -398,8 +398,8 @@ GLXGC_FindBestVisual(JNIEnv *env, jint screen)
static GLXPbuffer
GLXGC_InitScratchPbuffer(GLXFBConfig fbconfig)
{
int pbattrlist[] = {GLX_PBUFFER_WIDTH, 1,
GLX_PBUFFER_HEIGHT, 1,
int pbattrlist[] = {GLX_PBUFFER_WIDTH, 4,
GLX_PBUFFER_HEIGHT, 4,
GLX_PRESERVED_CONTENTS, GL_FALSE,
0};

@ -1,2 +0,0 @@
# Provider for Java Print Service
sun.print.Win32PrintServiceLookup

@ -1,2 +0,0 @@
# Providers for Java 2D/JPS Stream print services.
sun.print.PSStreamPrinterFactory

@ -1400,7 +1400,9 @@ final class WPathGraphics extends PathGraphics {
* The saved device transform is needed as the current transform
* is not likely to be the same.
*/
deviceClip(savedClip.getPathIterator(savedTransform));
if (savedClip != null) {
deviceClip(savedClip.getPathIterator(savedTransform));
}
/* Scale the bounding rectangle by the scale transform.
* Because the scaling transform has only x and y

@ -93,7 +93,7 @@ import sun.print.SunAlternateMedia;
import sun.print.SunPageSelection;
import sun.print.Win32MediaTray;
import sun.print.Win32PrintService;
import sun.print.Win32PrintServiceLookup;
import sun.print.PrintServiceLookupProvider;
import sun.print.ServiceDialog;
import sun.print.DialogOwner;
@ -454,7 +454,7 @@ public final class WPrinterJob extends RasterPrinterJob
// native printer is different !
// we update the current PrintService
try {
setPrintService(Win32PrintServiceLookup.
setPrintService(PrintServiceLookupProvider.
getWin32PrintLUS().
getPrintServiceByName(printerName));
} catch (PrinterException e) {
@ -628,7 +628,7 @@ public final class WPrinterJob extends RasterPrinterJob
String printerName = getNativePrintService();
if (printerName != null) {
myService = Win32PrintServiceLookup.getWin32PrintLUS().
myService = PrintServiceLookupProvider.getWin32PrintLUS().
getPrintServiceByName(printerName);
// no need to call setNativePrintService as this name is
// currently set in native

@ -47,7 +47,7 @@ import javax.print.attribute.PrintServiceAttribute;
import javax.print.attribute.PrintServiceAttributeSet;
import javax.print.attribute.standard.PrinterName;
public class Win32PrintServiceLookup extends PrintServiceLookup {
public class PrintServiceLookupProvider extends PrintServiceLookup {
private String defaultPrinter;
private PrintService defaultPrintService;
@ -70,10 +70,10 @@ public class Win32PrintServiceLookup extends PrintServiceLookup {
* javax.print.PrintServiceLookup.defaultPrintService() so that the
* same instance is stored there.
*/
private static Win32PrintServiceLookup win32PrintLUS;
private static PrintServiceLookupProvider win32PrintLUS;
/* Think carefully before calling this. Preferably don't call it. */
public static Win32PrintServiceLookup getWin32PrintLUS() {
public static PrintServiceLookupProvider getWin32PrintLUS() {
if (win32PrintLUS == null) {
/* This call is internally synchronized.
* When it returns an instance of this class will have
@ -84,7 +84,7 @@ public class Win32PrintServiceLookup extends PrintServiceLookup {
return win32PrintLUS;
}
public Win32PrintServiceLookup() {
public PrintServiceLookupProvider() {
if (win32PrintLUS == null) {
win32PrintLUS = this;

@ -68,7 +68,7 @@ static BOOL IsSupportedLevel(HANDLE hPrinter, DWORD dwLevel) {
extern "C" {
JNIEXPORT jstring JNICALL
Java_sun_print_Win32PrintServiceLookup_getDefaultPrinterName(JNIEnv *env,
Java_sun_print_PrintServiceLookupProvider_getDefaultPrinterName(JNIEnv *env,
jobject peer)
{
TRY;
@ -119,7 +119,7 @@ Java_sun_print_Win32PrintServiceLookup_getDefaultPrinterName(JNIEnv *env,
JNIEXPORT jobjectArray JNICALL
Java_sun_print_Win32PrintServiceLookup_getAllPrinterNames(JNIEnv *env,
Java_sun_print_PrintServiceLookupProvider_getAllPrinterNames(JNIEnv *env,
jobject peer)
{
TRY;
@ -176,7 +176,7 @@ Java_sun_print_Win32PrintServiceLookup_getAllPrinterNames(JNIEnv *env,
JNIEXPORT jlong JNICALL
Java_sun_print_Win32PrintServiceLookup_notifyFirstPrinterChange(JNIEnv *env,
Java_sun_print_PrintServiceLookupProvider_notifyFirstPrinterChange(JNIEnv *env,
jobject peer,
jstring printer) {
HANDLE hPrinter;
@ -210,7 +210,7 @@ Java_sun_print_Win32PrintServiceLookup_notifyFirstPrinterChange(JNIEnv *env,
JNIEXPORT void JNICALL
Java_sun_print_Win32PrintServiceLookup_notifyClosePrinterChange(JNIEnv *env,
Java_sun_print_PrintServiceLookupProvider_notifyClosePrinterChange(JNIEnv *env,
jobject peer,
jlong chgObject) {
FindClosePrinterChangeNotification((HANDLE)chgObject);
@ -218,7 +218,7 @@ Java_sun_print_Win32PrintServiceLookup_notifyClosePrinterChange(JNIEnv *env,
JNIEXPORT jint JNICALL
Java_sun_print_Win32PrintServiceLookup_notifyPrinterChange(JNIEnv *env,
Java_sun_print_PrintServiceLookupProvider_notifyPrinterChange(JNIEnv *env,
jobject peer,
jlong chgObject) {
DWORD dwChange;

@ -771,6 +771,17 @@ BOOL AwtPrintControl::InitPrintDialog(JNIEnv *env,
jint maxPage = env->CallIntMethod(printCtrl,
AwtPrintControl::getMaxPageID);
pd.nMaxPage = (maxPage <= (jint)((WORD)-1)) ? (WORD)maxPage : (WORD)-1;
// In the event that the application displays the dialog before
// installing a Printable, but sets a page range, then max page will be 1
// since the default state of a PrinterJob is an empty "Book" Pageable.
// Windows pops up an error dialog in such a case which isn't very
// forthcoming about the exact problem.
// So if we detect this fix up such a problem here.
if (pd.nMinPage > pd.nFromPage) pd.nMinPage = pd.nFromPage;
if (pd.nMaxPage < pd.nToPage) pd.nMaxPage = pd.nToPage;
if (pd.nFromPage > pd.nMinPage || pd.nToPage < pd.nMaxPage) {
pd.Flags |= PD_PAGENUMS;
}
if (env->CallBooleanMethod(printCtrl,
AwtPrintControl::getDestID)) {

@ -47,7 +47,7 @@ import javax.management.MBeanServerFactory;
* <code>DefaultLoaderRepository</code> be rewritten.</p>
*
* @deprecated Use
* {@link javax.management.MBeanServer#getClassLoaderRepository()}}
* {@link javax.management.MBeanServer#getClassLoaderRepository()}
* instead.
*
* @since 1.5

@ -803,8 +803,10 @@ public class RowSetMetaDataImpl implements RowSetMetaData, Serializable {
* @throws SQLException if a database access error occurs
* or the given column number is out of bounds
*/
public boolean isDefinitelyWritable(int columnIndex)
throws SQLException { return true;}
public boolean isDefinitelyWritable(int columnIndex) throws SQLException {
checkColRange(columnIndex);
return true;
}
/**
* Retrieves the fully-qualified name of the class in the Java

@ -140,7 +140,8 @@ public final class KeychainStore extends KeyStoreSpi {
* password to recover it.
*
* @param alias the alias name
* @param password the password for recovering the key
* @param password the password for recovering the key. This password is
* used internally as the key is exported in a PKCS12 format.
*
* @return the requested key, or null if the given alias does not exist
* or does not identify a <i>key entry</i>.
@ -155,6 +156,20 @@ public final class KeychainStore extends KeyStoreSpi {
{
permissionCheck();
// An empty password is rejected by MacOS API, no private key data
// is exported. If no password is passed (as is the case when
// this implementation is used as browser keystore in various
// deployment scenarios like Webstart, JFX and applets), create
// a dummy password so MacOS API is happy.
if (password == null || password.length == 0) {
// Must not be a char array with only a 0, as this is an empty
// string.
if (random == null) {
random = new SecureRandom();
}
password = Long.toString(random.nextLong()).toCharArray();
}
Object entry = entries.get(alias.toLowerCase());
if (entry == null || !(entry instanceof KeyEntry)) {

@ -829,7 +829,7 @@ public final class TimeZoneNames_de extends TimeZoneNamesBundle {
{"Europe/Madrid", CET},
{"Europe/Malta", CET},
{"Europe/Mariehamn", EET},
{"Europe/Minsk", FET},
{"Europe/Minsk", MSK},
{"Europe/Monaco", CET},
{"Europe/Moscow", MSK},
{"Europe/Nicosia", EET},
@ -917,6 +917,9 @@ public final class TimeZoneNames_de extends TimeZoneNamesBundle {
{"PRT", AST},
{"Pacific/Apia", WST_SAMOA},
{"Pacific/Auckland", NZST},
{"Pacific/Bougainville", new String[] {"Bougainville Standard Time", "BST",
"Bougainville Daylight Time", "BST",
"Bougainville Time", "BT"}},
{"Pacific/Chatham", CHAST},
{"Pacific/Chuuk", CHUT},
{"Pacific/Easter", EASTER},

@ -829,7 +829,7 @@ public final class TimeZoneNames_es extends TimeZoneNamesBundle {
{"Europe/Madrid", CET},
{"Europe/Malta", CET},
{"Europe/Mariehamn", EET},
{"Europe/Minsk", FET},
{"Europe/Minsk", MSK},
{"Europe/Monaco", CET},
{"Europe/Moscow", MSK},
{"Europe/Nicosia", EET},
@ -917,6 +917,9 @@ public final class TimeZoneNames_es extends TimeZoneNamesBundle {
{"PRT", AST},
{"Pacific/Apia", WST_SAMOA},
{"Pacific/Auckland", NZST},
{"Pacific/Bougainville", new String[] {"Bougainville Standard Time", "BST",
"Bougainville Daylight Time", "BST",
"Bougainville Time", "BT"}},
{"Pacific/Chatham", CHAST},
{"Pacific/Chuuk", CHUT},
{"Pacific/Easter", EASTER},

@ -829,7 +829,7 @@ public final class TimeZoneNames_fr extends TimeZoneNamesBundle {
{"Europe/Madrid", CET},
{"Europe/Malta", CET},
{"Europe/Mariehamn", EET},
{"Europe/Minsk", FET},
{"Europe/Minsk", MSK},
{"Europe/Monaco", CET},
{"Europe/Moscow", MSK},
{"Europe/Nicosia", EET},
@ -917,6 +917,9 @@ public final class TimeZoneNames_fr extends TimeZoneNamesBundle {
{"PRT", AST},
{"Pacific/Apia", WST_SAMOA},
{"Pacific/Auckland", NZST},
{"Pacific/Bougainville", new String[] {"Bougainville Standard Time", "BST",
"Bougainville Daylight Time", "BST",
"Bougainville Time", "BT"}},
{"Pacific/Chatham", CHAST},
{"Pacific/Chuuk", CHUT},
{"Pacific/Easter", EASTER},

@ -829,7 +829,7 @@ public final class TimeZoneNames_it extends TimeZoneNamesBundle {
{"Europe/Madrid", CET},
{"Europe/Malta", CET},
{"Europe/Mariehamn", EET},
{"Europe/Minsk", FET},
{"Europe/Minsk", MSK},
{"Europe/Monaco", CET},
{"Europe/Moscow", MSK},
{"Europe/Nicosia", EET},
@ -917,6 +917,9 @@ public final class TimeZoneNames_it extends TimeZoneNamesBundle {
{"PRT", AST},
{"Pacific/Apia", WST_SAMOA},
{"Pacific/Auckland", NZST},
{"Pacific/Bougainville", new String[] {"Bougainville Standard Time", "BST",
"Bougainville Daylight Time", "BST",
"Bougainville Time", "BT"}},
{"Pacific/Chatham", CHAST},
{"Pacific/Chuuk", CHUT},
{"Pacific/Easter", EASTER},

@ -829,7 +829,7 @@ public final class TimeZoneNames_ja extends TimeZoneNamesBundle {
{"Europe/Madrid", CET},
{"Europe/Malta", CET},
{"Europe/Mariehamn", EET},
{"Europe/Minsk", FET},
{"Europe/Minsk", MSK},
{"Europe/Monaco", CET},
{"Europe/Moscow", MSK},
{"Europe/Nicosia", EET},
@ -917,6 +917,9 @@ public final class TimeZoneNames_ja extends TimeZoneNamesBundle {
{"PRT", AST},
{"Pacific/Apia", WST_SAMOA},
{"Pacific/Auckland", NZST},
{"Pacific/Bougainville", new String[] {"Bougainville Standard Time", "BST",
"Bougainville Daylight Time", "BST",
"Bougainville Time", "BT"}},
{"Pacific/Chatham", CHAST},
{"Pacific/Chuuk", CHUT},
{"Pacific/Easter", EASTER},

@ -829,7 +829,7 @@ public final class TimeZoneNames_ko extends TimeZoneNamesBundle {
{"Europe/Madrid", CET},
{"Europe/Malta", CET},
{"Europe/Mariehamn", EET},
{"Europe/Minsk", FET},
{"Europe/Minsk", MSK},
{"Europe/Monaco", CET},
{"Europe/Moscow", MSK},
{"Europe/Nicosia", EET},
@ -917,6 +917,9 @@ public final class TimeZoneNames_ko extends TimeZoneNamesBundle {
{"PRT", AST},
{"Pacific/Apia", WST_SAMOA},
{"Pacific/Auckland", NZST},
{"Pacific/Bougainville", new String[] {"Bougainville Standard Time", "BST",
"Bougainville Daylight Time", "BST",
"Bougainville Time", "BT"}},
{"Pacific/Chatham", CHAST},
{"Pacific/Chuuk", CHUT},
{"Pacific/Easter", EASTER},

@ -829,7 +829,7 @@ public final class TimeZoneNames_pt_BR extends TimeZoneNamesBundle {
{"Europe/Madrid", CET},
{"Europe/Malta", CET},
{"Europe/Mariehamn", EET},
{"Europe/Minsk", FET},
{"Europe/Minsk", MSK},
{"Europe/Monaco", CET},
{"Europe/Moscow", MSK},
{"Europe/Nicosia", EET},
@ -917,6 +917,9 @@ public final class TimeZoneNames_pt_BR extends TimeZoneNamesBundle {
{"PRT", AST},
{"Pacific/Apia", WST_SAMOA},
{"Pacific/Auckland", NZST},
{"Pacific/Bougainville", new String[] {"Bougainville Standard Time", "BST",
"Bougainville Daylight Time", "BST",
"Bougainville Time", "BT"}},
{"Pacific/Chatham", CHAST},
{"Pacific/Chuuk", TRUT},
{"Pacific/Easter", EASTER},

@ -829,7 +829,7 @@ public final class TimeZoneNames_sv extends TimeZoneNamesBundle {
{"Europe/Madrid", CET},
{"Europe/Malta", CET},
{"Europe/Mariehamn", EET},
{"Europe/Minsk", FET},
{"Europe/Minsk", MSK},
{"Europe/Monaco", CET},
{"Europe/Moscow", MSK},
{"Europe/Nicosia", EET},
@ -917,6 +917,9 @@ public final class TimeZoneNames_sv extends TimeZoneNamesBundle {
{"PRT", AST},
{"Pacific/Apia", WST_SAMOA},
{"Pacific/Auckland", NZST},
{"Pacific/Bougainville", new String[] {"Bougainville Standard Time", "BST",
"Bougainville Daylight Time", "BST",
"Bougainville Time", "BT"}},
{"Pacific/Chatham", CHAST},
{"Pacific/Chuuk", CHUT},
{"Pacific/Easter", EASTER},

@ -829,7 +829,7 @@ public final class TimeZoneNames_zh_CN extends TimeZoneNamesBundle {
{"Europe/Madrid", CET},
{"Europe/Malta", CET},
{"Europe/Mariehamn", EET},
{"Europe/Minsk", FET},
{"Europe/Minsk", MSK},
{"Europe/Monaco", CET},
{"Europe/Moscow", MSK},
{"Europe/Nicosia", EET},
@ -917,6 +917,9 @@ public final class TimeZoneNames_zh_CN extends TimeZoneNamesBundle {
{"PRT", AST},
{"Pacific/Apia", WST_SAMOA},
{"Pacific/Auckland", NZST},
{"Pacific/Bougainville", new String[] {"Bougainville Standard Time", "BST",
"Bougainville Daylight Time", "BST",
"Bougainville Time", "BT"}},
{"Pacific/Chatham", CHAST},
{"Pacific/Chuuk", CHUT},
{"Pacific/Easter", EASTER},

@ -831,7 +831,7 @@ public final class TimeZoneNames_zh_TW extends TimeZoneNamesBundle {
{"Europe/Madrid", CET},
{"Europe/Malta", CET},
{"Europe/Mariehamn", EET},
{"Europe/Minsk", FET},
{"Europe/Minsk", MSK},
{"Europe/Monaco", CET},
{"Europe/Moscow", MSK},
{"Europe/Nicosia", EET},
@ -919,6 +919,9 @@ public final class TimeZoneNames_zh_TW extends TimeZoneNamesBundle {
{"PRT", AST},
{"Pacific/Apia", WST_SAMOA},
{"Pacific/Auckland", NZST},
{"Pacific/Bougainville", new String[] {"Bougainville Standard Time", "BST",
"Bougainville Daylight Time", "BST",
"Bougainville Time", "BT"}},
{"Pacific/Chatham", CHAST},
{"Pacific/Chuuk", CHUT},
{"Pacific/Easter", EASTER},

@ -200,6 +200,9 @@ java/nio/file/WatchService/LotsOfEvents.java solaris-all
# jdk_rmi
# 7140992
java/rmi/server/Unreferenced/finiteGCLatency/FiniteGCLatency.java generic-all
# 7146541
java/rmi/transport/rapidExportUnexport/RapidExportUnexport.java linux-all

@ -12,3 +12,6 @@ exclusiveAccess.dirs=java/rmi/Naming java/util/prefs sun/management/jmxremote su
# Group definitions
groups=TEST.groups [closed/TEST.groups]
# Tests using jtreg 4.1 b10 features
requiredVersion=4.1 b10

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