This commit is contained in:
Vladimir Kozlov 2014-11-21 14:58:29 -08:00
commit 37a6f605d0
155 changed files with 4287 additions and 1288 deletions

View File

@ -282,3 +282,4 @@ cdcf2e599e42935c2d1d19a24bb19e808aeb43b5 jdk9-b36
27c3345d6dce39a22c262f30bb1f0e0b00c3709e jdk9-b37 27c3345d6dce39a22c262f30bb1f0e0b00c3709e jdk9-b37
d2d745313c81d1fc01f426983b9f784ab1f750e8 jdk9-b38 d2d745313c81d1fc01f426983b9f784ab1f750e8 jdk9-b38
ca6edf957fe1c6ea818530b503578e872cea7239 jdk9-b39 ca6edf957fe1c6ea818530b503578e872cea7239 jdk9-b39
f1ed1540da70a066527fd043413107e47721edbf jdk9-b40

View File

@ -44,7 +44,7 @@ BUILD_DEMOS =
DEMO_SHARE_SRC := $(JDK_TOPDIR)/src/demo/share DEMO_SHARE_SRC := $(JDK_TOPDIR)/src/demo/share
DEMO_CLOSED_SHARE_SRC := $(JDK_TOPDIR)/src/closed/demo/share DEMO_CLOSED_SHARE_SRC := $(JDK_TOPDIR)/src/closed/demo/share
DEMO_SOLARIS_SRC := $(JDK_TOPDIR)/src/demo/solaris 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 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 2 = add these directories to the includes, default is agent_util
# Param 3 = extra CFLAGS # Param 3 = extra CFLAGS
# Param 4 = C or C++ (defaults to C) # Param 4 = C or C++ (defaults to C)
# Param 5 = libs for posix # Param 5 = libs for unix
# Param 6 = libs for windows # Param 6 = libs for windows
# Param 7 = libs for solaris # Param 7 = libs for solaris
# Param 8 = libs for linux # Param 8 = libs for linux
# Param 9 = extra directories with required sources # Param 9 = extra directories with required sources
BUILD_DEMO_JVMTI_$1_EXTRA_SRC := \ 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)) \ $$(wildcard $$(addprefix $(DEMO_SHARE_SRC)/jvmti/, $2)) \
$9 $9
BUILD_DEMO_JVMTI_$1_EXTRA_SRC_EXCLUDE := \ BUILD_DEMO_JVMTI_$1_EXTRA_SRC_EXCLUDE := \
@ -257,7 +257,7 @@ define SetupJVMTIDemo
LDFLAGS := $(filter-out -incremental:no -opt:ref, $(LDFLAGS_JDKLIB)), \ LDFLAGS := $(filter-out -incremental:no -opt:ref, $(LDFLAGS_JDKLIB)), \
LDFLAGS_macosx := $(call SET_EXECUTABLE_ORIGIN), \ LDFLAGS_macosx := $(call SET_EXECUTABLE_ORIGIN), \
LDFLAGS_SUFFIX := $$($1_EXTRA_CXX), \ LDFLAGS_SUFFIX := $$($1_EXTRA_CXX), \
LDFLAGS_SUFFIX_posix := $5, \ LDFLAGS_SUFFIX_unix := $5, \
LDFLAGS_SUFFIX_windows := $6, \ LDFLAGS_SUFFIX_windows := $6, \
LDFLAGS_SUFFIX_solaris := $7 -lc, \ LDFLAGS_SUFFIX_solaris := $7 -lc, \
LDFLAGS_SUFFIX_linux := $8, \ LDFLAGS_SUFFIX_linux := $8, \

View File

