Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
7ff0de35
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
7ff0de35
编写于
9月 11, 2013
作者:
R
rriggs
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
5a3ee720
b0fd992a
变更
75
展开全部
隐藏空白更改
内联
并排
Showing
75 changed file
with
1639 addition
and
463 deletion
+1639
-463
make/java/java/genlocales.gmk
make/java/java/genlocales.gmk
+24
-24
make/java/java/localegen.sh
make/java/java/localegen.sh
+15
-15
make/java/text/base/FILES_java.gmk
make/java/text/base/FILES_java.gmk
+12
-0
make/java/util/FILES_java.gmk
make/java/util/FILES_java.gmk
+4
-1
make/java/util/FILES_properties.gmk
make/java/util/FILES_properties.gmk
+17
-1
make/sun/text/FILES_java.gmk
make/sun/text/FILES_java.gmk
+0
-15
make/sun/text/FILES_properties.gmk
make/sun/text/FILES_properties.gmk
+0
-16
makefiles/CreateJars.gmk
makefiles/CreateJars.gmk
+0
-33
makefiles/GensrcLocaleDataMetaInfo.gmk
makefiles/GensrcLocaleDataMetaInfo.gmk
+12
-12
src/share/classes/com/sun/nio/sctp/Association.java
src/share/classes/com/sun/nio/sctp/Association.java
+7
-0
src/share/classes/com/sun/nio/sctp/IllegalReceiveException.java
...are/classes/com/sun/nio/sctp/IllegalReceiveException.java
+3
-0
src/share/classes/com/sun/nio/sctp/IllegalUnbindException.java
...hare/classes/com/sun/nio/sctp/IllegalUnbindException.java
+3
-0
src/share/classes/com/sun/nio/sctp/InvalidStreamException.java
...hare/classes/com/sun/nio/sctp/InvalidStreamException.java
+3
-0
src/share/classes/com/sun/nio/sctp/MessageInfo.java
src/share/classes/com/sun/nio/sctp/MessageInfo.java
+1
-1
src/share/classes/com/sun/nio/sctp/Notification.java
src/share/classes/com/sun/nio/sctp/Notification.java
+2
-0
src/share/classes/com/sun/nio/sctp/SctpChannel.java
src/share/classes/com/sun/nio/sctp/SctpChannel.java
+11
-2
src/share/classes/com/sun/nio/sctp/SctpMultiChannel.java
src/share/classes/com/sun/nio/sctp/SctpMultiChannel.java
+14
-2
src/share/classes/com/sun/nio/sctp/SctpServerChannel.java
src/share/classes/com/sun/nio/sctp/SctpServerChannel.java
+7
-1
src/share/classes/java/lang/Class.java
src/share/classes/java/lang/Class.java
+66
-31
src/share/classes/java/lang/reflect/Executable.java
src/share/classes/java/lang/reflect/Executable.java
+25
-13
src/share/classes/java/net/AbstractPlainSocketImpl.java
src/share/classes/java/net/AbstractPlainSocketImpl.java
+0
-4
src/share/classes/java/net/InetAddressContainer.java
src/share/classes/java/net/InetAddressContainer.java
+30
-0
src/share/classes/java/rmi/activation/Activatable.java
src/share/classes/java/rmi/activation/Activatable.java
+25
-1
src/share/classes/java/rmi/activation/ActivationDesc.java
src/share/classes/java/rmi/activation/ActivationDesc.java
+9
-1
src/share/classes/java/rmi/activation/ActivationGroup.java
src/share/classes/java/rmi/activation/ActivationGroup.java
+11
-1
src/share/classes/java/rmi/activation/ActivationGroupID.java
src/share/classes/java/rmi/activation/ActivationGroupID.java
+3
-1
src/share/classes/java/rmi/activation/ActivationID.java
src/share/classes/java/rmi/activation/ActivationID.java
+3
-1
src/share/classes/java/rmi/activation/package.html
src/share/classes/java/rmi/activation/package.html
+10
-1
src/share/classes/java/security/AccessController.java
src/share/classes/java/security/AccessController.java
+24
-0
src/share/classes/java/security/AlgorithmParameters.java
src/share/classes/java/security/AlgorithmParameters.java
+1
-0
src/share/classes/java/security/AlgorithmParametersSpi.java
src/share/classes/java/security/AlgorithmParametersSpi.java
+2
-0
src/share/classes/java/security/KeyFactory.java
src/share/classes/java/security/KeyFactory.java
+2
-0
src/share/classes/java/security/KeyFactorySpi.java
src/share/classes/java/security/KeyFactorySpi.java
+2
-0
src/share/classes/java/security/KeyStore.java
src/share/classes/java/security/KeyStore.java
+1
-0
src/share/classes/java/security/Principal.java
src/share/classes/java/security/Principal.java
+2
-1
src/share/classes/java/security/cert/CertPathBuilderSpi.java
src/share/classes/java/security/cert/CertPathBuilderSpi.java
+2
-0
src/share/classes/java/security/cert/CertPathValidatorSpi.java
...hare/classes/java/security/cert/CertPathValidatorSpi.java
+2
-0
src/share/classes/java/security/cert/PKIXRevocationChecker.java
...are/classes/java/security/cert/PKIXRevocationChecker.java
+3
-0
src/share/classes/java/security/interfaces/RSAMultiPrimePrivateCrtKey.java
.../java/security/interfaces/RSAMultiPrimePrivateCrtKey.java
+6
-1
src/share/classes/java/security/interfaces/RSAPrivateCrtKey.java
...re/classes/java/security/interfaces/RSAPrivateCrtKey.java
+6
-1
src/share/classes/java/security/interfaces/RSAPrivateKey.java
...share/classes/java/security/interfaces/RSAPrivateKey.java
+6
-1
src/share/classes/java/security/interfaces/RSAPublicKey.java
src/share/classes/java/security/interfaces/RSAPublicKey.java
+6
-1
src/share/classes/java/util/logging/LogManager.java
src/share/classes/java/util/logging/LogManager.java
+211
-99
src/share/classes/java/util/logging/Logger.java
src/share/classes/java/util/logging/Logger.java
+27
-15
src/share/classes/javax/net/ssl/SSLParameters.java
src/share/classes/javax/net/ssl/SSLParameters.java
+33
-3
src/share/classes/sun/security/ssl/Handshaker.java
src/share/classes/sun/security/ssl/Handshaker.java
+29
-2
src/share/classes/sun/security/ssl/SSLEngineImpl.java
src/share/classes/sun/security/ssl/SSLEngineImpl.java
+10
-0
src/share/classes/sun/security/ssl/SSLServerSocketImpl.java
src/share/classes/sun/security/ssl/SSLServerSocketImpl.java
+11
-2
src/share/classes/sun/security/ssl/SSLSocketImpl.java
src/share/classes/sun/security/ssl/SSLSocketImpl.java
+13
-1
src/share/classes/sun/security/ssl/ServerHandshaker.java
src/share/classes/sun/security/ssl/ServerHandshaker.java
+13
-4
src/share/classes/sun/util/locale/provider/JRELocaleProviderAdapter.java
...es/sun/util/locale/provider/JRELocaleProviderAdapter.java
+9
-9
src/share/classes/sun/util/locale/provider/LocaleDataMetaInfo-XLocales.java.template
...locale/provider/LocaleDataMetaInfo-XLocales.java.template
+7
-7
src/share/classes/sun/util/locale/provider/LocaleResources.java
...are/classes/sun/util/locale/provider/LocaleResources.java
+1
-1
src/windows/classes/sun/security/mscapi/Key.java
src/windows/classes/sun/security/mscapi/Key.java
+2
-1
src/windows/native/java/net/NetworkInterface_winXP.c
src/windows/native/java/net/NetworkInterface_winXP.c
+12
-7
test/java/lang/Class/ArrayMethods.java
test/java/lang/Class/ArrayMethods.java
+108
-0
test/java/net/CookieHandler/LocalHostCookie.java
test/java/net/CookieHandler/LocalHostCookie.java
+6
-2
test/java/net/NetworkInterface/Equals.java
test/java/net/NetworkInterface/Equals.java
+51
-9
test/java/net/NetworkInterface/UniqueMacAddressesTest.java
test/java/net/NetworkInterface/UniqueMacAddressesTest.java
+129
-0
test/java/nio/file/WatchService/SensitivityModifier.java
test/java/nio/file/WatchService/SensitivityModifier.java
+1
-1
test/java/util/logging/Logger/getGlobal/TestGetGlobal.java
test/java/util/logging/Logger/getGlobal/TestGetGlobal.java
+9
-1
test/java/util/logging/Logger/getGlobal/TestGetGlobalConcurrent.java
...til/logging/Logger/getGlobal/TestGetGlobalConcurrent.java
+16
-10
test/java/util/logging/Logger/getGlobal/policy
test/java/util/logging/Logger/getGlobal/policy
+1
-0
test/java/util/logging/ParentLoggersTest.java
test/java/util/logging/ParentLoggersTest.java
+1
-1
test/java/util/logging/TestAppletLoggerContext.java
test/java/util/logging/TestAppletLoggerContext.java
+76
-89
test/sun/security/krb5/runNameEquals.sh
test/sun/security/krb5/runNameEquals.sh
+10
-1
test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLEngineImpl/CloseEngineException.java
.../ssl/internal/ssl/SSLEngineImpl/CloseEngineException.java
+11
-4
test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLEngineImpl/CloseInboundException.java
...ssl/internal/ssl/SSLEngineImpl/CloseInboundException.java
+6
-0
test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLEngineImpl/CloseStart.java
...om/sun/net/ssl/internal/ssl/SSLEngineImpl/CloseStart.java
+10
-3
test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLEngineImpl/DelegatedTaskWrongException.java
...ternal/ssl/SSLEngineImpl/DelegatedTaskWrongException.java
+6
-1
test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLEngineImpl/EmptyExtensionData.java
...et/ssl/internal/ssl/SSLEngineImpl/EmptyExtensionData.java
+6
-0
test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLEngineImpl/EngineEnforceUseClientMode.java
...nternal/ssl/SSLEngineImpl/EngineEnforceUseClientMode.java
+6
-1
test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLEngineImpl/RehandshakeFinished.java
...t/ssl/internal/ssl/SSLEngineImpl/RehandshakeFinished.java
+10
-7
test/sun/security/ssl/javax/net/ssl/SSLParameters/UseCipherSuitesOrder.java
...ssl/javax/net/ssl/SSLParameters/UseCipherSuitesOrder.java
+357
-0
test/sun/util/locale/provider/Bug8024141.java
test/sun/util/locale/provider/Bug8024141.java
+59
-0
未找到文件。
make/java/java/genlocales.gmk
浏览文件 @
7ff0de35
...
...
@@ -38,31 +38,31 @@ FILES_compiled_properties_orig := $(FILES_compiled_properties)
# only FILES_java and FILES_compiled_properties variables will be picked up
#
# $(BUILDDIR)/java/util/FILES_java.gmk & $(BUILDDIR)/java/util/FILES_properties.gmk
# contain "sun.util.resources" for
US
language support
# contain "sun.util.resources" for
EN
language support
include $(BUILDDIR)/java/util/FILES_java.gmk
include $(BUILDDIR)/java/util/FILES_properties.gmk
US
_Resources_java := $(FILES_java)
US
_Resources_properties := $(FILES_compiled_properties)
EN
_Resources_java := $(FILES_java)
EN
_Resources_properties := $(FILES_compiled_properties)
# $(BUILDDIR)/java/text/FILES_java.gmk contains the "sun.text.resources" for
#
US
language support
#
EN
language support
include $(BUILDDIR)/java/text/base/FILES_java.gmk
US
_Resources_java += $(FILES_java)
EN
_Resources_java += $(FILES_java)
FILES_compiled_properties=
# $(BUILDDIR)/sun/text/FILES_java.gmk & $(BUILDDIR)/sun/text/FILES_properties.gmk
# contain both resources for Non-
US
language support
# contain both resources for Non-
EN
language support
include $(BUILDDIR)/sun/text/FILES_java.gmk
include $(BUILDDIR)/sun/text/FILES_properties.gmk
Non
US
_Resources_java := $(FILES_java)
Non
US
_Resources_properties := $(FILES_compiled_properties)
Non
EN
_Resources_java := $(FILES_java)
Non
EN
_Resources_properties := $(FILES_compiled_properties)
# Restore the orignal FILES_java & FILES_compiled_properties variables
FILES_java := $(FILES_java_orig)
...
...
@@ -80,30 +80,30 @@ RESOURCE_NAMES="FormatData CollationData TimeZoneNames LocaleNames CurrencyNames
ifeq ($(PLATFORM), macosx)
$(LocaleDataMetaInfo_Dest):$(LocaleDataMetaInfo_Src) $(LOCALEGEN_SH)
@$(RM) $@.tmp.
us $@.tmp.nonus
;
@$(RM) $@.tmp.
en $@.tmp.nonen
;
@$(prep-target)
@$(ECHO) $(
US_Resources_properties) | $(NAWK) 'gsub(/.properties/,"\n") {print}' > $@.tmp.us
;
@$(ECHO) $(
US_Resources_java) | $(NAWK) 'gsub(/.java/,"\n") {print}' >> $@.tmp.us
;
@$(ECHO) $(Non
US_Resources_properties) | $(NAWK) 'gsub(/.properties/,"\n") {print}' > $@.tmp.nonus
;
@$(ECHO) $(Non
US_Resources_java) | $(NAWK) 'gsub(/.java/,"\n") {print}' >> $@.tmp.nonus
;
@$(ECHO) $(
EN_Resources_properties) | $(NAWK) 'gsub(/.properties/,"\n") {print}' > $@.tmp.en
;
@$(ECHO) $(
EN_Resources_java) | $(NAWK) 'gsub(/.java/,"\n") {print}' >> $@.tmp.en
;
@$(ECHO) $(Non
EN_Resources_properties) | $(NAWK) 'gsub(/.properties/,"\n") {print}' > $@.tmp.nonen
;
@$(ECHO) $(Non
EN_Resources_java) | $(NAWK) 'gsub(/.java/,"\n") {print}' >> $@.tmp.nonen
;
NAWK="$(NAWK)" SED="$(SED)" SORT="$(SORT)" \
$(SH) $(LOCALEGEN_SH) $(RESOURCE_NAMES) $@.tmp.
us
\
$@.tmp.non
us
$< $@
@$(RM) $@.tmp.
us $@.tmp.nonus
;
$(SH) $(LOCALEGEN_SH) $(RESOURCE_NAMES) $@.tmp.
en
\
$@.tmp.non
en
$< $@
@$(RM) $@.tmp.
en $@.tmp.nonen
;
else
$(LocaleDataMetaInfo_Dest):$(LocaleDataMetaInfo_Src) $(LOCALEGEN_SH)
@$(RM) $@.tmp.
us $@.tmp.nonus
;
@$(RM) $@.tmp.
en $@.tmp.nonen
;
@$(prep-target)
@$(ECHO) $(subst .properties,'\n',$(
US_Resources_properties)) > $@.tmp.us
;
@$(ECHO) $(subst .java,'\n',$(
US_Resources_java)) >> $@.tmp.us
;
@$(ECHO) $(subst .properties,'\n',$(Non
US_Resources_properties)) > $@.tmp.nonus
;
@$(ECHO) $(subst .java,'\n',$(Non
US_Resources_java)) >> $@.tmp.nonus
;
@$(ECHO) $(subst .properties,'\n',$(
EN_Resources_properties)) > $@.tmp.en
;
@$(ECHO) $(subst .java,'\n',$(
EN_Resources_java)) >> $@.tmp.en
;
@$(ECHO) $(subst .properties,'\n',$(Non
EN_Resources_properties)) > $@.tmp.nonen
;
@$(ECHO) $(subst .java,'\n',$(Non
EN_Resources_java)) >> $@.tmp.nonen
;
NAWK="$(NAWK)" SED="$(SED)" SORT="$(SORT)" \
$(SH) $(LOCALEGEN_SH) $(RESOURCE_NAMES) $@.tmp.
us
\
$@.tmp.non
us
$< $@
@$(RM) $@.tmp.
us $@.tmp.nonus
;
$(SH) $(LOCALEGEN_SH) $(RESOURCE_NAMES) $@.tmp.
en
\
$@.tmp.non
en
$< $@
@$(RM) $@.tmp.
en $@.tmp.nonen
;
endif
genlocales : $(LocaleDataMetaInfo_Dest)
...
...
make/java/java/localegen.sh
浏览文件 @
7ff0de35
...
...
@@ -35,11 +35,11 @@
# A list of resource base name list;
RESOURCE_NAMES
=
$1
# A list of
US
resources;
US
_FILES_LIST
=
$2
# A list of
EN
resources;
EN
_FILES_LIST
=
$2
# A list of non-
US
resources;
NON
US
_FILES_LIST
=
$3
# A list of non-
EN
resources;
NON
EN
_FILES_LIST
=
$3
INPUT_FILE
=
$4
OUTPUT_FILE
=
$5
...
...
@@ -53,23 +53,23 @@ getlocalelist() {
sed_script
=
"
$SED
-e
\"
s@^#warn .*@// -- This file was mechanically generated: Do not edit! -- //@
\"
"
# ja-JP-JP and th-TH-TH need to be manually added, as they don't have any resource files.
non
us
all
=
" ja-JP-JP th-TH-TH "
non
en
all
=
" ja-JP-JP th-TH-TH "
for
FILE
in
$RESOURCE_NAMES
do
getlocalelist
$FILE
$
US
_FILES_LIST
sed_script
=
$sed_script
"-e
\"
s@#"
$FILE
"_
US
Locales#@
$localelist
@g
\"
"
usall
=
$us
all
" "
$localelist
getlocalelist
$FILE
$NON
US
_FILES_LIST
sed_script
=
$sed_script
"-e
\"
s@#"
$FILE
"_Non
US
Locales#@
$localelist
@g
\"
"
non
usall
=
$nonus
all
" "
$localelist
getlocalelist
$FILE
$
EN
_FILES_LIST
sed_script
=
$sed_script
"-e
\"
s@#"
$FILE
"_
EN
Locales#@
$localelist
@g
\"
"
enall
=
$en
all
" "
$localelist
getlocalelist
$FILE
$NON
EN
_FILES_LIST
sed_script
=
$sed_script
"-e
\"
s@#"
$FILE
"_Non
EN
Locales#@
$localelist
@g
\"
"
non
enall
=
$nonen
all
" "
$localelist
done
usall
=
`
(
for
LOC
in
$us
all
;
do
echo
$LOC
;
done
)
|
$SORT
-u
`
non
usall
=
`
(
for
LOC
in
$nonus
all
;
do
echo
$LOC
;
done
)
|
$SORT
-u
`
enall
=
`
(
for
LOC
in
$en
all
;
do
echo
$LOC
;
done
)
|
$SORT
-u
`
non
enall
=
`
(
for
LOC
in
$nonen
all
;
do
echo
$LOC
;
done
)
|
$SORT
-u
`
sed_script
=
$sed_script
"-e
\"
s@#AvailableLocales_
USLocales#@
$us
all
@g
\"
"
sed_script
=
$sed_script
"-e
\"
s@#AvailableLocales_Non
USLocales#@
$nonus
all
@g
\"
"
sed_script
=
$sed_script
"-e
\"
s@#AvailableLocales_
ENLocales#@
$en
all
@g
\"
"
sed_script
=
$sed_script
"-e
\"
s@#AvailableLocales_Non
ENLocales#@
$nonen
all
@g
\"
"
sed_script
=
$sed_script
"
$INPUT_FILE
>
$OUTPUT_FILE
"
eval
$sed_script
make/java/text/base/FILES_java.gmk
浏览文件 @
7ff0de35
...
...
@@ -107,5 +107,17 @@ FILES_java = \
sun/text/resources/FormatData.java \
sun/text/resources/JavaTimeSupplementary.java \
sun/text/resources/en/FormatData_en.java \
sun/text/resources/en/FormatData_en_AU.java \
sun/text/resources/en/FormatData_en_CA.java \
sun/text/resources/en/FormatData_en_GB.java \
sun/text/resources/en/FormatData_en_IE.java \
sun/text/resources/en/FormatData_en_IN.java \
sun/text/resources/en/FormatData_en_MT.java \
sun/text/resources/en/FormatData_en_NZ.java \
sun/text/resources/en/FormatData_en_PH.java \
sun/text/resources/en/FormatData_en_SG.java \
sun/text/resources/en/FormatData_en_US.java \
sun/text/resources/en/FormatData_en_ZA.java \
sun/text/resources/en/JavaTimeSupplementary_en.java \
sun/text/resources/en/JavaTimeSupplementary_en_GB.java \
sun/text/resources/en/JavaTimeSupplementary_en_SG.java
make/java/util/FILES_java.gmk
浏览文件 @
7ff0de35
...
...
@@ -30,4 +30,7 @@ FILES_java = \
sun/util/resources/LocaleNamesBundle.java \
sun/util/resources/TimeZoneNamesBundle.java \
sun/util/resources/TimeZoneNames.java \
sun/util/resources/en/TimeZoneNames_en.java
sun/util/resources/en/TimeZoneNames_en.java \
sun/util/resources/en/TimeZoneNames_en_CA.java \
sun/util/resources/en/TimeZoneNames_en_GB.java \
sun/util/resources/en/TimeZoneNames_en_IE.java
make/java/util/FILES_properties.gmk
浏览文件 @
7ff0de35
...
...
@@ -26,9 +26,25 @@
FILES_compiled_properties = \
sun/util/resources/LocaleNames.properties \
sun/util/resources/en/LocaleNames_en.properties \
sun/util/resources/en/LocaleNames_en_MT.properties \
sun/util/resources/en/LocaleNames_en_PH.properties \
sun/util/resources/en/LocaleNames_en_SG.properties \
\
sun/util/resources/CalendarData.properties \
sun/util/resources/en/CalendarData_en.properties \
sun/util/resources/en/CalendarData_en_GB.properties \
sun/util/resources/en/CalendarData_en_IE.properties \
sun/util/resources/en/CalendarData_en_MT.properties \
\
sun/util/resources/CurrencyNames.properties \
sun/util/resources/en/CurrencyNames_en_US.properties
sun/util/resources/en/CurrencyNames_en_AU.properties \
sun/util/resources/en/CurrencyNames_en_CA.properties \
sun/util/resources/en/CurrencyNames_en_GB.properties \
sun/util/resources/en/CurrencyNames_en_IE.properties \
sun/util/resources/en/CurrencyNames_en_IN.properties \
sun/util/resources/en/CurrencyNames_en_MT.properties \
sun/util/resources/en/CurrencyNames_en_NZ.properties \
sun/util/resources/en/CurrencyNames_en_PH.properties \
sun/util/resources/en/CurrencyNames_en_SG.properties \
sun/util/resources/en/CurrencyNames_en_US.properties \
sun/util/resources/en/CurrencyNames_en_ZA.properties
make/sun/text/FILES_java.gmk
浏览文件 @
7ff0de35
...
...
@@ -96,16 +96,6 @@ FILES_java = \
sun/text/resources/el/FormatData_el.java \
sun/text/resources/el/FormatData_el_CY.java \
sun/text/resources/el/FormatData_el_GR.java \
sun/text/resources/en/FormatData_en_AU.java \
sun/text/resources/en/FormatData_en_CA.java \
sun/text/resources/en/FormatData_en_GB.java \
sun/text/resources/en/FormatData_en_IE.java \
sun/text/resources/en/FormatData_en_IN.java \
sun/text/resources/en/FormatData_en_MT.java \
sun/text/resources/en/FormatData_en_NZ.java \
sun/text/resources/en/FormatData_en_PH.java \
sun/text/resources/en/FormatData_en_SG.java \
sun/text/resources/en/FormatData_en_ZA.java \
sun/text/resources/es/FormatData_es.java \
sun/text/resources/es/FormatData_es_BO.java \
sun/text/resources/es/FormatData_es_AR.java \
...
...
@@ -214,9 +204,6 @@ FILES_java = \
sun/util/resources/zh/CurrencyNames_zh_SG.java \
sun/util/resources/zh/LocaleNames_zh_HK.java \
sun/util/resources/de/TimeZoneNames_de.java \
sun/util/resources/en/TimeZoneNames_en_CA.java \
sun/util/resources/en/TimeZoneNames_en_GB.java \
sun/util/resources/en/TimeZoneNames_en_IE.java \
sun/util/resources/es/TimeZoneNames_es.java \
sun/util/resources/fr/TimeZoneNames_fr.java \
sun/util/resources/hi/TimeZoneNames_hi.java \
...
...
@@ -237,8 +224,6 @@ FILES_java = \
sun/text/resources/da/JavaTimeSupplementary_da.java \
sun/text/resources/de/JavaTimeSupplementary_de.java \
sun/text/resources/el/JavaTimeSupplementary_el.java \
sun/text/resources/en/JavaTimeSupplementary_en_GB.java \
sun/text/resources/en/JavaTimeSupplementary_en_SG.java \
sun/text/resources/es/JavaTimeSupplementary_es.java \
sun/text/resources/et/JavaTimeSupplementary_et.java \
sun/text/resources/fi/JavaTimeSupplementary_fi.java \
...
...
make/sun/text/FILES_properties.gmk
浏览文件 @
7ff0de35
...
...
@@ -33,9 +33,6 @@ FILES_compiled_properties = \
sun/util/resources/de/LocaleNames_de.properties \
sun/util/resources/el/LocaleNames_el.properties \
sun/util/resources/el/LocaleNames_el_CY.properties \
sun/util/resources/en/LocaleNames_en_MT.properties \
sun/util/resources/en/LocaleNames_en_PH.properties \
sun/util/resources/en/LocaleNames_en_SG.properties \
sun/util/resources/es/LocaleNames_es.properties \
sun/util/resources/es/LocaleNames_es_US.properties \
sun/util/resources/et/LocaleNames_et.properties \
...
...
@@ -88,9 +85,6 @@ FILES_compiled_properties = \
sun/util/resources/de/CalendarData_de.properties \
sun/util/resources/el/CalendarData_el.properties \
sun/util/resources/el/CalendarData_el_CY.properties \
sun/util/resources/en/CalendarData_en_GB.properties \
sun/util/resources/en/CalendarData_en_IE.properties \
sun/util/resources/en/CalendarData_en_MT.properties \
sun/util/resources/es/CalendarData_es.properties \
sun/util/resources/es/CalendarData_es_ES.properties \
sun/util/resources/es/CalendarData_es_US.properties \
...
...
@@ -164,16 +158,6 @@ FILES_compiled_properties = \
sun/util/resources/de/CurrencyNames_de_LU.properties \
sun/util/resources/el/CurrencyNames_el_CY.properties \
sun/util/resources/el/CurrencyNames_el_GR.properties \
sun/util/resources/en/CurrencyNames_en_AU.properties \
sun/util/resources/en/CurrencyNames_en_CA.properties \
sun/util/resources/en/CurrencyNames_en_GB.properties \
sun/util/resources/en/CurrencyNames_en_IE.properties \
sun/util/resources/en/CurrencyNames_en_IN.properties \
sun/util/resources/en/CurrencyNames_en_MT.properties \
sun/util/resources/en/CurrencyNames_en_NZ.properties \
sun/util/resources/en/CurrencyNames_en_PH.properties \
sun/util/resources/en/CurrencyNames_en_SG.properties \
sun/util/resources/en/CurrencyNames_en_ZA.properties \
sun/util/resources/es/CurrencyNames_es.properties \
sun/util/resources/es/CurrencyNames_es_AR.properties \
sun/util/resources/es/CurrencyNames_es_BO.properties \
...
...
makefiles/CreateJars.gmk
浏览文件 @
7ff0de35
...
...
@@ -80,39 +80,6 @@ LOCALEDATA_INCLUDE_LOCALES := ar be bg ca cs da de el es et fi fr ga hi hr hu in
LOCALEDATA_INCLUDES := $(addprefix sun/text/resources/,$(LOCALEDATA_INCLUDE_LOCALES)) \
$(addprefix sun/util/resources/,$(LOCALEDATA_INCLUDE_LOCALES))
# For non-US English locale data
LOCALEDATA_INCLUDES += \
sun/text/resources/en/FormatData_en_AU.class \
sun/text/resources/en/FormatData_en_CA.class \
sun/text/resources/en/FormatData_en_GB.class \
sun/text/resources/en/FormatData_en_IE.class \
sun/text/resources/en/FormatData_en_IN.class \
sun/text/resources/en/FormatData_en_MT.class \
sun/text/resources/en/FormatData_en_NZ.class \
sun/text/resources/en/FormatData_en_PH.class \
sun/text/resources/en/FormatData_en_SG.class \
sun/text/resources/en/FormatData_en_ZA.class \
sun/util/resources/en/CalendarData_en_GB.class \
sun/util/resources/en/CalendarData_en_IE.class \
sun/util/resources/en/CalendarData_en_MT.class \
sun/util/resources/en/CurrencyNames_en_AU.class \
sun/util/resources/en/CurrencyNames_en_CA.class \
sun/util/resources/en/CurrencyNames_en_GB.class \
sun/util/resources/en/CurrencyNames_en_IE.class \
sun/util/resources/en/CurrencyNames_en_IN.class \
sun/util/resources/en/CurrencyNames_en_MT.class \
sun/util/resources/en/CurrencyNames_en_NZ.class \
sun/util/resources/en/CurrencyNames_en_PH.class \
sun/util/resources/en/CurrencyNames_en_SG.class \
sun/util/resources/en/CurrencyNames_en_ZA.class \
sun/util/resources/en/LocaleNames_en_MT.class \
sun/util/resources/en/LocaleNames_en_PH.class \
sun/util/resources/en/LocaleNames_en_SG.class \
sun/util/resources/en/TimeZoneNames_en_CA.class \
sun/util/resources/en/TimeZoneNames_en_GB.class \
sun/util/resources/en/TimeZoneNames_en_IE.class
$(eval $(call SetupArchive,BUILD_LOCALEDATA_JAR,,\
SRCS:=$(JDK_OUTPUTDIR)/classes,\
SUFFIXES:=.class _dict _th,\
...
...
makefiles/GensrcLocaleDataMetaInfo.gmk
浏览文件 @
7ff0de35
...
...
@@ -50,27 +50,27 @@ ifneq (,$(MISSING_RESOURCES)$(NEW_RESOURCES))
$(shell $(RM) $(JDK_OUTPUTDIR)/gensrc/sun/util/locale/provider/LocaleDataMetaInfo.java)
endif
# The
US
locales
US_LOCALES:=en en-US
# The
EN
locales
EN_LOCALES:=en%
# ja-JP-JP and th-TH-TH need to be manually added, as they don't have any resource files.
ALL_NON_
US
_LOCALES:=ja-JP-JP th-TH-TH
ALL_NON_
EN
_LOCALES:=ja-JP-JP th-TH-TH
SED_ARGS:=-e 's|$(HASH)warn This file is preprocessed before being compiled|// -- This file was mechanically generated: Do not edit! -- //|g'
# This macro creates a sed expression that substitues for example:
# #FormatData_
USLocales# with: en and/or en_US
.
# #FormatData_
ENLocales# with: en% locales
.
define CaptureLocale
$1_LOCALES := $$(subst _,-,$$(filter-out $1,$$(subst $1_,,$$(filter $1_%,$(LOCALE_RESOURCES)))))
$1_
US_LOCALES := $$(filter $(US
_LOCALES),$$($1_LOCALES))
$1_NON_
US_LOCALES := $$(filter-out $(US
_LOCALES),$$($1_LOCALES))
$1_
EN_LOCALES := $$(filter $(EN
_LOCALES),$$($1_LOCALES))
$1_NON_
EN_LOCALES := $$(filter-out $(EN
_LOCALES),$$($1_LOCALES))
ALL_
US_LOCALES += $$($1_US
_LOCALES)
ALL_NON_
US_LOCALES += $$($1_NON_US
_LOCALES)
ALL_
EN_LOCALES += $$($1_EN
_LOCALES)
ALL_NON_
EN_LOCALES += $$($1_NON_EN
_LOCALES)
# Don't sed in a space if there are no locales.
SED_ARGS+= -e 's/$$(HASH)$1_
USLocales$$(HASH)/$$(if $$($1_US_LOCALES),$$(SPACE)$$($1_US
_LOCALES),)/g'
SED_ARGS+= -e 's/$$(HASH)$1_Non
USLocales$$(HASH)/$$(if $$($1_NON_US_LOCALES),$$(SPACE)$$($1_NON_US
_LOCALES),)/g'
SED_ARGS+= -e 's/$$(HASH)$1_
ENLocales$$(HASH)/$$(if $$($1_EN_LOCALES),$$(SPACE)$$($1_EN
_LOCALES),)/g'
SED_ARGS+= -e 's/$$(HASH)$1_Non
ENLocales$$(HASH)/$$(if $$($1_NON_EN_LOCALES),$$(SPACE)$$($1_NON_EN
_LOCALES),)/g'
endef
#sun.text.resources.FormatData
...
...
@@ -91,8 +91,8 @@ $(eval $(call CaptureLocale,CurrencyNames))
#sun.util.resources.CalendarData
$(eval $(call CaptureLocale,CalendarData))
SED_ARGS+= -e 's/$(HASH)AvailableLocales_
USLocales$(HASH)/$(sort $(ALL_US
_LOCALES))/g'
SED_ARGS+= -e 's/$(HASH)AvailableLocales_Non
USLocales$(HASH)/$(sort $(ALL_NON_US
_LOCALES))/g'
SED_ARGS+= -e 's/$(HASH)AvailableLocales_
ENLocales$(HASH)/$(sort $(ALL_EN
_LOCALES))/g'
SED_ARGS+= -e 's/$(HASH)AvailableLocales_Non
ENLocales$(HASH)/$(sort $(ALL_NON_EN
_LOCALES))/g'
$(JDK_OUTPUTDIR)/gensrc/sun/util/locale/provider/LocaleDataMetaInfo.java: \
$(JDK_TOPDIR)/src/share/classes/sun/util/locale/provider/LocaleDataMetaInfo-XLocales.java.template
...
...
src/share/classes/com/sun/nio/sctp/Association.java
浏览文件 @
7ff0de35
...
...
@@ -58,6 +58,13 @@ public class Association {
/**
* Initializes a new instance of this class.
*
* @param associationID
* The association ID
* @param maxInStreams
* The maximum number of inbound streams
* @param maxOutStreams
* The maximum number of outbound streams
*/
protected
Association
(
int
associationID
,
int
maxInStreams
,
...
...
src/share/classes/com/sun/nio/sctp/IllegalReceiveException.java
浏览文件 @
7ff0de35
...
...
@@ -41,6 +41,9 @@ public class IllegalReceiveException extends IllegalStateException {
/**
* Constructs an instance of this class with the specified message.
*
* @param msg
* The String that contains a detailed message
*/
public
IllegalReceiveException
(
String
msg
)
{
super
(
msg
);
...
...
src/share/classes/com/sun/nio/sctp/IllegalUnbindException.java
浏览文件 @
7ff0de35
...
...
@@ -41,6 +41,9 @@ public class IllegalUnbindException extends IllegalStateException {
/**
* Constructs an instance of this class with the specified detailed message.
*
* @param msg
* The String that contains a detailed message
*/
public
IllegalUnbindException
(
String
msg
)
{
super
(
msg
);
...
...
src/share/classes/com/sun/nio/sctp/InvalidStreamException.java
浏览文件 @
7ff0de35
...
...
@@ -40,6 +40,9 @@ public class InvalidStreamException extends IllegalArgumentException {
/**
* Constructs an instance of this class with the specified detailed message.
*
* @param msg
* The String that contains a detailed message
*/
public
InvalidStreamException
(
String
msg
)
{
super
(
msg
);
...
...
src/share/classes/com/sun/nio/sctp/MessageInfo.java
浏览文件 @
7ff0de35
...
...
@@ -48,7 +48,7 @@ import java.net.SocketAddress;
* longer required to be sent after the time period expires. It is not a hard
* timeout and may be influenced by whether the association supports the partial
* reliability extension, <a href=http://www.ietf.org/rfc/rfc3758.txt>RFC 3758
* <
a>
* <
/a>.
*
* <P> {@code MessageInfo} instances are not safe for use by multiple concurrent
* threads. If a MessageInfo is to be used by more than one thread then access
...
...
src/share/classes/com/sun/nio/sctp/Notification.java
浏览文件 @
7ff0de35
...
...
@@ -40,6 +40,8 @@ package com.sun.nio.sctp;
public
interface
Notification
{
/**
* Returns the association that this notification is applicable to.
*
* @return The association
*/
public
Association
association
();
}
src/share/classes/com/sun/nio/sctp/SctpChannel.java
浏览文件 @
7ff0de35
...
...
@@ -59,7 +59,7 @@ import java.nio.channels.SelectionKey;
* {@link #setOption(SctpSocketOption,Object) setOption} method. An SCTP
* channel support the following options:
* <blockquote>
* <table border>
* <table border
summary="Socket options"
>
* <tr>
* <th>Option Name</th>
* <th>Description</th>
...
...
@@ -636,6 +636,9 @@ public abstract class SctpChannel
/**
* Returns the value of a socket option.
*
* @param <T>
* The type of the socket option value
*
* @param name
* The socket option
*
...
...
@@ -659,6 +662,9 @@ public abstract class SctpChannel
/**
* Sets the value of a socket option.
*
* @param <T>
* The type of the socket option value
*
* @param name
* The socket option
*
...
...
@@ -752,6 +758,9 @@ public abstract class SctpChannel
* the {@code receive} method of this channel, if it does an
* {@link IllegalReceiveException} will be thrown.
*
* @param <T>
* The type of the attachment
*
* @param dst
* The buffer into which message bytes are to be transferred
*
...
...
@@ -831,7 +840,7 @@ public abstract class SctpChannel
* there was insufficient room for the message in the underlying
* output buffer
*
* @throws InvalidStreamExcepton
* @throws InvalidStreamExcept
i
on
* If {@code streamNumner} is negative or greater than or equal to
* the maximum number of outgoing streams
*
...
...
src/share/classes/com/sun/nio/sctp/SctpMultiChannel.java
浏览文件 @
7ff0de35
...
...
@@ -63,7 +63,7 @@ import java.nio.channels.SelectionKey;
* {@link #setOption(SctpSocketOption,Object,Association) setOption} method. An
* {@code SctpMultiChannel} supports the following options:
* <blockquote>
* <table border>
* <table border
summary="Socket options"
>
* <tr>
* <th>Option Name</th>
* <th>Description</th>
...
...
@@ -394,6 +394,9 @@ public abstract class SctpMultiChannel
* Returns all of the remote addresses to which the given association on
* this channel's socket is connected.
*
* @param association
* The association
*
* @return All of the remote addresses for the given association, or
* an empty {@code Set} if the association has been shutdown
*
...
...
@@ -431,6 +434,9 @@ public abstract class SctpMultiChannel
* ignored if given. However, if the option is association specific then the
* association must be given.
*
* @param <T>
* The type of the socket option value
*
* @param name
* The socket option
*
...
...
@@ -464,6 +470,9 @@ public abstract class SctpMultiChannel
* ignored if given. However, if the option is association specific then the
* association must be given.
*
* @param <T>
* The type of the socket option value
*
* @param name
* The socket option
*
...
...
@@ -567,6 +576,9 @@ public abstract class SctpMultiChannel
* the {@code receive} method of this channel, if it does an
* {@link IllegalReceiveException} will be thrown.
*
* @param <T>
* The type of the attachment
*
* @param buffer
* The buffer into which bytes are to be transferred
*
...
...
@@ -673,7 +685,7 @@ public abstract class SctpMultiChannel
* there was insufficient room for the message in the underlying
* output buffer
*
* @throws InvalidStreamExcepton
* @throws InvalidStreamExcept
i
on
* If {@code streamNumber} is negative, or if an association already
* exists and {@code streamNumber} is greater than the maximum number
* of outgoing streams
...
...
src/share/classes/com/sun/nio/sctp/SctpServerChannel.java
浏览文件 @
7ff0de35
...
...
@@ -47,7 +47,7 @@ import java.nio.channels.spi.AbstractSelectableChannel;
* {@link #setOption(SctpSocketOption,Object) setOption} method. SCTP server socket
* channels support the following options:
* <blockquote>
* <table border>
* <table border
summary="Socket options"
>
* <tr>
* <th>Option Name</th>
* <th>Description</th>
...
...
@@ -345,6 +345,9 @@ public abstract class SctpServerChannel
/**
* Returns the value of a socket option.
*
* @param <T>
* The type of the socket option value
*
* @param name
* The socket option
*
...
...
@@ -367,6 +370,9 @@ public abstract class SctpServerChannel
/**
* Sets the value of a socket option.
*
* @param <T>
* The type of the socket option value
*
* @param name
* The socket option
*
...
...
src/share/classes/java/lang/Class.java
浏览文件 @
7ff0de35
...
...
@@ -821,6 +821,10 @@ public final class Class<T> implements java.io.Serializable,
* <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.
*
* @return an array of interfaces implemented by this class.
*/
public
Class
<?>[]
getInterfaces
()
{
...
...
@@ -1500,7 +1504,7 @@ public final class Class<T> implements java.io.Serializable,
* <p> If this {@code Class} object represents an array type, a primitive
* type, or void, then this method returns an array of length 0.
*
* <p> The elements in the
array returned
are not sorted and are not in any
* <p> The elements in the
returned array
are not sorted and are not in any
* particular order.
*
* @return the array of {@code Field} objects representing the
...
...
@@ -1525,23 +1529,33 @@ public final class Class<T> implements java.io.Serializable,
/**
* Returns an array containing {@code Method} objects reflecting all
* the public <em>member</em> methods of the class or interface represented
* by this {@code Class} object, including those declared by the class
* or interface and those inherited from superclasses and
* superinterfaces. Array classes return all the (public) member methods
* inherited from the {@code Object} class. The elements in the array
* returned are not sorted and are not in any particular order. This
* method returns an array of length 0 if this {@code Class} object
* represents a class or interface that has no public member methods, or if
* this {@code Class} object represents a primitive type or void.
* Returns an array containing {@code Method} objects reflecting all the
* public methods of the class or interface represented by this {@code
* Class} object, including those declared by the class or interface and
* those inherited from superclasses and superinterfaces.
*
* <p>
The class initialization method {@code <clinit>} is not
*
included in the returned array. If the class declares multiple public
*
member methods with the same parameter types, they are all included in
*
the returned array
.
* <p>
If this {@code Class} object represents a type that has multiple
*
public methods with the same name and parameter types, but different
*
return types, then the returned array has a {@code Method} object for
*
each such method
.
*
* <p> See <em>The Java Language Specification</em>, sections 8.2 and 8.4.
* <p> If this {@code Class} object represents a type with a class
* initialization method {@code <clinit>}, then the returned array does
* <em>not</em> have a corresponding {@code Method} object.
*
* <p> If this {@code Class} object represents an array type, then the
* returned array has a {@code Method} object for each of the public
* methods inherited by the array type from {@code Object}. It does not
* contain a {@code Method} object for {@code clone()}.
*
* <p> If this {@code Class} object represents a class or interface with no
* public methods, then the returned array has length 0.
*
* <p> If this {@code Class} object represents a primitive type or void,
* then the returned array has length 0.
*
* <p> The elements in the returned array are not sorted and are not in any
* particular order.
*
* @return the array of {@code Method} objects representing the
* public methods of this class
...
...
@@ -1553,6 +1567,8 @@ public final class Class<T> implements java.io.Serializable,
* s.checkPackageAccess()} denies access to the package
* of this class.
*
* @jls 8.2 Class Members
* @jls 8.4 Method Declarations
* @since JDK1.1
*/
@CallerSensitive
...
...
@@ -1693,7 +1709,8 @@ public final class Class<T> implements java.io.Serializable,
* method and the method being overridden would have the same
* signature but different return types.
*
* <p> See <em>The Java Language Specification</em>, sections 8.2 and 8.4.
* <p> If this {@code Class} object represents an array type, then this
* method does not find the {@code clone()} method.
*
* @param name the name of the method
* @param parameterTypes the list of parameters
...
...
@@ -1710,6 +1727,8 @@ public final class Class<T> implements java.io.Serializable,
* s.checkPackageAccess()} denies access to the package
* of this class.
*
* @jls 8.2 Class Members
* @jls 8.4 Method Declarations
* @since JDK1.1
*/
@CallerSensitive
...
...
@@ -1815,7 +1834,7 @@ public final class Class<T> implements java.io.Serializable,
* <p> If this {@code Class} object represents an array type, a primitive
* type, or void, then this method returns an array of length 0.
*
* <p> The elements in the
array returned
are not sorted and are not in any
* <p> The elements in the
returned array
are not sorted and are not in any
* particular order.
*
* @return the array of {@code Field} objects representing all the
...
...
@@ -1853,20 +1872,29 @@ public final class Class<T> implements java.io.Serializable,
/**
* Returns an array of {@code Method} objects reflecting all the
* methods declared by the class or interface represented by this
* {@code Class} object. This includes public, protected, default
* (package) access, and private methods, but excludes inherited methods.
* The elements in the array returned are not sorted and are not in any
* particular order. This method returns an array of length 0 if the class
* or interface declares no methods, or if this {@code Class} object
* represents a primitive type, an array class, or void. The class
* initialization method {@code <clinit>} is not included in the
* returned array. If the class declares multiple public member methods
* with the same parameter types, they are all included in the returned
* array.
*
* <p> See <em>The Java Language Specification</em>, section 8.2.
* Returns an array containing {@code Method} objects reflecting all the
* declared methods of the class or interface represented by this {@code
* Class} object, including public, protected, default (package)
* access, and private methods, but excluding inherited methods.
*
* <p> If this {@code Class} object represents a type that has multiple
* declared methods with the same name and parameter types, but different
* return types, then the returned array has a {@code Method} object for
* each such method.
*
* <p> If this {@code Class} object represents a type that has a class
* initialization method {@code <clinit>}, then the returned array does
* <em>not</em> have a corresponding {@code Method} object.
*
* <p> If this {@code Class} object represents a class or interface with no
* declared methods, then the returned array has length 0.
*
* <p> If this {@code Class} object represents an array type, a primitive
* type, or void, then the returned array has length 0.
*
* <p> The elements in the returned array are not sorted and are not in any
* particular order.
*
* @return the array of {@code Method} objects representing all the
* declared methods of this class
...
...
@@ -1891,6 +1919,8 @@ public final class Class<T> implements java.io.Serializable,
*
* </ul>
*
* @jls 8.2 Class Members
* @jls 8.4 Method Declarations
* @since JDK1.1
*/
@CallerSensitive
...
...
@@ -2011,6 +2041,9 @@ public final class Class<T> implements java.io.Serializable,
* name is "<init>"or "<clinit>" a {@code NoSuchMethodException}
* is raised.
*
* <p> If this {@code Class} object represents an array type, then this
* method does not find the {@code clone()} method.
*
* @param name the name of the method
* @param parameterTypes the parameter array
* @return the {@code Method} object for the method of this class
...
...
@@ -2038,6 +2071,8 @@ public final class Class<T> implements java.io.Serializable,
*
* </ul>
*
* @jls 8.2 Class Members
* @jls 8.4 Method Declarations
* @since JDK1.1
*/
@CallerSensitive
...
...
src/share/classes/java/lang/reflect/Executable.java
浏览文件 @
7ff0de35
...
...
@@ -428,20 +428,32 @@ public abstract class Executable extends AccessibleObject
}
/**
* Returns an array of arrays that represent the annotations on
* the formal parameters, in declaration order, of the executable
* represented by this object. (Returns an array of length zero if
* the underlying executable is parameterless. If the executable has
* one or more parameters, a nested array of length zero is
* returned for each parameter with no annotations.) The
* annotation objects contained in the returned arrays are
* serializable. The caller of this method is free to modify the
* returned arrays; it will have no effect on the arrays returned
* to other callers.
* Returns an array of arrays of {@code Annotation}s that
* represent the annotations on the formal parameters, in
* declaration order, of the {@code Executable} represented by
* this object. Synthetic and mandated parameters (see
* explanation below), such as the outer "this" parameter to an
* inner class constructor will be represented in the returned
* array. If the executable has no parameters (meaning no formal,
* no synthetic, and no mandated parameters), a zero-length array
* will be returned. If the {@code Executable} has one or more
* parameters, a nested array of length zero is returned for each
* parameter with no annotations. The annotation objects contained
* in the returned arrays are serializable. The caller of this
* method is free to modify the returned arrays; it will have no
* effect on the arrays returned to other callers.
*
* @return an array of arrays that represent the annotations on the formal
* parameters, in declaration order, of the executable represented by this
* object
* A compiler may add extra parameters that are implicitly
* declared in source ("mandated"), as well as parameters that
* are neither implicitly nor explicitly declared in source
* ("synthetic") to the parameter list for a method. See {@link
* java.lang.reflect.Parameter} for more information.
*
* @see java.lang.reflect.Parameter
* @see java.lang.reflect.Parameter#getAnnotations
* @return an array of arrays that represent the annotations on
* the formal and implicit parameters, in declaration order, of
* the executable represented by this object
*/
public
abstract
Annotation
[][]
getParameterAnnotations
();
...
...
src/share/classes/java/net/AbstractPlainSocketImpl.java
浏览文件 @
7ff0de35
...
...
@@ -719,7 +719,3 @@ abstract class AbstractPlainSocketImpl extends SocketImpl
public
final
static
int
SHUT_RD
=
0
;
public
final
static
int
SHUT_WR
=
1
;
}
class
InetAddressContainer
{
InetAddress
addr
;
}
src/share/classes/java/net/InetAddressContainer.java
0 → 100644
浏览文件 @
7ff0de35
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package
java.net
;
class
InetAddressContainer
{
InetAddress
addr
;
}
src/share/classes/java/rmi/activation/Activatable.java
浏览文件 @
7ff0de35
/*
* Copyright (c) 1997, 20
05
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 20
13
, 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
...
...
@@ -93,6 +93,8 @@ public abstract class Activatable extends RemoteServer {
* @exception RemoteException if either of the following fails:
* a) registering the object with the activation system or b) exporting
* the object to the RMI runtime.
* @exception UnsupportedOperationException if and only if activation is
* not supported by this implementation.
* @since 1.2
**/
protected
Activatable
(
String
location
,
...
...
@@ -143,6 +145,8 @@ public abstract class Activatable extends RemoteServer {
* @exception RemoteException if either of the following fails:
* a) registering the object with the activation system or b) exporting
* the object to the RMI runtime.
* @exception UnsupportedOperationException if and only if activation is
* not supported by this implementation.
* @since 1.2
**/
protected
Activatable
(
String
location
,
...
...
@@ -175,6 +179,8 @@ public abstract class Activatable extends RemoteServer {
* @param port the port number on which the object is exported
* @exception RemoteException if exporting the object to the RMI
* runtime fails
* @exception UnsupportedOperationException if and only if activation is
* not supported by this implementation
* @since 1.2
*/
protected
Activatable
(
ActivationID
id
,
int
port
)
...
...
@@ -206,6 +212,8 @@ public abstract class Activatable extends RemoteServer {
* @param ssf the server-side socket factory for receiving remote calls
* @exception RemoteException if exporting the object to the RMI
* runtime fails
* @exception UnsupportedOperationException if and only if activation is
* not supported by this implementation
* @since 1.2
*/
protected
Activatable
(
ActivationID
id
,
int
port
,
...
...
@@ -239,6 +247,8 @@ public abstract class Activatable extends RemoteServer {
* is not registered with the activation system
* @exception ActivationException if activation system is not running
* @exception RemoteException if remote call fails
* @exception UnsupportedOperationException if and only if activation is
* not supported by this implementation
* @since 1.2
*/
public
static
Remote
register
(
ActivationDesc
desc
)
...
...
@@ -273,6 +283,8 @@ public abstract class Activatable extends RemoteServer {
* already be inactive)
* @exception ActivationException if group is not active
* @exception RemoteException if call informing monitor fails
* @exception UnsupportedOperationException if and only if activation is
* not supported by this implementation
* @since 1.2
*/
public
static
boolean
inactive
(
ActivationID
id
)
...
...
@@ -290,6 +302,8 @@ public abstract class Activatable extends RemoteServer {
* @exception UnknownObjectException if object (<code>id</code>) is unknown
* @exception ActivationException if activation system is not running
* @exception RemoteException if remote call to activation system fails
* @exception UnsupportedOperationException if and only if activation is
* not supported by this implementation
* @since 1.2
*/
public
static
void
unregister
(
ActivationID
id
)
...
...
@@ -334,6 +348,8 @@ public abstract class Activatable extends RemoteServer {
* the wrong group
* @exception ActivationException if activation group is not active
* @exception RemoteException if object registration or export fails
* @exception UnsupportedOperationException if and only if activation is
* not supported by this implementation
* @since 1.2
**/
public
static
ActivationID
exportObject
(
Remote
obj
,
...
...
@@ -407,6 +423,8 @@ public abstract class Activatable extends RemoteServer {
* descriptor with the activation system
* @exception ActivationException if activation group is not active
* @exception RemoteException if object registration or export fails
* @exception UnsupportedOperationException if and only if activation is
* not supported by this implementation
* @since 1.2
**/
public
static
ActivationID
exportObject
(
Remote
obj
,
...
...
@@ -473,6 +491,8 @@ public abstract class Activatable extends RemoteServer {
* @param port the port on which the object is exported (an anonymous
* port is used if port=0)
* @exception RemoteException if object export fails
* @exception UnsupportedOperationException if and only if activation is
* not supported by this implementation
* @since 1.2
*/
public
static
Remote
exportObject
(
Remote
obj
,
...
...
@@ -503,6 +523,8 @@ public abstract class Activatable extends RemoteServer {
* remote object
* @param ssf the server-side socket factory for receiving remote calls
* @exception RemoteException if object export fails
* @exception UnsupportedOperationException if and only if activation is
* not supported by this implementation
* @since 1.2
*/
public
static
Remote
exportObject
(
Remote
obj
,
...
...
@@ -531,6 +553,8 @@ public abstract class Activatable extends RemoteServer {
* @return true if operation is successful, false otherwise
* @exception NoSuchObjectException if the remote object is not
* currently exported
* @exception UnsupportedOperationException if and only if activation is
* not supported by this implementation
* @since 1.2
*/
public
static
boolean
unexportObject
(
Remote
obj
,
boolean
force
)
...
...
src/share/classes/java/rmi/activation/ActivationDesc.java
浏览文件 @
7ff0de35
/*
* Copyright (c) 1997, 20
05
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 20
13
, 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
...
...
@@ -105,6 +105,8 @@ public final class ActivationDesc implements Serializable {
* @param data the object's initialization (activation) data contained
* in marshalled form.
* @exception ActivationException if the current group is nonexistent
* @exception UnsupportedOperationException if and only if activation is
* not supported by this implementation
* @since 1.2
*/
public
ActivationDesc
(
String
className
,
...
...
@@ -142,6 +144,8 @@ public final class ActivationDesc implements Serializable {
* <code>true</code> does not force an initial immediate activation of
* a newly registered object; initial activation is lazy.
* @exception ActivationException if the current group is nonexistent
* @exception UnsupportedOperationException if and only if activation is
* not supported by this implementation
* @since 1.2
*/
public
ActivationDesc
(
String
className
,
...
...
@@ -176,6 +180,8 @@ public final class ActivationDesc implements Serializable {
* @param data the object's initialization (activation) data contained
* in marshalled form.
* @exception IllegalArgumentException if <code>groupID</code> is null
* @exception UnsupportedOperationException if and only if activation is
* not supported by this implementation
* @since 1.2
*/
public
ActivationDesc
(
ActivationGroupID
groupID
,
...
...
@@ -208,6 +214,8 @@ public final class ActivationDesc implements Serializable {
* <code>true</code> does not force an initial immediate activation of
* a newly registered object; initial activation is lazy.
* @exception IllegalArgumentException if <code>groupID</code> is null
* @exception UnsupportedOperationException if and only if activation is
* not supported by this implementation
* @since 1.2
*/
public
ActivationDesc
(
ActivationGroupID
groupID
,
...
...
src/share/classes/java/rmi/activation/ActivationGroup.java
浏览文件 @
7ff0de35
/*
* Copyright (c) 1997, 20
05
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 20
13
, 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
...
...
@@ -133,6 +133,8 @@ public abstract class ActivationGroup
*
* @param groupID the group's identifier
* @throws RemoteException if this group could not be exported
* @throws UnsupportedOperationException if and only if activation is
* not supported by this implementation
* @since 1.2
*/
protected
ActivationGroup
(
ActivationGroupID
groupID
)
...
...
@@ -267,6 +269,8 @@ public abstract class ActivationGroup
* (Note: The default implementation of the security manager
* <code>checkSetFactory</code>
* method requires the RuntimePermission "setFactory")
* @exception UnsupportedOperationException if and only if activation is
* not supported by this implementation
* @see SecurityManager#checkSetFactory
* @since 1.2
*/
...
...
@@ -345,6 +349,8 @@ public abstract class ActivationGroup
/**
* Returns the current activation group's identifier. Returns null
* if no group is currently active for this VM.
* @exception UnsupportedOperationException if and only if activation is
* not supported by this implementation
* @return the activation group's identifier
* @since 1.2
*/
...
...
@@ -394,6 +400,8 @@ public abstract class ActivationGroup
* (Note: The default implementation of the security manager
* <code>checkSetFactory</code>
* method requires the RuntimePermission "setFactory")
* @exception UnsupportedOperationException if and only if activation is
* not supported by this implementation
* @see #getSystem
* @see SecurityManager#checkSetFactory
* @since 1.2
...
...
@@ -428,6 +436,8 @@ public abstract class ActivationGroup
* @exception ActivationException if activation system cannot be
* obtained or is not bound
* (means that it is not running)
* @exception UnsupportedOperationException if and only if activation is
* not supported by this implementation
* @see #setSystem
* @since 1.2
*/
...
...
src/share/classes/java/rmi/activation/ActivationGroupID.java
浏览文件 @
7ff0de35
/*
* Copyright (c) 1997,
1999
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997,
2013
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -63,6 +63,8 @@ public class ActivationGroupID implements java.io.Serializable {
* Constructs a unique group id.
*
* @param system the group's activation system
* @throws UnsupportedOperationException if and only if activation is
* not supported by this implementation
* @since 1.2
*/
public
ActivationGroupID
(
ActivationSystem
system
)
{
...
...
src/share/classes/java/rmi/activation/ActivationID.java
浏览文件 @
7ff0de35
/*
* Copyright (c) 1997, 20
05
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 20
13
, 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
...
...
@@ -90,6 +90,8 @@ public class ActivationID implements Serializable {
*
* @param activator reference to the activator responsible for
* activating the object
* @throws UnsupportedOperationException if and only if activation is
* not supported by this implementation
* @since 1.2
*/
public
ActivationID
(
Activator
activator
)
{
...
...
src/share/classes/java/rmi/activation/package.html
浏览文件 @
7ff0de35
<!--
Copyright (c) 1998,
1999
, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 1998,
2013
, Oracle and/or its affiliates. All rights reserved.
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
This code is free software; you can redistribute it and/or modify it
...
...
@@ -31,6 +31,15 @@ Provides support for RMI Object Activation. A remote
object's reference can be made ``persistent'' and later activated into a
``live'' object using the RMI activation mechanism.
<p>
Implementations are not required to support the activation
mechanism. If activation is not supported by this implementation,
several specific activation API methods are all required to throw
{@code UnsupportedOperationException}. If activation is supported by this
implementation, these methods must never throw {@code
UnsupportedOperationException}. These methods are denoted by the
presence of an entry for {@code UnsupportedOperationException} in the
<strong>
Throws
</strong>
section of each method's specification.
<!--
<h2>Package Specification</h2>
...
...
src/share/classes/java/security/AccessController.java
浏览文件 @
7ff0de35
...
...
@@ -279,6 +279,9 @@ public final class AccessController {
* <p> Note that any DomainCombiner associated with the current
* AccessControlContext will be ignored while the action is performed.
*
* @param <T> the type of the value returned by the PrivilegedAction's
* {@code run} method.
*
* @param action the action to be performed.
*
* @return the value returned by the action's {@code run} method.
...
...
@@ -305,6 +308,9 @@ public final class AccessController {
* <p> This method preserves the current AccessControlContext's
* DomainCombiner (which may be null) while the action is performed.
*
* @param <T> the type of the value returned by the PrivilegedAction's
* {@code run} method.
*
* @param action the action to be performed.
*
* @return the value returned by the action's {@code run} method.
...
...
@@ -344,6 +350,8 @@ public final class AccessController {
* {@link java.security.SecurityPermission}, then the action is performed
* with no permissions.
*
* @param <T> the type of the value returned by the PrivilegedAction's
* {@code run} method.
* @param action the action to be performed.
* @param context an <i>access control context</i>
* representing the restriction to be applied to the
...
...
@@ -377,6 +385,8 @@ public final class AccessController {
* If the action's {@code run} method throws an (unchecked) exception,
* it will propagate through this method.
*
* @param <T> the type of the value returned by the PrivilegedAction's
* {@code run} method.
* @param action the action to be performed.
* @param context an <i>access control context</i>
* representing the restriction to be applied to the
...
...
@@ -429,6 +439,8 @@ public final class AccessController {
* <p> This method preserves the current AccessControlContext's
* DomainCombiner (which may be null) while the action is performed.
*
* @param <T> the type of the value returned by the PrivilegedAction's
* {@code run} method.
* @param action the action to be performed.
* @param context an <i>access control context</i>
* representing the restriction to be applied to the
...
...
@@ -479,6 +491,9 @@ public final class AccessController {
* <p> Note that any DomainCombiner associated with the current
* AccessControlContext will be ignored while the action is performed.
*
* @param <T> the type of the value returned by the
* PrivilegedExceptionAction's {@code run} method.
*
* @param action the action to be performed
*
* @return the value returned by the action's {@code run} method
...
...
@@ -509,6 +524,9 @@ public final class AccessController {
* <p> This method preserves the current AccessControlContext's
* DomainCombiner (which may be null) while the action is performed.
*
* @param <T> the type of the value returned by the
* PrivilegedExceptionAction's {@code run} method.
*
* @param action the action to be performed.
*
* @return the value returned by the action's {@code run} method
...
...
@@ -585,6 +603,8 @@ public final class AccessController {
* {@link java.security.SecurityPermission}, then the action is performed
* with no permissions.
*
* @param <T> the type of the value returned by the
* PrivilegedExceptionAction's {@code run} method.
* @param action the action to be performed
* @param context an <i>access control context</i>
* representing the restriction to be applied to the
...
...
@@ -622,6 +642,8 @@ public final class AccessController {
* If the action's {@code run} method throws an (unchecked) exception,
* it will propagate through this method.
*
* @param <T> the type of the value returned by the
* PrivilegedExceptionAction's {@code run} method.
* @param action the action to be performed.
* @param context an <i>access control context</i>
* representing the restriction to be applied to the
...
...
@@ -676,6 +698,8 @@ public final class AccessController {
* <p> This method preserves the current AccessControlContext's
* DomainCombiner (which may be null) while the action is performed.
*
* @param <T> the type of the value returned by the
* PrivilegedExceptionAction's {@code run} method.
* @param action the action to be performed.
* @param context an <i>access control context</i>
* representing the restriction to be applied to the
...
...
src/share/classes/java/security/AlgorithmParameters.java
浏览文件 @
7ff0de35
...
...
@@ -324,6 +324,7 @@ public class AlgorithmParameters {
* parameters should be returned in an instance of the
* {@code DSAParameterSpec} class.
*
* @param <T> the type of the parameter specification to be returrned
* @param paramSpec the specification class in which
* the parameters should be returned.
*
...
...
src/share/classes/java/security/AlgorithmParametersSpi.java
浏览文件 @
7ff0de35
...
...
@@ -102,6 +102,8 @@ public abstract class AlgorithmParametersSpi {
* parameters should be returned in an instance of the
* {@code DSAParameterSpec} class.
*
* @param <T> the type of the parameter specification to be returned
*
* @param paramSpec the specification class in which
* the parameters should be returned.
*
...
...
src/share/classes/java/security/KeyFactory.java
浏览文件 @
7ff0de35
...
...
@@ -395,6 +395,8 @@ public class KeyFactory {
* key material should be returned in an instance of the
* {@code DSAPublicKeySpec} class.
*
* @param <T> the type of the key specification to be returned
*
* @param key the key.
*
* @param keySpec the specification class in which
...
...
src/share/classes/java/security/KeyFactorySpi.java
浏览文件 @
7ff0de35
...
...
@@ -106,6 +106,8 @@ public abstract class KeyFactorySpi {
* key material should be returned in an instance of the
* {@code DSAPublicKeySpec} class.
*
* @param <T> the type of the key specification to be returned
*
* @param key the key.
*
* @param keySpec the specification class in which
...
...
src/share/classes/java/security/KeyStore.java
浏览文件 @
7ff0de35
...
...
@@ -1753,6 +1753,7 @@ public class KeyStore {
/**
* Returns the KeyStore described by this object.
*
* @return the {@code KeyStore} described by this object
* @exception KeyStoreException if an error occured during the
* operation, for example if the KeyStore could not be
* instantiated or loaded
...
...
src/share/classes/java/security/Principal.java
浏览文件 @
7ff0de35
/*
* Copyright (c) 1996, 201
2
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 201
3
, 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
...
...
@@ -81,6 +81,7 @@ public interface Principal {
* <p>Subclasses may override this with a different implementation, if
* necessary.
*
* @param subject the {@code Subject}
* @return true if {@code subject} is non-null and is
* implied by this principal, or false otherwise.
* @since 1.8
...
...
src/share/classes/java/security/cert/CertPathBuilderSpi.java
浏览文件 @
7ff0de35
...
...
@@ -87,6 +87,8 @@ public abstract class CertPathBuilderSpi {
* service providers, this method cannot be abstract and by default throws
* an {@code UnsupportedOperationException}.
*
* @return a {@code CertPathChecker} that this implementation uses to
* check the revocation status of certificates
* @throws UnsupportedOperationException if this method is not supported
* @since 1.8
*/
...
...
src/share/classes/java/security/cert/CertPathValidatorSpi.java
浏览文件 @
7ff0de35
...
...
@@ -97,6 +97,8 @@ public abstract class CertPathValidatorSpi {
* service providers, this method cannot be abstract and by default throws
* an {@code UnsupportedOperationException}.
*
* @return a {@code CertPathChecker} that this implementation uses to
* check the revocation status of certificates
* @throws UnsupportedOperationException if this method is not supported
* @since 1.8
*/
...
...
src/share/classes/java/security/cert/PKIXRevocationChecker.java
浏览文件 @
7ff0de35
...
...
@@ -103,6 +103,9 @@ public abstract class PKIXRevocationChecker extends PKIXCertPathChecker {
private
Map
<
X509Certificate
,
byte
[]>
ocspResponses
=
Collections
.
emptyMap
();
private
Set
<
Option
>
options
=
Collections
.
emptySet
();
/**
* Default constructor.
*/
protected
PKIXRevocationChecker
()
{}
/**
...
...
src/share/classes/java/security/interfaces/RSAMultiPrimePrivateCrtKey.java
浏览文件 @
7ff0de35
/*
* Copyright (c) 2001, 20
0
3, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 20
1
3, 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
...
...
@@ -46,6 +46,11 @@ import java.security.spec.RSAOtherPrimeInfo;
public
interface
RSAMultiPrimePrivateCrtKey
extends
RSAPrivateKey
{
/**
* The type fingerprint that is set to indicate
* serialization compatibility with a previous
* version of the type.
*/
static
final
long
serialVersionUID
=
618058533534628008L
;
/**
...
...
src/share/classes/java/security/interfaces/RSAPrivateCrtKey.java
浏览文件 @
7ff0de35
/*
* Copyright (c) 1998, 20
0
3, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 20
1
3, 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
...
...
@@ -39,6 +39,11 @@ import java.math.BigInteger;
public
interface
RSAPrivateCrtKey
extends
RSAPrivateKey
{
/**
* The type fingerprint that is set to indicate
* serialization compatibility with a previous
* version of the type.
*/
static
final
long
serialVersionUID
=
-
5682214253527700368L
;
/**
...
...
src/share/classes/java/security/interfaces/RSAPrivateKey.java
浏览文件 @
7ff0de35
/*
* Copyright (c) 1998, 20
0
3, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 20
1
3, 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
...
...
@@ -39,6 +39,11 @@ import java.math.BigInteger;
public
interface
RSAPrivateKey
extends
java
.
security
.
PrivateKey
,
RSAKey
{
/**
* The type fingerprint that is set to indicate
* serialization compatibility with a previous
* version of the type.
*/
static
final
long
serialVersionUID
=
5187144804936595022L
;
/**
...
...
src/share/classes/java/security/interfaces/RSAPublicKey.java
浏览文件 @
7ff0de35
/*
* Copyright (c) 1998, 20
0
3, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 20
1
3, 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
...
...
@@ -36,6 +36,11 @@ import java.math.BigInteger;
public
interface
RSAPublicKey
extends
java
.
security
.
PublicKey
,
RSAKey
{
/**
* The type fingerprint that is set to indicate
* serialization compatibility with a previous
* version of the type.
*/
static
final
long
serialVersionUID
=
-
8727434096241101194L
;
/**
...
...
src/share/classes/java/util/logging/LogManager.java
浏览文件 @
7ff0de35
此差异已折叠。
点击以展开。
src/share/classes/java/util/logging/Logger.java
浏览文件 @
7ff0de35
...
...
@@ -245,14 +245,26 @@ public class Logger {
// In order to finish the initialization of the global logger, we
// will therefore call LogManager.getLogManager() here.
//
// Care must be taken *not* to call Logger.getGlobal() in
// LogManager static initializers in order to avoid such
// deadlocks.
//
if
(
global
!=
null
&&
global
.
manager
==
null
)
{
// Complete initialization of the global Logger.
global
.
manager
=
LogManager
.
getLogManager
();
}
// To prevent race conditions we also need to call
// LogManager.getLogManager() unconditionally here.
// Indeed we cannot rely on the observed value of global.manager,
// because global.manager will become not null somewhere during
// the initialization of LogManager.
// If two threads are calling getGlobal() concurrently, one thread
// will see global.manager null and call LogManager.getLogManager(),
// but the other thread could come in at a time when global.manager
// is already set although ensureLogManagerInitialized is not finished
// yet...
// Calling LogManager.getLogManager() unconditionally will fix that.
LogManager
.
getLogManager
();
// Now the global LogManager should be initialized,
// and the global logger should have been added to
// it, unless we were called within the constructor of a LogManager
// subclass installed as LogManager, in which case global.manager
// would still be null, and global will be lazily initialized later on.
return
global
;
}
...
...
@@ -298,11 +310,11 @@ public class Logger {
* no corresponding resource can be found.
*/
protected
Logger
(
String
name
,
String
resourceBundleName
)
{
this
(
name
,
resourceBundleName
,
null
);
this
(
name
,
resourceBundleName
,
null
,
LogManager
.
getLogManager
()
);
}
Logger
(
String
name
,
String
resourceBundleName
,
Class
<?>
caller
)
{
this
.
manager
=
LogManager
.
getLogManager
()
;
Logger
(
String
name
,
String
resourceBundleName
,
Class
<?>
caller
,
LogManager
manager
)
{
this
.
manager
=
manager
;
setupResourceInfo
(
resourceBundleName
,
caller
);
this
.
name
=
name
;
levelValue
=
Level
.
INFO
.
intValue
();
...
...
@@ -332,8 +344,8 @@ public class Logger {
levelValue
=
Level
.
INFO
.
intValue
();
}
// It is called from
the LogManager.<clinit> to complete
// i
nitialization of the global Log
ger.
// It is called from
LoggerContext.addLocalLogger() when the logger
// i
s actually added to a LogMana
ger.
void
setLogManager
(
LogManager
manager
)
{
this
.
manager
=
manager
;
}
...
...
@@ -558,7 +570,7 @@ public class Logger {
// cleanup some Loggers that have been GC'ed
manager
.
drainLoggerRefQueueBounded
();
Logger
result
=
new
Logger
(
null
,
resourceBundleName
,
Reflection
.
getCallerClass
());
Reflection
.
getCallerClass
()
,
manager
);
result
.
anonymous
=
true
;
Logger
root
=
manager
.
getLogger
(
""
);
result
.
doSetParent
(
root
);
...
...
@@ -1798,7 +1810,7 @@ public class Logger {
if
(
parent
==
null
)
{
throw
new
NullPointerException
();
}
manager
.
checkPermission
();
checkPermission
();
doSetParent
(
parent
);
}
...
...
src/share/classes/javax/net/ssl/SSLParameters.java
浏览文件 @
7ff0de35
/*
* Copyright (c) 2005, 201
2
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 201
3
, 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
...
...
@@ -40,7 +40,7 @@ import java.util.LinkedHashMap;
* the list of protocols to be allowed, the endpoint identification
* algorithm during SSL/TLS handshaking, the Server Name Indication (SNI),
* the algorithm constraints and whether SSL/TLS servers should request
* or require client authentication.
* or require client authentication
, etc
.
* <p>
* SSLParameters can be created via the constructors in this class.
* Objects can also be obtained using the <code>getSSLParameters()</code>
...
...
@@ -73,13 +73,14 @@ public class SSLParameters {
private
AlgorithmConstraints
algorithmConstraints
;
private
Map
<
Integer
,
SNIServerName
>
sniNames
=
null
;
private
Map
<
Integer
,
SNIMatcher
>
sniMatchers
=
null
;
private
boolean
preferLocalCipherSuites
;
/**
* Constructs SSLParameters.
* <p>
* The values of cipherSuites, protocols, cryptographic algorithm
* constraints, endpoint identification algorithm, server names and
* server name matchers are set to <code>null</code>,
* server name matchers are set to <code>null</code>,
useCipherSuitesOrder,
* wantClientAuth and needClientAuth are set to <code>false</code>.
*/
public
SSLParameters
()
{
...
...
@@ -434,5 +435,34 @@ public class SSLParameters {
return
null
;
}
/**
* Sets whether the local cipher suites preference should be honored.
*
* @param honorOrder whether local cipher suites order in
* {@code #getCipherSuites} should be honored during
* SSL/TLS handshaking.
*
* @see #getUseCipherSuitesOrder()
*
* @since 1.8
*/
public
final
void
setUseCipherSuitesOrder
(
boolean
honorOrder
)
{
this
.
preferLocalCipherSuites
=
honorOrder
;
}
/**
* Returns whether the local cipher suites preference should be honored.
*
* @return whether local cipher suites order in {@code #getCipherSuites}
* should be honored during SSL/TLS handshaking.
*
* @see #setUseCipherSuitesOrder(boolean)
*
* @since 1.8
*/
public
final
boolean
getUseCipherSuitesOrder
()
{
return
preferLocalCipherSuites
;
}
}
src/share/classes/sun/security/ssl/Handshaker.java
浏览文件 @
7ff0de35
...
...
@@ -145,6 +145,14 @@ abstract class Handshaker {
/* True if it's OK to start a new SSL session */
boolean
enableNewSession
;
// Whether local cipher suites preference should be honored during
// handshaking?
//
// Note that in this provider, this option only applies to server side.
// Local cipher suites preference is always honored in client side in
// this provider.
boolean
preferLocalCipherSuites
=
false
;
// Temporary storage for the individual keys. Set by
// calculateConnectionKeys() and cleared once the ciphers are
// activated.
...
...
@@ -462,6 +470,13 @@ abstract class Handshaker {
this
.
sniMatchers
=
sniMatchers
;
}
/**
* Sets the cipher suites preference.
*/
void
setUseCipherSuitesOrder
(
boolean
on
)
{
this
.
preferLocalCipherSuites
=
on
;
}
/**
* Prior to handshaking, activate the handshake and initialize the version,
* input stream and output stream.
...
...
@@ -533,7 +548,9 @@ abstract class Handshaker {
}
/**
* Check if the given ciphersuite is enabled and available.
* Check if the given ciphersuite is enabled and available within the
* current active cipher suites.
*
* Does not check if the required server certificates are available.
*/
boolean
isNegotiable
(
CipherSuite
s
)
{
...
...
@@ -541,7 +558,17 @@ abstract class Handshaker {
activeCipherSuites
=
getActiveCipherSuites
();
}
return
activeCipherSuites
.
contains
(
s
)
&&
s
.
isNegotiable
();
return
isNegotiable
(
activeCipherSuites
,
s
);
}
/**
* Check if the given ciphersuite is enabled and available within the
* proposed cipher suite list.
*
* Does not check if the required server certificates are available.
*/
final
static
boolean
isNegotiable
(
CipherSuiteList
proposed
,
CipherSuite
s
)
{
return
proposed
.
contains
(
s
)
&&
s
.
isNegotiable
();
}
/**
...
...
src/share/classes/sun/security/ssl/SSLEngineImpl.java
浏览文件 @
7ff0de35
...
...
@@ -319,6 +319,12 @@ final public class SSLEngineImpl extends SSLEngine {
*/
private
boolean
isFirstAppOutputRecord
=
true
;
/*
* Whether local cipher suites preference in server side should be
* honored during handshaking?
*/
private
boolean
preferLocalCipherSuites
=
false
;
/*
* Class and subclass dynamic debugging support
*/
...
...
@@ -470,6 +476,7 @@ final public class SSLEngineImpl extends SSLEngine {
protocolVersion
,
connectionState
==
cs_HANDSHAKE
,
secureRenegotiation
,
clientVerifyData
,
serverVerifyData
);
handshaker
.
setSNIMatchers
(
sniMatchers
);
handshaker
.
setUseCipherSuitesOrder
(
preferLocalCipherSuites
);
}
else
{
handshaker
=
new
ClientHandshaker
(
this
,
sslContext
,
enabledProtocols
,
...
...
@@ -2074,6 +2081,7 @@ final public class SSLEngineImpl extends SSLEngine {
params
.
setAlgorithmConstraints
(
algorithmConstraints
);
params
.
setSNIMatchers
(
sniMatchers
);
params
.
setServerNames
(
serverNames
);
params
.
setUseCipherSuitesOrder
(
preferLocalCipherSuites
);
return
params
;
}
...
...
@@ -2088,6 +2096,7 @@ final public class SSLEngineImpl extends SSLEngine {
// the super implementation does not handle the following parameters
identificationProtocol
=
params
.
getEndpointIdentificationAlgorithm
();
algorithmConstraints
=
params
.
getAlgorithmConstraints
();
preferLocalCipherSuites
=
params
.
getUseCipherSuitesOrder
();
List
<
SNIServerName
>
sniNames
=
params
.
getServerNames
();
if
(
sniNames
!=
null
)
{
...
...
@@ -2104,6 +2113,7 @@ final public class SSLEngineImpl extends SSLEngine {
handshaker
.
setAlgorithmConstraints
(
algorithmConstraints
);
if
(
roleIsServer
)
{
handshaker
.
setSNIMatchers
(
sniMatchers
);
handshaker
.
setUseCipherSuitesOrder
(
preferLocalCipherSuites
);
}
else
{
handshaker
.
setSNIServerNames
(
serverNames
);
}
...
...
src/share/classes/sun/security/ssl/SSLServerSocketImpl.java
浏览文件 @
7ff0de35
/*
* Copyright (c) 1996, 201
2
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 201
3
, 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
...
...
@@ -92,6 +92,12 @@ class SSLServerSocketImpl extends SSLServerSocket
Collection
<
SNIMatcher
>
sniMatchers
=
Collections
.<
SNIMatcher
>
emptyList
();
/*
* Whether local cipher suites preference in server side should be
* honored during handshaking?
*/
private
boolean
preferLocalCipherSuites
=
false
;
/**
* Create an SSL server socket on a port, using a non-default
* authentication context and a specified connection backlog.
...
...
@@ -304,6 +310,8 @@ class SSLServerSocketImpl extends SSLServerSocket
params
.
setEndpointIdentificationAlgorithm
(
identificationProtocol
);
params
.
setAlgorithmConstraints
(
algorithmConstraints
);
params
.
setSNIMatchers
(
sniMatchers
);
params
.
setUseCipherSuitesOrder
(
preferLocalCipherSuites
);
return
params
;
}
...
...
@@ -318,6 +326,7 @@ class SSLServerSocketImpl extends SSLServerSocket
// the super implementation does not handle the following parameters
identificationProtocol
=
params
.
getEndpointIdentificationAlgorithm
();
algorithmConstraints
=
params
.
getAlgorithmConstraints
();
preferLocalCipherSuites
=
params
.
getUseCipherSuitesOrder
();
Collection
<
SNIMatcher
>
matchers
=
params
.
getSNIMatchers
();
if
(
matchers
!=
null
)
{
sniMatchers
=
params
.
getSNIMatchers
();
...
...
@@ -334,7 +343,7 @@ class SSLServerSocketImpl extends SSLServerSocket
SSLSocketImpl
s
=
new
SSLSocketImpl
(
sslContext
,
useServerMode
,
enabledCipherSuites
,
doClientAuth
,
enableSessionCreation
,
enabledProtocols
,
identificationProtocol
,
algorithmConstraints
,
sniMatchers
);
sniMatchers
,
preferLocalCipherSuites
);
implAccept
(
s
);
s
.
doneConnect
();
...
...
src/share/classes/sun/security/ssl/SSLSocketImpl.java
浏览文件 @
7ff0de35
...
...
@@ -377,6 +377,12 @@ final public class SSLSocketImpl extends BaseSSLSocketImpl {
*/
private
ByteArrayOutputStream
heldRecordBuffer
=
null
;
/*
* Whether local cipher suites preference in server side should be
* honored during handshaking?
*/
private
boolean
preferLocalCipherSuites
=
false
;
//
// CONSTRUCTORS AND INITIALIZATION CODE
//
...
...
@@ -482,7 +488,8 @@ final public class SSLSocketImpl extends BaseSSLSocketImpl {
boolean
sessionCreation
,
ProtocolList
protocols
,
String
identificationProtocol
,
AlgorithmConstraints
algorithmConstraints
,
Collection
<
SNIMatcher
>
sniMatchers
)
throws
IOException
{
Collection
<
SNIMatcher
>
sniMatchers
,
boolean
preferLocalCipherSuites
)
throws
IOException
{
super
();
doClientAuth
=
clientAuth
;
...
...
@@ -490,6 +497,7 @@ final public class SSLSocketImpl extends BaseSSLSocketImpl {
this
.
identificationProtocol
=
identificationProtocol
;
this
.
algorithmConstraints
=
algorithmConstraints
;
this
.
sniMatchers
=
sniMatchers
;
this
.
preferLocalCipherSuites
=
preferLocalCipherSuites
;
init
(
context
,
serverMode
);
/*
...
...
@@ -1284,6 +1292,7 @@ final public class SSLSocketImpl extends BaseSSLSocketImpl {
protocolVersion
,
connectionState
==
cs_HANDSHAKE
,
secureRenegotiation
,
clientVerifyData
,
serverVerifyData
);
handshaker
.
setSNIMatchers
(
sniMatchers
);
handshaker
.
setUseCipherSuitesOrder
(
preferLocalCipherSuites
);
}
else
{
handshaker
=
new
ClientHandshaker
(
this
,
sslContext
,
enabledProtocols
,
...
...
@@ -2502,6 +2511,7 @@ final public class SSLSocketImpl extends BaseSSLSocketImpl {
params
.
setAlgorithmConstraints
(
algorithmConstraints
);
params
.
setSNIMatchers
(
sniMatchers
);
params
.
setServerNames
(
serverNames
);
params
.
setUseCipherSuitesOrder
(
preferLocalCipherSuites
);
return
params
;
}
...
...
@@ -2516,6 +2526,7 @@ final public class SSLSocketImpl extends BaseSSLSocketImpl {
// the super implementation does not handle the following parameters
identificationProtocol
=
params
.
getEndpointIdentificationAlgorithm
();
algorithmConstraints
=
params
.
getAlgorithmConstraints
();
preferLocalCipherSuites
=
params
.
getUseCipherSuitesOrder
();
List
<
SNIServerName
>
sniNames
=
params
.
getServerNames
();
if
(
sniNames
!=
null
)
{
...
...
@@ -2532,6 +2543,7 @@ final public class SSLSocketImpl extends BaseSSLSocketImpl {
handshaker
.
setAlgorithmConstraints
(
algorithmConstraints
);
if
(
roleIsServer
)
{
handshaker
.
setSNIMatchers
(
sniMatchers
);
handshaker
.
setUseCipherSuitesOrder
(
preferLocalCipherSuites
);
}
else
{
handshaker
.
setSNIServerNames
(
serverNames
);
}
...
...
src/share/classes/sun/security/ssl/ServerHandshaker.java
浏览文件 @
7ff0de35
...
...
@@ -932,8 +932,18 @@ final class ServerHandshaker extends Handshaker {
* the cipherSuite and keyExchange variables.
*/
private
void
chooseCipherSuite
(
ClientHello
mesg
)
throws
IOException
{
for
(
CipherSuite
suite
:
mesg
.
getCipherSuites
().
collection
())
{
if
(
isNegotiable
(
suite
)
==
false
)
{
CipherSuiteList
prefered
;
CipherSuiteList
proposed
;
if
(
preferLocalCipherSuites
)
{
prefered
=
getActiveCipherSuites
();
proposed
=
mesg
.
getCipherSuites
();
}
else
{
prefered
=
mesg
.
getCipherSuites
();
proposed
=
getActiveCipherSuites
();
}
for
(
CipherSuite
suite
:
prefered
.
collection
())
{
if
(
isNegotiable
(
proposed
,
suite
)
==
false
)
{
continue
;
}
...
...
@@ -948,8 +958,7 @@ final class ServerHandshaker extends Handshaker {
}
return
;
}
fatalSE
(
Alerts
.
alert_handshake_failure
,
"no cipher suites in common"
);
fatalSE
(
Alerts
.
alert_handshake_failure
,
"no cipher suites in common"
);
}
/**
...
...
src/share/classes/sun/util/locale/provider/JRELocaleProviderAdapter.java
浏览文件 @
7ff0de35
...
...
@@ -361,7 +361,7 @@ public class JRELocaleProviderAdapter extends LocaleProviderAdapter implements R
while
(
tokens
.
hasMoreTokens
())
{
String
token
=
tokens
.
nextToken
();
if
(
token
.
equals
(
"|"
))
{
if
(
isNon
US
LangSupported
())
{
if
(
isNon
EN
LangSupported
())
{
continue
;
}
break
;
...
...
@@ -398,7 +398,7 @@ public class JRELocaleProviderAdapter extends LocaleProviderAdapter implements R
*/
int
barIndex
=
supportedLocaleString
.
indexOf
(
'|'
);
StringTokenizer
localeStringTokenizer
;
if
(
isNon
US
LangSupported
())
{
if
(
isNon
EN
LangSupported
())
{
localeStringTokenizer
=
new
StringTokenizer
(
supportedLocaleString
.
substring
(
0
,
barIndex
)
+
supportedLocaleString
.
substring
(
barIndex
+
1
));
}
else
{
...
...
@@ -427,17 +427,17 @@ public class JRELocaleProviderAdapter extends LocaleProviderAdapter implements R
return
locales
;
}
private
static
volatile
Boolean
isNon
US
Supported
=
null
;
private
static
volatile
Boolean
isNon
EN
Supported
=
null
;
/*
* Returns true if the non
US
resources jar file exists in jre
* Returns true if the non
EN
resources jar file exists in jre
* extension directory. @returns true if the jar file is there. Otherwise,
* returns false.
*/
private
static
boolean
isNon
US
LangSupported
()
{
if
(
isNon
US
Supported
==
null
)
{
private
static
boolean
isNon
EN
LangSupported
()
{
if
(
isNon
EN
Supported
==
null
)
{
synchronized
(
JRELocaleProviderAdapter
.
class
)
{
if
(
isNon
US
Supported
==
null
)
{
if
(
isNon
EN
Supported
==
null
)
{
final
String
sep
=
File
.
separator
;
String
localeDataJar
=
java
.
security
.
AccessController
.
doPrivileged
(
...
...
@@ -449,7 +449,7 @@ public class JRELocaleProviderAdapter extends LocaleProviderAdapter implements R
* localedata.jar is installed or not.
*/
final
File
f
=
new
File
(
localeDataJar
);
isNon
US
Supported
=
isNon
EN
Supported
=
AccessController
.
doPrivileged
(
new
PrivilegedAction
<
Boolean
>()
{
@Override
public
Boolean
run
()
{
...
...
@@ -459,6 +459,6 @@ public class JRELocaleProviderAdapter extends LocaleProviderAdapter implements R
}
}
}
return
isNon
US
Supported
;
return
isNon
EN
Supported
;
}
}
src/share/classes/sun/util/locale/provider/LocaleDataMetaInfo-XLocales.java.template
浏览文件 @
7ff0de35
...
...
@@ -52,25 +52,25 @@ public class LocaleDataMetaInfo {
look up locale string such as "
en
" could be based on if it contains "
en
".
*/
resourceNameToLocales.put("
FormatData
",
"
#
FormatData_
USLocales
#
|
#
FormatData_NonUS
Locales
#
");
"
#
FormatData_
ENLocales
#
|
#
FormatData_NonEN
Locales
#
");
resourceNameToLocales.put("
CollationData
",
"
#
CollationData_
USLocales
#
|
#
CollationData_NonUS
Locales
#
");
"
#
CollationData_
ENLocales
#
|
#
CollationData_NonEN
Locales
#
");
resourceNameToLocales.put("
TimeZoneNames
",
"
#
TimeZoneNames_
USLocales
#
|
#
TimeZoneNames_NonUS
Locales
#
");
"
#
TimeZoneNames_
ENLocales
#
|
#
TimeZoneNames_NonEN
Locales
#
");
resourceNameToLocales.put("
LocaleNames
",
"
#
LocaleNames_
USLocales
#
|
#
LocaleNames_NonUS
Locales
#
");
"
#
LocaleNames_
ENLocales
#
|
#
LocaleNames_NonEN
Locales
#
");
resourceNameToLocales.put("
CurrencyNames
",
"
#
CurrencyNames_
USLocales
#
|
#
CurrencyNames_NonUS
Locales
#
");
"
#
CurrencyNames_
ENLocales
#
|
#
CurrencyNames_NonEN
Locales
#
");
resourceNameToLocales.put("
CalendarData
",
"
#
CalendarData_
USLocales
#
|
#
CalendarData_NonUS
Locales
#
");
"
#
CalendarData_
ENLocales
#
|
#
CalendarData_NonEN
Locales
#
");
resourceNameToLocales.put("
AvailableLocales
",
"
#
AvailableLocales_
USLocales
#
|
#
AvailableLocales_NonUS
Locales
#
");
"
#
AvailableLocales_
ENLocales
#
|
#
AvailableLocales_NonEN
Locales
#
");
}
/*
...
...
src/share/classes/sun/util/locale/provider/LocaleResources.java
浏览文件 @
7ff0de35
...
...
@@ -252,7 +252,7 @@ public class LocaleResources {
String
[]
getTimeZoneNames
(
String
key
,
int
size
)
{
String
[]
names
=
null
;
String
cacheKey
=
TIME_ZONE_NAMES
+
key
;
String
cacheKey
=
TIME_ZONE_NAMES
+
size
+
'.'
+
key
;
removeEmptyReferences
();
ResourceReference
data
=
cache
.
get
(
cacheKey
);
...
...
src/windows/classes/sun/security/mscapi/Key.java
浏览文件 @
7ff0de35
/*
* Copyright (c) 2005, 201
2
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 201
3
, 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
...
...
@@ -39,6 +39,7 @@ import sun.security.util.Length;
*/
abstract
class
Key
implements
java
.
security
.
Key
,
Length
{
private
static
final
long
serialVersionUID
=
-
1088859394025049194L
;
// Native handle
protected
long
hCryptProv
=
0
;
...
...
src/windows/native/java/net/NetworkInterface_winXP.c
浏览文件 @
7ff0de35
/*
* Copyright (c) 2003, 201
1
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 201
3
, 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
...
...
@@ -82,7 +82,6 @@ static int getAdapters (JNIEnv *env, IP_ADAPTER_ADDRESSES **adapters) {
IP_ADAPTER_ADDRESSES
*
adapterInfo
;
ULONG
len
;
adapterInfo
=
(
IP_ADAPTER_ADDRESSES
*
)
malloc
(
bufsize
);
if
(
adapterInfo
==
NULL
)
{
JNU_ThrowByName
(
env
,
"java/lang/OutOfMemoryError"
,
"Native heap allocation failure"
);
return
-
1
;
...
...
@@ -160,8 +159,12 @@ IP_ADAPTER_ADDRESSES *getAdapter (JNIEnv *env, jint index) {
ptr
=
adapterInfo
;
ret
=
NULL
;
while
(
ptr
!=
NULL
)
{
// IPv4 interface
if
(
ptr
->
Ipv6IfIndex
==
index
)
{
// in theory the IPv4 index and the IPv6 index can be the same
// where an interface is enabled for v4 and v6
// IfIndex == 0 IPv4 not available on this interface
// Ipv6IfIndex == 0 IPv6 not available on this interface
if
(((
ptr
->
IfIndex
!=
0
)
&&
(
ptr
->
IfIndex
==
index
))
||
((
ptr
->
Ipv6IfIndex
!=
0
)
&&
(
ptr
->
Ipv6IfIndex
==
index
)))
{
ret
=
(
IP_ADAPTER_ADDRESSES
*
)
malloc
(
sizeof
(
IP_ADAPTER_ADDRESSES
));
if
(
ret
==
NULL
)
{
free
(
adapterInfo
);
...
...
@@ -172,6 +175,7 @@ IP_ADAPTER_ADDRESSES *getAdapter (JNIEnv *env, jint index) {
//copy the memory and break out of the while loop.
memcpy
(
ret
,
ptr
,
sizeof
(
IP_ADAPTER_ADDRESSES
));
break
;
}
ptr
=
ptr
->
Next
;
}
...
...
@@ -192,7 +196,6 @@ int getAllInterfacesAndAddresses (JNIEnv *env, netif **netifPP)
int
tun
=
0
,
net
=
0
;
*
netifPP
=
NULL
;
/*
* Get the IPv4 interfaces. This information is the same
* as what previous JDK versions would return.
...
...
@@ -264,7 +267,7 @@ int getAllInterfacesAndAddresses (JNIEnv *env, netif **netifPP)
* set the index to the IPv6 index and add the
* IPv6 addresses
*/
nif
->
index
=
ptr
->
Ipv6IfIndex
;
nif
->
i
pv6I
ndex
=
ptr
->
Ipv6IfIndex
;
c
=
getAddrsFromAdapter
(
ptr
,
&
nif
->
addrs
);
nif
->
naddrs
+=
c
;
break
;
...
...
@@ -309,6 +312,9 @@ int getAllInterfacesAndAddresses (JNIEnv *env, netif **netifPP)
strcpy
(
nif
->
name
,
newname
);
wcscpy
((
PWCHAR
)
nif
->
displayName
,
ptr
->
FriendlyName
);
nif
->
dNameIsUnicode
=
TRUE
;
// the java.net.NetworkInterface abstraction only has index
// so the Ipv6IfIndex needs to map onto index
nif
->
index
=
ptr
->
Ipv6IfIndex
;
nif
->
ipv6Index
=
ptr
->
Ipv6IfIndex
;
nif
->
hasIpv6Address
=
TRUE
;
...
...
@@ -487,7 +493,6 @@ static jobject createNetworkInterfaceXP(JNIEnv *env, netif *ifs)
(
*
env
)
->
SetObjectField
(
env
,
netifObj
,
ni_nameID
,
name
);
(
*
env
)
->
SetObjectField
(
env
,
netifObj
,
ni_displayNameID
,
displayName
);
(
*
env
)
->
SetIntField
(
env
,
netifObj
,
ni_indexID
,
ifs
->
index
);
/*
* Get the IP addresses for this interface if necessary
* Note that 0 is a valid number of addresses.
...
...
test/java/lang/Class/ArrayMethods.java
0 → 100644
浏览文件 @
7ff0de35
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/* @test
* @bug 4987375
* @summary make sure clone() isn't reflected and that Cloneable and
* Serializable are found
*/
import
java.lang.reflect.*
;
import
java.util.Arrays
;
public
class
ArrayMethods
{
public
int
failed
=
0
;
public
static
void
main
(
String
[]
args
)
throws
Exception
{
ArrayMethods
m
=
new
ArrayMethods
();
m
.
testGetMethod
();
m
.
testGetMethods
();
m
.
testGetDeclaredMethod
();
m
.
testGetDeclaredMethods
();
m
.
testGetInterfaces
();
if
(
m
.
failed
!=
0
)
throw
new
RuntimeException
(
"Test failed, check log for details"
);
}
public
void
testGetMethod
()
{
try
{
Method
m
=
new
String
[
0
].
getClass
().
getMethod
(
"clone"
,
(
Class
<?>[])
null
);
failed
++;
System
.
out
.
println
(
"getMethod(\"clone\", null) Should not find clone()"
);
}
catch
(
NoSuchMethodException
e
)
{
;
//all good
}
}
public
void
testGetMethods
()
{
Method
[]
m
=
new
Integer
[
0
][
0
][
0
].
getClass
().
getMethods
();
for
(
Method
mm
:
m
)
if
(
mm
.
getName
().
contentEquals
(
"clone"
))
{
failed
++;
System
.
out
.
println
(
"getMethods() Should not find clone()"
);
}
}
public
void
testGetDeclaredMethod
()
{
try
{
Method
m
=
new
Object
[
0
][
0
].
getClass
().
getDeclaredMethod
(
"clone"
,
(
Class
<?>[])
null
);
failed
++;
System
.
out
.
println
(
"getDeclaredMethod(\"clone\", null) Should not find clone()"
);
}
catch
(
NoSuchMethodException
e
)
{
;
//all good
}
}
public
void
testGetDeclaredMethods
()
{
Method
[]
m
=
new
Throwable
[
0
][
0
][
0
][
0
].
getClass
().
getDeclaredMethods
();
if
(
m
.
length
!=
0
)
{
failed
++;
System
.
out
.
println
(
"getDeclaredMethods().length should be 0"
);
}
}
public
void
testGetInterfaces
()
{
Class
<?>[]
is
=
new
Integer
[
0
].
getClass
().
getInterfaces
();
boolean
thisFailed
=
false
;
if
(
is
.
length
!=
2
)
thisFailed
=
true
;
if
(!
is
[
0
].
getCanonicalName
().
equals
(
"java.lang.Cloneable"
))
thisFailed
=
true
;
if
(!
is
[
1
].
getCanonicalName
().
equals
(
"java.io.Serializable"
))
thisFailed
=
true
;
if
(
thisFailed
)
{
failed
++;
System
.
out
.
println
(
Arrays
.
asList
(
is
));
System
.
out
.
println
(
"Should contain exactly Cloneable, Serializable in that order."
);
}
}
}
test/java/net/CookieHandler/LocalHostCookie.java
浏览文件 @
7ff0de35
...
...
@@ -72,7 +72,9 @@ public class LocalHostCookie {
}
}
}
finally
{
s
.
stopServer
();
if
(
s
!=
null
)
{
s
.
stopServer
();
}
}
}
...
...
@@ -96,7 +98,9 @@ public class LocalHostCookie {
}
public
void
stopServer
()
{
server
.
stop
(
0
);
if
(
server
!=
null
)
{
server
.
stop
(
0
);
}
}
}
...
...
test/java/net/NetworkInterface/Equals.java
浏览文件 @
7ff0de35
...
...
@@ -25,41 +25,83 @@
* @bug 7003398
* @run main/othervm Equals
*/
import
java.net.NetworkInterface
;
import
java.io.ByteArrayOutputStream
;
import
java.io.PrintStream
;
import
java.net.InetAddress
;
import
java.net.NetworkInterface
;
import
java.net.SocketException
;
import
java.util.Arrays
;
import
java.util.Collections
;
import
java.util.Enumeration
;
import
java.util.HashMap
;
public
class
Equals
{
public
static
void
main
(
String
args
[])
throws
Exception
{
ByteArrayOutputStream
baos
=
new
ByteArrayOutputStream
();
PrintStream
bufferedOut
=
new
PrintStream
(
baos
);
Enumeration
nifs1
=
NetworkInterface
.
getNetworkInterfaces
();
Enumeration
<
NetworkInterface
>
nifs1
=
NetworkInterface
.
getNetworkInterfaces
();
HashMap
<
String
,
Integer
>
hashes
=
new
HashMap
<>();
HashMap
<
String
,
NetworkInterface
>
nicMap
=
new
HashMap
<>();
while
(
nifs1
.
hasMoreElements
())
{
NetworkInterface
ni
=
(
NetworkInterface
)
nifs1
.
nextElement
();
NetworkInterface
ni
=
nifs1
.
nextElement
();
hashes
.
put
(
ni
.
getName
(),
ni
.
hashCode
());
nicMap
.
put
(
ni
.
getName
(),
ni
);
displayInterfaceInformation
(
ni
,
bufferedOut
);
bufferedOut
.
flush
();
}
System
.
setSecurityManager
(
new
SecurityManager
());
Enumeration
nifs2
=
NetworkInterface
.
getNetworkInterfaces
();
Enumeration
<
NetworkInterface
>
nifs2
=
NetworkInterface
.
getNetworkInterfaces
();
while
(
nifs2
.
hasMoreElements
())
{
NetworkInterface
ni
=
(
NetworkInterface
)
nifs2
.
nextElement
();
NetworkInterface
ni
=
nifs2
.
nextElement
();
NetworkInterface
niOrig
=
nicMap
.
get
(
ni
.
getName
());
int
h
=
hashes
.
get
(
ni
.
getName
());
if
(
h
!=
ni
.
hashCode
())
{
throw
new
RuntimeException
(
"Hashcodes different for "
+
int
h
=
ni
.
hashCode
();
if
(
h
!=
hashes
.
get
(
ni
.
getName
()))
{
System
.
out
.
printf
(
"%nSystem information:%n"
);
System
.
out
.
printf
(
"%s"
,
baos
.
toString
(
"UTF8"
));
System
.
out
.
printf
(
"%nni.hashCode() returned %d, expected %d, for:%n"
,
h
,
hashes
.
get
(
ni
.
getName
()));
displayInterfaceInformation
(
ni
,
System
.
out
);
throw
new
RuntimeException
(
"Hashcodes different for "
+
ni
.
getName
());
}
if
(!
ni
.
equals
(
niOrig
))
{
throw
new
RuntimeException
(
"equality different for "
+
System
.
out
.
printf
(
"%nSystem information:%n"
);
System
.
out
.
printf
(
"%s"
,
baos
.
toString
(
"UTF8"
));
System
.
out
.
printf
(
"%nExpected the following interfaces to be the same:%n"
);
displayInterfaceInformation
(
niOrig
,
System
.
out
);
displayInterfaceInformation
(
ni
,
System
.
out
);
throw
new
RuntimeException
(
"equality different for "
+
ni
.
getName
());
}
}
}
static
void
displayInterfaceInformation
(
NetworkInterface
netint
,
PrintStream
out
)
throws
SocketException
{
out
.
printf
(
"Display name: %s%n"
,
netint
.
getDisplayName
());
out
.
printf
(
"Name: %s%n"
,
netint
.
getName
());
Enumeration
<
InetAddress
>
inetAddresses
=
netint
.
getInetAddresses
();
for
(
InetAddress
inetAddress
:
Collections
.
list
(
inetAddresses
))
out
.
printf
(
"InetAddress: %s%n"
,
inetAddress
);
out
.
printf
(
"Up? %s%n"
,
netint
.
isUp
());
out
.
printf
(
"Loopback? %s%n"
,
netint
.
isLoopback
());
out
.
printf
(
"PointToPoint? %s%n"
,
netint
.
isPointToPoint
());
out
.
printf
(
"Supports multicast? %s%n"
,
netint
.
supportsMulticast
());
out
.
printf
(
"Virtual? %s%n"
,
netint
.
isVirtual
());
out
.
printf
(
"Hardware address: %s%n"
,
Arrays
.
toString
(
netint
.
getHardwareAddress
()));
out
.
printf
(
"MTU: %s%n"
,
netint
.
getMTU
());
out
.
printf
(
"Index: %s%n"
,
netint
.
getIndex
());
out
.
printf
(
"%n"
);
}
}
test/java/net/NetworkInterface/UniqueMacAddressesTest.java
0 → 100644
浏览文件 @
7ff0de35
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
import
java.net.InetAddress
;
import
java.net.NetworkInterface
;
import
java.net.SocketException
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Enumeration
;
import
java.util.List
;
/*
* @test
* @bug 8021372
* @summary Tests that the MAC addresses returned by NetworkInterface.getNetworkInterfaces are unique for each adapter.
*
*/
public
class
UniqueMacAddressesTest
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
new
UniqueMacAddressesTest
().
execute
();
System
.
out
.
println
(
"UniqueMacAddressesTest: OK"
);
}
public
UniqueMacAddressesTest
()
{
System
.
out
.
println
(
"UniqueMacAddressesTest: start "
);
}
public
void
execute
()
throws
Exception
{
Enumeration
<
NetworkInterface
>
networkInterfaces
;
boolean
areMacAddressesUnique
=
false
;
List
<
NetworkInterface
>
networkInterfaceList
=
new
ArrayList
<
NetworkInterface
>();
networkInterfaces
=
NetworkInterface
.
getNetworkInterfaces
();
// build a list of NetworkInterface objects to test MAC address
// uniqueness
createNetworkInterfaceList
(
networkInterfaces
,
networkInterfaceList
);
areMacAddressesUnique
=
checkMacAddressesAreUnique
(
networkInterfaceList
);
if
(!
areMacAddressesUnique
)
{
throw
new
RuntimeException
(
"mac address uniqueness test failed"
);
}
}
private
boolean
checkMacAddressesAreUnique
(
List
<
NetworkInterface
>
networkInterfaces
)
throws
Exception
{
boolean
uniqueMacAddresses
=
true
;
for
(
NetworkInterface
networkInterface
:
networkInterfaces
)
{
for
(
NetworkInterface
comparisonNetIf
:
networkInterfaces
)
{
System
.
out
.
println
(
"Comparing netif "
+
networkInterface
.
getName
()
+
" and netif "
+
comparisonNetIf
.
getName
());
if
(
testMacAddressesEqual
(
networkInterface
,
comparisonNetIf
))
{
uniqueMacAddresses
=
false
;
break
;
}
}
if
(
uniqueMacAddresses
!=
true
)
break
;
}
return
uniqueMacAddresses
;
}
private
boolean
testMacAddressesEqual
(
NetworkInterface
netIf1
,
NetworkInterface
netIf2
)
throws
Exception
{
byte
[]
rawMacAddress1
=
null
;
byte
[]
rawMacAddress2
=
null
;
boolean
macAddressesEqual
=
false
;
if
(!
netIf1
.
getName
().
equals
(
netIf2
.
getName
()))
{
System
.
out
.
println
(
"compare hardware addresses "
+
createMacAddressString
(
netIf1
)
+
" and "
+
createMacAddressString
(
netIf2
));
rawMacAddress1
=
netIf1
.
getHardwareAddress
();
rawMacAddress2
=
netIf2
.
getHardwareAddress
();
macAddressesEqual
=
Arrays
.
equals
(
rawMacAddress1
,
rawMacAddress2
);
}
else
{
// same interface
macAddressesEqual
=
false
;
}
return
macAddressesEqual
;
}
private
String
createMacAddressString
(
NetworkInterface
netIf
)
throws
Exception
{
byte
[]
macAddr
=
netIf
.
getHardwareAddress
();
StringBuilder
sb
=
new
StringBuilder
();
if
(
macAddr
!=
null
)
{
for
(
int
i
=
0
;
i
<
macAddr
.
length
;
i
++)
{
sb
.
append
(
String
.
format
(
"%02X%s"
,
macAddr
[
i
],
(
i
<
macAddr
.
length
-
1
)
?
"-"
:
""
));
}
}
return
sb
.
toString
();
}
private
void
createNetworkInterfaceList
(
Enumeration
<
NetworkInterface
>
nis
,
List
<
NetworkInterface
>
networkInterfaceList
)
throws
Exception
{
byte
[]
macAddr
=
null
;
NetworkInterface
netIf
=
null
;
while
(
nis
.
hasMoreElements
())
{
netIf
=
(
NetworkInterface
)
nis
.
nextElement
();
macAddr
=
netIf
.
getHardwareAddress
();
if
(
macAddr
!=
null
)
{
System
.
out
.
println
(
"Adding NetworkInterface "
+
netIf
.
getName
());
networkInterfaceList
.
add
(
netIf
);
}
}
}
}
test/java/nio/file/WatchService/SensitivityModifier.java
浏览文件 @
7ff0de35
...
...
@@ -100,7 +100,7 @@ public class SensitivityModifier {
}
key
.
reset
();
key
=
watcher
.
poll
(
1
,
TimeUnit
.
SECONDS
);
}
while
(
key
!=
null
&&
!
eventReceived
);
}
while
(
key
!=
null
);
// we should have received at least one ENTRY_MODIFY event
if
(
eventReceived
)
{
...
...
test/java/util/logging/Logger/getGlobal/TestGetGlobal.java
浏览文件 @
7ff0de35
...
...
@@ -57,6 +57,12 @@ public class TestGetGlobal {
}
public
static
void
main
(
String
...
args
)
{
final
String
manager
=
System
.
getProperty
(
"java.util.logging.manager"
,
null
);
final
String
description
=
"TestGetGlobal"
+
(
System
.
getSecurityManager
()
==
null
?
" "
:
" -Djava.security.manager "
)
+
(
manager
==
null
?
""
:
"-Djava.util.logging.manager="
+
manager
);
Logger
.
global
.
info
(
messages
[
0
]);
// at this point LogManager is not
// initialized yet, so this message should not appear.
...
...
@@ -67,7 +73,9 @@ public class TestGetGlobal {
final
List
<
String
>
expected
=
Arrays
.
asList
(
Arrays
.
copyOfRange
(
messages
,
1
,
messages
.
length
));
if
(!
testgetglobal
.
HandlerImpl
.
received
.
equals
(
expected
))
{
throw
new
Error
(
"Unexpected message list: "
+
testgetglobal
.
HandlerImpl
.
received
+
" vs "
+
expected
);
System
.
err
.
println
(
"Test case failed: "
+
description
);
throw
new
Error
(
"Unexpected message list: "
+
testgetglobal
.
HandlerImpl
.
received
+
" vs "
+
expected
+
"\n\t"
+
description
);
}
}
}
test/java/util/logging/Logger/getGlobal/TestGetGlobalConcurrent.java
浏览文件 @
7ff0de35
...
...
@@ -22,17 +22,18 @@
*/
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.logging.Level
;
import
java.util.logging.Logger
;
/**
* @test
* @bug 7184195
* @summary
checks that java.util.logging.Logger.getGlobal().info() logs without configuration
* @bug 7184195
8021003
* @summary
Test that the global logger can log with no configuration when accessed from multiple threads.
* @build TestGetGlobalConcurrent testgetglobal.HandlerImpl testgetglobal.LogManagerImpl1 testgetglobal.LogManagerImpl2 testgetglobal.LogManagerImpl3 testgetglobal.BadLogManagerImpl testgetglobal.DummyLogManagerImpl
* @run main/othervm/timeout=10 TestGetGlobalConcurrent
* @run main/othervm/timeout=10/policy=policy -Djava.security.manager TestGetGlobalConcurrent
* @run main/othervm/timeout=10 -Djava.util.logging.manager=testgetglobal.LogManagerImpl TestGetGlobalConcurrent
* @run main/othervm/timeout=10/policy=policy -Djava.security.manager -Djava.util.logging.manager=testgetglobal.LogManagerImpl TestGetGlobalConcurrent
* @run main/othervm/timeout=10 -Djava.util.logging.manager=testgetglobal.LogManagerImpl
1
TestGetGlobalConcurrent
* @run main/othervm/timeout=10/policy=policy -Djava.security.manager -Djava.util.logging.manager=testgetglobal.LogManagerImpl
1
TestGetGlobalConcurrent
* @run main/othervm/timeout=10 -Djava.util.logging.manager=testgetglobal.LogManagerImpl2 TestGetGlobalConcurrent
* @run main/othervm/timeout=10/policy=policy -Djava.security.manager -Djava.util.logging.manager=testgetglobal.LogManagerImpl2 TestGetGlobalConcurrent
* @run main/othervm/timeout=10 -Djava.util.logging.manager=testgetglobal.LogManagerImpl3 TestGetGlobalConcurrent
...
...
@@ -69,7 +70,6 @@ public class TestGetGlobalConcurrent {
// initialize the LogManager - and thus this message should appear.
Logger
.
global
.
info
(
messages
[
i
+
1
]);
// Now that the LogManager is
// initialized, this message should appear too.
final
List
<
String
>
expected
=
Arrays
.
asList
(
Arrays
.
copyOfRange
(
messages
,
i
,
i
+
2
));
if
(!
testgetglobal
.
HandlerImpl
.
received
.
containsAll
(
expected
))
{
fail
(
new
Error
(
"Unexpected message list: "
+
testgetglobal
.
HandlerImpl
.
received
+
" vs "
+
expected
));
...
...
@@ -82,7 +82,6 @@ public class TestGetGlobalConcurrent {
// initialize the LogManager - and thus this message should appear.
Logger
.
global
.
info
(
messages
[
i
+
1
]);
// Now that the LogManager is
// initialized, this message should appear too.
final
List
<
String
>
expected
=
Arrays
.
asList
(
Arrays
.
copyOfRange
(
messages
,
i
,
i
+
2
));
if
(!
testgetglobal
.
HandlerImpl
.
received
.
containsAll
(
expected
))
{
fail
(
new
Error
(
"Unexpected message list: "
+
testgetglobal
.
HandlerImpl
.
received
+
" vs "
+
expected
));
...
...
@@ -96,7 +95,6 @@ public class TestGetGlobalConcurrent {
// initialize the LogManager - and thus this message should appear.
Logger
.
global
.
info
(
messages
[
i
+
1
]);
// Now that the LogManager is
// initialized, this message should appear too.
final
List
<
String
>
expected
=
Arrays
.
asList
(
Arrays
.
copyOfRange
(
messages
,
i
,
i
+
2
));
if
(!
testgetglobal
.
HandlerImpl
.
received
.
containsAll
(
expected
))
{
fail
(
new
Error
(
"Unexpected message list: "
+
testgetglobal
.
HandlerImpl
.
received
+
" vs "
+
expected
));
...
...
@@ -150,8 +148,17 @@ public class TestGetGlobalConcurrent {
public
void
run
()
{
test4
();
}
}
static
String
description
=
"Unknown"
;
public
static
void
main
(
String
...
args
)
throws
Exception
{
final
String
manager
=
System
.
getProperty
(
"java.util.logging.manager"
,
null
);
description
=
"TestGetGlobalConcurrent"
+
(
System
.
getSecurityManager
()
==
null
?
" "
:
" -Djava.security.manager "
)
+
(
manager
==
null
?
""
:
"-Djava.util.logging.manager="
+
manager
);
final
Thread
t1
=
new
Thread
(
new
WaitAndRun
(
new
Run1
()),
"test1"
);
final
Thread
t2
=
new
Thread
(
new
WaitAndRun
(
new
Run2
()),
"test2"
);
final
Thread
t3
=
new
Thread
(
new
WaitAndRun
(
new
Run3
()),
"test3"
);
...
...
@@ -169,14 +176,13 @@ public class TestGetGlobalConcurrent {
final
List
<
String
>
expected
=
Arrays
.
asList
(
Arrays
.
copyOfRange
(
messages
,
1
,
3
));
if
(!
testgetglobal
.
HandlerImpl
.
received
.
containsAll
(
expected
))
{
throw
new
Error
(
"Unexpected message list: "
+
testgetglobal
.
HandlerImpl
.
received
+
" vs "
+
expected
);
fail
(
new
Error
(
"Unexpected message list: "
+
testgetglobal
.
HandlerImpl
.
received
+
" vs "
+
expected
)
);
}
t1
.
join
();
t2
.
join
();
t3
.
join
();
t4
.
join
();
if
(
failed
!=
null
)
{
throw
new
Error
(
"Test failed
."
,
failed
);
throw
new
Error
(
"Test failed
: "
+
description
,
failed
);
}
System
.
out
.
println
(
"Test passed"
);
...
...
test/java/util/logging/Logger/getGlobal/policy
浏览文件 @
7ff0de35
grant {
permission java.util.PropertyPermission "java.util.logging.config.file", "write";
permission java.util.PropertyPermission "test.src", "read";
permission java.util.PropertyPermission "java.util.logging.manager", "read";
permission java.lang.RuntimePermission "setContextClassLoader";
permission java.lang.RuntimePermission "shutdownHooks";
permission java.util.logging.LoggingPermission "control";
...
...
test/java/util/logging/ParentLoggersTest.java
浏览文件 @
7ff0de35
...
...
@@ -29,7 +29,7 @@
* @author ss45998
*
* @build ParentLoggersTest
* @run main
/othervm
ParentLoggersTest
* @run main ParentLoggersTest
*/
/*
...
...
test/java/util/logging/TestAppletLoggerContext.java
浏览文件 @
7ff0de35
...
...
@@ -38,7 +38,7 @@ import sun.misc.SharedSecrets;
/*
* @test
* @bug 8017174 8010727
* @bug 8017174 8010727
8019945
* @summary NPE when using Logger.getAnonymousLogger or
* LogManager.getLogManager().getLogger
*
...
...
@@ -432,45 +432,36 @@ public class TestAppletLoggerContext {
assertNull
(
manager
.
getLogger
(
""
));
assertNull
(
manager
.
getLogger
(
""
));
Bridge
.
changeContext
();
// this is not a supported configuration:
// We are in an applet context with several log managers.
// We however need to check our assumptions...
// Applet context => root logger and global logger are not null.
// root == LogManager.getLogManager().rootLogger
// global == Logger.global
Logger
logger3
=
manager
.
getLogger
(
Logger
.
GLOBAL_LOGGER_NAME
);
Logger
logger3b
=
manager
.
getLogger
(
Logger
.
GLOBAL_LOGGER_NAME
);
assertNotNull
(
logger3
);
assertNotNull
(
logger3b
);
Logger
expected
=
(
System
.
getSecurityManager
()
!=
null
?
Logger
.
getGlobal
()
:
global
);
assertEquals
(
logger3
,
expected
);
// in applet context, we will not see
// the LogManager's custom global logger added above...
assertEquals
(
logger3b
,
expected
);
// in applet context, we will not see
// the LogManager's custom global logger added above...
Logger
global2
=
new
Bridge
.
CustomLogger
(
Logger
.
GLOBAL_LOGGER_NAME
);
manager
.
addLogger
(
global2
);
// adding a global logger will not work in applet context
// we will always get back the global logger.
// this could be considered as a bug...
Logger
logger4
=
manager
.
getLogger
(
Logger
.
GLOBAL_LOGGER_NAME
);
Logger
logger4b
=
manager
.
getLogger
(
Logger
.
GLOBAL_LOGGER_NAME
);
assertNotNull
(
logger4
);
assertNotNull
(
logger4b
);
assertEquals
(
logger4
,
expected
);
// adding a global logger will not work in applet context
assertEquals
(
logger4b
,
expected
);
// adding a global logger will not work in applet context
Logger
logger5
=
manager
.
getLogger
(
""
);
Logger
logger5b
=
manager
.
getLogger
(
""
);
Logger
expectedRoot
=
(
System
.
getSecurityManager
()
!=
null
?
LogManager
.
getLogManager
().
getLogger
(
""
)
:
null
);
assertEquals
(
logger5
,
expectedRoot
);
assertEquals
(
logger5b
,
expectedRoot
);
for
(
int
j
=
0
;
j
<
3
;
j
++)
{
Bridge
.
changeContext
();
// this is not a supported configuration:
// We are in an applet context with several log managers.
// We however need to check our assumptions...
// Applet context => root logger and global logger should also be null.
Logger
expected
=
(
System
.
getSecurityManager
()
==
null
?
global
:
null
);
Logger
logger3
=
manager
.
getLogger
(
Logger
.
GLOBAL_LOGGER_NAME
);
Logger
logger3b
=
manager
.
getLogger
(
Logger
.
GLOBAL_LOGGER_NAME
);
assertEquals
(
expected
,
logger3
);
assertEquals
(
expected
,
logger3b
);
Logger
global2
=
new
Bridge
.
CustomLogger
(
Logger
.
GLOBAL_LOGGER_NAME
);
manager
.
addLogger
(
global2
);
Logger
logger4
=
manager
.
getLogger
(
Logger
.
GLOBAL_LOGGER_NAME
);
Logger
logger4b
=
manager
.
getLogger
(
Logger
.
GLOBAL_LOGGER_NAME
);
assertNotNull
(
logger4
);
assertNotNull
(
logger4b
);
expected
=
(
System
.
getSecurityManager
()
==
null
?
global
:
global2
);;
assertEquals
(
logger4
,
expected
);
assertEquals
(
logger4b
,
expected
);
Logger
logger5
=
manager
.
getLogger
(
""
);
Logger
logger5b
=
manager
.
getLogger
(
""
);
Logger
expectedRoot
=
null
;
assertEquals
(
logger5
,
expectedRoot
);
assertEquals
(
logger5b
,
expectedRoot
);
}
}
}
...
...
@@ -511,57 +502,53 @@ public class TestAppletLoggerContext {
assertEquals
(
logger4
,
root
);
assertEquals
(
logger4b
,
root
);
Bridge
.
changeContext
();
for
(
int
j
=
0
;
j
<
3
;
j
++)
{
Bridge
.
changeContext
();
// this is not a supported configuration:
// We are in an applet context with several log managers.
// We haowever need to check our assumptions...
// Applet context => root logger and global logger are not null.
// root == LogManager.getLogManager().rootLogger
// global == Logger.global
Logger
logger5
=
manager
.
getLogger
(
""
);
Logger
logger5b
=
manager
.
getLogger
(
""
);
Logger
expectedRoot
=
(
System
.
getSecurityManager
()
!=
null
?
LogManager
.
getLogManager
().
getLogger
(
""
)
:
root
);
assertNotNull
(
logger5
);
assertNotNull
(
logger5b
);
assertEquals
(
logger5
,
expectedRoot
);
assertEquals
(
logger5b
,
expectedRoot
);
if
(
System
.
getSecurityManager
()
!=
null
)
{
assertNotEquals
(
logger5
,
root
);
assertNotEquals
(
logger5b
,
root
);
}
// this is not a supported configuration:
// We are in an applet context with several log managers.
// We however need to check our assumptions...
Logger
global2
=
new
Bridge
.
CustomLogger
(
Logger
.
GLOBAL_LOGGER_NAME
);
manager
.
addLogger
(
global2
);
// adding a global logger will not work in applet context
// we will always get back the global logger.
// this could be considered as a bug...
Logger
logger6
=
manager
.
getLogger
(
Logger
.
GLOBAL_LOGGER_NAME
);
Logger
logger6b
=
manager
.
getLogger
(
Logger
.
GLOBAL_LOGGER_NAME
);
Logger
expectedGlobal
=
(
System
.
getSecurityManager
()
!=
null
?
Logger
.
getGlobal
()
:
global
);
assertNotNull
(
logger6
);
assertNotNull
(
logger6b
);
assertEquals
(
logger6
,
expectedGlobal
);
// adding a global logger will not work in applet context
assertEquals
(
logger6b
,
expectedGlobal
);
// adding a global logger will not work in applet context
Logger
root2
=
new
Bridge
.
CustomLogger
(
""
);
manager
.
addLogger
(
root2
);
// adding a root logger will not work in applet context
// we will always get back the default manager's root logger.
// this could be considered as a bug...
Logger
logger7
=
manager
.
getLogger
(
""
);
Logger
logger7b
=
manager
.
getLogger
(
""
);
assertNotNull
(
logger7
);
assertNotNull
(
logger7b
);
assertEquals
(
logger7
,
expectedRoot
);
// adding a global logger will not work in applet context
assertEquals
(
logger7b
,
expectedRoot
);
// adding a global logger will not work in applet context
assertNotEquals
(
logger7
,
root2
);
assertNotEquals
(
logger7b
,
root2
);
// Applet context => root logger and global logger should also be null.
Logger
logger5
=
manager
.
getLogger
(
""
);
Logger
logger5b
=
manager
.
getLogger
(
""
);
Logger
expectedRoot
=
(
System
.
getSecurityManager
()
==
null
?
root
:
null
);
assertEquals
(
logger5
,
expectedRoot
);
assertEquals
(
logger5b
,
expectedRoot
);
if
(
System
.
getSecurityManager
()
!=
null
)
{
assertNull
(
manager
.
getLogger
(
Logger
.
GLOBAL_LOGGER_NAME
));
}
else
{
assertEquals
(
global
,
manager
.
getLogger
(
Logger
.
GLOBAL_LOGGER_NAME
));
}
Logger
global2
=
new
Bridge
.
CustomLogger
(
Logger
.
GLOBAL_LOGGER_NAME
);
manager
.
addLogger
(
global2
);
Logger
logger6
=
manager
.
getLogger
(
Logger
.
GLOBAL_LOGGER_NAME
);
Logger
logger6b
=
manager
.
getLogger
(
Logger
.
GLOBAL_LOGGER_NAME
);
Logger
expectedGlobal
=
(
System
.
getSecurityManager
()
==
null
?
global
:
global2
);
assertNotNull
(
logger6
);
assertNotNull
(
logger6b
);
assertEquals
(
logger6
,
expectedGlobal
);
assertEquals
(
logger6b
,
expectedGlobal
);
if
(
System
.
getSecurityManager
()
!=
null
)
{
assertNull
(
manager
.
getLogger
(
""
));
}
else
{
assertEquals
(
root
,
manager
.
getLogger
(
""
));
}
Logger
root2
=
new
Bridge
.
CustomLogger
(
""
);
manager
.
addLogger
(
root2
);
expectedRoot
=
(
System
.
getSecurityManager
()
==
null
?
root
:
root2
);
Logger
logger7
=
manager
.
getLogger
(
""
);
Logger
logger7b
=
manager
.
getLogger
(
""
);
assertNotNull
(
logger7
);
assertNotNull
(
logger7b
);
assertEquals
(
logger7
,
expectedRoot
);
assertEquals
(
logger7b
,
expectedRoot
);
}
}
}
...
...
test/sun/security/krb5/runNameEquals.sh
浏览文件 @
7ff0de35
...
...
@@ -22,7 +22,7 @@
#
# @test
# @bug 6317711 6944847
# @bug 6317711 6944847
8024046
# @summary Ensure the GSSName has the correct impl which respects
# the contract for equals and hashCode across different configurations.
...
...
@@ -56,6 +56,15 @@ case "$OS" in
PATHSEP
=
":"
FILESEP
=
"/"
NATIVE
=
true
# Not all *nix has native GSS libs installed
krb5-config
--libs
gssapi 2> /dev/null
if
[
$?
!=
0
]
;
then
# Fedora has a different path
/usr/kerberos/bin/krb5-config
--libs
gssapi 2> /dev/null
if
[
$?
!=
0
]
;
then
NATIVE
=
false
fi
fi
;;
CYGWIN
*
)
PATHSEP
=
";"
...
...
test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLEngineImpl/CloseEngineException.java
浏览文件 @
7ff0de35
...
...
@@ -21,17 +21,24 @@
* questions.
*/
//
// SunJSSE does not support dynamic system properties, no way to re-use
// system properties in samevm/agentvm mode.
//
/*
* @test
* @bug 4969799
* @summary javax.net.ssl.SSLSocket.SSLSocket(InetAddress,int) shouldn't
* throw exception
*
* This is making sure that starting a new handshake throws the right
* exception. There is a similar test for SSLSocket.
*
* @run main/othervm CloseEngineException
*/
//
// This is making sure that starting a new handshake throws the right
// exception. There is a similar test for SSLSocket.
//
import
javax.net.ssl.*
;
import
javax.net.ssl.SSLEngineResult.*
;
import
java.io.*
;
...
...
test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLEngineImpl/CloseInboundException.java
浏览文件 @
7ff0de35
...
...
@@ -21,11 +21,17 @@
* questions.
*/
//
// SunJSSE does not support dynamic system properties, no way to re-use
// system properties in samevm/agentvm mode.
//
/*
* @test
* @bug 4931274
* @summary closeInbound does not signal when a close_notify has not
* been received.
* @run main/othervm CloseInboundException
* @author Brad Wetmore
*/
...
...
test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLEngineImpl/CloseStart.java
浏览文件 @
7ff0de35
...
...
@@ -21,15 +21,22 @@
* questions.
*/
//
// SunJSSE does not support dynamic system properties, no way to re-use
// system properties in samevm/agentvm mode.
//
/*
* @test
* @bug 5019096
* @summary Add scatter/gather APIs for SSLEngine
*
* Check to see if the args are being parsed properly.
*
* @run main/othervm CloseStart
*/
//
// Check to see if the args are being parsed properly.
//
import
javax.net.ssl.*
;
import
javax.net.ssl.SSLEngineResult.*
;
import
java.io.*
;
...
...
test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLEngineImpl/DelegatedTaskWrongException.java
浏览文件 @
7ff0de35
...
...
@@ -21,11 +21,16 @@
* questions.
*/
//
// SunJSSE does not support dynamic system properties, no way to re-use
// system properties in samevm/agentvm mode.
//
/*
* @test
* @bug 4969459
* @summary Delegated tasks are not reflecting the subclasses of SSLException
*
*
@run main/othervm DelegatedTaskWrongException
*/
import
javax.net.ssl.*
;
...
...
test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLEngineImpl/EmptyExtensionData.java
浏览文件 @
7ff0de35
...
...
@@ -21,10 +21,16 @@
* questions.
*/
//
// SunJSSE does not support dynamic system properties, no way to re-use
// system properties in samevm/agentvm mode.
//
/*
* @test
* @bug 6728126
* @summary Parsing Extensions in Client Hello message is done in a wrong way
* @run main/othervm EmptyExtensionData
*/
import
javax.net.ssl.*
;
...
...
test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLEngineImpl/EngineEnforceUseClientMode.java
浏览文件 @
7ff0de35
...
...
@@ -21,11 +21,16 @@
* questions.
*/
//
// SunJSSE does not support dynamic system properties, no way to re-use
// system properties in samevm/agentvm mode.
//
/*
* @test
* @bug 4980882
* @summary SSLEngine should enforce setUseClientMode
*
*
@run main/othervm EngineEnforceUseClientMode
* @author Brad R. Wetmore
*/
...
...
test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLEngineImpl/RehandshakeFinished.java
浏览文件 @
7ff0de35
...
...
@@ -21,16 +21,21 @@
* questions.
*/
//
// SunJSSE does not support dynamic system properties, no way to re-use
// system properties in samevm/agentvm mode.
//
/*
* @test
* @bug 6207322
* @summary SSLEngine is returning a premature FINISHED message when doing
* an abbreviated handshake.
*
an abbreviated handshake.
* @run main/othervm RehandshakeFinished
*
*
SunJSSE does not support dynamic system properties, no way to re-use
* system properties in samevm/agentvm mode.
*
*
@author Brad Wetmore
*
/
/
*
* This test may need some updating if the messages change order.
* Currently I'm expecting that there is a simple renegotiation, with
* each message being contained in a single SSL packet.
...
...
@@ -41,8 +46,6 @@
* FINISHED
* CCS
* FINISHED
*
* @author Brad Wetmore
*/
/**
...
...
test/sun/security/ssl/javax/net/ssl/SSLParameters/UseCipherSuitesOrder.java
0 → 100644
浏览文件 @
7ff0de35
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* 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.
*/
//
// SunJSSE does not support dynamic system properties, no way to re-use
// system properties in samevm/agentvm mode.
//
/*
* @test
* @bug 7188657
* @summary There should be a way to reorder the JSSE ciphers
* @run main/othervm UseCipherSuitesOrder
* TLS_RSA_WITH_AES_128_CBC_SHA,SSL_RSA_WITH_RC4_128_SHA
*/
import
java.io.*
;
import
java.net.*
;
import
javax.net.ssl.*
;
import
java.util.Arrays
;
public
class
UseCipherSuitesOrder
{
/*
* =============================================================
* Set the various variables needed for the tests, then
* specify what tests to run on each side.
*/
/*
* Should we run the client or server in a separate thread?
* Both sides can throw exceptions, but do you have a preference
* as to which side should be the main thread.
*/
static
boolean
separateServerThread
=
false
;
/*
* Where do we find the keystores?
*/
static
String
pathToStores
=
"../../../../etc"
;
static
String
keyStoreFile
=
"keystore"
;
static
String
trustStoreFile
=
"truststore"
;
static
String
passwd
=
"passphrase"
;
/*
* Is the server ready to serve?
*/
volatile
static
boolean
serverReady
=
false
;
/*
* Turn on SSL debugging?
*/
static
boolean
debug
=
false
;
/*
* If the client or server is doing some kind of object creation
* that the other side depends on, and that thread prematurely
* exits, you may experience a hang. The test harness will
* terminate all hung threads after its timeout has expired,
* currently 3 minutes by default, but you might try to be
* smart about it....
*/
/*
* Define the server side of the test.
*
* If the server prematurely exits, serverReady will be set to true
* to avoid infinite hangs.
*/
void
doServerSide
()
throws
Exception
{
SSLServerSocketFactory
sslssf
=
(
SSLServerSocketFactory
)
SSLServerSocketFactory
.
getDefault
();
SSLServerSocket
sslServerSocket
=
(
SSLServerSocket
)
sslssf
.
createServerSocket
(
serverPort
);
serverPort
=
sslServerSocket
.
getLocalPort
();
// use local cipher suites preference
SSLParameters
params
=
sslServerSocket
.
getSSLParameters
();
params
.
setUseCipherSuitesOrder
(
true
);
params
.
setCipherSuites
(
srvEnabledCipherSuites
);
sslServerSocket
.
setSSLParameters
(
params
);
/*
* Signal Client, we're ready for his connect.
*/
serverReady
=
true
;
SSLSocket
sslSocket
=
(
SSLSocket
)
sslServerSocket
.
accept
();
InputStream
sslIS
=
sslSocket
.
getInputStream
();
OutputStream
sslOS
=
sslSocket
.
getOutputStream
();
sslIS
.
read
();
sslOS
.
write
(
85
);
sslOS
.
flush
();
SSLSession
session
=
sslSocket
.
getSession
();
if
(!
srvEnabledCipherSuites
[
0
].
equals
(
session
.
getCipherSuite
()))
{
throw
new
Exception
(
"Expected to negotiate "
+
srvEnabledCipherSuites
[
0
]
+
" , but not "
+
session
.
getCipherSuite
());
}
sslSocket
.
close
();
}
/*
* Define the client side of the test.
*
* If the server prematurely exits, serverReady will be set to true
* to avoid infinite hangs.
*/
void
doClientSide
()
throws
Exception
{
/*
* Wait for server to get started.
*/
while
(!
serverReady
)
{
Thread
.
sleep
(
50
);
}
SSLSocketFactory
sslsf
=
(
SSLSocketFactory
)
SSLSocketFactory
.
getDefault
();
SSLSocket
sslSocket
=
(
SSLSocket
)
sslsf
.
createSocket
(
"localhost"
,
serverPort
);
sslSocket
.
setEnabledCipherSuites
(
cliEnabledCipherSuites
);
InputStream
sslIS
=
sslSocket
.
getInputStream
();
OutputStream
sslOS
=
sslSocket
.
getOutputStream
();
sslOS
.
write
(
280
);
sslOS
.
flush
();
sslIS
.
read
();
sslSocket
.
close
();
}
// client enabled cipher suites
private
static
String
[]
cliEnabledCipherSuites
;
// server enabled cipher suites
private
static
String
[]
srvEnabledCipherSuites
;
private
static
void
parseArguments
(
String
[]
args
)
throws
Exception
{
if
(
args
.
length
!=
1
)
{
System
.
out
.
println
(
"Usage: java UseCipherSuitesOrder ciphersuites"
);
System
.
out
.
println
(
"\tciphersuites: "
+
"a list of enabled cipher suites, separated with comma"
);
throw
new
Exception
(
"Incorrect usage"
);
}
cliEnabledCipherSuites
=
args
[
0
].
split
(
","
);
if
(
cliEnabledCipherSuites
.
length
<
2
)
{
throw
new
Exception
(
"Need to enable at least two cipher suites"
);
}
// Only need to use 2 cipher suites in server side.
srvEnabledCipherSuites
=
Arrays
.<
String
>
copyOf
(
cliEnabledCipherSuites
,
2
);
// Reverse the cipher suite preference in server side.
srvEnabledCipherSuites
[
0
]
=
cliEnabledCipherSuites
[
1
];
srvEnabledCipherSuites
[
1
]
=
cliEnabledCipherSuites
[
0
];
}
/*
* =============================================================
* The remainder is just support stuff
*/
// use any free port by default
volatile
int
serverPort
=
0
;
volatile
Exception
serverException
=
null
;
volatile
Exception
clientException
=
null
;
public
static
void
main
(
String
[]
args
)
throws
Exception
{
// parse the arguments
parseArguments
(
args
);
String
keyFilename
=
System
.
getProperty
(
"test.src"
,
"."
)
+
"/"
+
pathToStores
+
"/"
+
keyStoreFile
;
String
trustFilename
=
System
.
getProperty
(
"test.src"
,
"."
)
+
"/"
+
pathToStores
+
"/"
+
trustStoreFile
;
System
.
setProperty
(
"javax.net.ssl.keyStore"
,
keyFilename
);
System
.
setProperty
(
"javax.net.ssl.keyStorePassword"
,
passwd
);
System
.
setProperty
(
"javax.net.ssl.trustStore"
,
trustFilename
);
System
.
setProperty
(
"javax.net.ssl.trustStorePassword"
,
passwd
);
if
(
debug
)
System
.
setProperty
(
"javax.net.debug"
,
"all"
);
/*
* Start the tests.
*/
new
UseCipherSuitesOrder
();
}
Thread
clientThread
=
null
;
Thread
serverThread
=
null
;
/*
* Primary constructor, used to drive remainder of the test.
*
* Fork off the other side, then do your work.
*/
UseCipherSuitesOrder
()
throws
Exception
{
Exception
startException
=
null
;
try
{
if
(
separateServerThread
)
{
startServer
(
true
);
startClient
(
false
);
}
else
{
startClient
(
true
);
startServer
(
false
);
}
}
catch
(
Exception
e
)
{
startException
=
e
;
}
/*
* Wait for other side to close down.
*/
if
(
separateServerThread
)
{
if
(
serverThread
!=
null
)
{
serverThread
.
join
();
}
}
else
{
if
(
clientThread
!=
null
)
{
clientThread
.
join
();
}
}
/*
* When we get here, the test is pretty much over.
* Which side threw the error?
*/
Exception
local
;
Exception
remote
;
if
(
separateServerThread
)
{
remote
=
serverException
;
local
=
clientException
;
}
else
{
remote
=
clientException
;
local
=
serverException
;
}
Exception
exception
=
null
;
/*
* Check various exception conditions.
*/
if
((
local
!=
null
)
&&
(
remote
!=
null
))
{
// If both failed, return the curthread's exception.
local
.
initCause
(
remote
);
exception
=
local
;
}
else
if
(
local
!=
null
)
{
exception
=
local
;
}
else
if
(
remote
!=
null
)
{
exception
=
remote
;
}
else
if
(
startException
!=
null
)
{
exception
=
startException
;
}
/*
* If there was an exception *AND* a startException,
* output it.
*/
if
(
exception
!=
null
)
{
if
(
exception
!=
startException
&&
startException
!=
null
)
{
exception
.
addSuppressed
(
startException
);
}
throw
exception
;
}
// Fall-through: no exception to throw!
}
void
startServer
(
boolean
newThread
)
throws
Exception
{
if
(
newThread
)
{
serverThread
=
new
Thread
()
{
public
void
run
()
{
try
{
doServerSide
();
}
catch
(
Exception
e
)
{
/*
* Our server thread just died.
*
* Release the client, if not active already...
*/
System
.
err
.
println
(
"Server died..."
);
serverReady
=
true
;
serverException
=
e
;
}
}
};
serverThread
.
start
();
}
else
{
try
{
doServerSide
();
}
catch
(
Exception
e
)
{
serverException
=
e
;
}
finally
{
serverReady
=
true
;
}
}
}
void
startClient
(
boolean
newThread
)
throws
Exception
{
if
(
newThread
)
{
clientThread
=
new
Thread
()
{
public
void
run
()
{
try
{
doClientSide
();
}
catch
(
Exception
e
)
{
/*
* Our client thread just died.
*/
System
.
err
.
println
(
"Client died..."
);
clientException
=
e
;
}
}
};
clientThread
.
start
();
}
else
{
try
{
doClientSide
();
}
catch
(
Exception
e
)
{
clientException
=
e
;
}
}
}
}
test/sun/util/locale/provider/Bug8024141.java
0 → 100644
浏览文件 @
7ff0de35
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 8024141
* @summary Test for cache support of sun.util.locale.provider.LocaleResources.getTimeZoneNames
*/
import
java.time.ZoneId
;
import
static
java
.
util
.
Locale
.
ENGLISH
;
import
static
java
.
time
.
format
.
TextStyle
.
FULL
;
import
static
java
.
time
.
format
.
TextStyle
.
SHORT
;
public
class
Bug8024141
{
// This test assumes that the two time zones are in GMT. If
// they become different zones, need to pick up another zones.
private
static
final
String
[]
ZONES
=
{
"Africa/Abidjan"
,
"Africa/Bamako"
};
public
static
void
main
(
String
[]
args
)
{
ZoneId
gmt
=
ZoneId
.
of
(
"GMT"
);
String
gmtName
=
gmt
.
getDisplayName
(
FULL
,
ENGLISH
);
String
gmtAbbr
=
gmt
.
getDisplayName
(
SHORT
,
ENGLISH
);
for
(
String
zone
:
ZONES
)
{
ZoneId
id
=
ZoneId
.
of
(
zone
);
String
name
=
id
.
getDisplayName
(
FULL
,
ENGLISH
);
String
abbr
=
id
.
getDisplayName
(
SHORT
,
ENGLISH
);
if
(!
name
.
equals
(
gmtName
)
||
!
abbr
.
equals
(
gmtAbbr
))
{
throw
new
RuntimeException
(
"inconsistent name/abbr for "
+
zone
+
":\n"
+
"name="
+
name
+
", abbr="
+
abbr
);
}
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录