Merge
This commit is contained in:
commit
5a54c4303b
jdk
make
CompileDemos.gmkImport.gmk
copy
data/tzdata
gensrc
launcher
lib
Awt2dLibraries.gmkCoreLibraries.gmkLib-java.instrument.gmkLib-java.management.gmkLib-java.prefs.gmkLib-java.security.jgss.gmkLib-java.smartcardio.gmkLib-jdk.crypto.mscapi.gmkLib-jdk.crypto.pkcs11.gmkLib-jdk.jdi.gmkLib-jdk.jdwp.agent.gmkLib-jdk.runtime.gmkLib-jdk.sctp.gmkLib-jdk.security.auth.gmkLibCommon.gmkNetworkingLibraries.gmkNioLibraries.gmkSoundLibraries.gmk
src/classes/build/tools/tzdb
src
java.base
share/classes
com/sun
crypto/provider
PBES2Parameters.javaRSACipher.javaTlsKeyMaterialGenerator.javaTlsMasterSecretGenerator.javaTlsPrfGenerator.javaTlsRsaPremasterSecretGenerator.java
net/ssl
SSLSecurity.java
internal/www/protocol/https
java
lang
Class.javaObject.javaThread.java
invoke
LambdaForm.javaLambdaFormBuffer.javaLambdaFormEditor.javaMethodHandle.javaMethodHandleImpl.javaMethodHandleStatics.javaMethodHandles.javaMethodTypeForm.java
reflect
net
nio
security
text
util
javax
sun
unix/classes/java/lang
windows
java.desktop/share/classes
META-INF/services
java/awt
javax/swing/plaf/basic
sun/awt
@ -44,7 +44,7 @@ BUILD_DEMOS =
|
||||
DEMO_SHARE_SRC := $(JDK_TOPDIR)/src/demo/share
|
||||
DEMO_CLOSED_SHARE_SRC := $(JDK_TOPDIR)/src/closed/demo/share
|
||||
DEMO_SOLARIS_SRC := $(JDK_TOPDIR)/src/demo/solaris
|
||||
DEMO_OS_API_SRC := $(JDK_TOPDIR)/src/demo/$(OPENJDK_TARGET_OS_API_DIR)
|
||||
DEMO_OS_TYPE_SRC := $(JDK_TOPDIR)/src/demo/$(OPENJDK_TARGET_OS_TYPE)
|
||||
VERSION_INFO_RESOURCE := $(JDK_TOPDIR)/src/java.base/windows/native/common/version.rc
|
||||
|
||||
##################################################################################################
|
||||
@ -214,13 +214,13 @@ define SetupJVMTIDemo
|
||||
# Param 2 = add these directories to the includes, default is agent_util
|
||||
# Param 3 = extra CFLAGS
|
||||
# Param 4 = C or C++ (defaults to C)
|
||||
# Param 5 = libs for posix
|
||||
# Param 5 = libs for unix
|
||||
# Param 6 = libs for windows
|
||||
# Param 7 = libs for solaris
|
||||
# Param 8 = libs for linux
|
||||
# Param 9 = extra directories with required sources
|
||||
BUILD_DEMO_JVMTI_$1_EXTRA_SRC := \
|
||||
$$(wildcard $(DEMO_OS_API_SRC)/jvmti/$1) \
|
||||
$$(wildcard $(DEMO_OS_TYPE_SRC)/jvmti/$1) \
|
||||
$$(wildcard $$(addprefix $(DEMO_SHARE_SRC)/jvmti/, $2)) \
|
||||
$9
|
||||
BUILD_DEMO_JVMTI_$1_EXTRA_SRC_EXCLUDE := \
|
||||
@ -257,7 +257,7 @@ define SetupJVMTIDemo
|
||||
LDFLAGS := $(filter-out -incremental:no -opt:ref, $(LDFLAGS_JDKLIB)), \
|
||||
LDFLAGS_macosx := $(call SET_EXECUTABLE_ORIGIN), \
|
||||
LDFLAGS_SUFFIX := $$($1_EXTRA_CXX), \
|
||||
LDFLAGS_SUFFIX_posix := $5, \
|
||||
LDFLAGS_SUFFIX_unix := $5, \
|
||||
LDFLAGS_SUFFIX_windows := $6, \
|
||||
LDFLAGS_SUFFIX_solaris := $7 -lc, \
|
||||
LDFLAGS_SUFFIX_linux := $8, \
|
||||
|
@ -30,7 +30,7 @@ include MakeBase.gmk
|
||||
|
||||
################################################################################
|
||||
|
||||
# Put the libraries here. Different locations for different target apis.
|
||||
# Put the libraries here. Different locations for different target OS types.
|
||||
ifneq ($(OPENJDK_TARGET_OS), windows)
|
||||
HOTSPOT_LIB_DIR := $(HOTSPOT_DIST)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR)
|
||||
BASE_INSTALL_LIBRARIES_HERE := $(SUPPORT_OUTPUTDIR)/modules_libs/java.base$(OPENJDK_TARGET_CPU_LIBDIR)
|
||||
|
@ -85,7 +85,7 @@ endif
|
||||
ifeq ($(OPENJDK_TARGET_OS), macosx)
|
||||
JVMCFG_SRC := $(JDK_TOPDIR)/src/java.base/macosx/conf/$(JVMCFG_ARCH)/jvm.cfg
|
||||
else
|
||||
JVMCFG_SRC := $(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_API_DIR)/conf/$(JVMCFG_ARCH)/jvm.cfg
|
||||
JVMCFG_SRC := $(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/conf/$(JVMCFG_ARCH)/jvm.cfg
|
||||
endif
|
||||
JVMCFG_DIR := $(LIB_DST_DIR)$(OPENJDK_TARGET_CPU_LIBDIR)
|
||||
JVMCFG := $(JVMCFG_DIR)/jvm.cfg
|
||||
@ -192,7 +192,7 @@ $(CONF_DST_DIR)/net.properties: $(JDK_TOPDIR)/src/java.base/share/conf/net.prope
|
||||
TARGETS += $(CONF_DST_DIR)/net.properties
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_OS), solaris)
|
||||
$(CONF_DST_DIR)/sdp/sdp.conf.template: $(JDK_TOPDIR)/src/java.base/${OPENJDK_TARGET_OS_API_DIR}/conf/sdp/sdp.conf.template
|
||||
$(CONF_DST_DIR)/sdp/sdp.conf.template: $(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/conf/sdp/sdp.conf.template
|
||||
$(ECHO) $(LOG_INFO) Copying $(@F)
|
||||
$(call install-file)
|
||||
|
||||
|
@ -104,13 +104,13 @@ TARGETS += $(PSFONTPROPFILE_TARGET_FILES)
|
||||
# Copy cursor.properties and cursors gif files to LIB_DST_DIR
|
||||
#
|
||||
ifneq ($(OPENJDK_TARGET_OS), macosx)
|
||||
OPENJDK_TARGET_OS_LIB_SRC := $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/conf
|
||||
OPENJDK_TARGET_OS_LIB_SRC := $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/conf
|
||||
else
|
||||
OPENJDK_TARGET_OS_LIB_SRC := $(JDK_TOPDIR)/src/java.desktop/macosx/conf
|
||||
endif
|
||||
|
||||
CURSORS_DEST_DIR := $(LIB_DST_DIR)/images/cursors
|
||||
CURSORS_OPENJDK_TARGET_OS_LIB_SRC := $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/conf/images/cursors
|
||||
CURSORS_OPENJDK_TARGET_OS_LIB_SRC := $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/conf/images/cursors
|
||||
|
||||
$(CURSORS_DEST_DIR)/cursors.properties: $(CURSORS_OPENJDK_TARGET_OS_LIB_SRC)/cursors.properties
|
||||
$(call install-file)
|
||||
|
@ -21,4 +21,4 @@
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
tzdata2014i
|
||||
tzdata2014j
|
||||
|
@ -29,20 +29,19 @@
|
||||
# tz@iana.org for general use in the future). For more, please see
|
||||
# the file CONTRIBUTING in the tz distribution.
|
||||
|
||||
# From Paul Eggert (2013-02-21):
|
||||
# From Paul Eggert (2014-10-31):
|
||||
#
|
||||
# A good source for time zone historical data outside the U.S. is
|
||||
# Unless otherwise specified, the source for data through 1990 is:
|
||||
# Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
|
||||
# San Diego: ACS Publications, Inc. (2003).
|
||||
# Unfortunately this book contains many errors and cites no sources.
|
||||
#
|
||||
# Gwillim Law writes that a good source
|
||||
# for recent time zone data is the International Air Transport
|
||||
# Association's Standard Schedules Information Manual (IATA SSIM),
|
||||
# published semiannually. Law sent in several helpful summaries
|
||||
# of the IATA's data after 1990.
|
||||
#
|
||||
# Except where otherwise noted, Shanks & Pottenger is the source for
|
||||
# entries through 1990, and IATA SSIM is the source for entries afterwards.
|
||||
# of the IATA's data after 1990. Except where otherwise noted,
|
||||
# IATA SSIM is the source for entries after 1990.
|
||||
#
|
||||
# Another source occasionally used is Edward W. Whitman, World Time Differences,
|
||||
# Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated), which
|
||||
@ -88,7 +87,6 @@
|
||||
# 3:00 CAST Central Africa Summer Time (no longer used)
|
||||
# 3:00 SAST South Africa Summer Time (no longer used)
|
||||
# 3:00 EAT East Africa Time
|
||||
# 4:00 EAST East Africa Summer Time (no longer used)
|
||||
|
||||
# Algeria
|
||||
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
|
||||
@ -169,9 +167,7 @@ Zone Africa/Ndjamena 1:00:12 - LMT 1912 # N'Djamena
|
||||
1:00 - WAT
|
||||
|
||||
# Comoros
|
||||
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
|
||||
Zone Indian/Comoro 2:53:04 - LMT 1911 Jul # Moroni, Gran Comoro
|
||||
3:00 - EAT
|
||||
# See Africa/Nairobi.
|
||||
|
||||
# Democratic Republic of the Congo
|
||||
# See Africa/Lagos for the western part and Africa/Maputo for the eastern.
|
||||
@ -195,9 +191,7 @@ Link Africa/Abidjan Africa/Sao_Tome # São Tomé and Príncipe
|
||||
Link Africa/Abidjan Atlantic/St_Helena # St Helena
|
||||
|
||||
# Djibouti
|
||||
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
|
||||
Zone Africa/Djibouti 2:52:36 - LMT 1911 Jul
|
||||
3:00 - EAT
|
||||
# See Africa/Nairobi.
|
||||
|
||||
###############################################################################
|
||||
|
||||
@ -410,27 +404,8 @@ Zone Africa/Cairo 2:05:09 - LMT 1900 Oct
|
||||
# See Africa/Lagos.
|
||||
|
||||
# Eritrea
|
||||
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
|
||||
Zone Africa/Asmara 2:35:32 - LMT 1870
|
||||
2:35:32 - AMT 1890 # Asmara Mean Time
|
||||
2:35:20 - ADMT 1936 May 5 # Adis Dera MT
|
||||
3:00 - EAT
|
||||
|
||||
# Ethiopia
|
||||
# From Paul Eggert (2014-07-31):
|
||||
# Like the Swahili of Kenya and Tanzania, many Ethiopians keep a
|
||||
# 12-hour clock starting at our 06:00, so their "8 o'clock" is our
|
||||
# 02:00 or 14:00. Keep this in mind when you ask the time in Amharic.
|
||||
#
|
||||
# Shanks & Pottenger write that Ethiopia had six narrowly-spaced time
|
||||
# zones between 1870 and 1890, that they merged to 38E50 (2:35:20) in
|
||||
# 1890, and that they switched to 3:00 on 1936-05-05. Perhaps 38E50
|
||||
# was for Adis Dera. Quite likely the Shanks data entries are wrong
|
||||
# anyway.
|
||||
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
|
||||
Zone Africa/Addis_Ababa 2:34:48 - LMT 1870
|
||||
2:35:20 - ADMT 1936 May 5 # Adis Dera MT
|
||||
3:00 - EAT
|
||||
# See Africa/Nairobi.
|
||||
|
||||
# Gabon
|
||||
# See Africa/Lagos.
|
||||
@ -474,6 +449,15 @@ Zone Africa/Nairobi 2:27:16 - LMT 1928 Jul
|
||||
2:30 - BEAT 1940
|
||||
2:45 - BEAUT 1960
|
||||
3:00 - EAT
|
||||
Link Africa/Nairobi Africa/Addis_Ababa # Ethiopia
|
||||
Link Africa/Nairobi Africa/Asmara # Eritrea
|
||||
Link Africa/Nairobi Africa/Dar_es_Salaam # Tanzania
|
||||
Link Africa/Nairobi Africa/Djibouti
|
||||
Link Africa/Nairobi Africa/Kampala # Uganda
|
||||
Link Africa/Nairobi Africa/Mogadishu # Somalia
|
||||
Link Africa/Nairobi Indian/Antananarivo # Madagascar
|
||||
Link Africa/Nairobi Indian/Comoro
|
||||
Link Africa/Nairobi Indian/Mayotte
|
||||
|
||||
# Lesotho
|
||||
# See Africa/Johannesburg.
|
||||
@ -551,11 +535,7 @@ Zone Africa/Tripoli 0:52:44 - LMT 1920
|
||||
2:00 - EET
|
||||
|
||||
# Madagascar
|
||||
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
|
||||
Zone Indian/Antananarivo 3:10:04 - LMT 1911 Jul
|
||||
3:00 - EAT 1954 Feb 27 23:00s
|
||||
3:00 1:00 EAST 1954 May 29 23:00s
|
||||
3:00 - EAT
|
||||
# See Africa/Nairobi.
|
||||
|
||||
# Malawi
|
||||
# See Africa/Maputo.
|
||||
@ -658,9 +638,7 @@ Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis
|
||||
# no information; probably like Indian/Mauritius
|
||||
|
||||
# Mayotte
|
||||
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
|
||||
Zone Indian/Mayotte 3:00:56 - LMT 1911 Jul # Mamoutzou
|
||||
3:00 - EAT
|
||||
# See Africa/Nairobi.
|
||||
|
||||
# Morocco
|
||||
# See the 'europe' file for Spanish Morocco (Africa/Ceuta).
|
||||
@ -1072,11 +1050,7 @@ Zone Indian/Mahe 3:41:48 - LMT 1906 Jun # Victoria
|
||||
# See Africa/Abidjan.
|
||||
|
||||
# Somalia
|
||||
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
|
||||
Zone Africa/Mogadishu 3:01:28 - LMT 1893 Nov
|
||||
3:00 - EAT 1931
|
||||
2:30 - BEAT 1957
|
||||
3:00 - EAT
|
||||
# See Africa/Nairobi.
|
||||
|
||||
# South Africa
|
||||
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
|
||||
@ -1119,11 +1093,7 @@ Link Africa/Khartoum Africa/Juba
|
||||
# See Africa/Johannesburg.
|
||||
|
||||
# Tanzania
|
||||
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
|
||||
Zone Africa/Dar_es_Salaam 2:37:08 - LMT 1931
|
||||
3:00 - EAT 1948
|
||||
2:45 - BEAUT 1961
|
||||
3:00 - EAT
|
||||
# See Africa/Nairobi.
|
||||
|
||||
# Togo
|
||||
# See Africa/Abidjan.
|
||||
@ -1229,12 +1199,7 @@ Zone Africa/Tunis 0:40:44 - LMT 1881 May 12
|
||||
1:00 Tunisia CE%sT
|
||||
|
||||
# Uganda
|
||||
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
|
||||
Zone Africa/Kampala 2:09:40 - LMT 1928 Jul
|
||||
3:00 - EAT 1930
|
||||
2:30 - BEAT 1948
|
||||
2:45 - BEAUT 1957
|
||||
3:00 - EAT
|
||||
# See Africa/Nairobi.
|
||||
|
||||
# Zambia
|
||||
# Zimbabwe
|
||||
|
@ -29,20 +29,19 @@
|
||||
# tz@iana.org for general use in the future). For more, please see
|
||||
# the file CONTRIBUTING in the tz distribution.
|
||||
|
||||
# From Paul Eggert (2013-08-11):
|
||||
# From Paul Eggert (2014-10-31):
|
||||
#
|
||||
# A good source for time zone historical data outside the U.S. is
|
||||
# Unless otherwise specified, the source for data through 1990 is:
|
||||
# Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
|
||||
# San Diego: ACS Publications, Inc. (2003).
|
||||
# Unfortunately this book contains many errors and cites no sources.
|
||||
#
|
||||
# Gwillim Law writes that a good source
|
||||
# for recent time zone data is the International Air Transport
|
||||
# Association's Standard Schedules Information Manual (IATA SSIM),
|
||||
# published semiannually. Law sent in several helpful summaries
|
||||
# of the IATA's data after 1990.
|
||||
#
|
||||
# Except where otherwise noted, Shanks & Pottenger is the source for
|
||||
# entries through 1990, and IATA SSIM is the source for entries afterwards.
|
||||
# of the IATA's data after 1990. Except where otherwise noted,
|
||||
# IATA SSIM is the source for entries after 1990.
|
||||
#
|
||||
# Another source occasionally used is Edward W. Whitman, World Time Differences,
|
||||
# Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated), which
|
||||
@ -1686,44 +1685,70 @@ Zone Asia/Bishkek 4:58:24 - LMT 1924 May 2
|
||||
# Korea (North and South)
|
||||
|
||||
# From Annie I. Bang (2006-07-10):
|
||||
# http://www.koreaherald.co.kr/SITE/data/html_dir/2006/07/10/200607100012.asp
|
||||
# The Ministry of Commerce, Industry and Energy has already
|
||||
# commissioned a research project [to reintroduce DST] and has said
|
||||
# the system may begin as early as 2008.... Korea ran a daylight
|
||||
# saving program from 1949-61 but stopped it during the 1950-53 Korean War.
|
||||
# http://www.koreaherald.com/view.php?ud=200607100012
|
||||
# Korea ran a daylight saving program from 1949-61 but stopped it
|
||||
# during the 1950-53 Korean War. The system was temporarily enforced
|
||||
# between 1987 and 1988 ...
|
||||
|
||||
# From Sanghyuk Jung (2014-10-29):
|
||||
# http://mm.icann.org/pipermail/tz/2014-October/021830.html
|
||||
# According to the Korean Wikipedia
|
||||
# http://ko.wikipedia.org/wiki/한국_표준시
|
||||
# [oldid=12896437 2014-09-04 08:03 UTC]
|
||||
# DST in Republic of Korea was as follows.... And I checked old
|
||||
# newspapers in Korean, all articles correspond with data in Wikipedia.
|
||||
# For example, the article in 1948 (Korean Language) proved that DST
|
||||
# started at June 1 in that year. For another example, the article in
|
||||
# 1988 said that DST started at 2:00 AM in that year.
|
||||
|
||||
# From Shanks & Pottenger:
|
||||
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
|
||||
Rule ROK 1960 only - May 15 0:00 1:00 D
|
||||
Rule ROK 1960 only - Sep 13 0:00 0 S
|
||||
Rule ROK 1987 1988 - May Sun>=8 0:00 1:00 D
|
||||
Rule ROK 1987 1988 - Oct Sun>=8 0:00 0 S
|
||||
Rule ROK 1948 only - Jun 1 0:00 1:00 D
|
||||
Rule ROK 1948 only - Sep 13 0:00 0 S
|
||||
Rule ROK 1949 only - Apr 3 0:00 1:00 D
|
||||
Rule ROK 1949 1951 - Sep Sun>=8 0:00 0 S
|
||||
Rule ROK 1950 only - Apr 1 0:00 1:00 D
|
||||
Rule ROK 1951 only - May 6 0:00 1:00 D
|
||||
Rule ROK 1955 only - May 5 0:00 1:00 D
|
||||
Rule ROK 1955 only - Sep 9 0:00 0 S
|
||||
Rule ROK 1956 only - May 20 0:00 1:00 D
|
||||
Rule ROK 1956 only - Sep 30 0:00 0 S
|
||||
Rule ROK 1957 1960 - May Sun>=1 0:00 1:00 D
|
||||
Rule ROK 1957 1960 - Sep Sun>=18 0:00 0 S
|
||||
Rule ROK 1987 1988 - May Sun>=8 2:00 1:00 D
|
||||
Rule ROK 1987 1988 - Oct Sun>=8 3:00 0 S
|
||||
|
||||
# From Paul Eggert (2014-07-01):
|
||||
# The following entries are from Shanks & Pottenger, except that I
|
||||
# guessed that time zone abbreviations through 1945 followed the same
|
||||
# From Paul Eggert (2014-10-30):
|
||||
# The Korean Wikipedia entry gives the following sources for UT offsets:
|
||||
#
|
||||
# 1908: Official Journal Article No. 3994 (Edict No. 5)
|
||||
# 1912: Governor-General of Korea Official Gazette Issue No. 367
|
||||
# (Announcement No. 338)
|
||||
# 1954: Presidential Decree No. 876 (1954-03-17)
|
||||
# 1961: Law No. 676 (1961-08-07)
|
||||
# 1987: Law No. 3919 (1986-12-31)
|
||||
#
|
||||
# The Wikipedia entry also has confusing information about a change
|
||||
# to UT+9 in April 1910, but then what would be the point of the later change
|
||||
# to UT+9 on 1912-01-01? Omit the 1910 change for now.
|
||||
#
|
||||
# I guessed that time zone abbreviations through 1945 followed the same
|
||||
# rules as discussed under Taiwan, with nominal switches from JST to KST
|
||||
# when the respective cities were taken over by the Allies after WWII.
|
||||
#
|
||||
# For Pyongyang we have no information; guess no changes since World War II.
|
||||
|
||||
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
|
||||
Zone Asia/Seoul 8:27:52 - LMT 1890
|
||||
8:30 - KST 1904 Dec
|
||||
9:00 - JCST 1928
|
||||
8:30 - KST 1932
|
||||
Zone Asia/Seoul 8:27:52 - LMT 1908 Apr 1
|
||||
8:30 - KST 1912 Jan 1
|
||||
9:00 - JCST 1937 Oct 1
|
||||
9:00 - JST 1945 Sep 8
|
||||
9:00 - KST 1954 Mar 21
|
||||
8:00 ROK K%sT 1961 Aug 10
|
||||
8:30 - KST 1968 Oct
|
||||
8:30 ROK K%sT 1961 Aug 10
|
||||
9:00 ROK K%sT
|
||||
Zone Asia/Pyongyang 8:23:00 - LMT 1890
|
||||
8:30 - KST 1904 Dec
|
||||
9:00 - JCST 1928
|
||||
8:30 - KST 1932
|
||||
Zone Asia/Pyongyang 8:23:00 - LMT 1908 Apr 1
|
||||
8:30 - KST 1912 Jan 1
|
||||
9:00 - JCST 1937 Oct 1
|
||||
9:00 - JST 1945 Aug 24
|
||||
9:00 - KST 1954 Mar 21
|
||||
8:00 - KST 1961 Aug 10
|
||||
9:00 - KST
|
||||
|
||||
###############################################################################
|
||||
|
@ -820,19 +820,19 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901
|
||||
# tz@iana.org for general use in the future). For more, please see
|
||||
# the file CONTRIBUTING in the tz distribution.
|
||||
|
||||
# From Paul Eggert (2013-02-21):
|
||||
# A good source for time zone historical data outside the U.S. is
|
||||
# From Paul Eggert (2014-10-31):
|
||||
#
|
||||
# Unless otherwise specified, the source for data through 1990 is:
|
||||
# Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
|
||||
# San Diego: ACS Publications, Inc. (2003).
|
||||
# Unfortunately this book contains many errors and cites no sources.
|
||||
#
|
||||
# Gwillim Law writes that a good source
|
||||
# for recent time zone data is the International Air Transport
|
||||
# Association's Standard Schedules Information Manual (IATA SSIM),
|
||||
# published semiannually. Law sent in several helpful summaries
|
||||
# of the IATA's data after 1990.
|
||||
#
|
||||
# Except where otherwise noted, Shanks & Pottenger is the source for
|
||||
# entries through 1990, and IATA SSIM is the source for entries afterwards.
|
||||
# of the IATA's data after 1990. Except where otherwise noted,
|
||||
# IATA SSIM is the source for entries after 1990.
|
||||
#
|
||||
# Another source occasionally used is Edward W. Whitman, World Time Differences,
|
||||
# Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated), which
|
||||
|
@ -29,16 +29,19 @@
|
||||
# tz@iana.org for general use in the future). For more, please see
|
||||
# the file CONTRIBUTING in the tz distribution.
|
||||
|
||||
# From Paul Eggert (2014-05-31):
|
||||
# A good source for time zone historical data outside the U.S. is
|
||||
# From Paul Eggert (2014-10-31):
|
||||
#
|
||||
# Unless otherwise specified, the source for data through 1990 is:
|
||||
# Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
|
||||
# San Diego: ACS Publications, Inc. (2003).
|
||||
# Unfortunately this book contains many errors and cites no sources.
|
||||
#
|
||||
# Gwillim Law writes that a good source
|
||||
# for recent time zone data is the International Air Transport
|
||||
# Association's Standard Schedules Information Manual (IATA SSIM),
|
||||
# published semiannually. Law sent in several helpful summaries
|
||||
# of the IATA's data after 1990.
|
||||
# of the IATA's data after 1990. Except where otherwise noted,
|
||||
# IATA SSIM is the source for entries after 1990.
|
||||
#
|
||||
# A reliable and entertaining source about time zones is
|
||||
# Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997).
|
||||
@ -310,6 +313,14 @@
|
||||
# "Timeball on the ballast office is down. Dunsink time."
|
||||
# -- James Joyce, Ulysses
|
||||
|
||||
# "Countess Markievicz ... claimed that the [1916] abolition of Dublin Mean Time
|
||||
# was among various actions undertaken by the 'English' government that
|
||||
# would 'put the whole country into the SF (Sinn Féin) camp'. She claimed
|
||||
# Irish 'public feeling (was) outraged by forcing of English time on us'."
|
||||
# -- Parsons M. Dublin lost its time zone - and 25 minutes - after 1916 Rising.
|
||||
# Irish Times 2014-10-27.
|
||||
# http://www.irishtimes.com/news/politics/dublin-lost-its-time-zone-and-25-minutes-after-1916-rising-1.1977411
|
||||
|
||||
# From Joseph S. Myers (2005-01-26):
|
||||
# Irish laws are available online at <http://www.irishstatutebook.ie>.
|
||||
# These include various relating to legal time, for example:
|
||||
@ -617,6 +628,7 @@ Rule Russia 1992 only - Sep lastSat 23:00 0 -
|
||||
Rule Russia 1993 2010 - Mar lastSun 2:00s 1:00 S
|
||||
Rule Russia 1993 1995 - Sep lastSun 2:00s 0 -
|
||||
Rule Russia 1996 2010 - Oct lastSun 2:00s 0 -
|
||||
# As described below, Russia's 2014 change affects Zone data, not Rule data.
|
||||
|
||||
# From Alexander Krivenyshev (2011-06-14):
|
||||
# According to Kremlin press service, Russian President Dmitry Medvedev
|
||||
|
@ -33,8 +33,8 @@
|
||||
# The NTP Timescale and Leap Seconds
|
||||
# http://www.eecis.udel.edu/~mills/leap.html
|
||||
|
||||
# The International Earth Rotation Service periodically uses leap seconds
|
||||
# to keep UTC to within 0.9 s of UT1
|
||||
# The International Earth Rotation and Reference Systems Service
|
||||
# periodically uses leap seconds to keep UTC to within 0.9 s of UT1
|
||||
# (which measures the true angular orientation of the earth in space); see
|
||||
# Terry J Quinn, The BIPM and the accurate measure of time,
|
||||
# Proc IEEE 79, 7 (July 1991), 894-905 <http://dx.doi.org/10.1109/5.84965>.
|
||||
|
@ -1014,19 +1014,19 @@ Zone America/Menominee -5:50:27 - LMT 1885 Sep 18 12:00
|
||||
################################################################################
|
||||
|
||||
|
||||
# From Paul Eggert (2006-03-22):
|
||||
# A good source for time zone historical data outside the U.S. is
|
||||
# From Paul Eggert (2014-10-31):
|
||||
#
|
||||
# Unless otherwise specified, the source for data through 1990 is:
|
||||
# Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
|
||||
# San Diego: ACS Publications, Inc. (2003).
|
||||
# Unfortunately this book contains many errors and cites no sources.
|
||||
#
|
||||
# Gwillim Law writes that a good source
|
||||
# for recent time zone data is the International Air Transport
|
||||
# Association's Standard Schedules Information Manual (IATA SSIM),
|
||||
# published semiannually. Law sent in several helpful summaries
|
||||
# of the IATA's data after 1990.
|
||||
#
|
||||
# Except where otherwise noted, Shanks & Pottenger is the source for
|
||||
# entries through 1990, and IATA SSIM is the source for entries afterwards.
|
||||
# of the IATA's data after 1990. Except where otherwise noted,
|
||||
# IATA SSIM is the source for entries after 1990.
|
||||
#
|
||||
# Other sources occasionally used include:
|
||||
#
|
||||
@ -3154,13 +3154,17 @@ Zone America/Miquelon -3:44:40 - LMT 1911 May 15 # St Pierre
|
||||
# From Paul Eggert (2014-08-19):
|
||||
# The 2014-08-13 Cabinet meeting decided to stay on UTC-4 year-round. See:
|
||||
# http://tcweeklynews.com/daylight-savings-time-to-be-maintained-p5353-127.htm
|
||||
# Model this as a switch from EST/EDT to AST on 2014-11-02 at 02:00.
|
||||
# Model this as a switch from EST/EDT to AST ...
|
||||
# From Chris Walton (2014-11-04):
|
||||
# ... the TCI government appears to have delayed the switch to
|
||||
# "permanent daylight saving time" by one year....
|
||||
# http://tcweeklynews.com/time-change-to-go-ahead-this-november-p5437-127.htm
|
||||
#
|
||||
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
|
||||
Zone America/Grand_Turk -4:44:32 - LMT 1890
|
||||
-5:07:11 - KMT 1912 Feb # Kingston Mean Time
|
||||
-5:00 - EST 1979
|
||||
-5:00 US E%sT 2014 Nov 2 2:00
|
||||
-5:00 US E%sT 2015 Nov Sun>=1 2:00
|
||||
-4:00 - AST
|
||||
|
||||
# British Virgin Is
|
||||
|
@ -29,23 +29,23 @@
|
||||
# tz@iana.org for general use in the future). For more, please see
|
||||
# the file CONTRIBUTING in the tz distribution.
|
||||
|
||||
# From Paul Eggert (2006-03-22):
|
||||
# A good source for time zone historical data outside the U.S. is
|
||||
# From Paul Eggert (2014-10-31):
|
||||
#
|
||||
# Unless otherwise specified, the source for data through 1990 is:
|
||||
# Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
|
||||
# San Diego: ACS Publications, Inc. (2003).
|
||||
#
|
||||
# For data circa 1899, a common source is:
|
||||
# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94.
|
||||
# http://www.jstor.org/stable/1774359
|
||||
# Unfortunately this book contains many errors and cites no sources.
|
||||
#
|
||||
# Gwillim Law writes that a good source
|
||||
# for recent time zone data is the International Air Transport
|
||||
# Association's Standard Schedules Information Manual (IATA SSIM),
|
||||
# published semiannually. Law sent in several helpful summaries
|
||||
# of the IATA's data after 1990.
|
||||
# of the IATA's data after 1990. Except where otherwise noted,
|
||||
# IATA SSIM is the source for entries after 1990.
|
||||
#
|
||||
# Except where otherwise noted, Shanks & Pottenger is the source for
|
||||
# entries through 1990, and IATA SSIM is the source for entries afterwards.
|
||||
# For data circa 1899, a common source is:
|
||||
# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94.
|
||||
# http://www.jstor.org/stable/1774359
|
||||
#
|
||||
# Earlier editions of these tables used the North American style (e.g. ARST and
|
||||
# ARDT for Argentine Standard and Daylight Time), but the following quote
|
||||
|
@ -29,9 +29,9 @@ GENSRC_AWT_ICONS_TMP := $(SUPPORT_OUTPUTDIR)/gensrc/java.desktop
|
||||
GENSRC_AWT_ICONS_DST := $(GENSRC_AWT_ICONS_TMP)/sun/awt/
|
||||
|
||||
ifdef OPENJDK
|
||||
X11_ICONS_PATH_PREFIX := $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)
|
||||
X11_ICONS_PATH_PREFIX := $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)
|
||||
else
|
||||
X11_ICONS_PATH_PREFIX := $(JDK_TOPDIR)/src/closed/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)
|
||||
X11_ICONS_PATH_PREFIX := $(JDK_TOPDIR)/src/closed/java.desktop/$(OPENJDK_TARGET_OS_TYPE)
|
||||
endif
|
||||
|
||||
GENSRC_AWT_ICONS_SRC += \
|
||||
|
@ -58,13 +58,15 @@ define SetupCompileProperties
|
||||
$1_CLASS := $3
|
||||
|
||||
# Convert .../src/<module>/share/classes/com/sun/tools/javac/resources/javac_zh_CN.properties
|
||||
# to .../langtools/gensrc/<module>/com/sun/tools/javac/resources/javac_zh_CN.java
|
||||
# to .../support/gensrc/<module>/com/sun/tools/javac/resources/javac_zh_CN.java
|
||||
# Strip away prefix and suffix, leaving for example only:
|
||||
# "<module>/share/classes/com/sun/tools/javac/resources/javac_zh_CN"
|
||||
$1_JAVAS := $$(patsubst $(JDK_TOPDIR)/src/%, \
|
||||
$(SUPPORT_OUTPUTDIR)/gensrc/%, \
|
||||
$$(patsubst %.properties, %.java, \
|
||||
$$(subst /share/classes,, $$($1_SRCS))))
|
||||
$$(subst /$(OPENJDK_TARGET_OS)/classes,, \
|
||||
$$(subst /$(OPENJDK_TARGET_OS_TYPE)/classes,, \
|
||||
$$(subst /share/classes,, $$($1_SRCS))))))
|
||||
|
||||
# Generate the package dirs for the to be generated java files. Sort to remove
|
||||
# duplicates.
|
||||
|
@ -95,8 +95,8 @@ ifneq ($(COMPILE_TYPE), cross)
|
||||
-I$(JDK_TOPDIR)/src/java.base/share/native/include \
|
||||
-I$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_EXPORT_DIR)/native/include \
|
||||
-I$(JDK_TOPDIR)/src/java.base/share/native/libjava \
|
||||
-I$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_API_DIR)/native/libjava \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/common/awt \
|
||||
-I$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjava \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/share/native/common/awt/debug \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/awt/image/cvutils \
|
||||
#
|
||||
|
@ -42,7 +42,7 @@ UNPACKEXE_SRC := $(JDK_TOPDIR)/src/jdk.runtime/share/native/common-unpack \
|
||||
$(JDK_TOPDIR)/src/jdk.runtime/share/native/unpack200
|
||||
UNPACKEXE_CFLAGS := -I$(JDK_TOPDIR)/src/jdk.runtime/share/native/common-unpack \
|
||||
-I$(JDK_TOPDIR)/src/java.base/share/native/libjava \
|
||||
-I$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_API_DIR)/native/libjava
|
||||
-I$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjava
|
||||
|
||||
ifeq ($(USE_EXTERNAL_LIBZ), true)
|
||||
UNPACKEXE_CFLAGS += -DSYSTEM_ZLIB
|
||||
@ -77,7 +77,7 @@ ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||
EXE_OUT_OPTION := -Fe
|
||||
# With the current way unpack200 is built, debug symbols aren't supported
|
||||
# anyway.
|
||||
UNPACKEXE_DEBUG_SYMBOLS :=
|
||||
UNPACKEXE_DEBUG_SYMBOLS := false
|
||||
endif
|
||||
|
||||
# The linker on older SuSE distros (e.g. on SLES 10) complains with:
|
||||
@ -102,7 +102,7 @@ $(eval $(call SetupNativeCompilation,BUILD_UNPACKEXE, \
|
||||
MAPFILE := $(UNPACK_MAPFILE),\
|
||||
LDFLAGS := $(UNPACKEXE_ZIPOBJS), \
|
||||
LDFLAGS_windows := $(CXXFLAGS_JDKEXE), \
|
||||
LDFLAGS_posix := $(LDFLAGS_JDKEXE) $(LDFLAGS_CXX_JDK) \
|
||||
LDFLAGS_unix := $(LDFLAGS_JDKEXE) $(LDFLAGS_CXX_JDK) \
|
||||
$(call SET_SHARED_LIBRARY_NAME,$(LIBRARY_PREFIX)unpack$(SHARED_LIBRARY_SUFFIX)) \
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
||||
LDFLAGS_linux := -lc, \
|
||||
|
@ -58,7 +58,7 @@ endif
|
||||
LAUNCHER_SRC := $(JDK_TOPDIR)/src/java.base/share/native/launcher
|
||||
LAUNCHER_CFLAGS := -I$(JDK_TOPDIR)/src/java.base/share/native/launcher \
|
||||
-I$(JDK_TOPDIR)/src/java.base/share/native/libjli \
|
||||
-I$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_API_DIR)/native/libjli \
|
||||
-I$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjli \
|
||||
-I$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS)/native/libjli \
|
||||
#
|
||||
GLOBAL_VERSION_INFO_RESOURCE := $(JDK_TOPDIR)/src/java.base/windows/native/common/version.rc
|
||||
@ -67,10 +67,10 @@ MACOSX_PLIST_DIR := $(JDK_TOPDIR)/src/java.base/macosx/native/launcher
|
||||
# Until the shuffle is permanent, we can't add this in configure
|
||||
CFLAGS_JDKEXE := $(filter-out %javavm/export, $(CFLAGS_JDKEXE))
|
||||
CFLAGS_JDKEXE += -I$(JDK_TOPDIR)/src/java.base/share/native/include \
|
||||
-I$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_API_DIR)/native/include
|
||||
-I$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/include
|
||||
CXXFLAGS_JDKEXE := $(filter-out %javavm/export, $(CXXFLAGS_JDKEXE))
|
||||
CXXFLAGS_JDKEXE += -I$(JDK_TOPDIR)/src/java.base/share/native/include \
|
||||
-I$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_API_DIR)/native/include
|
||||
-I$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/include
|
||||
JAVA_MANIFEST := $(JDK_TOPDIR)/src/java.base/windows/native/launcher/java.manifest
|
||||
|
||||
define SetupLauncher
|
||||
@ -78,7 +78,7 @@ define SetupLauncher
|
||||
# Parameter 1 is the name of the launcher (java, javac, jar...)
|
||||
# Parameter 2 is extra CFLAGS
|
||||
# Parameter 3 is extra LDFLAGS
|
||||
# Parameter 4 is extra LDFLAGS_SUFFIX_posix
|
||||
# Parameter 4 is extra LDFLAGS_SUFFIX_unix
|
||||
# Parameter 5 is extra LDFLAGS_SUFFIX_windows
|
||||
# Parameter 6 is optional Windows JLI library (full path)
|
||||
# Parameter 7 is optional Windows resource (RC) flags
|
||||
@ -183,7 +183,7 @@ define SetupLauncher
|
||||
$(call SET_SHARED_LIBRARY_NAME,$(LIBRARY_PREFIX)$(SHARED_LIBRARY_SUFFIX)), \
|
||||
MAPFILE := $$($1_MAPFILE), \
|
||||
LDFLAGS_SUFFIX := $(LDFLAGS_JDKEXE_SUFFIX) $$($1_LDFLAGS_SUFFIX), \
|
||||
LDFLAGS_SUFFIX_posix := $4, \
|
||||
LDFLAGS_SUFFIX_unix := $4, \
|
||||
LDFLAGS_SUFFIX_windows := $$($1_WINDOWS_JLI_LIB) \
|
||||
$(SUPPORT_OUTPUTDIR)/native/java.base/libjava/java.lib advapi32.lib $5, \
|
||||
LDFLAGS_SUFFIX_linux := -L$(SUPPORT_OUTPUTDIR)/modules_libs/java.base$(OPENJDK_TARGET_CPU_LIBDIR)/jli -ljli $(LIBDL) -lc, \
|
||||
@ -227,4 +227,3 @@ ifdef OPENJDK
|
||||
else
|
||||
JAVA_RC_FLAGS += -i "$(JDK_TOPDIR)/src/closed/java.base/windows/native/launcher/icons"
|
||||
endif
|
||||
|
||||
|
@ -31,7 +31,7 @@ BUILD_LIBMLIB_SRC := $(JDK_TOPDIR)/src/java.desktop/share/native/libmlib_image \
|
||||
$(JDK_TOPDIR)/src/java.desktop/share/native/common/awt/medialib
|
||||
BUILD_LIBMLIB_CFLAGS := -D__USE_J2D_NAMES -D__MEDIALIB_OLD_NAMES \
|
||||
$(addprefix -I, $(BUILD_LIBMLIB_SRC)) \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/libmlib_image
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libmlib_image
|
||||
|
||||
BUILD_LIBMLIB_LDLIBS :=
|
||||
BUILD_LIBMLIB_IMAGE_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libmlib_image/mapfile-vers
|
||||
@ -144,9 +144,9 @@ endif
|
||||
################################################################################
|
||||
|
||||
LIBAWT_DIRS := $(JDK_TOPDIR)/src/java.desktop/share/native/libawt \
|
||||
$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/libawt \
|
||||
$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libawt \
|
||||
$(JDK_TOPDIR)/src/java.desktop/share/native/common/awt/debug \
|
||||
$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/common/awt \
|
||||
$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt \
|
||||
#
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_OS), aix)
|
||||
@ -211,7 +211,7 @@ ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||
# Why does libawt need java.base headers?
|
||||
LIBAWT_CFLAGS += -I$(JDK_TOPDIR)/src/java.desktop/share/native/common/font \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/share/native/common/java2d/opengl \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/common/java2d/opengl \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/java2d/opengl \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/windows/native/include \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/share/native/include \
|
||||
-I$(SUPPORT_OUTPUTDIR)/headers/java.base \
|
||||
@ -299,15 +299,15 @@ ifeq ($(findstring $(OPENJDK_TARGET_OS),windows macosx),)
|
||||
ifndef BUILD_HEADLESS_ONLY
|
||||
|
||||
LIBAWT_XAWT_DIRS := \
|
||||
$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/libawt_xawt \
|
||||
$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/libjawt \
|
||||
$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libawt_xawt \
|
||||
$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libjawt \
|
||||
$(JDK_TOPDIR)/src/java.desktop/share/native/common/awt/debug \
|
||||
$(JDK_TOPDIR)/src/java.desktop/share/native/common/awt/utility \
|
||||
$(JDK_TOPDIR)/src/java.desktop/share/native/common/font \
|
||||
$(JDK_TOPDIR)/src/java.desktop/share/native/common/java2d/opengl \
|
||||
$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/common/java2d/opengl \
|
||||
$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/common/java2d/x11 \
|
||||
$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/common/awt \
|
||||
$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/java2d/opengl \
|
||||
$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/java2d/x11 \
|
||||
$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt \
|
||||
#
|
||||
|
||||
LIBAWT_XAWT_EXCLUDES := medialib
|
||||
@ -316,15 +316,15 @@ ifeq ($(findstring $(OPENJDK_TARGET_OS),windows macosx),)
|
||||
-I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/share/native/include \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS)/native/include \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/include \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/include \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/java2d \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/libawt/java2d \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libawt/java2d \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/java2d/loops \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/java2d/pipe \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/awt/image/cvutils \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/awt/image \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/libsunwjdga \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/common/font \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libsunwjdga \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/font \
|
||||
$(LIBJAVA_HEADER_FLAGS)
|
||||
#
|
||||
|
||||
@ -421,7 +421,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBLCMS, \
|
||||
MAPFILE := $(JDK_TOPDIR)/make/mapfiles/liblcms/mapfile-vers, \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
||||
LDFLAGS_posix := -L $(INSTALL_LIBRARIES_HERE), \
|
||||
LDFLAGS_unix := -L $(INSTALL_LIBRARIES_HERE), \
|
||||
LDFLAGS_solaris := /usr/lib$(OPENJDK_TARGET_CPU_ISADIR)/libm.so.2, \
|
||||
LDFLAGS_windows := $(WIN_AWT_LIB) $(WIN_JAVA_LIB), \
|
||||
LDFLAGS_SUFFIX_solaris := -lawt -ljava -ljvm -lc $(LCMS_LIBS), \
|
||||
@ -517,14 +517,14 @@ TARGETS += $(BUILD_LIBJAVAJPEG)
|
||||
################################################################################
|
||||
|
||||
LIBFONTMANAGER_SRC := $(JDK_TOPDIR)/src/java.desktop/share/native/libfontmanager \
|
||||
$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/libfontmanager
|
||||
$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libfontmanager
|
||||
LIBFONTMANAGER_CFLAGS := \
|
||||
$(addprefix -I, $(shell $(FIND) \
|
||||
$(LIBFONTMANAGER_SRC) \
|
||||
$(JDK_TOPDIR)/src/java.desktop/share/native/libawt \
|
||||
$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/libawt \
|
||||
$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libawt \
|
||||
$(JDK_TOPDIR)/src/java.desktop/share/native/common \
|
||||
$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/common -type d)) \
|
||||
$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common -type d)) \
|
||||
-I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
|
||||
$(LIBJAVA_HEADER_FLAGS) \
|
||||
#
|
||||
@ -545,7 +545,7 @@ ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||
LIBFONTMANAGER_EXCLUDE_FILES += X11FontScaler.c \
|
||||
X11TextRenderer.c
|
||||
LIBFONTMANAGER_OPTIMIZATION := HIGHEST
|
||||
LIBFONTMANAGER_CFLAGS += -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/libawt/windows
|
||||
LIBFONTMANAGER_CFLAGS += -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libawt/windows
|
||||
else ifeq ($(OPENJDK_TARGET_OS), macosx)
|
||||
LIBFONTMANAGER_EXCLUDE_FILES += X11FontScaler.c \
|
||||
X11TextRenderer.c \
|
||||
@ -581,7 +581,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBFONTMANAGER, \
|
||||
MAPFILE := $(BUILD_LIBFONTMANAGER_MAPFILE), \
|
||||
LDFLAGS := $(subst -Xlinker -z -Xlinker defs,,$(LDFLAGS_JDKLIB)) $(LDFLAGS_CXX_JDK) \
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
||||
LDFLAGS_posix := -L $(INSTALL_LIBRARIES_HERE), \
|
||||
LDFLAGS_unix := -L $(INSTALL_LIBRARIES_HERE), \
|
||||
LDFLAGS_SUFFIX := $(BUILD_LIBFONTMANAGER_FONTLIB), \
|
||||
LDFLAGS_SUFFIX_linux := -lawt $(LIBM) $(LIBCXX) -ljava -ljvm -lc, \
|
||||
LDFLAGS_SUFFIX_solaris := $(filter-out -R%, $(X_LIBS)) \
|
||||
@ -610,12 +610,12 @@ TARGETS += $(BUILD_LIBFONTMANAGER)
|
||||
################################################################################
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||
LIBJAWT_SRC := $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/libjawt
|
||||
LIBJAWT_CFLAGS := -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/libawt/windows \
|
||||
LIBJAWT_SRC := $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libjawt
|
||||
LIBJAWT_CFLAGS := -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libawt/windows \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/share/native/common/awt/debug \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/java2d \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/awt/image/cvutils \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/libawt/java2d/windows \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libawt/java2d/windows \
|
||||
-I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/windows/native/include \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/share/native/include \
|
||||
@ -659,12 +659,12 @@ else # OPENJDK_TARGET_OS not windows
|
||||
ifeq ($(OPENJDK_TARGET_OS), macosx)
|
||||
LIBJAWT_SRC := $(JDK_TOPDIR)/src/java.desktop/macosx/native/libjawt
|
||||
else
|
||||
LIBJAWT_SRC := $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/libjawt
|
||||
LIBJAWT_SRC := $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libjawt
|
||||
endif
|
||||
LIBJAWT_CFLAGS := \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/common/awt \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS)/native/include \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/include \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/include \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/share/native/include \
|
||||
$(LIBJAVA_HEADER_FLAGS) \
|
||||
#
|
||||
@ -698,7 +698,7 @@ else # OPENJDK_TARGET_OS not windows
|
||||
MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjawt/mapfile-vers, \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
||||
LDFLAGS_posix := -L $(INSTALL_LIBRARIES_HERE), \
|
||||
LDFLAGS_unix := -L $(INSTALL_LIBRARIES_HERE), \
|
||||
LDFLAGS_solaris := $(X_LIBS), \
|
||||
LDFLAGS_SUFFIX_linux := $(JAWT_LIBS) $(LDFLAGS_JDKLIB_SUFFIX), \
|
||||
LDFLAGS_SUFFIX_aix := $(JAWT_LIBS) $(LDFLAGS_JDKLIB_SUFFIX),\
|
||||
@ -729,9 +729,9 @@ ifeq ($(BUILD_HEADLESS), true)
|
||||
ifeq ($(findstring $(OPENJDK_TARGET_OS), windows macosx),)
|
||||
|
||||
LIBAWT_HEADLESS_DIRS := $(JDK_TOPDIR)/src/java.desktop/unix/native/libawt_headless/awt \
|
||||
$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/common/awt \
|
||||
$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/common/java2d/opengl \
|
||||
$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/common/java2d/x11 \
|
||||
$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt \
|
||||
$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/java2d/opengl \
|
||||
$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/java2d/x11 \
|
||||
$(JDK_TOPDIR)/src/java.desktop/share/native/common/java2d/opengl \
|
||||
$(JDK_TOPDIR)/src/java.desktop/share/native/common/font \
|
||||
#
|
||||
@ -744,11 +744,11 @@ ifeq ($(BUILD_HEADLESS), true)
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/awt/image/cvutils \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/java2d/pipe \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/awt/image \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/libawt/java2d \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libawt/java2d \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/share/native/common/font \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/share/native/common/awt/debug \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/common/font \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/libsunwjdga/ \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/font \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libsunwjdga/ \
|
||||
$(LIBJAVA_HEADER_FLAGS) \
|
||||
#
|
||||
|
||||
@ -775,7 +775,7 @@ ifeq ($(BUILD_HEADLESS), true)
|
||||
MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libawt_headless/mapfile-vers, \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
||||
LDFLAGS_posix := -L $(INSTALL_LIBRARIES_HERE), \
|
||||
LDFLAGS_unix := -L $(INSTALL_LIBRARIES_HERE), \
|
||||
LDFLAGS_linux := $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
|
||||
LDFLAGS_solaris := $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
|
||||
LDFLAGS_macosx := $(call SET_SHARED_LIBRARY_ORIGIN)., \
|
||||
@ -823,7 +823,7 @@ ifndef BUILD_HEADLESS_ONLY
|
||||
endif
|
||||
|
||||
ifneq ($(OPENJDK_TARGET_OS), macosx)
|
||||
LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/libsplashscreen
|
||||
LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libsplashscreen
|
||||
else
|
||||
LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/java.desktop/macosx/native/libsplashscreen
|
||||
endif
|
||||
@ -997,7 +997,7 @@ ifeq ($(OPENJDK_TARGET_OS), macosx)
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/macosx/native/libawt_lwawt/awt \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/macosx/native/libosxapp \
|
||||
-I$(JDK_TOPDIR)/src/java.base/share/native/libjava \
|
||||
-I$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_API_DIR)/native/libjava \
|
||||
-I$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjava \
|
||||
-I$(SUPPORT_OUTPUTDIR)/headers/java.desktop, \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN) \
|
||||
|
@ -99,7 +99,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBVERIFY, \
|
||||
MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libverify/mapfile-vers, \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
||||
LDFLAGS_SUFFIX_posix := -ljvm -lc, \
|
||||
LDFLAGS_SUFFIX_unix := -ljvm -lc, \
|
||||
LDFLAGS_SUFFIX_windows := jvm.lib, \
|
||||
VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
|
||||
RC_FLAGS := $(RC_FLAGS) \
|
||||
@ -160,7 +160,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBJAVA, \
|
||||
MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjava/mapfile-vers, \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
||||
LDFLAGS_SUFFIX_posix := -ljvm -lverify, \
|
||||
LDFLAGS_SUFFIX_unix := -ljvm -lverify, \
|
||||
LDFLAGS_SUFFIX_solaris := -lsocket -lnsl -lscf $(LIBDL) $(BUILD_LIBFDLIBM) -lc, \
|
||||
LDFLAGS_SUFFIX_linux := $(LIBDL) $(BUILD_LIBFDLIBM), \
|
||||
LDFLAGS_SUFFIX_aix := $(LIBDL) $(BUILD_LIBFDLIBM) -lm,\
|
||||
@ -216,9 +216,9 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBZIP, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) \
|
||||
$(ZLIB_CPPFLAGS) \
|
||||
-I$(JDK_TOPDIR)/src/java.base/share/native/libjava \
|
||||
-I$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_API_DIR)/native/libjava \
|
||||
-I$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjava \
|
||||
-I$(SUPPORT_OUTPUTDIR)/headers/java.base, \
|
||||
CFLAGS_posix := $(BUILD_LIBZIP_MMAP) -UDEBUG, \
|
||||
CFLAGS_unix := $(BUILD_LIBZIP_MMAP) -UDEBUG, \
|
||||
MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libzip/mapfile-vers, \
|
||||
REORDER := $(BUILD_LIBZIP_REORDER), \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
||||
@ -248,7 +248,7 @@ TARGETS += $(BUILD_LIBZIP)
|
||||
##########################################################################################
|
||||
|
||||
BUILD_LIBJLI_SRC_DIRS := $(JDK_TOPDIR)/src/java.base/share/native/libjli \
|
||||
$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_API_DIR)/native/libjli
|
||||
$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjli
|
||||
|
||||
LIBJLI_CFLAGS := $(CFLAGS_JDKLIB)
|
||||
|
||||
@ -292,7 +292,7 @@ else ifneq ($(OPENJDK_TARGET_OS), macosx)
|
||||
|
||||
# if the architecture specific ergo file exists then
|
||||
# use it, else use the generic definitions from ergo.c
|
||||
ifneq ($(wildcard $(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_API_DIR)/native/libjli/$(ERGO_ARCH_FILE)), )
|
||||
ifneq ($(wildcard $(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjli/$(ERGO_ARCH_FILE)), )
|
||||
BUILD_LIBJLI_FILES += $(ERGO_ARCH_FILE)
|
||||
else # !ERGO_ARCH_FILE
|
||||
LIBJLI_CFLAGS += -DUSE_GENERIC_ERGO
|
||||
|
@ -28,7 +28,7 @@ include LibCommon.gmk
|
||||
################################################################################
|
||||
|
||||
LIBINSTRUMENT_SRC := $(JDK_TOPDIR)/src/java.instrument/share/native/libinstrument \
|
||||
$(JDK_TOPDIR)/src/java.instrument/$(OPENJDK_TARGET_OS_API_DIR)/native/libinstrument \
|
||||
$(JDK_TOPDIR)/src/java.instrument/$(OPENJDK_TARGET_OS_TYPE)/native/libinstrument \
|
||||
#
|
||||
LIBINSTRUMENT_CFLAGS := $(CFLAGS_JDKLIB) \
|
||||
$(addprefix -I, $(LIBINSTRUMENT_SRC)) \
|
||||
|
@ -31,7 +31,7 @@ $(eval $(call IncludeCustomExtension, jdk, lib/Lib-java.management.gmk))
|
||||
################################################################################
|
||||
|
||||
BUILD_LIBMANAGEMENT_SRC += $(JDK_TOPDIR)/src/java.management/share/native/libmanagement \
|
||||
$(JDK_TOPDIR)/src/java.management/$(OPENJDK_TARGET_OS_API_DIR)/native/libmanagement
|
||||
$(JDK_TOPDIR)/src/java.management/$(OPENJDK_TARGET_OS_TYPE)/native/libmanagement
|
||||
BUILD_LIBMANAGEMENT_CFLAGS := -I$(JDK_TOPDIR)/src/java.management/share/native/include \
|
||||
$(addprefix -I,$(BUILD_LIBMANAGEMENT_SRC)) \
|
||||
-I$(SUPPORT_OUTPUTDIR)/headers/java.management \
|
||||
|
@ -30,7 +30,7 @@ include LibCommon.gmk
|
||||
ifeq ($(OPENJDK_TARGET_OS), macosx)
|
||||
LIBPREF_SRC_DIRS := $(JDK_TOPDIR)/src/java.prefs/macosx/native/libprefs
|
||||
else
|
||||
LIBPREF_SRC_DIRS := $(JDK_TOPDIR)/src/java.prefs/$(OPENJDK_TARGET_OS_API_DIR)/native/libprefs
|
||||
LIBPREF_SRC_DIRS := $(JDK_TOPDIR)/src/java.prefs/$(OPENJDK_TARGET_OS_TYPE)/native/libprefs
|
||||
endif
|
||||
|
||||
$(eval $(call SetupNativeCompilation,BUILD_LIBPREFS, \
|
||||
|
@ -29,7 +29,7 @@ include LibCommon.gmk
|
||||
|
||||
ifneq ($(OPENJDK_TARGET_OS), windows)
|
||||
LIBJ2GSS_SRC := $(JDK_TOPDIR)/src/java.security.jgss/share/native/libj2gss \
|
||||
$(JDK_TOPDIR)/src/java.security.jgss/$(OPENJDK_TARGET_OS_API_DIR)/native/libj2gss \
|
||||
$(JDK_TOPDIR)/src/java.security.jgss/$(OPENJDK_TARGET_OS_TYPE)/native/libj2gss \
|
||||
#
|
||||
|
||||
$(eval $(call SetupNativeCompilation,BUILD_LIBJ2GSS, \
|
||||
@ -58,7 +58,7 @@ ifneq ($(BUILD_CRYPTO), no)
|
||||
BUILD_LIBKRB5_NAME :=
|
||||
ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||
BUILD_LIBKRB5_NAME := w2k_lsa_auth
|
||||
BUILD_LIBKRB5_SRC := $(JDK_TOPDIR)/src/java.security.jgss/$(OPENJDK_TARGET_OS_API_DIR)/native/libw2k_lsa_auth
|
||||
BUILD_LIBKRB5_SRC := $(JDK_TOPDIR)/src/java.security.jgss/$(OPENJDK_TARGET_OS_TYPE)/native/libw2k_lsa_auth
|
||||
BUILD_LIBKRB5_LIBS := advapi32.lib Secur32.lib netapi32.lib kernel32.lib user32.lib \
|
||||
gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib \
|
||||
ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib
|
||||
|
@ -28,9 +28,9 @@ include LibCommon.gmk
|
||||
################################################################################
|
||||
|
||||
LIBJ2PCSC_SRC := $(JDK_TOPDIR)/src/java.smartcardio/share/native/libj2pcsc \
|
||||
$(JDK_TOPDIR)/src/java.smartcardio/$(OPENJDK_TARGET_OS_API_DIR)/native/libj2pcsc
|
||||
$(JDK_TOPDIR)/src/java.smartcardio/$(OPENJDK_TARGET_OS_TYPE)/native/libj2pcsc
|
||||
LIBJ2PCSC_CPPFLAGS := $(addprefix -I,$(LIBJ2PCSC_SRC)) \
|
||||
-I$(JDK_TOPDIR)/src/java.smartcardio/$(OPENJDK_TARGET_OS_API_DIR)/native/libj2pcsc/MUSCLE \
|
||||
-I$(JDK_TOPDIR)/src/java.smartcardio/$(OPENJDK_TARGET_OS_TYPE)/native/libj2pcsc/MUSCLE \
|
||||
-I$(SUPPORT_OUTPUTDIR)/headers/java.smartcardio
|
||||
|
||||
$(eval $(call SetupNativeCompilation,BUILD_LIBJ2PCSC, \
|
||||
@ -38,13 +38,13 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBJ2PCSC, \
|
||||
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
|
||||
SRC := $(LIBJ2PCSC_SRC), \
|
||||
LANG := C, \
|
||||
CFLAGS_posix := -D__sun_jdk, \
|
||||
CFLAGS_unix := -D__sun_jdk, \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) $(LIBJ2PCSC_CPPFLAGS), \
|
||||
MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libj2pcsc/mapfile-vers, \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
||||
LDFLAGS_SUFFIX_posix := $(LIBDL), \
|
||||
LDFLAGS_SUFFIX_unix := $(LIBDL), \
|
||||
LDFLAGS_SUFFIX_windows := winscard.lib, \
|
||||
LDFLAGS_SUFFIX_solaris := -lc, \
|
||||
VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
|
||||
|
@ -29,7 +29,7 @@ include LibCommon.gmk
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||
|
||||
LIBSUNMSCAPI_SRC := $(JDK_TOPDIR)/src/jdk.crypto.mscapi/$(OPENJDK_TARGET_OS_API_DIR)/native/libsunmscapi
|
||||
LIBSUNMSCAPI_SRC := $(JDK_TOPDIR)/src/jdk.crypto.mscapi/$(OPENJDK_TARGET_OS_TYPE)/native/libsunmscapi
|
||||
|
||||
$(eval $(call SetupNativeCompilation,BUILD_LIBSUNMSCAPI, \
|
||||
LIBRARY := sunmscapi, \
|
||||
|
@ -28,7 +28,7 @@ include LibCommon.gmk
|
||||
################################################################################
|
||||
|
||||
LIBJ2PKCS11_SRC := $(JDK_TOPDIR)/src/jdk.crypto.pkcs11/share/native/libj2pkcs11 \
|
||||
$(JDK_TOPDIR)/src/jdk.crypto.pkcs11/$(OPENJDK_TARGET_OS_API_DIR)/native/libj2pkcs11
|
||||
$(JDK_TOPDIR)/src/jdk.crypto.pkcs11/$(OPENJDK_TARGET_OS_TYPE)/native/libj2pkcs11
|
||||
|
||||
$(eval $(call SetupNativeCompilation,BUILD_LIBJ2PKCS11, \
|
||||
LIBRARY := j2pkcs11, \
|
||||
@ -42,7 +42,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBJ2PKCS11, \
|
||||
MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libj2pkcs11/mapfile-vers, \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
||||
LDFLAGS_SUFFIX_posix := $(LIBDL), \
|
||||
LDFLAGS_SUFFIX_unix := $(LIBDL), \
|
||||
LDFLAGS_SUFFIX_solaris := -lc, \
|
||||
VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
|
||||
RC_FLAGS := $(RC_FLAGS) \
|
||||
|
@ -30,7 +30,7 @@ include LibCommon.gmk
|
||||
ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||
|
||||
LIBDT_SHMEM_SRC := $(JDK_TOPDIR)/src/jdk.jdi/share/native/libdt_shmem \
|
||||
$(JDK_TOPDIR)/src/jdk.jdi/$(OPENJDK_TARGET_OS_API_DIR)/native/libdt_shmem \
|
||||
$(JDK_TOPDIR)/src/jdk.jdi/$(OPENJDK_TARGET_OS_TYPE)/native/libdt_shmem \
|
||||
#
|
||||
LIBDT_SHMEM_CPPFLAGS := -I$(INCLUDEDIR) -I$(JDK_OUTPUTDIR)/include/$(OPENJDK_TARGET_OS) \
|
||||
$(addprefix -I, $(LIBDT_SHMEM_SRC)) \
|
||||
|
@ -28,7 +28,7 @@ include LibCommon.gmk
|
||||
################################################################################
|
||||
|
||||
LIBDT_SOCKET_SRC := $(JDK_TOPDIR)/src/jdk.jdwp.agent/share/native/libdt_socket \
|
||||
$(JDK_TOPDIR)/src/jdk.jdwp.agent/$(OPENJDK_TARGET_OS_API_DIR)/native/libdt_socket
|
||||
$(JDK_TOPDIR)/src/jdk.jdwp.agent/$(OPENJDK_TARGET_OS_TYPE)/native/libdt_socket
|
||||
LIBDT_SOCKET_CPPFLAGS := \
|
||||
$(addprefix -I, $(LIBDT_SOCKET_SRC)) \
|
||||
-I$(JDK_TOPDIR)/src/jdk.jdwp.agent/share/native/libjdwp/export \
|
||||
@ -66,7 +66,7 @@ TARGETS += $(BUILD_LIBDT_SOCKET)
|
||||
################################################################################
|
||||
|
||||
LIBJDWP_SRC := $(JDK_TOPDIR)/src/jdk.jdwp.agent/share/native/libjdwp \
|
||||
$(JDK_TOPDIR)/src/jdk.jdwp.agent/$(OPENJDK_TARGET_OS_API_DIR)/native/libjdwp
|
||||
$(JDK_TOPDIR)/src/jdk.jdwp.agent/$(OPENJDK_TARGET_OS_TYPE)/native/libjdwp
|
||||
LIBJDWP_CPPFLAGS := \
|
||||
-I$(JDK_TOPDIR)/src/jdk.jdwp.agent/share/native/libjdwp/export \
|
||||
-I$(JDK_TOPDIR)/src/jdk.jdwp.agent/share/native/include \
|
||||
|
@ -45,7 +45,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBUNPACK, \
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
||||
LDFLAGS_windows := -map:$(SUPPORT_OUTPUTDIR)/native/$(MODULE)/unpack.map -debug \
|
||||
jvm.lib $(WIN_JAVA_LIB), \
|
||||
LDFLAGS_SUFFIX_posix := -ljvm $(LIBCXX) -ljava -lc, \
|
||||
LDFLAGS_SUFFIX_unix := -ljvm $(LIBCXX) -ljava -lc, \
|
||||
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libunpack, \
|
||||
VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
|
||||
RC_FLAGS := $(RC_FLAGS) \
|
||||
@ -61,7 +61,7 @@ TARGETS += $(BUILD_LIBUNPACK)
|
||||
################################################################################
|
||||
|
||||
LIBJSDT_SRC := $(JDK_TOPDIR)/src/jdk.runtime/share/native/libjsdt \
|
||||
$(JDK_TOPDIR)/src/jdk.runtime/$(OPENJDK_TARGET_OS_API_DIR)/native/libjsdt
|
||||
$(JDK_TOPDIR)/src/jdk.runtime/$(OPENJDK_TARGET_OS_TYPE)/native/libjsdt
|
||||
|
||||
$(eval $(call SetupNativeCompilation,BUILD_LIBJSDT, \
|
||||
LIBRARY := jsdt, \
|
||||
|
@ -27,7 +27,7 @@ include LibCommon.gmk
|
||||
|
||||
################################################################################
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_OS_API), posix)
|
||||
ifeq ($(OPENJDK_TARGET_OS_TYPE), unix)
|
||||
|
||||
ifeq (, $(filter $(OPENJDK_TARGET_OS), macosx aix))
|
||||
|
||||
@ -40,11 +40,11 @@ ifeq ($(OPENJDK_TARGET_OS_API), posix)
|
||||
$(eval $(call SetupNativeCompilation,BUILD_LIBSCTP, \
|
||||
LIBRARY := sctp, \
|
||||
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
|
||||
SRC := $(JDK_TOPDIR)/src/jdk.sctp/$(OPENJDK_TARGET_OS_API_DIR)/native/libsctp, \
|
||||
SRC := $(JDK_TOPDIR)/src/jdk.sctp/$(OPENJDK_TARGET_OS_TYPE)/native/libsctp, \
|
||||
LANG := C, \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) \
|
||||
-I $(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_API_DIR)/native/libnio/ch \
|
||||
-I $(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libnio/ch \
|
||||
-I $(JDK_TOPDIR)/src/java.base/share/native/libnio/ch \
|
||||
$(addprefix -I, $(call FindSrcDirsForLib, java.base, net)) \
|
||||
$(LIBJAVA_HEADER_FLAGS) \
|
||||
@ -55,7 +55,7 @@ ifeq ($(OPENJDK_TARGET_OS_API), posix)
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
||||
LDFLAGS_SUFFIX_linux := -lpthread $(LIBDL) -ljava -ljvm, \
|
||||
LDFLAGS_SUFFIX_posix := -lnio -lnet, \
|
||||
LDFLAGS_SUFFIX_unix := -lnio -lnet, \
|
||||
LDFLAGS_SUFFIX_solaris := -lsocket -ljava -ljvm -lc, \
|
||||
LDFLAGS_SUFFIX_macosx := -ljava -ljvm, \
|
||||
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libsctp, \
|
||||
|
@ -43,7 +43,7 @@ endif
|
||||
$(eval $(call SetupNativeCompilation,BUILD_LIBJAAS, \
|
||||
LIBRARY := $(LIBJAAS_NAME), \
|
||||
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
|
||||
SRC := $(JDK_TOPDIR)/src/jdk.security.auth/$(OPENJDK_TARGET_OS_API_DIR)/native/libjaas, \
|
||||
SRC := $(JDK_TOPDIR)/src/jdk.security.auth/$(OPENJDK_TARGET_OS_TYPE)/native/libjaas, \
|
||||
LANG := C, \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) -I$(SUPPORT_OUTPUTDIR)/headers/jdk.security.auth, \
|
||||
|
@ -36,15 +36,17 @@ GLOBAL_VERSION_INFO_RESOURCE := $(JDK_TOPDIR)/src/java.base/windows/native/commo
|
||||
# elegant solution to this.
|
||||
WIN_JAVA_LIB := $(SUPPORT_OUTPUTDIR)/native/java.base/libjava/java.lib
|
||||
|
||||
# Use this variable to set DEBUG_SYMBOLS true on windows for all libraries, but
|
||||
# not on other platforms.
|
||||
ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||
DEBUG_ALL_BINARIES := true
|
||||
endif
|
||||
|
||||
# Build everything with debugging on OpenJDK
|
||||
ifdef OPENJDK
|
||||
# Build everything with debugging on OpenJDK
|
||||
DEBUG_ALL_BINARIES := true
|
||||
else
|
||||
# Use this variable to set DEBUG_SYMBOLS true on windows for all libraries, but
|
||||
# not on other platforms.
|
||||
ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||
DEBUG_ALL_BINARIES := true
|
||||
else
|
||||
DEBUG_ALL_BINARIES := false
|
||||
endif
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
@ -54,14 +56,14 @@ endif
|
||||
define FindSrcDirsForLib
|
||||
$(call uniq, $(wildcard \
|
||||
$(JDK_TOPDIR)/src/$(strip $1)/$(OPENJDK_TARGET_OS)/native/lib$(strip $2) \
|
||||
$(JDK_TOPDIR)/src/$(strip $1)/$(OPENJDK_TARGET_OS_API_DIR)/native/lib$(strip $2) \
|
||||
$(JDK_TOPDIR)/src/$(strip $1)/$(OPENJDK_TARGET_OS_TYPE)/native/lib$(strip $2) \
|
||||
$(JDK_TOPDIR)/src/$(strip $1)/share/native/lib$(strip $2)))
|
||||
endef
|
||||
|
||||
################################################################################
|
||||
# Find lib dir for module
|
||||
# Param 1 - module name
|
||||
ifeq ($(OPENJDK_TARGET_OS_API), posix)
|
||||
ifeq ($(OPENJDK_TARGET_OS_TYPE), unix)
|
||||
define FindLibDirForModule
|
||||
$(SUPPORT_OUTPUTDIR)/modules_libs/$(strip $1)$(OPENJDK_TARGET_CPU_LIBDIR)
|
||||
endef
|
||||
|
@ -24,7 +24,7 @@
|
||||
#
|
||||
|
||||
LIBNET_SRC_DIRS := $(JDK_TOPDIR)/src/java.base/share/native/libnet \
|
||||
$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_API_DIR)/native/libnet
|
||||
$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libnet
|
||||
LIBNET_CFLAGS += -I$(SUPPORT_OUTPUTDIR)/headers/java.base \
|
||||
$(LIBJAVA_HEADER_FLAGS)
|
||||
|
||||
@ -77,4 +77,3 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBNET, \
|
||||
$(BUILD_LIBNET): $(BUILD_LIBJAVA)
|
||||
|
||||
TARGETS += $(BUILD_LIBNET)
|
||||
|
||||
|
@ -25,10 +25,10 @@
|
||||
|
||||
BUILD_LIBNIO_SRC := \
|
||||
$(JDK_TOPDIR)/src/java.base/share/native/libnio/ch \
|
||||
$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_API_DIR)/native/libnio \
|
||||
$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libnio \
|
||||
$(sort $(wildcard \
|
||||
$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_API_DIR)/native/libnio/ch \
|
||||
$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_API_DIR)/native/libnio/fs \
|
||||
$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libnio/ch \
|
||||
$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libnio/fs \
|
||||
$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS)/native/libnio/ch \
|
||||
$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS)/native/libnio/fs)) \
|
||||
#
|
||||
|
@ -25,7 +25,7 @@
|
||||
|
||||
LIBJSOUND_SRC_DIRS := \
|
||||
$(JDK_TOPDIR)/src/java.desktop/share/native/libjsound \
|
||||
$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/libjsound \
|
||||
$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libjsound \
|
||||
#
|
||||
LIBJSOUND_CFLAGS := \
|
||||
-I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
|
||||
@ -165,7 +165,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBJSOUND, \
|
||||
-framework CoreServices -framework AudioUnit $(LIBCXX) \
|
||||
-framework CoreMIDI -framework AudioToolbox, \
|
||||
LDFLAGS_windows := $(WIN_JAVA_LIB) advapi32.lib winmm.lib, \
|
||||
LDFLAGS_SUFFIX_posix := -ljava -ljvm, \
|
||||
LDFLAGS_SUFFIX_unix := -ljava -ljvm, \
|
||||
LDFLAGS_SUFFIX_solaris := -lc, \
|
||||
VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
|
||||
RC_FLAGS := $(RC_FLAGS) \
|
||||
|
@ -95,7 +95,17 @@ class TzdbZoneRulesProvider {
|
||||
obj = zones.get(zoneId);
|
||||
}
|
||||
if (obj == null) {
|
||||
throw new ZoneRulesException("Unknown time-zone ID: " + zoneId0);
|
||||
// Timezone link can be located in 'backward' file and it
|
||||
// can refer to another link, so we need to check for
|
||||
// link one more time, before throwing an exception
|
||||
String zoneIdBack = zoneId;
|
||||
if (links.containsKey(zoneId)) {
|
||||
zoneId = links.get(zoneId);
|
||||
obj = zones.get(zoneId);
|
||||
}
|
||||
if (obj == null) {
|
||||
throw new ZoneRulesException("Unknown time-zone ID: " + zoneIdBack);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (obj instanceof ZoneRules) {
|
||||
|
@ -253,6 +253,7 @@ abstract class PBES2Parameters extends AlgorithmParametersSpi {
|
||||
this.cipherParam = ((PBEParameterSpec)paramSpec).getParameterSpec();
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
protected void engineInit(byte[] encoded)
|
||||
throws IOException
|
||||
{
|
||||
@ -290,6 +291,7 @@ abstract class PBES2Parameters extends AlgorithmParametersSpi {
|
||||
.append(kdfAlgo).append("And").append(cipherAlgo).toString();
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private String parseKDF(DerValue keyDerivationFunc) throws IOException {
|
||||
String kdfAlgo = null;
|
||||
|
||||
@ -351,6 +353,7 @@ abstract class PBES2Parameters extends AlgorithmParametersSpi {
|
||||
return kdfAlgo;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private String parseES(DerValue encryptionScheme) throws IOException {
|
||||
String cipherAlgo = null;
|
||||
|
||||
|
@ -243,6 +243,7 @@ public final class RSACipher extends CipherSpi {
|
||||
}
|
||||
|
||||
// initialize this cipher
|
||||
@SuppressWarnings("deprecation")
|
||||
private void init(int opmode, Key key, SecureRandom random,
|
||||
AlgorithmParameterSpec params)
|
||||
throws InvalidKeyException, InvalidAlgorithmParameterException {
|
||||
@ -424,6 +425,7 @@ public final class RSACipher extends CipherSpi {
|
||||
}
|
||||
|
||||
// see JCE spec
|
||||
@SuppressWarnings("deprecation")
|
||||
protected Key engineUnwrap(byte[] wrappedKey, String algorithm,
|
||||
int type) throws InvalidKeyException, NoSuchAlgorithmException {
|
||||
if (wrappedKey.length > buffer.length) {
|
||||
|
@ -46,6 +46,7 @@ public final class TlsKeyMaterialGenerator extends KeyGeneratorSpi {
|
||||
private final static String MSG = "TlsKeyMaterialGenerator must be "
|
||||
+ "initialized using a TlsKeyMaterialParameterSpec";
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private TlsKeyMaterialParameterSpec spec;
|
||||
|
||||
private int protocolVersion;
|
||||
@ -57,6 +58,7 @@ public final class TlsKeyMaterialGenerator extends KeyGeneratorSpi {
|
||||
throw new InvalidParameterException(MSG);
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
protected void engineInit(AlgorithmParameterSpec params,
|
||||
SecureRandom random) throws InvalidAlgorithmParameterException {
|
||||
if (params instanceof TlsKeyMaterialParameterSpec == false) {
|
||||
@ -91,6 +93,7 @@ public final class TlsKeyMaterialGenerator extends KeyGeneratorSpi {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private SecretKey engineGenerateKey0() throws GeneralSecurityException {
|
||||
byte[] masterSecret = spec.getMasterSecret().getEncoded();
|
||||
|
||||
|
@ -46,6 +46,7 @@ public final class TlsMasterSecretGenerator extends KeyGeneratorSpi {
|
||||
private final static String MSG = "TlsMasterSecretGenerator must be "
|
||||
+ "initialized using a TlsMasterSecretParameterSpec";
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private TlsMasterSecretParameterSpec spec;
|
||||
|
||||
private int protocolVersion;
|
||||
@ -57,6 +58,7 @@ public final class TlsMasterSecretGenerator extends KeyGeneratorSpi {
|
||||
throw new InvalidParameterException(MSG);
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
protected void engineInit(AlgorithmParameterSpec params,
|
||||
SecureRandom random) throws InvalidAlgorithmParameterException {
|
||||
if (params instanceof TlsMasterSecretParameterSpec == false) {
|
||||
@ -139,7 +141,8 @@ public final class TlsMasterSecretGenerator extends KeyGeneratorSpi {
|
||||
}
|
||||
}
|
||||
|
||||
private static final class TlsMasterSecretKey implements TlsMasterSecret {
|
||||
@SuppressWarnings("deprecation")
|
||||
private static final class TlsMasterSecretKey implements TlsMasterSecret {
|
||||
private static final long serialVersionUID = 1019571680375368880L;
|
||||
|
||||
private byte[] key;
|
||||
|
@ -112,6 +112,7 @@ abstract class TlsPrfGenerator extends KeyGeneratorSpi {
|
||||
private final static String MSG = "TlsPrfGenerator must be "
|
||||
+ "initialized using a TlsPrfParameterSpec";
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private TlsPrfParameterSpec spec;
|
||||
|
||||
public TlsPrfGenerator() {
|
||||
@ -121,6 +122,7 @@ abstract class TlsPrfGenerator extends KeyGeneratorSpi {
|
||||
throw new InvalidParameterException(MSG);
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
protected void engineInit(AlgorithmParameterSpec params,
|
||||
SecureRandom random) throws InvalidAlgorithmParameterException {
|
||||
if (params instanceof TlsPrfParameterSpec == false) {
|
||||
|
@ -44,6 +44,7 @@ public final class TlsRsaPremasterSecretGenerator extends KeyGeneratorSpi {
|
||||
private final static String MSG = "TlsRsaPremasterSecretGenerator must be "
|
||||
+ "initialized using a TlsRsaPremasterSecretParameterSpec";
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private TlsRsaPremasterSecretParameterSpec spec;
|
||||
private SecureRandom random;
|
||||
|
||||
@ -54,6 +55,7 @@ public final class TlsRsaPremasterSecretGenerator extends KeyGeneratorSpi {
|
||||
throw new InvalidParameterException(MSG);
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
protected void engineInit(AlgorithmParameterSpec params,
|
||||
SecureRandom random) throws InvalidAlgorithmParameterException {
|
||||
if (!(params instanceof TlsRsaPremasterSecretParameterSpec)) {
|
||||
|
@ -276,6 +276,7 @@ final class SSLSecurity {
|
||||
* object. This also mean that anything going down into the SPI
|
||||
* needs to be wrapped, as well as anything coming back up.
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
final class SSLContextSpiWrapper extends SSLContextSpi {
|
||||
|
||||
private javax.net.ssl.SSLContext theSSLContext;
|
||||
@ -285,6 +286,7 @@ final class SSLContextSpiWrapper extends SSLContextSpi {
|
||||
theSSLContext = javax.net.ssl.SSLContext.getInstance(algName, prov);
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
protected void engineInit(KeyManager[] kma, TrustManager[] tma,
|
||||
SecureRandom sr) throws KeyManagementException {
|
||||
|
||||
@ -387,6 +389,7 @@ final class SSLContextSpiWrapper extends SSLContextSpi {
|
||||
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
final class TrustManagerFactorySpiWrapper extends TrustManagerFactorySpi {
|
||||
|
||||
private javax.net.ssl.TrustManagerFactory theTrustManagerFactory;
|
||||
@ -438,6 +441,7 @@ final class TrustManagerFactorySpiWrapper extends TrustManagerFactorySpi {
|
||||
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
final class KeyManagerFactorySpiWrapper extends KeyManagerFactorySpi {
|
||||
|
||||
private javax.net.ssl.KeyManagerFactory theKeyManagerFactory;
|
||||
@ -493,6 +497,7 @@ final class KeyManagerFactorySpiWrapper extends KeyManagerFactorySpi {
|
||||
|
||||
// =================================
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
final class X509KeyManagerJavaxWrapper implements
|
||||
javax.net.ssl.X509KeyManager {
|
||||
|
||||
@ -590,6 +595,7 @@ final class X509KeyManagerJavaxWrapper implements
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
final class X509TrustManagerJavaxWrapper implements
|
||||
javax.net.ssl.X509TrustManager {
|
||||
|
||||
@ -622,6 +628,7 @@ final class X509TrustManagerJavaxWrapper implements
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
final class X509KeyManagerComSunWrapper implements X509KeyManager {
|
||||
|
||||
private javax.net.ssl.X509KeyManager theX509KeyManager;
|
||||
@ -657,6 +664,7 @@ final class X509KeyManagerComSunWrapper implements X509KeyManager {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
final class X509TrustManagerComSunWrapper implements X509TrustManager {
|
||||
|
||||
private javax.net.ssl.X509TrustManager theX509TrustManager;
|
||||
|
@ -53,6 +53,7 @@ import sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection;
|
||||
* com.sun.net.ssl.HttpURLConnection is used in the com.sun version.
|
||||
*
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // HttpsURLConnection is deprecated
|
||||
public class DelegateHttpsURLConnection extends AbstractDelegateHttpsURLConnection {
|
||||
|
||||
// we need a reference to the HttpsURLConnection to get
|
||||
@ -62,6 +63,7 @@ public class DelegateHttpsURLConnection extends AbstractDelegateHttpsURLConnecti
|
||||
// this is for ResponseCache.put(URI, URLConnection)
|
||||
// second parameter needs to be cast to javax.net.ssl.HttpsURLConnection
|
||||
// instead of AbstractDelegateHttpsURLConnection
|
||||
|
||||
public com.sun.net.ssl.HttpsURLConnection httpsURLConnection;
|
||||
|
||||
DelegateHttpsURLConnection(URL url,
|
||||
@ -98,9 +100,10 @@ public class DelegateHttpsURLConnection extends AbstractDelegateHttpsURLConnecti
|
||||
}
|
||||
|
||||
class VerifierWrapper implements javax.net.ssl.HostnameVerifier {
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private com.sun.net.ssl.HostnameVerifier verifier;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
VerifierWrapper(com.sun.net.ssl.HostnameVerifier verifier) {
|
||||
this.verifier = verifier;
|
||||
}
|
||||
|
@ -64,6 +64,7 @@ import sun.net.www.http.HttpClient;
|
||||
// For both copies of the file, uncomment one line and comment the other
|
||||
// public class HttpsURLConnectionImpl
|
||||
// extends javax.net.ssl.HttpsURLConnection {
|
||||
@SuppressWarnings("deprecation") // HttpsURLConnection is deprecated
|
||||
public class HttpsURLConnectionOldImpl
|
||||
extends com.sun.net.ssl.HttpsURLConnection {
|
||||
|
||||
|
@ -691,6 +691,8 @@ public final class Class<T> implements java.io.Serializable,
|
||||
ClassLoader getClassLoader0() { return classLoader; }
|
||||
|
||||
// Initialized in JVM not by private constructor
|
||||
// This field is filtered from reflection access, i.e. getDeclaredField
|
||||
// will throw NoSuchFieldException
|
||||
private final ClassLoader classLoader;
|
||||
|
||||
/**
|
||||
@ -719,15 +721,15 @@ public final class Class<T> implements java.io.Serializable,
|
||||
|
||||
|
||||
/**
|
||||
* Returns the {@code Class} representing the superclass of the entity
|
||||
* (class, interface, primitive type or void) represented by this
|
||||
* {@code Class}. If this {@code Class} represents either the
|
||||
* Returns the {@code Class} representing the direct superclass of the
|
||||
* entity (class, interface, primitive type or void) represented by
|
||||
* this {@code Class}. If this {@code Class} represents either the
|
||||
* {@code Object} class, an interface, a primitive type, or void, then
|
||||
* null is returned. If this object represents an array class then the
|
||||
* {@code Class} object representing the {@code Object} class is
|
||||
* returned.
|
||||
*
|
||||
* @return the superclass of the class represented by this object.
|
||||
* @return the direct superclass of the class represented by this object
|
||||
*/
|
||||
public native Class<? super T> getSuperclass();
|
||||
|
||||
@ -758,7 +760,7 @@ public final class Class<T> implements java.io.Serializable,
|
||||
* @throws java.lang.reflect.MalformedParameterizedTypeException if the
|
||||
* generic superclass refers to a parameterized type that cannot be
|
||||
* instantiated for any reason
|
||||
* @return the superclass of the class represented by this object
|
||||
* @return the direct superclass of the class represented by this object
|
||||
* @since 1.5
|
||||
*/
|
||||
public Type getGenericSuperclass() {
|
||||
@ -798,15 +800,15 @@ public final class Class<T> implements java.io.Serializable,
|
||||
|
||||
|
||||
/**
|
||||
* Determines the interfaces implemented by the class or interface
|
||||
* Returns the interfaces directly implemented by the class or interface
|
||||
* represented by this object.
|
||||
*
|
||||
* <p> If this object represents a class, the return value is an array
|
||||
* containing objects representing all interfaces implemented by the
|
||||
* class. The order of the interface objects in the array corresponds to
|
||||
* the order of the interface names in the {@code implements} clause
|
||||
* of the declaration of the class represented by this object. For
|
||||
* example, given the declaration:
|
||||
* <p>If this object represents a class, the return value is an array
|
||||
* containing objects representing all interfaces directly implemented by
|
||||
* the class. The order of the interface objects in the array corresponds
|
||||
* to the order of the interface names in the {@code implements} clause of
|
||||
* the declaration of the class represented by this object. For example,
|
||||
* given the declaration:
|
||||
* <blockquote>
|
||||
* {@code class Shimmer implements FloorWax, DessertTopping { ... }}
|
||||
* </blockquote>
|
||||
@ -823,23 +825,23 @@ public final class Class<T> implements java.io.Serializable,
|
||||
* is the {@code Class} object that represents interface
|
||||
* {@code DessertTopping}.
|
||||
*
|
||||
* <p> If this object represents an interface, the array contains objects
|
||||
* representing all interfaces extended by the interface. The order of the
|
||||
* interface objects in the array corresponds to the order of the interface
|
||||
* names in the {@code extends} clause of the declaration of the
|
||||
* interface represented by this object.
|
||||
* <p>If this object represents an interface, the array contains objects
|
||||
* representing all interfaces directly extended by the interface. The
|
||||
* order of the interface objects in the array corresponds to the order of
|
||||
* the interface names in the {@code extends} clause of the declaration of
|
||||
* the interface represented by this object.
|
||||
*
|
||||
* <p> If this object represents a class or interface that implements no
|
||||
* <p>If this object represents a class or interface that implements no
|
||||
* interfaces, the method returns an array of length 0.
|
||||
*
|
||||
* <p> If this object represents a primitive type or void, the method
|
||||
* <p>If this object represents a primitive type or void, the method
|
||||
* returns an array of length 0.
|
||||
*
|
||||
* <p> If this {@code Class} object represents an array type, the
|
||||
* <p>If this {@code Class} object represents an array type, the
|
||||
* interfaces {@code Cloneable} and {@code java.io.Serializable} are
|
||||
* returned in that order.
|
||||
*
|
||||
* @return an array of interfaces implemented by this class.
|
||||
* @return an array of interfaces directly implemented by this class
|
||||
*/
|
||||
public Class<?>[] getInterfaces() {
|
||||
ReflectionData<T> rd = reflectionData();
|
||||
@ -873,29 +875,28 @@ public final class Class<T> implements java.io.Serializable,
|
||||
* for the semantics of the creation process for parameterized
|
||||
* types.
|
||||
*
|
||||
* <p> If this object represents a class, the return value is an
|
||||
* array containing objects representing all interfaces
|
||||
* implemented by the class. The order of the interface objects in
|
||||
* the array corresponds to the order of the interface names in
|
||||
* the {@code implements} clause of the declaration of the class
|
||||
* represented by this object. In the case of an array class, the
|
||||
* interfaces {@code Cloneable} and {@code Serializable} are
|
||||
* <p>If this object represents a class, the return value is an array
|
||||
* containing objects representing all interfaces directly implemented by
|
||||
* the class. The order of the interface objects in the array corresponds
|
||||
* to the order of the interface names in the {@code implements} clause of
|
||||
* the declaration of the class represented by this object.
|
||||
*
|
||||
* <p>If this object represents an interface, the array contains objects
|
||||
* representing all interfaces directly extended by the interface. The
|
||||
* order of the interface objects in the array corresponds to the order of
|
||||
* the interface names in the {@code extends} clause of the declaration of
|
||||
* the interface represented by this object.
|
||||
*
|
||||
* <p>If this object represents a class or interface that implements no
|
||||
* interfaces, the method returns an array of length 0.
|
||||
*
|
||||
* <p>If this object represents a primitive type or void, the method
|
||||
* returns an array of length 0.
|
||||
*
|
||||
* <p>If this {@code Class} object represents an array type, the
|
||||
* interfaces {@code Cloneable} and {@code java.io.Serializable} are
|
||||
* returned in that order.
|
||||
*
|
||||
* <p>If this object represents an interface, the array contains
|
||||
* objects representing all interfaces directly extended by the
|
||||
* interface. The order of the interface objects in the array
|
||||
* corresponds to the order of the interface names in the
|
||||
* {@code extends} clause of the declaration of the interface
|
||||
* represented by this object.
|
||||
*
|
||||
* <p>If this object represents a class or interface that
|
||||
* implements no interfaces, the method returns an array of length
|
||||
* 0.
|
||||
*
|
||||
* <p>If this object represents a primitive type or void, the
|
||||
* method returns an array of length 0.
|
||||
*
|
||||
* @throws java.lang.reflect.GenericSignatureFormatError
|
||||
* if the generic class signature does not conform to the format
|
||||
* specified in
|
||||
@ -905,7 +906,7 @@ public final class Class<T> implements java.io.Serializable,
|
||||
* @throws java.lang.reflect.MalformedParameterizedTypeException
|
||||
* if any of the generic superinterfaces refer to a parameterized
|
||||
* type that cannot be instantiated for any reason
|
||||
* @return an array of interfaces implemented by this class
|
||||
* @return an array of interfaces directly implemented by this class
|
||||
* @since 1.5
|
||||
*/
|
||||
public Type[] getGenericInterfaces() {
|
||||
@ -1533,7 +1534,8 @@ public final class Class<T> implements java.io.Serializable,
|
||||
* 0.
|
||||
*
|
||||
* <p> If this {@code Class} object represents a class, then this method
|
||||
* returns the public fields of the class and of all its superclasses.
|
||||
* returns the public fields of the class and of all its superclasses and
|
||||
* superinterfaces.
|
||||
*
|
||||
* <p> If this {@code Class} object represents an interface, then this
|
||||
* method returns the fields of the interface and of all its
|
||||
|
@ -453,7 +453,7 @@ public class Object {
|
||||
"nanosecond timeout value out of range");
|
||||
}
|
||||
|
||||
if (nanos >= 500000 || (nanos != 0 && timeout == 0)) {
|
||||
if (nanos > 0) {
|
||||
timeout++;
|
||||
}
|
||||
|
||||
|
@ -145,7 +145,7 @@ class Thread implements Runnable {
|
||||
registerNatives();
|
||||
}
|
||||
|
||||
private volatile char name[];
|
||||
private volatile String name;
|
||||
private int priority;
|
||||
private Thread threadQ;
|
||||
private long eetop;
|
||||
@ -366,7 +366,7 @@ class Thread implements Runnable {
|
||||
throw new NullPointerException("name cannot be null");
|
||||
}
|
||||
|
||||
this.name = name.toCharArray();
|
||||
this.name = name;
|
||||
|
||||
Thread parent = currentThread();
|
||||
SecurityManager security = System.getSecurityManager();
|
||||
@ -1119,7 +1119,11 @@ class Thread implements Runnable {
|
||||
*/
|
||||
public final synchronized void setName(String name) {
|
||||
checkAccess();
|
||||
this.name = name.toCharArray();
|
||||
if (name == null) {
|
||||
throw new NullPointerException("name cannot be null");
|
||||
}
|
||||
|
||||
this.name = name;
|
||||
if (threadStatus != 0) {
|
||||
setNativeName(name);
|
||||
}
|
||||
@ -1132,7 +1136,7 @@ class Thread implements Runnable {
|
||||
* @see #setName(String)
|
||||
*/
|
||||
public final String getName() {
|
||||
return new String(name, true);
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -125,7 +125,7 @@ class LambdaForm {
|
||||
MemberName vmentry; // low-level behavior, or null if not yet prepared
|
||||
private boolean isCompiled;
|
||||
|
||||
Object transformCache; // managed by LambdaFormEditor
|
||||
volatile Object transformCache; // managed by LambdaFormEditor
|
||||
|
||||
public static final int VOID_RESULT = -1, LAST_RESULT = -2;
|
||||
|
||||
|
@ -46,19 +46,16 @@ final class LambdaFormBuffer {
|
||||
private static final int F_TRANS = 0x10, F_OWNED = 0x03;
|
||||
|
||||
LambdaFormBuffer(LambdaForm lf) {
|
||||
this(lf.arity, lf.names, lf.result);
|
||||
this.arity = lf.arity;
|
||||
setNames(lf.names);
|
||||
int result = lf.result;
|
||||
if (result == LAST_RESULT) result = length - 1;
|
||||
if (result >= 0 && lf.names[result].type != V_TYPE)
|
||||
resultName = lf.names[result];
|
||||
debugName = lf.debugName;
|
||||
assert(lf.nameRefsAreLegal());
|
||||
}
|
||||
|
||||
private LambdaFormBuffer(int arity, Name[] names, int result) {
|
||||
this.arity = arity;
|
||||
setNames(names);
|
||||
if (result == LAST_RESULT) result = length - 1;
|
||||
if (result >= 0 && names[result].type != V_TYPE)
|
||||
resultName = names[result];
|
||||
}
|
||||
|
||||
private LambdaForm lambdaForm() {
|
||||
assert(!inTrans()); // need endEdit call to tidy things up
|
||||
return new LambdaForm(debugName, arity, nameArray(), resultIndex());
|
||||
|
@ -25,6 +25,7 @@
|
||||
|
||||
package java.lang.invoke;
|
||||
|
||||
import java.lang.ref.SoftReference;
|
||||
import java.util.Arrays;
|
||||
import static java.lang.invoke.LambdaForm.*;
|
||||
import static java.lang.invoke.LambdaForm.BasicType.*;
|
||||
@ -58,10 +59,9 @@ class LambdaFormEditor {
|
||||
* The sequence is unterminated, ending with an indefinite number of zero bytes.
|
||||
* Sequences that are simple (short enough and with small enough values) pack into a 64-bit long.
|
||||
*/
|
||||
private static final class Transform {
|
||||
private static final class Transform extends SoftReference<LambdaForm> {
|
||||
final long packedBytes;
|
||||
final byte[] fullBytes;
|
||||
final LambdaForm result; // result of transform, or null, if there is none available
|
||||
|
||||
private enum Kind {
|
||||
NO_KIND, // necessary because ordinal must be greater than zero
|
||||
@ -140,9 +140,9 @@ class LambdaFormEditor {
|
||||
Kind kind() { return Kind.values()[byteAt(0)]; }
|
||||
|
||||
private Transform(long packedBytes, byte[] fullBytes, LambdaForm result) {
|
||||
super(result);
|
||||
this.packedBytes = packedBytes;
|
||||
this.fullBytes = fullBytes;
|
||||
this.result = result;
|
||||
}
|
||||
private Transform(long packedBytes) {
|
||||
this(packedBytes, null, null);
|
||||
@ -243,6 +243,7 @@ class LambdaFormEditor {
|
||||
buf.append("unpacked");
|
||||
buf.append(Arrays.toString(fullBytes));
|
||||
}
|
||||
LambdaForm result = get();
|
||||
if (result != null) {
|
||||
buf.append(" result=");
|
||||
buf.append(result);
|
||||
@ -253,7 +254,7 @@ class LambdaFormEditor {
|
||||
|
||||
/** Find a previously cached transform equivalent to the given one, and return its result. */
|
||||
private LambdaForm getInCache(Transform key) {
|
||||
assert(key.result == null);
|
||||
assert(key.get() == null);
|
||||
// The transformCache is one of null, Transform, Transform[], or ConcurrentHashMap.
|
||||
Object c = lambdaForm.transformCache;
|
||||
Transform k = null;
|
||||
@ -276,7 +277,7 @@ class LambdaFormEditor {
|
||||
}
|
||||
}
|
||||
assert(k == null || key.equals(k));
|
||||
return k == null ? null : k.result;
|
||||
return (k != null) ? k.get() : null;
|
||||
}
|
||||
|
||||
/** Arbitrary but reasonable limits on Transform[] size for cache. */
|
||||
@ -293,7 +294,17 @@ class LambdaFormEditor {
|
||||
@SuppressWarnings("unchecked")
|
||||
ConcurrentHashMap<Transform,Transform> m = (ConcurrentHashMap<Transform,Transform>) c;
|
||||
Transform k = m.putIfAbsent(key, key);
|
||||
return k != null ? k.result : form;
|
||||
if (k == null) return form;
|
||||
LambdaForm result = k.get();
|
||||
if (result != null) {
|
||||
return result;
|
||||
} else {
|
||||
if (m.replace(key, k, key)) {
|
||||
return form;
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
assert(pass == 0);
|
||||
synchronized (lambdaForm) {
|
||||
@ -308,17 +319,27 @@ class LambdaFormEditor {
|
||||
if (c instanceof Transform) {
|
||||
Transform k = (Transform)c;
|
||||
if (k.equals(key)) {
|
||||
return k.result;
|
||||
LambdaForm result = k.get();
|
||||
if (result == null) {
|
||||
lambdaForm.transformCache = key;
|
||||
return form;
|
||||
} else {
|
||||
return result;
|
||||
}
|
||||
} else if (k.get() == null) { // overwrite stale entry
|
||||
lambdaForm.transformCache = key;
|
||||
return form;
|
||||
}
|
||||
// expand one-element cache to small array
|
||||
ta = new Transform[MIN_CACHE_ARRAY_SIZE];
|
||||
ta[0] = k;
|
||||
lambdaForm.transformCache = c = ta;
|
||||
lambdaForm.transformCache = ta;
|
||||
} else {
|
||||
// it is already expanded
|
||||
ta = (Transform[])c;
|
||||
}
|
||||
int len = ta.length;
|
||||
int stale = -1;
|
||||
int i;
|
||||
for (i = 0; i < len; i++) {
|
||||
Transform k = ta[i];
|
||||
@ -326,10 +347,18 @@ class LambdaFormEditor {
|
||||
break;
|
||||
}
|
||||
if (k.equals(key)) {
|
||||
return k.result;
|
||||
LambdaForm result = k.get();
|
||||
if (result == null) {
|
||||
ta[i] = key;
|
||||
return form;
|
||||
} else {
|
||||
return result;
|
||||
}
|
||||
} else if (stale < 0 && k.get() == null) {
|
||||
stale = i; // remember 1st stale entry index
|
||||
}
|
||||
}
|
||||
if (i < len) {
|
||||
if (i < len || stale >= 0) {
|
||||
// just fall through to cache update
|
||||
} else if (len < MAX_CACHE_ARRAY_SIZE) {
|
||||
len = Math.min(len * 2, MAX_CACHE_ARRAY_SIZE);
|
||||
@ -344,7 +373,8 @@ class LambdaFormEditor {
|
||||
// The second iteration will update for this query, concurrently.
|
||||
continue;
|
||||
}
|
||||
ta[i] = key;
|
||||
int idx = (stale >= 0) ? stale : i;
|
||||
ta[idx] = key;
|
||||
return form;
|
||||
}
|
||||
}
|
||||
|
@ -867,15 +867,11 @@ assertEquals("[A, B, C]", (String) caToString2.invokeExact('A', "BC".toCharArray
|
||||
MethodType postSpreadType = asSpreaderChecks(arrayType, arrayLength);
|
||||
int arity = type().parameterCount();
|
||||
int spreadArgPos = arity - arrayLength;
|
||||
if (USE_LAMBDA_FORM_EDITOR) {
|
||||
MethodHandle afterSpread = this.asType(postSpreadType);
|
||||
BoundMethodHandle mh = afterSpread.rebind();
|
||||
LambdaForm lform = mh.editor().spreadArgumentsForm(1 + spreadArgPos, arrayType, arrayLength);
|
||||
MethodType preSpreadType = postSpreadType.replaceParameterTypes(spreadArgPos, arity, arrayType);
|
||||
return mh.copyWith(preSpreadType, lform);
|
||||
} else {
|
||||
return MethodHandleImpl.makeSpreadArguments(this, arrayType, spreadArgPos, arrayLength);
|
||||
}
|
||||
MethodHandle afterSpread = this.asType(postSpreadType);
|
||||
BoundMethodHandle mh = afterSpread.rebind();
|
||||
LambdaForm lform = mh.editor().spreadArgumentsForm(1 + spreadArgPos, arrayType, arrayLength);
|
||||
MethodType preSpreadType = postSpreadType.replaceParameterTypes(spreadArgPos, arity, arrayType);
|
||||
return mh.copyWith(preSpreadType, lform);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -996,23 +992,15 @@ assertEquals("[123]", (String) longsToString.invokeExact((long)123));
|
||||
public MethodHandle asCollector(Class<?> arrayType, int arrayLength) {
|
||||
asCollectorChecks(arrayType, arrayLength);
|
||||
int collectArgPos = type().parameterCount() - 1;
|
||||
if (USE_LAMBDA_FORM_EDITOR) {
|
||||
BoundMethodHandle mh = rebind();
|
||||
MethodType resultType = type().asCollectorType(arrayType, arrayLength);
|
||||
MethodHandle newArray = MethodHandleImpl.varargsArray(arrayType, arrayLength);
|
||||
LambdaForm lform = mh.editor().collectArgumentArrayForm(1 + collectArgPos, newArray);
|
||||
if (lform != null) {
|
||||
return mh.copyWith(resultType, lform);
|
||||
}
|
||||
lform = mh.editor().collectArgumentsForm(1 + collectArgPos, newArray.type().basicType());
|
||||
return mh.copyWithExtendL(resultType, lform, newArray);
|
||||
} else {
|
||||
MethodHandle target = this;
|
||||
if (arrayType != type().parameterType(collectArgPos))
|
||||
target = MethodHandleImpl.makePairwiseConvert(this, type().changeParameterType(collectArgPos, arrayType), true);
|
||||
MethodHandle collector = MethodHandleImpl.varargsArray(arrayType, arrayLength);
|
||||
return MethodHandles.collectArguments(target, collectArgPos, collector);
|
||||
BoundMethodHandle mh = rebind();
|
||||
MethodType resultType = type().asCollectorType(arrayType, arrayLength);
|
||||
MethodHandle newArray = MethodHandleImpl.varargsArray(arrayType, arrayLength);
|
||||
LambdaForm lform = mh.editor().collectArgumentArrayForm(1 + collectArgPos, newArray);
|
||||
if (lform != null) {
|
||||
return mh.copyWith(resultType, lform);
|
||||
}
|
||||
lform = mh.editor().collectArgumentsForm(1 + collectArgPos, newArray.type().basicType());
|
||||
return mh.copyWithExtendL(resultType, lform, newArray);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -191,11 +191,7 @@ import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
|
||||
MethodType dstType = target.type();
|
||||
if (srcType == dstType)
|
||||
return target;
|
||||
if (USE_LAMBDA_FORM_EDITOR) {
|
||||
return makePairwiseConvertByEditor(target, srcType, strict, monobox);
|
||||
} else {
|
||||
return makePairwiseConvertIndirect(target, srcType, strict, monobox);
|
||||
}
|
||||
return makePairwiseConvertByEditor(target, srcType, strict, monobox);
|
||||
}
|
||||
|
||||
private static int countNonNull(Object[] array) {
|
||||
|
@ -45,23 +45,21 @@ import sun.misc.Unsafe;
|
||||
static final boolean DUMP_CLASS_FILES;
|
||||
static final boolean TRACE_INTERPRETER;
|
||||
static final boolean TRACE_METHOD_LINKAGE;
|
||||
static final boolean USE_LAMBDA_FORM_EDITOR;
|
||||
static final int COMPILE_THRESHOLD;
|
||||
static final int DONT_INLINE_THRESHOLD;
|
||||
static final int PROFILE_LEVEL;
|
||||
|
||||
static {
|
||||
final Object[] values = new Object[8];
|
||||
final Object[] values = new Object[7];
|
||||
AccessController.doPrivileged(new PrivilegedAction<Void>() {
|
||||
public Void run() {
|
||||
values[0] = Boolean.getBoolean("java.lang.invoke.MethodHandle.DEBUG_NAMES");
|
||||
values[1] = Boolean.getBoolean("java.lang.invoke.MethodHandle.DUMP_CLASS_FILES");
|
||||
values[2] = Boolean.getBoolean("java.lang.invoke.MethodHandle.TRACE_INTERPRETER");
|
||||
values[3] = Boolean.getBoolean("java.lang.invoke.MethodHandle.TRACE_METHOD_LINKAGE");
|
||||
values[4] = Boolean.getBoolean("java.lang.invoke.MethodHandle.USE_LF_EDITOR");
|
||||
values[5] = Integer.getInteger("java.lang.invoke.MethodHandle.COMPILE_THRESHOLD", 30);
|
||||
values[6] = Integer.getInteger("java.lang.invoke.MethodHandle.DONT_INLINE_THRESHOLD", 30);
|
||||
values[7] = Integer.getInteger("java.lang.invoke.MethodHandle.PROFILE_LEVEL", 0);
|
||||
values[4] = Integer.getInteger("java.lang.invoke.MethodHandle.COMPILE_THRESHOLD", 0);
|
||||
values[5] = Integer.getInteger("java.lang.invoke.MethodHandle.DONT_INLINE_THRESHOLD", 30);
|
||||
values[6] = Integer.getInteger("java.lang.invoke.MethodHandle.PROFILE_LEVEL", 0);
|
||||
return null;
|
||||
}
|
||||
});
|
||||
@ -69,10 +67,9 @@ import sun.misc.Unsafe;
|
||||
DUMP_CLASS_FILES = (Boolean) values[1];
|
||||
TRACE_INTERPRETER = (Boolean) values[2];
|
||||
TRACE_METHOD_LINKAGE = (Boolean) values[3];
|
||||
USE_LAMBDA_FORM_EDITOR = (Boolean) values[4];
|
||||
COMPILE_THRESHOLD = (Integer) values[5];
|
||||
DONT_INLINE_THRESHOLD = (Integer) values[6];
|
||||
PROFILE_LEVEL = (Integer) values[7];
|
||||
COMPILE_THRESHOLD = (Integer) values[4];
|
||||
DONT_INLINE_THRESHOLD = (Integer) values[5];
|
||||
PROFILE_LEVEL = (Integer) values[6];
|
||||
}
|
||||
|
||||
/** Tell if any of the debugging switches are turned on.
|
||||
|
@ -2103,115 +2103,65 @@ assert((int)twice.invokeExact(21) == 42);
|
||||
reorder = reorder.clone(); // get a private copy
|
||||
MethodType oldType = target.type();
|
||||
permuteArgumentChecks(reorder, newType, oldType);
|
||||
if (USE_LAMBDA_FORM_EDITOR) {
|
||||
// first detect dropped arguments and handle them separately
|
||||
int[] originalReorder = reorder;
|
||||
BoundMethodHandle result = target.rebind();
|
||||
LambdaForm form = result.form;
|
||||
int newArity = newType.parameterCount();
|
||||
// Normalize the reordering into a real permutation,
|
||||
// by removing duplicates and adding dropped elements.
|
||||
// This somewhat improves lambda form caching, as well
|
||||
// as simplifying the transform by breaking it up into steps.
|
||||
for (int ddIdx; (ddIdx = findFirstDupOrDrop(reorder, newArity)) != 0; ) {
|
||||
if (ddIdx > 0) {
|
||||
// We found a duplicated entry at reorder[ddIdx].
|
||||
// Example: (x,y,z)->asList(x,y,z)
|
||||
// permuted by [1*,0,1] => (a0,a1)=>asList(a1,a0,a1)
|
||||
// permuted by [0,1,0*] => (a0,a1)=>asList(a0,a1,a0)
|
||||
// The starred element corresponds to the argument
|
||||
// deleted by the dupArgumentForm transform.
|
||||
int srcPos = ddIdx, dstPos = srcPos, dupVal = reorder[srcPos];
|
||||
boolean killFirst = false;
|
||||
for (int val; (val = reorder[--dstPos]) != dupVal; ) {
|
||||
// Set killFirst if the dup is larger than an intervening position.
|
||||
// This will remove at least one inversion from the permutation.
|
||||
if (dupVal > val) killFirst = true;
|
||||
}
|
||||
if (!killFirst) {
|
||||
srcPos = dstPos;
|
||||
dstPos = ddIdx;
|
||||
}
|
||||
form = form.editor().dupArgumentForm(1 + srcPos, 1 + dstPos);
|
||||
assert (reorder[srcPos] == reorder[dstPos]);
|
||||
oldType = oldType.dropParameterTypes(dstPos, dstPos + 1);
|
||||
// contract the reordering by removing the element at dstPos
|
||||
int tailPos = dstPos + 1;
|
||||
System.arraycopy(reorder, tailPos, reorder, dstPos, reorder.length - tailPos);
|
||||
reorder = Arrays.copyOf(reorder, reorder.length - 1);
|
||||
} else {
|
||||
int dropVal = ~ddIdx, insPos = 0;
|
||||
while (insPos < reorder.length && reorder[insPos] < dropVal) {
|
||||
// Find first element of reorder larger than dropVal.
|
||||
// This is where we will insert the dropVal.
|
||||
insPos += 1;
|
||||
}
|
||||
Class<?> ptype = newType.parameterType(dropVal);
|
||||
form = form.editor().addArgumentForm(1 + insPos, BasicType.basicType(ptype));
|
||||
oldType = oldType.insertParameterTypes(insPos, ptype);
|
||||
// expand the reordering by inserting an element at insPos
|
||||
int tailPos = insPos + 1;
|
||||
reorder = Arrays.copyOf(reorder, reorder.length + 1);
|
||||
System.arraycopy(reorder, insPos, reorder, tailPos, reorder.length - tailPos);
|
||||
reorder[insPos] = dropVal;
|
||||
// first detect dropped arguments and handle them separately
|
||||
int[] originalReorder = reorder;
|
||||
BoundMethodHandle result = target.rebind();
|
||||
LambdaForm form = result.form;
|
||||
int newArity = newType.parameterCount();
|
||||
// Normalize the reordering into a real permutation,
|
||||
// by removing duplicates and adding dropped elements.
|
||||
// This somewhat improves lambda form caching, as well
|
||||
// as simplifying the transform by breaking it up into steps.
|
||||
for (int ddIdx; (ddIdx = findFirstDupOrDrop(reorder, newArity)) != 0; ) {
|
||||
if (ddIdx > 0) {
|
||||
// We found a duplicated entry at reorder[ddIdx].
|
||||
// Example: (x,y,z)->asList(x,y,z)
|
||||
// permuted by [1*,0,1] => (a0,a1)=>asList(a1,a0,a1)
|
||||
// permuted by [0,1,0*] => (a0,a1)=>asList(a0,a1,a0)
|
||||
// The starred element corresponds to the argument
|
||||
// deleted by the dupArgumentForm transform.
|
||||
int srcPos = ddIdx, dstPos = srcPos, dupVal = reorder[srcPos];
|
||||
boolean killFirst = false;
|
||||
for (int val; (val = reorder[--dstPos]) != dupVal; ) {
|
||||
// Set killFirst if the dup is larger than an intervening position.
|
||||
// This will remove at least one inversion from the permutation.
|
||||
if (dupVal > val) killFirst = true;
|
||||
}
|
||||
assert (permuteArgumentChecks(reorder, newType, oldType));
|
||||
if (!killFirst) {
|
||||
srcPos = dstPos;
|
||||
dstPos = ddIdx;
|
||||
}
|
||||
form = form.editor().dupArgumentForm(1 + srcPos, 1 + dstPos);
|
||||
assert (reorder[srcPos] == reorder[dstPos]);
|
||||
oldType = oldType.dropParameterTypes(dstPos, dstPos + 1);
|
||||
// contract the reordering by removing the element at dstPos
|
||||
int tailPos = dstPos + 1;
|
||||
System.arraycopy(reorder, tailPos, reorder, dstPos, reorder.length - tailPos);
|
||||
reorder = Arrays.copyOf(reorder, reorder.length - 1);
|
||||
} else {
|
||||
int dropVal = ~ddIdx, insPos = 0;
|
||||
while (insPos < reorder.length && reorder[insPos] < dropVal) {
|
||||
// Find first element of reorder larger than dropVal.
|
||||
// This is where we will insert the dropVal.
|
||||
insPos += 1;
|
||||
}
|
||||
Class<?> ptype = newType.parameterType(dropVal);
|
||||
form = form.editor().addArgumentForm(1 + insPos, BasicType.basicType(ptype));
|
||||
oldType = oldType.insertParameterTypes(insPos, ptype);
|
||||
// expand the reordering by inserting an element at insPos
|
||||
int tailPos = insPos + 1;
|
||||
reorder = Arrays.copyOf(reorder, reorder.length + 1);
|
||||
System.arraycopy(reorder, insPos, reorder, tailPos, reorder.length - tailPos);
|
||||
reorder[insPos] = dropVal;
|
||||
}
|
||||
assert (reorder.length == newArity); // a perfect permutation
|
||||
// Note: This may cache too many distinct LFs. Consider backing off to varargs code.
|
||||
form = form.editor().permuteArgumentsForm(1, reorder);
|
||||
if (newType == result.type() && form == result.internalForm())
|
||||
return result;
|
||||
return result.copyWith(newType, form);
|
||||
} else {
|
||||
// first detect dropped arguments and handle them separately
|
||||
MethodHandle originalTarget = target;
|
||||
int newArity = newType.parameterCount();
|
||||
for (int dropIdx; (dropIdx = findFirstDrop(reorder, newArity)) >= 0; ) {
|
||||
// dropIdx is missing from reorder; add it in at the end
|
||||
int oldArity = reorder.length;
|
||||
target = dropArguments(target, oldArity, newType.parameterType(dropIdx));
|
||||
reorder = Arrays.copyOf(reorder, oldArity + 1);
|
||||
reorder[oldArity] = dropIdx;
|
||||
}
|
||||
assert(target == originalTarget || permuteArgumentChecks(reorder, newType, target.type()));
|
||||
// Note: This may cache too many distinct LFs. Consider backing off to varargs code.
|
||||
BoundMethodHandle result = target.rebind();
|
||||
LambdaForm form = result.form.permuteArguments(1, reorder, basicTypes(newType.parameterList()));
|
||||
return result.copyWith(newType, form);
|
||||
}
|
||||
}
|
||||
|
||||
/** Return the first value in [0..newArity-1] that is not present in reorder. */
|
||||
private static int findFirstDrop(int[] reorder, int newArity) {
|
||||
final int BIT_LIMIT = 63; // max number of bits in bit mask
|
||||
if (newArity < BIT_LIMIT) {
|
||||
long mask = 0;
|
||||
for (int arg : reorder) {
|
||||
assert(arg < newArity);
|
||||
mask |= (1L << arg);
|
||||
}
|
||||
if (mask == (1L << newArity) - 1) {
|
||||
assert(Long.numberOfTrailingZeros(Long.lowestOneBit(~mask)) == newArity);
|
||||
return -1;
|
||||
}
|
||||
// find first zero
|
||||
long zeroBit = Long.lowestOneBit(~mask);
|
||||
int zeroPos = Long.numberOfTrailingZeros(zeroBit);
|
||||
assert(zeroPos < newArity);
|
||||
return zeroPos;
|
||||
} else {
|
||||
BitSet mask = new BitSet(newArity);
|
||||
for (int arg : reorder) {
|
||||
assert (arg < newArity);
|
||||
mask.set(arg);
|
||||
}
|
||||
int zeroPos = mask.nextClearBit(0);
|
||||
assert(zeroPos <= newArity);
|
||||
if (zeroPos == newArity)
|
||||
return -1;
|
||||
return zeroPos;
|
||||
assert (permuteArgumentChecks(reorder, newType, oldType));
|
||||
}
|
||||
assert (reorder.length == newArity); // a perfect permutation
|
||||
// Note: This may cache too many distinct LFs. Consider backing off to varargs code.
|
||||
form = form.editor().permuteArgumentsForm(1, reorder);
|
||||
if (newType == result.type() && form == result.internalForm())
|
||||
return result;
|
||||
return result.copyWith(newType, form);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -2502,13 +2452,9 @@ assertEquals("yz", (String) d0.invokeExact(123, "x", "y", "z"));
|
||||
if (dropped == 0) return target;
|
||||
BoundMethodHandle result = target.rebind();
|
||||
LambdaForm lform = result.form;
|
||||
if (USE_LAMBDA_FORM_EDITOR) {
|
||||
int insertFormArg = 1 + pos;
|
||||
for (Class<?> ptype : valueTypes) {
|
||||
lform = lform.editor().addArgumentForm(insertFormArg++, BasicType.basicType(ptype));
|
||||
}
|
||||
} else {
|
||||
lform = lform.addArguments(pos, valueTypes);
|
||||
int insertFormArg = 1 + pos;
|
||||
for (Class<?> ptype : valueTypes) {
|
||||
lform = lform.editor().addArgumentForm(insertFormArg++, BasicType.basicType(ptype));
|
||||
}
|
||||
result = result.copyWith(newType, lform);
|
||||
return result;
|
||||
@ -2659,18 +2605,14 @@ assertEquals("XY", (String) f2.invokeExact("x", "y")); // XY
|
||||
/*non-public*/ static
|
||||
MethodHandle filterArgument(MethodHandle target, int pos, MethodHandle filter) {
|
||||
filterArgumentChecks(target, pos, filter);
|
||||
if (USE_LAMBDA_FORM_EDITOR) {
|
||||
MethodType targetType = target.type();
|
||||
MethodType filterType = filter.type();
|
||||
BoundMethodHandle result = target.rebind();
|
||||
Class<?> newParamType = filterType.parameterType(0);
|
||||
LambdaForm lform = result.editor().filterArgumentForm(1 + pos, BasicType.basicType(newParamType));
|
||||
MethodType newType = targetType.changeParameterType(pos, newParamType);
|
||||
result = result.copyWithExtendL(newType, lform, filter);
|
||||
return result;
|
||||
} else {
|
||||
return MethodHandleImpl.makeCollectArguments(target, filter, pos, false);
|
||||
}
|
||||
MethodType targetType = target.type();
|
||||
MethodType filterType = filter.type();
|
||||
BoundMethodHandle result = target.rebind();
|
||||
Class<?> newParamType = filterType.parameterType(0);
|
||||
LambdaForm lform = result.editor().filterArgumentForm(1 + pos, BasicType.basicType(newParamType));
|
||||
MethodType newType = targetType.changeParameterType(pos, newParamType);
|
||||
result = result.copyWithExtendL(newType, lform, filter);
|
||||
return result;
|
||||
}
|
||||
|
||||
private static void filterArgumentsCheckArity(MethodHandle target, int pos, MethodHandle[] filters) {
|
||||
@ -2797,21 +2739,17 @@ assertEquals("[top, [[up, down, strange], charm], bottom]",
|
||||
public static
|
||||
MethodHandle collectArguments(MethodHandle target, int pos, MethodHandle filter) {
|
||||
MethodType newType = collectArgumentsChecks(target, pos, filter);
|
||||
if (USE_LAMBDA_FORM_EDITOR) {
|
||||
MethodType collectorType = filter.type();
|
||||
BoundMethodHandle result = target.rebind();
|
||||
LambdaForm lform;
|
||||
if (collectorType.returnType().isArray() && filter.intrinsicName() == Intrinsic.NEW_ARRAY) {
|
||||
lform = result.editor().collectArgumentArrayForm(1 + pos, filter);
|
||||
if (lform != null) {
|
||||
return result.copyWith(newType, lform);
|
||||
}
|
||||
MethodType collectorType = filter.type();
|
||||
BoundMethodHandle result = target.rebind();
|
||||
LambdaForm lform;
|
||||
if (collectorType.returnType().isArray() && filter.intrinsicName() == Intrinsic.NEW_ARRAY) {
|
||||
lform = result.editor().collectArgumentArrayForm(1 + pos, filter);
|
||||
if (lform != null) {
|
||||
return result.copyWith(newType, lform);
|
||||
}
|
||||
lform = result.editor().collectArgumentsForm(1 + pos, collectorType.basicType());
|
||||
return result.copyWithExtendL(newType, lform, filter);
|
||||
} else {
|
||||
return MethodHandleImpl.makeCollectArguments(target, filter, pos, false);
|
||||
}
|
||||
lform = result.editor().collectArgumentsForm(1 + pos, collectorType.basicType());
|
||||
return result.copyWithExtendL(newType, lform, filter);
|
||||
}
|
||||
|
||||
private static MethodType collectArgumentsChecks(MethodHandle target, int pos, MethodHandle filter) throws RuntimeException {
|
||||
@ -2890,16 +2828,12 @@ System.out.println((int) f0.invokeExact("x", "y")); // 2
|
||||
MethodType targetType = target.type();
|
||||
MethodType filterType = filter.type();
|
||||
filterReturnValueChecks(targetType, filterType);
|
||||
if (USE_LAMBDA_FORM_EDITOR) {
|
||||
BoundMethodHandle result = target.rebind();
|
||||
BasicType rtype = BasicType.basicType(filterType.returnType());
|
||||
LambdaForm lform = result.editor().filterReturnForm(rtype, false);
|
||||
MethodType newType = targetType.changeReturnType(filterType.returnType());
|
||||
result = result.copyWithExtendL(newType, lform, filter);
|
||||
return result;
|
||||
} else {
|
||||
return MethodHandleImpl.makeCollectArguments(filter, target, 0, false);
|
||||
}
|
||||
BoundMethodHandle result = target.rebind();
|
||||
BasicType rtype = BasicType.basicType(filterType.returnType());
|
||||
LambdaForm lform = result.editor().filterReturnForm(rtype, false);
|
||||
MethodType newType = targetType.changeReturnType(filterType.returnType());
|
||||
result = result.copyWithExtendL(newType, lform, filter);
|
||||
return result;
|
||||
}
|
||||
|
||||
private static void filterReturnValueChecks(MethodType targetType, MethodType filterType) throws RuntimeException {
|
||||
@ -2993,19 +2927,15 @@ assertEquals("boojum", (String) catTrace.invokeExact("boo", "jum"));
|
||||
MethodType targetType = target.type();
|
||||
MethodType combinerType = combiner.type();
|
||||
Class<?> rtype = foldArgumentChecks(foldPos, targetType, combinerType);
|
||||
if (USE_LAMBDA_FORM_EDITOR) {
|
||||
BoundMethodHandle result = target.rebind();
|
||||
boolean dropResult = (rtype == void.class);
|
||||
// Note: This may cache too many distinct LFs. Consider backing off to varargs code.
|
||||
LambdaForm lform = result.editor().foldArgumentsForm(1 + foldPos, dropResult, combinerType.basicType());
|
||||
MethodType newType = targetType;
|
||||
if (!dropResult)
|
||||
newType = newType.dropParameterTypes(foldPos, foldPos + 1);
|
||||
result = result.copyWithExtendL(newType, lform, combiner);
|
||||
return result;
|
||||
} else {
|
||||
return MethodHandleImpl.makeCollectArguments(target, combiner, foldPos, true);
|
||||
}
|
||||
BoundMethodHandle result = target.rebind();
|
||||
boolean dropResult = (rtype == void.class);
|
||||
// Note: This may cache too many distinct LFs. Consider backing off to varargs code.
|
||||
LambdaForm lform = result.editor().foldArgumentsForm(1 + foldPos, dropResult, combinerType.basicType());
|
||||
MethodType newType = targetType;
|
||||
if (!dropResult)
|
||||
newType = newType.dropParameterTypes(foldPos, foldPos + 1);
|
||||
result = result.copyWithExtendL(newType, lform, combiner);
|
||||
return result;
|
||||
}
|
||||
|
||||
private static Class<?> foldArgumentChecks(int foldPos, MethodType targetType, MethodType combinerType) {
|
||||
|
@ -26,9 +26,8 @@
|
||||
package java.lang.invoke;
|
||||
|
||||
import sun.invoke.util.Wrapper;
|
||||
import java.lang.ref.SoftReference;
|
||||
import static java.lang.invoke.MethodHandleStatics.*;
|
||||
import static java.lang.invoke.MethodHandleNatives.Constants.*;
|
||||
import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
|
||||
|
||||
/**
|
||||
* Shared information for a group of method types, which differ
|
||||
@ -51,7 +50,7 @@ final class MethodTypeForm {
|
||||
final MethodType basicType; // the canonical erasure, with primitives simplified
|
||||
|
||||
// Cached adapter information:
|
||||
@Stable final MethodHandle[] methodHandles;
|
||||
@Stable final SoftReference<MethodHandle>[] methodHandles;
|
||||
// Indexes into methodHandles:
|
||||
static final int
|
||||
MH_BASIC_INV = 0, // cached instance of MH.invokeBasic
|
||||
@ -60,7 +59,7 @@ final class MethodTypeForm {
|
||||
MH_LIMIT = 3;
|
||||
|
||||
// Cached lambda form information, for basic types only:
|
||||
final @Stable LambdaForm[] lambdaForms;
|
||||
final @Stable SoftReference<LambdaForm>[] lambdaForms;
|
||||
// Indexes into lambdaForms:
|
||||
static final int
|
||||
LF_INVVIRTUAL = 0, // DMH invokeVirtual
|
||||
@ -108,26 +107,40 @@ final class MethodTypeForm {
|
||||
|
||||
public MethodHandle cachedMethodHandle(int which) {
|
||||
assert(assertIsBasicType());
|
||||
return methodHandles[which];
|
||||
SoftReference<MethodHandle> entry = methodHandles[which];
|
||||
return (entry != null) ? entry.get() : null;
|
||||
}
|
||||
|
||||
synchronized public MethodHandle setCachedMethodHandle(int which, MethodHandle mh) {
|
||||
// Simulate a CAS, to avoid racy duplication of results.
|
||||
MethodHandle prev = methodHandles[which];
|
||||
if (prev != null) return prev;
|
||||
return methodHandles[which] = mh;
|
||||
SoftReference<MethodHandle> entry = methodHandles[which];
|
||||
if (entry != null) {
|
||||
MethodHandle prev = entry.get();
|
||||
if (prev != null) {
|
||||
return prev;
|
||||
}
|
||||
}
|
||||
methodHandles[which] = new SoftReference<>(mh);
|
||||
return mh;
|
||||
}
|
||||
|
||||
public LambdaForm cachedLambdaForm(int which) {
|
||||
assert(assertIsBasicType());
|
||||
return lambdaForms[which];
|
||||
SoftReference<LambdaForm> entry = lambdaForms[which];
|
||||
return (entry != null) ? entry.get() : null;
|
||||
}
|
||||
|
||||
synchronized public LambdaForm setCachedLambdaForm(int which, LambdaForm form) {
|
||||
// Simulate a CAS, to avoid racy duplication of results.
|
||||
LambdaForm prev = lambdaForms[which];
|
||||
if (prev != null) return prev;
|
||||
return lambdaForms[which] = form;
|
||||
SoftReference<LambdaForm> entry = lambdaForms[which];
|
||||
if (entry != null) {
|
||||
LambdaForm prev = entry.get();
|
||||
if (prev != null) {
|
||||
return prev;
|
||||
}
|
||||
}
|
||||
lambdaForms[which] = new SoftReference<>(form);
|
||||
return form;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -135,6 +148,7 @@ final class MethodTypeForm {
|
||||
* This MTF will stand for that type and all un-erased variations.
|
||||
* Eagerly compute some basic properties of the type, common to all variations.
|
||||
*/
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
protected MethodTypeForm(MethodType erasedType) {
|
||||
this.erasedType = erasedType;
|
||||
|
||||
@ -234,8 +248,8 @@ final class MethodTypeForm {
|
||||
|
||||
// Initialize caches, but only for basic types
|
||||
assert(basicType == erasedType);
|
||||
this.lambdaForms = new LambdaForm[LF_LIMIT];
|
||||
this.methodHandles = new MethodHandle[MH_LIMIT];
|
||||
this.lambdaForms = new SoftReference[LF_LIMIT];
|
||||
this.methodHandles = new SoftReference[MH_LIMIT];
|
||||
}
|
||||
|
||||
private static long pack(int a, int b, int c, int d) {
|
||||
@ -409,5 +423,4 @@ final class MethodTypeForm {
|
||||
public String toString() {
|
||||
return "Form"+erasedType;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -140,13 +140,6 @@ public class AccessibleObject implements AnnotatedElement {
|
||||
throw new SecurityException("Cannot make a java.lang.Class" +
|
||||
" constructor accessible");
|
||||
}
|
||||
} else if (obj instanceof Field && flag == true) {
|
||||
Field f = (Field)obj;
|
||||
if (f.getDeclaringClass() == Class.class &&
|
||||
f.getName().equals("classLoader")) {
|
||||
throw new SecurityException("Cannot make java.lang.Class.classLoader" +
|
||||
" accessible");
|
||||
}
|
||||
}
|
||||
obj.override = flag;
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ public abstract
|
||||
class Authenticator {
|
||||
|
||||
// The system-wide authenticator object. See setDefault().
|
||||
private static Authenticator theAuthenticator;
|
||||
private static volatile Authenticator theAuthenticator;
|
||||
|
||||
private String requestingHost;
|
||||
private InetAddress requestingSite;
|
||||
|
@ -771,6 +771,7 @@ class DatagramSocket implements java.io.Closeable {
|
||||
} // end of while
|
||||
}
|
||||
}
|
||||
DatagramPacket tmp = null;
|
||||
if ((connectState == ST_CONNECTED_NO_IMPL) || explicitFilter) {
|
||||
// We have to do the filtering the old fashioned way since
|
||||
// the native impl doesn't support connect or the connect
|
||||
@ -795,11 +796,13 @@ class DatagramSocket implements java.io.Closeable {
|
||||
if ((!connectedAddress.equals(peekAddress)) ||
|
||||
(connectedPort != peekPort)) {
|
||||
// throw the packet away and silently continue
|
||||
DatagramPacket tmp = new DatagramPacket(
|
||||
tmp = new DatagramPacket(
|
||||
new byte[1024], 1024);
|
||||
getImpl().receive(tmp);
|
||||
if (explicitFilter) {
|
||||
bytesLeftToFilter -= tmp.getLength();
|
||||
if (checkFiltering(tmp)) {
|
||||
stop = true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
stop = true;
|
||||
@ -809,18 +812,22 @@ class DatagramSocket implements java.io.Closeable {
|
||||
// If the security check succeeds, or the datagram is
|
||||
// connected then receive the packet
|
||||
getImpl().receive(p);
|
||||
if (explicitFilter) {
|
||||
bytesLeftToFilter -= p.getLength();
|
||||
if (bytesLeftToFilter <= 0) {
|
||||
explicitFilter = false;
|
||||
} else {
|
||||
// break out of filter, if there is no more data queued
|
||||
explicitFilter = getImpl().dataAvailable() > 0;
|
||||
}
|
||||
if (explicitFilter && tmp == null) {
|
||||
// packet was not filtered, account for it here
|
||||
checkFiltering(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean checkFiltering(DatagramPacket p) throws SocketException {
|
||||
bytesLeftToFilter -= p.getLength();
|
||||
if (bytesLeftToFilter <= 0 || getImpl().dataAvailable() <= 0) {
|
||||
explicitFilter = false;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the local address to which the socket is bound.
|
||||
*
|
||||
|
@ -198,7 +198,7 @@ public abstract class AbstractInterruptibleChannel
|
||||
blockedOn(null);
|
||||
Thread interrupted = this.interrupted;
|
||||
if (interrupted != null && interrupted == Thread.currentThread()) {
|
||||
interrupted = null;
|
||||
this.interrupted = null;
|
||||
throw new ClosedByInterruptException();
|
||||
}
|
||||
if (!completed && !open)
|
||||
|
@ -1778,7 +1778,7 @@ public final class Files {
|
||||
* @param options
|
||||
* options indicating how symbolic links are handled
|
||||
*
|
||||
* @return the {@code path} parameter
|
||||
* @return the given path
|
||||
*
|
||||
* @throws UnsupportedOperationException
|
||||
* if the attribute view is not available
|
||||
@ -2019,7 +2019,7 @@ public final class Files {
|
||||
* @param perms
|
||||
* The new set of permissions
|
||||
*
|
||||
* @return The path
|
||||
* @return The given path
|
||||
*
|
||||
* @throws UnsupportedOperationException
|
||||
* if the associated file system does not support the {@code
|
||||
@ -2102,7 +2102,7 @@ public final class Files {
|
||||
* @param owner
|
||||
* The new file owner
|
||||
*
|
||||
* @return The path
|
||||
* @return The given path
|
||||
*
|
||||
* @throws UnsupportedOperationException
|
||||
* if the associated file system does not support the {@code
|
||||
@ -2289,14 +2289,14 @@ public final class Files {
|
||||
* @param time
|
||||
* the new last modified time
|
||||
*
|
||||
* @return the path
|
||||
* @return the given path
|
||||
*
|
||||
* @throws IOException
|
||||
* if an I/O error occurs
|
||||
* @throws SecurityException
|
||||
* In the case of the default provider, the security manager's {@link
|
||||
* SecurityManager#checkWrite(String) checkWrite} method is invoked
|
||||
* to check write access to file
|
||||
* In the case of the default provider, and a security manager is
|
||||
* installed, its {@link SecurityManager#checkWrite(String)
|
||||
* checkWrite} method denies write access to the file.
|
||||
*
|
||||
* @see BasicFileAttributeView#setTimes
|
||||
*/
|
||||
@ -2304,7 +2304,7 @@ public final class Files {
|
||||
throws IOException
|
||||
{
|
||||
getFileAttributeView(path, BasicFileAttributeView.class)
|
||||
.setTimes(time, null, null);
|
||||
.setTimes(Objects.requireNonNull(time), null, null);
|
||||
return path;
|
||||
}
|
||||
|
||||
|
@ -325,7 +325,7 @@ public interface Path
|
||||
*
|
||||
* @return the resulting path or this path if it does not contain
|
||||
* redundant name elements; an empty path is returned if this path
|
||||
* does have a root component and all name elements are redundant
|
||||
* does not have a root component and all name elements are redundant
|
||||
*
|
||||
* @see #getParent
|
||||
* @see #toRealPath
|
||||
|
@ -416,7 +416,8 @@ public class KeyStore {
|
||||
|
||||
/**
|
||||
* Retrieves the attributes associated with an entry.
|
||||
* <p>
|
||||
*
|
||||
* @implSpec
|
||||
* The default implementation returns an empty {@code Set}.
|
||||
*
|
||||
* @return an unmodifiable {@code Set} of attributes, possibly empty
|
||||
|
@ -74,7 +74,8 @@ public interface Principal {
|
||||
/**
|
||||
* Returns true if the specified subject is implied by this principal.
|
||||
*
|
||||
* <p>The default implementation of this method returns true if
|
||||
* @implSpec
|
||||
* The default implementation of this method returns true if
|
||||
* {@code subject} is non-null and contains at least one principal that
|
||||
* is equal to this principal.
|
||||
*
|
||||
|
@ -48,21 +48,18 @@ import java.text.AttributedCharacterIterator.Attribute;
|
||||
*/
|
||||
|
||||
public class AttributedString {
|
||||
|
||||
// since there are no vectors of int, we have to use arrays.
|
||||
// We allocate them in chunks of 10 elements so we don't have to allocate all the time.
|
||||
private static final int ARRAY_SIZE_INCREMENT = 10;
|
||||
|
||||
// field holding the text
|
||||
String text;
|
||||
|
||||
// fields holding run attribute information
|
||||
// run attributes are organized by run
|
||||
int runArraySize; // current size of the arrays
|
||||
int runCount; // actual number of runs, <= runArraySize
|
||||
int runStarts[]; // start index for each run
|
||||
Vector<Attribute> runAttributes[]; // vector of attribute keys for each run
|
||||
Vector<Object> runAttributeValues[]; // parallel vector of attribute values for each run
|
||||
// Fields holding run attribute information.
|
||||
// Run attributes are organized by run.
|
||||
// Arrays are always of equal lengths (the current capacity).
|
||||
// Since there are no vectors of int, we have to use arrays.
|
||||
private static final int INITIAL_CAPACITY = 10;
|
||||
int runCount; // actual number of runs, <= current capacity
|
||||
int[] runStarts; // start index for each run
|
||||
Vector<Attribute>[] runAttributes; // vector of attribute keys for each run
|
||||
Vector<Object>[] runAttributeValues; // parallel vector of attribute values for each run
|
||||
|
||||
/**
|
||||
* Constructs an AttributedString instance with the given
|
||||
@ -416,18 +413,17 @@ public class AttributedString {
|
||||
|
||||
private final void createRunAttributeDataVectors() {
|
||||
// use temporary variables so things remain consistent in case of an exception
|
||||
int newRunStarts[] = new int[ARRAY_SIZE_INCREMENT];
|
||||
int[] newRunStarts = new int[INITIAL_CAPACITY];
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
Vector<Attribute> newRunAttributes[] = (Vector<Attribute>[]) new Vector<?>[ARRAY_SIZE_INCREMENT];
|
||||
Vector<Attribute>[] newRunAttributes = (Vector<Attribute>[]) new Vector<?>[INITIAL_CAPACITY];
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
Vector<Object> newRunAttributeValues[] = (Vector<Object>[]) new Vector<?>[ARRAY_SIZE_INCREMENT];
|
||||
Vector<Object>[] newRunAttributeValues = (Vector<Object>[]) new Vector<?>[INITIAL_CAPACITY];
|
||||
|
||||
runStarts = newRunStarts;
|
||||
runAttributes = newRunAttributes;
|
||||
runAttributeValues = newRunAttributeValues;
|
||||
runArraySize = ARRAY_SIZE_INCREMENT;
|
||||
runCount = 1; // assume initial run starting at index 0
|
||||
}
|
||||
|
||||
@ -465,25 +461,22 @@ public class AttributedString {
|
||||
|
||||
// we'll have to break up a run
|
||||
// first, make sure we have enough space in our arrays
|
||||
if (runCount == runArraySize) {
|
||||
int newArraySize = runArraySize + ARRAY_SIZE_INCREMENT;
|
||||
int newRunStarts[] = new int[newArraySize];
|
||||
int currentCapacity = runStarts.length;
|
||||
if (runCount == currentCapacity) {
|
||||
// We need to resize - we grow capacity by 25%.
|
||||
int newCapacity = currentCapacity + (currentCapacity >> 2);
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
Vector<Attribute> newRunAttributes[] = (Vector<Attribute>[]) new Vector<?>[newArraySize];
|
||||
// use temporary variables so things remain consistent in case of an exception
|
||||
int[] newRunStarts =
|
||||
Arrays.copyOf(runStarts, newCapacity);
|
||||
Vector<Attribute>[] newRunAttributes =
|
||||
Arrays.copyOf(runAttributes, newCapacity);
|
||||
Vector<Object>[] newRunAttributeValues =
|
||||
Arrays.copyOf(runAttributeValues, newCapacity);
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
Vector<Object> newRunAttributeValues[] = (Vector<Object>[]) new Vector<?>[newArraySize];
|
||||
|
||||
for (int i = 0; i < runArraySize; i++) {
|
||||
newRunStarts[i] = runStarts[i];
|
||||
newRunAttributes[i] = runAttributes[i];
|
||||
newRunAttributeValues[i] = runAttributeValues[i];
|
||||
}
|
||||
runStarts = newRunStarts;
|
||||
runAttributes = newRunAttributes;
|
||||
runAttributeValues = newRunAttributeValues;
|
||||
runArraySize = newArraySize;
|
||||
}
|
||||
|
||||
// make copies of the attribute information of the old run that the new one used to be part of
|
||||
|
@ -2624,10 +2624,11 @@ public final class Formatter implements Closeable, Flushable {
|
||||
private boolean dt = false;
|
||||
private char c;
|
||||
|
||||
private int index(String s) {
|
||||
if (s != null) {
|
||||
private int index(String s, int start, int end) {
|
||||
if (start >= 0) {
|
||||
try {
|
||||
index = Integer.parseInt(s.substring(0, s.length() - 1));
|
||||
// skip the trailing '$'
|
||||
index = Integer.parseInt(s, start, end - 1, 10);
|
||||
} catch (NumberFormatException x) {
|
||||
assert(false);
|
||||
}
|
||||
@ -2648,11 +2649,11 @@ public final class Formatter implements Closeable, Flushable {
|
||||
return f;
|
||||
}
|
||||
|
||||
private int width(String s) {
|
||||
private int width(String s, int start, int end) {
|
||||
width = -1;
|
||||
if (s != null) {
|
||||
if (start >= 0) {
|
||||
try {
|
||||
width = Integer.parseInt(s);
|
||||
width = Integer.parseInt(s, start, end, 10);
|
||||
if (width < 0)
|
||||
throw new IllegalFormatWidthException(width);
|
||||
} catch (NumberFormatException x) {
|
||||
@ -2662,12 +2663,12 @@ public final class Formatter implements Closeable, Flushable {
|
||||
return width;
|
||||
}
|
||||
|
||||
private int precision(String s) {
|
||||
private int precision(String s, int start, int end) {
|
||||
precision = -1;
|
||||
if (s != null) {
|
||||
if (start >= 0) {
|
||||
try {
|
||||
// remove the '.'
|
||||
precision = Integer.parseInt(s.substring(1));
|
||||
// skip the leading '.'
|
||||
precision = Integer.parseInt(s, start + 1, end, 10);
|
||||
if (precision < 0)
|
||||
throw new IllegalFormatPrecisionException(precision);
|
||||
} catch (NumberFormatException x) {
|
||||
@ -2695,23 +2696,19 @@ public final class Formatter implements Closeable, Flushable {
|
||||
}
|
||||
|
||||
FormatSpecifier(String s, Matcher m) {
|
||||
int idx = 1;
|
||||
index(s, m.start(1), m.end(1));
|
||||
flags(s, m.start(2), m.end(2));
|
||||
width(s, m.start(3), m.end(3));
|
||||
precision(s, m.start(4), m.end(4));
|
||||
|
||||
index(m.group(idx++));
|
||||
flags(s, m.start(idx), m.end(idx++));
|
||||
width(m.group(idx++));
|
||||
precision(m.group(idx++));
|
||||
|
||||
int tTStart = m.start(idx);
|
||||
int tTEnd = m.end(idx++);
|
||||
if (tTStart != -1 && tTEnd != -1) {
|
||||
int tTStart = m.start(5);
|
||||
if (tTStart >= 0) {
|
||||
dt = true;
|
||||
if (tTStart == tTEnd - 1 && s.charAt(tTStart) == 'T') {
|
||||
if (s.charAt(tTStart) == 'T') {
|
||||
f.add(Flags.UPPERCASE);
|
||||
}
|
||||
}
|
||||
|
||||
conversion(s.charAt(m.start(idx)));
|
||||
conversion(s.charAt(m.start(6)));
|
||||
|
||||
if (dt)
|
||||
checkDateTime();
|
||||
|
@ -25,7 +25,6 @@
|
||||
|
||||
package java.util;
|
||||
|
||||
import java.net.NetworkInterface;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
import java.util.function.IntConsumer;
|
||||
import java.util.function.LongConsumer;
|
||||
@ -140,11 +139,10 @@ public final class SplittableRandom {
|
||||
* other cases, this split must be performed in a thread-safe
|
||||
* manner, so we use an AtomicLong to represent the seed rather
|
||||
* than use an explicit SplittableRandom. To bootstrap the
|
||||
* defaultGen, we start off using a seed based on current time and
|
||||
* network interface address unless the java.util.secureRandomSeed
|
||||
* property is set. This serves as a slimmed-down (and insecure)
|
||||
* variant of SecureRandom that also avoids stalls that may occur
|
||||
* when using /dev/random.
|
||||
* defaultGen, we start off using a seed based on current time
|
||||
* unless the java.util.secureRandomSeed property is set. This
|
||||
* serves as a slimmed-down (and insecure) variant of SecureRandom
|
||||
* that also avoids stalls that may occur when using /dev/random.
|
||||
*
|
||||
* It is a relatively simple matter to apply the basic design here
|
||||
* to use 128 bit seeds. However, emulating 128bit arithmetic and
|
||||
@ -237,34 +235,7 @@ public final class SplittableRandom {
|
||||
s = (s << 8) | ((long)(seedBytes[i]) & 0xffL);
|
||||
return s;
|
||||
}
|
||||
long h = 0L;
|
||||
try {
|
||||
Enumeration<NetworkInterface> ifcs =
|
||||
NetworkInterface.getNetworkInterfaces();
|
||||
boolean retry = false; // retry once if getHardwareAddress is null
|
||||
while (ifcs.hasMoreElements()) {
|
||||
NetworkInterface ifc = ifcs.nextElement();
|
||||
if (!ifc.isVirtual()) { // skip fake addresses
|
||||
byte[] bs = ifc.getHardwareAddress();
|
||||
if (bs != null) {
|
||||
int n = bs.length;
|
||||
int m = Math.min(n >>> 1, 4);
|
||||
for (int i = 0; i < m; ++i)
|
||||
h = (h << 16) ^ (bs[i] << 8) ^ bs[n-1-i];
|
||||
if (m < 4)
|
||||
h = (h << 8) ^ bs[n-1-m];
|
||||
h = mix64(h);
|
||||
break;
|
||||
}
|
||||
else if (!retry)
|
||||
retry = true;
|
||||
else
|
||||
break;
|
||||
}
|
||||
}
|
||||
} catch (Exception ignore) {
|
||||
}
|
||||
return (h ^ mix64(System.currentTimeMillis()) ^
|
||||
return (mix64(System.currentTimeMillis()) ^
|
||||
mix64(System.nanoTime()));
|
||||
}
|
||||
|
||||
|
@ -36,8 +36,6 @@
|
||||
package java.util.concurrent;
|
||||
|
||||
import java.io.ObjectStreamField;
|
||||
import java.net.NetworkInterface;
|
||||
import java.util.Enumeration;
|
||||
import java.util.Random;
|
||||
import java.util.Spliterator;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
@ -147,34 +145,7 @@ public class ThreadLocalRandom extends Random {
|
||||
s = (s << 8) | ((long)(seedBytes[i]) & 0xffL);
|
||||
return s;
|
||||
}
|
||||
long h = 0L;
|
||||
try {
|
||||
Enumeration<NetworkInterface> ifcs =
|
||||
NetworkInterface.getNetworkInterfaces();
|
||||
boolean retry = false; // retry once if getHardwareAddress is null
|
||||
while (ifcs.hasMoreElements()) {
|
||||
NetworkInterface ifc = ifcs.nextElement();
|
||||
if (!ifc.isVirtual()) { // skip fake addresses
|
||||
byte[] bs = ifc.getHardwareAddress();
|
||||
if (bs != null) {
|
||||
int n = bs.length;
|
||||
int m = Math.min(n >>> 1, 4);
|
||||
for (int i = 0; i < m; ++i)
|
||||
h = (h << 16) ^ (bs[i] << 8) ^ bs[n-1-i];
|
||||
if (m < 4)
|
||||
h = (h << 8) ^ bs[n-1-m];
|
||||
h = mix64(h);
|
||||
break;
|
||||
}
|
||||
else if (!retry)
|
||||
retry = true;
|
||||
else
|
||||
break;
|
||||
}
|
||||
}
|
||||
} catch (Exception ignore) {
|
||||
}
|
||||
return (h ^ mix64(System.currentTimeMillis()) ^
|
||||
return (mix64(System.currentTimeMillis()) ^
|
||||
mix64(System.nanoTime()));
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,7 @@ package java.util.jar;
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.Collection;
|
||||
@ -47,6 +47,9 @@ import sun.misc.ASCIICaseInsensitiveComparator;
|
||||
* <a href="../../../../technotes/guides/jar/jar.html">JAR File Specification</a>
|
||||
* for more information about valid attribute names and values.
|
||||
*
|
||||
* <p>This map and its views have a predictable iteration order, namely the
|
||||
* order that keys were inserted into the map, as with {@link LinkedHashMap}.
|
||||
*
|
||||
* @author David Connelly
|
||||
* @see Manifest
|
||||
* @since 1.2
|
||||
@ -71,7 +74,7 @@ public class Attributes implements Map<Object,Object>, Cloneable {
|
||||
* @param size the initial number of attributes
|
||||
*/
|
||||
public Attributes(int size) {
|
||||
map = new HashMap<>(size);
|
||||
map = new LinkedHashMap<>(size);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -81,7 +84,7 @@ public class Attributes implements Map<Object,Object>, Cloneable {
|
||||
* @param attr the specified Attributes
|
||||
*/
|
||||
public Attributes(Attributes attr) {
|
||||
map = new HashMap<>(attr);
|
||||
map = new LinkedHashMap<>(attr);
|
||||
}
|
||||
|
||||
|
||||
@ -295,6 +298,7 @@ public class Attributes implements Map<Object,Object>, Cloneable {
|
||||
* Writes the current attributes to the specified data output stream.
|
||||
* XXX Need to handle UTF8 values and break up lines longer than 72 bytes
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
void write(DataOutputStream os) throws IOException {
|
||||
for (Entry<Object, Object> e : entrySet()) {
|
||||
StringBuffer buffer = new StringBuffer(
|
||||
@ -322,6 +326,7 @@ public class Attributes implements Map<Object,Object>, Cloneable {
|
||||
*
|
||||
* XXX Need to handle UTF8 values and break up lines longer than 72 bytes
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
void writeMain(DataOutputStream out) throws IOException
|
||||
{
|
||||
// write out the *-Version header first, if it exists
|
||||
@ -364,6 +369,7 @@ public class Attributes implements Map<Object,Object>, Cloneable {
|
||||
* Reads attributes from the specified input stream.
|
||||
* XXX Need to handle UTF8 values.
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
void read(Manifest.FastInputStream is, byte[] lbuf) throws IOException {
|
||||
String name = null, value = null;
|
||||
byte[] lastline = null;
|
||||
|
@ -143,6 +143,7 @@ public class Manifest implements Cloneable {
|
||||
* @exception IOException if an I/O error has occurred
|
||||
* @see #getMainAttributes
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public void write(OutputStream out) throws IOException {
|
||||
DataOutputStream dos = new DataOutputStream(out);
|
||||
// Write out the main attributes for the manifest
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -34,9 +34,8 @@ import sun.nio.ch.DirectBuffer;
|
||||
* can be computed much faster.
|
||||
*
|
||||
* <p> Passing a {@code null} argument to a method in this class will cause
|
||||
* a {@link NullPointerException} to be thrown.
|
||||
* a {@link NullPointerException} to be thrown.</p>
|
||||
*
|
||||
* @see Checksum
|
||||
* @author David Connelly
|
||||
*/
|
||||
public
|
||||
@ -53,9 +52,8 @@ class Adler32 implements Checksum {
|
||||
/**
|
||||
* Updates the checksum with the specified byte (the low eight
|
||||
* bits of the argument b).
|
||||
*
|
||||
* @param b the byte to update the checksum with
|
||||
*/
|
||||
@Override
|
||||
public void update(int b) {
|
||||
adler = update(adler, b);
|
||||
}
|
||||
@ -63,11 +61,12 @@ class Adler32 implements Checksum {
|
||||
/**
|
||||
* Updates the checksum with the specified array of bytes.
|
||||
*
|
||||
* @throws ArrayIndexOutOfBoundsException
|
||||
* if {@code off} is negative, or {@code len} is negative,
|
||||
* or {@code off+len} is greater than the length of the
|
||||
* array {@code b}
|
||||
* @throws ArrayIndexOutOfBoundsException
|
||||
* if {@code off} is negative, or {@code len} is negative, or
|
||||
* {@code off+len} is negative or greater than the length of
|
||||
* the array {@code b}.
|
||||
*/
|
||||
@Override
|
||||
public void update(byte[] b, int off, int len) {
|
||||
if (b == null) {
|
||||
throw new NullPointerException();
|
||||
@ -78,29 +77,16 @@ class Adler32 implements Checksum {
|
||||
adler = updateBytes(adler, b, off, len);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the checksum with the specified array of bytes.
|
||||
*
|
||||
* @param b the byte array to update the checksum with
|
||||
*/
|
||||
public void update(byte[] b) {
|
||||
adler = updateBytes(adler, b, 0, b.length);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Updates the checksum with the bytes from the specified buffer.
|
||||
*
|
||||
* The checksum is updated using
|
||||
* buffer.{@link java.nio.Buffer#remaining() remaining()}
|
||||
* bytes starting at
|
||||
* buffer.{@link java.nio.Buffer#position() position()}
|
||||
* Upon return, the buffer's position will be updated to its
|
||||
* limit; its limit will not have been changed.
|
||||
* The checksum is updated with the remaining bytes in the buffer, starting
|
||||
* at the buffer's position. Upon return, the buffer's position will be
|
||||
* updated to its limit; its limit will not have been changed.
|
||||
*
|
||||
* @param buffer the ByteBuffer to update the checksum with
|
||||
* @since 1.8
|
||||
*/
|
||||
@Override
|
||||
public void update(ByteBuffer buffer) {
|
||||
int pos = buffer.position();
|
||||
int limit = buffer.limit();
|
||||
@ -113,9 +99,12 @@ class Adler32 implements Checksum {
|
||||
} else if (buffer.hasArray()) {
|
||||
adler = updateBytes(adler, buffer.array(), pos + buffer.arrayOffset(), rem);
|
||||
} else {
|
||||
byte[] b = new byte[rem];
|
||||
buffer.get(b);
|
||||
adler = updateBytes(adler, b, 0, b.length);
|
||||
byte[] b = new byte[Math.min(buffer.remaining(), 4096)];
|
||||
while (buffer.hasRemaining()) {
|
||||
int length = Math.min(buffer.remaining(), b.length);
|
||||
buffer.get(b, 0, length);
|
||||
update(b, 0, length);
|
||||
}
|
||||
}
|
||||
buffer.position(limit);
|
||||
}
|
||||
@ -123,6 +112,7 @@ class Adler32 implements Checksum {
|
||||
/**
|
||||
* Resets the checksum to initial value.
|
||||
*/
|
||||
@Override
|
||||
public void reset() {
|
||||
adler = 1;
|
||||
}
|
||||
@ -130,6 +120,7 @@ class Adler32 implements Checksum {
|
||||
/**
|
||||
* Returns the checksum value.
|
||||
*/
|
||||
@Override
|
||||
public long getValue() {
|
||||
return (long)adler & 0xffffffffL;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -32,9 +32,8 @@ import sun.nio.ch.DirectBuffer;
|
||||
* A class that can be used to compute the CRC-32 of a data stream.
|
||||
*
|
||||
* <p> Passing a {@code null} argument to a method in this class will cause
|
||||
* a {@link NullPointerException} to be thrown.
|
||||
* a {@link NullPointerException} to be thrown.</p>
|
||||
*
|
||||
* @see Checksum
|
||||
* @author David Connelly
|
||||
*/
|
||||
public
|
||||
@ -51,9 +50,8 @@ class CRC32 implements Checksum {
|
||||
/**
|
||||
* Updates the CRC-32 checksum with the specified byte (the low
|
||||
* eight bits of the argument b).
|
||||
*
|
||||
* @param b the byte to update the checksum with
|
||||
*/
|
||||
@Override
|
||||
public void update(int b) {
|
||||
crc = update(crc, b);
|
||||
}
|
||||
@ -61,11 +59,12 @@ class CRC32 implements Checksum {
|
||||
/**
|
||||
* Updates the CRC-32 checksum with the specified array of bytes.
|
||||
*
|
||||
* @throws ArrayIndexOutOfBoundsException
|
||||
* if {@code off} is negative, or {@code len} is negative,
|
||||
* or {@code off+len} is greater than the length of the
|
||||
* array {@code b}
|
||||
* @throws ArrayIndexOutOfBoundsException
|
||||
* if {@code off} is negative, or {@code len} is negative, or
|
||||
* {@code off+len} is negative or greater than the length of
|
||||
* the array {@code b}.
|
||||
*/
|
||||
@Override
|
||||
public void update(byte[] b, int off, int len) {
|
||||
if (b == null) {
|
||||
throw new NullPointerException();
|
||||
@ -77,27 +76,15 @@ class CRC32 implements Checksum {
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the CRC-32 checksum with the specified array of bytes.
|
||||
* Updates the CRC-32 checksum with the bytes from the specified buffer.
|
||||
*
|
||||
* @param b the array of bytes to update the checksum with
|
||||
*/
|
||||
public void update(byte[] b) {
|
||||
crc = updateBytes(crc, b, 0, b.length);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the checksum with the bytes from the specified buffer.
|
||||
* The checksum is updated with the remaining bytes in the buffer, starting
|
||||
* at the buffer's position. Upon return, the buffer's position will be
|
||||
* updated to its limit; its limit will not have been changed.
|
||||
*
|
||||
* The checksum is updated using
|
||||
* buffer.{@link java.nio.Buffer#remaining() remaining()}
|
||||
* bytes starting at
|
||||
* buffer.{@link java.nio.Buffer#position() position()}
|
||||
* Upon return, the buffer's position will
|
||||
* be updated to its limit; its limit will not have been changed.
|
||||
*
|
||||
* @param buffer the ByteBuffer to update the checksum with
|
||||
* @since 1.8
|
||||
*/
|
||||
@Override
|
||||
public void update(ByteBuffer buffer) {
|
||||
int pos = buffer.position();
|
||||
int limit = buffer.limit();
|
||||
@ -110,9 +97,12 @@ class CRC32 implements Checksum {
|
||||
} else if (buffer.hasArray()) {
|
||||
crc = updateBytes(crc, buffer.array(), pos + buffer.arrayOffset(), rem);
|
||||
} else {
|
||||
byte[] b = new byte[rem];
|
||||
buffer.get(b);
|
||||
crc = updateBytes(crc, b, 0, b.length);
|
||||
byte[] b = new byte[Math.min(buffer.remaining(), 4096)];
|
||||
while (buffer.hasRemaining()) {
|
||||
int length = Math.min(buffer.remaining(), b.length);
|
||||
buffer.get(b, 0, length);
|
||||
update(b, 0, length);
|
||||
}
|
||||
}
|
||||
buffer.position(limit);
|
||||
}
|
||||
@ -120,6 +110,7 @@ class CRC32 implements Checksum {
|
||||
/**
|
||||
* Resets CRC-32 to initial value.
|
||||
*/
|
||||
@Override
|
||||
public void reset() {
|
||||
crc = 0;
|
||||
}
|
||||
@ -127,6 +118,7 @@ class CRC32 implements Checksum {
|
||||
/**
|
||||
* Returns CRC-32 value.
|
||||
*/
|
||||
@Override
|
||||
public long getValue() {
|
||||
return (long)crc & 0xffffffffL;
|
||||
}
|
||||
|
340
jdk/src/java.base/share/classes/java/util/zip/CRC32C.java
Normal file
340
jdk/src/java.base/share/classes/java/util/zip/CRC32C.java
Normal file
@ -0,0 +1,340 @@
|
||||
/*
|
||||
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
package java.util.zip;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.ByteOrder;
|
||||
import sun.misc.Unsafe;
|
||||
import sun.nio.ch.DirectBuffer;
|
||||
|
||||
/**
|
||||
* A class that can be used to compute the CRC-32C of a data stream.
|
||||
*
|
||||
* <p>
|
||||
* CRC-32C is defined in <a href="http://www.ietf.org/rfc/rfc3720.txt">RFC
|
||||
* 3720</a>: Internet Small Computer Systems Interface (iSCSI).
|
||||
* </p>
|
||||
*
|
||||
* <p>
|
||||
* Passing a {@code null} argument to a method in this class will cause a
|
||||
* {@link NullPointerException} to be thrown.
|
||||
* </p>
|
||||
*
|
||||
* @since 1.9
|
||||
*/
|
||||
public final class CRC32C implements Checksum {
|
||||
|
||||
/*
|
||||
* This CRC-32C implementation uses the 'slicing-by-8' algorithm described
|
||||
* in the paper "A Systematic Approach to Building High Performance
|
||||
* Software-Based CRC Generators" by Michael E. Kounavis and Frank L. Berry,
|
||||
* Intel Research and Development
|
||||
*/
|
||||
|
||||
/**
|
||||
* CRC-32C Polynomial
|
||||
*/
|
||||
private static final int CRC32C_POLY = 0x1EDC6F41;
|
||||
private static final int REVERSED_CRC32C_POLY = Integer.reverse(CRC32C_POLY);
|
||||
|
||||
private static final Unsafe UNSAFE = Unsafe.getUnsafe();
|
||||
|
||||
// Lookup tables
|
||||
// Lookup table for single byte calculations
|
||||
private static final int[] byteTable;
|
||||
// Lookup tables for bulk operations in 'slicing-by-8' algorithm
|
||||
private static final int[][] byteTables = new int[8][256];
|
||||
private static final int[] byteTable0 = byteTables[0];
|
||||
private static final int[] byteTable1 = byteTables[1];
|
||||
private static final int[] byteTable2 = byteTables[2];
|
||||
private static final int[] byteTable3 = byteTables[3];
|
||||
private static final int[] byteTable4 = byteTables[4];
|
||||
private static final int[] byteTable5 = byteTables[5];
|
||||
private static final int[] byteTable6 = byteTables[6];
|
||||
private static final int[] byteTable7 = byteTables[7];
|
||||
|
||||
static {
|
||||
// Generate lookup tables
|
||||
// High-order polynomial term stored in LSB of r.
|
||||
for (int index = 0; index < byteTables[0].length; index++) {
|
||||
int r = index;
|
||||
for (int i = 0; i < Byte.SIZE; i++) {
|
||||
if ((r & 1) != 0) {
|
||||
r = (r >>> 1) ^ REVERSED_CRC32C_POLY;
|
||||
} else {
|
||||
r >>>= 1;
|
||||
}
|
||||
}
|
||||
byteTables[0][index] = r;
|
||||
}
|
||||
|
||||
for (int index = 0; index < byteTables[0].length; index++) {
|
||||
int r = byteTables[0][index];
|
||||
|
||||
for (int k = 1; k < byteTables.length; k++) {
|
||||
r = byteTables[0][r & 0xFF] ^ (r >>> 8);
|
||||
byteTables[k][index] = r;
|
||||
}
|
||||
}
|
||||
|
||||
if (ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN) {
|
||||
byteTable = byteTables[0];
|
||||
} else { // ByteOrder.BIG_ENDIAN
|
||||
byteTable = new int[byteTable0.length];
|
||||
System.arraycopy(byteTable0, 0, byteTable, 0, byteTable0.length);
|
||||
for (int[] table : byteTables) {
|
||||
for (int index = 0; index < table.length; index++) {
|
||||
table[index] = Integer.reverseBytes(table[index]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculated CRC-32C value
|
||||
*/
|
||||
private int crc = 0xFFFFFFFF;
|
||||
|
||||
/**
|
||||
* Creates a new CRC32C object.
|
||||
*/
|
||||
public CRC32C() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the CRC-32C checksum with the specified byte (the low eight bits
|
||||
* of the argument b).
|
||||
*/
|
||||
@Override
|
||||
public void update(int b) {
|
||||
crc = (crc >>> 8) ^ byteTable[(crc ^ (b & 0xFF)) & 0xFF];
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the CRC-32C checksum with the specified array of bytes.
|
||||
*
|
||||
* @throws ArrayIndexOutOfBoundsException
|
||||
* if {@code off} is negative, or {@code len} is negative, or
|
||||
* {@code off+len} is negative or greater than the length of
|
||||
* the array {@code b}.
|
||||
*/
|
||||
@Override
|
||||
public void update(byte[] b, int off, int len) {
|
||||
if (b == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
if (off < 0 || len < 0 || off > b.length - len) {
|
||||
throw new ArrayIndexOutOfBoundsException();
|
||||
}
|
||||
crc = updateBytes(crc, b, off, (off + len));
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the CRC-32C checksum with the bytes from the specified buffer.
|
||||
*
|
||||
* The checksum is updated with the remaining bytes in the buffer, starting
|
||||
* at the buffer's position. Upon return, the buffer's position will be
|
||||
* updated to its limit; its limit will not have been changed.
|
||||
*/
|
||||
@Override
|
||||
public void update(ByteBuffer buffer) {
|
||||
int pos = buffer.position();
|
||||
int limit = buffer.limit();
|
||||
assert (pos <= limit);
|
||||
int rem = limit - pos;
|
||||
if (rem <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (buffer instanceof DirectBuffer) {
|
||||
crc = updateDirectByteBuffer(crc, ((DirectBuffer) buffer).address(),
|
||||
pos, limit);
|
||||
} else if (buffer.hasArray()) {
|
||||
crc = updateBytes(crc, buffer.array(), pos + buffer.arrayOffset(),
|
||||
limit + buffer.arrayOffset());
|
||||
} else {
|
||||
byte[] b = new byte[Math.min(buffer.remaining(), 4096)];
|
||||
while (buffer.hasRemaining()) {
|
||||
int length = Math.min(buffer.remaining(), b.length);
|
||||
buffer.get(b, 0, length);
|
||||
update(b, 0, length);
|
||||
}
|
||||
}
|
||||
buffer.position(limit);
|
||||
}
|
||||
|
||||
/**
|
||||
* Resets CRC-32C to initial value.
|
||||
*/
|
||||
@Override
|
||||
public void reset() {
|
||||
crc = 0xFFFFFFFF;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns CRC-32C value.
|
||||
*/
|
||||
@Override
|
||||
public long getValue() {
|
||||
return (~crc) & 0xFFFFFFFFL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the CRC-32C checksum with the specified array of bytes.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Unsafe.{getInt, getLong}
|
||||
private static int updateBytes(int crc, byte[] b, int off, int end) {
|
||||
|
||||
// Do only byte reads for arrays so short they can't be aligned
|
||||
// or if bytes are stored with a larger witdh than one byte.,%
|
||||
if (end - off >= 8 && Unsafe.ARRAY_BYTE_INDEX_SCALE == 1) {
|
||||
|
||||
// align on 8 bytes
|
||||
int alignLength
|
||||
= (8 - ((Unsafe.ARRAY_BYTE_BASE_OFFSET + off) & 0x7)) & 0x7;
|
||||
for (int alignEnd = off + alignLength; off < alignEnd; off++) {
|
||||
crc = (crc >>> 8) ^ byteTable[(crc ^ b[off]) & 0xFF];
|
||||
}
|
||||
|
||||
if (ByteOrder.nativeOrder() == ByteOrder.BIG_ENDIAN) {
|
||||
crc = Integer.reverseBytes(crc);
|
||||
}
|
||||
|
||||
// slicing-by-8
|
||||
for (; off < (end - Long.BYTES); off += Long.BYTES) {
|
||||
int firstHalf;
|
||||
int secondHalf;
|
||||
if (Unsafe.ADDRESS_SIZE == 4) {
|
||||
// On 32 bit platforms read two ints instead of a single 64bit long
|
||||
firstHalf = UNSAFE.getInt(b, Unsafe.ARRAY_BYTE_BASE_OFFSET + off);
|
||||
secondHalf = UNSAFE.getInt(b, Unsafe.ARRAY_BYTE_BASE_OFFSET + off
|
||||
+ Integer.BYTES);
|
||||
} else {
|
||||
long value = UNSAFE.getLong(b, Unsafe.ARRAY_BYTE_BASE_OFFSET + off);
|
||||
if (ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN) {
|
||||
firstHalf = (int) value;
|
||||
secondHalf = (int) (value >>> 32);
|
||||
} else { // ByteOrder.BIG_ENDIAN
|
||||
firstHalf = (int) (value >>> 32);
|
||||
secondHalf = (int) value;
|
||||
}
|
||||
}
|
||||
crc ^= firstHalf;
|
||||
if (ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN) {
|
||||
crc = byteTable7[crc & 0xFF]
|
||||
^ byteTable6[(crc >>> 8) & 0xFF]
|
||||
^ byteTable5[(crc >>> 16) & 0xFF]
|
||||
^ byteTable4[crc >>> 24]
|
||||
^ byteTable3[secondHalf & 0xFF]
|
||||
^ byteTable2[(secondHalf >>> 8) & 0xFF]
|
||||
^ byteTable1[(secondHalf >>> 16) & 0xFF]
|
||||
^ byteTable0[secondHalf >>> 24];
|
||||
} else { // ByteOrder.BIG_ENDIAN
|
||||
crc = byteTable0[secondHalf & 0xFF]
|
||||
^ byteTable1[(secondHalf >>> 8) & 0xFF]
|
||||
^ byteTable2[(secondHalf >>> 16) & 0xFF]
|
||||
^ byteTable3[secondHalf >>> 24]
|
||||
^ byteTable4[crc & 0xFF]
|
||||
^ byteTable5[(crc >>> 8) & 0xFF]
|
||||
^ byteTable6[(crc >>> 16) & 0xFF]
|
||||
^ byteTable7[crc >>> 24];
|
||||
}
|
||||
}
|
||||
|
||||
if (ByteOrder.nativeOrder() == ByteOrder.BIG_ENDIAN) {
|
||||
crc = Integer.reverseBytes(crc);
|
||||
}
|
||||
}
|
||||
|
||||
// Tail
|
||||
for (; off < end; off++) {
|
||||
crc = (crc >>> 8) ^ byteTable[(crc ^ b[off]) & 0xFF];
|
||||
}
|
||||
|
||||
return crc;
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the CRC-32C checksum reading from the specified address.
|
||||
*/
|
||||
private static int updateDirectByteBuffer(int crc, long address,
|
||||
int off, int end) {
|
||||
|
||||
// Do only byte reads for arrays so short they can't be aligned
|
||||
if (end - off >= 8) {
|
||||
|
||||
// align on 8 bytes
|
||||
int alignLength = (8 - (int) ((address + off) & 0x7)) & 0x7;
|
||||
for (int alignEnd = off + alignLength; off < alignEnd; off++) {
|
||||
crc = (crc >>> 8)
|
||||
^ byteTable[(crc ^ UNSAFE.getByte(address + off)) & 0xFF];
|
||||
}
|
||||
|
||||
if (ByteOrder.nativeOrder() == ByteOrder.BIG_ENDIAN) {
|
||||
crc = Integer.reverseBytes(crc);
|
||||
}
|
||||
|
||||
// slicing-by-8
|
||||
for (; off <= (end - Long.BYTES); off += Long.BYTES) {
|
||||
// Always reading two ints as reading a long followed by
|
||||
// shifting and casting was slower.
|
||||
int firstHalf = UNSAFE.getInt(address + off);
|
||||
int secondHalf = UNSAFE.getInt(address + off + Integer.BYTES);
|
||||
crc ^= firstHalf;
|
||||
if (ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN) {
|
||||
crc = byteTable7[crc & 0xFF]
|
||||
^ byteTable6[(crc >>> 8) & 0xFF]
|
||||
^ byteTable5[(crc >>> 16) & 0xFF]
|
||||
^ byteTable4[crc >>> 24]
|
||||
^ byteTable3[secondHalf & 0xFF]
|
||||
^ byteTable2[(secondHalf >>> 8) & 0xFF]
|
||||
^ byteTable1[(secondHalf >>> 16) & 0xFF]
|
||||
^ byteTable0[secondHalf >>> 24];
|
||||
} else { // ByteOrder.BIG_ENDIAN
|
||||
crc = byteTable0[secondHalf & 0xFF]
|
||||
^ byteTable1[(secondHalf >>> 8) & 0xFF]
|
||||
^ byteTable2[(secondHalf >>> 16) & 0xFF]
|
||||
^ byteTable3[secondHalf >>> 24]
|
||||
^ byteTable4[crc & 0xFF]
|
||||
^ byteTable5[(crc >>> 8) & 0xFF]
|
||||
^ byteTable6[(crc >>> 16) & 0xFF]
|
||||
^ byteTable7[crc >>> 24];
|
||||
}
|
||||
}
|
||||
|
||||
if (ByteOrder.nativeOrder() == ByteOrder.BIG_ENDIAN) {
|
||||
crc = Integer.reverseBytes(crc);
|
||||
}
|
||||
}
|
||||
|
||||
// Tail
|
||||
for (; off < end; off++) {
|
||||
crc = (crc >>> 8)
|
||||
^ byteTable[(crc ^ UNSAFE.getByte(address + off)) & 0xFF];
|
||||
}
|
||||
|
||||
return crc;
|
||||
}
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1996, 1999, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -22,16 +22,17 @@
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package java.util.zip;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
/**
|
||||
* An interface representing a data checksum.
|
||||
*
|
||||
* @author David Connelly
|
||||
* @author David Connelly
|
||||
*/
|
||||
public
|
||||
interface Checksum {
|
||||
public interface Checksum {
|
||||
|
||||
/**
|
||||
* Updates the current checksum with the specified byte.
|
||||
*
|
||||
@ -41,14 +42,89 @@ interface Checksum {
|
||||
|
||||
/**
|
||||
* Updates the current checksum with the specified array of bytes.
|
||||
*
|
||||
* @implSpec This default implementation is equal to calling
|
||||
* {@code update(b, 0, b.length)}.
|
||||
*
|
||||
* @param b the array of bytes to update the checksum with
|
||||
*
|
||||
* @throws NullPointerException
|
||||
* if {@code b} is {@code null}
|
||||
*
|
||||
* @since 1.9
|
||||
*/
|
||||
default public void update(byte[] b) {
|
||||
update(b, 0, b.length);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the current checksum with the specified array of bytes.
|
||||
*
|
||||
* @param b the byte array to update the checksum with
|
||||
* @param off the start offset of the data
|
||||
* @param len the number of bytes to use for the update
|
||||
*/
|
||||
public void update(byte[] b, int off, int len);
|
||||
|
||||
/**
|
||||
* Updates the current checksum with the bytes from the specified buffer.
|
||||
*
|
||||
* The checksum is updated with the remaining bytes in the buffer, starting
|
||||
* at the buffer's position. Upon return, the buffer's position will be
|
||||
* updated to its limit; its limit will not have been changed.
|
||||
*
|
||||
* @apiNote For best performance with DirectByteBuffer and other ByteBuffer
|
||||
* implementations without a backing array implementers of this interface
|
||||
* should override this method.
|
||||
*
|
||||
* @implSpec The default implementation has the following behavior.<br>
|
||||
* For ByteBuffers backed by an accessible byte array.
|
||||
* <pre>{@code
|
||||
* update(buffer.array(),
|
||||
* buffer.position() + buffer.arrayOffset(),
|
||||
* buffer.remaining());
|
||||
* }</pre>
|
||||
* For ByteBuffers not backed by an accessible byte array.
|
||||
* <pre>{@code
|
||||
* byte[] b = new byte[Math.min(buffer.remaining(), 4096)];
|
||||
* while (buffer.hasRemaining()) {
|
||||
* int length = Math.min(buffer.remaining(), b.length);
|
||||
* buffer.get(b, 0, length);
|
||||
* update(b, 0, length);
|
||||
* }
|
||||
* }</pre>
|
||||
*
|
||||
* @param buffer the ByteBuffer to update the checksum with
|
||||
*
|
||||
* @throws NullPointerException
|
||||
* if {@code buffer} is {@code null}
|
||||
*
|
||||
* @since 1.9
|
||||
*/
|
||||
default public void update(ByteBuffer buffer) {
|
||||
int pos = buffer.position();
|
||||
int limit = buffer.limit();
|
||||
assert (pos <= limit);
|
||||
int rem = limit - pos;
|
||||
if (rem <= 0) {
|
||||
return;
|
||||
}
|
||||
if (buffer.hasArray()) {
|
||||
update(buffer.array(), pos + buffer.arrayOffset(), rem);
|
||||
} else {
|
||||
byte[] b = new byte[Math.min(buffer.remaining(), 4096)];
|
||||
while (buffer.hasRemaining()) {
|
||||
int length = Math.min(buffer.remaining(), b.length);
|
||||
buffer.get(b, 0, length);
|
||||
update(b, 0, length);
|
||||
}
|
||||
}
|
||||
buffer.position(limit);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the current checksum value.
|
||||
*
|
||||
* @return the current checksum value
|
||||
*/
|
||||
public long getValue();
|
||||
|
@ -0,0 +1,77 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Provides classes for reading and writing the standard ZIP and GZIP file
|
||||
* formats. Also includes classes for compressing and decompressing data using
|
||||
* the DEFLATE compression algorithm, which is used by the ZIP and GZIP file
|
||||
* formats. Additionally, there are utility classes for computing the CRC-32,
|
||||
* CRC-32C and Adler-32 checksums of arbitrary input streams.
|
||||
*
|
||||
* <h2>Package Specification</h2>
|
||||
*
|
||||
* <ul>
|
||||
* <li><a href="http://www.info-zip.org/doc/appnote-19970311-iz.zip">
|
||||
* Info-ZIP Application Note 970311</a> - a detailed description of
|
||||
* the Info-ZIP format upon which the {@code java.util.zip} classes
|
||||
* are based.
|
||||
* <li><a name="zip64">An implementation may optionally support the
|
||||
* ZIP64(tm) format extensions defined by the</a>
|
||||
* <a href="http://www.pkware.com/documents/casestudies/APPNOTE.TXT">
|
||||
* PKWARE ZIP File Format Specification</a>. The ZIP64(tm) format
|
||||
* extensions are used to overcome the size limitations of the
|
||||
* original ZIP format.
|
||||
* <li><a name="lang_encoding">APPENDIX D of</a>
|
||||
* <a href="http://www.pkware.com/documents/casestudies/APPNOTE.TXT">
|
||||
* PKWARE ZIP File Format Specification</a> - Language Encoding Flag
|
||||
* (EFS) to encode ZIP entry filename and comment fields using UTF-8.
|
||||
* <li><a href="http://www.ietf.org/rfc/rfc1950.txt">
|
||||
* ZLIB Compressed Data Format Specification version 3.3</a>
|
||||
*
|
||||
* <a href="http://www.ietf.org/rfc/rfc1950.txt.pdf">(pdf)</a>
|
||||
* (RFC 1950)
|
||||
* <li><a href="http://www.ietf.org/rfc/rfc1951.txt">
|
||||
* DEFLATE Compressed Data Format Specification version 1.3</a>
|
||||
*
|
||||
* <a href="http://www.ietf.org/rfc/rfc1951.txt.pdf">(pdf)</a>
|
||||
* (RFC 1951)
|
||||
* <li><a href="http://www.ietf.org/rfc/rfc1952.txt">
|
||||
* GZIP file format specification version 4.3</a>
|
||||
*
|
||||
* <a href="http://www.ietf.org/rfc/rfc1952.txt.pdf">(pdf)</a>
|
||||
* (RFC 1952)
|
||||
* <li>CRC-32 checksum is described in RFC 1952 (above)
|
||||
* <li>CRC-32C checksum is described in
|
||||
* <a href="http://www.ietf.org/rfc/rfc3720.txt">Internet Small
|
||||
* Computer Systems Interface (iSCSI)</a>
|
||||
*
|
||||
* <a href="http://www.ietf.org/rfc/rfc3720.txt.pdf">(pdf)</a>
|
||||
* (RFC 3720)
|
||||
* <li>Adler-32 checksum is described in RFC 1950 (above)
|
||||
* </ul>
|
||||
*
|
||||
* @since 1.1
|
||||
*/
|
||||
package java.util.zip;
|
@ -1,88 +0,0 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
||||
<html>
|
||||
<head>
|
||||
<!--
|
||||
Copyright (c) 1998, 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.
|
||||
-->
|
||||
|
||||
</head>
|
||||
<body bgcolor="white">
|
||||
|
||||
Provides classes for reading and writing the standard ZIP and GZIP
|
||||
file formats. Also includes classes for compressing and decompressing
|
||||
data using the DEFLATE compression algorithm, which is used by the
|
||||
ZIP and GZIP file formats. Additionally, there are utility classes
|
||||
for computing the CRC-32 and Adler-32 checksums of arbitrary
|
||||
input streams.
|
||||
|
||||
|
||||
<h2>Package Specification</h2>
|
||||
|
||||
<ul>
|
||||
<li><a href="http://www.info-zip.org/doc/appnote-19970311-iz.zip">
|
||||
Info-ZIP Application Note 970311
|
||||
</a> - a detailed description of the Info-ZIP format upon which
|
||||
the <code>java.util.zip</code> classes are based.
|
||||
<li><a name="zip64">An implementation may optionally support the ZIP64(tm) format extensions
|
||||
defined by the </a>
|
||||
<a href="http://www.pkware.com/documents/casestudies/APPNOTE.TXT">
|
||||
PKWARE ZIP File Format Specification</a>. The ZIP64(tm) format extensions
|
||||
are used to overcome the size limitations of the original ZIP format.
|
||||
<li><a name="lang_encoding">APPENDIX D of </a><a href="http://www.pkware.com/documents/casestudies/APPNOTE.TXT">
|
||||
PKWARE ZIP File Format Specification</a> - Language Encoding Flag (EFS) to
|
||||
encode ZIP entry filename and comment fields using UTF-8.
|
||||
<li><a href="http://www.ietf.org/rfc/rfc1950.txt">
|
||||
ZLIB Compressed Data Format Specification version 3.3</a>
|
||||
|
||||
<a href="http://www.ietf.org/rfc/rfc1950.txt.pdf">(pdf)</a>
|
||||
(RFC 1950)
|
||||
<li><a href="http://www.ietf.org/rfc/rfc1951.txt">
|
||||
DEFLATE Compressed Data Format Specification version 1.3</a>
|
||||
|
||||
<a href="http://www.ietf.org/rfc/rfc1951.txt.pdf">(pdf)</a>
|
||||
(RFC 1951)
|
||||
<li><a href="http://www.ietf.org/rfc/rfc1952.txt">
|
||||
GZIP file format specification version 4.3</a>
|
||||
|
||||
<a href="http://www.ietf.org/rfc/rfc1952.txt.pdf">(pdf)</a>
|
||||
(RFC 1952)
|
||||
<li>CRC-32 checksum is described in RFC 1952 (above)
|
||||
<li>Adler-32 checksum is described in RFC 1950 (above)
|
||||
</ul>
|
||||
|
||||
|
||||
<!--
|
||||
<h2>Related Documentation</h2>
|
||||
|
||||
For overviews, tutorials, examples, guides, and tool documentation, please see:
|
||||
<ul>
|
||||
<li><a href="">##### REFER TO NON-SPEC DOCUMENTATION HERE #####</a>
|
||||
</ul>
|
||||
-->
|
||||
|
||||
@since 1.1
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -88,6 +88,8 @@ public class CipherInputStream extends FilterInputStream {
|
||||
private int ofinish = 0;
|
||||
// stream status
|
||||
private boolean closed = false;
|
||||
// The stream has been read from. False if the stream has never been read.
|
||||
private boolean read = false;
|
||||
|
||||
/**
|
||||
* private convenience function.
|
||||
@ -103,6 +105,7 @@ public class CipherInputStream extends FilterInputStream {
|
||||
private int getMoreData() throws IOException {
|
||||
if (done) return -1;
|
||||
int readin = input.read(ibuffer);
|
||||
read = true;
|
||||
if (readin == -1) {
|
||||
done = true;
|
||||
try {
|
||||
@ -306,7 +309,11 @@ public class CipherInputStream extends FilterInputStream {
|
||||
}
|
||||
}
|
||||
catch (BadPaddingException | IllegalBlockSizeException ex) {
|
||||
throw new IOException(ex);
|
||||
/* If no data has been read from the stream to be en/decrypted,
|
||||
we supress any exceptions, and close quietly. */
|
||||
if (read) {
|
||||
throw new IOException(ex);
|
||||
}
|
||||
}
|
||||
ostart = 0;
|
||||
ofinish = 0;
|
||||
|
@ -41,7 +41,7 @@ public interface Destroyable {
|
||||
* on this {@code Object} will result in an
|
||||
* {@code IllegalStateException} being thrown.
|
||||
*
|
||||
* <p>
|
||||
* @implSpec
|
||||
* The default implementation throws {@code DestroyFailedException}.
|
||||
*
|
||||
* @exception DestroyFailedException if the destroy operation fails. <p>
|
||||
@ -56,7 +56,7 @@ public interface Destroyable {
|
||||
/**
|
||||
* Determine if this {@code Object} has been destroyed.
|
||||
*
|
||||
* <p>
|
||||
* @implSpec
|
||||
* The default implementation returns false.
|
||||
*
|
||||
* @return true if this {@code Object} has been destroyed,
|
||||
|
@ -46,6 +46,7 @@ package sun.net.idn;
|
||||
* @stable ICU 2.1
|
||||
*/
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
final class UCharacterDirection implements UCharacterEnums.ECharacterDirection {
|
||||
|
||||
// private constructor =========================================
|
||||
|
@ -657,9 +657,10 @@ public class HttpClient extends NetworkClient {
|
||||
cachedHttpClient = false;
|
||||
if (!failedOnce && requests != null) {
|
||||
failedOnce = true;
|
||||
if (getRequestMethod().equals("CONNECT") ||
|
||||
(httpuc.getRequestMethod().equals("POST") &&
|
||||
(!retryPostProp || streaming))) {
|
||||
if (getRequestMethod().equals("CONNECT")
|
||||
|| streaming
|
||||
|| (httpuc.getRequestMethod().equals("POST")
|
||||
&& !retryPostProp)) {
|
||||
// do not retry the request
|
||||
} else {
|
||||
// try once more
|
||||
@ -769,9 +770,10 @@ public class HttpClient extends NetworkClient {
|
||||
} else if (nread != 8) {
|
||||
if (!failedOnce && requests != null) {
|
||||
failedOnce = true;
|
||||
if (getRequestMethod().equals("CONNECT") ||
|
||||
(httpuc.getRequestMethod().equals("POST") &&
|
||||
(!retryPostProp || streaming))) {
|
||||
if (getRequestMethod().equals("CONNECT")
|
||||
|| streaming
|
||||
|| (httpuc.getRequestMethod().equals("POST")
|
||||
&& !retryPostProp)) {
|
||||
// do not retry the request
|
||||
} else {
|
||||
closeServer();
|
||||
|
@ -752,7 +752,7 @@ class DatagramChannelImpl
|
||||
}
|
||||
do {
|
||||
tmpBuf.clear();
|
||||
} while (read(tmpBuf) > 0);
|
||||
} while (receive(tmpBuf) != null);
|
||||
} finally {
|
||||
if (blocking) {
|
||||
configureBlocking(true);
|
||||
|
@ -46,6 +46,7 @@ public class Reflection {
|
||||
map.put(Reflection.class,
|
||||
new String[] {"fieldFilterMap", "methodFilterMap"});
|
||||
map.put(System.class, new String[] {"security"});
|
||||
map.put(Class.class, new String[] {"classLoader"});
|
||||
fieldFilterMap = map;
|
||||
|
||||
methodFilterMap = new HashMap<>();
|
||||
|
@ -42,8 +42,11 @@ public class ClassRepository extends GenericDeclRepository<ClassSignature> {
|
||||
|
||||
public static final ClassRepository NONE = ClassRepository.make("Ljava/lang/Object;", null);
|
||||
|
||||
private Type superclass; // caches the generic superclass info
|
||||
private Type[] superInterfaces; // caches the generic superinterface info
|
||||
/** The generic superclass info. Lazily initialized. */
|
||||
private volatile Type superclass;
|
||||
|
||||
/** The generic superinterface info. Lazily initialized. */
|
||||
private volatile Type[] superInterfaces;
|
||||
|
||||
// private, to enforce use of static factory
|
||||
private ClassRepository(String rawSig, GenericsFactory f) {
|
||||
@ -79,31 +82,34 @@ public class ClassRepository extends GenericDeclRepository<ClassSignature> {
|
||||
* with which the repository was created.
|
||||
*/
|
||||
|
||||
public Type getSuperclass(){
|
||||
public Type getSuperclass() {
|
||||
Type superclass = this.superclass;
|
||||
if (superclass == null) { // lazily initialize superclass
|
||||
Reifier r = getReifier(); // obtain visitor
|
||||
// Extract superclass subtree from AST and reify
|
||||
getTree().getSuperclass().accept(r);
|
||||
// extract result from visitor and cache it
|
||||
superclass = r.getResult();
|
||||
}
|
||||
this.superclass = superclass;
|
||||
}
|
||||
return superclass; // return cached result
|
||||
}
|
||||
|
||||
public Type[] getSuperInterfaces(){
|
||||
public Type[] getSuperInterfaces() {
|
||||
Type[] superInterfaces = this.superInterfaces;
|
||||
if (superInterfaces == null) { // lazily initialize super interfaces
|
||||
// first, extract super interface subtree(s) from AST
|
||||
TypeTree[] ts = getTree().getSuperInterfaces();
|
||||
// create array to store reified subtree(s)
|
||||
Type[] sis = new Type[ts.length];
|
||||
superInterfaces = new Type[ts.length];
|
||||
// reify all subtrees
|
||||
for (int i = 0; i < ts.length; i++) {
|
||||
Reifier r = getReifier(); // obtain visitor
|
||||
ts[i].accept(r);// reify subtree
|
||||
// extract result from visitor and store it
|
||||
sis[i] = r.getResult();
|
||||
superInterfaces[i] = r.getResult();
|
||||
}
|
||||
superInterfaces = sis; // cache overall result
|
||||
this.superInterfaces = superInterfaces;
|
||||
}
|
||||
return superInterfaces.clone(); // return cached result
|
||||
}
|
||||
|
@ -42,7 +42,8 @@ import sun.reflect.generics.visitor.Reifier;
|
||||
public abstract class GenericDeclRepository<S extends Signature>
|
||||
extends AbstractRepository<S> {
|
||||
|
||||
private TypeVariable<?>[] typeParams; // caches the formal type parameters
|
||||
/** The formal type parameters. Lazily initialized. */
|
||||
private volatile TypeVariable<?>[] typeParams;
|
||||
|
||||
protected GenericDeclRepository(String rawSig, GenericsFactory f) {
|
||||
super(rawSig, f);
|
||||
@ -55,8 +56,7 @@ public abstract class GenericDeclRepository<S extends Signature>
|
||||
* If the corresponding field is non-null, it is returned.
|
||||
* If not, it is created lazily. This is done by selecting the appropriate
|
||||
* part of the tree and transforming it into a reflective object
|
||||
* using a visitor.
|
||||
* a visitor, which is created by feeding it the factory
|
||||
* using a visitor, which is created by feeding it the factory
|
||||
* with which the repository was created.
|
||||
*/
|
||||
|
||||
@ -64,20 +64,21 @@ public abstract class GenericDeclRepository<S extends Signature>
|
||||
* Return the formal type parameters of this generic declaration.
|
||||
* @return the formal type parameters of this generic declaration
|
||||
*/
|
||||
public TypeVariable<?>[] getTypeParameters(){
|
||||
public TypeVariable<?>[] getTypeParameters() {
|
||||
TypeVariable<?>[] typeParams = this.typeParams;
|
||||
if (typeParams == null) { // lazily initialize type parameters
|
||||
// first, extract type parameter subtree(s) from AST
|
||||
FormalTypeParameter[] ftps = getTree().getFormalTypeParameters();
|
||||
// create array to store reified subtree(s)
|
||||
TypeVariable<?>[] tps = new TypeVariable<?>[ftps.length];
|
||||
typeParams = new TypeVariable<?>[ftps.length];
|
||||
// reify all subtrees
|
||||
for (int i = 0; i < ftps.length; i++) {
|
||||
Reifier r = getReifier(); // obtain visitor
|
||||
ftps[i].accept(r); // reify subtree
|
||||
// extract result from visitor and store it
|
||||
tps[i] = (TypeVariable<?>) r.getResult();
|
||||
typeParams[i] = (TypeVariable<?>) r.getResult();
|
||||
}
|
||||
typeParams = tps; // cache overall result
|
||||
this.typeParams = typeParams; // cache overall result
|
||||
}
|
||||
return typeParams.clone(); // return cached result
|
||||
}
|
||||
|
@ -42,7 +42,9 @@ public abstract class AbstractScope<D extends GenericDeclaration>
|
||||
implements Scope {
|
||||
|
||||
private final D recvr; // the declaration whose scope this instance represents
|
||||
private Scope enclosingScope; // the enclosing scope of this scope
|
||||
|
||||
/** The enclosing scope of this scope. Lazily initialized. */
|
||||
private volatile Scope enclosingScope;
|
||||
|
||||
/**
|
||||
* Constructor. Takes a reflective object whose scope the newly
|
||||
@ -71,7 +73,11 @@ public abstract class AbstractScope<D extends GenericDeclaration>
|
||||
* @return the enclosing scope
|
||||
*/
|
||||
protected Scope getEnclosingScope(){
|
||||
if (enclosingScope == null) {enclosingScope = computeEnclosingScope();}
|
||||
Scope enclosingScope = this.enclosingScope;
|
||||
if (enclosingScope == null) {
|
||||
enclosingScope = computeEnclosingScope();
|
||||
this.enclosingScope = enclosingScope;
|
||||
}
|
||||
return enclosingScope;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -968,7 +968,7 @@ final class CipherSuite implements Comparable<CipherSuite> {
|
||||
* 1. Prefer Suite B compliant cipher suites, see RFC6460 (To be
|
||||
* changed later, see below).
|
||||
* 2. Prefer the stronger bulk cipher, in the order of AES_256(GCM),
|
||||
* AES_128(GCM), AES_256, AES_128, RC-4, 3DES-EDE.
|
||||
* AES_128(GCM), AES_256, AES_128, 3DES-EDE, RC-4.
|
||||
* 3. Prefer the stronger MAC algorithm, in the order of SHA384,
|
||||
* SHA256, SHA, MD5.
|
||||
* 4. Prefer the better performance of key exchange and digital
|
||||
@ -1087,18 +1087,6 @@ final class CipherSuite implements Comparable<CipherSuite> {
|
||||
add("TLS_DHE_DSS_WITH_AES_128_CBC_SHA",
|
||||
0x0032, --p, K_DHE_DSS, B_AES_128, T);
|
||||
|
||||
// RC-4
|
||||
add("TLS_ECDHE_ECDSA_WITH_RC4_128_SHA",
|
||||
0xC007, --p, K_ECDHE_ECDSA, B_RC4_128, N);
|
||||
add("TLS_ECDHE_RSA_WITH_RC4_128_SHA",
|
||||
0xC011, --p, K_ECDHE_RSA, B_RC4_128, N);
|
||||
add("SSL_RSA_WITH_RC4_128_SHA",
|
||||
0x0005, --p, K_RSA, B_RC4_128, N);
|
||||
add("TLS_ECDH_ECDSA_WITH_RC4_128_SHA",
|
||||
0xC002, --p, K_ECDH_ECDSA, B_RC4_128, N);
|
||||
add("TLS_ECDH_RSA_WITH_RC4_128_SHA",
|
||||
0xC00C, --p, K_ECDH_RSA, B_RC4_128, N);
|
||||
|
||||
// 3DES_EDE
|
||||
add("TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA",
|
||||
0xC008, --p, K_ECDHE_ECDSA, B_3DES, T);
|
||||
@ -1115,6 +1103,17 @@ final class CipherSuite implements Comparable<CipherSuite> {
|
||||
add("SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA",
|
||||
0x0013, --p, K_DHE_DSS, B_3DES, N);
|
||||
|
||||
// RC-4
|
||||
add("TLS_ECDHE_ECDSA_WITH_RC4_128_SHA",
|
||||
0xC007, --p, K_ECDHE_ECDSA, B_RC4_128, N);
|
||||
add("TLS_ECDHE_RSA_WITH_RC4_128_SHA",
|
||||
0xC011, --p, K_ECDHE_RSA, B_RC4_128, N);
|
||||
add("SSL_RSA_WITH_RC4_128_SHA",
|
||||
0x0005, --p, K_RSA, B_RC4_128, N);
|
||||
add("TLS_ECDH_ECDSA_WITH_RC4_128_SHA",
|
||||
0xC002, --p, K_ECDH_ECDSA, B_RC4_128, N);
|
||||
add("TLS_ECDH_RSA_WITH_RC4_128_SHA",
|
||||
0xC00C, --p, K_ECDH_RSA, B_RC4_128, N);
|
||||
add("SSL_RSA_WITH_RC4_128_MD5",
|
||||
0x0004, --p, K_RSA, B_RC4_128, N);
|
||||
|
||||
@ -1134,7 +1133,7 @@ final class CipherSuite implements Comparable<CipherSuite> {
|
||||
* 2. If a cipher suite has been obsoleted, we put it at the end of
|
||||
* the list.
|
||||
* 3. Prefer the stronger bulk cipher, in the order of AES_256,
|
||||
* AES_128, RC-4, 3DES-EDE, DES, RC4_40, DES40, NULL.
|
||||
* AES_128, 3DES-EDE, RC-4, DES, DES40, RC4_40, NULL.
|
||||
* 4. Prefer the stronger MAC algorithm, in the order of SHA384,
|
||||
* SHA256, SHA, MD5.
|
||||
* 5. Prefer the better performance of key exchange and digital
|
||||
@ -1162,15 +1161,40 @@ final class CipherSuite implements Comparable<CipherSuite> {
|
||||
add("TLS_DH_anon_WITH_AES_128_CBC_SHA",
|
||||
0x0034, --p, K_DH_ANON, B_AES_128, N);
|
||||
|
||||
add("TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA",
|
||||
0xC017, --p, K_ECDH_ANON, B_3DES, N);
|
||||
add("SSL_DH_anon_WITH_3DES_EDE_CBC_SHA",
|
||||
0x001b, --p, K_DH_ANON, B_3DES, N);
|
||||
|
||||
add("TLS_ECDH_anon_WITH_RC4_128_SHA",
|
||||
0xC016, --p, K_ECDH_ANON, B_RC4_128, N);
|
||||
add("SSL_DH_anon_WITH_RC4_128_MD5",
|
||||
0x0018, --p, K_DH_ANON, B_RC4_128, N);
|
||||
|
||||
add("TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA",
|
||||
0xC017, --p, K_ECDH_ANON, B_3DES, N);
|
||||
add("SSL_DH_anon_WITH_3DES_EDE_CBC_SHA",
|
||||
0x001b, --p, K_DH_ANON, B_3DES, N);
|
||||
// weak cipher suites obsoleted in TLS 1.2
|
||||
add("SSL_RSA_WITH_DES_CBC_SHA",
|
||||
0x0009, --p, K_RSA, B_DES, N, tls12);
|
||||
add("SSL_DHE_RSA_WITH_DES_CBC_SHA",
|
||||
0x0015, --p, K_DHE_RSA, B_DES, N, tls12);
|
||||
add("SSL_DHE_DSS_WITH_DES_CBC_SHA",
|
||||
0x0012, --p, K_DHE_DSS, B_DES, N, tls12);
|
||||
add("SSL_DH_anon_WITH_DES_CBC_SHA",
|
||||
0x001a, --p, K_DH_ANON, B_DES, N, tls12);
|
||||
|
||||
// weak cipher suites obsoleted in TLS 1.1
|
||||
add("SSL_RSA_EXPORT_WITH_DES40_CBC_SHA",
|
||||
0x0008, --p, K_RSA_EXPORT, B_DES_40, N, tls11);
|
||||
add("SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA",
|
||||
0x0014, --p, K_DHE_RSA, B_DES_40, N, tls11);
|
||||
add("SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA",
|
||||
0x0011, --p, K_DHE_DSS, B_DES_40, N, tls11);
|
||||
add("SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA",
|
||||
0x0019, --p, K_DH_ANON, B_DES_40, N, tls11);
|
||||
|
||||
add("SSL_RSA_EXPORT_WITH_RC4_40_MD5",
|
||||
0x0003, --p, K_RSA_EXPORT, B_RC4_40, N, tls11);
|
||||
add("SSL_DH_anon_EXPORT_WITH_RC4_40_MD5",
|
||||
0x0017, --p, K_DH_ANON, B_RC4_40, N, tls11);
|
||||
|
||||
add("TLS_RSA_WITH_NULL_SHA256",
|
||||
0x003b, --p, K_RSA, B_NULL, N, max, tls12, P_SHA256);
|
||||
@ -1189,52 +1213,27 @@ final class CipherSuite implements Comparable<CipherSuite> {
|
||||
add("SSL_RSA_WITH_NULL_MD5",
|
||||
0x0001, --p, K_RSA, B_NULL, N);
|
||||
|
||||
// weak cipher suites obsoleted in TLS 1.2
|
||||
add("SSL_RSA_WITH_DES_CBC_SHA",
|
||||
0x0009, --p, K_RSA, B_DES, N, tls12);
|
||||
add("SSL_DHE_RSA_WITH_DES_CBC_SHA",
|
||||
0x0015, --p, K_DHE_RSA, B_DES, N, tls12);
|
||||
add("SSL_DHE_DSS_WITH_DES_CBC_SHA",
|
||||
0x0012, --p, K_DHE_DSS, B_DES, N, tls12);
|
||||
add("SSL_DH_anon_WITH_DES_CBC_SHA",
|
||||
0x001a, --p, K_DH_ANON, B_DES, N, tls12);
|
||||
|
||||
// weak cipher suites obsoleted in TLS 1.1
|
||||
add("SSL_RSA_EXPORT_WITH_RC4_40_MD5",
|
||||
0x0003, --p, K_RSA_EXPORT, B_RC4_40, N, tls11);
|
||||
add("SSL_DH_anon_EXPORT_WITH_RC4_40_MD5",
|
||||
0x0017, --p, K_DH_ANON, B_RC4_40, N, tls11);
|
||||
|
||||
add("SSL_RSA_EXPORT_WITH_DES40_CBC_SHA",
|
||||
0x0008, --p, K_RSA_EXPORT, B_DES_40, N, tls11);
|
||||
add("SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA",
|
||||
0x0014, --p, K_DHE_RSA, B_DES_40, N, tls11);
|
||||
add("SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA",
|
||||
0x0011, --p, K_DHE_DSS, B_DES_40, N, tls11);
|
||||
add("SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA",
|
||||
0x0019, --p, K_DH_ANON, B_DES_40, N, tls11);
|
||||
|
||||
// Supported Kerberos ciphersuites from RFC2712
|
||||
add("TLS_KRB5_WITH_RC4_128_SHA",
|
||||
0x0020, --p, K_KRB5, B_RC4_128, N);
|
||||
add("TLS_KRB5_WITH_RC4_128_MD5",
|
||||
0x0024, --p, K_KRB5, B_RC4_128, N);
|
||||
add("TLS_KRB5_WITH_3DES_EDE_CBC_SHA",
|
||||
0x001f, --p, K_KRB5, B_3DES, N);
|
||||
add("TLS_KRB5_WITH_3DES_EDE_CBC_MD5",
|
||||
0x0023, --p, K_KRB5, B_3DES, N);
|
||||
add("TLS_KRB5_WITH_RC4_128_SHA",
|
||||
0x0020, --p, K_KRB5, B_RC4_128, N);
|
||||
add("TLS_KRB5_WITH_RC4_128_MD5",
|
||||
0x0024, --p, K_KRB5, B_RC4_128, N);
|
||||
add("TLS_KRB5_WITH_DES_CBC_SHA",
|
||||
0x001e, --p, K_KRB5, B_DES, N, tls12);
|
||||
add("TLS_KRB5_WITH_DES_CBC_MD5",
|
||||
0x0022, --p, K_KRB5, B_DES, N, tls12);
|
||||
add("TLS_KRB5_EXPORT_WITH_RC4_40_SHA",
|
||||
0x0028, --p, K_KRB5_EXPORT, B_RC4_40, N, tls11);
|
||||
add("TLS_KRB5_EXPORT_WITH_RC4_40_MD5",
|
||||
0x002b, --p, K_KRB5_EXPORT, B_RC4_40, N, tls11);
|
||||
add("TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA",
|
||||
0x0026, --p, K_KRB5_EXPORT, B_DES_40, N, tls11);
|
||||
add("TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5",
|
||||
0x0029, --p, K_KRB5_EXPORT, B_DES_40, N, tls11);
|
||||
add("TLS_KRB5_EXPORT_WITH_RC4_40_SHA",
|
||||
0x0028, --p, K_KRB5_EXPORT, B_RC4_40, N, tls11);
|
||||
add("TLS_KRB5_EXPORT_WITH_RC4_40_MD5",
|
||||
0x002b, --p, K_KRB5_EXPORT, B_RC4_40, N, tls11);
|
||||
|
||||
/*
|
||||
* Other values from the TLS Cipher Suite Registry, as of August 2010.
|
||||
|
@ -1963,6 +1963,7 @@ static final class Finished extends HandshakeMessage {
|
||||
* algorithm. If we ever run across a different
|
||||
* length, this call will need to be updated.
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
TlsPrfParameterSpec spec = new TlsPrfParameterSpec(
|
||||
masterKey, tlsLabel, seed, 12,
|
||||
prfHashAlg, prfHashLength, prfBlockSize);
|
||||
|
@ -1122,6 +1122,7 @@ abstract class Handshaker {
|
||||
int prfHashLength = prf.getPRFHashLength();
|
||||
int prfBlockSize = prf.getPRFBlockSize();
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
TlsMasterSecretParameterSpec spec = new TlsMasterSecretParameterSpec(
|
||||
preMasterSecret, protocolVersion.major, protocolVersion.minor,
|
||||
clnt_random.random_bytes, svr_random.random_bytes,
|
||||
@ -1156,6 +1157,7 @@ abstract class Handshaker {
|
||||
* a premaster secret and started a new session) as well as on the
|
||||
* "fast handshake" (where we just resumed a pre-existing session).
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
void calculateConnectionKeys(SecretKey masterKey) {
|
||||
/*
|
||||
* For both the read and write sides of the protocol, we use the
|
||||
|
@ -63,6 +63,7 @@ final class RSAClientKeyExchange extends HandshakeMessage {
|
||||
* it, using its RSA private key. Result is the same size as the
|
||||
* server's public key, and uses PKCS #1 block format 02.
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
RSAClientKeyExchange(ProtocolVersion protocolVersion,
|
||||
ProtocolVersion maxVersion,
|
||||
SecureRandom generator, PublicKey publicKey) throws IOException {
|
||||
@ -92,6 +93,7 @@ final class RSAClientKeyExchange extends HandshakeMessage {
|
||||
* Server gets the PKCS #1 (block format 02) data, decrypts
|
||||
* it with its private key.
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
RSAClientKeyExchange(ProtocolVersion currentVersion,
|
||||
ProtocolVersion maxVersion,
|
||||
SecureRandom generator, HandshakeInStream input,
|
||||
|
@ -83,6 +83,7 @@ public final class RSASignature extends SignatureSpi {
|
||||
/**
|
||||
* Set the MD5 and SHA hashes to the provided objects.
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
static void setHashes(Signature sig, MessageDigest md5, MessageDigest sha) {
|
||||
sig.setParameter("hashes", new MessageDigest[] {md5, sha});
|
||||
}
|
||||
@ -183,6 +184,7 @@ public final class RSASignature extends SignatureSpi {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
protected void engineSetParameter(String param, Object value)
|
||||
throws InvalidParameterException {
|
||||
if (param.equals("hashes") == false) {
|
||||
@ -199,6 +201,7 @@ public final class RSASignature extends SignatureSpi {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
protected Object engineGetParameter(String param)
|
||||
throws InvalidParameterException {
|
||||
throw new InvalidParameterException("Parameters not supported");
|
||||
|
@ -54,6 +54,7 @@ import java.text.ParsePosition;
|
||||
* @author Alan Liu
|
||||
* @since ICU 2.8
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public class RuleCharacterIterator {
|
||||
|
||||
// TODO: Ideas for later. (Do not implement if not needed, lest the
|
||||
|
@ -273,6 +273,7 @@ import java.util.TreeSet;
|
||||
* @stable ICU 2.0
|
||||
* @see UnicodeSetIterator
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public class UnicodeSet implements UnicodeMatcher {
|
||||
|
||||
private static final int LOW = 0x000000; // LOW <= all valid values. ZERO for codepoints
|
||||
|
@ -406,14 +406,17 @@ final class UNIXProcess extends Process {
|
||||
if (hasExited) return true;
|
||||
if (timeout <= 0) return false;
|
||||
|
||||
long timeoutAsNanos = unit.toNanos(timeout);
|
||||
long startTime = System.nanoTime();
|
||||
long rem = timeoutAsNanos;
|
||||
long remainingNanos = unit.toNanos(timeout);
|
||||
long deadline = System.nanoTime() + remainingNanos;
|
||||
|
||||
while (!hasExited && (rem > 0)) {
|
||||
wait(Math.max(TimeUnit.NANOSECONDS.toMillis(rem), 1));
|
||||
rem = timeoutAsNanos - (System.nanoTime() - startTime);
|
||||
}
|
||||
do {
|
||||
// Round up to next millisecond
|
||||
wait(TimeUnit.NANOSECONDS.toMillis(remainingNanos + 999_999L));
|
||||
if (hasExited) {
|
||||
return true;
|
||||
}
|
||||
remainingNanos = deadline - System.nanoTime();
|
||||
} while (remainingNanos > 0);
|
||||
return hasExited;
|
||||
}
|
||||
|
||||
|
@ -461,11 +461,21 @@ final class ProcessImpl extends Process {
|
||||
if (getExitCodeProcess(handle) != STILL_ACTIVE) return true;
|
||||
if (timeout <= 0) return false;
|
||||
|
||||
long msTimeout = unit.toMillis(timeout);
|
||||
long remainingNanos = unit.toNanos(timeout);
|
||||
long deadline = System.nanoTime() + remainingNanos ;
|
||||
|
||||
do {
|
||||
// Round up to next millisecond
|
||||
long msTimeout = TimeUnit.NANOSECONDS.toMillis(remainingNanos + 999_999L);
|
||||
waitForTimeoutInterruptibly(handle, msTimeout);
|
||||
if (Thread.interrupted())
|
||||
throw new InterruptedException();
|
||||
if (getExitCodeProcess(handle) != STILL_ACTIVE) {
|
||||
return true;
|
||||
}
|
||||
remainingNanos = deadline - System.nanoTime();
|
||||
} while (remainingNanos > 0);
|
||||
|
||||
waitForTimeoutInterruptibly(handle, msTimeout);
|
||||
if (Thread.interrupted())
|
||||
throw new InterruptedException();
|
||||
return (getExitCodeProcess(handle) != STILL_ACTIVE);
|
||||
}
|
||||
|
||||
|
@ -32,9 +32,11 @@
|
||||
|
||||
#include "java_net_AbstractPlainDatagramSocketImpl.h"
|
||||
|
||||
static jfieldID IO_fd_fdID;
|
||||
static jfieldID IO_fd_fdID = NULL;
|
||||
static jfieldID apdsi_fdID = NULL;
|
||||
|
||||
static jfieldID apdsi_fdID;
|
||||
static jfieldID apdsi_fd1ID = NULL;
|
||||
static jclass two_stacks_clazz = NULL;
|
||||
|
||||
|
||||
/*
|
||||
@ -48,10 +50,21 @@ Java_java_net_AbstractPlainDatagramSocketImpl_init(JNIEnv *env, jclass cls) {
|
||||
apdsi_fdID = (*env)->GetFieldID(env, cls, "fd",
|
||||
"Ljava/io/FileDescriptor;");
|
||||
CHECK_NULL(apdsi_fdID);
|
||||
|
||||
IO_fd_fdID = NET_GetFileDescriptorID(env);
|
||||
CHECK_NULL(IO_fd_fdID);
|
||||
|
||||
two_stacks_clazz = (*env)->FindClass(env, "java/net/TwoStacksPlainDatagramSocketImpl");
|
||||
CHECK_NULL(two_stacks_clazz);
|
||||
|
||||
/* Handle both TwoStacks and DualStack here */
|
||||
|
||||
if (JNU_Equals(env, cls, two_stacks_clazz)) {
|
||||
/* fd1 present only in TwoStack.. */
|
||||
apdsi_fd1ID = (*env)->GetFieldID(env, cls, "fd1",
|
||||
"Ljava/io/FileDescriptor;");
|
||||
CHECK_NULL(apdsi_fd1ID);
|
||||
}
|
||||
|
||||
JNU_CHECK_EXCEPTION(env);
|
||||
}
|
||||
|
||||
@ -63,20 +76,38 @@ Java_java_net_AbstractPlainDatagramSocketImpl_init(JNIEnv *env, jclass cls) {
|
||||
JNIEXPORT jint JNICALL Java_java_net_AbstractPlainDatagramSocketImpl_dataAvailable
|
||||
(JNIEnv *env, jobject this) {
|
||||
SOCKET fd;
|
||||
int retval;
|
||||
|
||||
SOCKET fd1;
|
||||
int rv = -1, rv1 = -1;
|
||||
jobject fdObj = (*env)->GetObjectField(env, this, apdsi_fdID);
|
||||
|
||||
if (IS_NULL(fdObj)) {
|
||||
JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException",
|
||||
"Socket closed");
|
||||
return -1;
|
||||
if (!IS_NULL(fdObj)) {
|
||||
int retval = 0;
|
||||
fd = (SOCKET)(*env)->GetIntField(env, fdObj, IO_fd_fdID);
|
||||
rv = ioctlsocket(fd, FIONREAD, &retval);
|
||||
if (retval > 0) {
|
||||
return retval;
|
||||
}
|
||||
}
|
||||
fd = (SOCKET)(*env)->GetIntField(env, fdObj, IO_fd_fdID);
|
||||
|
||||
if (ioctlsocket(fd, FIONREAD, &retval) < 0) {
|
||||
if (!IS_NULL(apdsi_fd1ID)) {
|
||||
/* TwoStacks */
|
||||
jobject fd1Obj = (*env)->GetObjectField(env, this, apdsi_fd1ID);
|
||||
if (!IS_NULL(fd1Obj)) {
|
||||
int retval = 0;
|
||||
fd1 = (SOCKET)(*env)->GetIntField(env, fd1Obj, IO_fd_fdID);
|
||||
rv1 = ioctlsocket(fd1, FIONREAD, &retval);
|
||||
if (retval > 0) {
|
||||
return retval;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (rv < 0 && rv1 < 0) {
|
||||
JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException",
|
||||
"Socket closed");
|
||||
return -1;
|
||||
}
|
||||
return retval;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -2254,7 +2254,18 @@ public class Window extends Container implements Accessible {
|
||||
}
|
||||
firePropertyChange("alwaysOnTop", oldAlwaysOnTop, alwaysOnTop);
|
||||
}
|
||||
for (WeakReference<Window> ref : ownedWindowList) {
|
||||
setOwnedWindowsAlwaysOnTop(alwaysOnTop);
|
||||
}
|
||||
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
private void setOwnedWindowsAlwaysOnTop(boolean alwaysOnTop) {
|
||||
WeakReference<Window>[] ownedWindowArray;
|
||||
synchronized (ownedWindowList) {
|
||||
ownedWindowArray = new WeakReference[ownedWindowList.size()];
|
||||
ownedWindowList.copyInto(ownedWindowArray);
|
||||
}
|
||||
|
||||
for (WeakReference<Window> ref : ownedWindowArray) {
|
||||
Window window = ref.get();
|
||||
if (window != null) {
|
||||
try {
|
||||
|
@ -31,16 +31,14 @@ import java.awt.event.*;
|
||||
import javax.accessibility.AccessibleContext;
|
||||
import javax.swing.*;
|
||||
import javax.swing.plaf.*;
|
||||
import javax.swing.border.*;
|
||||
import javax.swing.event.InternalFrameEvent;
|
||||
import java.util.EventListener;
|
||||
import java.beans.PropertyChangeListener;
|
||||
import java.beans.PropertyChangeEvent;
|
||||
import java.beans.VetoableChangeListener;
|
||||
import java.beans.PropertyVetoException;
|
||||
|
||||
import sun.swing.DefaultLookup;
|
||||
import sun.swing.UIAction;
|
||||
|
||||
import static sun.swing.SwingUtilities2.AA_TEXT_PROPERTY_KEY;
|
||||
|
||||
/**
|
||||
* The class that manages a basic title bar
|
||||
@ -215,6 +213,12 @@ public class BasicInternalFrameTitlePane extends JComponent
|
||||
createButtons();
|
||||
addSubComponents();
|
||||
|
||||
updateProperties();
|
||||
}
|
||||
|
||||
private void updateProperties() {
|
||||
final Object aaTextInfo = frame.getClientProperty(AA_TEXT_PROPERTY_KEY);
|
||||
putClientProperty(AA_TEXT_PROPERTY_KEY, aaTextInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -24,6 +24,8 @@
|
||||
*/
|
||||
package javax.swing.plaf.basic;
|
||||
|
||||
import sun.datatransfer.DataFlavorUtil;
|
||||
|
||||
import java.io.*;
|
||||
import java.awt.datatransfer.*;
|
||||
import javax.swing.plaf.UIResource;
|
||||
@ -145,7 +147,7 @@ class BasicTransferable implements Transferable, UIResource {
|
||||
} else if (Reader.class.equals(flavor.getRepresentationClass())) {
|
||||
return new StringReader(data);
|
||||
} else if (InputStream.class.equals(flavor.getRepresentationClass())) {
|
||||
return new StringBufferInputStream(data);
|
||||
return createInputStream(flavor, data);
|
||||
}
|
||||
// fall through to unsupported
|
||||
} else if (isPlainFlavor(flavor)) {
|
||||
@ -156,7 +158,7 @@ class BasicTransferable implements Transferable, UIResource {
|
||||
} else if (Reader.class.equals(flavor.getRepresentationClass())) {
|
||||
return new StringReader(data);
|
||||
} else if (InputStream.class.equals(flavor.getRepresentationClass())) {
|
||||
return new StringBufferInputStream(data);
|
||||
return createInputStream(flavor, data);
|
||||
}
|
||||
// fall through to unsupported
|
||||
|
||||
@ -168,6 +170,15 @@ class BasicTransferable implements Transferable, UIResource {
|
||||
throw new UnsupportedFlavorException(flavor);
|
||||
}
|
||||
|
||||
private InputStream createInputStream(DataFlavor flavor, String data)
|
||||
throws IOException, UnsupportedFlavorException {
|
||||
String cs = DataFlavorUtil.getTextCharset(flavor);
|
||||
if (cs == null) {
|
||||
throw new UnsupportedFlavorException(flavor);
|
||||
}
|
||||
return new ByteArrayInputStream(data.getBytes(cs));
|
||||
}
|
||||
|
||||
// --- richer subclass flavors ----------------------------------------------
|
||||
|
||||
protected boolean isRicherFlavor(DataFlavor flavor) {
|
||||
|
@ -1882,6 +1882,9 @@ public abstract class SunToolkit extends Toolkit
|
||||
|
||||
public synchronized void setWindowDeactivationTime(Window w, long time) {
|
||||
AppContext ctx = getAppContext(w);
|
||||
if (ctx == null) {
|
||||
return;
|
||||
}
|
||||
@SuppressWarnings("unchecked")
|
||||
WeakHashMap<Window, Long> map = (WeakHashMap<Window, Long>)ctx.get(DEACTIVATION_TIMES_MAP_KEY);
|
||||
if (map == null) {
|
||||
@ -1893,6 +1896,9 @@ public abstract class SunToolkit extends Toolkit
|
||||
|
||||
public synchronized long getWindowDeactivationTime(Window w) {
|
||||
AppContext ctx = getAppContext(w);
|
||||
if (ctx == null) {
|
||||
return -1;
|
||||
}
|
||||
@SuppressWarnings("unchecked")
|
||||
WeakHashMap<Window, Long> map = (WeakHashMap<Window, Long>)ctx.get(DEACTIVATION_TIMES_MAP_KEY);
|
||||
if (map == null) {
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user