@ -656,7 +656,7 @@ endif
SRC_ZIP_SRCS := $(wildcard \ SRC_ZIP_SRCS := $(wildcard \
$(JDK_TOPDIR)/src/*/share/classes \ $(JDK_TOPDIR)/src/*/share/classes \
$(JDK_TOPDIR)/src/*/$(OPENJDK_TARGET_OS)/classes \ $(JDK_TOPDIR)/src/*/$(OPENJDK_TARGET_OS)/classes \
$(JDK_TOPDIR)/src/*/$(OPENJDK_TARGET_OS_API_DIR)/classes \ $(JDK_TOPDIR)/src/*/$(OPENJDK_TARGET_OS_TYPE)/classes \
$(LANGTOOLS_TOPDIR)/src/*/share/classes \ $(LANGTOOLS_TOPDIR)/src/*/share/classes \
$(CORBA_TOPDIR)/src/*/share/classes \ $(CORBA_TOPDIR)/src/*/share/classes \
$(JAXP_TOPDIR)/src/*/share/classes \ $(JAXP_TOPDIR)/src/*/share/classes \
@ -679,7 +679,7 @@ $(eval $(call SetupCopyFiles,COPY_LAUNCHER_SRC, \
FILES := $(wildcard \ FILES := $(wildcard \
$(JDK_TOPDIR)/src/java.base/share/native/launcher/* \ $(JDK_TOPDIR)/src/java.base/share/native/launcher/* \
$(JDK_TOPDIR)/src/java.base/share/native/libjli/* \ $(JDK_TOPDIR)/src/java.base/share/native/libjli/* \
$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_API_DIR)/native/libjli/java_md*))) $(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjli/java_md*)))
LAUNCHER_ZIP_SRC := $(COPY_LAUNCHER_SRC) LAUNCHER_ZIP_SRC := $(COPY_LAUNCHER_SRC)

View File

@ -30,8 +30,8 @@ include MakeBase.gmk
################################################################################ ################################################################################
# Put the libraries here. Different locations for different target apis. # Put the libraries here. Different locations for different target OS types.
ifeq ($(OPENJDK_TARGET_OS_API), posix) ifeq ($(OPENJDK_TARGET_OS_TYPE), unix)
INSTALL_LIBRARIES_HERE := $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR) INSTALL_LIBRARIES_HERE := $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)
HOTSPOT_LIB_DIR := $(HOTSPOT_DIST)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR) HOTSPOT_LIB_DIR := $(HOTSPOT_DIST)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR)
else else

View File

@ -83,7 +83,7 @@ endif
ifeq ($(OPENJDK_TARGET_OS), macosx) ifeq ($(OPENJDK_TARGET_OS), macosx)
JVMCFG_SRC := $(JDK_TOPDIR)/src/java.base/macosx/conf/$(JVMCFG_ARCH)/jvm.cfg JVMCFG_SRC := $(JDK_TOPDIR)/src/java.base/macosx/conf/$(JVMCFG_ARCH)/jvm.cfg
else 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 endif
JVMCFG_DIR := $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR) JVMCFG_DIR := $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)
JVMCFG := $(JVMCFG_DIR)/jvm.cfg JVMCFG := $(JVMCFG_DIR)/jvm.cfg
@ -190,7 +190,7 @@ $(JDK_OUTPUTDIR)/lib/net.properties: $(JDK_TOPDIR)/src/java.base/share/conf/net.
NET_CONF_FILES += $(JDK_OUTPUTDIR)/lib/net.properties NET_CONF_FILES += $(JDK_OUTPUTDIR)/lib/net.properties
ifeq ($(OPENJDK_TARGET_OS), solaris) ifeq ($(OPENJDK_TARGET_OS), solaris)
$(JDK_OUTPUTDIR)/lib/sdp/sdp.conf.template: $(JDK_TOPDIR)/src/java.base/${OPENJDK_TARGET_OS_API_DIR}/conf/sdp/sdp.conf.template $(JDK_OUTPUTDIR)/lib/sdp/sdp.conf.template: $(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/conf/sdp/sdp.conf.template
$(ECHO) $(LOG_INFO) Copying $(@F) $(ECHO) $(LOG_INFO) Copying $(@F)
$(call install-file) $(call install-file)

View File

@ -102,13 +102,13 @@ DESKTOP_CONF_FILES += $(PSFONTPROPFILE_TARGET_FILES)
# Copy cursor.properties and cursors gif files to LIB_DST_DIR # Copy cursor.properties and cursors gif files to LIB_DST_DIR
# #
ifneq ($(OPENJDK_TARGET_OS), macosx) 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 else
OPENJDK_TARGET_OS_LIB_SRC := $(JDK_TOPDIR)/src/java.desktop/macosx/conf OPENJDK_TARGET_OS_LIB_SRC := $(JDK_TOPDIR)/src/java.desktop/macosx/conf
endif endif
CURSORS_DEST_DIR := $(LIB_DST_DIR)/images/cursors 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 $(CURSORS_DEST_DIR)/cursors.properties: $(CURSORS_OPENJDK_TARGET_OS_LIB_SRC)/cursors.properties
$(call install-file) $(call install-file)

View File

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

View File

@ -29,20 +29,19 @@
# tz@iana.org for general use in the future). For more, please see # tz@iana.org for general use in the future). For more, please see
# the file CONTRIBUTING in the tz distribution. # 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), # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
# San Diego: ACS Publications, Inc. (2003). # San Diego: ACS Publications, Inc. (2003).
# Unfortunately this book contains many errors and cites no sources.
# #
# Gwillim Law writes that a good source # Gwillim Law writes that a good source
# for recent time zone data is the International Air Transport # for recent time zone data is the International Air Transport
# Association's Standard Schedules Information Manual (IATA SSIM), # Association's Standard Schedules Information Manual (IATA SSIM),
# published semiannually. Law sent in several helpful summaries # 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.
# #
# Another source occasionally used is Edward W. Whitman, World Time Differences, # Another source occasionally used is Edward W. Whitman, World Time Differences,
# Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated), which # 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 CAST Central Africa Summer Time (no longer used)
# 3:00 SAST South Africa Summer Time (no longer used) # 3:00 SAST South Africa Summer Time (no longer used)
# 3:00 EAT East Africa Time # 3:00 EAT East Africa Time
# 4:00 EAST East Africa Summer Time (no longer used)
# Algeria # Algeria
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S # 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 1:00 - WAT
# Comoros # Comoros
# Zone NAME GMTOFF RULES FORMAT [UNTIL] # See Africa/Nairobi.
Zone Indian/Comoro 2:53:04 - LMT 1911 Jul # Moroni, Gran Comoro
3:00 - EAT
# Democratic Republic of the Congo # Democratic Republic of the Congo
# See Africa/Lagos for the western part and Africa/Maputo for the eastern. # 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 Link Africa/Abidjan Atlantic/St_Helena # St Helena
# Djibouti # Djibouti
# Zone NAME GMTOFF RULES FORMAT [UNTIL] # See Africa/Nairobi.
Zone Africa/Djibouti 2:52:36 - LMT 1911 Jul
3:00 - EAT
############################################################################### ###############################################################################
@ -410,27 +404,8 @@ Zone Africa/Cairo 2:05:09 - LMT 1900 Oct
# See Africa/Lagos. # See Africa/Lagos.
# Eritrea # 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 # Ethiopia
# From Paul Eggert (2014-07-31): # See Africa/Nairobi.
# 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
# Gabon # Gabon
# See Africa/Lagos. # See Africa/Lagos.
@ -474,6 +449,15 @@ Zone Africa/Nairobi 2:27:16 - LMT 1928 Jul
2:30 - BEAT 1940 2:30 - BEAT 1940
2:45 - BEAUT 1960 2:45 - BEAUT 1960
3:00 - EAT 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 # Lesotho
# See Africa/Johannesburg. # See Africa/Johannesburg.
@ -551,11 +535,7 @@ Zone Africa/Tripoli 0:52:44 - LMT 1920
2:00 - EET 2:00 - EET
# Madagascar # Madagascar
# Zone NAME GMTOFF RULES FORMAT [UNTIL] # See Africa/Nairobi.
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
# Malawi # Malawi
# See Africa/Maputo. # See Africa/Maputo.
@ -658,9 +638,7 @@ Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis
# no information; probably like Indian/Mauritius # no information; probably like Indian/Mauritius
# Mayotte # Mayotte
# Zone NAME GMTOFF RULES FORMAT [UNTIL] # See Africa/Nairobi.
Zone Indian/Mayotte 3:00:56 - LMT 1911 Jul # Mamoutzou
3:00 - EAT
# Morocco # Morocco
# See the 'europe' file for Spanish Morocco (Africa/Ceuta). # 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. # See Africa/Abidjan.
# Somalia # Somalia
# Zone NAME GMTOFF RULES FORMAT [UNTIL] # See Africa/Nairobi.
Zone Africa/Mogadishu 3:01:28 - LMT 1893 Nov
3:00 - EAT 1931
2:30 - BEAT 1957
3:00 - EAT
# South Africa # South Africa
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
@ -1119,11 +1093,7 @@ Link Africa/Khartoum Africa/Juba
# See Africa/Johannesburg. # See Africa/Johannesburg.
# Tanzania # Tanzania
# Zone NAME GMTOFF RULES FORMAT [UNTIL] # See Africa/Nairobi.
Zone Africa/Dar_es_Salaam 2:37:08 - LMT 1931
3:00 - EAT 1948
2:45 - BEAUT 1961
3:00 - EAT
# Togo # Togo
# See Africa/Abidjan. # See Africa/Abidjan.
@ -1229,12 +1199,7 @@ Zone Africa/Tunis 0:40:44 - LMT 1881 May 12
1:00 Tunisia CE%sT 1:00 Tunisia CE%sT
# Uganda # Uganda
# Zone NAME GMTOFF RULES FORMAT [UNTIL] # See Africa/Nairobi.
Zone Africa/Kampala 2:09:40 - LMT 1928 Jul
3:00 - EAT 1930
2:30 - BEAT 1948
2:45 - BEAUT 1957
3:00 - EAT
# Zambia # Zambia
# Zimbabwe # Zimbabwe

View File

@ -29,20 +29,19 @@
# tz@iana.org for general use in the future). For more, please see # tz@iana.org for general use in the future). For more, please see
# the file CONTRIBUTING in the tz distribution. # 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), # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
# San Diego: ACS Publications, Inc. (2003). # San Diego: ACS Publications, Inc. (2003).
# Unfortunately this book contains many errors and cites no sources.
# #
# Gwillim Law writes that a good source # Gwillim Law writes that a good source
# for recent time zone data is the International Air Transport # for recent time zone data is the International Air Transport
# Association's Standard Schedules Information Manual (IATA SSIM), # Association's Standard Schedules Information Manual (IATA SSIM),
# published semiannually. Law sent in several helpful summaries # 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.
# #
# Another source occasionally used is Edward W. Whitman, World Time Differences, # Another source occasionally used is Edward W. Whitman, World Time Differences,
# Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated), which # 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) # Korea (North and South)
# From Annie I. Bang (2006-07-10): # From Annie I. Bang (2006-07-10):
# http://www.koreaherald.co.kr/SITE/data/html_dir/2006/07/10/200607100012.asp # http://www.koreaherald.com/view.php?ud=200607100012
# The Ministry of Commerce, Industry and Energy has already # Korea ran a daylight saving program from 1949-61 but stopped it
# commissioned a research project [to reintroduce DST] and has said # during the 1950-53 Korean War. The system was temporarily enforced
# the system may begin as early as 2008.... Korea ran a daylight # between 1987 and 1988 ...
# saving program from 1949-61 but stopped it during the 1950-53 Korean War.
# 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 NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule ROK 1960 only - May 15 0:00 1:00 D Rule ROK 1948 only - Jun 1 0:00 1:00 D
Rule ROK 1960 only - Sep 13 0:00 0 S Rule ROK 1948 only - Sep 13 0:00 0 S
Rule ROK 1987 1988 - May Sun>=8 0:00 1:00 D Rule ROK 1949 only - Apr 3 0:00 1:00 D
Rule ROK 1987 1988 - Oct Sun>=8 0:00 0 S 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): # From Paul Eggert (2014-10-30):
# The following entries are from Shanks & Pottenger, except that I # The Korean Wikipedia entry gives the following sources for UT offsets:
# guessed that time zone abbreviations through 1945 followed the same #
# 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 # rules as discussed under Taiwan, with nominal switches from JST to KST
# when the respective cities were taken over by the Allies after WWII. # 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 NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Seoul 8:27:52 - LMT 1890 Zone Asia/Seoul 8:27:52 - LMT 1908 Apr 1
8:30 - KST 1904 Dec 8:30 - KST 1912 Jan 1
9:00 - JCST 1928
8:30 - KST 1932
9:00 - JCST 1937 Oct 1 9:00 - JCST 1937 Oct 1
9:00 - JST 1945 Sep 8 9:00 - JST 1945 Sep 8
9:00 - KST 1954 Mar 21 9:00 - KST 1954 Mar 21
8:00 ROK K%sT 1961 Aug 10 8:30 ROK K%sT 1961 Aug 10
8:30 - KST 1968 Oct
9:00 ROK K%sT 9:00 ROK K%sT
Zone Asia/Pyongyang 8:23:00 - LMT 1890 Zone Asia/Pyongyang 8:23:00 - LMT 1908 Apr 1
8:30 - KST 1904 Dec 8:30 - KST 1912 Jan 1
9:00 - JCST 1928
8:30 - KST 1932
9:00 - JCST 1937 Oct 1 9:00 - JCST 1937 Oct 1
9:00 - JST 1945 Aug 24 9:00 - JST 1945 Aug 24
9:00 - KST 1954 Mar 21
8:00 - KST 1961 Aug 10
9:00 - KST 9:00 - KST
############################################################################### ###############################################################################

View File

@ -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 # tz@iana.org for general use in the future). For more, please see
# the file CONTRIBUTING in the tz distribution. # 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), # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
# San Diego: ACS Publications, Inc. (2003). # San Diego: ACS Publications, Inc. (2003).
# Unfortunately this book contains many errors and cites no sources.
# #
# Gwillim Law writes that a good source # Gwillim Law writes that a good source
# for recent time zone data is the International Air Transport # for recent time zone data is the International Air Transport
# Association's Standard Schedules Information Manual (IATA SSIM), # Association's Standard Schedules Information Manual (IATA SSIM),
# published semiannually. Law sent in several helpful summaries # 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.
# #
# Another source occasionally used is Edward W. Whitman, World Time Differences, # Another source occasionally used is Edward W. Whitman, World Time Differences,
# Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated), which # Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated), which

View File

@ -29,16 +29,19 @@
# tz@iana.org for general use in the future). For more, please see # tz@iana.org for general use in the future). For more, please see
# the file CONTRIBUTING in the tz distribution. # the file CONTRIBUTING in the tz distribution.
# From Paul Eggert (2014-05-31): # 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), # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
# San Diego: ACS Publications, Inc. (2003). # San Diego: ACS Publications, Inc. (2003).
# Unfortunately this book contains many errors and cites no sources.
# #
# Gwillim Law writes that a good source # Gwillim Law writes that a good source
# for recent time zone data is the International Air Transport # for recent time zone data is the International Air Transport
# Association's Standard Schedules Information Manual (IATA SSIM), # Association's Standard Schedules Information Manual (IATA SSIM),
# published semiannually. Law sent in several helpful summaries # 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 # A reliable and entertaining source about time zones is
# Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997). # Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997).
@ -310,6 +313,14 @@
# "Timeball on the ballast office is down. Dunsink time." # "Timeball on the ballast office is down. Dunsink time."
# -- James Joyce, Ulysses # -- 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): # From Joseph S. Myers (2005-01-26):
# Irish laws are available online at <http://www.irishstatutebook.ie>. # Irish laws are available online at <http://www.irishstatutebook.ie>.
# These include various relating to legal time, for example: # 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 2010 - Mar lastSun 2:00s 1:00 S
Rule Russia 1993 1995 - Sep lastSun 2:00s 0 - Rule Russia 1993 1995 - Sep lastSun 2:00s 0 -
Rule Russia 1996 2010 - Oct 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): # From Alexander Krivenyshev (2011-06-14):
# According to Kremlin press service, Russian President Dmitry Medvedev # According to Kremlin press service, Russian President Dmitry Medvedev

View File

@ -33,8 +33,8 @@
# The NTP Timescale and Leap Seconds # The NTP Timescale and Leap Seconds
# http://www.eecis.udel.edu/~mills/leap.html # http://www.eecis.udel.edu/~mills/leap.html
# The International Earth Rotation Service periodically uses leap seconds # The International Earth Rotation and Reference Systems Service
# to keep UTC to within 0.9 s of UT1 # 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 # (which measures the true angular orientation of the earth in space); see
# Terry J Quinn, The BIPM and the accurate measure of time, # 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>. # Proc IEEE 79, 7 (July 1991), 894-905 <http://dx.doi.org/10.1109/5.84965>.

View File

@ -1014,19 +1014,19 @@ Zone America/Menominee -5:50:27 - LMT 1885 Sep 18 12:00
################################################################################ ################################################################################
# From Paul Eggert (2006-03-22): # 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), # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
# San Diego: ACS Publications, Inc. (2003). # San Diego: ACS Publications, Inc. (2003).
# Unfortunately this book contains many errors and cites no sources.
# #
# Gwillim Law writes that a good source # Gwillim Law writes that a good source
# for recent time zone data is the International Air Transport # for recent time zone data is the International Air Transport
# Association's Standard Schedules Information Manual (IATA SSIM), # Association's Standard Schedules Information Manual (IATA SSIM),
# published semiannually. Law sent in several helpful summaries # 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.
# #
# Other sources occasionally used include: # 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): # From Paul Eggert (2014-08-19):
# The 2014-08-13 Cabinet meeting decided to stay on UTC-4 year-round. See: # 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 # 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 NAME GMTOFF RULES FORMAT [UNTIL]
Zone America/Grand_Turk -4:44:32 - LMT 1890 Zone America/Grand_Turk -4:44:32 - LMT 1890
-5:07:11 - KMT 1912 Feb # Kingston Mean Time -5:07:11 - KMT 1912 Feb # Kingston Mean Time
-5:00 - EST 1979 -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 -4:00 - AST
# British Virgin Is # British Virgin Is

View File

@ -29,23 +29,23 @@
# tz@iana.org for general use in the future). For more, please see # tz@iana.org for general use in the future). For more, please see
# the file CONTRIBUTING in the tz distribution. # the file CONTRIBUTING in the tz distribution.
# From Paul Eggert (2006-03-22): # 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), # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
# San Diego: ACS Publications, Inc. (2003). # San Diego: ACS Publications, Inc. (2003).
# # Unfortunately this book contains many errors and cites no sources.
# 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
# #
# Gwillim Law writes that a good source # Gwillim Law writes that a good source
# for recent time zone data is the International Air Transport # for recent time zone data is the International Air Transport
# Association's Standard Schedules Information Manual (IATA SSIM), # Association's Standard Schedules Information Manual (IATA SSIM),
# published semiannually. Law sent in several helpful summaries # 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 # For data circa 1899, a common source is:
# entries through 1990, and IATA SSIM is the source for entries afterwards. # 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 # 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 # ARDT for Argentine Standard and Daylight Time), but the following quote

View File

@ -29,9 +29,9 @@ GENSRC_AWT_ICONS_TMP := $(JDK_OUTPUTDIR)/gensrc
GENSRC_AWT_ICONS_DST := $(GENSRC_AWT_ICONS_TMP)/java.desktop/sun/awt/ GENSRC_AWT_ICONS_DST := $(GENSRC_AWT_ICONS_TMP)/java.desktop/sun/awt/
ifdef OPENJDK 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 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 endif
GENSRC_AWT_ICONS_SRC += \ GENSRC_AWT_ICONS_SRC += \

View File

@ -95,8 +95,8 @@ ifneq ($(COMPILE_TYPE), cross)
-I$(JDK_TOPDIR)/src/java.base/share/native/include \ -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/$(OPENJDK_TARGET_OS_EXPORT_DIR)/native/include \
-I$(JDK_TOPDIR)/src/java.base/share/native/libjava \ -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$(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/share/native/common/awt/debug \ -I$(JDK_TOPDIR)/src/java.desktop/share/native/common/awt/debug \
-I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/awt/image/cvutils \ -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/awt/image/cvutils \
# #

View File

@ -42,7 +42,7 @@ UNPACKEXE_SRC := $(JDK_TOPDIR)/src/jdk.runtime/share/native/common-unpack \
$(JDK_TOPDIR)/src/jdk.runtime/share/native/unpack200 $(JDK_TOPDIR)/src/jdk.runtime/share/native/unpack200
UNPACKEXE_CFLAGS := -I$(JDK_TOPDIR)/src/jdk.runtime/share/native/common-unpack \ 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/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) ifeq ($(USE_EXTERNAL_LIBZ), true)
UNPACKEXE_CFLAGS += -DSYSTEM_ZLIB UNPACKEXE_CFLAGS += -DSYSTEM_ZLIB
@ -102,7 +102,7 @@ $(eval $(call SetupNativeCompilation,BUILD_UNPACKEXE, \
MAPFILE := $(UNPACK_MAPFILE),\ MAPFILE := $(UNPACK_MAPFILE),\
LDFLAGS := $(UNPACKEXE_ZIPOBJS), \ LDFLAGS := $(UNPACKEXE_ZIPOBJS), \
LDFLAGS_windows := $(CXXFLAGS_JDKEXE), \ 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_NAME,$(LIBRARY_PREFIX)unpack$(SHARED_LIBRARY_SUFFIX)) \
$(call SET_SHARED_LIBRARY_ORIGIN), \ $(call SET_SHARED_LIBRARY_ORIGIN), \
LDFLAGS_linux := -lc, \ LDFLAGS_linux := -lc, \

View File

@ -62,7 +62,7 @@ endif
LAUNCHER_SRC := $(JDK_TOPDIR)/src/java.base/share/native/launcher LAUNCHER_SRC := $(JDK_TOPDIR)/src/java.base/share/native/launcher
LAUNCHER_CFLAGS := -I$(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/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 \ -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 GLOBAL_VERSION_INFO_RESOURCE := $(JDK_TOPDIR)/src/java.base/windows/native/common/version.rc
@ -71,10 +71,10 @@ MACOSX_PLIST_DIR := $(JDK_TOPDIR)/src/java.base/macosx/native/launcher
# Until the shuffle is permanent, we can't add this in configure # Until the shuffle is permanent, we can't add this in configure
CFLAGS_JDKEXE := $(filter-out %javavm/export, $(CFLAGS_JDKEXE)) CFLAGS_JDKEXE := $(filter-out %javavm/export, $(CFLAGS_JDKEXE))
CFLAGS_JDKEXE += -I$(JDK_TOPDIR)/src/java.base/share/native/include \ 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 := $(filter-out %javavm/export, $(CXXFLAGS_JDKEXE))
CXXFLAGS_JDKEXE += -I$(JDK_TOPDIR)/src/java.base/share/native/include \ 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 JAVA_MANIFEST := $(JDK_TOPDIR)/src/java.base/windows/native/launcher/java.manifest
define SetupLauncher define SetupLauncher
@ -82,7 +82,7 @@ define SetupLauncher
# Parameter 1 is the name of the launcher (java, javac, jar...) # Parameter 1 is the name of the launcher (java, javac, jar...)
# Parameter 2 is extra CFLAGS # Parameter 2 is extra CFLAGS
# Parameter 3 is extra LDFLAGS # 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 5 is extra LDFLAGS_SUFFIX_windows
# Parameter 6 is optional Windows JLI library (full path) # Parameter 6 is optional Windows JLI library (full path)
# Parameter 7 is optional Windows resource (RC) flags # Parameter 7 is optional Windows resource (RC) flags
@ -187,7 +187,7 @@ define SetupLauncher
$(call SET_SHARED_LIBRARY_NAME,$(LIBRARY_PREFIX)$(SHARED_LIBRARY_SUFFIX)), \ $(call SET_SHARED_LIBRARY_NAME,$(LIBRARY_PREFIX)$(SHARED_LIBRARY_SUFFIX)), \
MAPFILE := $$($1_MAPFILE), \ MAPFILE := $$($1_MAPFILE), \
LDFLAGS_SUFFIX := $(LDFLAGS_JDKEXE_SUFFIX) $$($1_LDFLAGS_SUFFIX), \ LDFLAGS_SUFFIX := $(LDFLAGS_JDKEXE_SUFFIX) $$($1_LDFLAGS_SUFFIX), \
LDFLAGS_SUFFIX_posix := $4, \ LDFLAGS_SUFFIX_unix := $4, \
LDFLAGS_SUFFIX_windows := $$($1_WINDOWS_JLI_LIB) \ LDFLAGS_SUFFIX_windows := $$($1_WINDOWS_JLI_LIB) \
$(JDK_OUTPUTDIR)/objs/libjava/java.lib advapi32.lib $5, \ $(JDK_OUTPUTDIR)/objs/libjava/java.lib advapi32.lib $5, \
LDFLAGS_SUFFIX_linux := -L$(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/jli -ljli $(LIBDL) -lc, \ LDFLAGS_SUFFIX_linux := -L$(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/jli -ljli $(LIBDL) -lc, \
@ -231,4 +231,3 @@ ifdef OPENJDK
else else
JAVA_RC_FLAGS += -i "$(JDK_TOPDIR)/src/closed/java.base/windows/native/launcher/icons" JAVA_RC_FLAGS += -i "$(JDK_TOPDIR)/src/closed/java.base/windows/native/launcher/icons"
endif endif

View File

@ -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 $(JDK_TOPDIR)/src/java.desktop/share/native/common/awt/medialib
BUILD_LIBMLIB_CFLAGS := -D__USE_J2D_NAMES -D__MEDIALIB_OLD_NAMES \ BUILD_LIBMLIB_CFLAGS := -D__USE_J2D_NAMES -D__MEDIALIB_OLD_NAMES \
$(addprefix -I, $(BUILD_LIBMLIB_SRC)) \ $(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_LDLIBS :=
BUILD_LIBMLIB_IMAGE_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libmlib_image/mapfile-vers 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 \ 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/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) ifeq ($(OPENJDK_TARGET_OS), aix)
@ -211,7 +211,7 @@ ifeq ($(OPENJDK_TARGET_OS), windows)
# Why does libawt need java.base headers? # Why does libawt need java.base headers?
LIBAWT_CFLAGS += -I$(JDK_TOPDIR)/src/java.desktop/share/native/common/font \ 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/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/windows/native/include \
-I$(JDK_TOPDIR)/src/java.desktop/share/native/include \ -I$(JDK_TOPDIR)/src/java.desktop/share/native/include \
-I$(JDK_OUTPUTDIR)/gensrc_headers/java.base \ -I$(JDK_OUTPUTDIR)/gensrc_headers/java.base \
@ -298,15 +298,15 @@ ifeq ($(findstring $(OPENJDK_TARGET_OS),windows macosx),)
ifndef BUILD_HEADLESS_ONLY ifndef BUILD_HEADLESS_ONLY
LIBAWT_XAWT_DIRS := \ LIBAWT_XAWT_DIRS := \
$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/libawt_xawt \ $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/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/libjawt \
$(JDK_TOPDIR)/src/java.desktop/share/native/common/awt/debug \ $(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/awt/utility \
$(JDK_TOPDIR)/src/java.desktop/share/native/common/font \ $(JDK_TOPDIR)/src/java.desktop/share/native/common/font \
$(JDK_TOPDIR)/src/java.desktop/share/native/common/java2d/opengl \ $(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_TYPE)/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/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/awt \
# #
LIBAWT_XAWT_EXCLUDES := medialib LIBAWT_XAWT_EXCLUDES := medialib
@ -315,15 +315,15 @@ ifeq ($(findstring $(OPENJDK_TARGET_OS),windows macosx),)
-I$(JDK_OUTPUTDIR)/gensrc_headers/java.desktop \ -I$(JDK_OUTPUTDIR)/gensrc_headers/java.desktop \
-I$(JDK_TOPDIR)/src/java.desktop/share/native/include \ -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)/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/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/loops \
-I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/java2d/pipe \ -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/cvutils \
-I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/awt/image \ -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_TYPE)/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/common/font \
$(LIBJAVA_HEADER_FLAGS) $(LIBJAVA_HEADER_FLAGS)
# #
@ -514,14 +514,14 @@ DESKTOP_LIBRARIES += $(BUILD_LIBJAVAJPEG)
################################################################################ ################################################################################
LIBFONTMANAGER_SRC := $(JDK_TOPDIR)/src/java.desktop/share/native/libfontmanager \ 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 := \ LIBFONTMANAGER_CFLAGS := \
$(addprefix -I, $(shell $(FIND) \ $(addprefix -I, $(shell $(FIND) \
$(LIBFONTMANAGER_SRC) \ $(LIBFONTMANAGER_SRC) \
$(JDK_TOPDIR)/src/java.desktop/share/native/libawt \ $(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/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$(JDK_OUTPUTDIR)/gensrc_headers/java.desktop \ -I$(JDK_OUTPUTDIR)/gensrc_headers/java.desktop \
$(LIBJAVA_HEADER_FLAGS) \ $(LIBJAVA_HEADER_FLAGS) \
# #
@ -542,7 +542,7 @@ ifeq ($(OPENJDK_TARGET_OS), windows)
LIBFONTMANAGER_EXCLUDE_FILES += X11FontScaler.c \ LIBFONTMANAGER_EXCLUDE_FILES += X11FontScaler.c \
X11TextRenderer.c X11TextRenderer.c
LIBFONTMANAGER_OPTIMIZATION := HIGHEST 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) else ifeq ($(OPENJDK_TARGET_OS), macosx)
LIBFONTMANAGER_EXCLUDE_FILES += X11FontScaler.c \ LIBFONTMANAGER_EXCLUDE_FILES += X11FontScaler.c \
X11TextRenderer.c \ X11TextRenderer.c \
@ -606,12 +606,12 @@ DESKTOP_LIBRARIES += $(BUILD_LIBFONTMANAGER)
################################################################################ ################################################################################
ifeq ($(OPENJDK_TARGET_OS), windows) ifeq ($(OPENJDK_TARGET_OS), windows)
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
LIBJAWT_CFLAGS := -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/libawt/windows \ 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/common/awt/debug \
-I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/java2d \ -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/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$(JDK_OUTPUTDIR)/gensrc_headers/java.desktop \ -I$(JDK_OUTPUTDIR)/gensrc_headers/java.desktop \
-I$(JDK_TOPDIR)/src/java.desktop/windows/native/include \ -I$(JDK_TOPDIR)/src/java.desktop/windows/native/include \
-I$(JDK_TOPDIR)/src/java.desktop/share/native/include \ -I$(JDK_TOPDIR)/src/java.desktop/share/native/include \
@ -655,12 +655,12 @@ else # OPENJDK_TARGET_OS not windows
ifeq ($(OPENJDK_TARGET_OS), macosx) ifeq ($(OPENJDK_TARGET_OS), macosx)
LIBJAWT_SRC := $(JDK_TOPDIR)/src/java.desktop/macosx/native/libjawt LIBJAWT_SRC := $(JDK_TOPDIR)/src/java.desktop/macosx/native/libjawt
else 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 endif
LIBJAWT_CFLAGS := \ 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)/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 \ -I$(JDK_TOPDIR)/src/java.desktop/share/native/include \
$(LIBJAVA_HEADER_FLAGS) \ $(LIBJAVA_HEADER_FLAGS) \
# #
@ -724,9 +724,9 @@ ifeq ($(BUILD_HEADLESS), true)
ifeq ($(findstring $(OPENJDK_TARGET_OS), windows macosx),) ifeq ($(findstring $(OPENJDK_TARGET_OS), windows macosx),)
LIBAWT_HEADLESS_DIRS := $(JDK_TOPDIR)/src/java.desktop/unix/native/libawt_headless/awt \ 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_TYPE)/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_TYPE)/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/java2d/x11 \
$(JDK_TOPDIR)/src/java.desktop/share/native/common/java2d/opengl \ $(JDK_TOPDIR)/src/java.desktop/share/native/common/java2d/opengl \
$(JDK_TOPDIR)/src/java.desktop/share/native/common/font \ $(JDK_TOPDIR)/src/java.desktop/share/native/common/font \
# #
@ -739,11 +739,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/awt/image/cvutils \
-I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/java2d/pipe \ -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/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/font \
-I$(JDK_TOPDIR)/src/java.desktop/share/native/common/awt/debug \ -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_TYPE)/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/libsunwjdga/ \
$(LIBJAVA_HEADER_FLAGS) \ $(LIBJAVA_HEADER_FLAGS) \
# #
@ -817,7 +817,7 @@ ifndef BUILD_HEADLESS_ONLY
endif endif
ifneq ($(OPENJDK_TARGET_OS), macosx) 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 else
LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/java.desktop/macosx/native/libsplashscreen LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/java.desktop/macosx/native/libsplashscreen
endif endif
@ -988,7 +988,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/libawt_lwawt/awt \
-I$(JDK_TOPDIR)/src/java.desktop/macosx/native/libosxapp \ -I$(JDK_TOPDIR)/src/java.desktop/macosx/native/libosxapp \
-I$(JDK_TOPDIR)/src/java.base/share/native/libjava \ -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$(JDK_OUTPUTDIR)/gensrc_headers/java.desktop, \ -I$(JDK_OUTPUTDIR)/gensrc_headers/java.desktop, \
LDFLAGS := $(LDFLAGS_JDKLIB) \ LDFLAGS := $(LDFLAGS_JDKLIB) \
$(call SET_SHARED_LIBRARY_ORIGIN) \ $(call SET_SHARED_LIBRARY_ORIGIN) \

View File

@ -99,7 +99,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBVERIFY, \
MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libverify/mapfile-vers, \ MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libverify/mapfile-vers, \
LDFLAGS := $(LDFLAGS_JDKLIB) \ LDFLAGS := $(LDFLAGS_JDKLIB) \
$(call SET_SHARED_LIBRARY_ORIGIN), \ $(call SET_SHARED_LIBRARY_ORIGIN), \
LDFLAGS_SUFFIX_posix := -ljvm -lc, \ LDFLAGS_SUFFIX_unix := -ljvm -lc, \
LDFLAGS_SUFFIX_windows := jvm.lib, \ LDFLAGS_SUFFIX_windows := jvm.lib, \
VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \ VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
RC_FLAGS := $(RC_FLAGS) \ RC_FLAGS := $(RC_FLAGS) \
@ -160,7 +160,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBJAVA, \
MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjava/mapfile-vers, \ MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjava/mapfile-vers, \
LDFLAGS := $(LDFLAGS_JDKLIB) \ LDFLAGS := $(LDFLAGS_JDKLIB) \
$(call SET_SHARED_LIBRARY_ORIGIN), \ $(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_solaris := -lsocket -lnsl -lscf $(LIBDL) $(BUILD_LIBFDLIBM) -lc, \
LDFLAGS_SUFFIX_linux := $(LIBDL) $(BUILD_LIBFDLIBM), \ LDFLAGS_SUFFIX_linux := $(LIBDL) $(BUILD_LIBFDLIBM), \
LDFLAGS_SUFFIX_aix := $(LIBDL) $(BUILD_LIBFDLIBM) -lm,\ LDFLAGS_SUFFIX_aix := $(LIBDL) $(BUILD_LIBFDLIBM) -lm,\
@ -216,9 +216,9 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBZIP, \
CFLAGS := $(CFLAGS_JDKLIB) \ CFLAGS := $(CFLAGS_JDKLIB) \
$(ZLIB_CPPFLAGS) \ $(ZLIB_CPPFLAGS) \
-I$(JDK_TOPDIR)/src/java.base/share/native/libjava \ -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$(JDK_OUTPUTDIR)/gensrc_headers/java.base, \ -I$(JDK_OUTPUTDIR)/gensrc_headers/java.base, \
CFLAGS_posix := $(BUILD_LIBZIP_MMAP) -UDEBUG, \ CFLAGS_unix := $(BUILD_LIBZIP_MMAP) -UDEBUG, \
MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libzip/mapfile-vers, \ MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libzip/mapfile-vers, \
REORDER := $(BUILD_LIBZIP_REORDER), \ REORDER := $(BUILD_LIBZIP_REORDER), \
LDFLAGS := $(LDFLAGS_JDKLIB) \ LDFLAGS := $(LDFLAGS_JDKLIB) \
@ -247,7 +247,7 @@ BASE_LIBRARIES += $(BUILD_LIBZIP)
########################################################################################## ##########################################################################################
BUILD_LIBJLI_SRC_DIRS := $(JDK_TOPDIR)/src/java.base/share/native/libjli \ 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) LIBJLI_CFLAGS := $(CFLAGS_JDKLIB)
@ -291,7 +291,7 @@ else ifneq ($(OPENJDK_TARGET_OS), macosx)
# if the architecture specific ergo file exists then # if the architecture specific ergo file exists then
# use it, else use the generic definitions from ergo.c # 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) BUILD_LIBJLI_FILES += $(ERGO_ARCH_FILE)
else # !ERGO_ARCH_FILE else # !ERGO_ARCH_FILE
LIBJLI_CFLAGS += -DUSE_GENERIC_ERGO LIBJLI_CFLAGS += -DUSE_GENERIC_ERGO

View File

@ -28,7 +28,7 @@ include LibCommon.gmk
################################################################################ ################################################################################
LIBINSTRUMENT_SRC := $(JDK_TOPDIR)/src/java.instrument/share/native/libinstrument \ 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) \ LIBINSTRUMENT_CFLAGS := $(CFLAGS_JDKLIB) \
$(addprefix -I, $(LIBINSTRUMENT_SRC)) \ $(addprefix -I, $(LIBINSTRUMENT_SRC)) \

View File

@ -31,7 +31,7 @@ $(eval $(call IncludeCustomExtension, jdk, lib/Lib-java.management.gmk))
################################################################################ ################################################################################
BUILD_LIBMANAGEMENT_SRC += $(JDK_TOPDIR)/src/java.management/share/native/libmanagement \ 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 \ BUILD_LIBMANAGEMENT_CFLAGS := -I$(JDK_TOPDIR)/src/java.management/share/native/include \
$(addprefix -I,$(BUILD_LIBMANAGEMENT_SRC)) \ $(addprefix -I,$(BUILD_LIBMANAGEMENT_SRC)) \
-I$(JDK_OUTPUTDIR)/gensrc_headers/java.management \ -I$(JDK_OUTPUTDIR)/gensrc_headers/java.management \

View File

@ -30,7 +30,7 @@ include LibCommon.gmk
ifeq ($(OPENJDK_TARGET_OS), macosx) ifeq ($(OPENJDK_TARGET_OS), macosx)
LIBPREF_SRC_DIRS := $(JDK_TOPDIR)/src/java.prefs/macosx/native/libprefs LIBPREF_SRC_DIRS := $(JDK_TOPDIR)/src/java.prefs/macosx/native/libprefs
else 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 endif
$(eval $(call SetupNativeCompilation,BUILD_LIBPREFS, \ $(eval $(call SetupNativeCompilation,BUILD_LIBPREFS, \

View File

@ -29,7 +29,7 @@ include LibCommon.gmk
ifneq ($(OPENJDK_TARGET_OS), windows) ifneq ($(OPENJDK_TARGET_OS), windows)
LIBJ2GSS_SRC := $(JDK_TOPDIR)/src/java.security.jgss/share/native/libj2gss \ 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, \ $(eval $(call SetupNativeCompilation,BUILD_LIBJ2GSS, \
@ -58,7 +58,7 @@ ifneq ($(BUILD_CRYPTO), no)
BUILD_LIBKRB5_NAME := BUILD_LIBKRB5_NAME :=
ifeq ($(OPENJDK_TARGET_OS), windows) ifeq ($(OPENJDK_TARGET_OS), windows)
BUILD_LIBKRB5_NAME := w2k_lsa_auth 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 \ BUILD_LIBKRB5_LIBS := advapi32.lib Secur32.lib netapi32.lib kernel32.lib user32.lib \
gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib \ gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib \
ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib

View File

@ -28,9 +28,9 @@ include LibCommon.gmk
################################################################################ ################################################################################
LIBJ2PCSC_SRC := $(JDK_TOPDIR)/src/java.smartcardio/share/native/libj2pcsc \ 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)) \ 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$(JDK_OUTPUTDIR)/gensrc_headers/java.smartcardio -I$(JDK_OUTPUTDIR)/gensrc_headers/java.smartcardio
$(eval $(call SetupNativeCompilation,BUILD_LIBJ2PCSC, \ $(eval $(call SetupNativeCompilation,BUILD_LIBJ2PCSC, \
@ -38,13 +38,13 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBJ2PCSC, \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
SRC := $(LIBJ2PCSC_SRC), \ SRC := $(LIBJ2PCSC_SRC), \
LANG := C, \ LANG := C, \
CFLAGS_posix := -D__sun_jdk, \ CFLAGS_unix := -D__sun_jdk, \
OPTIMIZATION := LOW, \ OPTIMIZATION := LOW, \
CFLAGS := $(CFLAGS_JDKLIB) $(LIBJ2PCSC_CPPFLAGS), \ CFLAGS := $(CFLAGS_JDKLIB) $(LIBJ2PCSC_CPPFLAGS), \
MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libj2pcsc/mapfile-vers, \ MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libj2pcsc/mapfile-vers, \
LDFLAGS := $(LDFLAGS_JDKLIB) \ LDFLAGS := $(LDFLAGS_JDKLIB) \
$(call SET_SHARED_LIBRARY_ORIGIN), \ $(call SET_SHARED_LIBRARY_ORIGIN), \
LDFLAGS_SUFFIX_posix := $(LIBDL), \ LDFLAGS_SUFFIX_unix := $(LIBDL), \
LDFLAGS_SUFFIX_windows := winscard.lib, \ LDFLAGS_SUFFIX_windows := winscard.lib, \
LDFLAGS_SUFFIX_solaris := -lc, \ LDFLAGS_SUFFIX_solaris := -lc, \
VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \ VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \

View File

@ -29,7 +29,7 @@ include LibCommon.gmk
ifeq ($(OPENJDK_TARGET_OS), windows) 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, \ $(eval $(call SetupNativeCompilation,BUILD_LIBSUNMSCAPI, \
LIBRARY := sunmscapi, \ LIBRARY := sunmscapi, \

View File

@ -28,7 +28,7 @@ include LibCommon.gmk
################################################################################ ################################################################################
LIBJ2PKCS11_SRC := $(JDK_TOPDIR)/src/jdk.crypto.pkcs11/share/native/libj2pkcs11 \ 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, \ $(eval $(call SetupNativeCompilation,BUILD_LIBJ2PKCS11, \
LIBRARY := j2pkcs11, \ LIBRARY := j2pkcs11, \
@ -42,7 +42,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBJ2PKCS11, \
MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libj2pkcs11/mapfile-vers, \ MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libj2pkcs11/mapfile-vers, \
LDFLAGS := $(LDFLAGS_JDKLIB) \ LDFLAGS := $(LDFLAGS_JDKLIB) \
$(call SET_SHARED_LIBRARY_ORIGIN), \ $(call SET_SHARED_LIBRARY_ORIGIN), \
LDFLAGS_SUFFIX_posix := $(LIBDL), \ LDFLAGS_SUFFIX_unix := $(LIBDL), \
LDFLAGS_SUFFIX_solaris := -lc, \ LDFLAGS_SUFFIX_solaris := -lc, \
VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \ VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
RC_FLAGS := $(RC_FLAGS) \ RC_FLAGS := $(RC_FLAGS) \

View File

@ -30,7 +30,7 @@ include LibCommon.gmk
ifeq ($(OPENJDK_TARGET_OS), windows) ifeq ($(OPENJDK_TARGET_OS), windows)
LIBDT_SHMEM_SRC := $(JDK_TOPDIR)/src/jdk.jdi/share/native/libdt_shmem \ 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) \ LIBDT_SHMEM_CPPFLAGS := -I$(INCLUDEDIR) -I$(JDK_OUTPUTDIR)/include/$(OPENJDK_TARGET_OS) \
$(addprefix -I, $(LIBDT_SHMEM_SRC)) \ $(addprefix -I, $(LIBDT_SHMEM_SRC)) \

View File

@ -28,7 +28,7 @@ include LibCommon.gmk
################################################################################ ################################################################################
LIBDT_SOCKET_SRC := $(JDK_TOPDIR)/src/jdk.jdwp.agent/share/native/libdt_socket \ 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 := \ LIBDT_SOCKET_CPPFLAGS := \
$(addprefix -I, $(LIBDT_SOCKET_SRC)) \ $(addprefix -I, $(LIBDT_SOCKET_SRC)) \
-I$(JDK_TOPDIR)/src/jdk.jdwp.agent/share/native/libjdwp/export \ -I$(JDK_TOPDIR)/src/jdk.jdwp.agent/share/native/libjdwp/export \
@ -66,7 +66,7 @@ JDWP_LIBRARIES += $(BUILD_LIBDT_SOCKET)
################################################################################ ################################################################################
LIBJDWP_SRC := $(JDK_TOPDIR)/src/jdk.jdwp.agent/share/native/libjdwp \ 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 := \ LIBJDWP_CPPFLAGS := \
-I$(JDK_TOPDIR)/src/jdk.jdwp.agent/share/native/libjdwp/export \ -I$(JDK_TOPDIR)/src/jdk.jdwp.agent/share/native/libjdwp/export \
-I$(JDK_TOPDIR)/src/jdk.jdwp.agent/share/native/include \ -I$(JDK_TOPDIR)/src/jdk.jdwp.agent/share/native/include \

View File

@ -45,7 +45,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBUNPACK, \
$(call SET_SHARED_LIBRARY_ORIGIN), \ $(call SET_SHARED_LIBRARY_ORIGIN), \
LDFLAGS_windows := -map:$(JDK_OUTPUTDIR)/objs/unpack.map -debug \ LDFLAGS_windows := -map:$(JDK_OUTPUTDIR)/objs/unpack.map -debug \
jvm.lib $(WIN_JAVA_LIB), \ jvm.lib $(WIN_JAVA_LIB), \
LDFLAGS_SUFFIX_posix := -ljvm $(LIBCXX) -ljava -lc, \ LDFLAGS_SUFFIX_unix := -ljvm $(LIBCXX) -ljava -lc, \
OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libunpack, \ OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libunpack, \
VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \ VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
RC_FLAGS := $(RC_FLAGS) \ RC_FLAGS := $(RC_FLAGS) \
@ -61,7 +61,7 @@ UNPACK_LIBRARIES += $(BUILD_LIBUNPACK)
################################################################################ ################################################################################
LIBJSDT_SRC := $(JDK_TOPDIR)/src/jdk.runtime/share/native/libjsdt \ 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, \ $(eval $(call SetupNativeCompilation,BUILD_LIBJSDT, \
LIBRARY := jsdt, \ LIBRARY := jsdt, \

View File

@ -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)) ifeq (, $(filter $(OPENJDK_TARGET_OS), macosx aix))
@ -40,11 +40,11 @@ ifeq ($(OPENJDK_TARGET_OS_API), posix)
$(eval $(call SetupNativeCompilation,BUILD_LIBSCTP, \ $(eval $(call SetupNativeCompilation,BUILD_LIBSCTP, \
LIBRARY := sctp, \ LIBRARY := sctp, \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ 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, \ LANG := C, \
OPTIMIZATION := LOW, \ OPTIMIZATION := LOW, \
CFLAGS := $(CFLAGS_JDKLIB) \ 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 \ -I $(JDK_TOPDIR)/src/java.base/share/native/libnio/ch \
$(addprefix -I, $(call FindSrcDirsForLib, java.base, net)) \ $(addprefix -I, $(call FindSrcDirsForLib, java.base, net)) \
$(LIBJAVA_HEADER_FLAGS) \ $(LIBJAVA_HEADER_FLAGS) \
@ -55,7 +55,7 @@ ifeq ($(OPENJDK_TARGET_OS_API), posix)
LDFLAGS := $(LDFLAGS_JDKLIB) \ LDFLAGS := $(LDFLAGS_JDKLIB) \
$(call SET_SHARED_LIBRARY_ORIGIN), \ $(call SET_SHARED_LIBRARY_ORIGIN), \
LDFLAGS_SUFFIX_linux := -lpthread $(LIBDL) -ljava -ljvm, \ 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_solaris := -lsocket -ljava -ljvm -lc, \
LDFLAGS_SUFFIX_macosx := -ljava -ljvm, \ LDFLAGS_SUFFIX_macosx := -ljava -ljvm, \
OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libsctp, \ OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libsctp, \

View File

@ -43,7 +43,7 @@ endif
$(eval $(call SetupNativeCompilation,BUILD_LIBJAAS, \ $(eval $(call SetupNativeCompilation,BUILD_LIBJAAS, \
LIBRARY := $(LIBJAAS_NAME), \ LIBRARY := $(LIBJAAS_NAME), \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ 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, \ LANG := C, \
OPTIMIZATION := LOW, \ OPTIMIZATION := LOW, \
CFLAGS := $(CFLAGS_JDKLIB) -I$(JDK_OUTPUTDIR)/gensrc_headers/jdk.security.auth, \ CFLAGS := $(CFLAGS_JDKLIB) -I$(JDK_OUTPUTDIR)/gensrc_headers/jdk.security.auth, \

View File

@ -34,8 +34,8 @@ include Tools.gmk
GLOBAL_VERSION_INFO_RESOURCE := $(JDK_TOPDIR)/src/java.base/windows/native/common/version.rc GLOBAL_VERSION_INFO_RESOURCE := $(JDK_TOPDIR)/src/java.base/windows/native/common/version.rc
# Put the libraries here. Different locations for different target apis. # Put the libraries here. Different locations for different target OS types.
ifeq ($(OPENJDK_TARGET_OS_API), posix) ifeq ($(OPENJDK_TARGET_OS_TYPE), unix)
INSTALL_LIBRARIES_HERE := $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR) INSTALL_LIBRARIES_HERE := $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)
else else
INSTALL_LIBRARIES_HERE := $(JDK_OUTPUTDIR)/bin INSTALL_LIBRARIES_HERE := $(JDK_OUTPUTDIR)/bin
@ -63,7 +63,7 @@ endif
# Param 2 - library name # Param 2 - library name
FindSrcDirsForLib = $(call uniq, $(wildcard \ FindSrcDirsForLib = $(call uniq, $(wildcard \
$(JDK_TOPDIR)/src/$(strip $1)/$(OPENJDK_TARGET_OS)/native/lib$(strip $2) \ $(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))) $(JDK_TOPDIR)/src/$(strip $1)/share/native/lib$(strip $2)))
################################################################################ ################################################################################

View File

@ -24,7 +24,7 @@
# #
LIBNET_SRC_DIRS := $(JDK_TOPDIR)/src/java.base/share/native/libnet \ 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$(JDK_OUTPUTDIR)/gensrc_headers/java.base \ LIBNET_CFLAGS += -I$(JDK_OUTPUTDIR)/gensrc_headers/java.base \
$(LIBJAVA_HEADER_FLAGS) $(LIBJAVA_HEADER_FLAGS)
@ -77,4 +77,3 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBNET, \
$(BUILD_LIBNET): $(BUILD_LIBJAVA) $(BUILD_LIBNET): $(BUILD_LIBJAVA)
BASE_LIBRARIES += $(BUILD_LIBNET) BASE_LIBRARIES += $(BUILD_LIBNET)

View File

@ -25,10 +25,10 @@
BUILD_LIBNIO_SRC := \ BUILD_LIBNIO_SRC := \
$(JDK_TOPDIR)/src/java.base/share/native/libnio/ch \ $(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 \ $(sort $(wildcard \
$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_API_DIR)/native/libnio/ch \ $(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/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/fs \
$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS)/native/libnio/ch \ $(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS)/native/libnio/ch \
$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS)/native/libnio/fs)) \ $(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS)/native/libnio/fs)) \
# #

View File

@ -25,7 +25,7 @@
LIBJSOUND_SRC_DIRS := \ LIBJSOUND_SRC_DIRS := \
$(JDK_TOPDIR)/src/java.desktop/share/native/libjsound \ $(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 := \ LIBJSOUND_CFLAGS := \
-I$(JDK_OUTPUTDIR)/gensrc_headers/java.desktop \ -I$(JDK_OUTPUTDIR)/gensrc_headers/java.desktop \
@ -169,7 +169,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBJSOUND, \
-framework CoreServices -framework AudioUnit $(LIBCXX) \ -framework CoreServices -framework AudioUnit $(LIBCXX) \
-framework CoreMIDI -framework AudioToolbox, \ -framework CoreMIDI -framework AudioToolbox, \
LDFLAGS_windows := $(WIN_JAVA_LIB) advapi32.lib winmm.lib, \ LDFLAGS_windows := $(WIN_JAVA_LIB) advapi32.lib winmm.lib, \
LDFLAGS_SUFFIX_posix := -ljava -ljvm, \ LDFLAGS_SUFFIX_unix := -ljava -ljvm, \
LDFLAGS_SUFFIX_solaris := -lc, \ LDFLAGS_SUFFIX_solaris := -lc, \
VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \ VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
RC_FLAGS := $(RC_FLAGS) \ RC_FLAGS := $(RC_FLAGS) \

View File

@ -95,7 +95,17 @@ class TzdbZoneRulesProvider {
obj = zones.get(zoneId); obj = zones.get(zoneId);
} }
if (obj == null) { 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) { if (obj instanceof ZoneRules) {

View File

@ -719,15 +719,15 @@ public final class Class<T> implements java.io.Serializable,
/** /**
* Returns the {@code Class} representing the superclass of the entity * Returns the {@code Class} representing the direct superclass of the
* (class, interface, primitive type or void) represented by this * entity (class, interface, primitive type or void) represented by
* {@code Class}. If this {@code Class} represents either the * this {@code Class}. If this {@code Class} represents either the
* {@code Object} class, an interface, a primitive type, or void, then * {@code Object} class, an interface, a primitive type, or void, then
* null is returned. If this object represents an array class then the * null is returned. If this object represents an array class then the
* {@code Class} object representing the {@code Object} class is * {@code Class} object representing the {@code Object} class is
* returned. * 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(); public native Class<? super T> getSuperclass();
@ -758,7 +758,7 @@ public final class Class<T> implements java.io.Serializable,
* @throws java.lang.reflect.MalformedParameterizedTypeException if the * @throws java.lang.reflect.MalformedParameterizedTypeException if the
* generic superclass refers to a parameterized type that cannot be * generic superclass refers to a parameterized type that cannot be
* instantiated for any reason * 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 * @since 1.5
*/ */
public Type getGenericSuperclass() { public Type getGenericSuperclass() {
@ -798,15 +798,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. * represented by this object.
* *
* <p>If this object represents a class, the return value is an array * <p>If this object represents a class, the return value is an array
* containing objects representing all interfaces implemented by the * containing objects representing all interfaces directly implemented by
* class. The order of the interface objects in the array corresponds to * the class. The order of the interface objects in the array corresponds
* the order of the interface names in the {@code implements} clause * to the order of the interface names in the {@code implements} clause of
* of the declaration of the class represented by this object. For * the declaration of the class represented by this object. For example,
* example, given the declaration: * given the declaration:
* <blockquote> * <blockquote>
* {@code class Shimmer implements FloorWax, DessertTopping { ... }} * {@code class Shimmer implements FloorWax, DessertTopping { ... }}
* </blockquote> * </blockquote>
@ -824,10 +824,10 @@ public final class Class<T> implements java.io.Serializable,
* {@code DessertTopping}. * {@code DessertTopping}.
* *
* <p>If this object represents an interface, the array contains objects * <p>If this object represents an interface, the array contains objects
* representing all interfaces extended by the interface. The order of the * representing all interfaces directly extended by the interface. The
* interface objects in the array corresponds to the order of the interface * order of the interface objects in the array corresponds to the order of
* names in the {@code extends} clause of the declaration of the * the interface names in the {@code extends} clause of the declaration of
* interface represented by this object. * 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. * interfaces, the method returns an array of length 0.
@ -839,7 +839,7 @@ public final class Class<T> implements java.io.Serializable,
* interfaces {@code Cloneable} and {@code java.io.Serializable} are * interfaces {@code Cloneable} and {@code java.io.Serializable} are
* returned in that order. * 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() { public Class<?>[] getInterfaces() {
ReflectionData<T> rd = reflectionData(); ReflectionData<T> rd = reflectionData();
@ -873,29 +873,28 @@ public final class Class<T> implements java.io.Serializable,
* for the semantics of the creation process for parameterized * for the semantics of the creation process for parameterized
* types. * types.
* *
* <p> If this object represents a class, the return value is an * <p>If this object represents a class, the return value is an array
* array containing objects representing all interfaces * containing objects representing all interfaces directly implemented by
* implemented by the class. The order of the interface objects in * the class. The order of the interface objects in the array corresponds
* the array corresponds to the order of the interface names in * to the order of the interface names in the {@code implements} clause of
* the {@code implements} clause of the declaration of the class * the declaration of the class represented by this object.
* represented by this object. In the case of an array class, the *
* interfaces {@code Cloneable} and {@code Serializable} are * <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. * 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 * @throws java.lang.reflect.GenericSignatureFormatError
* if the generic class signature does not conform to the format * if the generic class signature does not conform to the format
* specified in * specified in
@ -905,7 +904,7 @@ public final class Class<T> implements java.io.Serializable,
* @throws java.lang.reflect.MalformedParameterizedTypeException * @throws java.lang.reflect.MalformedParameterizedTypeException
* if any of the generic superinterfaces refer to a parameterized * if any of the generic superinterfaces refer to a parameterized
* type that cannot be instantiated for any reason * 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 * @since 1.5
*/ */
public Type[] getGenericInterfaces() { public Type[] getGenericInterfaces() {
@ -1533,7 +1532,8 @@ public final class Class<T> implements java.io.Serializable,
* 0. * 0.
* *
* <p> If this {@code Class} object represents a class, then this method * <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 * <p> If this {@code Class} object represents an interface, then this
* method returns the fields of the interface and of all its * method returns the fields of the interface and of all its

View File

@ -453,7 +453,7 @@ public class Object {
"nanosecond timeout value out of range"); "nanosecond timeout value out of range");
} }
if (nanos >= 500000 || (nanos != 0 && timeout == 0)) { if (nanos > 0) {
timeout++; timeout++;
} }

View File

@ -60,7 +60,7 @@ public abstract
class Authenticator { class Authenticator {
// The system-wide authenticator object. See setDefault(). // The system-wide authenticator object. See setDefault().
private static Authenticator theAuthenticator; private static volatile Authenticator theAuthenticator;
private String requestingHost; private String requestingHost;
private InetAddress requestingSite; private InetAddress requestingSite;

View File

@ -771,6 +771,7 @@ class DatagramSocket implements java.io.Closeable {
} // end of while } // end of while
} }
} }
DatagramPacket tmp = null;
if ((connectState == ST_CONNECTED_NO_IMPL) || explicitFilter) { if ((connectState == ST_CONNECTED_NO_IMPL) || explicitFilter) {
// We have to do the filtering the old fashioned way since // We have to do the filtering the old fashioned way since
// the native impl doesn't support connect or the connect // the native impl doesn't support connect or the connect
@ -795,11 +796,13 @@ class DatagramSocket implements java.io.Closeable {
if ((!connectedAddress.equals(peekAddress)) || if ((!connectedAddress.equals(peekAddress)) ||
(connectedPort != peekPort)) { (connectedPort != peekPort)) {
// throw the packet away and silently continue // throw the packet away and silently continue
DatagramPacket tmp = new DatagramPacket( tmp = new DatagramPacket(
new byte[1024], 1024); new byte[1024], 1024);
getImpl().receive(tmp); getImpl().receive(tmp);
if (explicitFilter) { if (explicitFilter) {
bytesLeftToFilter -= tmp.getLength(); if (checkFiltering(tmp)) {
stop = true;
}
} }
} else { } else {
stop = true; stop = true;
@ -809,16 +812,20 @@ class DatagramSocket implements java.io.Closeable {
// If the security check succeeds, or the datagram is // If the security check succeeds, or the datagram is
// connected then receive the packet // connected then receive the packet
getImpl().receive(p); getImpl().receive(p);
if (explicitFilter) { if (explicitFilter && tmp == null) {
// packet was not filtered, account for it here
checkFiltering(p);
}
}
}
private boolean checkFiltering(DatagramPacket p) throws SocketException {
bytesLeftToFilter -= p.getLength(); bytesLeftToFilter -= p.getLength();
if (bytesLeftToFilter <= 0) { if (bytesLeftToFilter <= 0 || getImpl().dataAvailable() <= 0) {
explicitFilter = false; explicitFilter = false;
} else { return true;
// break out of filter, if there is no more data queued
explicitFilter = getImpl().dataAvailable() > 0;
}
}
} }
return false;
} }
/** /**

View File

@ -2624,10 +2624,11 @@ public final class Formatter implements Closeable, Flushable {
private boolean dt = false; private boolean dt = false;
private char c; private char c;
private int index(String s) { private int index(String s, int start, int end) {
if (s != null) { if (start >= 0) {
try { try {
index = Integer.parseInt(s.substring(0, s.length() - 1)); // skip the trailing '$'
index = Integer.parseInt(s, start, end - 1, 10);
} catch (NumberFormatException x) { } catch (NumberFormatException x) {
assert(false); assert(false);
} }
@ -2648,11 +2649,11 @@ public final class Formatter implements Closeable, Flushable {
return f; return f;
} }
private int width(String s) { private int width(String s, int start, int end) {
width = -1; width = -1;
if (s != null) { if (start >= 0) {
try { try {
width = Integer.parseInt(s); width = Integer.parseInt(s, start, end, 10);
if (width < 0) if (width < 0)
throw new IllegalFormatWidthException(width); throw new IllegalFormatWidthException(width);
} catch (NumberFormatException x) { } catch (NumberFormatException x) {
@ -2662,12 +2663,12 @@ public final class Formatter implements Closeable, Flushable {
return width; return width;
} }
private int precision(String s) { private int precision(String s, int start, int end) {
precision = -1; precision = -1;
if (s != null) { if (start >= 0) {
try { try {
// remove the '.' // skip the leading '.'
precision = Integer.parseInt(s.substring(1)); precision = Integer.parseInt(s, start + 1, end, 10);
if (precision < 0) if (precision < 0)
throw new IllegalFormatPrecisionException(precision); throw new IllegalFormatPrecisionException(precision);
} catch (NumberFormatException x) { } catch (NumberFormatException x) {
@ -2695,23 +2696,19 @@ public final class Formatter implements Closeable, Flushable {
} }
FormatSpecifier(String s, Matcher m) { 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++)); int tTStart = m.start(5);
flags(s, m.start(idx), m.end(idx++)); if (tTStart >= 0) {
width(m.group(idx++));
precision(m.group(idx++));
int tTStart = m.start(idx);
int tTEnd = m.end(idx++);
if (tTStart != -1 && tTEnd != -1) {
dt = true; dt = true;
if (tTStart == tTEnd - 1 && s.charAt(tTStart) == 'T') { if (s.charAt(tTStart) == 'T') {
f.add(Flags.UPPERCASE); f.add(Flags.UPPERCASE);
} }
} }
conversion(s.charAt(m.start(6)));
conversion(s.charAt(m.start(idx)));
if (dt) if (dt)
checkDateTime(); checkDateTime();

View File

@ -28,7 +28,7 @@ package java.util.jar;
import java.io.DataInputStream; import java.io.DataInputStream;
import java.io.DataOutputStream; import java.io.DataOutputStream;
import java.io.IOException; import java.io.IOException;
import java.util.HashMap; import java.util.LinkedHashMap;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.Collection; import java.util.Collection;
@ -47,6 +47,9 @@ import sun.misc.ASCIICaseInsensitiveComparator;
* <a href="../../../../technotes/guides/jar/jar.html">JAR File Specification</a> * <a href="../../../../technotes/guides/jar/jar.html">JAR File Specification</a>
* for more information about valid attribute names and values. * 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 * @author David Connelly
* @see Manifest * @see Manifest
* @since 1.2 * @since 1.2
@ -71,7 +74,7 @@ public class Attributes implements Map<Object,Object>, Cloneable {
* @param size the initial number of attributes * @param size the initial number of attributes
*/ */
public Attributes(int size) { 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 * @param attr the specified Attributes
*/ */
public Attributes(Attributes attr) { public Attributes(Attributes attr) {
map = new HashMap<>(attr); map = new LinkedHashMap<>(attr);
} }

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -34,9 +34,8 @@ import sun.nio.ch.DirectBuffer;
* can be computed much faster. * can be computed much faster.
* *
* <p> Passing a {@code null} argument to a method in this class will cause * <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 * @author David Connelly
*/ */
public public
@ -53,9 +52,8 @@ class Adler32 implements Checksum {
/** /**
* Updates the checksum with the specified byte (the low eight * Updates the checksum with the specified byte (the low eight
* bits of the argument b). * bits of the argument b).
*
* @param b the byte to update the checksum with
*/ */
@Override
public void update(int b) { public void update(int b) {
adler = update(adler, b); adler = update(adler, b);
} }
@ -64,10 +62,11 @@ class Adler32 implements Checksum {
* Updates the checksum with the specified array of bytes. * Updates the checksum with the specified array of bytes.
* *
* @throws ArrayIndexOutOfBoundsException * @throws ArrayIndexOutOfBoundsException
* if {@code off} is negative, or {@code len} is negative, * if {@code off} is negative, or {@code len} is negative, or
* or {@code off+len} is greater than the length of the * {@code off+len} is negative or greater than the length of
* array {@code b} * the array {@code b}.
*/ */
@Override
public void update(byte[] b, int off, int len) { public void update(byte[] b, int off, int len) {
if (b == null) { if (b == null) {
throw new NullPointerException(); throw new NullPointerException();
@ -78,29 +77,16 @@ class Adler32 implements Checksum {
adler = updateBytes(adler, b, off, len); 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. * Updates the checksum with the bytes from the specified buffer.
* *
* The checksum is updated using * The checksum is updated with the remaining bytes in the buffer, starting
* buffer.{@link java.nio.Buffer#remaining() remaining()} * at the buffer's position. Upon return, the buffer's position will be
* bytes starting at * updated to its limit; its limit will not have been changed.
* 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 * @since 1.8
*/ */
@Override
public void update(ByteBuffer buffer) { public void update(ByteBuffer buffer) {
int pos = buffer.position(); int pos = buffer.position();
int limit = buffer.limit(); int limit = buffer.limit();
@ -113,9 +99,12 @@ class Adler32 implements Checksum {
} else if (buffer.hasArray()) { } else if (buffer.hasArray()) {
adler = updateBytes(adler, buffer.array(), pos + buffer.arrayOffset(), rem); adler = updateBytes(adler, buffer.array(), pos + buffer.arrayOffset(), rem);
} else { } else {
byte[] b = new byte[rem]; byte[] b = new byte[Math.min(buffer.remaining(), 4096)];
buffer.get(b); while (buffer.hasRemaining()) {
adler = updateBytes(adler, b, 0, b.length); int length = Math.min(buffer.remaining(), b.length);
buffer.get(b, 0, length);
update(b, 0, length);
}
} }
buffer.position(limit); buffer.position(limit);
} }
@ -123,6 +112,7 @@ class Adler32 implements Checksum {
/** /**
* Resets the checksum to initial value. * Resets the checksum to initial value.
*/ */
@Override
public void reset() { public void reset() {
adler = 1; adler = 1;
} }
@ -130,6 +120,7 @@ class Adler32 implements Checksum {
/** /**
* Returns the checksum value. * Returns the checksum value.
*/ */
@Override
public long getValue() { public long getValue() {
return (long)adler & 0xffffffffL; return (long)adler & 0xffffffffL;
} }

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -32,9 +32,8 @@ import sun.nio.ch.DirectBuffer;
* A class that can be used to compute the CRC-32 of a data stream. * 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 * <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 * @author David Connelly
*/ */
public public
@ -51,9 +50,8 @@ class CRC32 implements Checksum {
/** /**
* Updates the CRC-32 checksum with the specified byte (the low * Updates the CRC-32 checksum with the specified byte (the low
* eight bits of the argument b). * eight bits of the argument b).
*
* @param b the byte to update the checksum with
*/ */
@Override
public void update(int b) { public void update(int b) {
crc = update(crc, b); crc = update(crc, b);
} }
@ -62,10 +60,11 @@ class CRC32 implements Checksum {
* Updates the CRC-32 checksum with the specified array of bytes. * Updates the CRC-32 checksum with the specified array of bytes.
* *
* @throws ArrayIndexOutOfBoundsException * @throws ArrayIndexOutOfBoundsException
* if {@code off} is negative, or {@code len} is negative, * if {@code off} is negative, or {@code len} is negative, or
* or {@code off+len} is greater than the length of the * {@code off+len} is negative or greater than the length of
* array {@code b} * the array {@code b}.
*/ */
@Override
public void update(byte[] b, int off, int len) { public void update(byte[] b, int off, int len) {
if (b == null) { if (b == null) {
throw new NullPointerException(); 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 * 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
public void update(byte[] b) { * updated to its limit; its limit will not have been changed.
crc = updateBytes(crc, 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.
*
* @param buffer the ByteBuffer to update the checksum with
* @since 1.8 * @since 1.8
*/ */
@Override
public void update(ByteBuffer buffer) { public void update(ByteBuffer buffer) {
int pos = buffer.position(); int pos = buffer.position();
int limit = buffer.limit(); int limit = buffer.limit();
@ -110,9 +97,12 @@ class CRC32 implements Checksum {
} else if (buffer.hasArray()) { } else if (buffer.hasArray()) {
crc = updateBytes(crc, buffer.array(), pos + buffer.arrayOffset(), rem); crc = updateBytes(crc, buffer.array(), pos + buffer.arrayOffset(), rem);
} else { } else {
byte[] b = new byte[rem]; byte[] b = new byte[Math.min(buffer.remaining(), 4096)];
buffer.get(b); while (buffer.hasRemaining()) {
crc = updateBytes(crc, b, 0, b.length); int length = Math.min(buffer.remaining(), b.length);
buffer.get(b, 0, length);
update(b, 0, length);
}
} }
buffer.position(limit); buffer.position(limit);
} }
@ -120,6 +110,7 @@ class CRC32 implements Checksum {
/** /**
* Resets CRC-32 to initial value. * Resets CRC-32 to initial value.
*/ */
@Override
public void reset() { public void reset() {
crc = 0; crc = 0;
} }
@ -127,6 +118,7 @@ class CRC32 implements Checksum {
/** /**
* Returns CRC-32 value. * Returns CRC-32 value.
*/ */
@Override
public long getValue() { public long getValue() {
return (long)crc & 0xffffffffL; return (long)crc & 0xffffffffL;
} }

View File

@ -0,0 +1,339 @@
/*
* 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.
*/
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;
}
}

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -22,16 +22,17 @@
* or visit www.oracle.com if you need additional information or have any * or visit www.oracle.com if you need additional information or have any
* questions. * questions.
*/ */
package java.util.zip; package java.util.zip;
import java.nio.ByteBuffer;
/** /**
* An interface representing a data checksum. * An interface representing a data checksum.
* *
* @author David Connelly * @author David Connelly
*/ */
public public interface Checksum {
interface Checksum {
/** /**
* Updates the current checksum with the specified byte. * Updates the current checksum with the specified byte.
* *
@ -41,14 +42,89 @@ interface Checksum {
/** /**
* Updates the current checksum with the specified array of bytes. * 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 b the byte array to update the checksum with
* @param off the start offset of the data * @param off the start offset of the data
* @param len the number of bytes to use for the update * @param len the number of bytes to use for the update
*/ */
public void update(byte[] b, int off, int len); 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. * Returns the current checksum value.
*
* @return the current checksum value * @return the current checksum value
*/ */
public long getValue(); public long getValue();

View File

@ -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>
* &nbsp;
* <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>
* &nbsp;
* <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>
* &nbsp;
* <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>
* &nbsp;
* <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;

View File

@ -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>
&nbsp;
<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>
&nbsp;
<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>
&nbsp;
<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>

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -88,6 +88,8 @@ public class CipherInputStream extends FilterInputStream {
private int ofinish = 0; private int ofinish = 0;
// stream status // stream status
private boolean closed = false; 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. * private convenience function.
@ -103,6 +105,7 @@ public class CipherInputStream extends FilterInputStream {
private int getMoreData() throws IOException { private int getMoreData() throws IOException {
if (done) return -1; if (done) return -1;
int readin = input.read(ibuffer); int readin = input.read(ibuffer);
read = true;
if (readin == -1) { if (readin == -1) {
done = true; done = true;
try { try {
@ -306,8 +309,12 @@ public class CipherInputStream extends FilterInputStream {
} }
} }
catch (BadPaddingException | IllegalBlockSizeException ex) { catch (BadPaddingException | IllegalBlockSizeException 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); throw new IOException(ex);
} }
}
ostart = 0; ostart = 0;
ofinish = 0; ofinish = 0;
} }

View File

@ -657,9 +657,10 @@ public class HttpClient extends NetworkClient {
cachedHttpClient = false; cachedHttpClient = false;
if (!failedOnce && requests != null) { if (!failedOnce && requests != null) {
failedOnce = true; failedOnce = true;
if (getRequestMethod().equals("CONNECT") || if (getRequestMethod().equals("CONNECT")
(httpuc.getRequestMethod().equals("POST") && || streaming
(!retryPostProp || streaming))) { || (httpuc.getRequestMethod().equals("POST")
&& !retryPostProp)) {
// do not retry the request // do not retry the request
} else { } else {
// try once more // try once more
@ -769,9 +770,10 @@ public class HttpClient extends NetworkClient {
} else if (nread != 8) { } else if (nread != 8) {
if (!failedOnce && requests != null) { if (!failedOnce && requests != null) {
failedOnce = true; failedOnce = true;
if (getRequestMethod().equals("CONNECT") || if (getRequestMethod().equals("CONNECT")
(httpuc.getRequestMethod().equals("POST") && || streaming
(!retryPostProp || streaming))) { || (httpuc.getRequestMethod().equals("POST")
&& !retryPostProp)) {
// do not retry the request // do not retry the request
} else { } else {
closeServer(); closeServer();

View File

@ -752,7 +752,7 @@ class DatagramChannelImpl
} }
do { do {
tmpBuf.clear(); tmpBuf.clear();
} while (read(tmpBuf) > 0); } while (receive(tmpBuf) != null);
} finally { } finally {
if (blocking) { if (blocking) {
configureBlocking(true); configureBlocking(true);

View File

@ -42,8 +42,11 @@ public class ClassRepository extends GenericDeclRepository<ClassSignature> {
public static final ClassRepository NONE = ClassRepository.make("Ljava/lang/Object;", null); public static final ClassRepository NONE = ClassRepository.make("Ljava/lang/Object;", null);
private Type superclass; // caches the generic superclass info /** The generic superclass info. Lazily initialized. */
private Type[] superInterfaces; // caches the generic superinterface info private volatile Type superclass;
/** The generic superinterface info. Lazily initialized. */
private volatile Type[] superInterfaces;
// private, to enforce use of static factory // private, to enforce use of static factory
private ClassRepository(String rawSig, GenericsFactory f) { private ClassRepository(String rawSig, GenericsFactory f) {
@ -80,30 +83,33 @@ public class ClassRepository extends GenericDeclRepository<ClassSignature> {
*/ */
public Type getSuperclass() { public Type getSuperclass() {
Type superclass = this.superclass;
if (superclass == null) { // lazily initialize superclass if (superclass == null) { // lazily initialize superclass
Reifier r = getReifier(); // obtain visitor Reifier r = getReifier(); // obtain visitor
// Extract superclass subtree from AST and reify // Extract superclass subtree from AST and reify
getTree().getSuperclass().accept(r); getTree().getSuperclass().accept(r);
// extract result from visitor and cache it // extract result from visitor and cache it
superclass = r.getResult(); superclass = r.getResult();
this.superclass = superclass;
} }
return superclass; // return cached result return superclass; // return cached result
} }
public Type[] getSuperInterfaces() { public Type[] getSuperInterfaces() {
Type[] superInterfaces = this.superInterfaces;
if (superInterfaces == null) { // lazily initialize super interfaces if (superInterfaces == null) { // lazily initialize super interfaces
// first, extract super interface subtree(s) from AST // first, extract super interface subtree(s) from AST
TypeTree[] ts = getTree().getSuperInterfaces(); TypeTree[] ts = getTree().getSuperInterfaces();
// create array to store reified subtree(s) // create array to store reified subtree(s)
Type[] sis = new Type[ts.length]; superInterfaces = new Type[ts.length];
// reify all subtrees // reify all subtrees
for (int i = 0; i < ts.length; i++) { for (int i = 0; i < ts.length; i++) {
Reifier r = getReifier(); // obtain visitor Reifier r = getReifier(); // obtain visitor
ts[i].accept(r);// reify subtree ts[i].accept(r);// reify subtree
// extract result from visitor and store it // 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 return superInterfaces.clone(); // return cached result
} }

View File

@ -42,7 +42,8 @@ import sun.reflect.generics.visitor.Reifier;
public abstract class GenericDeclRepository<S extends Signature> public abstract class GenericDeclRepository<S extends Signature>
extends AbstractRepository<S> { 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) { protected GenericDeclRepository(String rawSig, GenericsFactory f) {
super(rawSig, 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 the corresponding field is non-null, it is returned.
* If not, it is created lazily. This is done by selecting the appropriate * If not, it is created lazily. This is done by selecting the appropriate
* part of the tree and transforming it into a reflective object * part of the tree and transforming it into a reflective object
* using a visitor. * using a visitor, which is created by feeding it the factory
* a visitor, which is created by feeding it the factory
* with which the repository was created. * with which the repository was created.
*/ */
@ -65,19 +65,20 @@ 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 if (typeParams == null) { // lazily initialize type parameters
// first, extract type parameter subtree(s) from AST // first, extract type parameter subtree(s) from AST
FormalTypeParameter[] ftps = getTree().getFormalTypeParameters(); FormalTypeParameter[] ftps = getTree().getFormalTypeParameters();
// create array to store reified subtree(s) // create array to store reified subtree(s)
TypeVariable<?>[] tps = new TypeVariable<?>[ftps.length]; typeParams = new TypeVariable<?>[ftps.length];
// reify all subtrees // reify all subtrees
for (int i = 0; i < ftps.length; i++) { for (int i = 0; i < ftps.length; i++) {
Reifier r = getReifier(); // obtain visitor Reifier r = getReifier(); // obtain visitor
ftps[i].accept(r); // reify subtree ftps[i].accept(r); // reify subtree
// extract result from visitor and store it // 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 return typeParams.clone(); // return cached result
} }

View File

@ -42,7 +42,9 @@ public abstract class AbstractScope<D extends GenericDeclaration>
implements Scope { implements Scope {
private final D recvr; // the declaration whose scope this instance represents 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 * Constructor. Takes a reflective object whose scope the newly
@ -71,7 +73,11 @@ public abstract class AbstractScope<D extends GenericDeclaration>
* @return the enclosing scope * @return the enclosing scope
*/ */
protected Scope getEnclosingScope(){ protected Scope getEnclosingScope(){
if (enclosingScope == null) {enclosingScope = computeEnclosingScope();} Scope enclosingScope = this.enclosingScope;
if (enclosingScope == null) {
enclosingScope = computeEnclosingScope();
this.enclosingScope = enclosingScope;
}
return enclosingScope; return enclosingScope;
} }

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -968,7 +968,7 @@ final class CipherSuite implements Comparable<CipherSuite> {
* 1. Prefer Suite B compliant cipher suites, see RFC6460 (To be * 1. Prefer Suite B compliant cipher suites, see RFC6460 (To be
* changed later, see below). * changed later, see below).
* 2. Prefer the stronger bulk cipher, in the order of AES_256(GCM), * 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, * 3. Prefer the stronger MAC algorithm, in the order of SHA384,
* SHA256, SHA, MD5. * SHA256, SHA, MD5.
* 4. Prefer the better performance of key exchange and digital * 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", add("TLS_DHE_DSS_WITH_AES_128_CBC_SHA",
0x0032, --p, K_DHE_DSS, B_AES_128, T); 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 // 3DES_EDE
add("TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA", add("TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA",
0xC008, --p, K_ECDHE_ECDSA, B_3DES, T); 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", add("SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA",
0x0013, --p, K_DHE_DSS, B_3DES, N); 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", add("SSL_RSA_WITH_RC4_128_MD5",
0x0004, --p, K_RSA, B_RC4_128, N); 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 * 2. If a cipher suite has been obsoleted, we put it at the end of
* the list. * the list.
* 3. Prefer the stronger bulk cipher, in the order of AES_256, * 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, * 4. Prefer the stronger MAC algorithm, in the order of SHA384,
* SHA256, SHA, MD5. * SHA256, SHA, MD5.
* 5. Prefer the better performance of key exchange and digital * 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", add("TLS_DH_anon_WITH_AES_128_CBC_SHA",
0x0034, --p, K_DH_ANON, B_AES_128, N); 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", add("TLS_ECDH_anon_WITH_RC4_128_SHA",
0xC016, --p, K_ECDH_ANON, B_RC4_128, N); 0xC016, --p, K_ECDH_ANON, B_RC4_128, N);
add("SSL_DH_anon_WITH_RC4_128_MD5", add("SSL_DH_anon_WITH_RC4_128_MD5",
0x0018, --p, K_DH_ANON, B_RC4_128, N); 0x0018, --p, K_DH_ANON, B_RC4_128, N);
add("TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA", // weak cipher suites obsoleted in TLS 1.2
0xC017, --p, K_ECDH_ANON, B_3DES, N); add("SSL_RSA_WITH_DES_CBC_SHA",
add("SSL_DH_anon_WITH_3DES_EDE_CBC_SHA", 0x0009, --p, K_RSA, B_DES, N, tls12);
0x001b, --p, K_DH_ANON, B_3DES, N); 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", add("TLS_RSA_WITH_NULL_SHA256",
0x003b, --p, K_RSA, B_NULL, N, max, tls12, P_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", add("SSL_RSA_WITH_NULL_MD5",
0x0001, --p, K_RSA, B_NULL, N); 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 // 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", add("TLS_KRB5_WITH_3DES_EDE_CBC_SHA",
0x001f, --p, K_KRB5, B_3DES, N); 0x001f, --p, K_KRB5, B_3DES, N);
add("TLS_KRB5_WITH_3DES_EDE_CBC_MD5", add("TLS_KRB5_WITH_3DES_EDE_CBC_MD5",
0x0023, --p, K_KRB5, B_3DES, N); 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", add("TLS_KRB5_WITH_DES_CBC_SHA",
0x001e, --p, K_KRB5, B_DES, N, tls12); 0x001e, --p, K_KRB5, B_DES, N, tls12);
add("TLS_KRB5_WITH_DES_CBC_MD5", add("TLS_KRB5_WITH_DES_CBC_MD5",
0x0022, --p, K_KRB5, B_DES, N, tls12); 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", add("TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA",
0x0026, --p, K_KRB5_EXPORT, B_DES_40, N, tls11); 0x0026, --p, K_KRB5_EXPORT, B_DES_40, N, tls11);
add("TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5", add("TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5",
0x0029, --p, K_KRB5_EXPORT, B_DES_40, N, tls11); 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. * Other values from the TLS Cipher Suite Registry, as of August 2010.

View File

@ -406,14 +406,17 @@ final class UNIXProcess extends Process {
if (hasExited) return true; if (hasExited) return true;
if (timeout <= 0) return false; if (timeout <= 0) return false;
long timeoutAsNanos = unit.toNanos(timeout); long remainingNanos = unit.toNanos(timeout);
long startTime = System.nanoTime(); long deadline = System.nanoTime() + remainingNanos;
long rem = timeoutAsNanos;
while (!hasExited && (rem > 0)) { do {
wait(Math.max(TimeUnit.NANOSECONDS.toMillis(rem), 1)); // Round up to next millisecond
rem = timeoutAsNanos - (System.nanoTime() - startTime); wait(TimeUnit.NANOSECONDS.toMillis(remainingNanos + 999_999L));
if (hasExited) {
return true;
} }
remainingNanos = deadline - System.nanoTime();
} while (remainingNanos > 0);
return hasExited; return hasExited;
} }

View File

@ -461,11 +461,21 @@ final class ProcessImpl extends Process {
if (getExitCodeProcess(handle) != STILL_ACTIVE) return true; if (getExitCodeProcess(handle) != STILL_ACTIVE) return true;
if (timeout <= 0) return false; 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); waitForTimeoutInterruptibly(handle, msTimeout);
if (Thread.interrupted()) if (Thread.interrupted())
throw new InterruptedException(); throw new InterruptedException();
if (getExitCodeProcess(handle) != STILL_ACTIVE) {
return true;
}
remainingNanos = deadline - System.nanoTime();
} while (remainingNanos > 0);
return (getExitCodeProcess(handle) != STILL_ACTIVE); return (getExitCodeProcess(handle) != STILL_ACTIVE);
} }

View File

@ -32,9 +32,11 @@
#include "java_net_AbstractPlainDatagramSocketImpl.h" #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", apdsi_fdID = (*env)->GetFieldID(env, cls, "fd",
"Ljava/io/FileDescriptor;"); "Ljava/io/FileDescriptor;");
CHECK_NULL(apdsi_fdID); CHECK_NULL(apdsi_fdID);
IO_fd_fdID = NET_GetFileDescriptorID(env); IO_fd_fdID = NET_GetFileDescriptorID(env);
CHECK_NULL(IO_fd_fdID); 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); 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 JNIEXPORT jint JNICALL Java_java_net_AbstractPlainDatagramSocketImpl_dataAvailable
(JNIEnv *env, jobject this) { (JNIEnv *env, jobject this) {
SOCKET fd; SOCKET fd;
int retval; SOCKET fd1;
int rv = -1, rv1 = -1;
jobject fdObj = (*env)->GetObjectField(env, this, apdsi_fdID); jobject fdObj = (*env)->GetObjectField(env, this, apdsi_fdID);
if (IS_NULL(fdObj)) { 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;
}
}
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", JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException",
"Socket closed"); "Socket closed");
return -1; return -1;
} }
fd = (SOCKET)(*env)->GetIntField(env, fdObj, IO_fd_fdID);
if (ioctlsocket(fd, FIONREAD, &retval) < 0) { return 0;
return -1;
}
return retval;
} }

View File

@ -1882,6 +1882,9 @@ public abstract class SunToolkit extends Toolkit
public synchronized void setWindowDeactivationTime(Window w, long time) { public synchronized void setWindowDeactivationTime(Window w, long time) {
AppContext ctx = getAppContext(w); AppContext ctx = getAppContext(w);
if (ctx == null) {
return;
}
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
WeakHashMap<Window, Long> map = (WeakHashMap<Window, Long>)ctx.get(DEACTIVATION_TIMES_MAP_KEY); WeakHashMap<Window, Long> map = (WeakHashMap<Window, Long>)ctx.get(DEACTIVATION_TIMES_MAP_KEY);
if (map == null) { if (map == null) {
@ -1893,6 +1896,9 @@ public abstract class SunToolkit extends Toolkit
public synchronized long getWindowDeactivationTime(Window w) { public synchronized long getWindowDeactivationTime(Window w) {
AppContext ctx = getAppContext(w); AppContext ctx = getAppContext(w);
if (ctx == null) {
return -1;
}
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
WeakHashMap<Window, Long> map = (WeakHashMap<Window, Long>)ctx.get(DEACTIVATION_TIMES_MAP_KEY); WeakHashMap<Window, Long> map = (WeakHashMap<Window, Long>)ctx.get(DEACTIVATION_TIMES_MAP_KEY);
if (map == null) { if (map == null) {

View File

@ -28,6 +28,7 @@ package sun.management;
import java.util.*; import java.util.*;
import com.sun.management.VMOption; import com.sun.management.VMOption;
import com.sun.management.VMOption.Origin; import com.sun.management.VMOption.Origin;
import java.security.AccessController;
/** /**
* Flag class is a helper class for constructing a VMOption. * Flag class is a helper class for constructing a VMOption.
@ -115,6 +116,13 @@ class Flag {
static synchronized native void setStringValue(String name, String value); static synchronized native void setStringValue(String name, String value);
static { static {
AccessController.doPrivileged(
new java.security.PrivilegedAction<Void>() {
public Void run() {
System.loadLibrary("management");
return null;
}
});
initialize(); initialize();
} }
private static native void initialize(); private static native void initialize();

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -37,9 +37,10 @@ import java.util.Iterator;
* *
* @author Sean Mullan * @author Sean Mullan
* @author JSR 105 Expert Group * @author JSR 105 Expert Group
* @param <T> the type of nodes maintained by this set
* @since 1.6 * @since 1.6
*/ */
public interface NodeSetData extends Data { public interface NodeSetData<T> extends Data, Iterable<T> {
/** /**
* Returns a read-only iterator over the nodes contained in this * Returns a read-only iterator over the nodes contained in this
@ -52,6 +53,5 @@ public interface NodeSetData extends Data {
* @return an <code>Iterator</code> over the nodes in this * @return an <code>Iterator</code> over the nodes in this
* <code>NodeSetData</code> in document order * <code>NodeSetData</code> in document order
*/ */
@SuppressWarnings("rawtypes") Iterator<T> iterator();
Iterator iterator();
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -33,6 +33,7 @@ import javax.xml.crypto.XMLCryptoContext;
import java.util.Collections; import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
import java.util.Map;
import org.w3c.dom.Element; import org.w3c.dom.Element;
/** /**
@ -219,8 +220,7 @@ public class DOMCryptoContext implements XMLCryptoContext {
* *
* @return a read-only iterator over the set of mappings * @return a read-only iterator over the set of mappings
*/ */
@SuppressWarnings("rawtypes") public Iterator<Map.Entry<String, Element>> iterator() {
public Iterator iterator() {
return Collections.unmodifiableMap(idMap).entrySet().iterator(); return Collections.unmodifiableMap(idMap).entrySet().iterator();
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -51,8 +51,8 @@ import java.util.List;
* *
* <pre> * <pre>
* XMLSignatureFactory factory = XMLSignatureFactory.getInstance("DOM"); * XMLSignatureFactory factory = XMLSignatureFactory.getInstance("DOM");
* List references = Collections.singletonList(factory.newReference * Reference ref = factory.newReference("#reference-1", DigestMethod.SHA1);
* ("#reference-1", DigestMethod.SHA1)); * List<Reference> references = Collections.singletonList(ref);
* Manifest manifest = factory.newManifest(references, "manifest-1"); * Manifest manifest = factory.newManifest(references, "manifest-1");
* </pre> * </pre>
* *
@ -86,6 +86,5 @@ public interface Manifest extends XMLStructure {
* *
* @return an unmodifiable list of one or more <code>Reference</code>s * @return an unmodifiable list of one or more <code>Reference</code>s
*/ */
@SuppressWarnings("rawtypes") List<Reference> getReferences();
List getReferences();
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -85,8 +85,7 @@ public interface Reference extends URIReference, XMLStructure {
* @return an unmodifiable list of <code>Transform</code>s * @return an unmodifiable list of <code>Transform</code>s
* (may be empty but never <code>null</code>) * (may be empty but never <code>null</code>)
*/ */
@SuppressWarnings("rawtypes") List<Transform> getTransforms();
List getTransforms();
/** /**
* Returns the digest method of this <code>Reference</code>. * Returns the digest method of this <code>Reference</code>.

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -87,6 +87,5 @@ public interface SignatureProperties extends XMLStructure {
* @return an unmodifiable list of one or more * @return an unmodifiable list of one or more
* <code>SignatureProperty</code>s * <code>SignatureProperty</code>s
*/ */
@SuppressWarnings("rawtypes") List<SignatureProperty> getProperties();
List getProperties();
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -91,6 +91,5 @@ public interface SignatureProperty extends XMLStructure {
* *
* @return an unmodifiable list of one or more <code>XMLStructure</code>s * @return an unmodifiable list of one or more <code>XMLStructure</code>s
*/ */
@SuppressWarnings("rawtypes") List<XMLStructure> getContent();
List getContent();
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -80,8 +80,7 @@ public interface SignedInfo extends XMLStructure {
* *
* @return an unmodifiable list of one or more {@link Reference}s * @return an unmodifiable list of one or more {@link Reference}s
*/ */
@SuppressWarnings("rawtypes") List<Reference> getReferences();
List getReferences();
/** /**
* Returns the optional <code>Id</code> attribute of this * Returns the optional <code>Id</code> attribute of this

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -64,7 +64,8 @@ import javax.xml.crypto.XMLStructure;
* *
* <pre> * <pre>
* XMLSignatureFactory fac = XMLSignatureFactory.getInstance("DOM"); * XMLSignatureFactory fac = XMLSignatureFactory.getInstance("DOM");
* List content = Collections.singletonList(fac.newManifest(references))); * Manifest manifest = fac.newManifest(references);
* List<XMLStructure> content = Collections.singletonList(manifest);
* XMLObject object = factory.newXMLObject(content, "object-1", null, null); * XMLObject object = factory.newXMLObject(content, "object-1", null, null);
* </pre> * </pre>
* *
@ -100,8 +101,7 @@ public interface XMLObject extends XMLStructure {
* @return an unmodifiable list of <code>XMLStructure</code>s (may be empty * @return an unmodifiable list of <code>XMLStructure</code>s (may be empty
* but never <code>null</code>) * but never <code>null</code>)
*/ */
@SuppressWarnings("rawtypes") List<XMLStructure> getContent();
List getContent();
/** /**
* Returns the Id of this <code>XMLObject</code>. * Returns the Id of this <code>XMLObject</code>.

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -136,8 +136,7 @@ public interface XMLSignature extends XMLStructure {
* @return an unmodifiable list of <code>XMLObject</code>s (may be empty * @return an unmodifiable list of <code>XMLObject</code>s (may be empty
* but never <code>null</code>) * but never <code>null</code>)
*/ */
@SuppressWarnings("rawtypes") List<XMLObject> getObjects();
List getObjects();
/** /**
* Returns the optional Id of this <code>XMLSignature</code>. * Returns the optional Id of this <code>XMLSignature</code>.

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -365,9 +365,8 @@ public abstract class XMLSignatureFactory {
* @throws ClassCastException if any of the <code>objects</code> are not of * @throws ClassCastException if any of the <code>objects</code> are not of
* type <code>XMLObject</code> * type <code>XMLObject</code>
*/ */
@SuppressWarnings("rawtypes")
public abstract XMLSignature newXMLSignature(SignedInfo si, KeyInfo ki, public abstract XMLSignature newXMLSignature(SignedInfo si, KeyInfo ki,
List objects, String id, String signatureValueId); List<? extends XMLObject> objects, String id, String signatureValueId);
/** /**
* Creates a <code>Reference</code> with the specified URI and digest * Creates a <code>Reference</code> with the specified URI and digest
@ -399,9 +398,8 @@ public abstract class XMLSignatureFactory {
* compliant * compliant
* @throws NullPointerException if <code>dm</code> is <code>null</code> * @throws NullPointerException if <code>dm</code> is <code>null</code>
*/ */
@SuppressWarnings("rawtypes")
public abstract Reference newReference(String uri, DigestMethod dm, public abstract Reference newReference(String uri, DigestMethod dm,
List transforms, String type, String id); List<? extends Transform> transforms, String type, String id);
/** /**
* Creates a <code>Reference</code> with the specified parameters and * Creates a <code>Reference</code> with the specified parameters and
@ -430,9 +428,9 @@ public abstract class XMLSignatureFactory {
* @throws NullPointerException if <code>dm</code> or * @throws NullPointerException if <code>dm</code> or
* <code>digestValue</code> is <code>null</code> * <code>digestValue</code> is <code>null</code>
*/ */
@SuppressWarnings("rawtypes")
public abstract Reference newReference(String uri, DigestMethod dm, public abstract Reference newReference(String uri, DigestMethod dm,
List transforms, String type, String id, byte[] digestValue); List<? extends Transform> transforms, String type, String id,
byte[] digestValue);
/** /**
* Creates a <code>Reference</code> with the specified parameters. * Creates a <code>Reference</code> with the specified parameters.
@ -473,10 +471,9 @@ public abstract class XMLSignatureFactory {
* <code>appliedTransforms</code> or <code>result</code> is * <code>appliedTransforms</code> or <code>result</code> is
* <code>null</code> * <code>null</code>
*/ */
@SuppressWarnings("rawtypes")
public abstract Reference newReference(String uri, DigestMethod dm, public abstract Reference newReference(String uri, DigestMethod dm,
List appliedTransforms, Data result, List transforms, String type, List<? extends Transform> appliedTransforms, Data result,
String id); List<? extends Transform> transforms, String type, String id);
/** /**
* Creates a <code>SignedInfo</code> with the specified canonicalization * Creates a <code>SignedInfo</code> with the specified canonicalization
@ -493,9 +490,8 @@ public abstract class XMLSignatureFactory {
* @throws NullPointerException if any of the parameters * @throws NullPointerException if any of the parameters
* are <code>null</code> * are <code>null</code>
*/ */
@SuppressWarnings("rawtypes")
public abstract SignedInfo newSignedInfo(CanonicalizationMethod cm, public abstract SignedInfo newSignedInfo(CanonicalizationMethod cm,
SignatureMethod sm, List references); SignatureMethod sm, List<? extends Reference> references);
/** /**
* Creates a <code>SignedInfo</code> with the specified parameters. * Creates a <code>SignedInfo</code> with the specified parameters.
@ -512,9 +508,8 @@ public abstract class XMLSignatureFactory {
* @throws NullPointerException if <code>cm</code>, <code>sm</code>, or * @throws NullPointerException if <code>cm</code>, <code>sm</code>, or
* <code>references</code> are <code>null</code> * <code>references</code> are <code>null</code>
*/ */
@SuppressWarnings("rawtypes")
public abstract SignedInfo newSignedInfo(CanonicalizationMethod cm, public abstract SignedInfo newSignedInfo(CanonicalizationMethod cm,
SignatureMethod sm, List references, String id); SignatureMethod sm, List<? extends Reference> references, String id);
// Object factory methods // Object factory methods
/** /**
@ -530,9 +525,8 @@ public abstract class XMLSignatureFactory {
* @throws ClassCastException if <code>content</code> contains any * @throws ClassCastException if <code>content</code> contains any
* entries that are not of type {@link XMLStructure} * entries that are not of type {@link XMLStructure}
*/ */
@SuppressWarnings("rawtypes") public abstract XMLObject newXMLObject(List<? extends XMLStructure> content,
public abstract XMLObject newXMLObject(List content, String id, String id, String mimeType, String encoding);
String mimeType, String encoding);
/** /**
* Creates a <code>Manifest</code> containing the specified * Creates a <code>Manifest</code> containing the specified
@ -547,8 +541,7 @@ public abstract class XMLSignatureFactory {
* @throws ClassCastException if <code>references</code> contains any * @throws ClassCastException if <code>references</code> contains any
* entries that are not of type {@link Reference} * entries that are not of type {@link Reference}
*/ */
@SuppressWarnings("rawtypes") public abstract Manifest newManifest(List<? extends Reference> references);
public abstract Manifest newManifest(List references);
/** /**
* Creates a <code>Manifest</code> containing the specified * Creates a <code>Manifest</code> containing the specified
@ -564,8 +557,8 @@ public abstract class XMLSignatureFactory {
* @throws ClassCastException if <code>references</code> contains any * @throws ClassCastException if <code>references</code> contains any
* entries that are not of type {@link Reference} * entries that are not of type {@link Reference}
*/ */
@SuppressWarnings("rawtypes") public abstract Manifest newManifest(List<? extends Reference> references,
public abstract Manifest newManifest(List references, String id); String id);
/** /**
* Creates a <code>SignatureProperty</code> containing the specified * Creates a <code>SignatureProperty</code> containing the specified
@ -583,9 +576,8 @@ public abstract class XMLSignatureFactory {
* @throws ClassCastException if <code>content</code> contains any * @throws ClassCastException if <code>content</code> contains any
* entries that are not of type {@link XMLStructure} * entries that are not of type {@link XMLStructure}
*/ */
@SuppressWarnings("rawtypes")
public abstract SignatureProperty newSignatureProperty public abstract SignatureProperty newSignatureProperty
(List content, String target, String id); (List<? extends XMLStructure> content, String target, String id);
/** /**
* Creates a <code>SignatureProperties</code> containing the specified * Creates a <code>SignatureProperties</code> containing the specified
@ -602,9 +594,8 @@ public abstract class XMLSignatureFactory {
* @throws ClassCastException if <code>properties</code> contains any * @throws ClassCastException if <code>properties</code> contains any
* entries that are not of type {@link SignatureProperty} * entries that are not of type {@link SignatureProperty}
*/ */
@SuppressWarnings("rawtypes")
public abstract SignatureProperties newSignatureProperties public abstract SignatureProperties newSignatureProperties
(List properties, String id); (List<? extends SignatureProperty> properties, String id);
// Algorithm factory methods // Algorithm factory methods
/** /**

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -94,8 +94,7 @@ public interface KeyInfo extends XMLStructure {
* in this <code>KeyInfo</code>. Never returns <code>null</code> or an * in this <code>KeyInfo</code>. Never returns <code>null</code> or an
* empty list. * empty list.
*/ */
@SuppressWarnings("rawtypes") List<XMLStructure> getContent();
List getContent();
/** /**
* Return the optional Id attribute of this <code>KeyInfo</code>, which * Return the optional Id attribute of this <code>KeyInfo</code>, which

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -305,8 +305,7 @@ public abstract class KeyInfoFactory {
* @throws ClassCastException if <code>content</code> contains any entries * @throws ClassCastException if <code>content</code> contains any entries
* that are not of type {@link XMLStructure} * that are not of type {@link XMLStructure}
*/ */
@SuppressWarnings("rawtypes") public abstract KeyInfo newKeyInfo(List<? extends XMLStructure> content);
public abstract KeyInfo newKeyInfo(List content);
/** /**
* Creates a <code>KeyInfo</code> containing the specified list of key * Creates a <code>KeyInfo</code> containing the specified list of key
@ -325,8 +324,8 @@ public abstract class KeyInfoFactory {
* @throws ClassCastException if <code>content</code> contains any entries * @throws ClassCastException if <code>content</code> contains any entries
* that are not of type {@link XMLStructure} * that are not of type {@link XMLStructure}
*/ */
@SuppressWarnings("rawtypes") public abstract KeyInfo newKeyInfo(List<? extends XMLStructure> content,
public abstract KeyInfo newKeyInfo(List content, String id); String id);
/** /**
* Creates a <code>KeyName</code> from the specified name. * Creates a <code>KeyName</code> from the specified name.
@ -387,9 +386,8 @@ public abstract class KeyInfoFactory {
* @throws ClassCastException if <code>other</code> contains any * @throws ClassCastException if <code>other</code> contains any
* entries that are not of type {@link XMLStructure} * entries that are not of type {@link XMLStructure}
*/ */
@SuppressWarnings("rawtypes")
public abstract PGPData newPGPData(byte[] keyId, byte[] keyPacket, public abstract PGPData newPGPData(byte[] keyId, byte[] keyPacket,
List other); List<? extends XMLStructure> other);
/** /**
* Creates a <code>PGPData</code> from the specified PGP key material * Creates a <code>PGPData</code> from the specified PGP key material
@ -411,8 +409,8 @@ public abstract class KeyInfoFactory {
* @throws ClassCastException if <code>other</code> contains any * @throws ClassCastException if <code>other</code> contains any
* entries that are not of type {@link XMLStructure} * entries that are not of type {@link XMLStructure}
*/ */
@SuppressWarnings("rawtypes") public abstract PGPData newPGPData(byte[] keyPacket,
public abstract PGPData newPGPData(byte[] keyPacket, List other); List<? extends XMLStructure> other);
/** /**
* Creates a <code>RetrievalMethod</code> from the specified URI. * Creates a <code>RetrievalMethod</code> from the specified URI.
@ -443,9 +441,8 @@ public abstract class KeyInfoFactory {
* @throws ClassCastException if <code>transforms</code> contains any * @throws ClassCastException if <code>transforms</code> contains any
* entries that are not of type {@link Transform} * entries that are not of type {@link Transform}
*/ */
@SuppressWarnings("rawtypes")
public abstract RetrievalMethod newRetrievalMethod(String uri, String type, public abstract RetrievalMethod newRetrievalMethod(String uri, String type,
List transforms); List<? extends Transform> transforms);
/** /**
* Creates a <code>X509Data</code> containing the specified list of * Creates a <code>X509Data</code> containing the specified list of
@ -469,8 +466,7 @@ public abstract class KeyInfoFactory {
* @throws ClassCastException if <code>content</code> contains any entries * @throws ClassCastException if <code>content</code> contains any entries
* that are not of one of the valid types mentioned above * that are not of one of the valid types mentioned above
*/ */
@SuppressWarnings("rawtypes") public abstract X509Data newX509Data(List<?> content);
public abstract X509Data newX509Data(List content);
/** /**
* Creates an <code>X509IssuerSerial</code> from the specified X.500 issuer * Creates an <code>X509IssuerSerial</code> from the specified X.500 issuer

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -112,6 +112,5 @@ public interface PGPData extends XMLStructure {
* @return an unmodifiable list of <code>XMLStructure</code>s (may be * @return an unmodifiable list of <code>XMLStructure</code>s (may be
* empty, but never <code>null</code>) * empty, but never <code>null</code>)
*/ */
@SuppressWarnings("rawtypes") List<XMLStructure> getExternalElements();
List getExternalElements();
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -80,8 +80,7 @@ public interface RetrievalMethod extends URIReference, XMLStructure {
* @return an unmodifiable list of <code>Transform</code> objects (may be * @return an unmodifiable list of <code>Transform</code> objects (may be
* empty but never <code>null</code>). * empty but never <code>null</code>).
*/ */
@SuppressWarnings("rawtypes") List<Transform> getTransforms();
List getTransforms();
/** /**
* Returns the URI of the referenced <code>KeyInfo</code> information. * Returns the URI of the referenced <code>KeyInfo</code> information.

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -109,6 +109,5 @@ public interface X509Data extends XMLStructure {
* @return an unmodifiable list of the content in this <code>X509Data</code> * @return an unmodifiable list of the content in this <code>X509Data</code>
* (never <code>null</code> or empty) * (never <code>null</code> or empty)
*/ */
@SuppressWarnings("rawtypes") List<?> getContent();
List getContent();
} }

View File

@ -59,7 +59,7 @@ import java.util.List;
*/ */
public final class ExcC14NParameterSpec implements C14NMethodParameterSpec { public final class ExcC14NParameterSpec implements C14NMethodParameterSpec {
private List<String> preList; private final List<String> prefixList;
/** /**
* Indicates the default namespace ("#default"). * Indicates the default namespace ("#default").
@ -71,7 +71,7 @@ public final class ExcC14NParameterSpec implements C14NMethodParameterSpec {
* list. * list.
*/ */
public ExcC14NParameterSpec() { public ExcC14NParameterSpec() {
preList = Collections.emptyList(); prefixList = Collections.emptyList();
} }
/** /**
@ -86,22 +86,14 @@ public final class ExcC14NParameterSpec implements C14NMethodParameterSpec {
* @throws ClassCastException if any of the entries in the list are not * @throws ClassCastException if any of the entries in the list are not
* of type <code>String</code> * of type <code>String</code>
*/ */
@SuppressWarnings("rawtypes") public ExcC14NParameterSpec(List<String> prefixList) {
public ExcC14NParameterSpec(List prefixList) {
if (prefixList == null) { if (prefixList == null) {
throw new NullPointerException("prefixList cannot be null"); throw new NullPointerException("prefixList cannot be null");
} }
List<?> copy = new ArrayList<>((List<?>)prefixList); List<String> tempList = Collections.checkedList(new ArrayList<>(),
for (int i = 0, size = copy.size(); i < size; i++) { String.class);
if (!(copy.get(i) instanceof String)) { tempList.addAll(prefixList);
throw new ClassCastException("not a String"); this.prefixList = Collections.unmodifiableList(tempList);
}
}
@SuppressWarnings("unchecked")
List<String> temp = (List<String>)copy;
preList = Collections.unmodifiableList(temp);
} }
/** /**
@ -114,8 +106,7 @@ public final class ExcC14NParameterSpec implements C14NMethodParameterSpec {
* @return the inclusive namespace prefix list (may be empty but never * @return the inclusive namespace prefix list (may be empty but never
* <code>null</code>) * <code>null</code>)
*/ */
@SuppressWarnings("rawtypes") public List<String> getPrefixList() {
public List getPrefixList() { return prefixList;
return preList;
} }
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -59,27 +59,18 @@ public final class XPathFilter2ParameterSpec implements TransformParameterSpec {
* @throws NullPointerException if <code>xPathList</code> is * @throws NullPointerException if <code>xPathList</code> is
* <code>null</code> * <code>null</code>
*/ */
@SuppressWarnings("rawtypes") public XPathFilter2ParameterSpec(List<XPathType> xPathList) {
public XPathFilter2ParameterSpec(List xPathList) {
if (xPathList == null) { if (xPathList == null) {
throw new NullPointerException("xPathList cannot be null"); throw new NullPointerException("xPathList cannot be null");
} }
List<?> xPathListCopy = new ArrayList<>((List<?>)xPathList); List<XPathType> tempList =
if (xPathListCopy.isEmpty()) { Collections.checkedList(new ArrayList<XPathType>(),
XPathType.class);
tempList.addAll(xPathList);
if (tempList.isEmpty()) {
throw new IllegalArgumentException("xPathList cannot be empty"); throw new IllegalArgumentException("xPathList cannot be empty");
} }
int size = xPathListCopy.size(); this.xPathList = Collections.unmodifiableList(tempList);
for (int i = 0; i < size; i++) {
if (!(xPathListCopy.get(i) instanceof XPathType)) {
throw new ClassCastException
("xPathList["+i+"] is not a valid type");
}
}
@SuppressWarnings("unchecked")
List<XPathType> temp = (List<XPathType>)xPathListCopy;
this.xPathList = Collections.unmodifiableList(temp);
} }
/** /**
@ -91,8 +82,7 @@ public final class XPathFilter2ParameterSpec implements TransformParameterSpec {
* @return a <code>List</code> of <code>XPathType</code> objects * @return a <code>List</code> of <code>XPathType</code> objects
* (never <code>null</code> or empty) * (never <code>null</code> or empty)
*/ */
@SuppressWarnings("rawtypes") public List<XPathType> getXPathList() {
public List getXPathList() {
return xPathList; return xPathList;
} }
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -32,7 +32,6 @@ import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
import java.util.Map; import java.util.Map;
import java.util.Map.Entry;
/** /**
* Parameters for the <a href="http://www.w3.org/TR/xmldsig-core/#sec-XPath"> * Parameters for the <a href="http://www.w3.org/TR/xmldsig-core/#sec-XPath">
@ -51,8 +50,8 @@ import java.util.Map.Entry;
*/ */
public final class XPathFilterParameterSpec implements TransformParameterSpec { public final class XPathFilterParameterSpec implements TransformParameterSpec {
private String xPath; private final String xPath;
private Map<String,String> nsMap; private final Map<String,String> nsMap;
/** /**
* Creates an <code>XPathFilterParameterSpec</code> with the specified * Creates an <code>XPathFilterParameterSpec</code> with the specified
@ -83,26 +82,16 @@ public final class XPathFilterParameterSpec implements TransformParameterSpec {
* @throws ClassCastException if any of the map's keys or entries are not * @throws ClassCastException if any of the map's keys or entries are not
* of type <code>String</code> * of type <code>String</code>
*/ */
@SuppressWarnings("rawtypes") public XPathFilterParameterSpec(String xPath, Map<String,String> namespaceMap) {
public XPathFilterParameterSpec(String xPath, Map namespaceMap) {
if (xPath == null || namespaceMap == null) { if (xPath == null || namespaceMap == null) {
throw new NullPointerException(); throw new NullPointerException();
} }
this.xPath = xPath; this.xPath = xPath;
Map<?,?> copy = new HashMap<>((Map<?,?>)namespaceMap); Map<String,String> tempMap = Collections.checkedMap(new HashMap<>(),
Iterator<? extends Map.Entry<?,?>> entries = copy.entrySet().iterator(); String.class,
while (entries.hasNext()) { String.class);
Map.Entry<?,?> me = entries.next(); tempMap.putAll(namespaceMap);
if (!(me.getKey() instanceof String) || this.nsMap = Collections.unmodifiableMap(tempMap);
!(me.getValue() instanceof String)) {
throw new ClassCastException("not a String");
}
}
@SuppressWarnings("unchecked")
Map<String,String> temp = (Map<String,String>)copy;
nsMap = Collections.unmodifiableMap(temp);
} }
/** /**
@ -125,8 +114,7 @@ public final class XPathFilterParameterSpec implements TransformParameterSpec {
* @return a <code>Map</code> of namespace prefixes to namespace URIs (may * @return a <code>Map</code> of namespace prefixes to namespace URIs (may
* be empty, but never <code>null</code>) * be empty, but never <code>null</code>)
*/ */
@SuppressWarnings("rawtypes") public Map<String,String> getNamespaceMap() {
public Map getNamespaceMap() {
return nsMap; return nsMap;
} }
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -28,7 +28,6 @@
package javax.xml.crypto.dsig.spec; package javax.xml.crypto.dsig.spec;
import java.util.Collections; import java.util.Collections;
import java.util.Iterator;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
@ -106,7 +105,7 @@ public class XPathType {
private final String expression; private final String expression;
private final Filter filter; private final Filter filter;
private Map<String,String> nsMap; private final Map<String,String> nsMap;
/** /**
* Creates an <code>XPathType</code> instance with the specified XPath * Creates an <code>XPathType</code> instance with the specified XPath
@ -147,26 +146,24 @@ public class XPathType {
* @throws ClassCastException if any of the map's keys or entries are * @throws ClassCastException if any of the map's keys or entries are
* not of type <code>String</code> * not of type <code>String</code>
*/ */
@SuppressWarnings("rawtypes") public XPathType(String expression, Filter filter,
public XPathType(String expression, Filter filter, Map namespaceMap) { Map<String,String> namespaceMap) {
this(expression, filter); if (expression == null) {
throw new NullPointerException("expression cannot be null");
}
if (filter == null) {
throw new NullPointerException("filter cannot be null");
}
if (namespaceMap == null) { if (namespaceMap == null) {
throw new NullPointerException("namespaceMap cannot be null"); throw new NullPointerException("namespaceMap cannot be null");
} }
Map<?,?> copy = new HashMap<>((Map<?,?>)namespaceMap); this.expression = expression;
Iterator<? extends Map.Entry<?,?>> entries = copy.entrySet().iterator(); this.filter = filter;
while (entries.hasNext()) { Map<String,String> tempMap = Collections.checkedMap(new HashMap<>(),
Map.Entry<?,?> me = entries.next(); String.class,
if (!(me.getKey() instanceof String) || String.class);
!(me.getValue() instanceof String)) { tempMap.putAll(namespaceMap);
throw new ClassCastException("not a String"); this.nsMap = Collections.unmodifiableMap(tempMap);
}
}
@SuppressWarnings("unchecked")
Map<String,String> temp = (Map<String,String>)copy;
nsMap = Collections.unmodifiableMap(temp);
} }
/** /**
@ -198,8 +195,7 @@ public class XPathType {
* @return a <code>Map</code> of namespace prefixes to namespace URIs * @return a <code>Map</code> of namespace prefixes to namespace URIs
* (may be empty, but never <code>null</code>) * (may be empty, but never <code>null</code>)
*/ */
@SuppressWarnings("rawtypes") public Map<String,String> getNamespaceMap() {
public Map getNamespaceMap() {
return nsMap; return nsMap;
} }
} }

View File

@ -21,7 +21,7 @@
* under the License. * under the License.
*/ */
/* /*
* Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
*/ */
/* /*
* $Id: ApacheCanonicalizer.java 1333869 2012-05-04 10:42:44Z coheigea $ * $Id: ApacheCanonicalizer.java 1333869 2012-05-04 10:42:44Z coheigea $
@ -166,11 +166,9 @@ public abstract class ApacheCanonicalizer extends TransformService {
(subTree.getRoot()))); (subTree.getRoot())));
} }
} else if (data instanceof NodeSetData) { } else if (data instanceof NodeSetData) {
NodeSetData nsd = (NodeSetData)data; NodeSetData<?> nsd = (NodeSetData<?>)data;
// convert Iterator to Set // convert Iterator to Set<Node>
@SuppressWarnings("unchecked") nodeSet = Utils.toNodeSet(nsd.iterator());
Set<Node> ns = Utils.toNodeSet(nsd.iterator());
nodeSet = ns;
if (log.isLoggable(java.util.logging.Level.FINE)) { if (log.isLoggable(java.util.logging.Level.FINE)) {
log.log(java.util.logging.Level.FINE, "Canonicalizing " + nodeSet.size() + " nodes"); log.log(java.util.logging.Level.FINE, "Canonicalizing " + nodeSet.size() + " nodes");
} }
@ -236,7 +234,6 @@ public abstract class ApacheCanonicalizer extends TransformService {
in = new XMLSignatureInput(subTree.getRoot()); in = new XMLSignatureInput(subTree.getRoot());
in.setExcludeComments(subTree.excludeComments()); in.setExcludeComments(subTree.excludeComments());
} else { } else {
@SuppressWarnings("unchecked")
Set<Node> nodeSet = Set<Node> nodeSet =
Utils.toNodeSet(((NodeSetData)data).iterator()); Utils.toNodeSet(((NodeSetData)data).iterator());
in = new XMLSignatureInput(nodeSet); in = new XMLSignatureInput(nodeSet);

View File

@ -39,7 +39,7 @@ import com.sun.org.apache.xml.internal.security.signature.NodeFilter;
import com.sun.org.apache.xml.internal.security.signature.XMLSignatureInput; import com.sun.org.apache.xml.internal.security.signature.XMLSignatureInput;
import com.sun.org.apache.xml.internal.security.utils.XMLUtils; import com.sun.org.apache.xml.internal.security.utils.XMLUtils;
public class ApacheNodeSetData implements ApacheData, NodeSetData { public class ApacheNodeSetData implements ApacheData, NodeSetData<Node> {
private XMLSignatureInput xi; private XMLSignatureInput xi;

View File

@ -21,7 +21,7 @@
* under the License. * under the License.
*/ */
/* /*
* Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
*/ */
/* /*
* $Id: ApacheTransform.java 1333869 2012-05-04 10:42:44Z coheigea $ * $Id: ApacheTransform.java 1333869 2012-05-04 10:42:44Z coheigea $
@ -175,7 +175,6 @@ public abstract class ApacheTransform extends TransformService {
in = new XMLSignatureInput(subTree.getRoot()); in = new XMLSignatureInput(subTree.getRoot());
in.setExcludeComments(subTree.excludeComments()); in.setExcludeComments(subTree.excludeComments());
} else { } else {
@SuppressWarnings("unchecked")
Set<Node> nodeSet = Set<Node> nodeSet =
Utils.toNodeSet(((NodeSetData)data).iterator()); Utils.toNodeSet(((NodeSetData)data).iterator());
in = new XMLSignatureInput(nodeSet); in = new XMLSignatureInput(nodeSet);

View File

@ -21,7 +21,7 @@
* under the License. * under the License.
*/ */
/* /*
* Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
*/ */
/* /*
* $Id: DOMExcC14NMethod.java 1197150 2011-11-03 14:34:57Z coheigea $ * $Id: DOMExcC14NMethod.java 1197150 2011-11-03 14:34:57Z coheigea $
@ -119,7 +119,6 @@ public final class DOMExcC14NMethod extends ApacheCanonicalizer {
ExcC14NParameterSpec params = (ExcC14NParameterSpec)spec; ExcC14NParameterSpec params = (ExcC14NParameterSpec)spec;
StringBuilder prefixListAttr = new StringBuilder(""); StringBuilder prefixListAttr = new StringBuilder("");
@SuppressWarnings("unchecked")
List<String> prefixList = params.getPrefixList(); List<String> prefixList = params.getPrefixList();
for (int i = 0, size = prefixList.size(); i < size; i++) { for (int i = 0, size = prefixList.size(); i < size; i++) {
prefixListAttr.append(prefixList.get(i)); prefixListAttr.append(prefixList.get(i));

View File

@ -68,17 +68,14 @@ public final class DOMKeyInfo extends DOMStructure implements KeyInfo {
if (content == null) { if (content == null) {
throw new NullPointerException("content cannot be null"); throw new NullPointerException("content cannot be null");
} }
this.keyInfoTypes = List<XMLStructure> tempList =
Collections.unmodifiableList(new ArrayList<XMLStructure>(content)); Collections.checkedList(new ArrayList<XMLStructure>(),
XMLStructure.class);
tempList.addAll(content);
this.keyInfoTypes = Collections.unmodifiableList(tempList);
if (this.keyInfoTypes.isEmpty()) { if (this.keyInfoTypes.isEmpty()) {
throw new IllegalArgumentException("content cannot be empty"); throw new IllegalArgumentException("content cannot be empty");
} }
for (int i = 0, size = this.keyInfoTypes.size(); i < size; i++) {
if (!(this.keyInfoTypes.get(i) instanceof XMLStructure)) {
throw new ClassCastException
("content["+i+"] is not a valid KeyInfo type");
}
}
this.id = id; this.id = id;
} }

View File

@ -34,6 +34,7 @@ import java.security.PublicKey;
import java.util.List; import java.util.List;
import javax.xml.crypto.*; import javax.xml.crypto.*;
import javax.xml.crypto.dom.DOMCryptoContext; import javax.xml.crypto.dom.DOMCryptoContext;
import javax.xml.crypto.dsig.Transform;
import javax.xml.crypto.dsig.keyinfo.*; import javax.xml.crypto.dsig.keyinfo.*;
import org.w3c.dom.Document; import org.w3c.dom.Document;
import org.w3c.dom.Element; import org.w3c.dom.Element;
@ -48,13 +49,11 @@ public final class DOMKeyInfoFactory extends KeyInfoFactory {
public DOMKeyInfoFactory() { } public DOMKeyInfoFactory() { }
@SuppressWarnings("rawtypes") public KeyInfo newKeyInfo(List<? extends XMLStructure> content) {
public KeyInfo newKeyInfo(List content) {
return newKeyInfo(content, null); return newKeyInfo(content, null);
} }
@SuppressWarnings({ "unchecked", "rawtypes" }) public KeyInfo newKeyInfo(List<? extends XMLStructure> content, String id) {
public KeyInfo newKeyInfo(List content, String id) {
return new DOMKeyInfo(content, id); return new DOMKeyInfo(content, id);
} }
@ -79,13 +78,13 @@ public final class DOMKeyInfoFactory extends KeyInfoFactory {
return newPGPData(keyId, null, null); return newPGPData(keyId, null, null);
} }
@SuppressWarnings({ "unchecked", "rawtypes" }) public PGPData newPGPData(byte[] keyId, byte[] keyPacket,
public PGPData newPGPData(byte[] keyId, byte[] keyPacket, List other) { List<? extends XMLStructure> other) {
return new DOMPGPData(keyId, keyPacket, other); return new DOMPGPData(keyId, keyPacket, other);
} }
@SuppressWarnings({ "unchecked", "rawtypes" }) public PGPData newPGPData(byte[] keyPacket,
public PGPData newPGPData(byte[] keyPacket, List other) { List<? extends XMLStructure> other) {
return new DOMPGPData(keyPacket, other); return new DOMPGPData(keyPacket, other);
} }
@ -93,17 +92,15 @@ public final class DOMKeyInfoFactory extends KeyInfoFactory {
return newRetrievalMethod(uri, null, null); return newRetrievalMethod(uri, null, null);
} }
@SuppressWarnings({ "unchecked", "rawtypes" })
public RetrievalMethod newRetrievalMethod(String uri, String type, public RetrievalMethod newRetrievalMethod(String uri, String type,
List transforms) { List<? extends Transform> transforms) {
if (uri == null) { if (uri == null) {
throw new NullPointerException("uri must not be null"); throw new NullPointerException("uri must not be null");
} }
return new DOMRetrievalMethod(uri, type, transforms); return new DOMRetrievalMethod(uri, type, transforms);
} }
@SuppressWarnings("rawtypes") public X509Data newX509Data(List<?> content) {
public X509Data newX509Data(List content) {
return new DOMX509Data(content); return new DOMX509Data(content);
} }

View File

@ -33,7 +33,6 @@ import javax.xml.crypto.dom.DOMCryptoContext;
import javax.xml.crypto.dsig.*; import javax.xml.crypto.dsig.*;
import javax.xml.crypto.dsig.keyinfo.KeyValue; import javax.xml.crypto.dsig.keyinfo.KeyValue;
// import java.io.IOException;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.security.AccessController; import java.security.AccessController;

View File

@ -67,18 +67,15 @@ public final class DOMManifest extends DOMStructure implements Manifest {
if (references == null) { if (references == null) {
throw new NullPointerException("references cannot be null"); throw new NullPointerException("references cannot be null");
} }
this.references = List<Reference> tempList =
Collections.unmodifiableList(new ArrayList<Reference>(references)); Collections.checkedList(new ArrayList<Reference>(),
Reference.class);
tempList.addAll(references);
this.references = Collections.unmodifiableList(tempList);
if (this.references.isEmpty()) { if (this.references.isEmpty()) {
throw new IllegalArgumentException("list of references must " + throw new IllegalArgumentException("list of references must " +
"contain at least one entry"); "contain at least one entry");
} }
for (int i = 0, size = this.references.size(); i < size; i++) {
if (!(this.references.get(i) instanceof Reference)) {
throw new ClassCastException
("references["+i+"] is not a valid type");
}
}
this.id = id; this.id = id;
} }
@ -127,7 +124,6 @@ public final class DOMManifest extends DOMStructure implements Manifest {
return id; return id;
} }
@SuppressWarnings("unchecked")
static List<Reference> getManifestReferences(Manifest mf) { static List<Reference> getManifestReferences(Manifest mf) {
return mf.getReferences(); return mf.getReferences();
} }

View File

@ -73,18 +73,13 @@ public final class DOMPGPData extends DOMStructure implements PGPData {
if (keyPacket == null) { if (keyPacket == null) {
throw new NullPointerException("keyPacket cannot be null"); throw new NullPointerException("keyPacket cannot be null");
} }
if (other == null || other.isEmpty()) { List<XMLStructure> tempList =
this.externalElements = Collections.emptyList(); Collections.checkedList(new ArrayList<XMLStructure>(),
} else { XMLStructure.class);
this.externalElements = if (other != null) {
Collections.unmodifiableList(new ArrayList<XMLStructure>(other)); tempList.addAll(other);
for (int i = 0, size = this.externalElements.size(); i < size; i++) {
if (!(this.externalElements.get(i) instanceof XMLStructure)) {
throw new ClassCastException
("other["+i+"] is not a valid PGPData type");
}
}
} }
this.externalElements = Collections.unmodifiableList(tempList);
this.keyPacket = keyPacket.clone(); this.keyPacket = keyPacket.clone();
checkKeyPacket(keyPacket); checkKeyPacket(keyPacket);
this.keyId = null; this.keyId = null;
@ -120,18 +115,13 @@ public final class DOMPGPData extends DOMStructure implements PGPData {
if (keyId.length != 8) { if (keyId.length != 8) {
throw new IllegalArgumentException("keyId must be 8 bytes long"); throw new IllegalArgumentException("keyId must be 8 bytes long");
} }
if (other == null || other.isEmpty()) { List<XMLStructure> tempList =
this.externalElements = Collections.emptyList(); Collections.checkedList(new ArrayList<XMLStructure>(),
} else { XMLStructure.class);
this.externalElements = if (other != null) {
Collections.unmodifiableList(new ArrayList<XMLStructure>(other)); tempList.addAll(other);
for (int i = 0, size = this.externalElements.size(); i < size; i++) {
if (!(this.externalElements.get(i) instanceof XMLStructure)) {
throw new ClassCastException
("other["+i+"] is not a valid PGPData type");
}
}
} }
this.externalElements = Collections.unmodifiableList(tempList);
this.keyId = keyId.clone(); this.keyId = keyId.clone();
this.keyPacket = keyPacket == null ? null this.keyPacket = keyPacket == null ? null
: keyPacket.clone(); : keyPacket.clone();

View File

@ -147,29 +147,21 @@ public final class DOMReference extends DOMStructure
if (dm == null) { if (dm == null) {
throw new NullPointerException("DigestMethod must be non-null"); throw new NullPointerException("DigestMethod must be non-null");
} }
if (appliedTransforms == null) { List<Transform> tempList =
this.allTransforms = new ArrayList<Transform>(); Collections.checkedList(new ArrayList<Transform>(),
} else { Transform.class);
this.allTransforms = new ArrayList<Transform>(appliedTransforms); if (appliedTransforms != null) {
for (int i = 0, size = this.allTransforms.size(); i < size; i++) { tempList.addAll(appliedTransforms);
if (!(this.allTransforms.get(i) instanceof Transform)) {
throw new ClassCastException
("appliedTransforms["+i+"] is not a valid type");
} }
List<Transform> tempList2 =
Collections.checkedList(new ArrayList<Transform>(),
Transform.class);
if (transforms != null) {
tempList.addAll(transforms);
tempList2.addAll(transforms);
} }
} this.allTransforms = Collections.unmodifiableList(tempList);
if (transforms == null) { this.transforms = tempList2;
this.transforms = Collections.emptyList();
} else {
this.transforms = new ArrayList<Transform>(transforms);
for (int i = 0, size = this.transforms.size(); i < size; i++) {
if (!(this.transforms.get(i) instanceof Transform)) {
throw new ClassCastException
("transforms["+i+"] is not a valid type");
}
}
this.allTransforms.addAll(this.transforms);
}
this.digestMethod = dm; this.digestMethod = dm;
this.uri = uri; this.uri = uri;
if ((uri != null) && (!uri.equals(""))) { if ((uri != null) && (!uri.equals(""))) {
@ -642,7 +634,7 @@ public final class DOMReference extends DOMStructure
if (xsi.isNodeSet()) { if (xsi.isNodeSet()) {
try { try {
final Set<Node> s = xsi.getNodeSet(); final Set<Node> s = xsi.getNodeSet();
return new NodeSetData() { return new NodeSetData<Node>() {
public Iterator<Node> iterator() { return s.iterator(); } public Iterator<Node> iterator() { return s.iterator(); }
}; };
} catch (Exception e) { } catch (Exception e) {

View File

@ -90,18 +90,13 @@ public final class DOMRetrievalMethod extends DOMStructure
if (uri == null) { if (uri == null) {
throw new NullPointerException("uri cannot be null"); throw new NullPointerException("uri cannot be null");
} }
if (transforms == null || transforms.isEmpty()) { List<Transform> tempList =
this.transforms = Collections.emptyList(); Collections.checkedList(new ArrayList<Transform>(),
} else { Transform.class);
this.transforms = Collections.unmodifiableList( if (transforms != null) {
new ArrayList<Transform>(transforms)); tempList.addAll(transforms);
for (int i = 0, size = this.transforms.size(); i < size; i++) {
if (!(this.transforms.get(i) instanceof Transform)) {
throw new ClassCastException
("transforms["+i+"] is not a valid type");
}
}
} }
this.transforms = Collections.unmodifiableList(tempList);
this.uri = uri; this.uri = uri;
if (!uri.equals("")) { if (!uri.equals("")) {
try { try {
@ -244,7 +239,7 @@ public final class DOMRetrievalMethod extends DOMStructure
// guard against RetrievalMethod loops // guard against RetrievalMethod loops
if ((data instanceof NodeSetData) && Utils.secureValidation(context)) { if ((data instanceof NodeSetData) && Utils.secureValidation(context)) {
NodeSetData nsd = (NodeSetData)data; NodeSetData<?> nsd = (NodeSetData<?>)data;
Iterator<?> i = nsd.iterator(); Iterator<?> i = nsd.iterator();
if (i.hasNext()) { if (i.hasNext()) {
Node root = (Node)i.next(); Node root = (Node)i.next();

View File

@ -69,18 +69,15 @@ public final class DOMSignatureProperties extends DOMStructure
{ {
if (properties == null) { if (properties == null) {
throw new NullPointerException("properties cannot be null"); throw new NullPointerException("properties cannot be null");
} else if (properties.isEmpty()) { }
List<SignatureProperty> tempList =
Collections.checkedList(new ArrayList<SignatureProperty>(),
SignatureProperty.class);
tempList.addAll(properties);
if (tempList.isEmpty()) {
throw new IllegalArgumentException("properties cannot be empty"); throw new IllegalArgumentException("properties cannot be empty");
} else {
this.properties = Collections.unmodifiableList(
new ArrayList<SignatureProperty>(properties));
for (int i = 0, size = this.properties.size(); i < size; i++) {
if (!(this.properties.get(i) instanceof SignatureProperty)) {
throw new ClassCastException
("properties["+i+"] is not a valid type");
}
}
} }
this.properties = Collections.unmodifiableList(tempList);
this.id = id; this.id = id;
} }

View File

@ -71,20 +71,18 @@ public final class DOMSignatureProperty extends DOMStructure
{ {
if (target == null) { if (target == null) {
throw new NullPointerException("target cannot be null"); throw new NullPointerException("target cannot be null");
} else if (content == null) { }
if (content == null) {
throw new NullPointerException("content cannot be null"); throw new NullPointerException("content cannot be null");
} else if (content.isEmpty()) { }
List<XMLStructure> tempList =
Collections.checkedList(new ArrayList<XMLStructure>(),
XMLStructure.class);
tempList.addAll(content);
if (tempList.isEmpty()) {
throw new IllegalArgumentException("content cannot be empty"); throw new IllegalArgumentException("content cannot be empty");
} else {
this.content = Collections.unmodifiableList(
new ArrayList<XMLStructure>(content));
for (int i = 0, size = this.content.size(); i < size; i++) {
if (!(this.content.get(i) instanceof XMLStructure)) {
throw new ClassCastException
("content["+i+"] is not a valid type");
}
}
} }
this.content = Collections.unmodifiableList(tempList);
this.target = target; this.target = target;
this.id = id; this.id = id;
} }
@ -169,7 +167,6 @@ public final class DOMSignatureProperty extends DOMStructure
boolean idsEqual = (id == null ? osp.getId() == null boolean idsEqual = (id == null ? osp.getId() == null
: id.equals(osp.getId())); : id.equals(osp.getId()));
@SuppressWarnings("unchecked")
List<XMLStructure> ospContent = osp.getContent(); List<XMLStructure> ospContent = osp.getContent();
return (equalsContent(ospContent) && return (equalsContent(ospContent) &&
target.equals(osp.getTarget()) && idsEqual); target.equals(osp.getTarget()) && idsEqual);

View File

@ -100,19 +100,14 @@ public final class DOMSignedInfo extends DOMStructure implements SignedInfo {
} }
this.canonicalizationMethod = cm; this.canonicalizationMethod = cm;
this.signatureMethod = sm; this.signatureMethod = sm;
this.references = Collections.unmodifiableList( List<Reference> tempList =
new ArrayList<Reference>(references)); Collections.checkedList(new ArrayList<Reference>(),
if (this.references.isEmpty()) { Reference.class);
throw new IllegalArgumentException("list of references must " + tempList.addAll(references);
"contain at least one entry"); if (tempList.isEmpty()) {
} throw new IllegalArgumentException("references cannot be empty");
for (int i = 0, size = this.references.size(); i < size; i++) {
Object obj = this.references.get(i);
if (!(obj instanceof Reference)) {
throw new ClassCastException("list of references contains " +
"an illegal type");
}
} }
this.references = Collections.unmodifiableList(tempList);
} }
/** /**

View File

@ -44,7 +44,7 @@ import org.w3c.dom.Node;
* directly on the subdocument and there is no need to convert it * directly on the subdocument and there is no need to convert it
* first to an XPath node-set. * first to an XPath node-set.
*/ */
public class DOMSubTreeData implements NodeSetData { public class DOMSubTreeData implements NodeSetData<Node> {
private boolean excludeComments; private boolean excludeComments;
private Node root; private Node root;

View File

@ -367,9 +367,7 @@ public class DOMUtils {
private static boolean paramsEqual(XPathFilter2ParameterSpec spec1, private static boolean paramsEqual(XPathFilter2ParameterSpec spec1,
XPathFilter2ParameterSpec spec2) XPathFilter2ParameterSpec spec2)
{ {
@SuppressWarnings("unchecked")
List<XPathType> types = spec1.getXPathList(); List<XPathType> types = spec1.getXPathList();
@SuppressWarnings("unchecked")
List<XPathType> otypes = spec2.getXPathList(); List<XPathType> otypes = spec2.getXPathList();
int size = types.size(); int size = types.size();
if (size != otypes.size()) { if (size != otypes.size()) {

View File

@ -135,7 +135,7 @@ public final class DOMX509Data extends DOMStructure implements X509Data {
this.content = Collections.unmodifiableList(content); this.content = Collections.unmodifiableList(content);
} }
public List<Object> getContent() { public List<?> getContent() {
return content; return content;
} }
@ -265,7 +265,7 @@ public final class DOMX509Data extends DOMStructure implements X509Data {
} }
X509Data oxd = (X509Data)o; X509Data oxd = (X509Data)o;
@SuppressWarnings("unchecked") List<Object> ocontent = oxd.getContent(); List<?> ocontent = oxd.getContent();
int size = content.size(); int size = content.size();
if (size != ocontent.size()) { if (size != ocontent.size()) {
return false; return false;

View File

@ -70,18 +70,13 @@ public final class DOMXMLObject extends DOMStructure implements XMLObject {
public DOMXMLObject(List<? extends XMLStructure> content, String id, public DOMXMLObject(List<? extends XMLStructure> content, String id,
String mimeType, String encoding) String mimeType, String encoding)
{ {
if (content == null || content.isEmpty()) { List<XMLStructure> tempList =
this.content = Collections.emptyList(); Collections.checkedList(new ArrayList<XMLStructure>(),
} else { XMLStructure.class);
this.content = Collections.unmodifiableList( if (content != null) {
new ArrayList<XMLStructure>(content)); tempList.addAll(content);
for (int i = 0, size = this.content.size(); i < size; i++) {
if (!(this.content.get(i) instanceof XMLStructure)) {
throw new ClassCastException
("content["+i+"] is not a valid type");
}
}
} }
this.content = Collections.unmodifiableList(tempList);
this.id = id; this.id = id;
this.mimeType = mimeType; this.mimeType = mimeType;
this.encoding = encoding; this.encoding = encoding;
@ -204,7 +199,6 @@ public final class DOMXMLObject extends DOMStructure implements XMLObject {
(mimeType == null ? oxo.getMimeType() == null (mimeType == null ? oxo.getMimeType() == null
: mimeType.equals(oxo.getMimeType())); : mimeType.equals(oxo.getMimeType()));
@SuppressWarnings("unchecked")
List<XMLStructure> oxoContent = oxo.getContent(); List<XMLStructure> oxoContent = oxo.getContent();
return (idsEqual && encodingsEqual && mimeTypesEqual && return (idsEqual && encodingsEqual && mimeTypesEqual &&
equalsContent(oxoContent)); equalsContent(oxoContent));

View File

@ -109,18 +109,13 @@ public final class DOMXMLSignature extends DOMStructure
this.si = si; this.si = si;
this.id = id; this.id = id;
this.sv = new DOMSignatureValue(signatureValueId); this.sv = new DOMSignatureValue(signatureValueId);
if (objs == null) { List<XMLObject> tempList =
this.objects = Collections.emptyList(); Collections.checkedList(new ArrayList<XMLObject>(),
} else { XMLObject.class);
this.objects = if (objs != null) {
Collections.unmodifiableList(new ArrayList<XMLObject>(objs)); tempList.addAll(objs);
for (int i = 0, size = this.objects.size(); i < size; i++) {
if (!(this.objects.get(i) instanceof XMLObject)) {
throw new ClassCastException
("objs["+i+"] is not an XMLObject");
}
}
} }
this.objects = Collections.unmodifiableList(tempList);
this.ki = ki; this.ki = ki;
} }
@ -270,7 +265,6 @@ public final class DOMXMLSignature extends DOMStructure
} }
// validate all References // validate all References
@SuppressWarnings("unchecked")
List<Reference> refs = this.si.getReferences(); List<Reference> refs = this.si.getReferences();
boolean validateRefs = true; boolean validateRefs = true;
for (int i = 0, size = refs.size(); validateRefs && i < size; i++) { for (int i = 0, size = refs.size(); validateRefs && i < size; i++) {
@ -297,7 +291,6 @@ public final class DOMXMLSignature extends DOMStructure
{ {
for (int i=0, size=objects.size(); validateMans && i < size; i++) { for (int i=0, size=objects.size(); validateMans && i < size; i++) {
XMLObject xo = objects.get(i); XMLObject xo = objects.get(i);
@SuppressWarnings("unchecked")
List<XMLStructure> content = xo.getContent(); List<XMLStructure> content = xo.getContent();
int csize = content.size(); int csize = content.size();
for (int j = 0; validateMans && j < csize; j++) { for (int j = 0; validateMans && j < csize; j++) {
@ -307,7 +300,6 @@ public final class DOMXMLSignature extends DOMStructure
log.log(java.util.logging.Level.FINE, "validating manifest"); log.log(java.util.logging.Level.FINE, "validating manifest");
} }
Manifest man = (Manifest)xs; Manifest man = (Manifest)xs;
@SuppressWarnings("unchecked")
List<Reference> manRefs = man.getReferences(); List<Reference> manRefs = man.getReferences();
int rsize = manRefs.size(); int rsize = manRefs.size();
for (int k = 0; validateMans && k < rsize; k++) { for (int k = 0; validateMans && k < rsize; k++) {
@ -348,20 +340,17 @@ public final class DOMXMLSignature extends DOMStructure
signatureIdMap = new HashMap<String, XMLStructure>(); signatureIdMap = new HashMap<String, XMLStructure>();
signatureIdMap.put(id, this); signatureIdMap.put(id, this);
signatureIdMap.put(si.getId(), si); signatureIdMap.put(si.getId(), si);
@SuppressWarnings("unchecked")
List<Reference> refs = si.getReferences(); List<Reference> refs = si.getReferences();
for (Reference ref : refs) { for (Reference ref : refs) {
signatureIdMap.put(ref.getId(), ref); signatureIdMap.put(ref.getId(), ref);
} }
for (XMLObject obj : objects) { for (XMLObject obj : objects) {
signatureIdMap.put(obj.getId(), obj); signatureIdMap.put(obj.getId(), obj);
@SuppressWarnings("unchecked")
List<XMLStructure> content = obj.getContent(); List<XMLStructure> content = obj.getContent();
for (XMLStructure xs : content) { for (XMLStructure xs : content) {
if (xs instanceof Manifest) { if (xs instanceof Manifest) {
Manifest man = (Manifest)xs; Manifest man = (Manifest)xs;
signatureIdMap.put(man.getId(), man); signatureIdMap.put(man.getId(), man);
@SuppressWarnings("unchecked")
List<Reference> manRefs = man.getReferences(); List<Reference> manRefs = man.getReferences();
for (Reference ref : manRefs) { for (Reference ref : manRefs) {
allReferences.add(ref); allReferences.add(ref);
@ -483,7 +472,6 @@ public final class DOMXMLSignature extends DOMStructure
// reference dependencies in the XPath Transform - so be on // reference dependencies in the XPath Transform - so be on
// the safe side, and skip and do at end in the final sweep // the safe side, and skip and do at end in the final sweep
if (uri.length() == 0) { if (uri.length() == 0) {
@SuppressWarnings("unchecked")
List<Transform> transforms = ref.getTransforms(); List<Transform> transforms = ref.getTransforms();
for (Transform transform : transforms) { for (Transform transform : transforms) {
String transformAlg = transform.getAlgorithm(); String transformAlg = transform.getAlgorithm();

View File

@ -58,9 +58,8 @@ public final class DOMXMLSignatureFactory extends XMLSignatureFactory {
return new DOMXMLSignature(si, ki, null, null, null); return new DOMXMLSignature(si, ki, null, null, null);
} }
@SuppressWarnings({ "unchecked", "rawtypes" })
public XMLSignature newXMLSignature(SignedInfo si, KeyInfo ki, public XMLSignature newXMLSignature(SignedInfo si, KeyInfo ki,
List objects, String id, String signatureValueId) { List<? extends XMLObject> objects, String id, String signatureValueId) {
return new DOMXMLSignature(si, ki, objects, id, signatureValueId); return new DOMXMLSignature(si, ki, objects, id, signatureValueId);
} }
@ -68,16 +67,14 @@ public final class DOMXMLSignatureFactory extends XMLSignatureFactory {
return newReference(uri, dm, null, null, null); return newReference(uri, dm, null, null, null);
} }
@SuppressWarnings({ "unchecked", "rawtypes" }) public Reference newReference(String uri, DigestMethod dm,
public Reference newReference(String uri, DigestMethod dm, List transforms, List<? extends Transform> transforms, String type, String id) {
String type, String id) {
return new DOMReference(uri, type, dm, transforms, id, getProvider()); return new DOMReference(uri, type, dm, transforms, id, getProvider());
} }
@SuppressWarnings({ "unchecked", "rawtypes" })
public Reference newReference(String uri, DigestMethod dm, public Reference newReference(String uri, DigestMethod dm,
List appliedTransforms, Data result, List transforms, String type, List<? extends Transform> appliedTransforms, Data result,
String id) { List<? extends Transform> transforms, String type, String id) {
if (appliedTransforms == null) { if (appliedTransforms == null) {
throw new NullPointerException("appliedTransforms cannot be null"); throw new NullPointerException("appliedTransforms cannot be null");
} }
@ -91,9 +88,9 @@ public final class DOMXMLSignatureFactory extends XMLSignatureFactory {
(uri, type, dm, appliedTransforms, result, transforms, id, getProvider()); (uri, type, dm, appliedTransforms, result, transforms, id, getProvider());
} }
@SuppressWarnings({ "unchecked", "rawtypes" }) public Reference newReference(String uri, DigestMethod dm,
public Reference newReference(String uri, DigestMethod dm, List transforms, List<? extends Transform> transforms, String type, String id,
String type, String id, byte[] digestValue) { byte[] digestValue) {
if (digestValue == null) { if (digestValue == null) {
throw new NullPointerException("digestValue cannot be null"); throw new NullPointerException("digestValue cannot be null");
} }
@ -101,43 +98,38 @@ public final class DOMXMLSignatureFactory extends XMLSignatureFactory {
(uri, type, dm, null, null, transforms, id, digestValue, getProvider()); (uri, type, dm, null, null, transforms, id, digestValue, getProvider());
} }
@SuppressWarnings("rawtypes")
public SignedInfo newSignedInfo(CanonicalizationMethod cm, public SignedInfo newSignedInfo(CanonicalizationMethod cm,
SignatureMethod sm, List references) { SignatureMethod sm, List<? extends Reference> references) {
return newSignedInfo(cm, sm, references, null); return newSignedInfo(cm, sm, references, null);
} }
@SuppressWarnings({ "unchecked", "rawtypes" })
public SignedInfo newSignedInfo(CanonicalizationMethod cm, public SignedInfo newSignedInfo(CanonicalizationMethod cm,
SignatureMethod sm, List references, String id) { SignatureMethod sm, List<? extends Reference> references, String id) {
return new DOMSignedInfo(cm, sm, references, id); return new DOMSignedInfo(cm, sm, references, id);
} }
// Object factory methods // Object factory methods
@SuppressWarnings({ "unchecked", "rawtypes" }) public XMLObject newXMLObject(List<? extends XMLStructure> content,
public XMLObject newXMLObject(List content, String id, String mimeType, String id, String mimeType, String encoding) {
String encoding) {
return new DOMXMLObject(content, id, mimeType, encoding); return new DOMXMLObject(content, id, mimeType, encoding);
} }
@SuppressWarnings("rawtypes") public Manifest newManifest(List<? extends Reference> references) {
public Manifest newManifest(List references) {
return newManifest(references, null); return newManifest(references, null);
} }
@SuppressWarnings({ "unchecked", "rawtypes" }) public Manifest newManifest(List<? extends Reference> references,
public Manifest newManifest(List references, String id) { String id) {
return new DOMManifest(references, id); return new DOMManifest(references, id);
} }
@SuppressWarnings({ "unchecked", "rawtypes" }) public SignatureProperties newSignatureProperties(
public SignatureProperties newSignatureProperties(List props, String id) { List<? extends SignatureProperty> props, String id) {
return new DOMSignatureProperties(props, id); return new DOMSignatureProperties(props, id);
} }
@SuppressWarnings({ "unchecked", "rawtypes" })
public SignatureProperty newSignatureProperty public SignatureProperty newSignatureProperty
(List info, String target, String id) { (List<? extends XMLStructure> info, String target, String id) {
return new DOMSignatureProperty(info, target, id); return new DOMSignatureProperty(info, target, id);
} }

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