提交 5b856e6d 编写于 作者: A asaha

Merge

...@@ -571,6 +571,7 @@ c44179bce874a97e93ffd7b76a226af417e017a4 jdk8u77-b03 ...@@ -571,6 +571,7 @@ c44179bce874a97e93ffd7b76a226af417e017a4 jdk8u77-b03
71f59a00df6c8f3bd5c6d6631a4988a431adab56 jdk8u91-b00 71f59a00df6c8f3bd5c6d6631a4988a431adab56 jdk8u91-b00
7ade7a1ab10ff893f62cce9440b4a839aa19c250 jdk8u91-b13 7ade7a1ab10ff893f62cce9440b4a839aa19c250 jdk8u91-b13
f8725698a870b6be82fad578e78a55910b259975 jdk8u91-b14 f8725698a870b6be82fad578e78a55910b259975 jdk8u91-b14
29380f4d81bd92a6a7aa7a984ca4541ff3ac3a67 jdk8u91-b15
39baa472e20c13c0eb1243eb5dce589e82f78143 jdk8u76-b00 39baa472e20c13c0eb1243eb5dce589e82f78143 jdk8u76-b00
6ea3aea950d19d803475b3f4d704a2942e71b302 jdk8u76-b01 6ea3aea950d19d803475b3f4d704a2942e71b302 jdk8u76-b01
4de4cffb5988cd68959ce4bbd14c6d4547078c91 jdk8u76-b02 4de4cffb5988cd68959ce4bbd14c6d4547078c91 jdk8u76-b02
...@@ -592,4 +593,32 @@ f6cc9dbb5db5883385c91bb71ca02081220aaf3d jdk8u81-b00 ...@@ -592,4 +593,32 @@ f6cc9dbb5db5883385c91bb71ca02081220aaf3d jdk8u81-b00
00f8f39308687cde45f23282871c46cc6c2f10b3 jdk8u101-b01 00f8f39308687cde45f23282871c46cc6c2f10b3 jdk8u101-b01
6042757c329b1b96fa6bc931e09306794f5c50c0 jdk8u101-b02 6042757c329b1b96fa6bc931e09306794f5c50c0 jdk8u101-b02
25934d0d38fe10383ff22eb3f39bf5e8b9e73ac9 jdk8u101-b03 25934d0d38fe10383ff22eb3f39bf5e8b9e73ac9 jdk8u101-b03
ebc56c2e803597ef409a5296addc986b390d934d jdk8u101-b04
c387bd2fb7db40467bd9aa803c8510a04ca32bae jdk8u101-b05
a15cdf2e91e7c2d71510280b31ae11048fb2f31e jdk8u101-b06
fdc0b30af431e17ffaed24ef5d545ae4cf7ddf6d jdk8u101-b07
4dc4099e933a6f4584b51305b26b5798f042699b jdk8u101-b08
5e7489ac05f0001e234e6d1c8730b465e74c9626 jdk8u101-b09
9486707c119ab3940f7ea06c1af23a4f6367c77b jdk8u101-b10
a9136f8d24d9ed01009df847176e0be67b354d15 jdk8u101-b11
3eab3ce82c31d1332bc383a1a3201eaee220c001 jdk8u101-b12
39baa472e20c13c0eb1243eb5dce589e82f78143 jdk8u76-b00
6ea3aea950d19d803475b3f4d704a2942e71b302 jdk8u76-b01
4de4cffb5988cd68959ce4bbd14c6d4547078c91 jdk8u76-b02
8bef978e2374604f449b4d1d7f90cb26618540d7 jdk8u76-b03
e057622070e5415c13b6d8511b97dce8bd2e398d jdk8u76-b04
fa5a91b29658aa9eb7aff54ae34898c149ff7149 jdk8u102-b00
fa5a91b29658aa9eb7aff54ae34898c149ff7149 jdk8u82-b00
569e105bed3c517a47f0f1ebce0abcaf776a8e89 jdk8u102-b01
5d5b55014d0da5bafb42366dc6d668ced4b8dec4 jdk8u102-b02
abab8d5270997ad25e0699151eed48ce8db40787 jdk8u102-b03
50809de3dcc24eb8cf86b8518cf0cc0423b61f4b jdk8u102-b04
cdfb600c2dce889af220ebb6c4b0764066baa741 jdk8u102-b05
59698da7972e97f4a18845b9c879f165b3c52e98 jdk8u102-b06
725b400c93e0209c64f36f6191b8d1fd3ef9ed30 jdk8u102-b07
c260a0aab5bff09f439914829b81f037715029bb jdk8u102-b08
605340e782425b68342c1bc6485b747708de6101 jdk8u102-b09
b64716a25e409798fcd7ed6143d55681ee4a4baa jdk8u102-b10
e915a408ebf7ba05b36d1b714e166a1d9e5c7edd jdk8u102-b11
8e12cb096db33b525ec010de5e857ef1cc985ddd jdk8u102-b12
ebc56c2e803597ef409a5296addc986b390d934d jdk8u111-b00 ebc56c2e803597ef409a5296addc986b390d934d jdk8u111-b00
# #
# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
...@@ -190,7 +190,11 @@ ifdef OPENJDK ...@@ -190,7 +190,11 @@ ifdef OPENJDK
SRC_SERVICES_FILES := $(filter-out %sun/java2d/cmm/kcms/META-INF/services/sun.java2d.cmm.CMMServiceProvider, $(SRC_SERVICES_FILES)) SRC_SERVICES_FILES := $(filter-out %sun/java2d/cmm/kcms/META-INF/services/sun.java2d.cmm.CMMServiceProvider, $(SRC_SERVICES_FILES))
else else
SRC_SERVICES_FILES := $(filter-out %sun/java2d/pisces/META-INF/services/sun.java2d.pipe.RenderingEngine, $(SRC_SERVICES_FILES)) SRC_SERVICES_FILES := $(filter-out %sun/java2d/pisces/META-INF/services/sun.java2d.pipe.RenderingEngine, $(SRC_SERVICES_FILES))
ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH), linux-sparc)
SRC_SERVICES_FILES := $(filter-out %sun/java2d/cmm/kcms/META-INF/services/sun.java2d.cmm.CMMServiceProvider, $(SRC_SERVICES_FILES))
else
SRC_SERVICES_FILES := $(filter-out %sun/java2d/cmm/lcms/META-INF/services/sun.java2d.cmm.CMMServiceProvider, $(SRC_SERVICES_FILES)) SRC_SERVICES_FILES := $(filter-out %sun/java2d/cmm/lcms/META-INF/services/sun.java2d.cmm.CMMServiceProvider, $(SRC_SERVICES_FILES))
endif
endif endif
# The number of services files are relatively few. If the increase in numbers, then # The number of services files are relatively few. If the increase in numbers, then
......
...@@ -21,4 +21,4 @@ ...@@ -21,4 +21,4 @@
# or visit www.oracle.com if you need additional information or have any # or visit www.oracle.com if you need additional information or have any
# questions. # questions.
# #
tzdata2016a tzdata2016d
...@@ -102,13 +102,9 @@ Rule E-EurAsia 1979 1995 - Sep lastSun 0:00 0 - ...@@ -102,13 +102,9 @@ Rule E-EurAsia 1979 1995 - Sep lastSun 0:00 0 -
Rule E-EurAsia 1996 max - Oct lastSun 0:00 0 - Rule E-EurAsia 1996 max - Oct lastSun 0:00 0 -
Rule RussiaAsia 1981 1984 - Apr 1 0:00 1:00 S Rule RussiaAsia 1981 1984 - Apr 1 0:00 1:00 S
Rule RussiaAsia 1981 1983 - Oct 1 0:00 0 - Rule RussiaAsia 1981 1983 - Oct 1 0:00 0 -
Rule RussiaAsia 1984 1991 - Sep lastSun 2:00s 0 - Rule RussiaAsia 1984 1995 - Sep lastSun 2:00s 0 -
Rule RussiaAsia 1985 1991 - Mar lastSun 2:00s 1:00 S Rule RussiaAsia 1985 2011 - Mar lastSun 2:00s 1:00 S
Rule RussiaAsia 1992 only - Mar lastSat 23:00 1:00 S Rule RussiaAsia 1996 2011 - Oct lastSun 2:00s 0 -
Rule RussiaAsia 1992 only - Sep lastSat 23:00 0 -
Rule RussiaAsia 1993 max - Mar lastSun 2:00s 1:00 S
Rule RussiaAsia 1993 1995 - Sep lastSun 2:00s 0 -
Rule RussiaAsia 1996 max - Oct lastSun 2:00s 0 -
# Afghanistan # Afghanistan
# Zone NAME GMTOFF RULES FORMAT [UNTIL] # Zone NAME GMTOFF RULES FORMAT [UNTIL]
...@@ -148,17 +144,26 @@ Zone Asia/Yerevan 2:58:00 - LMT 1924 May 2 ...@@ -148,17 +144,26 @@ Zone Asia/Yerevan 2:58:00 - LMT 1924 May 2
3:00 1:00 YERST 1991 Sep 23 # independence 3:00 1:00 YERST 1991 Sep 23 # independence
3:00 RussiaAsia AM%sT 1995 Sep 24 2:00s 3:00 RussiaAsia AM%sT 1995 Sep 24 2:00s
4:00 - AMT 1997 4:00 - AMT 1997
4:00 RussiaAsia AM%sT 2012 Mar 25 2:00s 4:00 RussiaAsia AM%sT 2012 Feb 9
4:00 - AMT 4:00 - AMT
# Azerbaijan # Azerbaijan
# From Rustam Aliyev of the Azerbaijan Internet Forum (2005-10-23): # From Rustam Aliyev of the Azerbaijan Internet Forum (2005-10-23):
# According to the resolution of Cabinet of Ministers, 1997 # According to the resolution of Cabinet of Ministers, 1997
# From Paul Eggert (2015-09-17): It was Resolution No. 21 (1997-03-17). # From Paul Eggert (2015-09-17): It was Resolution No. 21 (1997-03-17).
# http://code.az/files/daylight_res.pdf # http://code.az/files/daylight_res.pdf
# From Steffen Thorsen (2016-03-17):
# ... the Azerbaijani Cabinet of Ministers has cancelled switching to
# daylight saving time....
# http://www.azernews.az/azerbaijan/94137.html
# http://vestnikkavkaza.net/news/Azerbaijani-Cabinet-of-Ministers-cancels-daylight-saving-time.html
# http://en.apa.az/xeber_azerbaijan_abolishes_daylight_savings_ti_240862.html
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Azer 1997 max - Mar lastSun 4:00 1:00 S Rule Azer 1997 2015 - Mar lastSun 4:00 1:00 S
Rule Azer 1997 max - Oct lastSun 5:00 0 - Rule Azer 1997 2015 - Oct lastSun 5:00 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL] # Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Baku 3:19:24 - LMT 1924 May 2 Zone Asia/Baku 3:19:24 - LMT 1924 May 2
3:00 - BAKT 1957 Mar # Baku Time 3:00 - BAKT 1957 Mar # Baku Time
...@@ -1581,23 +1586,6 @@ Zone Asia/Amman 2:23:44 - LMT 1931 ...@@ -1581,23 +1586,6 @@ Zone Asia/Amman 2:23:44 - LMT 1931
# Kazakhstan # Kazakhstan
# From Paul Eggert (1996-11-22):
# Andrew Evtichov (1996-04-13) writes that Kazakhstan
# stayed in sync with Moscow after 1990, and that Aqtobe (formerly Aktyubinsk)
# and Aqtau (formerly Shevchenko) are the largest cities in their zones.
# Guess that Aqtau and Aqtobe diverged in 1995, since that's the first time
# IATA SSIM mentions a third time zone in Kazakhstan.
# From Paul Eggert (2006-03-22):
# German Iofis, ELSI, Almaty (2001-10-09) reports that Kazakhstan uses
# RussiaAsia rules, instead of switching at 00:00 as the IATA has it.
# Go with Shanks & Pottenger, who have them always using RussiaAsia rules.
# Also go with the following claims of Shanks & Pottenger:
#
# - Kazakhstan did not observe DST in 1991.
# - Qyzylorda switched from +5:00 to +6:00 on 1992-01-19 02:00.
# - Oral switched from +5:00 to +4:00 in spring 1989.
# From Kazakhstan Embassy's News Bulletin No. 11 # From Kazakhstan Embassy's News Bulletin No. 11
# <http://www.kazsociety.org.uk/news/2005/03/30.htm> (2005-03-21): # <http://www.kazsociety.org.uk/news/2005/03/30.htm> (2005-03-21):
# The Government of Kazakhstan passed a resolution March 15 abolishing # The Government of Kazakhstan passed a resolution March 15 abolishing
...@@ -1614,61 +1602,232 @@ Zone Asia/Amman 2:23:44 - LMT 1931 ...@@ -1614,61 +1602,232 @@ Zone Asia/Amman 2:23:44 - LMT 1931
# everything else.... I guess that would make Kazakhstan time zones # everything else.... I guess that would make Kazakhstan time zones
# de jure UTC+5 and UTC+6 respectively. # de jure UTC+5 and UTC+6 respectively.
# From Stepan Golosunov (2016-03-27) ([*] means see later comments below):
# Review of the linked documents from http://adilet.zan.kz/
# produced the following data for post-1991 Kazakhstan:
#
# 0. Act of the Cabinet of Ministers of the USSR
# from 1991-02-04 No. 20
# http://pravo.gov.ru/proxy/ips/?docbody=&nd=102010545
# removed the extra hour ("decree time") on the territory of the USSR
# starting with the last Sunday of March 1991.
# It also allowed (but not mandated) Kazakh SSR, Kirghiz SSR, Tajik SSR,
# Turkmen SSR and Uzbek SSR to not have "summer" time.
#
# The 1992-01-13 act also refers to the act of the Cabinet of Ministers
# of the Kazakh SSR from 1991-03-20 No. 170 "About the act of the Cabinet
# of Ministers of the USSR from 1991-02-04 No. 20" but I didn't found its
# text.
#
# According to Izvestia newspaper No. 68 (23334) from 1991-03-20
# (page 6; available at http://libinfo.org/newsr/newsr2574.djvu via
# http://libinfo.org/index.php?id=58564) on 1991-03-31 at 2:00 during
# transition to "summer" time:
# Republic of Georgia, Latvian SSR, Lithuanian SSR, SSR Moldova,
# Estonian SSR; Komi ASSR; Kaliningrad oblast; Nenets autonomous okrug
# were to move clocks 1 hour forward.
# Kazakh SSR (excluding Uralsk oblast); Republic of Kyrgyzstan, Tajik
# SSR; Andijan, Jizzakh, Namangan, Sirdarya, Tashkent, Fergana oblasts
# of the Uzbek SSR were to move clocks 1 hour backwards.
# Other territories were to not move clocks.
# When the "summer" time would end on 1991-09-29, clocks were to be
# moved 1 hour backwards on the territory of the USSR excluding
# Kazakhstan, Kirghizia, Uzbekistan, Turkmenia, Tajikistan.
#
# Apparently there were last minute changes. Apparently Kazakh act No. 170
# was one of such changes.
#
# https://ru.wikipedia.org/wiki/Декретное время
# claims that Sovetskaya Rossiya newspaper on 1991-03-29 published that
# Nenets autonomous okrug, Komi and Kazakhstan (excluding Uralsk oblast)
# were to not move clocks and Uralsk oblast was to move clocks
# forward; on 1991-09-29 Kazakhstan was to move clocks backwards.
# (Probably there were changes even after that publication. There is an
# article claiming that Kaliningrad oblast decided on 1991-03-29 to not
# move clocks.)
#
# This implies that on 1991-03-31 Asia/Oral remained on +04/+05 while
# the rest of Kazakhstan switched from +06/+07 to +05/06 or from +05/06
# to +04/+05. It's unclear how Kzyl-Orda oblast moved into the fifth
# time belt. (By switching from +04/+05 to +05/+06 on 1991-09-29?) ...
#
# 1. Act of the Cabinet of Ministers of the Republic of Kazakhstan
# from 1992-01-13 No. 28
# http://adilet.zan.kz/rus/docs/P920000028_
# (text includes modification from the 1996 act)
# introduced new rules for calculation of time, mirroring Russian
# 1992-01-08 act. It specified that time would be calculated
# according to time belts plus extra hour ("decree time"), moved clocks
# on the whole territory of Kazakhstan 1 hour forward on 1992-01-19 at
# 2:00, specified DST rules. It acknowledged that Kazakhstan was
# located in the fourth and the fifth time belts and specified the
# border between them to be located east of Kustanay and Aktyubinsk
# oblasts (notably including Turgai and Kzyl-Orda oblasts into the fifth
# time belt).
#
# This means switch on 1992-01-19 at 2:00 from +04/+05 to +05/+06 for
# Asia/Aqtau, Asia/Aqtobe, Asia/Oral, Atyrau and Kustanay oblasts; from
# +05/+06 to +06/+07 for Asia/Almaty and Asia/Qyzylorda (and Arkalyk) [*]....
#
# 2. Act of the Cabinet of Ministers of the Republic of Kazakhstan
# from 1992-03-27 No. 284
# http://adilet.zan.kz/rus/docs/P920000284_
# cancels extra hour ("decree time") for Uralsk and Kzyl-Orda oblasts
# since the last Sunday of March 1992, while keeping them in the fourth
# and the fifth time belts respectively.
#
# 3. Order of the Prime Minister of the Republic of Kazakhstan
# from 1994-09-23 No. 384
# http://adilet.zan.kz/rus/docs/R940000384_
# cancels the extra hour ("decree time") on the territory of Mangystau
# oblast since the last Sunday of September 1994 (saying that time on
# the territory would correspond to the third time belt as a
# result)....
#
# 4. Act of the Government of the Republic of Kazakhstan
# from 1996-05-08 No. 575
# http://adilet.zan.kz/rus/docs/P960000575_
# amends the 1992-01-13 act to end summer time in October instead
# of September, mirroring identical Russian change from 1996-04-23 act.
#
# 5. Act of the Government of the Republic of Kazakhstan
# from 1999-03-26 No. 305
# http://adilet.zan.kz/rus/docs/P990000305_
# cancels the extra hour ("decree time") for Atyrau oblast since the
# last Sunday of March 1999 while retaining the oblast in the fourth
# time belt.
#
# This means change from +05/+06 to +04/+05.
#
# There is no zone for Atyrau currently (listed under Asia/Aqtau in
# zone1970.tab).[*]
#
# 6. Act of the Government of the Republic of Kazakhstan
# from 2000-11-23 No. 1749
# http://adilet.zan.kz/rus/archive/docs/P000001749_/23.11.2000
# replaces the previous five documents.
#
# The only changes I noticed are in definition of the border between the
# fourth and the fifth time belts. They account for changes in spelling
# and administrative division (splitting of Turgai oblast in 1997
# probably changed time in territories incorporated into Kostanay oblast
# (including Arkalyk) from +06/+07 to +05/+06) and move Kyzylorda oblast
# from being in the fifth time belt and not using decree time into the
# fourth time belt (no change in practice).[*]
#
# 7. Act of the Government of the Republic of Kazakhstan
# from 2003-12-29 No. 1342
# http://adilet.zan.kz/rus/docs/P030001342_
# modified the 2000-11-23 act. No relevant changes, apparently.
#
# 8. Act of the Government of the Republic of Kazakhstan
# from 2004-07-20 No. 775
# http://adilet.zan.kz/rus/archive/docs/P040000775_/20.07.2004
# modified the 2000-11-23 act to move Kostanay and Kyzylorda oblasts into
# the fifth time belt and add Aktobe oblast to the list of regions not
# using extra hour ("decree time"), leaving Kazakhstan with only 2 time
# zones (+04/+05 and +06/+07). The changes were to be implemented
# during DST transitions in 2004 and 2005 but the acts got radically
# amended before implementation happened.
#
# 9. Act of the Government of the Republic of Kazakhstan
# from 2004-09-15 No. 1059
# http://adilet.zan.kz/rus/docs/P040001059_
# modified the 2000-11-23 act to remove exceptions from the "decree time"
# (leaving Kazakhstan in +05/+06 and +06/+07 zones), amended the
# 2004-07-20 act to implement changes for Atyrau, West Kazakhstan,
# Kostanay, Kyzylorda and Mangystau oblasts by not moving clocks
# during the 2014 transition to "winter" time.
#
# This means transition from +04/+05 to +05/+06 for Atyrau oblast (no
# zone currently), Asia/Oral, Asia/Aqtau and transition from +05/+06 to
# +06/+07 for Kostanay oblast (Kostanay and Arkalyk, no zones currently)
# and Asia/Qyzylorda on 2004-10-31 at 3:00....[*]
#
# 10. Act of the Government of the Republic of Kazakhstan
# from 2005-03-15 No. 231
# http://adilet.zan.kz/rus/docs/P050000231_
# removes DST provisions from the 2000-11-23 act, removes most of the
# (already implemented) provisions from the 2004-07-20 and 2004-09-15
# acts, comes into effect 10 days after official publication.
# The only practical effect seems to be the abolition of the summer
# time.
#
# Unamended version of the act of the Government of the Russian Federation
# No. 23 from 1992-01-08 [See 'europe' file for details].
# Kazakh 1992-01-13 act appears to provide the same rules and 1992-03-27
# act was to be enacted on the last Sunday of March 1992.
# From Paul Eggert (2016-04-15):
# The tables below should reflect Stepan Golosunov's remarks above,
# except for the items marked "[*]" which I haven't gotten to yet.
# It looks like we will need new zones Asia/Atyrau and Asia/Qostanay
# to handle changes from 1992 through 2004 that we did not previously
# know about.
# #
# Zone NAME GMTOFF RULES FORMAT [UNTIL] # Zone NAME GMTOFF RULES FORMAT [UNTIL]
# #
# Almaty (formerly Alma-Ata), representing most locations in Kazakhstan # Almaty (formerly Alma-Ata), representing most locations in Kazakhstan
# This includes KZ-AKM, KZ-ALA, KZ-ALM, KZ-AST, KZ-BAY, KZ-VOS, KZ-ZHA,
# KZ-KAR, KZ-SEV, KZ-PAV, and KZ-YUZ.
Zone Asia/Almaty 5:07:48 - LMT 1924 May 2 # or Alma-Ata Zone Asia/Almaty 5:07:48 - LMT 1924 May 2 # or Alma-Ata
5:00 - ALMT 1930 Jun 21 # Alma-Ata Time 5:00 - +05 1930 Jun 21
6:00 RussiaAsia ALM%sT 1991 6:00 RussiaAsia +06/+07 1991 Mar 31 2:00s
6:00 - ALMT 1992 5:00 RussiaAsia +05/+06 1992 Jan 19 2:00s
6:00 RussiaAsia ALM%sT 2005 Mar 15 6:00 RussiaAsia +06/+07 2004 Oct 31 2:00s
6:00 - ALMT 6:00 - +06
# Qyzylorda (aka Kyzylorda, Kizilorda, Kzyl-Orda, etc.) # Qyzylorda (aka Kyzylorda, Kizilorda, Kzyl-Orda, etc.) (KZ-KZY)
Zone Asia/Qyzylorda 4:21:52 - LMT 1924 May 2 Zone Asia/Qyzylorda 4:21:52 - LMT 1924 May 2
4:00 - KIZT 1930 Jun 21 # Kizilorda Time 4:00 - +04 1930 Jun 21
5:00 - KIZT 1981 Apr 1 5:00 - +05 1981 Apr 1
5:00 1:00 KIZST 1981 Oct 1 5:00 1:00 +06 1981 Oct 1
6:00 - KIZT 1982 Apr 1 6:00 - +06 1982 Apr 1
5:00 RussiaAsia KIZ%sT 1991 5:00 RussiaAsia +05/+06 1991 Mar 31 2:00s
5:00 - KIZT 1991 Dec 16 # independence 4:00 RussiaAsia +04/+05 1991 Sep 29 2:00s
5:00 - QYZT 1992 Jan 19 2:00 5:00 RussiaAsia +05/+06 1992 Jan 19 2:00s
6:00 RussiaAsia QYZ%sT 2005 Mar 15 6:00 RussiaAsia +06/+07 1992 Mar 29 2:00s
6:00 - QYZT 5:00 RussiaAsia +05/+06 2004 Oct 31 2:00s
# Aqtobe (aka Aktobe, formerly Aktyubinsk) 6:00 - +06
# Aqtobe (aka Aktobe, formerly Aktyubinsk) (KZ-AKT)
Zone Asia/Aqtobe 3:48:40 - LMT 1924 May 2 Zone Asia/Aqtobe 3:48:40 - LMT 1924 May 2
4:00 - AKTT 1930 Jun 21 # Aktyubinsk Time 4:00 - +04 1930 Jun 21
5:00 - AKTT 1981 Apr 1 5:00 - +05 1981 Apr 1
5:00 1:00 AKTST 1981 Oct 1 5:00 1:00 +06 1981 Oct 1
6:00 - AKTT 1982 Apr 1 6:00 - +06 1982 Apr 1
5:00 RussiaAsia AKT%sT 1991 5:00 RussiaAsia +05/+06 1991 Mar 31 2:00s
5:00 - AKTT 1991 Dec 16 # independence 4:00 RussiaAsia +04/+05 1992 Jan 19 2:00s
5:00 RussiaAsia AQT%sT 2005 Mar 15 # Aqtobe Time 5:00 RussiaAsia +05/+06 2004 Oct 31 2:00s
5:00 - AQTT 5:00 - +05
# Mangghystau # Qostanay (KZ-KUS)
# Mangghystau (KZ-MAN)
# Aqtau was not founded until 1963, but it represents an inhabited region, # Aqtau was not founded until 1963, but it represents an inhabited region,
# so include time stamps before 1963. # so include time stamps before 1963.
Zone Asia/Aqtau 3:21:04 - LMT 1924 May 2 Zone Asia/Aqtau 3:21:04 - LMT 1924 May 2
4:00 - FORT 1930 Jun 21 # Fort Shevchenko T 4:00 - +04 1930 Jun 21
5:00 - FORT 1963 5:00 - +05 1963
5:00 - SHET 1981 Oct 1 # Shevchenko Time 5:00 - +05 1981 Oct 1
6:00 - SHET 1982 Apr 1 6:00 - +06 1982 Apr 1
5:00 RussiaAsia SHE%sT 1991 5:00 RussiaAsia +05/+06 1991 Mar 31 2:00s
5:00 - SHET 1991 Dec 16 # independence 4:00 RussiaAsia +04/+05 1992 Jan 19 2:00s
5:00 RussiaAsia AQT%sT 1995 Mar lastSun 2:00 # Aqtau Time 5:00 RussiaAsia +05/+06 1994 Sep 25 2:00s
4:00 RussiaAsia AQT%sT 2005 Mar 15 4:00 RussiaAsia +04/+05 2004 Oct 31 2:00s
5:00 - AQTT 5:00 - +05
# West Kazakhstan
# West Kazakhstan (KZ-ZAP)
# From Paul Eggert (2016-03-18):
# The 1989 transition is from USSR act No. 227 (1989-03-14).
Zone Asia/Oral 3:25:24 - LMT 1924 May 2 # or Ural'sk Zone Asia/Oral 3:25:24 - LMT 1924 May 2 # or Ural'sk
4:00 - URAT 1930 Jun 21 # Ural'sk time 4:00 - +04 1930 Jun 21
5:00 - URAT 1981 Apr 1 5:00 - +05 1981 Apr 1
5:00 1:00 URAST 1981 Oct 1 5:00 1:00 +06 1981 Oct 1
6:00 - URAT 1982 Apr 1 6:00 - +06 1982 Apr 1
5:00 RussiaAsia URA%sT 1989 Mar 26 2:00 5:00 RussiaAsia +05/+06 1989 Mar 26 2:00s
4:00 RussiaAsia URA%sT 1991 4:00 RussiaAsia +04/+05 1992 Jan 19 2:00s
4:00 - URAT 1991 Dec 16 # independence 5:00 RussiaAsia +05/+06 1992 Mar 29 2:00s
4:00 RussiaAsia ORA%sT 2005 Mar 15 # Oral Time 4:00 RussiaAsia +04/+05 2004 Oct 31 2:00s
5:00 - ORAT 5:00 - +05
# Kyrgyzstan (Kirgizstan) # Kyrgyzstan (Kirgizstan)
# Transitions through 1991 are from Shanks & Pottenger. # Transitions through 1991 are from Shanks & Pottenger.
...@@ -2419,6 +2578,16 @@ Zone Asia/Karachi 4:28:12 - LMT 1907 ...@@ -2419,6 +2578,16 @@ Zone Asia/Karachi 4:28:12 - LMT 1907
# http://www.timeanddate.com/time/change/gaza-strip/gaza # http://www.timeanddate.com/time/change/gaza-strip/gaza
# http://www.timeanddate.com/time/change/west-bank/hebron # http://www.timeanddate.com/time/change/west-bank/hebron
# From Hannah Kreitem (2016-03-09):
# http://www.palestinecabinet.gov.ps/WebSite/ar/ViewDetails?ID=31728
# [Google translation]: "The Council also decided to start daylight
# saving in Palestine as of one o'clock on Saturday morning,
# 2016-03-26, to provide the clock 60 minutes ahead."
#
# From Paul Eggert (2016-03-12):
# Predict spring transitions on March's last Saturday at 01:00 from now on.
# Leave fall predictions alone for now.
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule EgyptAsia 1957 only - May 10 0:00 1:00 S Rule EgyptAsia 1957 only - May 10 0:00 1:00 S
Rule EgyptAsia 1957 1958 - Oct 1 0:00 0 - Rule EgyptAsia 1957 1958 - Oct 1 0:00 0 -
...@@ -2447,7 +2616,8 @@ Rule Palestine 2012 2014 - Mar lastThu 24:00 1:00 S ...@@ -2447,7 +2616,8 @@ Rule Palestine 2012 2014 - Mar lastThu 24:00 1:00 S
Rule Palestine 2012 only - Sep 21 1:00 0 - Rule Palestine 2012 only - Sep 21 1:00 0 -
Rule Palestine 2013 only - Sep Fri>=21 0:00 0 - Rule Palestine 2013 only - Sep Fri>=21 0:00 0 -
Rule Palestine 2014 max - Oct Fri>=21 0:00 0 - Rule Palestine 2014 max - Oct Fri>=21 0:00 0 -
Rule Palestine 2015 max - Mar lastFri 24:00 1:00 S Rule Palestine 2015 only - Mar lastFri 24:00 1:00 S
Rule Palestine 2016 max - Mar lastSat 1:00 1:00 S
# Zone NAME GMTOFF RULES FORMAT [UNTIL] # Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Gaza 2:17:52 - LMT 1900 Oct Zone Asia/Gaza 2:17:52 - LMT 1900 Oct
......
...@@ -83,6 +83,14 @@ Zone Australia/Eucla 8:35:28 - LMT 1895 Dec ...@@ -83,6 +83,14 @@ Zone Australia/Eucla 8:35:28 - LMT 1895 Dec
# Hamilton is the largest, but there is also a Hamilton in Victoria, # Hamilton is the largest, but there is also a Hamilton in Victoria,
# so use Lindeman. # so use Lindeman.
# #
# From J William Piggott (2016-02-20):
# There is no location named Holiday Islands in Queensland Australia; holiday
# islands is a colloquial term used globally. Hayman and Lindeman are at the
# north and south extremes of the Whitsunday Islands archipelago, and
# Hamilton is in between; it is reasonable to believe that this time zone
# applies to all of the Whitsundays.
# http://www.australia.gov.au/about-australia/australian-story/austn-islands
#
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule AQ 1971 only - Oct lastSun 2:00s 1:00 D Rule AQ 1971 only - Oct lastSun 2:00s 1:00 D
Rule AQ 1972 only - Feb lastSun 2:00s 0 S Rule AQ 1972 only - Feb lastSun 2:00s 0 S
......
此差异已折叠。
...@@ -75,7 +75,7 @@ BL St Barthelemy ...@@ -75,7 +75,7 @@ BL St Barthelemy
BM Bermuda BM Bermuda
BN Brunei BN Brunei
BO Bolivia BO Bolivia
BQ Caribbean Netherlands BQ Caribbean NL
BR Brazil BR Brazil
BS Bahamas BS Bahamas
BT Bhutan BT Bhutan
...@@ -186,7 +186,7 @@ MA Morocco ...@@ -186,7 +186,7 @@ MA Morocco
MC Monaco MC Monaco
MD Moldova MD Moldova
ME Montenegro ME Montenegro
MF St Martin (French part) MF St Martin (French)
MG Madagascar MG Madagascar
MH Marshall Islands MH Marshall Islands
MK Macedonia MK Macedonia
...@@ -256,7 +256,7 @@ SR Suriname ...@@ -256,7 +256,7 @@ SR Suriname
SS South Sudan SS South Sudan
ST Sao Tome & Principe ST Sao Tome & Principe
SV El Salvador SV El Salvador
SX St Maarten (Dutch part) SX St Maarten (Dutch)
SY Syria SY Syria
SZ Swaziland SZ Swaziland
TC Turks & Caicos Is TC Turks & Caicos Is
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
# leap-seconds.list file available from most NIST time servers. # leap-seconds.list file available from most NIST time servers.
# If the URL <ftp://time.nist.gov/pub/leap-seconds.list> does not work, # If the URL <ftp://time.nist.gov/pub/leap-seconds.list> does not work,
# you should be able to pick up leap-seconds.list from a secondary NIST server. # you should be able to pick up leap-seconds.list from a secondary NIST server.
# See <http://tf.nist.gov/tf-cgi/servers.cgi> for a list of secondary servers.
# For more about leap-seconds.list, please see # For more about leap-seconds.list, please see
# The NTP Timescale and Leap Seconds # The NTP Timescale and Leap Seconds
# http://www.eecis.udel.edu/~mills/leap.html # http://www.eecis.udel.edu/~mills/leap.html
...@@ -79,5 +80,5 @@ Leap 2008 Dec 31 23:59:60 + S ...@@ -79,5 +80,5 @@ Leap 2008 Dec 31 23:59:60 + S
Leap 2012 Jun 30 23:59:60 + S Leap 2012 Jun 30 23:59:60 + S
Leap 2015 Jun 30 23:59:60 + S Leap 2015 Jun 30 23:59:60 + S
# Updated through IERS Bulletin C50 # Updated through IERS Bulletin C51
# File expires on: 28 June 2016 # File expires on: 28 December 2016
...@@ -2498,13 +2498,22 @@ Zone America/Merida -5:58:28 - LMT 1922 Jan 1 0:01:32 ...@@ -2498,13 +2498,22 @@ Zone America/Merida -5:58:28 - LMT 1922 Jan 1 0:01:32
-6:00 - CST 1981 Dec 23 -6:00 - CST 1981 Dec 23
-5:00 - EST 1982 Dec 2 -5:00 - EST 1982 Dec 2
-6:00 Mexico C%sT -6:00 Mexico C%sT
# Coahuila, Durango, Nuevo León, Tamaulipas (near US border) # Coahuila, Nuevo León, Tamaulipas (near US border)
# This includes the following municipalities:
# in Coahuila: Ocampo, Acuña, Zaragoza, Jiménez, Piedras Negras, Nava,
# Guerrero, Hidalgo.
# in Nuevo León: Anáhuac, Los Aldama.
# in Tamaulipas: Nuevo Laredo, Guerrero, Mier, Miguel Alemán, Camargo,
# Gustavo Díaz Ordaz, Reynosa, Río Bravo, Valle Hermoso, Matamoros.
# See: Inicia mañana Horario de Verano en zona fronteriza, El Universal,
# 2016-03-12
# http://www.eluniversal.com.mx/articulo/estados/2016/03/12/inicia-manana-horario-de-verano-en-zona-fronteriza
Zone America/Matamoros -6:40:00 - LMT 1921 Dec 31 23:20:00 Zone America/Matamoros -6:40:00 - LMT 1921 Dec 31 23:20:00
-6:00 - CST 1988 -6:00 - CST 1988
-6:00 US C%sT 1989 -6:00 US C%sT 1989
-6:00 Mexico C%sT 2010 -6:00 Mexico C%sT 2010
-6:00 US C%sT -6:00 US C%sT
# Coahuila, Durango, Nuevo León, Tamaulipas (away from US border) # Durango; Coahuila, Nuevo León, Tamaulipas (away from US border)
Zone America/Monterrey -6:41:16 - LMT 1921 Dec 31 23:18:44 Zone America/Monterrey -6:41:16 - LMT 1921 Dec 31 23:18:44
-6:00 - CST 1988 -6:00 - CST 1988
-6:00 US C%sT 1989 -6:00 US C%sT 1989
...@@ -2520,6 +2529,9 @@ Zone America/Mexico_City -6:36:36 - LMT 1922 Jan 1 0:23:24 ...@@ -2520,6 +2529,9 @@ Zone America/Mexico_City -6:36:36 - LMT 1922 Jan 1 0:23:24
-6:00 - CST 2002 Feb 20 -6:00 - CST 2002 Feb 20
-6:00 Mexico C%sT -6:00 Mexico C%sT
# Chihuahua (near US border) # Chihuahua (near US border)
# This includes the municipalities of Janos, Ascensión, Juárez, Guadalupe,
# Práxedis G Guerrero, Coyame del Sotol, Ojinaga, and Manuel Benavides.
# (See the 2016-03-12 El Universal source mentioned above.)
Zone America/Ojinaga -6:57:40 - LMT 1922 Jan 1 0:02:20 Zone America/Ojinaga -6:57:40 - LMT 1922 Jan 1 0:02:20
-7:00 - MST 1927 Jun 10 23:00 -7:00 - MST 1927 Jun 10 23:00
-6:00 - CST 1930 Nov 15 -6:00 - CST 1930 Nov 15
...@@ -2607,7 +2619,7 @@ Zone America/Bahia_Banderas -7:01:00 - LMT 1921 Dec 31 23:59:00 ...@@ -2607,7 +2619,7 @@ Zone America/Bahia_Banderas -7:01:00 - LMT 1921 Dec 31 23:59:00
-7:00 Mexico M%sT 2010 Apr 4 2:00 -7:00 Mexico M%sT 2010 Apr 4 2:00
-6:00 Mexico C%sT -6:00 Mexico C%sT
# Baja California (near US border) # Baja California
Zone America/Tijuana -7:48:04 - LMT 1922 Jan 1 0:11:56 Zone America/Tijuana -7:48:04 - LMT 1922 Jan 1 0:11:56
-7:00 - MST 1924 -7:00 - MST 1924
-8:00 - PST 1927 Jun 10 23:00 -8:00 - PST 1927 Jun 10 23:00
...@@ -3083,6 +3095,13 @@ Zone America/Guatemala -6:02:04 - LMT 1918 Oct 5 ...@@ -3083,6 +3095,13 @@ Zone America/Guatemala -6:02:04 - LMT 1918 Oct 5
# http://radiovision2000haiti.net/public/haiti-avis-changement-dheure-dimanche/ # http://radiovision2000haiti.net/public/haiti-avis-changement-dheure-dimanche/
# http://www.canalplushaiti.net/?p=6714 # http://www.canalplushaiti.net/?p=6714
# From Steffen Thorsen (2016-03-12):
# Jean Antoine, editor of www.haiti-reference.com informed us that Haiti
# are not going on DST this year. Several other resources confirm this: ...
# http://www.radiotelevisioncaraibes.com/presse/heure_d_t_pas_de_changement_d_heure_pr_vu_pour_cet_ann_e.html
# http://www.vantbefinfo.com/changement-dheure-pas-pour-haiti/
# http://news.anmwe.com/haiti-lheure-nationale-ne-sera-ni-avancee-ni-reculee-cette-annee/
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Haiti 1983 only - May 8 0:00 1:00 D Rule Haiti 1983 only - May 8 0:00 1:00 D
Rule Haiti 1984 1987 - Apr lastSun 0:00 1:00 D Rule Haiti 1984 1987 - Apr lastSun 0:00 1:00 D
...@@ -3093,8 +3112,8 @@ Rule Haiti 1988 1997 - Apr Sun>=1 1:00s 1:00 D ...@@ -3093,8 +3112,8 @@ Rule Haiti 1988 1997 - Apr Sun>=1 1:00s 1:00 D
Rule Haiti 1988 1997 - Oct lastSun 1:00s 0 S Rule Haiti 1988 1997 - Oct lastSun 1:00s 0 S
Rule Haiti 2005 2006 - Apr Sun>=1 0:00 1:00 D Rule Haiti 2005 2006 - Apr Sun>=1 0:00 1:00 D
Rule Haiti 2005 2006 - Oct lastSun 0:00 0 S Rule Haiti 2005 2006 - Oct lastSun 0:00 0 S
Rule Haiti 2012 max - Mar Sun>=8 2:00 1:00 D Rule Haiti 2012 2015 - Mar Sun>=8 2:00 1:00 D
Rule Haiti 2012 max - Nov Sun>=1 2:00 0 S Rule Haiti 2012 2015 - Nov Sun>=1 2:00 0 S
# Zone NAME GMTOFF RULES FORMAT [UNTIL] # Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone America/Port-au-Prince -4:49:20 - LMT 1890 Zone America/Port-au-Prince -4:49:20 - LMT 1890
-4:49 - PPMT 1917 Jan 24 12:00 # P-a-P MT -4:49 - PPMT 1917 Jan 24 12:00 # P-a-P MT
......
...@@ -1244,6 +1244,20 @@ Zone America/Rio_Branco -4:31:12 - LMT 1914 ...@@ -1244,6 +1244,20 @@ Zone America/Rio_Branco -4:31:12 - LMT 1914
# From Paul Eggert (2015-03-03): # From Paul Eggert (2015-03-03):
# For now, assume that the extension will persist indefinitely. # For now, assume that the extension will persist indefinitely.
# From Juan Correa (2016-03-18):
# The decree regarding DST has been published in today's Official Gazette:
# http://www.diariooficial.interior.gob.cl/versiones-anteriores/do/20160318/
# http://www.leychile.cl/Navegar?idNorma=1088502
# It does consider the second Saturday of May and August as the dates
# for the transition; and it lists DST dates until 2019, but I think
# this scheme will stick.
#
# From Paul Eggert (2016-03-18):
# For now, assume the pattern holds for the indefinite future.
# The decree says transitions occur at 24:00; in practice this appears
# to mean 24:00 mainland time, not 24:00 local time, so that Easter
# Island is always two hours behind the mainland.
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Chile 1927 1931 - Sep 1 0:00 1:00 S Rule Chile 1927 1931 - Sep 1 0:00 1:00 S
Rule Chile 1928 1932 - Apr 1 0:00 0 - Rule Chile 1928 1932 - Apr 1 0:00 0 -
...@@ -1275,8 +1289,10 @@ Rule Chile 2009 only - Mar Sun>=9 3:00u 0 - ...@@ -1275,8 +1289,10 @@ Rule Chile 2009 only - Mar Sun>=9 3:00u 0 -
Rule Chile 2010 only - Apr Sun>=1 3:00u 0 - Rule Chile 2010 only - Apr Sun>=1 3:00u 0 -
Rule Chile 2011 only - May Sun>=2 3:00u 0 - Rule Chile 2011 only - May Sun>=2 3:00u 0 -
Rule Chile 2011 only - Aug Sun>=16 4:00u 1:00 S Rule Chile 2011 only - Aug Sun>=16 4:00u 1:00 S
Rule Chile 2012 2015 - Apr Sun>=23 3:00u 0 - Rule Chile 2012 2014 - Apr Sun>=23 3:00u 0 -
Rule Chile 2012 2014 - Sep Sun>=2 4:00u 1:00 S Rule Chile 2012 2014 - Sep Sun>=2 4:00u 1:00 S
Rule Chile 2016 max - May Sun>=9 3:00u 0 -
Rule Chile 2016 max - Aug Sun>=9 4:00u 1:00 S
# IATA SSIM anomalies: (1992-02) says 1992-03-14; # IATA SSIM anomalies: (1992-02) says 1992-03-14;
# (1996-09) says 1998-03-08. Ignore these. # (1996-09) says 1998-03-08. Ignore these.
# Zone NAME GMTOFF RULES FORMAT [UNTIL] # Zone NAME GMTOFF RULES FORMAT [UNTIL]
...@@ -1293,13 +1309,11 @@ Zone America/Santiago -4:42:46 - LMT 1890 ...@@ -1293,13 +1309,11 @@ Zone America/Santiago -4:42:46 - LMT 1890
-4:00 1:00 CLST 1946 Sep 1 # central Chile -4:00 1:00 CLST 1946 Sep 1 # central Chile
-4:00 - CLT 1947 Apr 1 -4:00 - CLT 1947 Apr 1
-5:00 - CLT 1947 May 21 23:00 -5:00 - CLT 1947 May 21 23:00
-4:00 Chile CL%sT 2015 Apr 26 3:00u -4:00 Chile CL%sT
-3:00 - CLT
Zone Pacific/Easter -7:17:28 - LMT 1890 Zone Pacific/Easter -7:17:28 - LMT 1890
-7:17:28 - EMT 1932 Sep # Easter Mean Time -7:17:28 - EMT 1932 Sep # Easter Mean Time
-7:00 Chile EAS%sT 1982 Mar 14 3:00u # Easter Time -7:00 Chile EAS%sT 1982 Mar 14 3:00u # Easter Time
-6:00 Chile EAS%sT 2015 Apr 26 3:00u -6:00 Chile EAS%sT
-5:00 - EAST
# #
# Salas y Gómez Island is uninhabited. # Salas y Gómez Island is uninhabited.
# Other Chilean locations, including Juan Fernández Is, Desventuradas Is, # Other Chilean locations, including Juan Fernández Is, Desventuradas Is,
...@@ -1321,8 +1335,7 @@ Zone Pacific/Easter -7:17:28 - LMT 1890 ...@@ -1321,8 +1335,7 @@ Zone Pacific/Easter -7:17:28 - LMT 1890
Zone Antarctica/Palmer 0 - zzz 1965 Zone Antarctica/Palmer 0 - zzz 1965
-4:00 Arg AR%sT 1969 Oct 5 -4:00 Arg AR%sT 1969 Oct 5
-3:00 Arg AR%sT 1982 May -3:00 Arg AR%sT 1982 May
-4:00 Chile CL%sT 2015 Apr 26 3:00u -4:00 Chile CL%sT
-3:00 - CLT
# Colombia # Colombia
...@@ -1765,9 +1778,25 @@ Zone America/Montevideo -3:44:44 - LMT 1898 Jun 28 ...@@ -1765,9 +1778,25 @@ Zone America/Montevideo -3:44:44 - LMT 1898 Jun 28
# resolution publication) # resolution publication)
# http://www.globovision.com/news.php?nid=72208 # http://www.globovision.com/news.php?nid=72208
# From Alexander Krivenyshev (2016-04-15):
# https://actualidad.rt.com/actualidad/204758-venezuela-modificar-huso-horario-sequia-elnino
#
# From Paul Eggert (2016-04-15):
# Clocks advance 30 minutes on 2016-05-01 at 02:30. See:
# Barboza AD. Huso horario en Venezuela volverá a 4 horas menos con
# respecto al "Greenwich". Panorama 2016-04-15 12:20 -0430.
# http://www.panorama.com.ve/ciudad/Huso-horario-en-Venezuela-volvera-a-4-horas-menos-con-respecto-al-Greenwich-20160415-0032.html
#
# "'Venezuela's new time-zone: hours without light, hours without water,
# hours of presidential broadcasts, hours of lines," quipped comedian
# Jean Mary Curro ...". See: Cawthorne A, Kai D. Venezuela scraps
# half-hour time difference set by Chavez. Reuters 2016-04-15 14:50 -0400
# http://www.reuters.com/article/us-venezuela-timezone-idUSKCN0XC2BE
# Zone NAME GMTOFF RULES FORMAT [UNTIL] # Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone America/Caracas -4:27:44 - LMT 1890 Zone America/Caracas -4:27:44 - LMT 1890
-4:27:40 - CMT 1912 Feb 12 # Caracas Mean Time? -4:27:40 - CMT 1912 Feb 12 # Caracas Mean Time?
-4:30 - VET 1965 Jan 1 0:00 # Venezuela T. -4:30 - VET 1965 Jan 1 0:00 # Venezuela T.
-4:00 - VET 2007 Dec 9 3:00 -4:00 - VET 2007 Dec 9 3:00
-4:30 - VET -4:30 - VET 2016 May 1 2:30
-4:00 - VET
此差异已折叠。
/* /*
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -30,11 +30,37 @@ import java.io.IOException; ...@@ -30,11 +30,37 @@ import java.io.IOException;
import java.io.PrintWriter; import java.io.PrintWriter;
import java.util.Formatter; import java.util.Formatter;
import java.util.HashSet; import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.SortedSet; import java.util.SortedSet;
class ResourceBundleGenerator implements BundleGenerator { class ResourceBundleGenerator implements BundleGenerator {
// preferred timezones - keeping compatibility with JDK1.1 3 letter abbreviations
private static final String[] preferredTZIDs = {
"America/Los_Angeles",
"America/Denver",
"America/Phoenix",
"America/Chicago",
"America/New_York",
"America/Indianapolis",
"Pacific/Honolulu",
"America/Anchorage",
"America/Halifax",
"America/Sitka",
"America/St_Johns",
"Europe/Paris",
// Although CLDR does not support abbreviated zones, handle "GMT" as a
// special case here, as it is specified in the javadoc.
"GMT",
"Africa/Casablanca",
"Asia/Jerusalem",
"Asia/Tokyo",
"Europe/Bucharest",
"Asia/Shanghai",
"UTC",
};
@Override @Override
public void generateBundle(String packageName, String baseName, String localeID, boolean useJava, public void generateBundle(String packageName, String baseName, String localeID, boolean useJava,
Map<String, ?> map, BundleType type) throws IOException { Map<String, ?> map, BundleType type) throws IOException {
...@@ -89,6 +115,19 @@ class ResourceBundleGenerator implements BundleGenerator { ...@@ -89,6 +115,19 @@ class ResourceBundleGenerator implements BundleGenerator {
for (String key : metaKeys) { for (String key : metaKeys) {
map.remove(key); map.remove(key);
} }
// Make it preferred ordered
LinkedHashMap<String, Object> newMap = new LinkedHashMap<>();
for (String preferred : preferredTZIDs) {
if (map.containsKey(preferred)) {
newMap.put(preferred, map.remove(preferred));
} else if (("GMT".equals(preferred) || "UTC".equals(preferred)) &&
metaKeys.contains(CLDRConverter.METAZONE_ID_PREFIX+preferred)) {
newMap.put(preferred, preferred);
}
}
newMap.putAll(map);
map = newMap;
} }
try (PrintWriter out = new PrintWriter(file, encoding)) { try (PrintWriter out = new PrintWriter(file, encoding)) {
......
...@@ -15,13 +15,13 @@ ...@@ -15,13 +15,13 @@
# #
alert=\uACBD\uBCF4 alert=\uACBD\uBCF4
awtcomponent=AWT \uAD6C\uC131 \uC694\uC18C awtcomponent=AWT \uAD6C\uC131 \uC694\uC18C
checkbox=\uCCB4\uD06C \uBC15\uC2A4 checkbox=\uCCB4\uD06C\uBC15\uC2A4
colorchooser=\uC0C9\uC0C1 \uC120\uD0DD\uAE30 colorchooser=\uC0C9\uC0C1 \uC120\uD0DD\uAE30
columnheader=\uC5F4 \uBA38\uB9AC\uAE00 columnheader=\uC5F4 \uBA38\uB9AC\uAE00
combobox=\uCF64\uBCF4 \uC0C1\uC790 combobox=\uCF64\uBCF4 \uC0C1\uC790
canvas=\uCE94\uBC84\uC2A4 canvas=\uCE94\uBC84\uC2A4
desktopicon=\uBC14\uD0D5 \uD654\uBA74 \uC544\uC774\uCF58 desktopicon=\uBC14\uD0D5\uD654\uBA74 \uC544\uC774\uCF58
desktoppane=\uBC14\uD0D5 \uD654\uBA74 \uCC3D desktoppane=\uBC14\uD0D5\uD654\uBA74 \uCC3D
dialog=\uB300\uD654\uC0C1\uC790 dialog=\uB300\uD654\uC0C1\uC790
directorypane=\uB514\uB809\uD1A0\uB9AC \uCC3D directorypane=\uB514\uB809\uD1A0\uB9AC \uCC3D
glasspane=\uAE00\uB798\uC2A4 \uCC3D glasspane=\uAE00\uB798\uC2A4 \uCC3D
......
...@@ -2975,7 +2975,8 @@ final public class LdapCtx extends ComponentDirContext ...@@ -2975,7 +2975,8 @@ final public class LdapCtx extends ComponentDirContext
r = new LdapReferralException(resolvedName, resolvedObj, remainName, r = new LdapReferralException(resolvedName, resolvedObj, remainName,
msg, envprops, fullDN, handleReferrals, reqCtls); msg, envprops, fullDN, handleReferrals, reqCtls);
// only one set of URLs is present // only one set of URLs is present
r.setReferralInfo(res.referrals.elementAt(0), false); r.setReferralInfo(res.referrals == null ? null :
res.referrals.elementAt(0), false);
if (hopCount > 1) { if (hopCount > 1) {
r.setHopCount(hopCount); r.setHopCount(hopCount);
...@@ -3044,7 +3045,7 @@ final public class LdapCtx extends ComponentDirContext ...@@ -3044,7 +3045,7 @@ final public class LdapCtx extends ComponentDirContext
* assume name resolution has not yet completed. * assume name resolution has not yet completed.
*/ */
if (((res.entries == null) || (res.entries.isEmpty())) && if (((res.entries == null) || (res.entries.isEmpty())) &&
(res.referrals.size() == 1)) { ((res.referrals != null) && (res.referrals.size() == 1))) {
r.setReferralInfo(res.referrals, false); r.setReferralInfo(res.referrals, false);
......
...@@ -92,7 +92,12 @@ final class LdapReferralContext implements DirContext, LdapContext { ...@@ -92,7 +92,12 @@ final class LdapReferralContext implements DirContext, LdapContext {
try { try {
referral = refEx.getNextReferral(); referral = refEx.getNextReferral();
if (referral == null) { if (referral == null) {
if (previousEx != null) {
throw (NamingException)(previousEx.fillInStackTrace()); throw (NamingException)(previousEx.fillInStackTrace());
} else {
throw new NamingException(
"Illegal encoding: referral is empty");
}
} }
} catch (LdapReferralException e) { } catch (LdapReferralException e) {
......
...@@ -217,14 +217,16 @@ final public class LdapReferralException extends ...@@ -217,14 +217,16 @@ final public class LdapReferralException extends
System.out.println("LdapReferralException.setReferralInfo"); System.out.println("LdapReferralException.setReferralInfo");
this.referrals = referrals; this.referrals = referrals;
if (referrals != null) { referralCount = (referrals == null) ? 0 : referrals.size();
referralCount = referrals.size();
}
if (debug) { if (debug) {
if (referrals != null) {
for (int i = 0; i < referralCount; i++) { for (int i = 0; i < referralCount; i++) {
System.out.println(" [" + i + "] " + referrals.elementAt(i)); System.out.println(" [" + i + "] " + referrals.elementAt(i));
} }
} else {
System.out.println("setReferralInfo : referrals == null");
}
} }
} }
......
...@@ -666,6 +666,40 @@ public final class SoftSynthesizer implements AudioSynthesizer, ...@@ -666,6 +666,40 @@ public final class SoftSynthesizer implements AudioSynthesizer,
} }
}); });
actions.add(new PrivilegedAction<InputStream>() {
public InputStream run() {
if (System.getProperties().getProperty("os.name")
.startsWith("Linux")) {
File[] systemSoundFontsDir = new File[] {
/* Arch, Fedora, Mageia */
new File("/usr/share/soundfonts/"),
new File("/usr/local/share/soundfonts/"),
/* Debian, Gentoo, OpenSUSE, Ubuntu */
new File("/usr/share/sounds/sf2/"),
new File("/usr/local/share/sounds/sf2/"),
};
/*
* Look for a default.sf2
*/
for (File systemSoundFontDir : systemSoundFontsDir) {
if (systemSoundFontDir.exists()) {
File defaultSoundFont = new File(systemSoundFontDir, "default.sf2");
if (defaultSoundFont.exists()) {
try {
return new FileInputStream(defaultSoundFont);
} catch (IOException e) {
// continue with lookup
}
}
}
}
}
return null;
}
});
actions.add(new PrivilegedAction<InputStream>() { actions.add(new PrivilegedAction<InputStream>() {
public InputStream run() { public InputStream run() {
if (System.getProperties().getProperty("os.name") if (System.getProperties().getProperty("os.name")
......
...@@ -354,7 +354,14 @@ public class HprofReader extends Reader /* imports */ implements ArrayTypeCodes ...@@ -354,7 +354,14 @@ public class HprofReader extends Reader /* imports */ implements ArrayTypeCodes
} }
private void skipBytes(long length) throws IOException { private void skipBytes(long length) throws IOException {
in.skipBytes((int)length); while (length > 0) {
long skipped = in.skip(length);
length -= skipped;
if (skipped == 0) {
// EOF or other problem, throw exception
throw new EOFException("Couldn't skip enough bytes");
}
}
} }
private int readVersionHeader() throws IOException { private int readVersionHeader() throws IOException {
...@@ -486,12 +493,12 @@ public class HprofReader extends Reader /* imports */ implements ArrayTypeCodes ...@@ -486,12 +493,12 @@ public class HprofReader extends Reader /* imports */ implements ArrayTypeCodes
break; break;
} }
case HPROF_GC_OBJ_ARRAY_DUMP: { case HPROF_GC_OBJ_ARRAY_DUMP: {
int bytesRead = readArray(false); long bytesRead = readArray(false);
bytesLeft -= bytesRead; bytesLeft -= bytesRead;
break; break;
} }
case HPROF_GC_PRIM_ARRAY_DUMP: { case HPROF_GC_PRIM_ARRAY_DUMP: {
int bytesRead = readArray(true); long bytesRead = readArray(true);
bytesLeft -= bytesRead; bytesLeft -= bytesRead;
break; break;
} }
...@@ -743,12 +750,12 @@ public class HprofReader extends Reader /* imports */ implements ArrayTypeCodes ...@@ -743,12 +750,12 @@ public class HprofReader extends Reader /* imports */ implements ArrayTypeCodes
// Handle a HPROF_GC_OBJ_ARRAY_DUMP or HPROF_GC_PRIM_ARRAY_DUMP // Handle a HPROF_GC_OBJ_ARRAY_DUMP or HPROF_GC_PRIM_ARRAY_DUMP
// Return number of bytes read // Return number of bytes read
// //
private int readArray(boolean isPrimitive) throws IOException { private long readArray(boolean isPrimitive) throws IOException {
long start = in.position(); long start = in.position();
long id = readID(); long id = readID();
StackTrace stackTrace = getStackTraceFromSerial(in.readInt()); StackTrace stackTrace = getStackTraceFromSerial(in.readInt());
int num = in.readInt(); int num = in.readInt();
int bytesRead = identifierSize + 8; long bytesRead = identifierSize + 8;
long elementClassID; long elementClassID;
if (isPrimitive) { if (isPrimitive) {
elementClassID = in.readByte(); elementClassID = in.readByte();
...@@ -810,14 +817,14 @@ public class HprofReader extends Reader /* imports */ implements ArrayTypeCodes ...@@ -810,14 +817,14 @@ public class HprofReader extends Reader /* imports */ implements ArrayTypeCodes
} }
} }
if (primitiveSignature != 0x00) { if (primitiveSignature != 0x00) {
int size = elSize * num; long size = elSize * (long)num;
bytesRead += size; bytesRead += size;
JavaValueArray va = new JavaValueArray(primitiveSignature, start); JavaValueArray va = new JavaValueArray(primitiveSignature, start);
skipBytes(size); skipBytes(size);
snapshot.addHeapObject(id, va); snapshot.addHeapObject(id, va);
snapshot.setSiteTrace(va, stackTrace); snapshot.setSiteTrace(va, stackTrace);
} else { } else {
int sz = num * identifierSize; long sz = (long)num * identifierSize;
bytesRead += sz; bytesRead += sz;
JavaObjectArray arr = new JavaObjectArray(elementClassID, start); JavaObjectArray arr = new JavaObjectArray(elementClassID, start);
skipBytes(sz); skipBytes(sz);
......
...@@ -200,4 +200,9 @@ public class ArrayTypeImpl extends ReferenceTypeImpl ...@@ -200,4 +200,9 @@ public class ArrayTypeImpl extends ReferenceTypeImpl
* Defined always to be true for arrays * Defined always to be true for arrays
*/ */
public boolean isFinal() { return true; } public boolean isFinal() { return true; }
/*
* Defined always to be false for arrays
*/
public boolean isStatic() { return false; }
} }
/* /*
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -112,29 +112,56 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { ...@@ -112,29 +112,56 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
} }
/** /**
* This method has the same contract as ensureCapacity, but is * For positive values of {@code minimumCapacity}, this method
* never synchronized. * behaves like {@code ensureCapacity}, however it is never
* synchronized.
* If {@code minimumCapacity} is non positive due to numeric
* overflow, this method throws {@code OutOfMemoryError}.
*/ */
private void ensureCapacityInternal(int minimumCapacity) { private void ensureCapacityInternal(int minimumCapacity) {
// overflow-conscious code // overflow-conscious code
if (minimumCapacity - value.length > 0) if (minimumCapacity - value.length > 0) {
expandCapacity(minimumCapacity); value = Arrays.copyOf(value,
newCapacity(minimumCapacity));
} }
}
/**
* The maximum size of array to allocate (unless necessary).
* Some VMs reserve some header words in an array.
* Attempts to allocate larger arrays may result in
* OutOfMemoryError: Requested array size exceeds VM limit
*/
private static final int MAX_ARRAY_SIZE = Integer.MAX_VALUE - 8;
/** /**
* This implements the expansion semantics of ensureCapacity with no * Returns a capacity at least as large as the given minimum capacity.
* size check or synchronization. * Returns the current capacity increased by the same amount + 2 if
* that suffices.
* Will not return a capacity greater than {@code MAX_ARRAY_SIZE}
* unless the given minimum capacity is greater than that.
*
* @param minCapacity the desired minimum capacity
* @throws OutOfMemoryError if minCapacity is less than zero or
* greater than Integer.MAX_VALUE
*/ */
void expandCapacity(int minimumCapacity) { private int newCapacity(int minCapacity) {
int newCapacity = value.length * 2 + 2; // overflow-conscious code
if (newCapacity - minimumCapacity < 0) int newCapacity = (value.length << 1) + 2;
newCapacity = minimumCapacity; if (newCapacity - minCapacity < 0) {
if (newCapacity < 0) { newCapacity = minCapacity;
if (minimumCapacity < 0) // overflow }
return (newCapacity <= 0 || MAX_ARRAY_SIZE - newCapacity < 0)
? hugeCapacity(minCapacity)
: newCapacity;
}
private int hugeCapacity(int minCapacity) {
if (Integer.MAX_VALUE - minCapacity < 0) { // overflow
throw new OutOfMemoryError(); throw new OutOfMemoryError();
newCapacity = Integer.MAX_VALUE;
} }
value = Arrays.copyOf(value, newCapacity); return (minCapacity > MAX_ARRAY_SIZE)
? minCapacity : MAX_ARRAY_SIZE;
} }
/** /**
......
...@@ -171,9 +171,7 @@ import java.util.Arrays; ...@@ -171,9 +171,7 @@ import java.util.Arrays;
@Override @Override
public synchronized void ensureCapacity(int minimumCapacity) { public synchronized void ensureCapacity(int minimumCapacity) {
if (minimumCapacity > value.length) { super.ensureCapacity(minimumCapacity);
expandCapacity(minimumCapacity);
}
} }
/** /**
......
/* /*
* Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1994, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -145,7 +145,7 @@ class Thread implements Runnable { ...@@ -145,7 +145,7 @@ class Thread implements Runnable {
registerNatives(); registerNatives();
} }
private volatile char name[]; private volatile String name;
private int priority; private int priority;
private Thread threadQ; private Thread threadQ;
private long eetop; private long eetop;
...@@ -366,7 +366,7 @@ class Thread implements Runnable { ...@@ -366,7 +366,7 @@ class Thread implements Runnable {
throw new NullPointerException("name cannot be null"); throw new NullPointerException("name cannot be null");
} }
this.name = name.toCharArray(); this.name = name;
Thread parent = currentThread(); Thread parent = currentThread();
SecurityManager security = System.getSecurityManager(); SecurityManager security = System.getSecurityManager();
...@@ -1119,7 +1119,11 @@ class Thread implements Runnable { ...@@ -1119,7 +1119,11 @@ class Thread implements Runnable {
*/ */
public final synchronized void setName(String name) { public final synchronized void setName(String name) {
checkAccess(); checkAccess();
this.name = name.toCharArray(); if (name == null) {
throw new NullPointerException("name cannot be null");
}
this.name = name;
if (threadStatus != 0) { if (threadStatus != 0) {
setNativeName(name); setNativeName(name);
} }
...@@ -1132,7 +1136,7 @@ class Thread implements Runnable { ...@@ -1132,7 +1136,7 @@ class Thread implements Runnable {
* @see #setName(String) * @see #setName(String)
*/ */
public final String getName() { public final String getName() {
return new String(name, true); return name;
} }
/** /**
......
...@@ -158,7 +158,7 @@ class DirectMethodHandle extends MethodHandle { ...@@ -158,7 +158,7 @@ class DirectMethodHandle extends MethodHandle {
private static LambdaForm preparedLambdaForm(MemberName m) { private static LambdaForm preparedLambdaForm(MemberName m) {
assert(m.isInvocable()) : m; // call preparedFieldLambdaForm instead assert(m.isInvocable()) : m; // call preparedFieldLambdaForm instead
MethodType mtype = m.getInvocationType().basicType(); MethodType mtype = m.getInvocationType().basicType();
assert(!m.isMethodHandleInvoke() || "invokeBasic".equals(m.getName())) : m; assert(!m.isMethodHandleInvoke()) : m;
int which; int which;
switch (m.getReferenceKind()) { switch (m.getReferenceKind()) {
case REF_invokeVirtual: which = LF_INVVIRTUAL; break; case REF_invokeVirtual: which = LF_INVVIRTUAL; break;
......
...@@ -1034,7 +1034,7 @@ class LambdaForm { ...@@ -1034,7 +1034,7 @@ class LambdaForm {
this.member = member; this.member = member;
this.resolvedHandle = resolvedHandle; this.resolvedHandle = resolvedHandle;
// The following assert is almost always correct, but will fail for corner cases, such as PrivateInvokeTest. // The following assert is almost always correct, but will fail for corner cases, such as PrivateInvokeTest.
//assert(!isInvokeBasic()); //assert(!isInvokeBasic(member));
} }
NamedFunction(MethodType basicInvokerType) { NamedFunction(MethodType basicInvokerType) {
assert(basicInvokerType == basicInvokerType.basicType()) : basicInvokerType; assert(basicInvokerType == basicInvokerType.basicType()) : basicInvokerType;
...@@ -1045,12 +1045,12 @@ class LambdaForm { ...@@ -1045,12 +1045,12 @@ class LambdaForm {
// necessary to pass BigArityTest // necessary to pass BigArityTest
this.member = Invokers.invokeBasicMethod(basicInvokerType); this.member = Invokers.invokeBasicMethod(basicInvokerType);
} }
assert(isInvokeBasic()); assert(isInvokeBasic(member));
} }
private boolean isInvokeBasic() { private static boolean isInvokeBasic(MemberName member) {
return member != null && return member != null &&
member.isMethodHandleInvoke() && member.getDeclaringClass() == MethodHandle.class &&
"invokeBasic".equals(member.getName()); "invokeBasic".equals(member.getName());
} }
...@@ -1191,7 +1191,7 @@ class LambdaForm { ...@@ -1191,7 +1191,7 @@ class LambdaForm {
assert(mh.type().basicType() == MethodType.genericMethodType(arity).changeReturnType(rtype)) assert(mh.type().basicType() == MethodType.genericMethodType(arity).changeReturnType(rtype))
: Arrays.asList(mh, rtype, arity); : Arrays.asList(mh, rtype, arity);
MemberName member = mh.internalMemberName(); MemberName member = mh.internalMemberName();
if (member != null && member.getName().equals("invokeBasic") && member.isMethodHandleInvoke()) { if (isInvokeBasic(member)) {
assert(arity > 0); assert(arity > 0);
assert(a[0] instanceof MethodHandle); assert(a[0] instanceof MethodHandle);
MethodHandle mh2 = (MethodHandle) a[0]; MethodHandle mh2 = (MethodHandle) a[0];
......
...@@ -341,7 +341,6 @@ import java.util.Objects; ...@@ -341,7 +341,6 @@ import java.util.Objects;
} }
/** Utility method to query if this member is a method handle invocation (invoke or invokeExact). /** Utility method to query if this member is a method handle invocation (invoke or invokeExact).
* Also returns true for the non-public MH.invokeBasic.
*/ */
public boolean isMethodHandleInvoke() { public boolean isMethodHandleInvoke() {
final int bits = MH_INVOKE_MODS &~ Modifier.PUBLIC; final int bits = MH_INVOKE_MODS &~ Modifier.PUBLIC;
...@@ -356,7 +355,6 @@ import java.util.Objects; ...@@ -356,7 +355,6 @@ import java.util.Objects;
switch (name) { switch (name) {
case "invoke": case "invoke":
case "invokeExact": case "invokeExact":
case "invokeBasic": // internal sig-poly method
return true; return true;
default: default:
return false; return false;
......
...@@ -28,6 +28,7 @@ package java.lang.invoke; ...@@ -28,6 +28,7 @@ package java.lang.invoke;
import java.lang.reflect.*; import java.lang.reflect.*;
import java.util.BitSet; import java.util.BitSet;
import java.util.List; import java.util.List;
import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import sun.invoke.util.ValueConversions; import sun.invoke.util.ValueConversions;
...@@ -864,8 +865,6 @@ assertEquals("", (String) MH_newString.invokeExact()); ...@@ -864,8 +865,6 @@ assertEquals("", (String) MH_newString.invokeExact());
return invoker(type); return invoker(type);
if ("invokeExact".equals(name)) if ("invokeExact".equals(name))
return exactInvoker(type); return exactInvoker(type);
if ("invokeBasic".equals(name))
return basicInvoker(type);
assert(!MemberName.isMethodHandleInvokeName(name)); assert(!MemberName.isMethodHandleInvokeName(name));
return null; return null;
} }
...@@ -2447,6 +2446,7 @@ assertEquals("yz", (String) d0.invokeExact(123, "x", "y", "z")); ...@@ -2447,6 +2446,7 @@ assertEquals("yz", (String) d0.invokeExact(123, "x", "y", "z"));
*/ */
public static public static
MethodHandle dropArguments(MethodHandle target, int pos, List<Class<?>> valueTypes) { MethodHandle dropArguments(MethodHandle target, int pos, List<Class<?>> valueTypes) {
valueTypes = copyTypes(valueTypes);
MethodType oldType = target.type(); // get NPE MethodType oldType = target.type(); // get NPE
int dropped = dropArgumentChecks(oldType, pos, valueTypes); int dropped = dropArgumentChecks(oldType, pos, valueTypes);
MethodType newType = oldType.insertParameterTypes(pos, valueTypes); MethodType newType = oldType.insertParameterTypes(pos, valueTypes);
...@@ -2461,6 +2461,11 @@ assertEquals("yz", (String) d0.invokeExact(123, "x", "y", "z")); ...@@ -2461,6 +2461,11 @@ assertEquals("yz", (String) d0.invokeExact(123, "x", "y", "z"));
return result; return result;
} }
private static List<Class<?>> copyTypes(List<Class<?>> types) {
Object[] a = types.toArray();
return Arrays.asList(Arrays.copyOf(a, a.length, Class[].class));
}
private static int dropArgumentChecks(MethodType oldType, int pos, List<Class<?>> valueTypes) { private static int dropArgumentChecks(MethodType oldType, int pos, List<Class<?>> valueTypes) {
int dropped = valueTypes.size(); int dropped = valueTypes.size();
MethodType.checkSlotCount(dropped); MethodType.checkSlotCount(dropped);
...@@ -2842,7 +2847,7 @@ System.out.println((int) f0.invokeExact("x", "y")); // 2 ...@@ -2842,7 +2847,7 @@ System.out.println((int) f0.invokeExact("x", "y")); // 2
int filterValues = filterType.parameterCount(); int filterValues = filterType.parameterCount();
if (filterValues == 0 if (filterValues == 0
? (rtype != void.class) ? (rtype != void.class)
: (rtype != filterType.parameterType(0))) : (rtype != filterType.parameterType(0) || filterValues != 1))
throw newIllegalArgumentException("target and filter types do not match", targetType, filterType); throw newIllegalArgumentException("target and filter types do not match", targetType, filterType);
} }
......
/* /*
* Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1995, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -1515,7 +1515,7 @@ public abstract class URLConnection { ...@@ -1515,7 +1515,7 @@ public abstract class URLConnection {
} }
if (c1 == 0xFF && c2 == 0xD8 && c3 == 0xFF) { if (c1 == 0xFF && c2 == 0xD8 && c3 == 0xFF) {
if (c4 == 0xE0) { if (c4 == 0xE0 || c4 == 0xEE) {
return "image/jpeg"; return "image/jpeg";
} }
...@@ -1530,10 +1530,6 @@ public abstract class URLConnection { ...@@ -1530,10 +1530,6 @@ public abstract class URLConnection {
c11 == 0)) { c11 == 0)) {
return "image/jpeg"; return "image/jpeg";
} }
if (c4 == 0xEE) {
return "image/jpg";
}
} }
if (c1 == 0xD0 && c2 == 0xCF && c3 == 0x11 && c4 == 0xE0 && if (c1 == 0xD0 && c2 == 0xCF && c3 == 0x11 && c4 == 0xE0 &&
......
...@@ -170,7 +170,8 @@ public final class URLPermission extends Permission { ...@@ -170,7 +170,8 @@ public final class URLPermission extends Permission {
parseURI(getName()); parseURI(getName());
int colon = actions.indexOf(':'); int colon = actions.indexOf(':');
if (actions.lastIndexOf(':') != colon) { if (actions.lastIndexOf(':') != colon) {
throw new IllegalArgumentException("invalid actions string"); throw new IllegalArgumentException(
"Invalid actions string: \"" + actions + "\"");
} }
String methods, headers; String methods, headers;
...@@ -371,7 +372,8 @@ public final class URLPermission extends Permission { ...@@ -371,7 +372,8 @@ public final class URLPermission extends Permission {
l.add(s); l.add(s);
b = new StringBuilder(); b = new StringBuilder();
} else if (c == ' ' || c == '\t') { } else if (c == ' ' || c == '\t') {
throw new IllegalArgumentException("white space not allowed"); throw new IllegalArgumentException(
"White space not allowed in methods: \"" + methods + "\"");
} else { } else {
if (c >= 'a' && c <= 'z') { if (c >= 'a' && c <= 'z') {
c += 'A' - 'a'; c += 'A' - 'a';
...@@ -398,7 +400,8 @@ public final class URLPermission extends Permission { ...@@ -398,7 +400,8 @@ public final class URLPermission extends Permission {
} }
b.append(c); b.append(c);
} else if (c == ' ' || c == '\t') { } else if (c == ' ' || c == '\t') {
throw new IllegalArgumentException("white space not allowed"); throw new IllegalArgumentException(
"White space not allowed in headers: \"" + headers + "\"");
} else if (c == '-') { } else if (c == '-') {
capitalizeNext = true; capitalizeNext = true;
b.append(c); b.append(c);
...@@ -423,14 +426,16 @@ public final class URLPermission extends Permission { ...@@ -423,14 +426,16 @@ public final class URLPermission extends Permission {
int len = url.length(); int len = url.length();
int delim = url.indexOf(':'); int delim = url.indexOf(':');
if (delim == -1 || delim + 1 == len) { if (delim == -1 || delim + 1 == len) {
throw new IllegalArgumentException("invalid URL string"); throw new IllegalArgumentException(
"Invalid URL string: \"" + url + "\"");
} }
scheme = url.substring(0, delim).toLowerCase(); scheme = url.substring(0, delim).toLowerCase();
this.ssp = url.substring(delim + 1); this.ssp = url.substring(delim + 1);
if (!ssp.startsWith("//")) { if (!ssp.startsWith("//")) {
if (!ssp.equals("*")) { if (!ssp.equals("*")) {
throw new IllegalArgumentException("invalid URL string"); throw new IllegalArgumentException(
"Invalid URL string: \"" + url + "\"");
} }
this.authority = new Authority(scheme, "*"); this.authority = new Authority(scheme, "*");
return; return;
......
/* /*
* Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -47,7 +47,6 @@ import java.util.Arrays; ...@@ -47,7 +47,6 @@ import java.util.Arrays;
import java.util.Locale; import java.util.Locale;
import java.util.Objects; import java.util.Objects;
import java.util.ResourceBundle; import java.util.ResourceBundle;
import java.util.TimeZone;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap; import java.util.concurrent.ConcurrentMap;
import sun.util.locale.provider.LocaleProviderAdapter; import sun.util.locale.provider.LocaleProviderAdapter;
...@@ -146,6 +145,12 @@ public class DateFormatSymbols implements Serializable, Cloneable { ...@@ -146,6 +145,12 @@ public class DateFormatSymbols implements Serializable, Cloneable {
initializeData(locale); initializeData(locale);
} }
/**
* Constructs an uninitialized DateFormatSymbols.
*/
private DateFormatSymbols(boolean flag) {
}
/** /**
* Era strings. For example: "AD" and "BC". An array of 2 strings, * Era strings. For example: "AD" and "BC". An array of 2 strings,
* indexed by <code>Calendar.BC</code> and <code>Calendar.AD</code>. * indexed by <code>Calendar.BC</code> and <code>Calendar.AD</code>.
...@@ -677,56 +682,82 @@ public class DateFormatSymbols implements Serializable, Cloneable { ...@@ -677,56 +682,82 @@ public class DateFormatSymbols implements Serializable, Cloneable {
*/ */
transient volatile int cachedHashCode = 0; transient volatile int cachedHashCode = 0;
private void initializeData(Locale desiredLocale) { /**
locale = desiredLocale; * Initializes this DateFormatSymbols with the locale data. This method uses
* a cached DateFormatSymbols instance for the given locale if available. If
// Copy values of a cached instance if any. * there's no cached one, this method creates an uninitialized instance and
* populates its fields from the resource bundle for the locale, and caches
* the instance. Note: zoneStrings isn't initialized in this method.
*/
private void initializeData(Locale locale) {
SoftReference<DateFormatSymbols> ref = cachedInstances.get(locale); SoftReference<DateFormatSymbols> ref = cachedInstances.get(locale);
DateFormatSymbols dfs; DateFormatSymbols dfs;
if (ref != null && (dfs = ref.get()) != null) { if (ref == null || (dfs = ref.get()) == null) {
copyMembers(dfs, this); if (ref != null) {
return; // Remove the empty SoftReference
cachedInstances.remove(locale, ref);
} }
dfs = new DateFormatSymbols(false);
// Initialize the fields from the ResourceBundle for locale. // Initialize the fields from the ResourceBundle for locale.
LocaleProviderAdapter adapter = LocaleProviderAdapter.getAdapter(DateFormatSymbolsProvider.class, locale); LocaleProviderAdapter adapter
= LocaleProviderAdapter.getAdapter(DateFormatSymbolsProvider.class, locale);
// Avoid any potential recursions // Avoid any potential recursions
if (!(adapter instanceof ResourceBundleBasedAdapter)) { if (!(adapter instanceof ResourceBundleBasedAdapter)) {
adapter = LocaleProviderAdapter.getResourceBundleBased(); adapter = LocaleProviderAdapter.getResourceBundleBased();
} }
ResourceBundle resource = ((ResourceBundleBasedAdapter)adapter).getLocaleData().getDateFormatData(locale); ResourceBundle resource
= ((ResourceBundleBasedAdapter)adapter).getLocaleData().getDateFormatData(locale);
dfs.locale = locale;
// JRE and CLDR use different keys // JRE and CLDR use different keys
// JRE: Eras, short.Eras and narrow.Eras // JRE: Eras, short.Eras and narrow.Eras
// CLDR: long.Eras, Eras and narrow.Eras // CLDR: long.Eras, Eras and narrow.Eras
if (resource.containsKey("Eras")) { if (resource.containsKey("Eras")) {
eras = resource.getStringArray("Eras"); dfs.eras = resource.getStringArray("Eras");
} else if (resource.containsKey("long.Eras")) { } else if (resource.containsKey("long.Eras")) {
eras = resource.getStringArray("long.Eras"); dfs.eras = resource.getStringArray("long.Eras");
} else if (resource.containsKey("short.Eras")) { } else if (resource.containsKey("short.Eras")) {
eras = resource.getStringArray("short.Eras"); dfs.eras = resource.getStringArray("short.Eras");
} }
months = resource.getStringArray("MonthNames"); dfs.months = resource.getStringArray("MonthNames");
shortMonths = resource.getStringArray("MonthAbbreviations"); dfs.shortMonths = resource.getStringArray("MonthAbbreviations");
ampms = resource.getStringArray("AmPmMarkers"); dfs.ampms = resource.getStringArray("AmPmMarkers");
localPatternChars = resource.getString("DateTimePatternChars"); dfs.localPatternChars = resource.getString("DateTimePatternChars");
// Day of week names are stored in a 1-based array. // Day of week names are stored in a 1-based array.
weekdays = toOneBasedArray(resource.getStringArray("DayNames")); dfs.weekdays = toOneBasedArray(resource.getStringArray("DayNames"));
shortWeekdays = toOneBasedArray(resource.getStringArray("DayAbbreviations")); dfs.shortWeekdays = toOneBasedArray(resource.getStringArray("DayAbbreviations"));
// Put a clone in the cache // Put dfs in the cache
ref = new SoftReference<>((DateFormatSymbols)this.clone()); ref = new SoftReference<>(dfs);
SoftReference<DateFormatSymbols> x = cachedInstances.putIfAbsent(locale, ref); SoftReference<DateFormatSymbols> x = cachedInstances.putIfAbsent(locale, ref);
if (x != null) { if (x != null) {
DateFormatSymbols y = x.get(); DateFormatSymbols y = x.get();
if (y == null) { if (y == null) {
// Replace the empty SoftReference with ref. // Replace the empty SoftReference with ref.
cachedInstances.put(locale, ref); cachedInstances.replace(locale, x, ref);
} else {
ref = x;
dfs = y;
}
}
// If the bundle's locale isn't the target locale, put another cache
// entry for the bundle's locale.
Locale bundleLocale = resource.getLocale();
if (!bundleLocale.equals(locale)) {
SoftReference<DateFormatSymbols> z
= cachedInstances.putIfAbsent(bundleLocale, ref);
if (z != null && z.get() == null) {
cachedInstances.replace(bundleLocale, z, ref);
} }
} }
} }
// Copy the field values from dfs to this instance.
copyMembers(dfs, this);
}
private static String[] toOneBasedArray(String[] src) { private static String[] toOneBasedArray(String[] src) {
int len = src.length; int len = src.length;
String[] dst = new String[len + 1]; String[] dst = new String[len + 1];
...@@ -806,12 +837,14 @@ public class DateFormatSymbols implements Serializable, Cloneable { ...@@ -806,12 +837,14 @@ public class DateFormatSymbols implements Serializable, Cloneable {
/** /**
* Clones all the data members from the source DateFormatSymbols to * Clones all the data members from the source DateFormatSymbols to
* the target DateFormatSymbols. This is only for subclasses. * the target DateFormatSymbols.
*
* @param src the source DateFormatSymbols. * @param src the source DateFormatSymbols.
* @param dst the target DateFormatSymbols. * @param dst the target DateFormatSymbols.
*/ */
private void copyMembers(DateFormatSymbols src, DateFormatSymbols dst) private void copyMembers(DateFormatSymbols src, DateFormatSymbols dst)
{ {
dst.locale = src.locale;
dst.eras = Arrays.copyOf(src.eras, src.eras.length); dst.eras = Arrays.copyOf(src.eras, src.eras.length);
dst.months = Arrays.copyOf(src.months, src.months.length); dst.months = Arrays.copyOf(src.months, src.months.length);
dst.shortMonths = Arrays.copyOf(src.shortMonths, src.shortMonths.length); dst.shortMonths = Arrays.copyOf(src.shortMonths, src.shortMonths.length);
......
...@@ -1132,10 +1132,10 @@ public class Hashtable<K,V> ...@@ -1132,10 +1132,10 @@ public class Hashtable<K,V>
Entry<Object, Object> entryStack = null; Entry<Object, Object> entryStack = null;
synchronized (this) { synchronized (this) {
// Write out the length, threshold, loadfactor // Write out the threshold and loadFactor
s.defaultWriteObject(); s.defaultWriteObject();
// Write out length, count of elements // Write out the length and count of elements
s.writeInt(table.length); s.writeInt(table.length);
s.writeInt(count); s.writeInt(count);
...@@ -1165,22 +1165,33 @@ public class Hashtable<K,V> ...@@ -1165,22 +1165,33 @@ public class Hashtable<K,V>
private void readObject(java.io.ObjectInputStream s) private void readObject(java.io.ObjectInputStream s)
throws IOException, ClassNotFoundException throws IOException, ClassNotFoundException
{ {
// Read in the length, threshold, and loadfactor // Read in the threshold and loadFactor
s.defaultReadObject(); s.defaultReadObject();
// Validate loadFactor (ignore threshold - it will be re-computed)
if (loadFactor <= 0 || Float.isNaN(loadFactor))
throw new StreamCorruptedException("Illegal Load: " + loadFactor);
// Read the original length of the array and number of elements // Read the original length of the array and number of elements
int origlength = s.readInt(); int origlength = s.readInt();
int elements = s.readInt(); int elements = s.readInt();
// Compute new size with a bit of room 5% to grow but // Validate # of elements
// no larger than the original size. Make the length if (elements < 0)
throw new StreamCorruptedException("Illegal # of Elements: " + elements);
// Clamp original length to be more than elements / loadFactor
// (this is the invariant enforced with auto-growth)
origlength = Math.max(origlength, (int)(elements / loadFactor) + 1);
// Compute new length with a bit of room 5% + 3 to grow but
// no larger than the clamped original length. Make the length
// odd if it's large enough, this helps distribute the entries. // odd if it's large enough, this helps distribute the entries.
// Guard against the length ending up zero, that's not valid. // Guard against the length ending up zero, that's not valid.
int length = (int)(elements * loadFactor) + (elements / 20) + 3; int length = (int)((elements + elements / 20) / loadFactor) + 3;
if (length > elements && (length & 1) == 0) if (length > elements && (length & 1) == 0)
length--; length--;
if (origlength > 0 && length > origlength) length = Math.min(length, origlength);
length = origlength;
table = new Entry<?,?>[length]; table = new Entry<?,?>[length];
threshold = (int)Math.min(length * loadFactor, MAX_ARRAY_SIZE + 1); threshold = (int)Math.min(length * loadFactor, MAX_ARRAY_SIZE + 1);
count = 0; count = 0;
...@@ -1191,7 +1202,7 @@ public class Hashtable<K,V> ...@@ -1191,7 +1202,7 @@ public class Hashtable<K,V>
K key = (K)s.readObject(); K key = (K)s.readObject();
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
V value = (V)s.readObject(); V value = (V)s.readObject();
// synch could be eliminated for performance // sync is eliminated for performance
reconstitutionPut(table, key, value); reconstitutionPut(table, key, value);
} }
} }
...@@ -1203,9 +1214,9 @@ public class Hashtable<K,V> ...@@ -1203,9 +1214,9 @@ public class Hashtable<K,V>
* *
* <p>This differs from the regular put method in several ways. No * <p>This differs from the regular put method in several ways. No
* checking for rehashing is necessary since the number of elements * checking for rehashing is necessary since the number of elements
* initially in the table is known. The modCount is not incremented * initially in the table is known. The modCount is not incremented and
* because we are creating a new instance. Also, no return value * there's no synchronization because we are creating a new instance.
* is needed. * Also, no return value is needed.
*/ */
private void reconstitutionPut(Entry<?,?>[] tab, K key, V value) private void reconstitutionPut(Entry<?,?>[] tab, K key, V value)
throws StreamCorruptedException throws StreamCorruptedException
......
...@@ -485,19 +485,25 @@ public class ConcurrentLinkedQueue<E> extends AbstractQueue<E> ...@@ -485,19 +485,25 @@ public class ConcurrentLinkedQueue<E> extends AbstractQueue<E>
* @return {@code true} if this queue changed as a result of the call * @return {@code true} if this queue changed as a result of the call
*/ */
public boolean remove(Object o) { public boolean remove(Object o) {
if (o == null) return false; if (o != null) {
Node<E> pred = null; Node<E> next, pred = null;
for (Node<E> p = first(); p != null; p = succ(p)) { for (Node<E> p = first(); p != null; pred = p, p = next) {
boolean removed = false;
E item = p.item; E item = p.item;
if (item != null && if (item != null) {
o.equals(item) && if (!o.equals(item)) {
p.casItem(item, null)) { next = succ(p);
Node<E> next = succ(p); continue;
if (pred != null && next != null) }
removed = p.casItem(item, null);
}
next = succ(p);
if (pred != null && next != null) // unlink
pred.casNext(p, next); pred.casNext(p, next);
if (removed)
return true; return true;
} }
pred = p;
} }
return false; return false;
} }
......
...@@ -800,6 +800,7 @@ public class Logger { ...@@ -800,6 +800,7 @@ public class Logger {
* @param level One of the message level identifiers, e.g., SEVERE * @param level One of the message level identifiers, e.g., SEVERE
* @param msgSupplier A function, which when called, produces the * @param msgSupplier A function, which when called, produces the
* desired log message * desired log message
* @since 1.8
*/ */
public void log(Level level, Supplier<String> msgSupplier) { public void log(Level level, Supplier<String> msgSupplier) {
if (!isLoggable(level)) { if (!isLoggable(level)) {
......
/* /*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -64,8 +64,7 @@ final class JceSecurity { ...@@ -64,8 +64,7 @@ final class JceSecurity {
private final static Map<Provider, Object> verifyingProviders = private final static Map<Provider, Object> verifyingProviders =
new IdentityHashMap<>(); new IdentityHashMap<>();
// Set the default value. May be changed in the static initializer. private static final boolean isRestricted;
private static boolean isRestricted = true;
/* /*
* Don't let anyone instantiate this. * Don't let anyone instantiate this.
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
* under the License. * under the License.
*/ */
/* /*
* Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
*/ */
/* /*
* $Id: DOMURIDereferencer.java 1231033 2012-01-13 12:12:12Z coheigea $ * $Id: DOMURIDereferencer.java 1231033 2012-01-13 12:12:12Z coheigea $
...@@ -111,7 +111,8 @@ public class DOMURIDereferencer implements URIDereferencer { ...@@ -111,7 +111,8 @@ public class DOMURIDereferencer implements URIDereferencer {
try { try {
ResourceResolver apacheResolver = ResourceResolver apacheResolver =
ResourceResolver.getInstance(uriAttr, baseURI, secVal); ResourceResolver.getInstance(uriAttr, baseURI, secVal);
XMLSignatureInput in = apacheResolver.resolve(uriAttr, baseURI); XMLSignatureInput in = apacheResolver.resolve(uriAttr,
baseURI, secVal);
if (in.isOctetStream()) { if (in.isOctetStream()) {
return new ApacheOctetStreamData(in); return new ApacheOctetStreamData(in);
} else { } else {
......
...@@ -2898,13 +2898,7 @@ search: ...@@ -2898,13 +2898,7 @@ search:
return comp; return comp;
} }
} else { } else {
// First, prefer application types. // First, prefer text types
comp = compareIndices(primaryTypes, primaryType1, primaryType2,
UNKNOWN_OBJECT_LOSES);
if (comp != 0) {
return comp;
}
if (flavor1.isFlavorTextType()) { if (flavor1.isFlavorTextType()) {
return 1; return 1;
} }
...@@ -2913,6 +2907,13 @@ search: ...@@ -2913,6 +2907,13 @@ search:
return -1; return -1;
} }
// Next, prefer application types.
comp = compareIndices(primaryTypes, primaryType1, primaryType2,
UNKNOWN_OBJECT_LOSES);
if (comp != 0) {
return comp;
}
// Next, look for application/x-java-* types. Prefer unknown // Next, look for application/x-java-* types. Prefer unknown
// MIME types because if the user provides his own data flavor, // MIME types because if the user provides his own data flavor,
// it will likely be the most descriptive one. // it will likely be the most descriptive one.
......
/*
* Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package sun.invoke.anon;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import sun.misc.IOUtils;
/**
* Anonymous class loader. Will load any valid classfile, producing
* a {@link Class} metaobject, without installing that class in the
* system dictionary. Therefore, {@link Class#forName(String)} will never
* produce a reference to an anonymous class.
* <p>
* The access permissions of the anonymous class are borrowed from
* a <em>host class</em>. The new class behaves as if it were an
* inner class of the host class. It can access the host's private
* members, if the creator of the class loader has permission to
* do so (or to create accessible reflective objects).
* <p>
* When the anonymous class is loaded, elements of its constant pool
* can be patched to new values. This provides a hook to pre-resolve
* named classes in the constant pool to other classes, including
* anonymous ones. Also, string constants can be pre-resolved to
* any reference. (The verifier treats non-string, non-class reference
* constants as plain objects.)
* <p>
* Why include the patching function? It makes some use cases much easier.
* Second, the constant pool needed some internal patching anyway,
* to anonymize the loaded class itself. Finally, if you are going
* to use this seriously, you'll want to build anonymous classes
* on top of pre-existing anonymous classes, and that requires patching.
*
* <p>%%% TO-DO:
* <ul>
* <li>needs better documentation</li>
* <li>needs more security work (for safe delegation)</li>
* <li>needs a clearer story about error processing</li>
* <li>patch member references also (use ';' as delimiter char)</li>
* <li>patch method references to (conforming) method handles</li>
* </ul>
*
* @author jrose
* @author Remi Forax
* @see <a href="http://blogs.sun.com/jrose/entry/anonymous_classes_in_the_vm">
* http://blogs.sun.com/jrose/entry/anonymous_classes_in_the_vm</a>
*/
public class AnonymousClassLoader {
final Class<?> hostClass;
// Privileged constructor.
private AnonymousClassLoader(Class<?> hostClass) {
this.hostClass = hostClass;
}
public static AnonymousClassLoader make(sun.misc.Unsafe unsafe, Class<?> hostClass) {
if (unsafe == null) throw new NullPointerException();
return new AnonymousClassLoader(hostClass);
}
public Class<?> loadClass(byte[] classFile) {
if (defineAnonymousClass == null) {
// no JVM support; try to fake an approximation
try {
return fakeLoadClass(new ConstantPoolParser(classFile).createPatch());
} catch (InvalidConstantPoolFormatException ee) {
throw new IllegalArgumentException(ee);
}
}
return loadClass(classFile, null);
}
public Class<?> loadClass(ConstantPoolPatch classPatch) {
if (defineAnonymousClass == null) {
// no JVM support; try to fake an approximation
return fakeLoadClass(classPatch);
}
Object[] patches = classPatch.patchArray;
// Convert class names (this late in the game)
// to use slash '/' instead of dot '.'.
// Java likes dots, but the JVM likes slashes.
for (int i = 0; i < patches.length; i++) {
Object value = patches[i];
if (value != null) {
byte tag = classPatch.getTag(i);
switch (tag) {
case ConstantPoolVisitor.CONSTANT_Class:
if (value instanceof String) {
if (patches == classPatch.patchArray)
patches = patches.clone();
patches[i] = ((String)value).replace('.', '/');
}
break;
case ConstantPoolVisitor.CONSTANT_Fieldref:
case ConstantPoolVisitor.CONSTANT_Methodref:
case ConstantPoolVisitor.CONSTANT_InterfaceMethodref:
case ConstantPoolVisitor.CONSTANT_NameAndType:
// When/if the JVM supports these patches,
// we'll probably need to reformat them also.
// Meanwhile, let the class loader create the error.
break;
}
}
}
return loadClass(classPatch.outer.classFile, classPatch.patchArray);
}
private Class<?> loadClass(byte[] classFile, Object[] patchArray) {
try {
return (Class<?>)
defineAnonymousClass.invoke(unsafe,
hostClass, classFile, patchArray);
} catch (Exception ex) {
throwReflectedException(ex);
throw new RuntimeException("error loading into "+hostClass, ex);
}
}
private static void throwReflectedException(Exception ex) {
if (ex instanceof InvocationTargetException) {
Throwable tex = ((InvocationTargetException)ex).getTargetException();
if (tex instanceof Error)
throw (Error) tex;
ex = (Exception) tex;
}
if (ex instanceof RuntimeException) {
throw (RuntimeException) ex;
}
}
private Class<?> fakeLoadClass(ConstantPoolPatch classPatch) {
// Implementation:
// 1. Make up a new name nobody has used yet.
// 2. Inspect the tail-header of the class to find the this_class index.
// 3. Patch the CONSTANT_Class for this_class to the new name.
// 4. Add other CP entries required by (e.g.) string patches.
// 5. Flatten Class constants down to their names, making sure that
// the host class loader can pick them up again accurately.
// 6. Generate the edited class file bytes.
//
// Potential limitations:
// * The class won't be truly anonymous, and may interfere with others.
// * Flattened class constants might not work, because of loader issues.
// * Pseudo-string constants will not flatten down to real strings.
// * Method handles will (of course) fail to flatten to linkage strings.
if (true) throw new UnsupportedOperationException("NYI");
Object[] cpArray;
try {
cpArray = classPatch.getOriginalCP();
} catch (InvalidConstantPoolFormatException ex) {
throw new RuntimeException(ex);
}
int thisClassIndex = classPatch.getParser().getThisClassIndex();
String thisClassName = (String) cpArray[thisClassIndex];
synchronized (AnonymousClassLoader.class) {
thisClassName = thisClassName+"\\|"+(++fakeNameCounter);
}
classPatch.putUTF8(thisClassIndex, thisClassName);
byte[] classFile = null;
return unsafe.defineClass(null, classFile, 0, classFile.length,
hostClass.getClassLoader(),
hostClass.getProtectionDomain());
}
private static int fakeNameCounter = 99999;
// ignore two warnings on this line:
private static sun.misc.Unsafe unsafe = sun.misc.Unsafe.getUnsafe();
// preceding line requires that this class be on the boot class path
static private final Method defineAnonymousClass;
static {
Method dac = null;
Class<? extends sun.misc.Unsafe> unsafeClass = unsafe.getClass();
try {
dac = unsafeClass.getMethod("defineAnonymousClass",
Class.class,
byte[].class,
Object[].class);
} catch (Exception ee) {
dac = null;
}
defineAnonymousClass = dac;
}
private static void noJVMSupport() {
throw new UnsupportedOperationException("no JVM support for anonymous classes");
}
private static native Class<?> loadClassInternal(Class<?> hostClass,
byte[] classFile,
Object[] patchArray);
public static byte[] readClassFile(Class<?> templateClass) throws IOException {
String templateName = templateClass.getName();
int lastDot = templateName.lastIndexOf('.');
java.net.URL url = templateClass.getResource(templateName.substring(lastDot+1)+".class");
java.net.URLConnection connection = url.openConnection();
int contentLength = connection.getContentLength();
if (contentLength < 0)
throw new IOException("invalid content length "+contentLength);
return IOUtils.readFully(connection.getInputStream(), contentLength, true);
}
}
/*
* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package sun.invoke.anon;
import java.io.IOException;
import java.io.OutputStream;
import java.nio.BufferUnderflowException;
import java.nio.ByteBuffer;
import static sun.invoke.anon.ConstantPoolVisitor.*;
/** A constant pool parser.
*/
public class ConstantPoolParser {
final byte[] classFile;
final byte[] tags;
final char[] firstHeader; // maghi, maglo, minor, major, cplen
// these are filled in on first parse:
int endOffset;
char[] secondHeader; // flags, this_class, super_class, intlen
// used to decode UTF8 array
private char[] charArray = new char[80];
/** Creates a constant pool parser.
* @param classFile an array of bytes containing a class.
* @throws InvalidConstantPoolFormatException if the header of the class has errors.
*/
public ConstantPoolParser(byte[] classFile) throws InvalidConstantPoolFormatException {
this.classFile = classFile;
this.firstHeader = parseHeader(classFile);
this.tags = new byte[firstHeader[4]];
}
/** Create a constant pool parser by loading the bytecodes of the
* class taken as argument.
*
* @param templateClass the class to parse.
*
* @throws IOException raised if an I/O occurs when loading
* the bytecode of the template class.
* @throws InvalidConstantPoolFormatException if the header of the class has errors.
*
* @see #ConstantPoolParser(byte[])
* @see AnonymousClassLoader#readClassFile(Class)
*/
public ConstantPoolParser(Class<?> templateClass) throws IOException, InvalidConstantPoolFormatException {
this(AnonymousClassLoader.readClassFile(templateClass));
}
/** Creates an empty patch to patch the class file
* used by the current parser.
* @return a new class patch.
*/
public ConstantPoolPatch createPatch() {
return new ConstantPoolPatch(this);
}
/** Report the tag of the indicated CP entry.
* @param index
* @return one of {@link ConstantPoolVisitor#CONSTANT_Utf8}, etc.
*/
public byte getTag(int index) {
getEndOffset(); // trigger an exception if we haven't parsed yet
return tags[index];
}
/** Report the length of the constant pool. */
public int getLength() {
return firstHeader[4];
}
/** Report the offset, within the class file, of the start of the constant pool. */
public int getStartOffset() {
return firstHeader.length * 2;
}
/** Report the offset, within the class file, of the end of the constant pool. */
public int getEndOffset() {
if (endOffset == 0)
throw new IllegalStateException("class file has not yet been parsed");
return endOffset;
}
/** Report the CP index of this class's own name. */
public int getThisClassIndex() {
getEndOffset(); // provoke exception if not yet parsed
return secondHeader[1];
}
/** Report the total size of the class file. */
public int getTailLength() {
return classFile.length - getEndOffset();
}
/** Write the head (header plus constant pool)
* of the class file to the indicated stream.
*/
public void writeHead(OutputStream out) throws IOException {
out.write(classFile, 0, getEndOffset());
}
/** Write the head (header plus constant pool)
* of the class file to the indicated stream,
* incorporating the non-null entries of the given array
* as patches.
*/
void writePatchedHead(OutputStream out, Object[] patchArray) {
// this will be useful to partially emulate the class loader on old JVMs
throw new UnsupportedOperationException("Not yet implemented");
}
/** Write the tail (everything after the constant pool)
* of the class file to the indicated stream.
*/
public void writeTail(OutputStream out) throws IOException {
out.write(classFile, getEndOffset(), getTailLength());
}
private static char[] parseHeader(byte[] classFile) throws InvalidConstantPoolFormatException {
char[] result = new char[5];
ByteBuffer buffer = ByteBuffer.wrap(classFile);
for (int i = 0; i < result.length; i++)
result[i] = (char) getUnsignedShort(buffer);
int magic = result[0] << 16 | result[1] << 0;
if (magic != 0xCAFEBABE)
throw new InvalidConstantPoolFormatException("invalid magic number "+magic);
// skip major, minor version
int len = result[4];
if (len < 1)
throw new InvalidConstantPoolFormatException("constant pool length < 1");
return result;
}
/** Parse the constant pool of the class
* calling a method visit* each time a constant pool entry is parsed.
*
* The order of the calls to visit* is not guaranteed to be the same
* than the order of the constant pool entry in the bytecode array.
*
* @param visitor
* @throws InvalidConstantPoolFormatException
*/
public void parse(ConstantPoolVisitor visitor) throws InvalidConstantPoolFormatException {
ByteBuffer buffer = ByteBuffer.wrap(classFile);
buffer.position(getStartOffset()); //skip header
Object[] values = new Object[getLength()];
try {
parseConstantPool(buffer, values, visitor);
} catch(BufferUnderflowException e) {
throw new InvalidConstantPoolFormatException(e);
}
if (endOffset == 0) {
endOffset = buffer.position();
secondHeader = new char[4];
for (int i = 0; i < secondHeader.length; i++) {
secondHeader[i] = (char) getUnsignedShort(buffer);
}
}
resolveConstantPool(values, visitor);
}
private char[] getCharArray(int utfLength) {
if (utfLength <= charArray.length)
return charArray;
return charArray = new char[utfLength];
}
private void parseConstantPool(ByteBuffer buffer, Object[] values, ConstantPoolVisitor visitor) throws InvalidConstantPoolFormatException {
for (int i = 1; i < tags.length; ) {
byte tag = (byte) getUnsignedByte(buffer);
assert(tags[i] == 0 || tags[i] == tag);
tags[i] = tag;
switch (tag) {
case CONSTANT_Utf8:
int utfLen = getUnsignedShort(buffer);
String value = getUTF8(buffer, utfLen, getCharArray(utfLen));
visitor.visitUTF8(i, CONSTANT_Utf8, value);
tags[i] = tag;
values[i++] = value;
break;
case CONSTANT_Integer:
visitor.visitConstantValue(i, tag, buffer.getInt());
i++;
break;
case CONSTANT_Float:
visitor.visitConstantValue(i, tag, buffer.getFloat());
i++;
break;
case CONSTANT_Long:
visitor.visitConstantValue(i, tag, buffer.getLong());
i+=2;
break;
case CONSTANT_Double:
visitor.visitConstantValue(i, tag, buffer.getDouble());
i+=2;
break;
case CONSTANT_Class: // fall through:
case CONSTANT_String:
tags[i] = tag;
values[i++] = new int[] { getUnsignedShort(buffer) };
break;
case CONSTANT_Fieldref: // fall through:
case CONSTANT_Methodref: // fall through:
case CONSTANT_InterfaceMethodref: // fall through:
case CONSTANT_NameAndType:
tags[i] = tag;
values[i++] = new int[] { getUnsignedShort(buffer), getUnsignedShort(buffer) };
break;
default:
throw new AssertionError("invalid constant "+tag);
}
}
}
private void resolveConstantPool(Object[] values, ConstantPoolVisitor visitor) {
// clean out the int[] values, which are temporary
for (int beg = 1, end = values.length-1, beg2, end2;
beg <= end;
beg = beg2, end = end2) {
beg2 = end; end2 = beg-1;
//System.out.println("CP resolve pass: "+beg+".."+end);
for (int i = beg; i <= end; i++) {
Object value = values[i];
if (!(value instanceof int[]))
continue;
int[] array = (int[]) value;
byte tag = tags[i];
switch (tag) {
case CONSTANT_String:
String stringBody = (String) values[array[0]];
visitor.visitConstantString(i, tag, stringBody, array[0]);
values[i] = null;
break;
case CONSTANT_Class: {
String className = (String) values[array[0]];
// use the external form favored by Class.forName:
className = className.replace('/', '.');
visitor.visitConstantString(i, tag, className, array[0]);
values[i] = className;
break;
}
case CONSTANT_NameAndType: {
String memberName = (String) values[array[0]];
String signature = (String) values[array[1]];
visitor.visitDescriptor(i, tag, memberName, signature,
array[0], array[1]);
values[i] = new String[] {memberName, signature};
break;
}
case CONSTANT_Fieldref: // fall through:
case CONSTANT_Methodref: // fall through:
case CONSTANT_InterfaceMethodref: {
Object className = values[array[0]];
Object nameAndType = values[array[1]];
if (!(className instanceof String) ||
!(nameAndType instanceof String[])) {
// one more pass is needed
if (beg2 > i) beg2 = i;
if (end2 < i) end2 = i;
continue;
}
String[] nameAndTypeArray = (String[]) nameAndType;
visitor.visitMemberRef(i, tag,
(String)className,
nameAndTypeArray[0],
nameAndTypeArray[1],
array[0], array[1]);
values[i] = null;
}
break;
default:
continue;
}
}
}
}
private static int getUnsignedByte(ByteBuffer buffer) {
return buffer.get() & 0xFF;
}
private static int getUnsignedShort(ByteBuffer buffer) {
int b1 = getUnsignedByte(buffer);
int b2 = getUnsignedByte(buffer);
return (b1 << 8) + (b2 << 0);
}
private static String getUTF8(ByteBuffer buffer, int utfLen, char[] charArray) throws InvalidConstantPoolFormatException {
int utfLimit = buffer.position() + utfLen;
int index = 0;
while (buffer.position() < utfLimit) {
int c = buffer.get() & 0xff;
if (c > 127) {
buffer.position(buffer.position() - 1);
return getUTF8Extended(buffer, utfLimit, charArray, index);
}
charArray[index++] = (char)c;
}
return new String(charArray, 0, index);
}
private static String getUTF8Extended(ByteBuffer buffer, int utfLimit, char[] charArray, int index) throws InvalidConstantPoolFormatException {
int c, c2, c3;
while (buffer.position() < utfLimit) {
c = buffer.get() & 0xff;
switch (c >> 4) {
case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7:
/* 0xxxxxxx*/
charArray[index++] = (char)c;
break;
case 12: case 13:
/* 110x xxxx 10xx xxxx*/
c2 = buffer.get();
if ((c2 & 0xC0) != 0x80)
throw new InvalidConstantPoolFormatException(
"malformed input around byte " + buffer.position());
charArray[index++] = (char)(((c & 0x1F) << 6) |
(c2 & 0x3F));
break;
case 14:
/* 1110 xxxx 10xx xxxx 10xx xxxx */
c2 = buffer.get();
c3 = buffer.get();
if (((c2 & 0xC0) != 0x80) || ((c3 & 0xC0) != 0x80))
throw new InvalidConstantPoolFormatException(
"malformed input around byte " + (buffer.position()));
charArray[index++] = (char)(((c & 0x0F) << 12) |
((c2 & 0x3F) << 6) |
((c3 & 0x3F) << 0));
break;
default:
/* 10xx xxxx, 1111 xxxx */
throw new InvalidConstantPoolFormatException(
"malformed input around byte " + buffer.position());
}
}
// The number of chars produced may be less than utflen
return new String(charArray, 0, index);
}
}
/*
* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package sun.invoke.anon;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Arrays;
import java.util.HashSet;
import java.util.IdentityHashMap;
import java.util.Map;
import static sun.invoke.anon.ConstantPoolVisitor.*;
/** A class and its patched constant pool.
*
* This class allow to modify (patch) a constant pool
* by changing the value of its entry.
* Entry are referenced using index that can be get
* by parsing the constant pool using
* {@link ConstantPoolParser#parse(ConstantPoolVisitor)}.
*
* @see ConstantPoolVisitor
* @see ConstantPoolParser#createPatch()
*/
public class ConstantPoolPatch {
final ConstantPoolParser outer;
final Object[] patchArray;
ConstantPoolPatch(ConstantPoolParser outer) {
this.outer = outer;
this.patchArray = new Object[outer.getLength()];
}
/** Create a {@link ConstantPoolParser} and
* a {@link ConstantPoolPatch} in one step.
* Equivalent to {@code new ConstantPoolParser(classFile).createPatch()}.
*
* @param classFile an array of bytes containing a class.
* @see #ConstantPoolParser(Class)
*/
public ConstantPoolPatch(byte[] classFile) throws InvalidConstantPoolFormatException {
this(new ConstantPoolParser(classFile));
}
/** Create a {@link ConstantPoolParser} and
* a {@link ConstantPoolPatch} in one step.
* Equivalent to {@code new ConstantPoolParser(templateClass).createPatch()}.
*
* @param templateClass the class to parse.
* @see #ConstantPoolParser(Class)
*/
public ConstantPoolPatch(Class<?> templateClass) throws IOException, InvalidConstantPoolFormatException {
this(new ConstantPoolParser(templateClass));
}
/** Creates a patch from an existing patch.
* All changes are copied from that patch.
* @param patch a patch
*
* @see ConstantPoolParser#createPatch()
*/
public ConstantPoolPatch(ConstantPoolPatch patch) {
outer = patch.outer;
patchArray = patch.patchArray.clone();
}
/** Which parser built this patch? */
public ConstantPoolParser getParser() {
return outer;
}
/** Report the tag at the given index in the constant pool. */
public byte getTag(int index) {
return outer.getTag(index);
}
/** Report the current patch at the given index of the constant pool.
* Null means no patch will be made.
* To observe the unpatched entry at the given index, use
* {@link #getParser()}{@code .}@link ConstantPoolParser#parse(ConstantPoolVisitor)}
*/
public Object getPatch(int index) {
Object value = patchArray[index];
if (value == null) return null;
switch (getTag(index)) {
case CONSTANT_Fieldref:
case CONSTANT_Methodref:
case CONSTANT_InterfaceMethodref:
if (value instanceof String)
value = stripSemis(2, (String) value);
break;
case CONSTANT_NameAndType:
if (value instanceof String)
value = stripSemis(1, (String) value);
break;
}
return value;
}
/** Clear all patches. */
public void clear() {
Arrays.fill(patchArray, null);
}
/** Clear one patch. */
public void clear(int index) {
patchArray[index] = null;
}
/** Produce the patches as an array. */
public Object[] getPatches() {
return patchArray.clone();
}
/** Produce the original constant pool as an array. */
public Object[] getOriginalCP() throws InvalidConstantPoolFormatException {
return getOriginalCP(0, patchArray.length, -1);
}
/** Walk the constant pool, applying patches using the given map.
*
* @param utf8Map Utf8 strings to modify, if encountered
* @param classMap Classes (or their names) to modify, if encountered
* @param valueMap Constant values to modify, if encountered
* @param deleteUsedEntries if true, delete map entries that are used
*/
public void putPatches(final Map<String,String> utf8Map,
final Map<String,Object> classMap,
final Map<Object,Object> valueMap,
boolean deleteUsedEntries) throws InvalidConstantPoolFormatException {
final HashSet<String> usedUtf8Keys;
final HashSet<String> usedClassKeys;
final HashSet<Object> usedValueKeys;
if (deleteUsedEntries) {
usedUtf8Keys = (utf8Map == null) ? null : new HashSet<String>();
usedClassKeys = (classMap == null) ? null : new HashSet<String>();
usedValueKeys = (valueMap == null) ? null : new HashSet<Object>();
} else {
usedUtf8Keys = null;
usedClassKeys = null;
usedValueKeys = null;
}
outer.parse(new ConstantPoolVisitor() {
@Override
public void visitUTF8(int index, byte tag, String utf8) {
putUTF8(index, utf8Map.get(utf8));
if (usedUtf8Keys != null) usedUtf8Keys.add(utf8);
}
@Override
public void visitConstantValue(int index, byte tag, Object value) {
putConstantValue(index, tag, valueMap.get(value));
if (usedValueKeys != null) usedValueKeys.add(value);
}
@Override
public void visitConstantString(int index, byte tag, String name, int nameIndex) {
if (tag == CONSTANT_Class) {
putConstantValue(index, tag, classMap.get(name));
if (usedClassKeys != null) usedClassKeys.add(name);
} else {
assert(tag == CONSTANT_String);
visitConstantValue(index, tag, name);
}
}
});
if (usedUtf8Keys != null) utf8Map.keySet().removeAll(usedUtf8Keys);
if (usedClassKeys != null) classMap.keySet().removeAll(usedClassKeys);
if (usedValueKeys != null) valueMap.keySet().removeAll(usedValueKeys);
}
Object[] getOriginalCP(final int startIndex,
final int endIndex,
final int tagMask) throws InvalidConstantPoolFormatException {
final Object[] cpArray = new Object[endIndex - startIndex];
outer.parse(new ConstantPoolVisitor() {
void show(int index, byte tag, Object value) {
if (index < startIndex || index >= endIndex) return;
if (((1 << tag) & tagMask) == 0) return;
cpArray[index - startIndex] = value;
}
@Override
public void visitUTF8(int index, byte tag, String utf8) {
show(index, tag, utf8);
}
@Override
public void visitConstantValue(int index, byte tag, Object value) {
assert(tag != CONSTANT_String);
show(index, tag, value);
}
@Override
public void visitConstantString(int index, byte tag,
String value, int j) {
show(index, tag, value);
}
@Override
public void visitMemberRef(int index, byte tag,
String className, String memberName,
String signature,
int j, int k) {
show(index, tag, new String[]{ className, memberName, signature });
}
@Override
public void visitDescriptor(int index, byte tag,
String memberName, String signature,
int j, int k) {
show(index, tag, new String[]{ memberName, signature });
}
});
return cpArray;
}
/** Write the head (header plus constant pool)
* of the patched class file to the indicated stream.
*/
void writeHead(OutputStream out) throws IOException {
outer.writePatchedHead(out, patchArray);
}
/** Write the tail (everything after the constant pool)
* of the patched class file to the indicated stream.
*/
void writeTail(OutputStream out) throws IOException {
outer.writeTail(out);
}
private void checkConstantTag(byte tag, Object value) {
if (value == null)
throw new IllegalArgumentException(
"invalid null constant value");
if (classForTag(tag) != value.getClass())
throw new IllegalArgumentException(
"invalid constant value"
+ (tag == CONSTANT_None ? ""
: " for tag "+tagName(tag))
+ " of class "+value.getClass());
}
private void checkTag(int index, byte putTag) {
byte tag = outer.tags[index];
if (tag != putTag)
throw new IllegalArgumentException(
"invalid put operation"
+ " for " + tagName(putTag)
+ " at index " + index + " found " + tagName(tag));
}
private void checkTagMask(int index, int tagBitMask) {
byte tag = outer.tags[index];
int tagBit = ((tag & 0x1F) == tag) ? (1 << tag) : 0;
if ((tagBit & tagBitMask) == 0)
throw new IllegalArgumentException(
"invalid put operation"
+ " at index " + index + " found " + tagName(tag));
}
private static void checkMemberName(String memberName) {
if (memberName.indexOf(';') >= 0)
throw new IllegalArgumentException("memberName " + memberName + " contains a ';'");
}
/** Set the entry of the constant pool indexed by index to
* a new string.
*
* @param index an index to a constant pool entry containing a
* {@link ConstantPoolVisitor#CONSTANT_Utf8} value.
* @param utf8 a string
*
* @see ConstantPoolVisitor#visitUTF8(int, byte, String)
*/
public void putUTF8(int index, String utf8) {
if (utf8 == null) { clear(index); return; }
checkTag(index, CONSTANT_Utf8);
patchArray[index] = utf8;
}
/** Set the entry of the constant pool indexed by index to
* a new value, depending on its dynamic type.
*
* @param index an index to a constant pool entry containing a
* one of the following structures:
* {@link ConstantPoolVisitor#CONSTANT_Integer},
* {@link ConstantPoolVisitor#CONSTANT_Float},
* {@link ConstantPoolVisitor#CONSTANT_Long},
* {@link ConstantPoolVisitor#CONSTANT_Double},
* {@link ConstantPoolVisitor#CONSTANT_String}, or
* {@link ConstantPoolVisitor#CONSTANT_Class}
* @param value a boxed int, float, long or double; or a string or class object
* @throws IllegalArgumentException if the type of the constant does not
* match the constant pool entry type,
* as reported by {@link #getTag(int)}
*
* @see #putConstantValue(int, byte, Object)
* @see ConstantPoolVisitor#visitConstantValue(int, byte, Object)
* @see ConstantPoolVisitor#visitConstantString(int, byte, String, int)
*/
public void putConstantValue(int index, Object value) {
if (value == null) { clear(index); return; }
byte tag = tagForConstant(value.getClass());
checkConstantTag(tag, value);
checkTag(index, tag);
patchArray[index] = value;
}
/** Set the entry of the constant pool indexed by index to
* a new value.
*
* @param index an index to a constant pool entry matching the given tag
* @param tag one of the following values:
* {@link ConstantPoolVisitor#CONSTANT_Integer},
* {@link ConstantPoolVisitor#CONSTANT_Float},
* {@link ConstantPoolVisitor#CONSTANT_Long},
* {@link ConstantPoolVisitor#CONSTANT_Double},
* {@link ConstantPoolVisitor#CONSTANT_String}, or
* {@link ConstantPoolVisitor#CONSTANT_Class}
* @param value a boxed number, string, or class object
* @throws IllegalArgumentException if the type of the constant does not
* match the constant pool entry type, or if a class name contains
* '/' or ';'
*
* @see #putConstantValue(int, Object)
* @see ConstantPoolVisitor#visitConstantValue(int, byte, Object)
* @see ConstantPoolVisitor#visitConstantString(int, byte, String, int)
*/
public void putConstantValue(int index, byte tag, Object value) {
if (value == null) { clear(index); return; }
checkTag(index, tag);
if (tag == CONSTANT_Class && value instanceof String) {
checkClassName((String) value);
} else if (tag == CONSTANT_String) {
// the JVM accepts any object as a patch for a string
} else {
// make sure the incoming value is the right type
checkConstantTag(tag, value);
}
checkTag(index, tag);
patchArray[index] = value;
}
/** Set the entry of the constant pool indexed by index to
* a new {@link ConstantPoolVisitor#CONSTANT_NameAndType} value.
*
* @param index an index to a constant pool entry containing a
* {@link ConstantPoolVisitor#CONSTANT_NameAndType} value.
* @param memberName a memberName
* @param signature a signature
* @throws IllegalArgumentException if memberName contains the character ';'
*
* @see ConstantPoolVisitor#visitDescriptor(int, byte, String, String, int, int)
*/
public void putDescriptor(int index, String memberName, String signature) {
checkTag(index, CONSTANT_NameAndType);
checkMemberName(memberName);
patchArray[index] = addSemis(memberName, signature);
}
/** Set the entry of the constant pool indexed by index to
* a new {@link ConstantPoolVisitor#CONSTANT_Fieldref},
* {@link ConstantPoolVisitor#CONSTANT_Methodref}, or
* {@link ConstantPoolVisitor#CONSTANT_InterfaceMethodref} value.
*
* @param index an index to a constant pool entry containing a member reference
* @param className a class name
* @param memberName a field or method name
* @param signature a field or method signature
* @throws IllegalArgumentException if memberName contains the character ';'
* or signature is not a correct signature
*
* @see ConstantPoolVisitor#visitMemberRef(int, byte, String, String, String, int, int)
*/
public void putMemberRef(int index, byte tag,
String className, String memberName, String signature) {
checkTagMask(tag, CONSTANT_MemberRef_MASK);
checkTag(index, tag);
checkClassName(className);
checkMemberName(memberName);
if (signature.startsWith("(") == (tag == CONSTANT_Fieldref))
throw new IllegalArgumentException("bad signature: "+signature);
patchArray[index] = addSemis(className, memberName, signature);
}
static private final int CONSTANT_MemberRef_MASK =
CONSTANT_Fieldref
| CONSTANT_Methodref
| CONSTANT_InterfaceMethodref;
private static final Map<Class<?>, Byte> CONSTANT_VALUE_CLASS_TAG
= new IdentityHashMap<Class<?>, Byte>();
private static final Class<?>[] CONSTANT_VALUE_CLASS = new Class<?>[16];
static {
Object[][] values = {
{Integer.class, CONSTANT_Integer},
{Long.class, CONSTANT_Long},
{Float.class, CONSTANT_Float},
{Double.class, CONSTANT_Double},
{String.class, CONSTANT_String},
{Class.class, CONSTANT_Class}
};
for (Object[] value : values) {
Class<?> cls = (Class<?>)value[0];
Byte tag = (Byte) value[1];
CONSTANT_VALUE_CLASS_TAG.put(cls, tag);
CONSTANT_VALUE_CLASS[(byte)tag] = cls;
}
}
static Class<?> classForTag(byte tag) {
if ((tag & 0xFF) >= CONSTANT_VALUE_CLASS.length)
return null;
return CONSTANT_VALUE_CLASS[tag];
}
static byte tagForConstant(Class<?> cls) {
Byte tag = CONSTANT_VALUE_CLASS_TAG.get(cls);
return (tag == null) ? CONSTANT_None : (byte)tag;
}
private static void checkClassName(String className) {
if (className.indexOf('/') >= 0 || className.indexOf(';') >= 0)
throw new IllegalArgumentException("invalid class name " + className);
}
static String addSemis(String name, String... names) {
StringBuilder buf = new StringBuilder(name.length() * 5);
buf.append(name);
for (String name2 : names) {
buf.append(';').append(name2);
}
String res = buf.toString();
assert(stripSemis(names.length, res)[0].equals(name));
assert(stripSemis(names.length, res)[1].equals(names[0]));
assert(names.length == 1 ||
stripSemis(names.length, res)[2].equals(names[1]));
return res;
}
static String[] stripSemis(int count, String string) {
String[] res = new String[count+1];
int pos = 0;
for (int i = 0; i < count; i++) {
int pos2 = string.indexOf(';', pos);
if (pos2 < 0) pos2 = string.length(); // yuck
res[i] = string.substring(pos, pos2);
pos = pos2;
}
res[count] = string.substring(pos);
return res;
}
public String toString() {
StringBuilder buf = new StringBuilder(this.getClass().getName());
buf.append("{");
Object[] origCP = null;
for (int i = 0; i < patchArray.length; i++) {
if (patchArray[i] == null) continue;
if (origCP != null) {
buf.append(", ");
} else {
try {
origCP = getOriginalCP();
} catch (InvalidConstantPoolFormatException ee) {
origCP = new Object[0];
}
}
Object orig = (i < origCP.length) ? origCP[i] : "?";
buf.append(orig).append("=").append(patchArray[i]);
}
buf.append("}");
return buf.toString();
}
}
/*
* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package sun.invoke.anon;
/**
* A visitor called by {@link ConstantPoolParser#parse(ConstantPoolVisitor)}
* when a constant pool entry is parsed.
* <p>
* A visit* method is called when a constant pool entry is parsed.
* The first argument is always the constant pool index.
* The second argument is always the constant pool tag,
* even for methods like {@link #visitUTF8(int, byte, String)} which only apply to one tag.
* String arguments refer to Utf8 or NameAndType entries declared elsewhere,
* and are always accompanied by the indexes of those entries.
* <p>
* The order of the calls to the visit* methods is not necessarily related
* to the order of the entries in the constant pool.
* If one entry has a reference to another entry, the latter (lower-level)
* entry will be visited first.
* <p>
* The following table shows the relation between constant pool entry
* types and the corresponding visit* methods:
*
* <table border=1 cellpadding=5 summary="constant pool visitor methods">
* <tr><th>Tag(s)</th><th>Method</th></tr>
* <tr>
* <td>{@link #CONSTANT_Utf8}</td>
* <td>{@link #visitUTF8(int, byte, String)}</td>
* </tr><tr>
* <td>{@link #CONSTANT_Integer}, {@link #CONSTANT_Float},
* {@link #CONSTANT_Long}, {@link #CONSTANT_Double}</td>
* <td>{@link #visitConstantValue(int, byte, Object)}</td>
* </tr><tr>
* <td>{@link #CONSTANT_String}, {@link #CONSTANT_Class}</td>
* <td>{@link #visitConstantString(int, byte, String, int)}</td>
* </tr><tr>
* <td>{@link #CONSTANT_NameAndType}</td>
* <td>{@link #visitDescriptor(int, byte, String, String, int, int)}</td>
* </tr><tr>
* <td>{@link #CONSTANT_Fieldref},
* {@link #CONSTANT_Methodref},
* {@link #CONSTANT_InterfaceMethodref}</td>
* <td>{@link #visitMemberRef(int, byte, String, String, String, int, int)}</td>
* </tr>
* </table>
*
* @see ConstantPoolPatch
* @author Remi Forax
* @author jrose
*/
public class ConstantPoolVisitor {
/** Called each time an UTF8 constant pool entry is found.
* @param index the constant pool index
* @param tag always {@link #CONSTANT_Utf8}
* @param utf8 string encoded in modified UTF-8 format passed as a {@code String}
*
* @see ConstantPoolPatch#putUTF8(int, String)
*/
public void visitUTF8(int index, byte tag, String utf8) {
// do nothing
}
/** Called for each constant pool entry that encodes an integer,
* a float, a long, or a double.
* Constant strings and classes are not managed by this method but
* by {@link #visitConstantString(int, byte, String, int)}.
*
* @param index the constant pool index
* @param tag one of {@link #CONSTANT_Integer},
* {@link #CONSTANT_Float},
* {@link #CONSTANT_Long},
* or {@link #CONSTANT_Double}
* @param value encoded value
*
* @see ConstantPoolPatch#putConstantValue(int, Object)
*/
public void visitConstantValue(int index, byte tag, Object value) {
// do nothing
}
/** Called for each constant pool entry that encodes a string or a class.
* @param index the constant pool index
* @param tag one of {@link #CONSTANT_String},
* {@link #CONSTANT_Class},
* @param name string body or class name (using dot separator)
* @param nameIndex the index of the Utf8 string for the name
*
* @see ConstantPoolPatch#putConstantValue(int, byte, Object)
*/
public void visitConstantString(int index, byte tag,
String name, int nameIndex) {
// do nothing
}
/** Called for each constant pool entry that encodes a name and type.
* @param index the constant pool index
* @param tag always {@link #CONSTANT_NameAndType}
* @param memberName a field or method name
* @param signature the member signature
* @param memberNameIndex index of the Utf8 string for the member name
* @param signatureIndex index of the Utf8 string for the signature
*
* @see ConstantPoolPatch#putDescriptor(int, String, String)
*/
public void visitDescriptor(int index, byte tag,
String memberName, String signature,
int memberNameIndex, int signatureIndex) {
// do nothing
}
/** Called for each constant pool entry that encodes a field or method.
* @param index the constant pool index
* @param tag one of {@link #CONSTANT_Fieldref},
* or {@link #CONSTANT_Methodref},
* or {@link #CONSTANT_InterfaceMethodref}
* @param className the class name (using dot separator)
* @param memberName name of the field or method
* @param signature the field or method signature
* @param classNameIndex index of the Utf8 string for the class name
* @param descriptorIndex index of the NameAndType descriptor constant
*
* @see ConstantPoolPatch#putMemberRef(int, byte, String, String, String)
*/
public void visitMemberRef(int index, byte tag,
String className, String memberName, String signature,
int classNameIndex, int descriptorIndex) {
// do nothing
}
public static final byte
CONSTANT_None = 0,
CONSTANT_Utf8 = 1,
//CONSTANT_Unicode = 2, /* unused */
CONSTANT_Integer = 3,
CONSTANT_Float = 4,
CONSTANT_Long = 5,
CONSTANT_Double = 6,
CONSTANT_Class = 7,
CONSTANT_String = 8,
CONSTANT_Fieldref = 9,
CONSTANT_Methodref = 10,
CONSTANT_InterfaceMethodref = 11,
CONSTANT_NameAndType = 12;
private static String[] TAG_NAMES = {
"Empty",
"Utf8",
null, //"Unicode",
"Integer",
"Float",
"Long",
"Double",
"Class",
"String",
"Fieldref",
"Methodref",
"InterfaceMethodref",
"NameAndType"
};
public static String tagName(byte tag) {
String name = null;
if ((tag & 0xFF) < TAG_NAMES.length)
name = TAG_NAMES[tag];
if (name == null)
name = "Unknown#"+(tag&0xFF);
return name;
}
}
# #
# Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
...@@ -44,7 +44,7 @@ java.launcher.X.macosx.usage=\n\u4E0B\u5217\u662F Mac OS X \u7279\u5B9A\u9078\u9 ...@@ -44,7 +44,7 @@ java.launcher.X.macosx.usage=\n\u4E0B\u5217\u662F Mac OS X \u7279\u5B9A\u9078\u9
java.launcher.cls.error1=\u932F\u8AA4: \u627E\u4E0D\u5230\u6216\u7121\u6CD5\u8F09\u5165\u4E3B\u8981\u985E\u5225 {0} java.launcher.cls.error1=\u932F\u8AA4: \u627E\u4E0D\u5230\u6216\u7121\u6CD5\u8F09\u5165\u4E3B\u8981\u985E\u5225 {0}
java.launcher.cls.error2=\u932F\u8AA4: \u4E3B\u8981\u65B9\u6CD5\u4E0D\u662F\u985E\u5225 {1} \u4E2D\u7684 {0}\uFF0C\u8ACB\u5B9A\u7FA9\u4E3B\u8981\u65B9\u6CD5\u70BA:\n public static void main(String[] args) java.launcher.cls.error2=\u932F\u8AA4: \u4E3B\u8981\u65B9\u6CD5\u4E0D\u662F\u985E\u5225 {1} \u4E2D\u7684 {0}\uFF0C\u8ACB\u5B9A\u7FA9\u4E3B\u8981\u65B9\u6CD5\u70BA:\n public static void main(String[] args)
java.launcher.cls.error3=\u932F\u8AA4: \u4E3B\u8981\u65B9\u6CD5\u5FC5\u9808\u50B3\u56DE\u985E\u5225 {0} \u4E2D void \u985E\u578B\u7684\u503C\uFF0C \n\u8ACB\u5B9A\u7FA9\u4E3B\u8981\u65B9\u6CD5\u70BA:\n public static void main(String[] args) java.launcher.cls.error3=\u932F\u8AA4: \u4E3B\u8981\u65B9\u6CD5\u5FC5\u9808\u50B3\u56DE\u985E\u5225 {0} \u4E2D void \u985E\u578B\u7684\u503C\uFF0C\n\u8ACB\u5B9A\u7FA9\u4E3B\u8981\u65B9\u6CD5\u70BA:\n public static void main(String[] args)
java.launcher.cls.error4=\u932F\u8AA4: \u5728\u985E\u5225 {0} \u4E2D\u627E\u4E0D\u5230\u4E3B\u8981\u65B9\u6CD5\uFF0C\u8ACB\u5B9A\u7FA9\u4E3B\u8981\u65B9\u6CD5\u70BA:\n public static void main(String[] args)\n\u6216\u8005 JavaFX \u61C9\u7528\u7A0B\u5F0F\u985E\u5225\u5FC5\u9808\u64F4\u5145 {1} java.launcher.cls.error4=\u932F\u8AA4: \u5728\u985E\u5225 {0} \u4E2D\u627E\u4E0D\u5230\u4E3B\u8981\u65B9\u6CD5\uFF0C\u8ACB\u5B9A\u7FA9\u4E3B\u8981\u65B9\u6CD5\u70BA:\n public static void main(String[] args)\n\u6216\u8005 JavaFX \u61C9\u7528\u7A0B\u5F0F\u985E\u5225\u5FC5\u9808\u64F4\u5145 {1}
java.launcher.cls.error5=\u932F\u8AA4: \u907A\u6F0F\u57F7\u884C\u6B64\u61C9\u7528\u7A0B\u5F0F\u6240\u9700\u7684 JavaFX \u7A0B\u5F0F\u5BE6\u969B\u57F7\u884C\u5143\u4EF6 java.launcher.cls.error5=\u932F\u8AA4: \u907A\u6F0F\u57F7\u884C\u6B64\u61C9\u7528\u7A0B\u5F0F\u6240\u9700\u7684 JavaFX \u7A0B\u5F0F\u5BE6\u969B\u57F7\u884C\u5143\u4EF6
java.launcher.jar.error1=\u932F\u8AA4: \u5617\u8A66\u958B\u555F\u6A94\u6848 {0} \u6642\u767C\u751F\u672A\u9810\u671F\u7684\u932F\u8AA4 java.launcher.jar.error1=\u932F\u8AA4: \u5617\u8A66\u958B\u555F\u6A94\u6848 {0} \u6642\u767C\u751F\u672A\u9810\u671F\u7684\u932F\u8AA4
......
...@@ -30,9 +30,12 @@ import java.io.File; ...@@ -30,9 +30,12 @@ import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.Serializable;
import java.lang.management.ManagementFactory; import java.lang.management.ManagementFactory;
import java.net.InetAddress; import java.net.InetAddress;
import java.net.MalformedURLException; import java.net.MalformedURLException;
import java.net.Socket;
import java.net.ServerSocket;
import java.net.UnknownHostException; import java.net.UnknownHostException;
import java.rmi.NoSuchObjectException; import java.rmi.NoSuchObjectException;
import java.rmi.Remote; import java.rmi.Remote;
...@@ -40,6 +43,7 @@ import java.rmi.RemoteException; ...@@ -40,6 +43,7 @@ import java.rmi.RemoteException;
import java.rmi.registry.Registry; import java.rmi.registry.Registry;
import java.rmi.server.RMIClientSocketFactory; import java.rmi.server.RMIClientSocketFactory;
import java.rmi.server.RMIServerSocketFactory; import java.rmi.server.RMIServerSocketFactory;
import java.rmi.server.RMISocketFactory;
import java.rmi.server.RemoteObject; import java.rmi.server.RemoteObject;
import java.rmi.server.UnicastRemoteObject; import java.rmi.server.UnicastRemoteObject;
import java.security.KeyStore; import java.security.KeyStore;
...@@ -59,6 +63,8 @@ import javax.management.remote.JMXServiceURL; ...@@ -59,6 +63,8 @@ import javax.management.remote.JMXServiceURL;
import javax.management.remote.rmi.RMIConnectorServer; import javax.management.remote.rmi.RMIConnectorServer;
import javax.net.ssl.KeyManagerFactory; import javax.net.ssl.KeyManagerFactory;
import javax.net.ssl.SSLContext; import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.TrustManagerFactory; import javax.net.ssl.TrustManagerFactory;
import javax.rmi.ssl.SslRMIClientSocketFactory; import javax.rmi.ssl.SslRMIClientSocketFactory;
import javax.rmi.ssl.SslRMIServerSocketFactory; import javax.rmi.ssl.SslRMIServerSocketFactory;
...@@ -107,6 +113,8 @@ public final class ConnectorBootstrap { ...@@ -107,6 +113,8 @@ public final class ConnectorBootstrap {
public static final String PORT = public static final String PORT =
"com.sun.management.jmxremote.port"; "com.sun.management.jmxremote.port";
public static final String HOST =
"com.sun.management.jmxremote.host";
public static final String RMI_PORT = public static final String RMI_PORT =
"com.sun.management.jmxremote.rmi.port"; "com.sun.management.jmxremote.rmi.port";
public static final String CONFIG_FILE_NAME = public static final String CONFIG_FILE_NAME =
...@@ -424,10 +432,14 @@ public final class ConnectorBootstrap { ...@@ -424,10 +432,14 @@ public final class ConnectorBootstrap {
checkAccessFile(accessFileName); checkAccessFile(accessFileName);
} }
final String bindAddress =
props.getProperty(PropertyNames.HOST);
if (log.debugOn()) { if (log.debugOn()) {
log.debug("startRemoteConnectorServer", log.debug("startRemoteConnectorServer",
Agent.getText("jmxremote.ConnectorBootstrap.starting") + Agent.getText("jmxremote.ConnectorBootstrap.starting") +
"\n\t" + PropertyNames.PORT + "=" + port + "\n\t" + PropertyNames.PORT + "=" + port +
(bindAddress == null ? "" : "\n\t" + PropertyNames.HOST + "=" + bindAddress) +
"\n\t" + PropertyNames.RMI_PORT + "=" + rmiPort + "\n\t" + PropertyNames.RMI_PORT + "=" + rmiPort +
"\n\t" + PropertyNames.USE_SSL + "=" + useSsl + "\n\t" + PropertyNames.USE_SSL + "=" + useSsl +
"\n\t" + PropertyNames.USE_REGISTRY_SSL + "=" + useRegistrySsl + "\n\t" + PropertyNames.USE_REGISTRY_SSL + "=" + useRegistrySsl +
...@@ -458,7 +470,7 @@ public final class ConnectorBootstrap { ...@@ -458,7 +470,7 @@ public final class ConnectorBootstrap {
sslConfigFileName, enabledCipherSuitesList, sslConfigFileName, enabledCipherSuitesList,
enabledProtocolsList, sslNeedClientAuth, enabledProtocolsList, sslNeedClientAuth,
useAuthentication, loginConfigName, useAuthentication, loginConfigName,
passwordFileName, accessFileName); passwordFileName, accessFileName, bindAddress);
cs = data.jmxConnectorServer; cs = data.jmxConnectorServer;
url = data.jmxRemoteURL; url = data.jmxRemoteURL;
log.config("startRemoteConnectorServer", log.config("startRemoteConnectorServer",
...@@ -631,12 +643,13 @@ public final class ConnectorBootstrap { ...@@ -631,12 +643,13 @@ public final class ConnectorBootstrap {
String sslConfigFileName, String sslConfigFileName,
String[] enabledCipherSuites, String[] enabledCipherSuites,
String[] enabledProtocols, String[] enabledProtocols,
boolean sslNeedClientAuth) { boolean sslNeedClientAuth,
String bindAddress) {
if (sslConfigFileName == null) { if (sslConfigFileName == null) {
return new SslRMIServerSocketFactory( return new HostAwareSslSocketFactory(
enabledCipherSuites, enabledCipherSuites,
enabledProtocols, enabledProtocols,
sslNeedClientAuth); sslNeedClientAuth, bindAddress);
} else { } else {
checkRestrictedFile(sslConfigFileName); checkRestrictedFile(sslConfigFileName);
try { try {
...@@ -690,11 +703,11 @@ public final class ConnectorBootstrap { ...@@ -690,11 +703,11 @@ public final class ConnectorBootstrap {
SSLContext ctx = SSLContext.getInstance("SSL"); SSLContext ctx = SSLContext.getInstance("SSL");
ctx.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null); ctx.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null);
return new SslRMIServerSocketFactory( return new HostAwareSslSocketFactory(
ctx, ctx,
enabledCipherSuites, enabledCipherSuites,
enabledProtocols, enabledProtocols,
sslNeedClientAuth); sslNeedClientAuth, bindAddress);
} catch (Exception e) { } catch (Exception e) {
throw new AgentConfigurationError(AGENT_EXCEPTION, e, e.toString()); throw new AgentConfigurationError(AGENT_EXCEPTION, e, e.toString());
} }
...@@ -714,7 +727,8 @@ public final class ConnectorBootstrap { ...@@ -714,7 +727,8 @@ public final class ConnectorBootstrap {
boolean useAuthentication, boolean useAuthentication,
String loginConfigName, String loginConfigName,
String passwordFileName, String passwordFileName,
String accessFileName) String accessFileName,
String bindAddress)
throws IOException, MalformedURLException { throws IOException, MalformedURLException {
/* Make sure we use non-guessable RMI object IDs. Otherwise /* Make sure we use non-guessable RMI object IDs. Otherwise
...@@ -722,7 +736,7 @@ public final class ConnectorBootstrap { ...@@ -722,7 +736,7 @@ public final class ConnectorBootstrap {
* IDs. */ * IDs. */
System.setProperty("java.rmi.server.randomIDs", "true"); System.setProperty("java.rmi.server.randomIDs", "true");
JMXServiceURL url = new JMXServiceURL("rmi", null, rmiPort); JMXServiceURL url = new JMXServiceURL("rmi", bindAddress, rmiPort);
Map<String, Object> env = new HashMap<>(); Map<String, Object> env = new HashMap<>();
...@@ -733,6 +747,8 @@ public final class ConnectorBootstrap { ...@@ -733,6 +747,8 @@ public final class ConnectorBootstrap {
String[].class.getName(), String.class.getName() String[].class.getName(), String.class.getName()
}); });
boolean useSocketFactory = bindAddress != null && !useSsl;
if (useAuthentication) { if (useAuthentication) {
if (loginConfigName != null) { if (loginConfigName != null) {
env.put("jmx.remote.x.login.config", loginConfigName); env.put("jmx.remote.x.login.config", loginConfigName);
...@@ -757,7 +773,7 @@ public final class ConnectorBootstrap { ...@@ -757,7 +773,7 @@ public final class ConnectorBootstrap {
csf = new SslRMIClientSocketFactory(); csf = new SslRMIClientSocketFactory();
ssf = createSslRMIServerSocketFactory( ssf = createSslRMIServerSocketFactory(
sslConfigFileName, enabledCipherSuites, sslConfigFileName, enabledCipherSuites,
enabledProtocols, sslNeedClientAuth); enabledProtocols, sslNeedClientAuth, bindAddress);
} }
if (useSsl) { if (useSsl) {
...@@ -767,6 +783,12 @@ public final class ConnectorBootstrap { ...@@ -767,6 +783,12 @@ public final class ConnectorBootstrap {
ssf); ssf);
} }
if (useSocketFactory) {
ssf = new HostAwareSocketFactory(bindAddress);
env.put(RMIConnectorServer.RMI_SERVER_SOCKET_FACTORY_ATTRIBUTE,
ssf);
}
JMXConnectorServer connServer = null; JMXConnectorServer connServer = null;
try { try {
connServer = connServer =
...@@ -786,6 +808,10 @@ public final class ConnectorBootstrap { ...@@ -786,6 +808,10 @@ public final class ConnectorBootstrap {
registry = registry =
new SingleEntryRegistry(port, csf, ssf, new SingleEntryRegistry(port, csf, ssf,
"jmxrmi", exporter.firstExported); "jmxrmi", exporter.firstExported);
} else if (useSocketFactory) {
registry =
new SingleEntryRegistry(port, csf, ssf,
"jmxrmi", exporter.firstExported);
} else { } else {
registry = registry =
new SingleEntryRegistry(port, new SingleEntryRegistry(port,
...@@ -819,4 +845,172 @@ public final class ConnectorBootstrap { ...@@ -819,4 +845,172 @@ public final class ConnectorBootstrap {
private static final ClassLogger log = private static final ClassLogger log =
new ClassLogger(ConnectorBootstrap.class.getPackage().getName(), new ClassLogger(ConnectorBootstrap.class.getPackage().getName(),
"ConnectorBootstrap"); "ConnectorBootstrap");
private static class HostAwareSocketFactory implements RMIServerSocketFactory {
private final String bindAddress;
private HostAwareSocketFactory(String bindAddress) {
this.bindAddress = bindAddress;
}
@Override
public ServerSocket createServerSocket(int port) throws IOException {
if (bindAddress == null) {
return new ServerSocket(port);
} else {
try {
InetAddress addr = InetAddress.getByName(bindAddress);
return new ServerSocket(port, 0, addr);
} catch (UnknownHostException e) {
return new ServerSocket(port);
}
}
}
}
private static class HostAwareSslSocketFactory extends SslRMIServerSocketFactory {
private final String bindAddress;
private final String[] enabledCipherSuites;
private final String[] enabledProtocols;
private final boolean needClientAuth;
private final SSLContext context;
private HostAwareSslSocketFactory(String[] enabledCipherSuites,
String[] enabledProtocols,
boolean sslNeedClientAuth,
String bindAddress) throws IllegalArgumentException {
this(null, enabledCipherSuites, enabledProtocols, sslNeedClientAuth, bindAddress);
}
private HostAwareSslSocketFactory(SSLContext ctx,
String[] enabledCipherSuites,
String[] enabledProtocols,
boolean sslNeedClientAuth,
String bindAddress) throws IllegalArgumentException {
this.context = ctx;
this.bindAddress = bindAddress;
this.enabledProtocols = enabledProtocols;
this.enabledCipherSuites = enabledCipherSuites;
this.needClientAuth = sslNeedClientAuth;
checkValues(ctx, enabledCipherSuites, enabledProtocols);
}
@Override
public ServerSocket createServerSocket(int port) throws IOException {
if (bindAddress != null) {
try {
InetAddress addr = InetAddress.getByName(bindAddress);
return new SslServerSocket(port, 0, addr, context,
enabledCipherSuites, enabledProtocols, needClientAuth);
} catch (UnknownHostException e) {
return new SslServerSocket(port, context,
enabledCipherSuites, enabledProtocols, needClientAuth);
}
} else {
return new SslServerSocket(port, context,
enabledCipherSuites, enabledProtocols, needClientAuth);
}
}
private static void checkValues(SSLContext context,
String[] enabledCipherSuites,
String[] enabledProtocols) throws IllegalArgumentException {
// Force the initialization of the default at construction time,
// rather than delaying it to the first time createServerSocket()
// is called.
//
final SSLSocketFactory sslSocketFactory =
context == null ?
(SSLSocketFactory)SSLSocketFactory.getDefault() : context.getSocketFactory();
SSLSocket sslSocket = null;
if (enabledCipherSuites != null || enabledProtocols != null) {
try {
sslSocket = (SSLSocket) sslSocketFactory.createSocket();
} catch (Exception e) {
final String msg = "Unable to check if the cipher suites " +
"and protocols to enable are supported";
throw (IllegalArgumentException)
new IllegalArgumentException(msg).initCause(e);
}
}
// Check if all the cipher suites and protocol versions to enable
// are supported by the underlying SSL/TLS implementation and if
// true create lists from arrays.
//
if (enabledCipherSuites != null) {
sslSocket.setEnabledCipherSuites(enabledCipherSuites);
}
if (enabledProtocols != null) {
sslSocket.setEnabledProtocols(enabledProtocols);
}
}
}
private static class SslServerSocket extends ServerSocket {
private static SSLSocketFactory defaultSSLSocketFactory;
private final String[] enabledCipherSuites;
private final String[] enabledProtocols;
private final boolean needClientAuth;
private final SSLContext context;
private SslServerSocket(int port,
SSLContext ctx,
String[] enabledCipherSuites,
String[] enabledProtocols,
boolean needClientAuth) throws IOException {
super(port);
this.enabledProtocols = enabledProtocols;
this.enabledCipherSuites = enabledCipherSuites;
this.needClientAuth = needClientAuth;
this.context = ctx;
}
private SslServerSocket(int port,
int backlog,
InetAddress bindAddr,
SSLContext ctx,
String[] enabledCipherSuites,
String[] enabledProtocols,
boolean needClientAuth) throws IOException {
super(port, backlog, bindAddr);
this.enabledProtocols = enabledProtocols;
this.enabledCipherSuites = enabledCipherSuites;
this.needClientAuth = needClientAuth;
this.context = ctx;
}
@Override
public Socket accept() throws IOException {
final SSLSocketFactory sslSocketFactory =
context == null ?
getDefaultSSLSocketFactory() : context.getSocketFactory();
Socket socket = super.accept();
SSLSocket sslSocket = (SSLSocket) sslSocketFactory.createSocket(
socket, socket.getInetAddress().getHostName(),
socket.getPort(), true);
sslSocket.setUseClientMode(false);
if (enabledCipherSuites != null) {
sslSocket.setEnabledCipherSuites(enabledCipherSuites);
}
if (enabledProtocols != null) {
sslSocket.setEnabledProtocols(enabledProtocols);
}
sslSocket.setNeedClientAuth(needClientAuth);
return sslSocket;
}
private static synchronized SSLSocketFactory getDefaultSSLSocketFactory() {
if (defaultSSLSocketFactory == null) {
defaultSSLSocketFactory = (SSLSocketFactory)SSLSocketFactory.getDefault();
return defaultSSLSocketFactory;
} else {
return defaultSSLSocketFactory;
}
}
}
} }
# #
# #
# Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
...@@ -31,10 +31,10 @@ agent.err.error = \u932F\u8AA4 ...@@ -31,10 +31,10 @@ agent.err.error = \u932F\u8AA4
agent.err.exception = \u4EE3\u7406\u7A0B\u5F0F\u767C\u751F\u7570\u5E38 agent.err.exception = \u4EE3\u7406\u7A0B\u5F0F\u767C\u751F\u7570\u5E38
agent.err.warning = \u8B66\u544A agent.err.warning = \u8B66\u544A
agent.err.configfile.notfound = \u627E\u4E0D\u5230\u914D\u7F6E\u6A94\u6848 agent.err.configfile.notfound = \u627E\u4E0D\u5230\u7D44\u614B\u6A94\u6848
agent.err.configfile.failed = \u7121\u6CD5\u8B80\u53D6\u914D\u7F6E\u6A94\u6848 agent.err.configfile.failed = \u7121\u6CD5\u8B80\u53D6\u7D44\u614B\u6A94\u6848
agent.err.configfile.closed.failed = \u7121\u6CD5\u95DC\u9589\u914D\u7F6E\u6A94\u6848 agent.err.configfile.closed.failed = \u7121\u6CD5\u95DC\u9589\u7D44\u614B\u6A94\u6848
agent.err.configfile.access.denied = \u5B58\u53D6\u914D\u7F6E\u6A94\u6848\u906D\u5230\u62D2\u7D55 agent.err.configfile.access.denied = \u5B58\u53D6\u7D44\u614B\u6A94\u6848\u906D\u5230\u62D2\u7D55
agent.err.exportaddress.failed = \u5C07 JMX \u9023\u63A5\u5668\u4F4D\u5740\u532F\u51FA\u81F3\u8A2D\u5099\u7DE9\u885D\u5340\u5931\u6557 agent.err.exportaddress.failed = \u5C07 JMX \u9023\u63A5\u5668\u4F4D\u5740\u532F\u51FA\u81F3\u8A2D\u5099\u7DE9\u885D\u5340\u5931\u6557
......
/* /*
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -47,6 +47,9 @@ public class Util { ...@@ -47,6 +47,9 @@ public class Util {
// The number of temp buffers in our pool // The number of temp buffers in our pool
private static final int TEMP_BUF_POOL_SIZE = IOUtil.IOV_MAX; private static final int TEMP_BUF_POOL_SIZE = IOUtil.IOV_MAX;
// The max size allowed for a cached temp buffer, in bytes
private static final long MAX_CACHED_BUFFER_SIZE = getMaxCachedBufferSize();
// Per-thread cache of temporary direct buffers // Per-thread cache of temporary direct buffers
private static ThreadLocal<BufferCache> bufferCache = private static ThreadLocal<BufferCache> bufferCache =
new ThreadLocal<BufferCache>() new ThreadLocal<BufferCache>()
...@@ -57,6 +60,52 @@ public class Util { ...@@ -57,6 +60,52 @@ public class Util {
} }
}; };
/**
* Returns the max size allowed for a cached temp buffers, in
* bytes. It defaults to Long.MAX_VALUE. It can be set with the
* jdk.nio.maxCachedBufferSize property. Even though
* ByteBuffer.capacity() returns an int, we're using a long here
* for potential future-proofing.
*/
private static long getMaxCachedBufferSize() {
String s = java.security.AccessController.doPrivileged(
new PrivilegedAction<String>() {
@Override
public String run() {
return System.getProperty("jdk.nio.maxCachedBufferSize");
}
});
if (s != null) {
try {
long m = Long.parseLong(s);
if (m >= 0) {
return m;
} else {
// if it's negative, ignore the system property
}
} catch (NumberFormatException e) {
// if the string is not well formed, ignore the system property
}
}
return Long.MAX_VALUE;
}
/**
* Returns true if a buffer of this size is too large to be
* added to the buffer cache, false otherwise.
*/
private static boolean isBufferTooLarge(int size) {
return size > MAX_CACHED_BUFFER_SIZE;
}
/**
* Returns true if the buffer is too large to be added to the
* buffer cache, false otherwise.
*/
private static boolean isBufferTooLarge(ByteBuffer buf) {
return isBufferTooLarge(buf.capacity());
}
/** /**
* A simple cache of direct buffers. * A simple cache of direct buffers.
*/ */
...@@ -83,6 +132,9 @@ public class Util { ...@@ -83,6 +132,9 @@ public class Util {
* size (or null if no suitable buffer is found). * size (or null if no suitable buffer is found).
*/ */
ByteBuffer get(int size) { ByteBuffer get(int size) {
// Don't call this if the buffer would be too large.
assert !isBufferTooLarge(size);
if (count == 0) if (count == 0)
return null; // cache is empty return null; // cache is empty
...@@ -120,6 +172,9 @@ public class Util { ...@@ -120,6 +172,9 @@ public class Util {
} }
boolean offerFirst(ByteBuffer buf) { boolean offerFirst(ByteBuffer buf) {
// Don't call this if the buffer is too large.
assert !isBufferTooLarge(buf);
if (count >= TEMP_BUF_POOL_SIZE) { if (count >= TEMP_BUF_POOL_SIZE) {
return false; return false;
} else { } else {
...@@ -131,6 +186,9 @@ public class Util { ...@@ -131,6 +186,9 @@ public class Util {
} }
boolean offerLast(ByteBuffer buf) { boolean offerLast(ByteBuffer buf) {
// Don't call this if the buffer is too large.
assert !isBufferTooLarge(buf);
if (count >= TEMP_BUF_POOL_SIZE) { if (count >= TEMP_BUF_POOL_SIZE) {
return false; return false;
} else { } else {
...@@ -159,6 +217,15 @@ public class Util { ...@@ -159,6 +217,15 @@ public class Util {
* Returns a temporary buffer of at least the given size * Returns a temporary buffer of at least the given size
*/ */
public static ByteBuffer getTemporaryDirectBuffer(int size) { public static ByteBuffer getTemporaryDirectBuffer(int size) {
// If a buffer of this size is too large for the cache, there
// should not be a buffer in the cache that is at least as
// large. So we'll just create a new one. Also, we don't have
// to remove the buffer from the cache (as this method does
// below) given that we won't put the new buffer in the cache.
if (isBufferTooLarge(size)) {
return ByteBuffer.allocateDirect(size);
}
BufferCache cache = bufferCache.get(); BufferCache cache = bufferCache.get();
ByteBuffer buf = cache.get(size); ByteBuffer buf = cache.get(size);
if (buf != null) { if (buf != null) {
...@@ -188,6 +255,13 @@ public class Util { ...@@ -188,6 +255,13 @@ public class Util {
* likely to be returned by a subsequent call to getTemporaryDirectBuffer. * likely to be returned by a subsequent call to getTemporaryDirectBuffer.
*/ */
static void offerFirstTemporaryDirectBuffer(ByteBuffer buf) { static void offerFirstTemporaryDirectBuffer(ByteBuffer buf) {
// If the buffer is too large for the cache we don't have to
// check the cache. We'll just free it.
if (isBufferTooLarge(buf)) {
free(buf);
return;
}
assert buf != null; assert buf != null;
BufferCache cache = bufferCache.get(); BufferCache cache = bufferCache.get();
if (!cache.offerFirst(buf)) { if (!cache.offerFirst(buf)) {
...@@ -203,6 +277,13 @@ public class Util { ...@@ -203,6 +277,13 @@ public class Util {
* cache in same order that they were obtained. * cache in same order that they were obtained.
*/ */
static void offerLastTemporaryDirectBuffer(ByteBuffer buf) { static void offerLastTemporaryDirectBuffer(ByteBuffer buf) {
// If the buffer is too large for the cache we don't have to
// check the cache. We'll just free it.
if (isBufferTooLarge(buf)) {
free(buf);
return;
}
assert buf != null; assert buf != null;
BufferCache cache = bufferCache.get(); BufferCache cache = bufferCache.get();
if (!cache.offerLast(buf)) { if (!cache.offerLast(buf)) {
......
# #
# #
# Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
...@@ -71,7 +71,7 @@ rmid.group.inactive=rmid: \u555F\u52D5\u7FA4\u7D44\u672A\u5728\u4F7F\u7528\u4E2D ...@@ -71,7 +71,7 @@ rmid.group.inactive=rmid: \u555F\u52D5\u7FA4\u7D44\u672A\u5728\u4F7F\u7528\u4E2D
# "Activation.main", "sun.rmi.activation.execPolicy", "ExecPermission" and # "Activation.main", "sun.rmi.activation.execPolicy", "ExecPermission" and
# "ExecOptionPermission" should not be translated, since they refer to # "ExecOptionPermission" should not be translated, since they refer to
# class/permission names. # class/permission names.
rmid.exec.perms.inadequate=Activation.main: \u8B66\u544A: sun.rmi.activation.execPolicy \u7CFB\u7D71\n\u5C6C\u6027\u672A\u6307\u5B9A\uFF0C\u4E26\u4E14\u672A\u6388\u4E88 ExecPermissions/ExecOptionPermissions; \n\u5F8C\u7E8C\u7684\u555F\u52D5\u5617\u8A66\u53EF\u80FD\u6703\u56E0\u70BA\u672A\u6210\u529F\u7684\nExecPermission/ExecOptionPermission \u6B0A\u9650\u6AA2\u67E5\u800C\u5931\u6557\u3002\u5982\u9700\n\u95DC\u65BC\u5982\u4F55\u914D\u7F6E rmid \u5B89\u5168\u7684\u8AAA\u660E\u6587\u4EF6\uFF0C\u8ACB\u53C3\u8003:\n\nhttp://java.sun.com/j2se/1.4/docs/tooldocs/solaris/rmid.html\nhttp://java.sun.com/j2se/1.4/docs/tooldocs/win32/rmid.html\n rmid.exec.perms.inadequate=Activation.main: \u8B66\u544A: sun.rmi.activation.execPolicy \u7CFB\u7D71\n\u5C6C\u6027\u672A\u6307\u5B9A\uFF0C\u4E26\u4E14\u672A\u6388\u4E88 ExecPermissions/ExecOptionPermissions; \n\u5F8C\u7E8C\u7684\u555F\u52D5\u5617\u8A66\u53EF\u80FD\u6703\u56E0\u70BA\u672A\u6210\u529F\u7684\nExecPermission/ExecOptionPermission \u6B0A\u9650\u6AA2\u67E5\u800C\u5931\u6557\u3002\u5982\u9700\n\u95DC\u65BC\u5982\u4F55\u8A2D\u5B9A rmid \u5B89\u5168\u7684\u8AAA\u660E\u6587\u4EF6\uFF0C\u8ACB\u53C3\u8003:\n\nhttp://java.sun.com/j2se/1.4/docs/tooldocs/solaris/rmid.html\nhttp://java.sun.com/j2se/1.4/docs/tooldocs/win32/rmid.html\n
# "rmid", "-port", "-log", "-stop", "-C" and "-J" should not be translated, # "rmid", "-port", "-log", "-stop", "-C" and "-J" should not be translated,
# because they are syntax # because they are syntax
......
/* /*
* Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -118,6 +118,9 @@ public class DGCAckHandler { ...@@ -118,6 +118,9 @@ public class DGCAckHandler {
if (objList != null && task == null) { if (objList != null && task == null) {
task = scheduler.schedule(new Runnable() { task = scheduler.schedule(new Runnable() {
public void run() { public void run() {
if (id != null) {
idTable.remove(id);
}
release(); release();
} }
}, dgcAckTimeout, TimeUnit.MILLISECONDS); }, dgcAckTimeout, TimeUnit.MILLISECONDS);
......
/* /*
* Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -383,19 +383,19 @@ public final class PKCS12KeyStore extends KeyStoreSpi { ...@@ -383,19 +383,19 @@ public final class PKCS12KeyStore extends KeyStoreSpi {
// decode secret key // decode secret key
} else { } else {
SecretKeyFactory sKeyFactory =
SecretKeyFactory.getInstance(keyAlgo);
byte[] keyBytes = in.getOctetString(); byte[] keyBytes = in.getOctetString();
SecretKeySpec secretKeySpec = SecretKeySpec secretKeySpec =
new SecretKeySpec(keyBytes, keyAlgo); new SecretKeySpec(keyBytes, keyAlgo);
// Special handling required for PBE: needs a PBEKeySpec // Special handling required for PBE: needs a PBEKeySpec
if (keyAlgo.startsWith("PBE")) { if (keyAlgo.startsWith("PBE")) {
SecretKeyFactory sKeyFactory =
SecretKeyFactory.getInstance(keyAlgo);
KeySpec pbeKeySpec = KeySpec pbeKeySpec =
sKeyFactory.getKeySpec(secretKeySpec, PBEKeySpec.class); sKeyFactory.getKeySpec(secretKeySpec, PBEKeySpec.class);
key = sKeyFactory.generateSecret(pbeKeySpec); key = sKeyFactory.generateSecret(pbeKeySpec);
} else { } else {
key = sKeyFactory.generateSecret(secretKeySpec); key = secretKeySpec;
} }
if (debug != null) { if (debug != null) {
......
...@@ -36,9 +36,7 @@ import java.util.Date; ...@@ -36,9 +36,7 @@ import java.util.Date;
import sun.security.util.Debug; import sun.security.util.Debug;
import sun.security.util.DerInputStream; import sun.security.util.DerInputStream;
import sun.security.util.DerOutputStream;
import sun.security.x509.SerialNumber; import sun.security.x509.SerialNumber;
import sun.security.x509.KeyIdentifier;
import sun.security.x509.AuthorityKeyIdentifierExtension; import sun.security.x509.AuthorityKeyIdentifierExtension;
/** /**
...@@ -131,13 +129,7 @@ class AdaptableX509CertSelector extends X509CertSelector { ...@@ -131,13 +129,7 @@ class AdaptableX509CertSelector extends X509CertSelector {
serial = null; serial = null;
if (ext != null) { if (ext != null) {
KeyIdentifier akid = (KeyIdentifier)ext.get( ski = ext.getEncodedKeyIdentifier();
AuthorityKeyIdentifierExtension.KEY_ID);
if (akid != null) {
DerOutputStream derout = new DerOutputStream();
derout.putOctetString(akid.getIdentifier());
ski = derout.toByteArray();
}
SerialNumber asn = (SerialNumber)ext.get( SerialNumber asn = (SerialNumber)ext.get(
AuthorityKeyIdentifierExtension.SERIAL_NUMBER); AuthorityKeyIdentifierExtension.SERIAL_NUMBER);
if (asn != null) { if (asn != null) {
......
...@@ -33,7 +33,6 @@ import javax.security.auth.x500.X500Principal; ...@@ -33,7 +33,6 @@ import javax.security.auth.x500.X500Principal;
import java.util.*; import java.util.*;
import sun.security.util.Debug; import sun.security.util.Debug;
import sun.security.util.DerOutputStream;
import static sun.security.x509.PKIXExtensions.*; import static sun.security.x509.PKIXExtensions.*;
import sun.security.x509.*; import sun.security.x509.*;
...@@ -608,12 +607,9 @@ public class DistributionPointFetcher { ...@@ -608,12 +607,9 @@ public class DistributionPointFetcher {
AuthorityKeyIdentifierExtension akidext = AuthorityKeyIdentifierExtension akidext =
crlImpl.getAuthKeyIdExtension(); crlImpl.getAuthKeyIdExtension();
if (akidext != null) { if (akidext != null) {
KeyIdentifier akid = (KeyIdentifier)akidext.get( byte[] kid = akidext.getEncodedKeyIdentifier();
AuthorityKeyIdentifierExtension.KEY_ID); if (kid != null) {
if (akid != null) { certSel.setSubjectKeyIdentifier(kid);
DerOutputStream derout = new DerOutputStream();
derout.putOctetString(akid.getIdentifier());
certSel.setSubjectKeyIdentifier(derout.toByteArray());
} }
SerialNumber asn = (SerialNumber)akidext.get( SerialNumber asn = (SerialNumber)akidext.get(
......
...@@ -46,9 +46,10 @@ import sun.security.provider.certpath.PKIX.BuilderParams; ...@@ -46,9 +46,10 @@ import sun.security.provider.certpath.PKIX.BuilderParams;
import sun.security.util.Debug; import sun.security.util.Debug;
import sun.security.x509.AccessDescription; import sun.security.x509.AccessDescription;
import sun.security.x509.AuthorityInfoAccessExtension; import sun.security.x509.AuthorityInfoAccessExtension;
import sun.security.x509.AuthorityKeyIdentifierExtension;
import static sun.security.x509.PKIXExtensions.*; import static sun.security.x509.PKIXExtensions.*;
import sun.security.x509.X500Name; import sun.security.x509.X500Name;
import sun.security.x509.AuthorityKeyIdentifierExtension; import sun.security.x509.X509CertImpl;
/** /**
* This class represents a forward builder, which is able to retrieve * This class represents a forward builder, which is able to retrieve
...@@ -69,7 +70,6 @@ class ForwardBuilder extends Builder { ...@@ -69,7 +70,6 @@ class ForwardBuilder extends Builder {
private AdaptableX509CertSelector caSelector; private AdaptableX509CertSelector caSelector;
private X509CertSelector caTargetSelector; private X509CertSelector caTargetSelector;
TrustAnchor trustAnchor; TrustAnchor trustAnchor;
private Comparator<X509Certificate> comparator;
private boolean searchAllCertStores = true; private boolean searchAllCertStores = true;
/** /**
...@@ -93,7 +93,6 @@ class ForwardBuilder extends Builder { ...@@ -93,7 +93,6 @@ class ForwardBuilder extends Builder {
trustedSubjectDNs.add(anchor.getCA()); trustedSubjectDNs.add(anchor.getCA());
} }
} }
comparator = new PKIXCertComparator(trustedSubjectDNs);
this.searchAllCertStores = searchAllCertStores; this.searchAllCertStores = searchAllCertStores;
} }
...@@ -122,6 +121,8 @@ class ForwardBuilder extends Builder { ...@@ -122,6 +121,8 @@ class ForwardBuilder extends Builder {
* As each cert is added, it is sorted based on the PKIXCertComparator * As each cert is added, it is sorted based on the PKIXCertComparator
* algorithm. * algorithm.
*/ */
Comparator<X509Certificate> comparator =
new PKIXCertComparator(trustedSubjectDNs, currState.cert);
Set<X509Certificate> certs = new TreeSet<>(comparator); Set<X509Certificate> certs = new TreeSet<>(comparator);
/* /*
...@@ -264,14 +265,6 @@ class ForwardBuilder extends Builder { ...@@ -264,14 +265,6 @@ class ForwardBuilder extends Builder {
CertPathHelper.setPathToNames CertPathHelper.setPathToNames
(caSelector, currentState.subjectNamesTraversed); (caSelector, currentState.subjectNamesTraversed);
/*
* Facilitate certification path construction with authority
* key identifier and subject key identifier.
*/
AuthorityKeyIdentifierExtension akidext =
currentState.cert.getAuthorityKeyIdentifierExtension();
caSelector.setSkiAndSerialNumber(akidext);
/* /*
* check the validity period * check the validity period
*/ */
...@@ -404,41 +397,68 @@ class ForwardBuilder extends Builder { ...@@ -404,41 +397,68 @@ class ForwardBuilder extends Builder {
* *
* Preference order for current cert: * Preference order for current cert:
* *
* 1) Issuer matches a trusted subject * 1) The key identifier of an AKID extension (if present) in the
* previous certificate matches the key identifier in the SKID extension
*
* 2) Issuer matches a trusted subject
* Issuer: ou=D,ou=C,o=B,c=A * Issuer: ou=D,ou=C,o=B,c=A
* *
* 2) Issuer is a descendant of a trusted subject (in order of * 3) Issuer is a descendant of a trusted subject (in order of
* number of links to the trusted subject) * number of links to the trusted subject)
* a) Issuer: ou=E,ou=D,ou=C,o=B,c=A [links=1] * a) Issuer: ou=E,ou=D,ou=C,o=B,c=A [links=1]
* b) Issuer: ou=F,ou=E,ou=D,ou=C,ou=B,c=A [links=2] * b) Issuer: ou=F,ou=E,ou=D,ou=C,ou=B,c=A [links=2]
* *
* 3) Issuer is an ancestor of a trusted subject (in order of number of * 4) Issuer is an ancestor of a trusted subject (in order of number of
* links to the trusted subject) * links to the trusted subject)
* a) Issuer: ou=C,o=B,c=A [links=1] * a) Issuer: ou=C,o=B,c=A [links=1]
* b) Issuer: o=B,c=A [links=2] * b) Issuer: o=B,c=A [links=2]
* *
* 4) Issuer is in the same namespace as a trusted subject (in order of * 5) Issuer is in the same namespace as a trusted subject (in order of
* number of links to the trusted subject) * number of links to the trusted subject)
* a) Issuer: ou=G,ou=C,o=B,c=A [links=2] * a) Issuer: ou=G,ou=C,o=B,c=A [links=2]
* b) Issuer: ou=H,o=B,c=A [links=3] * b) Issuer: ou=H,o=B,c=A [links=3]
* *
* 5) Issuer is an ancestor of certificate subject (in order of number * 6) Issuer is an ancestor of certificate subject (in order of number
* of links to the certificate subject) * of links to the certificate subject)
* a) Issuer: ou=K,o=J,c=A * a) Issuer: ou=K,o=J,c=A
* Subject: ou=L,ou=K,o=J,c=A * Subject: ou=L,ou=K,o=J,c=A
* b) Issuer: o=J,c=A * b) Issuer: o=J,c=A
* Subject: ou=L,ou=K,0=J,c=A * Subject: ou=L,ou=K,0=J,c=A
* *
* 6) Any other certificates * 7) Any other certificates
*/ */
static class PKIXCertComparator implements Comparator<X509Certificate> { static class PKIXCertComparator implements Comparator<X509Certificate> {
final static String METHOD_NME = "PKIXCertComparator.compare()"; static final String METHOD_NME = "PKIXCertComparator.compare()";
private final Set<X500Principal> trustedSubjectDNs; private final Set<X500Principal> trustedSubjectDNs;
private final X509CertSelector certSkidSelector;
PKIXCertComparator(Set<X500Principal> trustedSubjectDNs) { PKIXCertComparator(Set<X500Principal> trustedSubjectDNs,
X509CertImpl previousCert) throws IOException {
this.trustedSubjectDNs = trustedSubjectDNs; this.trustedSubjectDNs = trustedSubjectDNs;
this.certSkidSelector = getSelector(previousCert);
}
/**
* Returns an X509CertSelector for matching on the authority key
* identifier, or null if not applicable.
*/
private X509CertSelector getSelector(X509CertImpl previousCert)
throws IOException {
if (previousCert != null) {
AuthorityKeyIdentifierExtension akidExt =
previousCert.getAuthorityKeyIdentifierExtension();
if (akidExt != null) {
byte[] skid = akidExt.getEncodedKeyIdentifier();
if (skid != null) {
X509CertSelector selector = new X509CertSelector();
selector.setSubjectKeyIdentifier(skid);
return selector;
}
}
}
return null;
} }
/** /**
...@@ -462,6 +482,16 @@ class ForwardBuilder extends Builder { ...@@ -462,6 +482,16 @@ class ForwardBuilder extends Builder {
// if certs are the same, return 0 // if certs are the same, return 0
if (oCert1.equals(oCert2)) return 0; if (oCert1.equals(oCert2)) return 0;
// If akid/skid match then it is preferable
if (certSkidSelector != null) {
if (certSkidSelector.match(oCert1)) {
return -1;
}
if (certSkidSelector.match(oCert2)) {
return 1;
}
}
X500Principal cIssuer1 = oCert1.getIssuerX500Principal(); X500Principal cIssuer1 = oCert1.getIssuerX500Principal();
X500Principal cIssuer2 = oCert2.getIssuerX500Principal(); X500Principal cIssuer2 = oCert2.getIssuerX500Principal();
X500Name cIssuer1Name = X500Name.asX500Name(cIssuer1); X500Name cIssuer1Name = X500Name.asX500Name(cIssuer1);
......
...@@ -813,7 +813,8 @@ class DH_ServerKeyExchange extends ServerKeyExchange ...@@ -813,7 +813,8 @@ class DH_ServerKeyExchange extends ServerKeyExchange
preferableSignatureAlgorithm)) { preferableSignatureAlgorithm)) {
throw new SSLHandshakeException( throw new SSLHandshakeException(
"Unsupported SignatureAndHashAlgorithm in " + "Unsupported SignatureAndHashAlgorithm in " +
"ServerKeyExchange message"); "ServerKeyExchange message: " +
preferableSignatureAlgorithm);
} }
} else { } else {
this.preferableSignatureAlgorithm = null; this.preferableSignatureAlgorithm = null;
...@@ -846,7 +847,8 @@ class DH_ServerKeyExchange extends ServerKeyExchange ...@@ -846,7 +847,8 @@ class DH_ServerKeyExchange extends ServerKeyExchange
sig = RSASignature.getInstance(); sig = RSASignature.getInstance();
break; break;
default: default:
throw new SSLKeyException("neither an RSA or a DSA key"); throw new SSLKeyException(
"neither an RSA or a DSA key: " + algorithm);
} }
} }
...@@ -1096,7 +1098,8 @@ class ECDH_ServerKeyExchange extends ServerKeyExchange { ...@@ -1096,7 +1098,8 @@ class ECDH_ServerKeyExchange extends ServerKeyExchange {
preferableSignatureAlgorithm)) { preferableSignatureAlgorithm)) {
throw new SSLHandshakeException( throw new SSLHandshakeException(
"Unsupported SignatureAndHashAlgorithm in " + "Unsupported SignatureAndHashAlgorithm in " +
"ServerKeyExchange message"); "ServerKeyExchange message: " +
preferableSignatureAlgorithm);
} }
} }
...@@ -1136,7 +1139,8 @@ class ECDH_ServerKeyExchange extends ServerKeyExchange { ...@@ -1136,7 +1139,8 @@ class ECDH_ServerKeyExchange extends ServerKeyExchange {
case "RSA": case "RSA":
return RSASignature.getInstance(); return RSASignature.getInstance();
default: default:
throw new NoSuchAlgorithmException("neither an RSA or a EC key"); throw new NoSuchAlgorithmException(
"neither an RSA or a EC key : " + keyAlgorithm);
} }
} }
...@@ -1343,7 +1347,8 @@ class CertificateRequest extends HandshakeMessage ...@@ -1343,7 +1347,8 @@ class CertificateRequest extends HandshakeMessage
algorithmsLen = input.getInt16(); algorithmsLen = input.getInt16();
if (algorithmsLen < 2) { if (algorithmsLen < 2) {
throw new SSLProtocolException( throw new SSLProtocolException(
"Invalid supported_signature_algorithms field"); "Invalid supported_signature_algorithms field: " +
algorithmsLen);
} }
algorithms = new ArrayList<SignatureAndHashAlgorithm>(); algorithms = new ArrayList<SignatureAndHashAlgorithm>();
...@@ -1362,7 +1367,8 @@ class CertificateRequest extends HandshakeMessage ...@@ -1362,7 +1367,8 @@ class CertificateRequest extends HandshakeMessage
if (remains != 0) { if (remains != 0) {
throw new SSLProtocolException( throw new SSLProtocolException(
"Invalid supported_signature_algorithms field"); "Invalid supported_signature_algorithms field. remains: " +
remains);
} }
} else { } else {
algorithms = new ArrayList<SignatureAndHashAlgorithm>(); algorithms = new ArrayList<SignatureAndHashAlgorithm>();
...@@ -1379,7 +1385,8 @@ class CertificateRequest extends HandshakeMessage ...@@ -1379,7 +1385,8 @@ class CertificateRequest extends HandshakeMessage
} }
if (len != 0) { if (len != 0) {
throw new SSLProtocolException("Bad CertificateRequest DN length"); throw new SSLProtocolException(
"Bad CertificateRequest DN length: " + len);
} }
authorities = v.toArray(new DistinguishedName[v.size()]); authorities = v.toArray(new DistinguishedName[v.size()]);
...@@ -1610,7 +1617,7 @@ static final class CertificateVerify extends HandshakeMessage { ...@@ -1610,7 +1617,7 @@ static final class CertificateVerify extends HandshakeMessage {
preferableSignatureAlgorithm)) { preferableSignatureAlgorithm)) {
throw new SSLHandshakeException( throw new SSLHandshakeException(
"Unsupported SignatureAndHashAlgorithm in " + "Unsupported SignatureAndHashAlgorithm in " +
"CertificateVerify message"); "CertificateVerify message: " + preferableSignatureAlgorithm);
} }
} }
...@@ -1977,7 +1984,8 @@ static final class Finished extends HandshakeMessage { ...@@ -1977,7 +1984,8 @@ static final class Finished extends HandshakeMessage {
SecretKey prfKey = kg.generateKey(); SecretKey prfKey = kg.generateKey();
if ("RAW".equals(prfKey.getFormat()) == false) { if ("RAW".equals(prfKey.getFormat()) == false) {
throw new ProviderException( throw new ProviderException(
"Invalid PRF output, format must be RAW"); "Invalid PRF output, format must be RAW. " +
"Format received: " + prfKey.getFormat());
} }
byte[] finished = prfKey.getEncoded(); byte[] finished = prfKey.getEncoded();
return finished; return finished;
......
/* /*
* Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -67,7 +67,8 @@ final class RSAClientKeyExchange extends HandshakeMessage { ...@@ -67,7 +67,8 @@ final class RSAClientKeyExchange extends HandshakeMessage {
ProtocolVersion maxVersion, ProtocolVersion maxVersion,
SecureRandom generator, PublicKey publicKey) throws IOException { SecureRandom generator, PublicKey publicKey) throws IOException {
if (publicKey.getAlgorithm().equals("RSA") == false) { if (publicKey.getAlgorithm().equals("RSA") == false) {
throw new SSLKeyException("Public key not of type RSA"); throw new SSLKeyException("Public key not of type RSA: " +
publicKey.getAlgorithm());
} }
this.protocolVersion = protocolVersion; this.protocolVersion = protocolVersion;
...@@ -98,7 +99,8 @@ final class RSAClientKeyExchange extends HandshakeMessage { ...@@ -98,7 +99,8 @@ final class RSAClientKeyExchange extends HandshakeMessage {
int messageSize, PrivateKey privateKey) throws IOException { int messageSize, PrivateKey privateKey) throws IOException {
if (privateKey.getAlgorithm().equals("RSA") == false) { if (privateKey.getAlgorithm().equals("RSA") == false) {
throw new SSLKeyException("Private key not of type RSA"); throw new SSLKeyException("Private key not of type RSA: " +
privateKey.getAlgorithm());
} }
if (currentVersion.v >= ProtocolVersion.TLS10.v) { if (currentVersion.v >= ProtocolVersion.TLS10.v) {
...@@ -113,10 +115,31 @@ final class RSAClientKeyExchange extends HandshakeMessage { ...@@ -113,10 +115,31 @@ final class RSAClientKeyExchange extends HandshakeMessage {
byte[] encoded = null; byte[] encoded = null;
try { try {
boolean needFailover = false;
Cipher cipher = JsseJce.getCipher(JsseJce.CIPHER_RSA_PKCS1); Cipher cipher = JsseJce.getCipher(JsseJce.CIPHER_RSA_PKCS1);
boolean needFailover = !KeyUtil.isOracleJCEProvider( try {
// Try UNWRAP_MODE mode firstly.
cipher.init(Cipher.UNWRAP_MODE, privateKey,
new TlsRsaPremasterSecretParameterSpec(
maxVersion.v, currentVersion.v),
generator);
// The provider selection can be delayed, please don't call
// any Cipher method before the call to Cipher.init().
needFailover = !KeyUtil.isOracleJCEProvider(
cipher.getProvider().getName()); cipher.getProvider().getName());
} catch (InvalidKeyException | UnsupportedOperationException iue) {
if (debug != null && Debug.isOn("handshake")) {
System.out.println("The Cipher provider " +
cipher.getProvider().getName() +
" caused exception: " + iue.getMessage());
}
needFailover = true;
}
if (needFailover) { if (needFailover) {
// Use DECRYPT_MODE and dispose the previous initialization.
cipher.init(Cipher.DECRYPT_MODE, privateKey); cipher.init(Cipher.DECRYPT_MODE, privateKey);
boolean failed = false; boolean failed = false;
try { try {
...@@ -132,17 +155,14 @@ final class RSAClientKeyExchange extends HandshakeMessage { ...@@ -132,17 +155,14 @@ final class RSAClientKeyExchange extends HandshakeMessage {
maxVersion.v, currentVersion.v, maxVersion.v, currentVersion.v,
encoded, generator); encoded, generator);
} else { } else {
cipher.init(Cipher.UNWRAP_MODE, privateKey, // the cipher should have been initialized
new TlsRsaPremasterSecretParameterSpec(
maxVersion.v, currentVersion.v),
generator);
preMaster = (SecretKey)cipher.unwrap(encrypted, preMaster = (SecretKey)cipher.unwrap(encrypted,
"TlsRsaPremasterSecret", Cipher.SECRET_KEY); "TlsRsaPremasterSecret", Cipher.SECRET_KEY);
} }
} catch (InvalidKeyException ibk) { } catch (InvalidKeyException ibk) {
// the message is too big to process with RSA // the message is too big to process with RSA
throw new SSLProtocolException( throw new SSLException(
"Unable to process PreMasterSecret, may be too big"); "Unable to process PreMasterSecret", ibk);
} catch (Exception e) { } catch (Exception e) {
// unlikely to happen, otherwise, must be a provider exception // unlikely to happen, otherwise, must be a provider exception
if (debug != null && Debug.isOn("handshake")) { if (debug != null && Debug.isOn("handshake")) {
......
...@@ -413,12 +413,16 @@ final class SignatureAndHashAlgorithm { ...@@ -413,12 +413,16 @@ final class SignatureAndHashAlgorithm {
"SHA1withECDSA", --p); "SHA1withECDSA", --p);
if (Security.getProvider("SunMSCAPI") == null) { if (Security.getProvider("SunMSCAPI") == null) {
supports(HashAlgorithm.SHA224, SignatureAlgorithm.DSA,
"SHA224withDSA", --p);
supports(HashAlgorithm.SHA224, SignatureAlgorithm.RSA, supports(HashAlgorithm.SHA224, SignatureAlgorithm.RSA,
"SHA224withRSA", --p); "SHA224withRSA", --p);
supports(HashAlgorithm.SHA224, SignatureAlgorithm.ECDSA, supports(HashAlgorithm.SHA224, SignatureAlgorithm.ECDSA,
"SHA224withECDSA", --p); "SHA224withECDSA", --p);
} }
supports(HashAlgorithm.SHA256, SignatureAlgorithm.DSA,
"SHA256withDSA", --p);
supports(HashAlgorithm.SHA256, SignatureAlgorithm.RSA, supports(HashAlgorithm.SHA256, SignatureAlgorithm.RSA,
"SHA256withRSA", --p); "SHA256withRSA", --p);
supports(HashAlgorithm.SHA256, SignatureAlgorithm.ECDSA, supports(HashAlgorithm.SHA256, SignatureAlgorithm.ECDSA,
......
/* /*
* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -88,6 +88,8 @@ public class Resources_ja extends java.util.ListResourceBundle { ...@@ -88,6 +88,8 @@ public class Resources_ja extends java.util.ListResourceBundle {
"[-tsacert <alias>] \u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7\u5C40\u306E\u516C\u958B\u9375\u8A3C\u660E\u66F8"}, "[-tsacert <alias>] \u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7\u5C40\u306E\u516C\u958B\u9375\u8A3C\u660E\u66F8"},
{".tsapolicyid.tsapolicyid.for.Timestamping.Authority", {".tsapolicyid.tsapolicyid.for.Timestamping.Authority",
"[-tsapolicyid <oid>] \u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7\u5C40\u306ETSAPolicyID"}, "[-tsapolicyid <oid>] \u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7\u5C40\u306ETSAPolicyID"},
{".tsadigestalg.algorithm.of.digest.data.in.timestamping.request",
"[-tsadigestalg <algorithm>] \u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7\u30FB\u30EA\u30AF\u30A8\u30B9\u30C8\u306E\u30C0\u30A4\u30B8\u30A7\u30B9\u30C8\u30FB\u30C7\u30FC\u30BF\u306E\u30A2\u30EB\u30B4\u30EA\u30BA\u30E0"},
{".altsigner.class.class.name.of.an.alternative.signing.mechanism", {".altsigner.class.class.name.of.an.alternative.signing.mechanism",
"[-altsigner <class>] \u4EE3\u66FF\u7F72\u540D\u30E1\u30AB\u30CB\u30BA\u30E0\u306E\u30AF\u30E9\u30B9\u540D"}, "[-altsigner <class>] \u4EE3\u66FF\u7F72\u540D\u30E1\u30AB\u30CB\u30BA\u30E0\u306E\u30AF\u30E9\u30B9\u540D"},
{".altsignerpath.pathlist.location.of.an.alternative.signing.mechanism", {".altsignerpath.pathlist.location.of.an.alternative.signing.mechanism",
......
/* /*
* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -88,6 +88,8 @@ public class Resources_zh_CN extends java.util.ListResourceBundle { ...@@ -88,6 +88,8 @@ public class Resources_zh_CN extends java.util.ListResourceBundle {
"[-tsacert <\u522B\u540D>] \u65F6\u95F4\u6233\u9881\u53D1\u673A\u6784\u7684\u516C\u5171\u5BC6\u94A5\u8BC1\u4E66"}, "[-tsacert <\u522B\u540D>] \u65F6\u95F4\u6233\u9881\u53D1\u673A\u6784\u7684\u516C\u5171\u5BC6\u94A5\u8BC1\u4E66"},
{".tsapolicyid.tsapolicyid.for.Timestamping.Authority", {".tsapolicyid.tsapolicyid.for.Timestamping.Authority",
"[-tsapolicyid <oid>] \u65F6\u95F4\u6233\u9881\u53D1\u673A\u6784\u7684 TSAPolicyID"}, "[-tsapolicyid <oid>] \u65F6\u95F4\u6233\u9881\u53D1\u673A\u6784\u7684 TSAPolicyID"},
{".tsadigestalg.algorithm.of.digest.data.in.timestamping.request",
"[-tsadigestalg <\u7B97\u6CD5>] \u65F6\u95F4\u6233\u8BF7\u6C42\u4E2D\u7684\u6458\u8981\u6570\u636E\u7684\u7B97\u6CD5"},
{".altsigner.class.class.name.of.an.alternative.signing.mechanism", {".altsigner.class.class.name.of.an.alternative.signing.mechanism",
"[-altsigner <\u7C7B>] \u66FF\u4EE3\u7684\u7B7E\u540D\u673A\u5236\u7684\u7C7B\u540D"}, "[-altsigner <\u7C7B>] \u66FF\u4EE3\u7684\u7B7E\u540D\u673A\u5236\u7684\u7C7B\u540D"},
{".altsignerpath.pathlist.location.of.an.alternative.signing.mechanism", {".altsignerpath.pathlist.location.of.an.alternative.signing.mechanism",
......
/* /*
* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -381,9 +381,9 @@ public class Resources_zh_TW extends java.util.ListResourceBundle { ...@@ -381,9 +381,9 @@ public class Resources_zh_TW extends java.util.ListResourceBundle {
"\u6C92\u6709\u4F86\u81EA SSL \u4F3A\u670D\u5668\u7684\u6191\u8B49"}, "\u6C92\u6709\u4F86\u81EA SSL \u4F3A\u670D\u5668\u7684\u6191\u8B49"},
{".The.integrity.of.the.information.stored.in.your.keystore.", {".The.integrity.of.the.information.stored.in.your.keystore.",
"* \u5C1A\u672A\u9A57\u8B49\u5132\u5B58\u65BC\u91D1\u9470\u5132\u5B58\u5EAB\u4E2D\u8CC7\u8A0A *\n* \u7684\u5B8C\u6574\u6027\uFF01\u82E5\u8981\u9A57\u8B49\u5176\u5B8C\u6574\u6027\uFF0C*\n* \u60A8\u5FC5\u9808\u63D0\u4F9B\u60A8\u7684\u91D1\u9470\u5132\u5B58\u5EAB\u5BC6\u78BC\u3002 *"}, "* \u5C1A\u672A\u9A57\u8B49\u5132\u5B58\u65BC\u91D1\u9470\u5132\u5B58\u5EAB\u4E2D\u8CC7\u8A0A *\n* \u7684\u5B8C\u6574\u6027\uFF01\u82E5\u8981\u9A57\u8B49\u5176\u5B8C\u6574\u6027\uFF0C *\n* \u60A8\u5FC5\u9808\u63D0\u4F9B\u60A8\u7684\u91D1\u9470\u5132\u5B58\u5EAB\u5BC6\u78BC\u3002 *"},
{".The.integrity.of.the.information.stored.in.the.srckeystore.", {".The.integrity.of.the.information.stored.in.the.srckeystore.",
"* \u5C1A\u672A\u9A57\u8B49\u5132\u5B58\u65BC srckeystore \u4E2D\u8CC7\u8A0A*\n* \u7684\u5B8C\u6574\u6027\uFF01\u82E5\u8981\u9A57\u8B49\u5176\u5B8C\u6574\u6027\uFF0C\u60A8\u5FC5\u9808 *\n* \u63D0\u4F9B srckeystore \u5BC6\u78BC\u3002 *"}, "* \u5C1A\u672A\u9A57\u8B49\u5132\u5B58\u65BC srckeystore \u4E2D\u8CC7\u8A0A *\n* \u7684\u5B8C\u6574\u6027\uFF01\u82E5\u8981\u9A57\u8B49\u5176\u5B8C\u6574\u6027\uFF0C\u60A8\u5FC5\u9808 *\n* \u63D0\u4F9B srckeystore \u5BC6\u78BC\u3002 *"},
{"Certificate.reply.does.not.contain.public.key.for.alias.", {"Certificate.reply.does.not.contain.public.key.for.alias.",
"\u6191\u8B49\u56DE\u8986\u4E26\u672A\u5305\u542B <{0}> \u7684\u516C\u958B\u91D1\u9470"}, "\u6191\u8B49\u56DE\u8986\u4E26\u672A\u5305\u542B <{0}> \u7684\u516C\u958B\u91D1\u9470"},
......
/* /*
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -35,7 +35,7 @@ public class Resources_zh_TW extends java.util.ListResourceBundle { ...@@ -35,7 +35,7 @@ public class Resources_zh_TW extends java.util.ListResourceBundle {
private static final Object[][] contents = { private static final Object[][] contents = {
{"NEWLINE", "\n"}, {"NEWLINE", "\n"},
{"Warning.A.public.key.for.alias.signers.i.does.not.exist.Make.sure.a.KeyStore.is.properly.configured.", {"Warning.A.public.key.for.alias.signers.i.does.not.exist.Make.sure.a.KeyStore.is.properly.configured.",
"\u8B66\u544A: \u5225\u540D {0} \u7684\u516C\u958B\u91D1\u9470\u4E0D\u5B58\u5728\u3002\u8ACB\u78BA\u5B9A\u91D1\u9470\u5132\u5B58\u5EAB\u914D\u7F6E\u6B63\u78BA\u3002"}, "\u8B66\u544A: \u5225\u540D {0} \u7684\u516C\u958B\u91D1\u9470\u4E0D\u5B58\u5728\u3002\u8ACB\u78BA\u5B9A\u91D1\u9470\u5132\u5B58\u5EAB\u8A2D\u5B9A\u6B63\u78BA\u3002"},
{"Warning.Class.not.found.class", "\u8B66\u544A: \u627E\u4E0D\u5230\u985E\u5225 {0}"}, {"Warning.Class.not.found.class", "\u8B66\u544A: \u627E\u4E0D\u5230\u985E\u5225 {0}"},
{"Warning.Invalid.argument.s.for.constructor.arg", {"Warning.Invalid.argument.s.for.constructor.arg",
"\u8B66\u544A: \u7121\u6548\u7684\u5EFA\u69CB\u5B50\u5F15\u6578: {0}"}, "\u8B66\u544A: \u7121\u6548\u7684\u5EFA\u69CB\u5B50\u5F15\u6578: {0}"},
......
/* /*
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -83,7 +83,7 @@ public class Resources_zh_TW extends java.util.ListResourceBundle { ...@@ -83,7 +83,7 @@ public class Resources_zh_TW extends java.util.ListResourceBundle {
// javax.security.auth.login.LoginContext // javax.security.auth.login.LoginContext
{"Invalid.null.input.name", "\u7121\u6548\u7A7A\u503C\u8F38\u5165: \u540D\u7A31"}, {"Invalid.null.input.name", "\u7121\u6548\u7A7A\u503C\u8F38\u5165: \u540D\u7A31"},
{"No.LoginModules.configured.for.name", {"No.LoginModules.configured.for.name",
"\u7121\u91DD\u5C0D {0} \u914D\u7F6E\u7684 LoginModules"}, "\u7121\u91DD\u5C0D {0} \u8A2D\u5B9A\u7684 LoginModules"},
{"invalid.null.Subject.provided", "\u63D0\u4F9B\u7121\u6548\u7A7A\u503C\u4E3B\u984C"}, {"invalid.null.Subject.provided", "\u63D0\u4F9B\u7121\u6548\u7A7A\u503C\u4E3B\u984C"},
{"invalid.null.CallbackHandler.provided", {"invalid.null.CallbackHandler.provided",
"\u63D0\u4F9B\u7121\u6548\u7A7A\u503C CallbackHandler"}, "\u63D0\u4F9B\u7121\u6548\u7A7A\u503C CallbackHandler"},
......
...@@ -307,4 +307,16 @@ implements CertAttrSet<String> { ...@@ -307,4 +307,16 @@ implements CertAttrSet<String> {
public String getName() { public String getName() {
return (NAME); return (NAME);
} }
/**
* Return the encoded key identifier, or null if not specified.
*/
public byte[] getEncodedKeyIdentifier() throws IOException {
if (id != null) {
DerOutputStream derOut = new DerOutputStream();
id.encode(derOut);
return derOut.toByteArray();
}
return null;
}
} }
/* /*
* Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -310,6 +310,7 @@ public final class TimeZoneNames extends TimeZoneNamesBundle { ...@@ -310,6 +310,7 @@ public final class TimeZoneNames extends TimeZoneNamesBundle {
{"Europe/Bucharest", EET}, {"Europe/Bucharest", EET},
{"Asia/Shanghai", CTT}, {"Asia/Shanghai", CTT},
{"CTT", CTT}, {"CTT", CTT},
{"UTC", UTC},
/* Don't change the order of the above zones /* Don't change the order of the above zones
* to keep compatibility with the previous version. * to keep compatibility with the previous version.
*/ */
...@@ -1032,7 +1033,6 @@ public final class TimeZoneNames extends TimeZoneNamesBundle { ...@@ -1032,7 +1033,6 @@ public final class TimeZoneNames extends TimeZoneNamesBundle {
{"US/Pacific", PST}, {"US/Pacific", PST},
{"US/Pacific-New", PST}, {"US/Pacific-New", PST},
{"US/Samoa", SAMOA}, {"US/Samoa", SAMOA},
{"UTC", UTC},
{"VST", ICT}, {"VST", ICT},
{"W-SU", MSK}, {"W-SU", MSK},
{"WET", WET}, {"WET", WET},
......
/* /*
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -311,6 +311,7 @@ public final class TimeZoneNames_de extends TimeZoneNamesBundle { ...@@ -311,6 +311,7 @@ public final class TimeZoneNames_de extends TimeZoneNamesBundle {
{"Europe/Bucharest", EET}, {"Europe/Bucharest", EET},
{"Asia/Shanghai", CTT}, {"Asia/Shanghai", CTT},
{"CTT", CTT}, {"CTT", CTT},
{"UTC", UTC},
/* Don't change the order of the above zones /* Don't change the order of the above zones
* to keep compatibility with the previous version. * to keep compatibility with the previous version.
*/ */
...@@ -1033,7 +1034,6 @@ public final class TimeZoneNames_de extends TimeZoneNamesBundle { ...@@ -1033,7 +1034,6 @@ public final class TimeZoneNames_de extends TimeZoneNamesBundle {
{"US/Pacific", PST}, {"US/Pacific", PST},
{"US/Pacific-New", PST}, {"US/Pacific-New", PST},
{"US/Samoa", SAMOA}, {"US/Samoa", SAMOA},
{"UTC", UTC},
{"VST", ICT}, {"VST", ICT},
{"W-SU", MSK}, {"W-SU", MSK},
{"WET", WET}, {"WET", WET},
......
/* /*
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -311,6 +311,7 @@ public final class TimeZoneNames_es extends TimeZoneNamesBundle { ...@@ -311,6 +311,7 @@ public final class TimeZoneNames_es extends TimeZoneNamesBundle {
{"Europe/Bucharest", EET}, {"Europe/Bucharest", EET},
{"Asia/Shanghai", CTT}, {"Asia/Shanghai", CTT},
{"CTT", CTT}, {"CTT", CTT},
{"UTC", UTC},
/* Don't change the order of the above zones /* Don't change the order of the above zones
* to keep compatibility with the previous version. * to keep compatibility with the previous version.
*/ */
...@@ -1033,7 +1034,6 @@ public final class TimeZoneNames_es extends TimeZoneNamesBundle { ...@@ -1033,7 +1034,6 @@ public final class TimeZoneNames_es extends TimeZoneNamesBundle {
{"US/Pacific", PST}, {"US/Pacific", PST},
{"US/Pacific-New", PST}, {"US/Pacific-New", PST},
{"US/Samoa", SAMOA}, {"US/Samoa", SAMOA},
{"UTC", UTC},
{"VST", ICT}, {"VST", ICT},
{"W-SU", MSK}, {"W-SU", MSK},
{"WET", WET}, {"WET", WET},
......
/* /*
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -311,6 +311,7 @@ public final class TimeZoneNames_fr extends TimeZoneNamesBundle { ...@@ -311,6 +311,7 @@ public final class TimeZoneNames_fr extends TimeZoneNamesBundle {
{"Europe/Bucharest", EET}, {"Europe/Bucharest", EET},
{"Asia/Shanghai", CTT}, {"Asia/Shanghai", CTT},
{"CTT", CTT}, {"CTT", CTT},
{"UTC", UTC},
/* Don't change the order of the above zones /* Don't change the order of the above zones
* to keep compatibility with the previous version. * to keep compatibility with the previous version.
*/ */
...@@ -1033,7 +1034,6 @@ public final class TimeZoneNames_fr extends TimeZoneNamesBundle { ...@@ -1033,7 +1034,6 @@ public final class TimeZoneNames_fr extends TimeZoneNamesBundle {
{"US/Pacific", PST}, {"US/Pacific", PST},
{"US/Pacific-New", PST}, {"US/Pacific-New", PST},
{"US/Samoa", SAMOA}, {"US/Samoa", SAMOA},
{"UTC", UTC},
{"VST", ICT}, {"VST", ICT},
{"W-SU", MSK}, {"W-SU", MSK},
{"WET", WET}, {"WET", WET},
......
/* /*
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -311,6 +311,7 @@ public final class TimeZoneNames_it extends TimeZoneNamesBundle { ...@@ -311,6 +311,7 @@ public final class TimeZoneNames_it extends TimeZoneNamesBundle {
{"Europe/Bucharest", EET}, {"Europe/Bucharest", EET},
{"Asia/Shanghai", CTT}, {"Asia/Shanghai", CTT},
{"CTT", CTT}, {"CTT", CTT},
{"UTC", UTC},
/* Don't change the order of the above zones /* Don't change the order of the above zones
* to keep compatibility with the previous version. * to keep compatibility with the previous version.
*/ */
...@@ -1033,7 +1034,6 @@ public final class TimeZoneNames_it extends TimeZoneNamesBundle { ...@@ -1033,7 +1034,6 @@ public final class TimeZoneNames_it extends TimeZoneNamesBundle {
{"US/Pacific", PST}, {"US/Pacific", PST},
{"US/Pacific-New", PST}, {"US/Pacific-New", PST},
{"US/Samoa", SAMOA}, {"US/Samoa", SAMOA},
{"UTC", UTC},
{"VST", ICT}, {"VST", ICT},
{"W-SU", MSK}, {"W-SU", MSK},
{"WET", WET}, {"WET", WET},
......
/* /*
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -311,6 +311,7 @@ public final class TimeZoneNames_ja extends TimeZoneNamesBundle { ...@@ -311,6 +311,7 @@ public final class TimeZoneNames_ja extends TimeZoneNamesBundle {
{"Europe/Bucharest", EET}, {"Europe/Bucharest", EET},
{"Asia/Shanghai", CTT}, {"Asia/Shanghai", CTT},
{"CTT", CTT}, {"CTT", CTT},
{"UTC", UTC},
/* Don't change the order of the above zones /* Don't change the order of the above zones
* to keep compatibility with the previous version. * to keep compatibility with the previous version.
*/ */
...@@ -1033,7 +1034,6 @@ public final class TimeZoneNames_ja extends TimeZoneNamesBundle { ...@@ -1033,7 +1034,6 @@ public final class TimeZoneNames_ja extends TimeZoneNamesBundle {
{"US/Pacific", PST}, {"US/Pacific", PST},
{"US/Pacific-New", PST}, {"US/Pacific-New", PST},
{"US/Samoa", SAMOA}, {"US/Samoa", SAMOA},
{"UTC", UTC},
{"VST", ICT}, {"VST", ICT},
{"W-SU", MSK}, {"W-SU", MSK},
{"WET", WET}, {"WET", WET},
......
/* /*
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -311,6 +311,7 @@ public final class TimeZoneNames_ko extends TimeZoneNamesBundle { ...@@ -311,6 +311,7 @@ public final class TimeZoneNames_ko extends TimeZoneNamesBundle {
{"Europe/Bucharest", EET}, {"Europe/Bucharest", EET},
{"Asia/Shanghai", CTT}, {"Asia/Shanghai", CTT},
{"CTT", CTT}, {"CTT", CTT},
{"UTC", UTC},
/* Don't change the order of the above zones /* Don't change the order of the above zones
* to keep compatibility with the previous version. * to keep compatibility with the previous version.
*/ */
...@@ -1033,7 +1034,6 @@ public final class TimeZoneNames_ko extends TimeZoneNamesBundle { ...@@ -1033,7 +1034,6 @@ public final class TimeZoneNames_ko extends TimeZoneNamesBundle {
{"US/Pacific", PST}, {"US/Pacific", PST},
{"US/Pacific-New", PST}, {"US/Pacific-New", PST},
{"US/Samoa", SAMOA}, {"US/Samoa", SAMOA},
{"UTC", UTC},
{"VST", ICT}, {"VST", ICT},
{"W-SU", MSK}, {"W-SU", MSK},
{"WET", WET}, {"WET", WET},
......
/* /*
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -311,6 +311,7 @@ public final class TimeZoneNames_pt_BR extends TimeZoneNamesBundle { ...@@ -311,6 +311,7 @@ public final class TimeZoneNames_pt_BR extends TimeZoneNamesBundle {
{"Europe/Bucharest", EET}, {"Europe/Bucharest", EET},
{"Asia/Shanghai", CTT}, {"Asia/Shanghai", CTT},
{"CTT", CTT}, {"CTT", CTT},
{"UTC", UTC},
/* Don't change the order of the above zones /* Don't change the order of the above zones
* to keep compatibility with the previous version. * to keep compatibility with the previous version.
*/ */
...@@ -1033,7 +1034,6 @@ public final class TimeZoneNames_pt_BR extends TimeZoneNamesBundle { ...@@ -1033,7 +1034,6 @@ public final class TimeZoneNames_pt_BR extends TimeZoneNamesBundle {
{"US/Pacific", PST}, {"US/Pacific", PST},
{"US/Pacific-New", PST}, {"US/Pacific-New", PST},
{"US/Samoa", SAMOA}, {"US/Samoa", SAMOA},
{"UTC", UTC},
{"VST", ICT}, {"VST", ICT},
{"W-SU", MSK}, {"W-SU", MSK},
{"WET", WET}, {"WET", WET},
......
/* /*
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -311,6 +311,7 @@ public final class TimeZoneNames_sv extends TimeZoneNamesBundle { ...@@ -311,6 +311,7 @@ public final class TimeZoneNames_sv extends TimeZoneNamesBundle {
{"Europe/Bucharest", EET}, {"Europe/Bucharest", EET},
{"Asia/Shanghai", CTT}, {"Asia/Shanghai", CTT},
{"CTT", CTT}, {"CTT", CTT},
{"UTC", UTC},
/* Don't change the order of the above zones /* Don't change the order of the above zones
* to keep compatibility with the previous version. * to keep compatibility with the previous version.
*/ */
...@@ -1033,7 +1034,6 @@ public final class TimeZoneNames_sv extends TimeZoneNamesBundle { ...@@ -1033,7 +1034,6 @@ public final class TimeZoneNames_sv extends TimeZoneNamesBundle {
{"US/Pacific", PST}, {"US/Pacific", PST},
{"US/Pacific-New", PST}, {"US/Pacific-New", PST},
{"US/Samoa", SAMOA}, {"US/Samoa", SAMOA},
{"UTC", UTC},
{"VST", ICT}, {"VST", ICT},
{"W-SU", MSK}, {"W-SU", MSK},
{"WET", WET}, {"WET", WET},
......
/* /*
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -311,6 +311,7 @@ public final class TimeZoneNames_zh_CN extends TimeZoneNamesBundle { ...@@ -311,6 +311,7 @@ public final class TimeZoneNames_zh_CN extends TimeZoneNamesBundle {
{"Europe/Bucharest", EET}, {"Europe/Bucharest", EET},
{"Asia/Shanghai", CTT}, {"Asia/Shanghai", CTT},
{"CTT", CTT}, {"CTT", CTT},
{"UTC", UTC},
/* Don't change the order of the above zones /* Don't change the order of the above zones
* to keep compatibility with the previous version. * to keep compatibility with the previous version.
*/ */
...@@ -1033,7 +1034,6 @@ public final class TimeZoneNames_zh_CN extends TimeZoneNamesBundle { ...@@ -1033,7 +1034,6 @@ public final class TimeZoneNames_zh_CN extends TimeZoneNamesBundle {
{"US/Pacific", PST}, {"US/Pacific", PST},
{"US/Pacific-New", PST}, {"US/Pacific-New", PST},
{"US/Samoa", SAMOA}, {"US/Samoa", SAMOA},
{"UTC", UTC},
{"VST", ICT}, {"VST", ICT},
{"W-SU", MSK}, {"W-SU", MSK},
{"WET", WET}, {"WET", WET},
......
/* /*
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -311,6 +311,7 @@ public final class TimeZoneNames_zh_TW extends TimeZoneNamesBundle { ...@@ -311,6 +311,7 @@ public final class TimeZoneNames_zh_TW extends TimeZoneNamesBundle {
{"Europe/Bucharest", EET}, {"Europe/Bucharest", EET},
{"Asia/Shanghai", CTT}, {"Asia/Shanghai", CTT},
{"CTT", CTT}, {"CTT", CTT},
{"UTC", UTC},
/* Don't change the order of the above zones /* Don't change the order of the above zones
* to keep compatibility with the previous version. * to keep compatibility with the previous version.
*/ */
...@@ -1035,7 +1036,6 @@ public final class TimeZoneNames_zh_TW extends TimeZoneNamesBundle { ...@@ -1035,7 +1036,6 @@ public final class TimeZoneNames_zh_TW extends TimeZoneNamesBundle {
{"US/Pacific", PST}, {"US/Pacific", PST},
{"US/Pacific-New", PST}, {"US/Pacific-New", PST},
{"US/Samoa", SAMOA}, {"US/Samoa", SAMOA},
{"UTC", UTC},
{"VST", ICT}, {"VST", ICT},
{"W-SU", MSK}, {"W-SU", MSK},
{"WET", WET}, {"WET", WET},
......
...@@ -316,3 +316,16 @@ ...@@ -316,3 +316,16 @@
# For a non-default password file location use the following line # For a non-default password file location use the following line
# com.sun.management.jmxremote.access.file=filepath # com.sun.management.jmxremote.access.file=filepath
#
# ################ Management agent listen interface #########################
#
# com.sun.management.jmxremote.host=<host-or-interface-name>
# Specifies the local interface on which the JMX RMI agent will bind.
# This is useful when running on machines which have several
# interfaces defined. It makes it possible to listen to a specific
# subnet accessible through that interface.
#
# The format of the value for that property is any string accepted
# by java.net.InetAddress.getByName(String).
#
...@@ -225,9 +225,8 @@ final class UNIXProcess extends Process { ...@@ -225,9 +225,8 @@ final class UNIXProcess extends Process {
ThreadGroup systemThreadGroup = tg; ThreadGroup systemThreadGroup = tg;
ThreadFactory threadFactory = grimReaper -> { ThreadFactory threadFactory = grimReaper -> {
// Our thread stack requirement is quite modest. long stackSize = Boolean.getBoolean("jdk.lang.processReaperUseDefaultStackSize") ? 0 : 32768;
Thread t = new Thread(systemThreadGroup, grimReaper, Thread t = new Thread(systemThreadGroup, grimReaper,"process reaper", stackSize);
"process reaper", 32768);
t.setDaemon(true); t.setDaemon(true);
// A small attempt (probably futile) to avoid priority inversion // A small attempt (probably futile) to avoid priority inversion
t.setPriority(Thread.MAX_PRIORITY); t.setPriority(Thread.MAX_PRIORITY);
......
...@@ -79,7 +79,6 @@ public class XBaseWindow { ...@@ -79,7 +79,6 @@ public class XBaseWindow {
static enum InitialiseState { static enum InitialiseState {
INITIALISING, INITIALISING,
NOT_INITIALISED,
INITIALISED, INITIALISED,
FAILED_INITIALISATION FAILED_INITIALISATION
}; };
...@@ -122,7 +121,6 @@ public class XBaseWindow { ...@@ -122,7 +121,6 @@ public class XBaseWindow {
*/ */
void instantPreInit(XCreateWindowParams params) { void instantPreInit(XCreateWindowParams params) {
state_lock = new StateLock(); state_lock = new StateLock();
initialising = InitialiseState.NOT_INITIALISED;
} }
/** /**
...@@ -131,7 +129,6 @@ public class XBaseWindow { ...@@ -131,7 +129,6 @@ public class XBaseWindow {
*/ */
void preInit(XCreateWindowParams params) { void preInit(XCreateWindowParams params) {
state_lock = new StateLock(); state_lock = new StateLock();
initialising = InitialiseState.NOT_INITIALISED;
embedded = Boolean.TRUE.equals(params.get(EMBEDDED)); embedded = Boolean.TRUE.equals(params.get(EMBEDDED));
visible = Boolean.TRUE.equals(params.get(VISIBLE)); visible = Boolean.TRUE.equals(params.get(VISIBLE));
...@@ -223,7 +220,6 @@ public class XBaseWindow { ...@@ -223,7 +220,6 @@ public class XBaseWindow {
return false; return false;
} }
return true; return true;
case NOT_INITIALISED:
case FAILED_INITIALISATION: case FAILED_INITIALISATION:
return false; return false;
default: default:
...@@ -673,7 +669,7 @@ public class XBaseWindow { ...@@ -673,7 +669,7 @@ public class XBaseWindow {
XToolkit.awtLock(); XToolkit.awtLock();
try { try {
XAtom xa = XAtom.get(XAtom.XA_WM_CLASS); XAtom xa = XAtom.get(XAtom.XA_WM_CLASS);
xa.setProperty8(getWindow(), cl[0] + '\0' + cl[1]); xa.setProperty8(getWindow(), cl[0] + '\0' + cl[1] + '\0');
} finally { } finally {
XToolkit.awtUnlock(); XToolkit.awtUnlock();
} }
......
...@@ -242,7 +242,7 @@ sequence.fallback=lucida,\ ...@@ -242,7 +242,7 @@ sequence.fallback=lucida,\
# Exclusion Ranges # Exclusion Ranges
exclusion.alphabetic=0700-1e9f,1f00-20ab,20ad-f8ff exclusion.alphabetic=0700-1e9f,1f00-2017,2020-20ab,20ad-f8ff
exclusion.chinese-gb18030=0390-03d6,2200-22ef,2701-27be exclusion.chinese-gb18030=0390-03d6,2200-22ef,2701-27be
exclusion.hebrew=0041-005a,0060-007a,007f-00ff,20ac-20ac exclusion.hebrew=0041-005a,0060-007a,007f-00ff,20ac-20ac
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册