--- a/jdk/make/java/java/genlocales.gmk Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/make/java/java/genlocales.gmk Wed Sep 11 10:35:31 2013 -0400
@@ -38,31 +38,31 @@
# 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
-NonUS_Resources_java := $(FILES_java)
-NonUS_Resources_properties := $(FILES_compiled_properties)
+NonEN_Resources_java := $(FILES_java)
+NonEN_Resources_properties := $(FILES_compiled_properties)
# Restore the orignal FILES_java & FILES_compiled_properties variables
FILES_java := $(FILES_java_orig)
@@ -80,30 +80,30 @@
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) $(NonUS_Resources_properties) | $(NAWK) 'gsub(/.properties/,"\n") {print}' > $@.tmp.nonus;
- @$(ECHO) $(NonUS_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) $(NonEN_Resources_properties) | $(NAWK) 'gsub(/.properties/,"\n") {print}' > $@.tmp.nonen;
+ @$(ECHO) $(NonEN_Resources_java) | $(NAWK) 'gsub(/.java/,"\n") {print}' >> $@.tmp.nonen;
NAWK="$(NAWK)" SED="$(SED)" SORT="$(SORT)" \
- $(SH) $(LOCALEGEN_SH) $(RESOURCE_NAMES) $@.tmp.us \
- $@.tmp.nonus $< $@
- @$(RM) $@.tmp.us $@.tmp.nonus;
+ $(SH) $(LOCALEGEN_SH) $(RESOURCE_NAMES) $@.tmp.en \
+ $@.tmp.nonen $< $@
+ @$(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',$(NonUS_Resources_properties)) > $@.tmp.nonus;
- @$(ECHO) $(subst .java,'\n',$(NonUS_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',$(NonEN_Resources_properties)) > $@.tmp.nonen;
+ @$(ECHO) $(subst .java,'\n',$(NonEN_Resources_java)) >> $@.tmp.nonen;
NAWK="$(NAWK)" SED="$(SED)" SORT="$(SORT)" \
- $(SH) $(LOCALEGEN_SH) $(RESOURCE_NAMES) $@.tmp.us \
- $@.tmp.nonus $< $@
- @$(RM) $@.tmp.us $@.tmp.nonus;
+ $(SH) $(LOCALEGEN_SH) $(RESOURCE_NAMES) $@.tmp.en \
+ $@.tmp.nonen $< $@
+ @$(RM) $@.tmp.en $@.tmp.nonen;
endif
genlocales : $(LocaleDataMetaInfo_Dest)
--- a/jdk/make/java/java/localegen.sh Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/make/java/java/localegen.sh Wed Sep 11 10:35:31 2013 -0400
@@ -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;
-NONUS_FILES_LIST=$3
+# A list of non-EN resources;
+NONEN_FILES_LIST=$3
INPUT_FILE=$4
OUTPUT_FILE=$5
@@ -53,23 +53,23 @@
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.
-nonusall=" ja-JP-JP th-TH-TH "
+nonenall=" ja-JP-JP th-TH-TH "
for FILE in $RESOURCE_NAMES
do
- getlocalelist $FILE $US_FILES_LIST
- sed_script=$sed_script"-e \"s@#"$FILE"_USLocales#@$localelist@g\" "
- usall=$usall" "$localelist
- getlocalelist $FILE $NONUS_FILES_LIST
- sed_script=$sed_script"-e \"s@#"$FILE"_NonUSLocales#@$localelist@g\" "
- nonusall=$nonusall" "$localelist
+ getlocalelist $FILE $EN_FILES_LIST
+ sed_script=$sed_script"-e \"s@#"$FILE"_ENLocales#@$localelist@g\" "
+ enall=$enall" "$localelist
+ getlocalelist $FILE $NONEN_FILES_LIST
+ sed_script=$sed_script"-e \"s@#"$FILE"_NonENLocales#@$localelist@g\" "
+ nonenall=$nonenall" "$localelist
done
-usall=`(for LOC in $usall; do echo $LOC;done) |$SORT -u`
-nonusall=`(for LOC in $nonusall; do echo $LOC;done) |$SORT -u`
+enall=`(for LOC in $enall; do echo $LOC;done) |$SORT -u`
+nonenall=`(for LOC in $nonenall; do echo $LOC;done) |$SORT -u`
-sed_script=$sed_script"-e \"s@#AvailableLocales_USLocales#@$usall@g\" "
-sed_script=$sed_script"-e \"s@#AvailableLocales_NonUSLocales#@$nonusall@g\" "
+sed_script=$sed_script"-e \"s@#AvailableLocales_ENLocales#@$enall@g\" "
+sed_script=$sed_script"-e \"s@#AvailableLocales_NonENLocales#@$nonenall@g\" "
sed_script=$sed_script"$INPUT_FILE > $OUTPUT_FILE"
eval $sed_script
--- a/jdk/make/java/text/base/FILES_java.gmk Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/make/java/text/base/FILES_java.gmk Wed Sep 11 10:35:31 2013 -0400
@@ -107,5 +107,17 @@
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
--- a/jdk/make/java/util/FILES_java.gmk Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/make/java/util/FILES_java.gmk Wed Sep 11 10:35:31 2013 -0400
@@ -30,4 +30,7 @@
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
--- a/jdk/make/java/util/FILES_properties.gmk Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/make/java/util/FILES_properties.gmk Wed Sep 11 10:35:31 2013 -0400
@@ -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
--- a/jdk/make/sun/text/FILES_java.gmk Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/make/sun/text/FILES_java.gmk Wed Sep 11 10:35:31 2013 -0400
@@ -96,16 +96,6 @@
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 @@
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 @@
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 \
--- a/jdk/make/sun/text/FILES_properties.gmk Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/make/sun/text/FILES_properties.gmk Wed Sep 11 10:35:31 2013 -0400
@@ -33,9 +33,6 @@
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 @@
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 @@
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 \
--- a/jdk/makefiles/CreateJars.gmk Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/makefiles/CreateJars.gmk Wed Sep 11 10:35:31 2013 -0400
@@ -80,39 +80,6 @@
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,\
--- a/jdk/makefiles/GensrcLocaleDataMetaInfo.gmk Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/makefiles/GensrcLocaleDataMetaInfo.gmk Wed Sep 11 10:35:31 2013 -0400
@@ -50,27 +50,27 @@
$(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_NonUSLocales$$(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_NonENLocales$$(HASH)/$$(if $$($1_NON_EN_LOCALES),$$(SPACE)$$($1_NON_EN_LOCALES),)/g'
endef
#sun.text.resources.FormatData
@@ -91,8 +91,8 @@
#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_NonUSLocales$(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_NonENLocales$(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
--- a/jdk/src/share/classes/com/sun/nio/sctp/Association.java Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/src/share/classes/com/sun/nio/sctp/Association.java Wed Sep 11 10:35:31 2013 -0400
@@ -58,6 +58,13 @@
/**
* 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,
--- a/jdk/src/share/classes/com/sun/nio/sctp/IllegalReceiveException.java Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/src/share/classes/com/sun/nio/sctp/IllegalReceiveException.java Wed Sep 11 10:35:31 2013 -0400
@@ -41,6 +41,9 @@
/**
* 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);
--- a/jdk/src/share/classes/com/sun/nio/sctp/IllegalUnbindException.java Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/src/share/classes/com/sun/nio/sctp/IllegalUnbindException.java Wed Sep 11 10:35:31 2013 -0400
@@ -41,6 +41,9 @@
/**
* 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);
--- a/jdk/src/share/classes/com/sun/nio/sctp/InvalidStreamException.java Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/src/share/classes/com/sun/nio/sctp/InvalidStreamException.java Wed Sep 11 10:35:31 2013 -0400
@@ -40,6 +40,9 @@
/**
* 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);
--- a/jdk/src/share/classes/com/sun/nio/sctp/MessageInfo.java Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/src/share/classes/com/sun/nio/sctp/MessageInfo.java Wed Sep 11 10:35:31 2013 -0400
@@ -48,7 +48,7 @@
* 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
--- a/jdk/src/share/classes/com/sun/nio/sctp/Notification.java Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/src/share/classes/com/sun/nio/sctp/Notification.java Wed Sep 11 10:35:31 2013 -0400
@@ -40,6 +40,8 @@
public interface Notification {
/**
* Returns the association that this notification is applicable to.
+ *
+ * @return The association
*/
public Association association();
}
--- a/jdk/src/share/classes/com/sun/nio/sctp/SctpChannel.java Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/src/share/classes/com/sun/nio/sctp/SctpChannel.java Wed Sep 11 10:35:31 2013 -0400
@@ -59,7 +59,7 @@
* {@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 @@
/**
* 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 @@
/**
* 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 @@
* 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 @@
* there was insufficient room for the message in the underlying
* output buffer
*
- * @throws InvalidStreamExcepton
+ * @throws InvalidStreamException
* If {@code streamNumner} is negative or greater than or equal to
* the maximum number of outgoing streams
*
--- a/jdk/src/share/classes/com/sun/nio/sctp/SctpMultiChannel.java Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/src/share/classes/com/sun/nio/sctp/SctpMultiChannel.java Wed Sep 11 10:35:31 2013 -0400
@@ -63,7 +63,7 @@
* {@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 @@
* 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 @@
* 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 @@
* 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 @@
* 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 @@
* there was insufficient room for the message in the underlying
* output buffer
*
- * @throws InvalidStreamExcepton
+ * @throws InvalidStreamException
* If {@code streamNumber} is negative, or if an association already
* exists and {@code streamNumber} is greater than the maximum number
* of outgoing streams
--- a/jdk/src/share/classes/com/sun/nio/sctp/SctpServerChannel.java Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/src/share/classes/com/sun/nio/sctp/SctpServerChannel.java Wed Sep 11 10:35:31 2013 -0400
@@ -47,7 +47,7 @@
* {@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 @@
/**
* 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 @@
/**
* Sets the value of a socket option.
*
+ * @param <T>
+ * The type of the socket option value
+ *
* @param name
* The socket option
*
--- a/jdk/src/share/classes/java/lang/Class.java Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/src/share/classes/java/lang/Class.java Wed Sep 11 10:35:31 2013 -0400
@@ -821,6 +821,10 @@
* <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 @@
* <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 @@
/**
- * 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> 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> 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> 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 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> See <em>The Java Language Specification</em>, sections 8.2 and 8.4.
+ * <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 @@
* 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 @@
* 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 @@
* 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 @@
* <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 @@
/**
- * 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.
+ *
+ * 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> See <em>The Java Language Specification</em>, section 8.2.
+ * <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 @@
*
* </ul>
*
+ * @jls 8.2 Class Members
+ * @jls 8.4 Method Declarations
* @since JDK1.1
*/
@CallerSensitive
@@ -2011,6 +2041,9 @@
* 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 @@
*
* </ul>
*
+ * @jls 8.2 Class Members
+ * @jls 8.4 Method Declarations
* @since JDK1.1
*/
@CallerSensitive
--- a/jdk/src/share/classes/java/lang/reflect/Executable.java Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/src/share/classes/java/lang/reflect/Executable.java Wed Sep 11 10:35:31 2013 -0400
@@ -428,20 +428,32 @@
}
/**
- * 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();
--- a/jdk/src/share/classes/java/net/AbstractPlainSocketImpl.java Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/src/share/classes/java/net/AbstractPlainSocketImpl.java Wed Sep 11 10:35:31 2013 -0400
@@ -719,7 +719,3 @@
public final static int SHUT_RD = 0;
public final static int SHUT_WR = 1;
}
-
-class InetAddressContainer {
- InetAddress addr;
-}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/java/net/InetAddressContainer.java Wed Sep 11 10:35:31 2013 -0400
@@ -0,0 +1,30 @@
+/*
+ * 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;
+}
--- a/jdk/src/share/classes/java/rmi/activation/Activatable.java Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/src/share/classes/java/rmi/activation/Activatable.java Wed Sep 11 10:35:31 2013 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2005, 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
@@ -93,6 +93,8 @@
* @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 @@
* @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 @@
* @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 @@
* @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 @@
* 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 @@
* 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 @@
* @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 @@
* 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 @@
* 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 @@
* @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 @@
* 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 @@
* @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)
--- a/jdk/src/share/classes/java/rmi/activation/ActivationDesc.java Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/src/share/classes/java/rmi/activation/ActivationDesc.java Wed Sep 11 10:35:31 2013 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2005, 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
@@ -105,6 +105,8 @@
* @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 @@
* <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 @@
* @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 @@
* <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,
--- a/jdk/src/share/classes/java/rmi/activation/ActivationGroup.java Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/src/share/classes/java/rmi/activation/ActivationGroup.java Wed Sep 11 10:35:31 2013 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2005, 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
@@ -133,6 +133,8 @@
*
* @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 @@
* (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 @@
/**
* 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 @@
* (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 @@
* @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
*/
--- a/jdk/src/share/classes/java/rmi/activation/ActivationGroupID.java Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/src/share/classes/java/rmi/activation/ActivationGroupID.java Wed Sep 11 10:35:31 2013 -0400
@@ -1,5 +1,5 @@
/*
- * 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 @@
* 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) {
--- a/jdk/src/share/classes/java/rmi/activation/ActivationID.java Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/src/share/classes/java/rmi/activation/ActivationID.java Wed Sep 11 10:35:31 2013 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2005, 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
@@ -90,6 +90,8 @@
*
* @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) {
--- a/jdk/src/share/classes/java/rmi/activation/package.html Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/src/share/classes/java/rmi/activation/package.html Wed Sep 11 10:35:31 2013 -0400
@@ -1,5 +1,5 @@
<!--
- 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 @@
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>
--- a/jdk/src/share/classes/java/security/AccessController.java Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/src/share/classes/java/security/AccessController.java Wed Sep 11 10:35:31 2013 -0400
@@ -279,6 +279,9 @@
* <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 @@
* <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 @@
* {@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 @@
* 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 @@
* <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 @@
* <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 @@
* <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 @@
* {@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 @@
* 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 @@
* <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
--- a/jdk/src/share/classes/java/security/AlgorithmParameters.java Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/src/share/classes/java/security/AlgorithmParameters.java Wed Sep 11 10:35:31 2013 -0400
@@ -324,6 +324,7 @@
* 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.
*
--- a/jdk/src/share/classes/java/security/AlgorithmParametersSpi.java Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/src/share/classes/java/security/AlgorithmParametersSpi.java Wed Sep 11 10:35:31 2013 -0400
@@ -102,6 +102,8 @@
* 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.
*
--- a/jdk/src/share/classes/java/security/KeyFactory.java Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/src/share/classes/java/security/KeyFactory.java Wed Sep 11 10:35:31 2013 -0400
@@ -395,6 +395,8 @@
* 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
--- a/jdk/src/share/classes/java/security/KeyFactorySpi.java Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/src/share/classes/java/security/KeyFactorySpi.java Wed Sep 11 10:35:31 2013 -0400
@@ -106,6 +106,8 @@
* 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
--- a/jdk/src/share/classes/java/security/KeyStore.java Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/src/share/classes/java/security/KeyStore.java Wed Sep 11 10:35:31 2013 -0400
@@ -1753,6 +1753,7 @@
/**
* 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
--- a/jdk/src/share/classes/java/security/Principal.java Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/src/share/classes/java/security/Principal.java Wed Sep 11 10:35:31 2013 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -81,6 +81,7 @@
* <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
--- a/jdk/src/share/classes/java/security/cert/CertPathBuilderSpi.java Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/src/share/classes/java/security/cert/CertPathBuilderSpi.java Wed Sep 11 10:35:31 2013 -0400
@@ -87,6 +87,8 @@
* 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
*/
--- a/jdk/src/share/classes/java/security/cert/CertPathValidatorSpi.java Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/src/share/classes/java/security/cert/CertPathValidatorSpi.java Wed Sep 11 10:35:31 2013 -0400
@@ -97,6 +97,8 @@
* 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
*/
--- a/jdk/src/share/classes/java/security/cert/PKIXRevocationChecker.java Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/src/share/classes/java/security/cert/PKIXRevocationChecker.java Wed Sep 11 10:35:31 2013 -0400
@@ -103,6 +103,9 @@
private Map<X509Certificate, byte[]> ocspResponses = Collections.emptyMap();
private Set<Option> options = Collections.emptySet();
+ /**
+ * Default constructor.
+ */
protected PKIXRevocationChecker() {}
/**
--- a/jdk/src/share/classes/java/security/interfaces/RSAMultiPrimePrivateCrtKey.java Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/src/share/classes/java/security/interfaces/RSAMultiPrimePrivateCrtKey.java Wed Sep 11 10:35:31 2013 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -46,6 +46,11 @@
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;
/**
--- a/jdk/src/share/classes/java/security/interfaces/RSAPrivateCrtKey.java Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/src/share/classes/java/security/interfaces/RSAPrivateCrtKey.java Wed Sep 11 10:35:31 2013 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2003, 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
@@ -39,6 +39,11 @@
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;
/**
--- a/jdk/src/share/classes/java/security/interfaces/RSAPrivateKey.java Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/src/share/classes/java/security/interfaces/RSAPrivateKey.java Wed Sep 11 10:35:31 2013 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2003, 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
@@ -39,6 +39,11 @@
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;
/**
--- a/jdk/src/share/classes/java/security/interfaces/RSAPublicKey.java Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/src/share/classes/java/security/interfaces/RSAPublicKey.java Wed Sep 11 10:35:31 2013 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2003, 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
@@ -36,6 +36,11 @@
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;
/**
--- a/jdk/src/share/classes/java/util/logging/LogManager.java Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/src/share/classes/java/util/logging/LogManager.java Wed Sep 11 10:35:31 2013 -0400
@@ -144,7 +144,7 @@
public class LogManager {
// The global LogManager object
- private static LogManager manager;
+ private static final LogManager manager;
private Properties props = new Properties();
private final static Level defaultLevel = Level.INFO;
@@ -156,8 +156,10 @@
// LoggerContext for system loggers and user loggers
private final LoggerContext systemContext = new SystemLoggerContext();
private final LoggerContext userContext = new LoggerContext();
- private Logger rootLogger;
-
+ // non final field - make it volatile to make sure that other threads
+ // will see the new value once ensureLogManagerInitialized() has finished
+ // executing.
+ private volatile Logger rootLogger;
// Have we done the primordial reading of the configuration file?
// (Must be done after a suitable amount of java.lang.System
// initialization has been done)
@@ -169,58 +171,35 @@
private boolean deathImminent;
static {
- AccessController.doPrivileged(new PrivilegedAction<Object>() {
- public Object run() {
- String cname = null;
- try {
- cname = System.getProperty("java.util.logging.manager");
- if (cname != null) {
- try {
- Class<?> clz = ClassLoader.getSystemClassLoader().loadClass(cname);
- manager = (LogManager) clz.newInstance();
- } catch (ClassNotFoundException ex) {
- Class<?> clz = Thread.currentThread().getContextClassLoader().loadClass(cname);
- manager = (LogManager) clz.newInstance();
- }
+ manager = AccessController.doPrivileged(new PrivilegedAction<LogManager>() {
+ @Override
+ public LogManager run() {
+ LogManager mgr = null;
+ String cname = null;
+ try {
+ cname = System.getProperty("java.util.logging.manager");
+ if (cname != null) {
+ try {
+ Class<?> clz = ClassLoader.getSystemClassLoader()
+ .loadClass(cname);
+ mgr = (LogManager) clz.newInstance();
+ } catch (ClassNotFoundException ex) {
+ Class<?> clz = Thread.currentThread()
+ .getContextClassLoader().loadClass(cname);
+ mgr = (LogManager) clz.newInstance();
}
- } catch (Exception ex) {
- System.err.println("Could not load Logmanager \"" + cname + "\"");
- ex.printStackTrace();
}
- if (manager == null) {
- manager = new LogManager();
- }
+ } catch (Exception ex) {
+ System.err.println("Could not load Logmanager \"" + cname + "\"");
+ ex.printStackTrace();
+ }
+ if (mgr == null) {
+ mgr = new LogManager();
+ }
+ return mgr;
- // Create and retain Logger for the root of the namespace.
- manager.rootLogger = manager.new RootLogger();
- // since by design the global manager's userContext and
- // systemContext don't have their requiresDefaultLoggers
- // flag set - we make sure to add the root logger to
- // the global manager's default contexts here.
- manager.addLogger(manager.rootLogger);
- manager.systemContext.addLocalLogger(manager.rootLogger, false);
- manager.userContext.addLocalLogger(manager.rootLogger, false);
-
- // Adding the global Logger. Doing so in the Logger.<clinit>
- // would deadlock with the LogManager.<clinit>.
- // Do not call Logger.getGlobal() here as this might trigger
- // the deadlock too.
- @SuppressWarnings("deprecation")
- final Logger global = Logger.global;
- global.setLogManager(manager);
-
- // Make sure the global logger will be registered in the
- // global manager's default contexts.
- manager.addLogger(global);
- manager.systemContext.addLocalLogger(global, false);
- manager.userContext.addLocalLogger(global, false);
-
- // We don't call readConfiguration() here, as we may be running
- // very early in the JVM startup sequence. Instead readConfiguration
- // will be called lazily in getLogManager().
- return null;
- }
- });
+ }
+ });
}
@@ -235,6 +214,7 @@
this.setContextClassLoader(null);
}
+ @Override
public void run() {
// This is to ensure the LogManager.<clinit> is completed
// before synchronized block. Otherwise deadlocks are possible.
@@ -271,12 +251,103 @@
}
/**
+ * Lazy initialization: if this instance of manager is the global
+ * manager then this method will read the initial configuration and
+ * add the root logger and global logger by calling addLogger().
+ *
+ * Note that it is subtly different from what we do in LoggerContext.
+ * In LoggerContext we're patching up the logger context tree in order to add
+ * the root and global logger *to the context tree*.
+ *
+ * For this to work, addLogger() must have already have been called
+ * once on the LogManager instance for the default logger being
+ * added.
+ *
+ * This is why ensureLogManagerInitialized() needs to be called before
+ * any logger is added to any logger context.
+ *
+ */
+ private boolean initializedCalled = false;
+ private volatile boolean initializationDone = false;
+ final void ensureLogManagerInitialized() {
+ final LogManager owner = this;
+ if (initializationDone || owner != manager) {
+ // we don't want to do this twice, and we don't want to do
+ // this on private manager instances.
+ return;
+ }
+
+ // Maybe another thread has called ensureLogManagerInitialized()
+ // before us and is still executing it. If so we will block until
+ // the log manager has finished initialized, then acquire the monitor,
+ // notice that initializationDone is now true and return.
+ // Otherwise - we have come here first! We will acquire the monitor,
+ // see that initializationDone is still false, and perform the
+ // initialization.
+ //
+ synchronized(this) {
+ // If initializedCalled is true it means that we're already in
+ // the process of initializing the LogManager in this thread.
+ // There has been a recursive call to ensureLogManagerInitialized().
+ final boolean isRecursiveInitialization = (initializedCalled == true);
+
+ assert initializedCalled || !initializationDone
+ : "Initialization can't be done if initialized has not been called!";
+
+ if (isRecursiveInitialization || initializationDone) {
+ // If isRecursiveInitialization is true it means that we're
+ // already in the process of initializing the LogManager in
+ // this thread. There has been a recursive call to
+ // ensureLogManagerInitialized(). We should not proceed as
+ // it would lead to infinite recursion.
+ //
+ // If initializationDone is true then it means the manager
+ // has finished initializing; just return: we're done.
+ return;
+ }
+ // Calling addLogger below will in turn call requiresDefaultLogger()
+ // which will call ensureLogManagerInitialized().
+ // We use initializedCalled to break the recursion.
+ initializedCalled = true;
+ try {
+ AccessController.doPrivileged(new PrivilegedAction<Object>() {
+ @Override
+ public Object run() {
+ assert rootLogger == null;
+ assert initializedCalled && !initializationDone;
+
+ // Read configuration.
+ owner.readPrimordialConfiguration();
+
+ // Create and retain Logger for the root of the namespace.
+ owner.rootLogger = owner.new RootLogger();
+ owner.addLogger(owner.rootLogger);
+
+ // Adding the global Logger.
+ // Do not call Logger.getGlobal() here as this might trigger
+ // subtle inter-dependency issues.
+ @SuppressWarnings("deprecation")
+ final Logger global = Logger.global;
+
+ // Make sure the global logger will be registered in the
+ // global manager
+ owner.addLogger(global);
+ return null;
+ }
+ });
+ } finally {
+ initializationDone = true;
+ }
+ }
+ }
+
+ /**
* Returns the global LogManager object.
* @return the global LogManager object
*/
public static LogManager getLogManager() {
if (manager != null) {
- manager.readPrimordialConfiguration();
+ manager.ensureLogManagerInitialized();
}
return manager;
}
@@ -295,6 +366,7 @@
try {
AccessController.doPrivileged(new PrivilegedExceptionAction<Void>() {
+ @Override
public Void run() throws Exception {
readConfiguration();
@@ -304,8 +376,7 @@
}
});
} catch (Exception ex) {
- // System.err.println("Can't read logging configuration:");
- // ex.printStackTrace();
+ assert false : "Exception raised while reading logging configuration: " + ex;
}
}
}
@@ -392,7 +463,7 @@
}
// LoggerContext maps from AppContext
- private static WeakHashMap<Object, LoggerContext> contextsMap = null;
+ private WeakHashMap<Object, LoggerContext> contextsMap = null;
// Returns the LoggerContext for the user code (i.e. application or AppContext).
// Loggers are isolated from each AppContext.
@@ -414,10 +485,7 @@
context = contextsMap.get(ecx);
if (context == null) {
// Create a new LoggerContext for the applet.
- // The new logger context has its requiresDefaultLoggers
- // flag set to true - so that these loggers will be
- // lazily added when the context is firt accessed.
- context = new LoggerContext(true);
+ context = new LoggerContext();
contextsMap.put(ecx, context);
}
}
@@ -427,9 +495,14 @@
return context != null ? context : userContext;
}
+ // The system context.
+ final LoggerContext getSystemContext() {
+ return systemContext;
+ }
+
private List<LoggerContext> contexts() {
List<LoggerContext> cxs = new ArrayList<>();
- cxs.add(systemContext);
+ cxs.add(getSystemContext());
cxs.add(getUserContext());
return cxs;
}
@@ -450,7 +523,7 @@
Logger result = getLogger(name);
if (result == null) {
// only allocate the new logger once
- Logger newLogger = new Logger(name, resourceBundleName, caller);
+ Logger newLogger = new Logger(name, resourceBundleName, caller, this);
do {
if (addLogger(newLogger)) {
// We successfully added the new Logger that we
@@ -477,7 +550,7 @@
Logger demandSystemLogger(String name, String resourceBundleName) {
// Add a system logger in the system context's namespace
- final Logger sysLogger = systemContext.demandLogger(name, resourceBundleName);
+ final Logger sysLogger = getSystemContext().demandLogger(name, resourceBundleName);
// Add the system logger to the LogManager's namespace if not exist
// so that there is only one single logger of the given name.
@@ -501,6 +574,7 @@
// if logger already exists but handlers not set
final Logger l = logger;
AccessController.doPrivileged(new PrivilegedAction<Void>() {
+ @Override
public Void run() {
for (Handler hdl : l.getHandlers()) {
sysLogger.addHandler(hdl);
@@ -519,24 +593,52 @@
// doesn't exist in the user context, it'll also be added to the user context.
// The user context is queried by the user code and all other loggers are
// added in the user context.
- static class LoggerContext {
+ class LoggerContext {
// Table of named Loggers that maps names to Loggers.
private final Hashtable<String,LoggerWeakRef> namedLoggers = new Hashtable<>();
// Tree of named Loggers
private final LogNode root;
- private final boolean requiresDefaultLoggers;
private LoggerContext() {
- this(false);
+ this.root = new LogNode(null, this);
+ }
+
+
+ // Tells whether default loggers are required in this context.
+ // If true, the default loggers will be lazily added.
+ final boolean requiresDefaultLoggers() {
+ final boolean requiresDefaultLoggers = (getOwner() == manager);
+ if (requiresDefaultLoggers) {
+ getOwner().ensureLogManagerInitialized();
+ }
+ return requiresDefaultLoggers;
}
- private LoggerContext(boolean requiresDefaultLoggers) {
- this.root = new LogNode(null, this);
- this.requiresDefaultLoggers = requiresDefaultLoggers;
+
+ // This context's LogManager.
+ final LogManager getOwner() {
+ return LogManager.this;
+ }
+
+ // This context owner's root logger, which if not null, and if
+ // the context requires default loggers, will be added to the context
+ // logger's tree.
+ final Logger getRootLogger() {
+ return getOwner().rootLogger;
+ }
+
+ // The global logger, which if not null, and if
+ // the context requires default loggers, will be added to the context
+ // logger's tree.
+ final Logger getGlobalLogger() {
+ @SuppressWarnings("deprecated") // avoids initialization cycles.
+ final Logger global = Logger.global;
+ return global;
}
Logger demandLogger(String name, String resourceBundleName) {
// a LogManager subclass may have its own implementation to add and
// get a Logger. So delegate to the LogManager to do the work.
- return manager.demandLogger(name, resourceBundleName, null);
+ final LogManager owner = getOwner();
+ return owner.demandLogger(name, resourceBundleName, null);
}
@@ -548,10 +650,10 @@
// or getLoggerNames()
//
private void ensureInitialized() {
- if (requiresDefaultLoggers) {
+ if (requiresDefaultLoggers()) {
// Ensure that the root and global loggers are set.
- ensureDefaultLogger(manager.rootLogger);
- ensureDefaultLogger(Logger.global);
+ ensureDefaultLogger(getRootLogger());
+ ensureDefaultLogger(getGlobalLogger());
}
}
@@ -580,13 +682,13 @@
// before adding 'logger'.
//
private void ensureAllDefaultLoggers(Logger logger) {
- if (requiresDefaultLoggers) {
+ if (requiresDefaultLoggers()) {
final String name = logger.getName();
if (!name.isEmpty()) {
- ensureDefaultLogger(manager.rootLogger);
- }
- if (!Logger.GLOBAL_LOGGER_NAME.equals(name)) {
- ensureDefaultLogger(Logger.global);
+ ensureDefaultLogger(getRootLogger());
+ if (!Logger.GLOBAL_LOGGER_NAME.equals(name)) {
+ ensureDefaultLogger(getGlobalLogger());
+ }
}
}
}
@@ -598,8 +700,8 @@
// This check is simple sanity: we do not want that this
// method be called for anything else than Logger.global
// or owner.rootLogger.
- if (!requiresDefaultLoggers || logger == null
- || logger != Logger.global && logger != manager.rootLogger) {
+ if (!requiresDefaultLoggers() || logger == null
+ || logger != Logger.global && logger != LogManager.this.rootLogger) {
// the case where we have a non null logger which is neither
// Logger.global nor manager.rootLogger indicates a serious
@@ -625,7 +727,7 @@
boolean addLocalLogger(Logger logger) {
// no need to add default loggers if it's not required
- return addLocalLogger(logger, requiresDefaultLoggers);
+ return addLocalLogger(logger, requiresDefaultLoggers());
}
// Add a logger to this context. This method will only set its level
@@ -663,11 +765,13 @@
// We're adding a new logger.
// Note that we are creating a weak reference here.
- ref = manager.new LoggerWeakRef(logger);
+ final LogManager owner = getOwner();
+ logger.setLogManager(owner);
+ ref = owner.new LoggerWeakRef(logger);
namedLoggers.put(name, ref);
// Apply any initial level defined for the new logger.
- Level level = manager.getLevelProperty(name + ".level", null);
+ Level level = owner.getLevelProperty(name + ".level", null);
if (level != null) {
doSetLevel(logger, level);
}
@@ -719,10 +823,12 @@
// If logger.getUseParentHandlers() returns 'true' and any of the logger's
// parents have levels or handlers defined, make sure they are instantiated.
private void processParentHandlers(final Logger logger, final String name) {
+ final LogManager owner = getOwner();
AccessController.doPrivileged(new PrivilegedAction<Void>() {
+ @Override
public Void run() {
- if (logger != manager.rootLogger) {
- boolean useParent = manager.getBooleanProperty(name + ".useParentHandlers", true);
+ if (logger != owner.rootLogger) {
+ boolean useParent = owner.getBooleanProperty(name + ".useParentHandlers", true);
if (!useParent) {
logger.setUseParentHandlers(false);
}
@@ -738,8 +844,8 @@
break;
}
String pname = name.substring(0, ix2);
- if (manager.getProperty(pname + ".level") != null ||
- manager.getProperty(pname + ".handlers") != null) {
+ if (owner.getProperty(pname + ".level") != null ||
+ owner.getProperty(pname + ".handlers") != null) {
// This pname has a level/handlers definition.
// Make sure it exists.
demandLogger(pname, null);
@@ -779,16 +885,17 @@
}
}
- static class SystemLoggerContext extends LoggerContext {
+ final class SystemLoggerContext extends LoggerContext {
// Add a system logger in the system context's namespace as well as
// in the LogManager's namespace if not exist so that there is only
// one single logger of the given name. System loggers are visible
// to applications unless a logger of the same name has been added.
+ @Override
Logger demandLogger(String name, String resourceBundleName) {
Logger result = findLogger(name);
if (result == null) {
// only allocate the new system logger once
- Logger newLogger = new Logger(name, resourceBundleName);
+ Logger newLogger = new Logger(name, resourceBundleName, null, getOwner());
do {
if (addLocalLogger(newLogger)) {
// We successfully added the new Logger that we
@@ -822,6 +929,7 @@
final String handlersPropertyName)
{
AccessController.doPrivileged(new PrivilegedAction<Object>() {
+ @Override
public Object run() {
String names[] = parseClassNames(handlersPropertyName);
for (int i = 0; i < names.length; i++) {
@@ -1014,6 +1122,7 @@
// There is a security manager. Raise privilege before
// calling setLevel.
AccessController.doPrivileged(new PrivilegedAction<Object>() {
+ @Override
public Object run() {
logger.setLevel(level);
return null;
@@ -1032,6 +1141,7 @@
// There is a security manager. Raise privilege before
// calling setParent.
AccessController.doPrivileged(new PrivilegedAction<Object>() {
+ @Override
public Object run() {
logger.setParent(parent);
return null;
@@ -1129,14 +1239,9 @@
f = new File(f, "logging.properties");
fname = f.getCanonicalPath();
}
- InputStream in = new FileInputStream(fname);
- BufferedInputStream bin = new BufferedInputStream(in);
- try {
+ try (final InputStream in = new FileInputStream(fname)) {
+ final BufferedInputStream bin = new BufferedInputStream(in);
readConfiguration(bin);
- } finally {
- if (in != null) {
- in.close();
- }
}
}
@@ -1201,7 +1306,7 @@
}
hands = hands.trim();
int ix = 0;
- Vector<String> result = new Vector<>();
+ final List<String> result = new ArrayList<>();
while (ix < hands.length()) {
int end = ix;
while (end < hands.length()) {
@@ -1471,28 +1576,35 @@
// We use a subclass of Logger for the root logger, so
// that we only instantiate the global handlers when they
// are first needed.
- private class RootLogger extends Logger {
+ private final class RootLogger extends Logger {
private RootLogger() {
- super("", null);
+ // We do not call the protected Logger two args constructor here,
+ // to avoid calling LogManager.getLogManager() from within the
+ // RootLogger constructor.
+ super("", null, null, LogManager.this);
setLevel(defaultLevel);
}
+ @Override
public void log(LogRecord record) {
// Make sure that the global handlers have been instantiated.
initializeGlobalHandlers();
super.log(record);
}
+ @Override
public void addHandler(Handler h) {
initializeGlobalHandlers();
super.addHandler(h);
}
+ @Override
public void removeHandler(Handler h) {
initializeGlobalHandlers();
super.removeHandler(h);
}
+ @Override
public Handler[] getHandlers() {
initializeGlobalHandlers();
return super.getHandlers();
--- a/jdk/src/share/classes/java/util/logging/Logger.java Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/src/share/classes/java/util/logging/Logger.java Wed Sep 11 10:35:31 2013 -0400
@@ -245,14 +245,26 @@
// 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 @@
* 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 @@
levelValue = Level.INFO.intValue();
}
- // It is called from the LogManager.<clinit> to complete
- // initialization of the global Logger.
+ // It is called from LoggerContext.addLocalLogger() when the logger
+ // is actually added to a LogManager.
void setLogManager(LogManager manager) {
this.manager = manager;
}
@@ -558,7 +570,7 @@
// 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 @@
if (parent == null) {
throw new NullPointerException();
}
- manager.checkPermission();
+ checkPermission();
doSetParent(parent);
}
--- a/jdk/src/share/classes/javax/net/ssl/SSLParameters.java Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/src/share/classes/javax/net/ssl/SSLParameters.java Wed Sep 11 10:35:31 2013 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -40,7 +40,7 @@
* 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 @@
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 @@
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;
+ }
}
--- a/jdk/src/share/classes/sun/security/ssl/Handshaker.java Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/src/share/classes/sun/security/ssl/Handshaker.java Wed Sep 11 10:35:31 2013 -0400
@@ -145,6 +145,14 @@
/* 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.
@@ -463,6 +471,13 @@
}
/**
+ * 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 @@
}
/**
- * 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 @@
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();
}
/**
--- a/jdk/src/share/classes/sun/security/ssl/SSLEngineImpl.java Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/src/share/classes/sun/security/ssl/SSLEngineImpl.java Wed Sep 11 10:35:31 2013 -0400
@@ -320,6 +320,12 @@
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
*/
private static final Debug debug = Debug.getInstance("ssl");
@@ -470,6 +476,7 @@
protocolVersion, connectionState == cs_HANDSHAKE,
secureRenegotiation, clientVerifyData, serverVerifyData);
handshaker.setSNIMatchers(sniMatchers);
+ handshaker.setUseCipherSuitesOrder(preferLocalCipherSuites);
} else {
handshaker = new ClientHandshaker(this, sslContext,
enabledProtocols,
@@ -2074,6 +2081,7 @@
params.setAlgorithmConstraints(algorithmConstraints);
params.setSNIMatchers(sniMatchers);
params.setServerNames(serverNames);
+ params.setUseCipherSuitesOrder(preferLocalCipherSuites);
return params;
}
@@ -2088,6 +2096,7 @@
// 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 @@
handshaker.setAlgorithmConstraints(algorithmConstraints);
if (roleIsServer) {
handshaker.setSNIMatchers(sniMatchers);
+ handshaker.setUseCipherSuitesOrder(preferLocalCipherSuites);
} else {
handshaker.setSNIServerNames(serverNames);
}
--- a/jdk/src/share/classes/sun/security/ssl/SSLServerSocketImpl.java Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/src/share/classes/sun/security/ssl/SSLServerSocketImpl.java Wed Sep 11 10:35:31 2013 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -92,6 +92,12 @@
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 @@
params.setEndpointIdentificationAlgorithm(identificationProtocol);
params.setAlgorithmConstraints(algorithmConstraints);
params.setSNIMatchers(sniMatchers);
+ params.setUseCipherSuitesOrder(preferLocalCipherSuites);
+
return params;
}
@@ -318,6 +326,7 @@
// 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 @@
SSLSocketImpl s = new SSLSocketImpl(sslContext, useServerMode,
enabledCipherSuites, doClientAuth, enableSessionCreation,
enabledProtocols, identificationProtocol, algorithmConstraints,
- sniMatchers);
+ sniMatchers, preferLocalCipherSuites);
implAccept(s);
s.doneConnect();
--- a/jdk/src/share/classes/sun/security/ssl/SSLSocketImpl.java Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/src/share/classes/sun/security/ssl/SSLSocketImpl.java Wed Sep 11 10:35:31 2013 -0400
@@ -377,6 +377,12 @@
*/
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 @@
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 @@
this.identificationProtocol = identificationProtocol;
this.algorithmConstraints = algorithmConstraints;
this.sniMatchers = sniMatchers;
+ this.preferLocalCipherSuites = preferLocalCipherSuites;
init(context, serverMode);
/*
@@ -1284,6 +1292,7 @@
protocolVersion, connectionState == cs_HANDSHAKE,
secureRenegotiation, clientVerifyData, serverVerifyData);
handshaker.setSNIMatchers(sniMatchers);
+ handshaker.setUseCipherSuitesOrder(preferLocalCipherSuites);
} else {
handshaker = new ClientHandshaker(this, sslContext,
enabledProtocols,
@@ -2502,6 +2511,7 @@
params.setAlgorithmConstraints(algorithmConstraints);
params.setSNIMatchers(sniMatchers);
params.setServerNames(serverNames);
+ params.setUseCipherSuitesOrder(preferLocalCipherSuites);
return params;
}
@@ -2516,6 +2526,7 @@
// 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 @@
handshaker.setAlgorithmConstraints(algorithmConstraints);
if (roleIsServer) {
handshaker.setSNIMatchers(sniMatchers);
+ handshaker.setUseCipherSuitesOrder(preferLocalCipherSuites);
} else {
handshaker.setSNIServerNames(serverNames);
}
--- a/jdk/src/share/classes/sun/security/ssl/ServerHandshaker.java Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/src/share/classes/sun/security/ssl/ServerHandshaker.java Wed Sep 11 10:35:31 2013 -0400
@@ -932,8 +932,18 @@
* 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 @@
}
return;
}
- fatalSE(Alerts.alert_handshake_failure,
- "no cipher suites in common");
+ fatalSE(Alerts.alert_handshake_failure, "no cipher suites in common");
}
/**
--- a/jdk/src/share/classes/sun/util/locale/provider/JRELocaleProviderAdapter.java Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/src/share/classes/sun/util/locale/provider/JRELocaleProviderAdapter.java Wed Sep 11 10:35:31 2013 -0400
@@ -361,7 +361,7 @@
while (tokens.hasMoreTokens()) {
String token = tokens.nextToken();
if (token.equals("|")) {
- if (isNonUSLangSupported()) {
+ if (isNonENLangSupported()) {
continue;
}
break;
@@ -398,7 +398,7 @@
*/
int barIndex = supportedLocaleString.indexOf('|');
StringTokenizer localeStringTokenizer;
- if (isNonUSLangSupported()) {
+ if (isNonENLangSupported()) {
localeStringTokenizer = new StringTokenizer(supportedLocaleString.substring(0, barIndex)
+ supportedLocaleString.substring(barIndex + 1));
} else {
@@ -427,17 +427,17 @@
return locales;
}
- private static volatile Boolean isNonUSSupported = null;
+ private static volatile Boolean isNonENSupported = 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 isNonUSLangSupported() {
- if (isNonUSSupported == null) {
+ private static boolean isNonENLangSupported() {
+ if (isNonENSupported == null) {
synchronized (JRELocaleProviderAdapter.class) {
- if (isNonUSSupported == null) {
+ if (isNonENSupported == null) {
final String sep = File.separator;
String localeDataJar =
java.security.AccessController.doPrivileged(
@@ -449,7 +449,7 @@
* localedata.jar is installed or not.
*/
final File f = new File(localeDataJar);
- isNonUSSupported =
+ isNonENSupported =
AccessController.doPrivileged(new PrivilegedAction<Boolean>() {
@Override
public Boolean run() {
@@ -459,6 +459,6 @@
}
}
}
- return isNonUSSupported;
+ return isNonENSupported;
}
}
--- a/jdk/src/share/classes/sun/util/locale/provider/LocaleDataMetaInfo-XLocales.java.template Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/src/share/classes/sun/util/locale/provider/LocaleDataMetaInfo-XLocales.java.template Wed Sep 11 10:35:31 2013 -0400
@@ -52,25 +52,25 @@
look up locale string such as "en" could be based on if it contains " en ".
*/
resourceNameToLocales.put("FormatData",
- " #FormatData_USLocales# | #FormatData_NonUSLocales# ");
+ " #FormatData_ENLocales# | #FormatData_NonENLocales# ");
resourceNameToLocales.put("CollationData",
- " #CollationData_USLocales# | #CollationData_NonUSLocales# ");
+ " #CollationData_ENLocales# | #CollationData_NonENLocales# ");
resourceNameToLocales.put("TimeZoneNames",
- " #TimeZoneNames_USLocales# | #TimeZoneNames_NonUSLocales# ");
+ " #TimeZoneNames_ENLocales# | #TimeZoneNames_NonENLocales# ");
resourceNameToLocales.put("LocaleNames",
- " #LocaleNames_USLocales# | #LocaleNames_NonUSLocales# ");
+ " #LocaleNames_ENLocales# | #LocaleNames_NonENLocales# ");
resourceNameToLocales.put("CurrencyNames",
- " #CurrencyNames_USLocales# | #CurrencyNames_NonUSLocales# ");
+ " #CurrencyNames_ENLocales# | #CurrencyNames_NonENLocales# ");
resourceNameToLocales.put("CalendarData",
- " #CalendarData_USLocales# | #CalendarData_NonUSLocales# ");
+ " #CalendarData_ENLocales# | #CalendarData_NonENLocales# ");
resourceNameToLocales.put("AvailableLocales",
- " #AvailableLocales_USLocales# | #AvailableLocales_NonUSLocales# ");
+ " #AvailableLocales_ENLocales# | #AvailableLocales_NonENLocales# ");
}
/*
--- a/jdk/src/share/classes/sun/util/locale/provider/LocaleResources.java Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/src/share/classes/sun/util/locale/provider/LocaleResources.java Wed Sep 11 10:35:31 2013 -0400
@@ -252,7 +252,7 @@
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);
--- a/jdk/src/windows/classes/sun/security/mscapi/Key.java Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/src/windows/classes/sun/security/mscapi/Key.java Wed Sep 11 10:35:31 2013 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -39,6 +39,7 @@
*/
abstract class Key implements java.security.Key, Length
{
+ private static final long serialVersionUID = -1088859394025049194L;
// Native handle
protected long hCryptProv = 0;
--- a/jdk/src/windows/native/java/net/NetworkInterface_winXP.c Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/src/windows/native/java/net/NetworkInterface_winXP.c Wed Sep 11 10:35:31 2013 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -82,7 +82,6 @@
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 @@
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 @@
//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 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 @@
* set the index to the IPv6 index and add the
* IPv6 addresses
*/
- nif->index = ptr->Ipv6IfIndex;
+ nif->ipv6Index = ptr->Ipv6IfIndex;
c = getAddrsFromAdapter(ptr, &nif->addrs);
nif->naddrs += c;
break;
@@ -309,6 +312,9 @@
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 @@
(*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.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/lang/Class/ArrayMethods.java Wed Sep 11 10:35:31 2013 -0400
@@ -0,0 +1,108 @@
+/*
+ * 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.");
+ }
+ }
+}
--- a/jdk/test/java/net/CookieHandler/LocalHostCookie.java Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/test/java/net/CookieHandler/LocalHostCookie.java Wed Sep 11 10:35:31 2013 -0400
@@ -72,7 +72,9 @@
}
}
} finally {
- s.stopServer();
+ if (s != null) {
+ s.stopServer();
+ }
}
}
@@ -96,7 +98,9 @@
}
public void stopServer() {
- server.stop(0);
+ if (server != null) {
+ server.stop(0);
+ }
}
}
--- a/jdk/test/java/net/NetworkInterface/Equals.java Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/test/java/net/NetworkInterface/Equals.java Wed Sep 11 10:35:31 2013 -0400
@@ -25,41 +25,83 @@
* @bug 7003398
* @run main/othervm Equals
*/
+
+import java.io.ByteArrayOutputStream;
+import java.io.PrintStream;
+import java.net.InetAddress;
import java.net.NetworkInterface;
-import java.net.InetAddress;
+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");
+ }
}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/net/NetworkInterface/UniqueMacAddressesTest.java Wed Sep 11 10:35:31 2013 -0400
@@ -0,0 +1,129 @@
+/*
+ * 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);
+ }
+ }
+ }
+}
--- a/jdk/test/java/nio/file/WatchService/SensitivityModifier.java Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/test/java/nio/file/WatchService/SensitivityModifier.java Wed Sep 11 10:35:31 2013 -0400
@@ -100,7 +100,7 @@
}
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) {
--- a/jdk/test/java/util/logging/Logger/getGlobal/TestGetGlobal.java Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/test/java/util/logging/Logger/getGlobal/TestGetGlobal.java Wed Sep 11 10:35:31 2013 -0400
@@ -57,6 +57,12 @@
}
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 @@
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);
}
}
}
--- a/jdk/test/java/util/logging/Logger/getGlobal/TestGetGlobalConcurrent.java Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/test/java/util/logging/Logger/getGlobal/TestGetGlobalConcurrent.java Wed Sep 11 10:35:31 2013 -0400
@@ -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.LogManagerImpl1 TestGetGlobalConcurrent
+ * @run main/othervm/timeout=10/policy=policy -Djava.security.manager -Djava.util.logging.manager=testgetglobal.LogManagerImpl1 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 @@
// 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 @@
// 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 @@
// 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 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 @@
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");
--- a/jdk/test/java/util/logging/Logger/getGlobal/policy Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/test/java/util/logging/Logger/getGlobal/policy Wed Sep 11 10:35:31 2013 -0400
@@ -1,6 +1,7 @@
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";
--- a/jdk/test/java/util/logging/ParentLoggersTest.java Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/test/java/util/logging/ParentLoggersTest.java Wed Sep 11 10:35:31 2013 -0400
@@ -29,7 +29,7 @@
* @author ss45998
*
* @build ParentLoggersTest
- * @run main/othervm ParentLoggersTest
+ * @run main ParentLoggersTest
*/
/*
--- a/jdk/test/java/util/logging/TestAppletLoggerContext.java Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/test/java/util/logging/TestAppletLoggerContext.java Wed Sep 11 10:35:31 2013 -0400
@@ -38,7 +38,7 @@
/*
* @test
- * @bug 8017174 8010727
+ * @bug 8017174 8010727 8019945
* @summary NPE when using Logger.getAnonymousLogger or
* LogManager.getLogManager().getLogger
*
@@ -432,45 +432,36 @@
assertNull(manager.getLogger(""));
assertNull(manager.getLogger(""));
- 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 however need to check our assumptions...
+ // 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
+ // Applet context => root logger and global logger should also be null.
- 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 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 = (System.getSecurityManager() != null
- ? LogManager.getLogManager().getLogger("")
- : null);
- assertEquals(logger5, expectedRoot);
- assertEquals(logger5b, expectedRoot);
+ Logger logger5 = manager.getLogger("");
+ Logger logger5b = manager.getLogger("");
+ Logger expectedRoot = null;
+ assertEquals(logger5, expectedRoot);
+ assertEquals(logger5b, expectedRoot);
+ }
}
}
@@ -511,57 +502,53 @@
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...
+ // 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
+ // Applet context => root logger and global logger should also be null.
- Logger logger5 = manager.getLogger("");
- Logger logger5b = manager.getLogger("");
- Logger expectedRoot = (System.getSecurityManager() != null
- ? LogManager.getLogManager().getLogger("")
- : root);
+ Logger logger5 = manager.getLogger("");
+ Logger logger5b = manager.getLogger("");
+ Logger expectedRoot = (System.getSecurityManager() == null ? root : null);
+ assertEquals(logger5, expectedRoot);
+ assertEquals(logger5b, expectedRoot);
- assertNotNull(logger5);
- assertNotNull(logger5b);
- assertEquals(logger5, expectedRoot);
- assertEquals(logger5b, expectedRoot);
- if (System.getSecurityManager() != null) {
- assertNotEquals(logger5, root);
- assertNotEquals(logger5b, root);
- }
+ 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); // 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 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);
- 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);
+ 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);
+ }
}
}
--- a/jdk/test/sun/security/krb5/runNameEquals.sh Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/test/sun/security/krb5/runNameEquals.sh Wed Sep 11 10:35:31 2013 -0400
@@ -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 @@
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=";"
--- a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLEngineImpl/CloseEngineException.java Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLEngineImpl/CloseEngineException.java Wed Sep 11 10:35:31 2013 -0400
@@ -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.*;
--- a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLEngineImpl/CloseInboundException.java Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLEngineImpl/CloseInboundException.java Wed Sep 11 10:35:31 2013 -0400
@@ -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
*/
--- a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLEngineImpl/CloseStart.java Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLEngineImpl/CloseStart.java Wed Sep 11 10:35:31 2013 -0400
@@ -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.*;
--- a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLEngineImpl/DelegatedTaskWrongException.java Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLEngineImpl/DelegatedTaskWrongException.java Wed Sep 11 10:35:31 2013 -0400
@@ -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.*;
--- a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLEngineImpl/EmptyExtensionData.java Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLEngineImpl/EmptyExtensionData.java Wed Sep 11 10:35:31 2013 -0400
@@ -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.*;
--- a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLEngineImpl/EngineEnforceUseClientMode.java Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLEngineImpl/EngineEnforceUseClientMode.java Wed Sep 11 10:35:31 2013 -0400
@@ -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
*/
--- a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLEngineImpl/RehandshakeFinished.java Wed Sep 11 10:16:21 2013 -0400
+++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLEngineImpl/RehandshakeFinished.java Wed Sep 11 10:35:31 2013 -0400
@@ -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
*/
/**
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/security/ssl/javax/net/ssl/SSLParameters/UseCipherSuitesOrder.java Wed Sep 11 10:35:31 2013 -0400
@@ -0,0 +1,357 @@
+/*
+ * 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;
+ }
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/util/locale/provider/Bug8024141.java Wed Sep 11 10:35:31 2013 -0400
@@ -0,0 +1,59 @@
+/*
+ * 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);
+ }
+ }
+ }
+}