1.1 --- a/.hgtags Tue Apr 19 16:01:27 2011 -0700
1.2 +++ b/.hgtags Tue Apr 26 15:48:03 2011 -0700
1.3 @@ -113,3 +113,4 @@
1.4 aa13e7702cd9d8aca9aa38f1227f966990866944 jdk7-b136
1.5 29296ea6529a418037ccce95903249665ef31c11 jdk7-b137
1.6 60d3d55dcc9c31a30ced9caa6ef5c0dcd7db031d jdk7-b138
1.7 +d80954a89b49fda47c0c5cace65a17f5a758b8bd jdk7-b139
2.1 --- a/make/com/sun/java/pack/Makefile Tue Apr 19 16:01:27 2011 -0700
2.2 +++ b/make/com/sun/java/pack/Makefile Tue Apr 26 15:48:03 2011 -0700
2.3 @@ -56,10 +56,6 @@
2.4
2.5 vpath %.cpp $(SHARE_SRC)/native/$(PKGDIR)
2.6
2.7 -
2.8 -
2.9 -
2.10 -
2.11 ifeq ($(STANDALONE),true)
2.12 ZIPOBJDIR = $(OUTPUTDIR)/tmp/sun/java.util.zip/zip/$(OBJDIRNAME)
2.13
2.14 @@ -131,8 +127,9 @@
2.15 pack200-tool:
2.16 $(call make-launcher, pack200, com.sun.java.util.jar.pack.Driver, , --pack)
2.17
2.18 +# ignore mapfile for non-product binary
2.19 unpacker:
2.20 - $(MAKE) $(UNPACK_EXE) STANDALONE=true LDMAPFLAGS_OPT= LDMAPFLAGS_DBG=
2.21 + $(MAKE) $(UNPACK_EXE) STANDALONE=true LDMAPFLAGS_DBG=
2.22
2.23 ifeq ($(PLATFORM), windows)
2.24 IMVERSIONVALUE=$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION).$(JDK_UPDATE_VER).$(COOKED_BUILD_NUMBER)
2.25 @@ -147,8 +144,14 @@
2.26 $(ECHO) "Resource files not required for Unix"
2.27 endif
2.28
2.29 +# Mapfile-vers.gmk, does not copy over the mapfile-vers-unpack200, when
2.30 +# the make utiliy is re-invoked, as in this case. In order to workaround
2.31 +# this special case, the mapfile required for the unpack200 command, is
2.32 +# explicitly copied over to the expected location.
2.33 $(UNPACK_EXE): $(UNPACK_EXE_FILES_o) updatefiles winres
2.34 $(prep-target)
2.35 + $(RM) $(TEMPDIR)/mapfile-vers
2.36 + $(CP) mapfile-vers-unpack200 $(TEMPDIR)/mapfile-vers
2.37 $(LINKER) $(LDDFLAGS) $(UNPACK_EXE_FILES_o) $(RES) $(LIBCXX) $(LDOUTPUT)$(TEMPDIR)/unpack200$(EXE_SUFFIX)
2.38 ifdef MT
2.39 $(MT) /manifest $(OBJDIR)/unpack200$(EXE_SUFFIX).manifest /outputresource:$(TEMPDIR)/unpack200$(EXE_SUFFIX);#1
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
3.2 +++ b/make/com/sun/java/pack/mapfile-vers-unpack200 Tue Apr 26 15:48:03 2011 -0700
3.3 @@ -0,0 +1,31 @@
3.4 +#
3.5 +# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
3.6 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3.7 +#
3.8 +# This code is free software; you can redistribute it and/or modify it
3.9 +# under the terms of the GNU General Public License version 2 only, as
3.10 +# published by the Free Software Foundation. Oracle designates this
3.11 +# particular file as subject to the "Classpath" exception as provided
3.12 +# by Oracle in the LICENSE file that accompanied this code.
3.13 +#
3.14 +# This code is distributed in the hope that it will be useful, but WITHOUT
3.15 +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3.16 +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
3.17 +# version 2 for more details (a copy is included in the LICENSE file that
3.18 +# accompanied this code).
3.19 +#
3.20 +# You should have received a copy of the GNU General Public License version
3.21 +# 2 along with this work; if not, write to the Free Software Foundation,
3.22 +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
3.23 +#
3.24 +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
3.25 +# or visit www.oracle.com if you need additional information or have any
3.26 +# questions.
3.27 +#
3.28 +
3.29 +# Define library interface.
3.30 +
3.31 +SUNWprivate_1.1 {
3.32 + local:
3.33 + *;
3.34 +};
4.1 --- a/make/common/Mapfile-vers.gmk Tue Apr 19 16:01:27 2011 -0700
4.2 +++ b/make/common/Mapfile-vers.gmk Tue Apr 26 15:48:03 2011 -0700
4.3 @@ -52,8 +52,8 @@
4.4 endif
4.5
4.6 # If we are re-ordering functions in this solaris library, we need to make
4.7 - # sure that -xF is added to the compile lines. This option is critical and
4.8 - # enables the functions to be reordered.
4.9 + # sure that -xF is added to the compile lines. This option is critical and
4.10 + # enables the functions to be reordered.
4.11 ifdef FILES_reorder
4.12 CFLAGS_OPT += -xF
4.13 CXXFLAGS_OPT += -xF
4.14 @@ -76,7 +76,6 @@
4.15
4.16 endif # PLATFORM
4.17
4.18 -
4.19 ifeq ($(PLATFORM), linux)
4.20
4.21 ifeq ($(VARIANT), OPT)
5.1 --- a/make/common/Program.gmk Tue Apr 19 16:01:27 2011 -0700
5.2 +++ b/make/common/Program.gmk Tue Apr 26 15:48:03 2011 -0700
5.3 @@ -55,6 +55,11 @@
5.4
5.5 program: $(ACTUAL_PROGRAM)
5.6
5.7 +# reuse the mapfiles in the launcher's directory, the same should
5.8 +# be applicable to the tool launchers as well.
5.9 +FILES_m = $(BUILDDIR)/java/main/java/mapfile-$(ARCH)
5.10 +include $(BUILDDIR)/common/Mapfile-vers.gmk
5.11 +
5.12 include $(JDK_TOPDIR)/make/common/Rules.gmk
5.13
5.14 ifdef NEVER_ACT_AS_SERVER_CLASS_MACHINE
6.1 --- a/make/common/Release.gmk Tue Apr 19 16:01:27 2011 -0700
6.2 +++ b/make/common/Release.gmk Tue Apr 26 15:48:03 2011 -0700
6.3 @@ -885,12 +885,18 @@
6.4 ABS_DB_PATH :=$(call FullPath,$(CLOSED_SHARE_SRC)/db)
6.5 DB_ZIP_LIST = $(shell $(LS) $(ABS_DB_PATH)/*.zip 2>/dev/null)
6.6
6.7 +# Java DB image. Move the Java DB demo directory into the JDK's demo
6.8 +# dir and in the process, rename it to db. Also remove index.html,
6.9 +# since it presumes docs are co-located. Also remove register.html (no
6.10 +# longer relevant).
6.11 initial-image-jdk-db: $(DB_ZIP_LIST)
6.12 $(MKDIR) -p $(JDK_IMAGE_DIR)/db
6.13 for d in $(DB_ZIP_LIST); do \
6.14 ($(CD) $(JDK_IMAGE_DIR)/db && $(UNZIP) -o $$d); \
6.15 done
6.16 -
6.17 + $(RM) -rf $(DEMODIR)/db
6.18 + $(MV) $(JDK_IMAGE_DIR)/db/demo $(DEMODIR)/db
6.19 + $(RM) $(JDK_IMAGE_DIR)/db/index.html $(JDK_IMAGE_DIR)/db/register.html
6.20 endif
6.21
6.22 # Standard jdk image
7.1 --- a/make/common/shared/Defs.gmk Tue Apr 19 16:01:27 2011 -0700
7.2 +++ b/make/common/shared/Defs.gmk Tue Apr 26 15:48:03 2011 -0700
7.3 @@ -218,11 +218,7 @@
7.4 else
7.5 LAUNCHER_NAME = java
7.6 PRODUCT_NAME = Java(TM)
7.7 - ifeq ($(J4B), true)
7.8 - PRODUCT_SUFFIX = SE Runtime Environment for Business
7.9 - else
7.10 - PRODUCT_SUFFIX = SE Runtime Environment
7.11 - endif
7.12 + PRODUCT_SUFFIX = SE Runtime Environment
7.13 JDK_RC_PLATFORM_NAME = Platform SE
7.14 COMPANY_NAME = Oracle Corporation
7.15 endif
8.1 --- a/make/docs/Makefile Tue Apr 19 16:01:27 2011 -0700
8.2 +++ b/make/docs/Makefile Tue Apr 26 15:48:03 2011 -0700
8.3 @@ -53,7 +53,7 @@
8.4 DEV_DOCS_URL = $(DEV_DOCS_URL-$(JDK_MINOR_VERSION))
8.5
8.6 # Url to Java Language Spec
8.7 -JLS3_URL = http://java.sun.com/docs/books/jls/
8.8 +#JLS3_URL = http://java.sun.com/docs/books/jls/
8.9
8.10 # Common Java trademark line
8.11 JAVA_TRADEMARK_LINE = Java is a trademark or registered trademark of \
8.12 @@ -293,8 +293,8 @@
8.13 <strong>Java$(TRADEMARK) Platform<br>Standard Ed. $(JDK_MINOR_VERSION)</strong>
8.14
8.15 # Java language specification cite
8.16 -TAG_JLS3 = jls3:a:See <cite><a href="$(JLS3_URL)"> \
8.17 -The Java Language Specification, Third Edition</a></cite>:
8.18 +TAG_JLS = jls:a:See <cite> \
8.19 +The Java™ Language Specification</cite>:
8.20
8.21 # Overview file for core apis
8.22 COREAPI_OVERVIEW = $(SHARE_SRC)/classes/overview-core.html
8.23 @@ -329,7 +329,7 @@
8.24 $(call OptionPair,-tag,specdefault:X) ; \
8.25 $(call OptionPair,-tag,Note:X) ; \
8.26 $(call OptionPair,-tag,ToDo:X) ; \
8.27 - $(call OptionPair,-tag,$(TAG_JLS3)) ; \
8.28 + $(call OptionPair,-tag,$(TAG_JLS)) ; \
8.29 $(call OptionOnly,-splitIndex) ; \
8.30 $(call OptionPair,-overview,$(COREAPI_OVERVIEW)) ; \
8.31 $(call OptionPair,-doctitle,$(COREAPI_DOCTITLE)) ; \
8.32 @@ -1081,6 +1081,7 @@
8.33 $(call OptionPair,-doctitle,$(TREEAPI_DOCTITLE)) ; \
8.34 $(call OptionPair,-windowtitle,$(TREEAPI_WINDOWTITLE) $(DRAFT_WINTITLE));\
8.35 $(call OptionPair,-header,$(TREEAPI_HEADER)$(DRAFT_HEADER)) ; \
8.36 + $(call OptionPair,-tag,$(TAG_JLS)) ; \
8.37 $(call OptionPair,-bottom,$(TREEAPI_BOTTOM)$(DRAFT_BOTTOM)) ; \
8.38 $(call OptionTrip,-group,$(TREEAPI_GROUPNAME),$(TREEAPI_REGEXP)); \
8.39 $(call OptionTrip,-linkoffline,$(TREEAPI2COREAPI),$(COREAPI_DOCSDIR)/); \
9.1 --- a/make/java/java/FILES_java.gmk Tue Apr 19 16:01:27 2011 -0700
9.2 +++ b/make/java/java/FILES_java.gmk Tue Apr 26 15:48:03 2011 -0700
9.3 @@ -189,7 +189,6 @@
9.4 java/util/ListResourceBundle.java \
9.5 sun/util/EmptyListResourceBundle.java \
9.6 java/util/Locale.java \
9.7 - sun/util/locale/AsciiUtil.java \
9.8 sun/util/locale/BaseLocale.java \
9.9 sun/util/locale/Extension.java \
9.10 sun/util/locale/InternalLocaleBuilder.java \
9.11 @@ -197,6 +196,7 @@
9.12 sun/util/locale/LocaleExtensions.java \
9.13 sun/util/locale/LocaleObjectCache.java \
9.14 sun/util/locale/LocaleSyntaxException.java \
9.15 + sun/util/locale/LocaleUtils.java \
9.16 sun/util/locale/ParseStatus.java \
9.17 sun/util/locale/StringTokenIterator.java \
9.18 sun/util/locale/UnicodeLocaleExtension.java \
10.1 --- a/make/java/main/java/Makefile Tue Apr 19 16:01:27 2011 -0700
10.2 +++ b/make/java/main/java/Makefile Tue Apr 26 15:48:03 2011 -0700
10.3 @@ -61,5 +61,4 @@
10.4
10.5 ifeq ($(PLATFORM), solaris)
10.6 LDFLAGS += -R$(OPENWIN_LIB)
10.7 -LDFLAGS += -M mapfile-$(ARCH)
10.8 endif
11.1 --- a/make/java/main/java/mapfile-amd64 Tue Apr 19 16:01:27 2011 -0700
11.2 +++ b/make/java/main/java/mapfile-amd64 Tue Apr 26 15:48:03 2011 -0700
11.3 @@ -1,5 +1,5 @@
11.4 #
11.5 -# Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
11.6 +# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
11.7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
11.8 #
11.9 # This code is free software; you can redistribute it and/or modify it
11.10 @@ -27,7 +27,7 @@
11.11 # interested in declaring a version, simply scoping the file is sufficient.
11.12 #
11.13
11.14 -{
11.15 +SUNWprivate_1.1 {
11.16 global:
11.17 main; # Provides basic adb symbol offsets
11.18 environ; # Public symbols and required by Java run time
12.1 --- a/make/java/main/java/mapfile-i586 Tue Apr 19 16:01:27 2011 -0700
12.2 +++ b/make/java/main/java/mapfile-i586 Tue Apr 26 15:48:03 2011 -0700
12.3 @@ -1,5 +1,5 @@
12.4 #
12.5 -# Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved.
12.6 +# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
12.7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
12.8 #
12.9 # This code is free software; you can redistribute it and/or modify it
12.10 @@ -27,7 +27,7 @@
12.11 # interested in declaring a version, simply scoping the file is sufficient.
12.12 #
12.13
12.14 -{
12.15 +SUNWprivate_1.1 {
12.16 global:
12.17 main; # Provides basic adb symbol offsets
12.18 environ; # Public symbols and required by Java run time
13.1 --- a/make/java/main/java/mapfile-sparc Tue Apr 19 16:01:27 2011 -0700
13.2 +++ b/make/java/main/java/mapfile-sparc Tue Apr 26 15:48:03 2011 -0700
13.3 @@ -1,5 +1,5 @@
13.4 #
13.5 -# Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
13.6 +# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
13.7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
13.8 #
13.9 # This code is free software; you can redistribute it and/or modify it
13.10 @@ -26,7 +26,7 @@
13.11 # interested in declaring a version, simply scoping the file is sufficient.
13.12 #
13.13
13.14 -{
13.15 +SUNWprivate_1.1 {
13.16 global:
13.17 main; # Provides basic adb symbol offsets
13.18 environ; # Public symbols and required by Java run time
14.1 --- a/make/java/main/java/mapfile-sparcv9 Tue Apr 19 16:01:27 2011 -0700
14.2 +++ b/make/java/main/java/mapfile-sparcv9 Tue Apr 26 15:48:03 2011 -0700
14.3 @@ -1,5 +1,5 @@
14.4 #
14.5 -# Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
14.6 +# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
14.7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
14.8 #
14.9 # This code is free software; you can redistribute it and/or modify it
14.10 @@ -28,7 +28,7 @@
14.11 # interested in declaring a version, simply scoping the file is sufficient.
14.12 #
14.13
14.14 -{
14.15 +SUNWprivate_1.1 {
14.16 global:
14.17 main; # Provides basic adb symbol offsets
14.18 environ; # Public symbols and required by Java run time
15.1 --- a/make/javax/crypto/Defs-jce.gmk Tue Apr 19 16:01:27 2011 -0700
15.2 +++ b/make/javax/crypto/Defs-jce.gmk Tue Apr 26 15:48:03 2011 -0700
15.3 @@ -58,7 +58,7 @@
15.4 SIGNING_KEY_DIR = /security/ws/JCE-signing/src
15.5 SIGNING_KEYSTORE = $(SIGNING_KEY_DIR)/KeyStore.jks
15.6 SIGNING_PASSPHRASE = $(SIGNING_KEY_DIR)/passphrase.txt
15.7 -SIGNING_ALIAS = jce_rsa
15.8 +SIGNING_ALIAS = oracle_jce_rsa
15.9
15.10 #
15.11 # Defines for signing the various jar files.
16.1 --- a/make/jpda/jdwp/jdwp.spec Tue Apr 19 16:01:27 2011 -0700
16.2 +++ b/make/jpda/jdwp/jdwp.spec Tue Apr 26 15:48:03 2011 -0700
16.3 @@ -519,9 +519,8 @@
16.4 "Both the JNI signature and the generic signature are "
16.5 "returned for each class. "
16.6 "Generic signatures are described in the signature attribute "
16.7 - "section in the "
16.8 - "<a href=\"http://java.sun.com/docs/books/vmspec\">
16.9 - "Java Virtual Machine Specification, 3rd Edition.</a> "
16.10 + "section in "
16.11 + "<cite>The Java™ Virtual Machine Specification</cite>. "
16.12 "Since JDWP version 1.5."
16.13 (Out
16.14 )
16.15 @@ -623,8 +622,8 @@
16.16 (referenceType refType "The reference type ID.")
16.17 )
16.18 (Reply
16.19 - (int modBits "Modifier bits as defined in the "
16.20 - "<a href=\"http://java.sun.com/docs/books/vmspec/html/ClassFile.doc.html\">VM Specification</a>")
16.21 + (int modBits "Modifier bits as defined in Chapter 4 of "
16.22 + "<cite>The Java™ Virtual Machine Specification</cite>")
16.23 )
16.24 (ErrorSet
16.25 (Error INVALID_CLASS "refType is not the ID of a reference "
16.26 @@ -651,8 +650,8 @@
16.27 (int modBits "The modifier bit flags (also known as access flags) "
16.28 "which provide additional information on the "
16.29 "field declaration. Individual flag values are "
16.30 - "defined in the "
16.31 - "<a href=\"http://java.sun.com/docs/books/vmspec/html/ClassFile.doc.html\">VM Specification</a>."
16.32 + "defined in Chapter 4 of "
16.33 + "<cite>The Java™ Virtual Machine Specification</cite>. "
16.34 "In addition, The <code>0xf0000000</code> bit identifies "
16.35 "the field as synthetic, if the synthetic attribute "
16.36 "<a href=\"#JDWP_VirtualMachine_Capabilities\">capability</a> is available.")
16.37 @@ -686,8 +685,8 @@
16.38 (int modBits "The modifier bit flags (also known as access flags) "
16.39 "which provide additional information on the "
16.40 "method declaration. Individual flag values are "
16.41 - "defined in the "
16.42 - "<a href=\"http://java.sun.com/docs/books/vmspec/html/ClassFile.doc.html\">VM Specification</a>."
16.43 + "defined in Chapter 4 of "
16.44 + "<cite>The Java™ Virtual Machine Specification</cite>. "
16.45 "In addition, The <code>0xf0000000</code> bit identifies "
16.46 "the method as synthetic, if the synthetic attribute "
16.47 "<a href=\"#JDWP_VirtualMachine_Capabilities\">capability</a> is available.")
16.48 @@ -773,8 +772,8 @@
16.49 (Command Status=9
16.50 "Returns the current status of the reference type. The status "
16.51 "indicates the extent to which the reference type has been "
16.52 - "initialized, as described in the "
16.53 - "<a href=\"http://java.sun.com/docs/books/vmspec/html/Concepts.doc.html#16491\">VM specification</a>. "
16.54 + "initialized, as described in section 2.1.6 of "
16.55 + "<cite>The Java™ Virtual Machine Specification</cite>. "
16.56 "If the class is linked the PREPARED and VERIFIED bits in the returned status bits "
16.57 "will be set. If the class is initialized the INITIALIZED bit in the returned "
16.58 "status bits will be set. If an error occured during initialization then the "
16.59 @@ -852,9 +851,8 @@
16.60 "Returns the JNI signature of a reference type along with the "
16.61 "generic signature if there is one. "
16.62 "Generic signatures are described in the signature attribute "
16.63 - "section in the "
16.64 - "<a href=\"http://java.sun.com/docs/books/vmspec\">
16.65 - "Java Virtual Machine Specification, 3rd Edition.</a> "
16.66 + "section in "
16.67 + "<cite>The Java™ Virtual Machine Specification</cite>. "
16.68 "Since JDWP version 1.5."
16.69 "<p>
16.70 (Out
16.71 @@ -882,9 +880,8 @@
16.72 "by the compiler. "
16.73 "Fields are returned in the order they occur in the class file. "
16.74 "Generic signatures are described in the signature attribute "
16.75 - "section in the "
16.76 - "<a href=\"http://java.sun.com/docs/books/vmspec\">
16.77 - "Java Virtual Machine Specification, 3rd Edition.</a> "
16.78 + "section in "
16.79 + "<cite>The Java™ Virtual Machine Specification</cite>. "
16.80 "Since JDWP version 1.5."
16.81 (Out
16.82 (referenceType refType "The reference type ID.")
16.83 @@ -900,8 +897,8 @@
16.84 (int modBits "The modifier bit flags (also known as access flags) "
16.85 "which provide additional information on the "
16.86 "field declaration. Individual flag values are "
16.87 - "defined in the "
16.88 - "<a href=\"http://java.sun.com/docs/books/vmspec/html/ClassFile.doc.html\">VM Specification</a>."
16.89 + "defined in Chapter 4 of "
16.90 + "<cite>The Java™ Virtual Machine Specification</cite>. "
16.91 "In addition, The <code>0xf0000000</code> bit identifies "
16.92 "the field as synthetic, if the synthetic attribute "
16.93 "<a href=\"#JDWP_VirtualMachine_Capabilities\">capability</a> is available.")
16.94 @@ -925,9 +922,8 @@
16.95 "if present, and any synthetic methods created by the compiler. "
16.96 "Methods are returned in the order they occur in the class file. "
16.97 "Generic signatures are described in the signature attribute "
16.98 - "section in the "
16.99 - "<a href=\"http://java.sun.com/docs/books/vmspec\">
16.100 - "Java Virtual Machine Specification, 3rd Edition.</a> "
16.101 + "section in "
16.102 + "<cite>The Java™ Virtual Machine Specification</cite>. "
16.103 "Since JDWP version 1.5."
16.104 (Out
16.105 (referenceType refType "The reference type ID.")
16.106 @@ -943,8 +939,8 @@
16.107 (int modBits "The modifier bit flags (also known as access flags) "
16.108 "which provide additional information on the "
16.109 "method declaration. Individual flag values are "
16.110 - "defined in the "
16.111 - "<a href=\"http://java.sun.com/docs/books/vmspec/html/ClassFile.doc.html\">VM Specification</a>."
16.112 + "defined in Chapter 4 of "
16.113 + "<cite>The Java™ Virtual Machine Specification</cite>. "
16.114 "In addition, The <code>0xf0000000</code> bit identifies "
16.115 "the method as synthetic, if the synthetic attribute "
16.116 "<a href=\"#JDWP_VirtualMachine_Capabilities\">capability</a> is available.")
16.117 @@ -1006,8 +1002,8 @@
16.118 )
16.119 (Command ConstantPool=18
16.120 "Return the raw bytes of the constant pool in the format of the "
16.121 - "constant_pool item of the Class File Format in the "
16.122 - "Java Virtual Machine Specification. "
16.123 + "constant_pool item of the Class File Format in "
16.124 + "<cite>The Java™ Virtual Machine Specification</cite>. "
16.125 "<p>Since JDWP version 1.6. Requires canGetConstantPool capability - see "
16.126 "<a href=\"#JDWP_VirtualMachine_CapabilitiesNew\">CapabilitiesNew</a>.""
16.127 (Out
16.128 @@ -1016,7 +1012,8 @@
16.129 (Reply
16.130 (int count "Total number of constant pool entries plus one. This "
16.131 "corresponds to the constant_pool_count item of the "
16.132 - "Class File Format in the Java Virtual Machine Specification. ")
16.133 + "Class File Format in "
16.134 + "<cite>The Java™ Virtual Machine Specification</cite>. ")
16.135 (Repeat bytes
16.136 (byte cpbytes "Raw bytes of constant pool")
16.137 )
16.138 @@ -1324,7 +1321,8 @@
16.139 )
16.140 )
16.141 (Command Bytecodes=3
16.142 - "Retrieve the method's bytecodes as defined in the JVM Specification."
16.143 + "Retrieve the method's bytecodes as defined in "
16.144 + "<cite>The Java™ Virtual Machine Specification</cite>. "
16.145 "Requires canGetBytecodes capability - see "
16.146 "<a href=\"#JDWP_VirtualMachine_CapabilitiesNew\">CapabilitiesNew</a>."
16.147 (Out
16.148 @@ -1379,9 +1377,8 @@
16.149 "instance methods, the \"this\" reference is included in the "
16.150 "table. Also, synthetic variables may be present. "
16.151 "Generic signatures are described in the signature attribute "
16.152 - "section in the "
16.153 - "<a href=\"http://java.sun.com/docs/books/vmspec\">
16.154 - "Java Virtual Machine Specification, 3rd Edition.</a> "
16.155 + "section in "
16.156 + "<cite>The Java™ Virtual Machine Specification</cite>. "
16.157 "Since JDWP version 1.5."
16.158 (Out
16.159 (referenceType refType "The class.")
16.160 @@ -1970,8 +1967,9 @@
16.161 "<p>"
16.162 "The method which will return early is referred to as the "
16.163 "called method. The called method is the current method (as "
16.164 - "defined by the Frames section in the Java Virtual Machine "
16.165 - "Specification) for the specified thread at the time this command "
16.166 + "defined by the Frames section in "
16.167 + "<cite>The Java™ Virtual Machine Specification</cite>) "
16.168 + "for the specified thread at the time this command "
16.169 "is received. "
16.170 "<p>"
16.171 "The specified thread must be suspended. "
17.1 --- a/make/mksample/Makefile Tue Apr 19 16:01:27 2011 -0700
17.2 +++ b/make/mksample/Makefile Tue Apr 26 15:48:03 2011 -0700
17.3 @@ -1,5 +1,5 @@
17.4 #
17.5 -# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
17.6 +# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
17.7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
17.8 #
17.9 # This code is free software; you can redistribute it and/or modify it
17.10 @@ -38,7 +38,7 @@
17.11 endif
17.12
17.13 SUBDIRS =
17.14 -SUBDIRS_misc = nio scripting nbproject
17.15 +SUBDIRS_misc = nio scripting nbproject forkjoin
17.16 SUBDIRS_enterprise = $(WEBSERVICES_SUBDIR)
17.17 SUBDIRS_management = jmx
17.18
18.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
18.2 +++ b/make/mksample/forkjoin/Makefile Tue Apr 26 15:48:03 2011 -0700
18.3 @@ -0,0 +1,41 @@
18.4 +#
18.5 +# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
18.6 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
18.7 +#
18.8 +# This code is free software; you can redistribute it and/or modify it
18.9 +# under the terms of the GNU General Public License version 2 only, as
18.10 +# published by the Free Software Foundation. Oracle designates this
18.11 +# particular file as subject to the "Classpath" exception as provided
18.12 +# by Oracle in the LICENSE file that accompanied this code.
18.13 +#
18.14 +# This code is distributed in the hope that it will be useful, but WITHOUT
18.15 +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18.16 +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18.17 +# version 2 for more details (a copy is included in the LICENSE file that
18.18 +# accompanied this code).
18.19 +#
18.20 +# You should have received a copy of the GNU General Public License version
18.21 +# 2 along with this work; if not, write to the Free Software Foundation,
18.22 +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18.23 +#
18.24 +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
18.25 +# or visit www.oracle.com if you need additional information or have any
18.26 +# questions.
18.27 +#
18.28 +
18.29 +#
18.30 +# Makefile for building all the samples under the forkjoin subdirectory.
18.31 +#
18.32 +
18.33 +BUILDDIR = ../..
18.34 +PRODUCT = java
18.35 +include $(BUILDDIR)/common/Defs.gmk
18.36 +
18.37 +SUBDIRS = mergesort
18.38 +include $(BUILDDIR)/common/Subdirs.gmk
18.39 +
18.40 +all build clean clobber::
18.41 + $(SUBDIRS-loop)
18.42 +
18.43 +clobber clean ::
18.44 + $(RM) -r $(SAMPLEDIR)/forkjoin
19.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
19.2 +++ b/make/mksample/forkjoin/mergesort/Makefile Tue Apr 26 15:48:03 2011 -0700
19.3 @@ -0,0 +1,51 @@
19.4 +#
19.5 +# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
19.6 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
19.7 +#
19.8 +# This code is free software; you can redistribute it and/or modify it
19.9 +# under the terms of the GNU General Public License version 2 only, as
19.10 +# published by the Free Software Foundation. Oracle designates this
19.11 +# particular file as subject to the "Classpath" exception as provided
19.12 +# by Oracle in the LICENSE file that accompanied this code.
19.13 +#
19.14 +# This code is distributed in the hope that it will be useful, but WITHOUT
19.15 +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
19.16 +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19.17 +# version 2 for more details (a copy is included in the LICENSE file that
19.18 +# accompanied this code).
19.19 +#
19.20 +# You should have received a copy of the GNU General Public License version
19.21 +# 2 along with this work; if not, write to the Free Software Foundation,
19.22 +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19.23 +#
19.24 +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
19.25 +# or visit www.oracle.com if you need additional information or have any
19.26 +# questions.
19.27 +#
19.28 +
19.29 +#
19.30 +# Makefile for the forkjoin/mergesort sample code
19.31 +#
19.32 +
19.33 +BUILDDIR = ../../..
19.34 +
19.35 +PRODUCT = java
19.36 +
19.37 +include $(BUILDDIR)/common/Defs.gmk
19.38 +
19.39 +SAMPLE_SRC_DIR = $(SHARE_SRC)/sample/forkjoin/mergesort
19.40 +SAMPLE_DST_DIR = $(SAMPLEDIR)/forkjoin/mergesort
19.41 +
19.42 +SAMPLE_FILES = \
19.43 + $(SAMPLE_DST_DIR)/MergeDemo.java \
19.44 + $(SAMPLE_DST_DIR)/MergeSort.java
19.45 +
19.46 +all build: $(SAMPLE_FILES)
19.47 +
19.48 +$(SAMPLE_DST_DIR)/%: $(SAMPLE_SRC_DIR)/%
19.49 + $(install-file)
19.50 +
19.51 +clean clobber:
19.52 + $(RM) -r $(SAMPLE_DST_DIR)
19.53 +
19.54 +.PHONY: all build clean clobber
20.1 --- a/make/mksample/nio/Makefile Tue Apr 19 16:01:27 2011 -0700
20.2 +++ b/make/mksample/nio/Makefile Tue Apr 26 15:48:03 2011 -0700
20.3 @@ -1,5 +1,5 @@
20.4 #
20.5 -# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
20.6 +# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
20.7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
20.8 #
20.9 # This code is free software; you can redistribute it and/or modify it
20.10 @@ -31,7 +31,7 @@
20.11 PRODUCT = java
20.12 include $(BUILDDIR)/common/Defs.gmk
20.13
20.14 -SUBDIRS = file multicast server
20.15 +SUBDIRS = chatserver file multicast server
20.16 include $(BUILDDIR)/common/Subdirs.gmk
20.17
20.18 all build clean clobber::
21.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
21.2 +++ b/make/mksample/nio/chatserver/Makefile Tue Apr 26 15:48:03 2011 -0700
21.3 @@ -0,0 +1,56 @@
21.4 +#
21.5 +# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
21.6 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
21.7 +#
21.8 +# This code is free software; you can redistribute it and/or modify it
21.9 +# under the terms of the GNU General Public License version 2 only, as
21.10 +# published by the Free Software Foundation. Oracle designates this
21.11 +# particular file as subject to the "Classpath" exception as provided
21.12 +# by Oracle in the LICENSE file that accompanied this code.
21.13 +#
21.14 +# This code is distributed in the hope that it will be useful, but WITHOUT
21.15 +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21.16 +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21.17 +# version 2 for more details (a copy is included in the LICENSE file that
21.18 +# accompanied this code).
21.19 +#
21.20 +# You should have received a copy of the GNU General Public License version
21.21 +# 2 along with this work; if not, write to the Free Software Foundation,
21.22 +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
21.23 +#
21.24 +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21.25 +# or visit www.oracle.com if you need additional information or have any
21.26 +# questions.
21.27 +#
21.28 +
21.29 +#
21.30 +# Makefile for the nio/chatserver sample code
21.31 +#
21.32 +
21.33 +BUILDDIR = ../../..
21.34 +
21.35 +PRODUCT = java
21.36 +
21.37 +include $(BUILDDIR)/common/Defs.gmk
21.38 +
21.39 +SAMPLE_SRC_DIR = $(SHARE_SRC)/sample/nio/chatserver
21.40 +SAMPLE_DST_DIR = $(SAMPLEDIR)/nio/chatserver
21.41 +
21.42 +SAMPLE_FILES = \
21.43 + $(SAMPLE_DST_DIR)/ChatServer.java \
21.44 + $(SAMPLE_DST_DIR)/Client.java \
21.45 + $(SAMPLE_DST_DIR)/ClientReader.java \
21.46 + $(SAMPLE_DST_DIR)/DataReader.java \
21.47 + $(SAMPLE_DST_DIR)/MessageReader.java \
21.48 + $(SAMPLE_DST_DIR)/NameReader.java \
21.49 + $(SAMPLE_DST_DIR)/README.txt
21.50 +
21.51 +all build: $(SAMPLE_FILES)
21.52 +
21.53 +$(SAMPLE_DST_DIR)/%: $(SAMPLE_SRC_DIR)/%
21.54 + $(install-file)
21.55 +
21.56 +clean clobber:
21.57 + $(RM) -r $(SAMPLE_DST_DIR)
21.58 +
21.59 +.PHONY: all build clean clobber
22.1 --- a/src/share/bin/jli_util.h Tue Apr 19 16:01:27 2011 -0700
22.2 +++ b/src/share/bin/jli_util.h Tue Apr 26 15:48:03 2011 -0700
22.3 @@ -1,5 +1,5 @@
22.4 /*
22.5 - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
22.6 + * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
22.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
22.8 *
22.9 * This code is free software; you can redistribute it and/or modify it
22.10 @@ -35,7 +35,6 @@
22.11 void JLI_MemFree(void *ptr);
22.12 int JLI_StrCCmp(const char *s1, const char* s2);
22.13
22.14 -
22.15 #define JLI_StrLen(p1) strlen((p1))
22.16 #define JLI_StrChr(p1, p2) strchr((p1), (p2))
22.17 #define JLI_StrRChr(p1, p2) strrchr((p1), (p2))
22.18 @@ -48,6 +47,7 @@
22.19 #define JLI_StrSpn(p1, p2) strspn((p1), (p2))
22.20 #define JLI_StrCSpn(p1, p2) strcspn((p1), (p2))
22.21 #define JLI_StrPBrk(p1, p2) strpbrk((p1), (p2))
22.22 +#define JLI_StrTok(p1, p2) strtok((p1), (p2))
22.23
22.24 /* On Windows lseek() is in io.h rather than the location dictated by POSIX. */
22.25 #ifdef _WIN32
23.1 --- a/src/share/classes/com/sun/beans/TypeResolver.java Tue Apr 19 16:01:27 2011 -0700
23.2 +++ b/src/share/classes/com/sun/beans/TypeResolver.java Tue Apr 26 15:48:03 2011 -0700
23.3 @@ -175,8 +175,8 @@
23.4 /**
23.5 * Converts the given {@code type} to the corresponding class.
23.6 * This method implements the concept of type erasure,
23.7 - * that is described in <a href="http://jscstage.sfbay.sun.com/docs/books/jls/third_edition/html/typesValues.html#4.6">section 4.6</a>
23.8 - * of Java Language Specification.
23.9 + * that is described in section 4.6 of
23.10 + * <cite>The Java™ Language Specification</cite>.
23.11 *
23.12 * @param type the array of types to convert
23.13 * @return a corresponding class
24.1 --- a/src/share/classes/com/sun/java/util/jar/pack/package.html Tue Apr 19 16:01:27 2011 -0700
24.2 +++ b/src/share/classes/com/sun/java/util/jar/pack/package.html Tue Apr 26 15:48:03 2011 -0700
24.3 @@ -88,8 +88,8 @@
24.4 http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html</a></li>
24.5
24.6 <li>
24.7 -Java Virtual Machine Specification : <a href="http://java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc.html">
24.8 -http://java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc.html</a></li>
24.9 +Class File Specification: Chapter 4 of
24.10 +<em>The Java™ Virtual Machine Specification</em>
24.11
24.12 <li>
24.13 Hypertext Transfer Protocol -- HTTP/1.1 : <a href="http://www.ietf.org/rfc/rfc2616.txt">
25.1 --- a/src/share/classes/com/sun/jdi/Accessible.java Tue Apr 19 16:01:27 2011 -0700
25.2 +++ b/src/share/classes/com/sun/jdi/Accessible.java Tue Apr 26 15:48:03 2011 -0700
25.3 @@ -42,12 +42,9 @@
25.4 * Returns the Java<sup><font size=-2>TM</font></sup>
25.5 * programming language modifiers, encoded in an integer.
25.6 * <p>
25.7 - * The modifier encodings are defined in the
25.8 - * <a href="http://java.sun.com/docs/books/vmspec/">Java Virtual Machine
25.9 - * Specification</a>, in the <code>access_flag</code> tables for
25.10 - * <a href="http://java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc.html#75734">classes</a>,
25.11 - * <a href="http://java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc.html#88358">fields</a>, and
25.12 - * <a href="http://java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc.html#75568">methods</a>.
25.13 + * The modifier encodings are defined in
25.14 + * <cite>The Java™ Virtual Machine Specification</cite>
25.15 + * in the <code>access_flag</code> tables for classes(section 4.1), fields(section 4.5), and methods(section 4.6).
25.16 */
25.17 public int modifiers();
25.18
26.1 --- a/src/share/classes/com/sun/jdi/ArrayType.java Tue Apr 19 16:01:27 2011 -0700
26.2 +++ b/src/share/classes/com/sun/jdi/ArrayType.java Tue Apr 26 15:48:03 2011 -0700
26.3 @@ -77,11 +77,9 @@
26.4 * as specified in the array declaration.
26.5 * <P>
26.6 * Note: The component type of a array will always be
26.7 - * created or loaded before the array - see the
26.8 - * <a href="http://java.sun.com/docs/books/vmspec/">Java Virtual
26.9 - * Machine Specification</a>, section
26.10 - * <a href="http://java.sun.com/docs/books/vmspec/2nd-edition/html/ConstantPool.doc.html#79473">5.3.3
26.11 - * Creating Array Classes</a>.
26.12 + * created or loaded before the array - see
26.13 + * <cite>The Java™ Virtual Machine Specification</cite>,
26.14 + * section 5.3.3 - Creating Array Classes.
26.15 * However, although the component type will be loaded it may
26.16 * not yet be prepared, in which case the type will be returned
26.17 * but attempts to perform some operations on the returned type
27.1 --- a/src/share/classes/com/sun/jdi/ClassLoaderReference.java Tue Apr 19 16:01:27 2011 -0700
27.2 +++ b/src/share/classes/com/sun/jdi/ClassLoaderReference.java Tue Apr 26 15:48:03 2011 -0700
27.3 @@ -71,11 +71,9 @@
27.4 * <p>
27.5 * No ordering of the returned list is guaranteed.
27.6 * <p>
27.7 - * See the revised
27.8 - * <a href="http://java.sun.com/docs/books/vmspec/">Java
27.9 - * Virtual Machine Specification</a> section
27.10 - * <a href="http://java.sun.com/docs/books/vmspec/2nd-edition/html/ConstantPool.doc.html#72007">5.3
27.11 - * Creation and Loading</a>
27.12 + * See
27.13 + * <cite>The Java™ Virtual Machine Specification</cite>,
27.14 + * section 5.3 - Creation and Loading
27.15 * for more information on the initiating classloader.
27.16 * <p>
27.17 * Note that unlike {@link #definedClasses()}
28.1 --- a/src/share/classes/com/sun/jdi/ClassNotLoadedException.java Tue Apr 19 16:01:27 2011 -0700
28.2 +++ b/src/share/classes/com/sun/jdi/ClassNotLoadedException.java Tue Apr 26 15:48:03 2011 -0700
28.3 @@ -60,9 +60,9 @@
28.4 * is visible to the class loader of enclosing class. (That is, the
28.5 * class loader of the enclosing class must be an <i>initiating</i> class
28.6 * loader for the class in question.)
28.7 - * See the <a href="http://java.sun.com/docs/books/vmspec/">Java
28.8 - * Virtual Machine Specification</a> for
28.9 - * more details.
28.10 + * See
28.11 + * <cite>The Java™ Virtual Machine Specification</cite>
28.12 + * for more details.
28.13 *
28.14 * @author Gordon Hirsch
28.15 * @since 1.3
29.1 --- a/src/share/classes/com/sun/jdi/ClassType.java Tue Apr 19 16:01:27 2011 -0700
29.2 +++ b/src/share/classes/com/sun/jdi/ClassType.java Tue Apr 26 15:48:03 2011 -0700
29.3 @@ -164,10 +164,8 @@
29.4 * component type is passed. The component type can be a primitive type.
29.5 * Autoboxing is not supported.
29.6 *
29.7 - * See the <a href="http://java.sun.com/docs/books/jls/">
29.8 - * Java Language Specification</a>.
29.9 - * section
29.10 - * <a href="http://java.sun.com/docs/books/jls/second_edition/html/conversions.doc.html#184206">5.2</a>
29.11 + * See Section 5.2 of
29.12 + * <cite>The Java™ Language Specification</cite>
29.13 * for more information on assignment compatibility.
29.14 * <p>
29.15 * By default, all threads in the target VM are resumed while
29.16 @@ -280,10 +278,8 @@
29.17 * component type is passed. The component type can be a primitive type.
29.18 * Autoboxing is not supported.
29.19 *
29.20 - * See the <a href="http://java.sun.com/docs/books/jls/">
29.21 - * Java Language Specification</a>.
29.22 - * section
29.23 - * <a href="http://java.sun.com/docs/books/jls/second_edition/html/conversions.doc.html#184206">5.2</a>
29.24 + * See section 5.2 of
29.25 + * <cite>The Java™ Language Specification</cite>
29.26 * for more information on assignment compatibility.
29.27 * <p>
29.28 * By default, all threads in the target VM are resumed while
30.1 --- a/src/share/classes/com/sun/jdi/LocalVariable.java Tue Apr 19 16:01:27 2011 -0700
30.2 +++ b/src/share/classes/com/sun/jdi/LocalVariable.java Tue Apr 26 15:48:03 2011 -0700
30.3 @@ -102,9 +102,7 @@
30.4 /**
30.5 * Gets the generic signature for this variable if there is one.
30.6 * Generic signatures are described in the
30.7 - * <a href="http://java.sun.com/docs/books/vmspec">
30.8 - * "Java<sup><font size=-2>TM</font></sup>
30.9 - * Virtual Machine Specification, 3rd Edition.</a>
30.10 + * <cite>The Java™ Virtual Machine Specification</cite>.
30.11 *
30.12 * @return a string containing the generic signature, or <code>null</code>
30.13 * if there is no generic signature.
31.1 --- a/src/share/classes/com/sun/jdi/Method.java Tue Apr 19 16:01:27 2011 -0700
31.2 +++ b/src/share/classes/com/sun/jdi/Method.java Tue Apr 26 15:48:03 2011 -0700
31.3 @@ -164,10 +164,8 @@
31.4
31.5 /**
31.6 * Determine if this method is a bridge method. Bridge
31.7 - * methods are defined in the
31.8 - * <a href="http://java.sun.com/docs/books/jls">
31.9 - * "Java<sup><font size=-2>TM</font></sup>
31.10 - * Language Specification, 3rd Edition.</a>
31.11 + * methods are defined in
31.12 + * <cite>The Java™ Language Specification</cite>.
31.13 *
31.14 * @return <code>true</code> if the method is a bridge method,
31.15 * false otherwise.
32.1 --- a/src/share/classes/com/sun/jdi/ObjectReference.java Tue Apr 19 16:01:27 2011 -0700
32.2 +++ b/src/share/classes/com/sun/jdi/ObjectReference.java Tue Apr 26 15:48:03 2011 -0700
32.3 @@ -118,10 +118,8 @@
32.4 * enclosing class's class loader). Primitive values must be
32.5 * either assignment compatible with the field type or must be
32.6 * convertible to the field type without loss of information.
32.7 - * See the <a href="http://java.sun.com/docs/books/jls/">
32.8 - * Java<sup><font size=-2>TM</font></sup> Language Specification</a>.
32.9 - * section
32.10 - * <a href="http://java.sun.com/docs/books/jls/second_edition/html/conversions.doc.html#184206">5.2</a>
32.11 + * See section 5.2 of
32.12 + * <cite>The Java™ Language Specification</cite>
32.13 * for more information on assignment
32.14 * compatibility.
32.15 *
32.16 @@ -182,18 +180,13 @@
32.17 * component type is passed. The component type can be a primitive type.
32.18 * Autoboxing is not supported.
32.19 *
32.20 - * See the <a href="http://java.sun.com/docs/books/jls/">
32.21 - * Java Language Specification</a>.
32.22 - * section
32.23 - * <a href="http://java.sun.com/docs/books/jls/second_edition/html/conversions.doc.html#184206">5.2</a>
32.24 + * See section 5.2 of
32.25 + * <cite>The Java™ Language Specification</cite>
32.26 * for more information on assignment compatibility.
32.27 * <p>
32.28 * By default, the method is invoked using dynamic lookup as
32.29 - * documented in the
32.30 - * <a href="http://java.sun.com/docs/books/jls/">
32.31 - * Java Language Specification</a>
32.32 - * second edition, section
32.33 - * <a href="http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#45606">15.12.4.4</a>;
32.34 + * documented in section 15.12.4.4 of
32.35 + * <cite>The Java™ Language Specification</cite>
32.36 * in particular, overriding based on the runtime type of the object
32.37 * mirrored by this {@link ObjectReference} will occur. This
32.38 * behavior can be changed by specifying the
33.1 --- a/src/share/classes/com/sun/jdi/ReferenceType.java Tue Apr 19 16:01:27 2011 -0700
33.2 +++ b/src/share/classes/com/sun/jdi/ReferenceType.java Tue Apr 26 15:48:03 2011 -0700
33.3 @@ -30,9 +30,8 @@
33.4
33.5 /**
33.6 * The type of an object in a target VM. ReferenceType encompasses
33.7 - * classes, interfaces, and array types as defined in the
33.8 - * <a href="http://java.sun.com/docs/books/jls/">
33.9 - * Java<sup><font size=-2>TM</font></sup> Language Specification</a>.
33.10 + * classes, interfaces, and array types as defined in
33.11 + * <cite>The Java™ Language Specification</cite>.
33.12 * All ReferenceType objects belong to one of the following
33.13 * subinterfaces:
33.14 * {@link ClassType} for classes,
33.15 @@ -98,9 +97,7 @@
33.16 /**
33.17 * Gets the generic signature for this type if there is one.
33.18 * Generic signatures are described in the
33.19 - * <a href="http://java.sun.com/docs/books/vmspec">
33.20 - * "Java<sup><font size=-2>TM</font></sup>
33.21 - * Virtual Machine Specification, 3rd Edition.</a>
33.22 + * <cite>The Java™ Virtual Machine Specification</cite>.
33.23 *
33.24 * @return a string containing the generic signature, or <code>null</code>
33.25 * if there is no generic signature.
34.1 --- a/src/share/classes/com/sun/jdi/TypeComponent.java Tue Apr 19 16:01:27 2011 -0700
34.2 +++ b/src/share/classes/com/sun/jdi/TypeComponent.java Tue Apr 26 15:48:03 2011 -0700
34.3 @@ -74,9 +74,7 @@
34.4 /**
34.5 * Gets the generic signature for this TypeComponent if there is one.
34.6 * Generic signatures are described in the
34.7 - * <a href="http://java.sun.com/docs/books/vmspec">
34.8 - * "Java<sup><font size=-2>TM</font></sup>
34.9 - * Virtual Machine Specification, 3rd Edition.</a>
34.10 + * <cite>The Java™ Virtual Machine Specification</cite>.
34.11 *
34.12 * @return a string containing the generic signature, or <code>null</code>
34.13 * if there is no generic signature.
35.1 --- a/src/share/classes/com/sun/media/sound/DLSInstrument.java Tue Apr 19 16:01:27 2011 -0700
35.2 +++ b/src/share/classes/com/sun/media/sound/DLSInstrument.java Tue Apr 26 15:48:03 2011 -0700
35.3 @@ -25,6 +25,7 @@
35.4 package com.sun.media.sound;
35.5
35.6 import java.util.ArrayList;
35.7 +import java.util.Arrays;
35.8 import java.util.HashMap;
35.9 import java.util.List;
35.10 import java.util.Map;
35.11 @@ -439,10 +440,10 @@
35.12 }
35.13
35.14 public byte[] getGuid() {
35.15 - return guid;
35.16 + return guid == null ? null : Arrays.copyOf(guid, guid.length);
35.17 }
35.18
35.19 public void setGuid(byte[] guid) {
35.20 - this.guid = guid;
35.21 + this.guid = guid == null ? null : Arrays.copyOf(guid, guid.length);
35.22 }
35.23 }
36.1 --- a/src/share/classes/com/sun/media/sound/DLSSample.java Tue Apr 19 16:01:27 2011 -0700
36.2 +++ b/src/share/classes/com/sun/media/sound/DLSSample.java Tue Apr 26 15:48:03 2011 -0700
36.3 @@ -25,6 +25,7 @@
36.4 package com.sun.media.sound;
36.5
36.6 import java.io.InputStream;
36.7 +import java.util.Arrays;
36.8 import javax.sound.midi.Soundbank;
36.9 import javax.sound.midi.SoundbankResource;
36.10 import javax.sound.sampled.AudioFormat;
36.11 @@ -113,10 +114,10 @@
36.12 }
36.13
36.14 public byte[] getGuid() {
36.15 - return guid;
36.16 + return guid == null ? null : Arrays.copyOf(guid, guid.length);
36.17 }
36.18
36.19 public void setGuid(byte[] guid) {
36.20 - this.guid = guid;
36.21 + this.guid = guid == null ? null : Arrays.copyOf(guid, guid.length);
36.22 }
36.23 }
37.1 --- a/src/share/classes/com/sun/media/sound/ModelConnectionBlock.java Tue Apr 19 16:01:27 2011 -0700
37.2 +++ b/src/share/classes/com/sun/media/sound/ModelConnectionBlock.java Tue Apr 26 15:48:03 2011 -0700
37.3 @@ -24,6 +24,8 @@
37.4 */
37.5 package com.sun.media.sound;
37.6
37.7 +import java.util.Arrays;
37.8 +
37.9 /**
37.10 * Connection blocks are used to connect source variable
37.11 * to a destination variable.
37.12 @@ -117,19 +119,17 @@
37.13 }
37.14
37.15 public ModelSource[] getSources() {
37.16 - return sources;
37.17 + return Arrays.copyOf(sources, sources.length);
37.18 }
37.19
37.20 public void setSources(ModelSource[] source) {
37.21 - this.sources = source;
37.22 + this.sources = source == null ? no_sources : Arrays.copyOf(source, source.length);
37.23 }
37.24
37.25 public void addSource(ModelSource source) {
37.26 ModelSource[] oldsources = sources;
37.27 sources = new ModelSource[oldsources.length + 1];
37.28 - for (int i = 0; i < oldsources.length; i++) {
37.29 - sources[i] = oldsources[i];
37.30 - }
37.31 + System.arraycopy(oldsources, 0, sources, 0, oldsources.length);
37.32 sources[sources.length - 1] = source;
37.33 }
37.34 }
38.1 --- a/src/share/classes/com/sun/media/sound/SoftChannel.java Tue Apr 19 16:01:27 2011 -0700
38.2 +++ b/src/share/classes/com/sun/media/sound/SoftChannel.java Tue Apr 26 15:48:03 2011 -0700
38.3 @@ -503,7 +503,7 @@
38.4 firstVoice = true;
38.5 voiceNo = 0;
38.6
38.7 - int tunedKey = (int)(Math.round(tuning.getTuning()[noteNumber]/100.0));
38.8 + int tunedKey = (int)(Math.round(tuning.getTuning(noteNumber)/100.0));
38.9 play_noteNumber = noteNumber;
38.10 play_velocity = velocity;
38.11 play_delay = delay;
38.12 @@ -607,7 +607,7 @@
38.13 firstVoice = true;
38.14 voiceNo = 0;
38.15
38.16 - int tunedKey = (int)(Math.round(tuning.getTuning()[noteNumber]/100.0));
38.17 + int tunedKey = (int)(Math.round(tuning.getTuning(noteNumber)/100.0));
38.18 play_noteNumber = noteNumber;
38.19 play_velocity = lastVelocity[noteNumber];
38.20 play_releasetriggered = true;
38.21 @@ -632,7 +632,7 @@
38.22 int delay = play_delay;
38.23 boolean releasetriggered = play_releasetriggered;
38.24
38.25 - SoftPerformer p = current_instrument.getPerformers()[performerIndex];
38.26 + SoftPerformer p = current_instrument.getPerformer(performerIndex);
38.27
38.28 if (firstVoice) {
38.29 firstVoice = false;
39.1 --- a/src/share/classes/com/sun/media/sound/SoftInstrument.java Tue Apr 19 16:01:27 2011 -0700
39.2 +++ b/src/share/classes/com/sun/media/sound/SoftInstrument.java Tue Apr 26 15:48:03 2011 -0700
39.3 @@ -76,7 +76,12 @@
39.4 return data;
39.5 }
39.6
39.7 + /* am: currently getPerformers() is not used (replaced with getPerformer(int))
39.8 public SoftPerformer[] getPerformers() {
39.9 return performers;
39.10 }
39.11 + */
39.12 + public SoftPerformer getPerformer(int index) {
39.13 + return performers[index];
39.14 + }
39.15 }
40.1 --- a/src/share/classes/com/sun/media/sound/SoftMixingDataLine.java Tue Apr 19 16:01:27 2011 -0700
40.2 +++ b/src/share/classes/com/sun/media/sound/SoftMixingDataLine.java Tue Apr 26 15:48:03 2011 -0700
40.3 @@ -505,7 +505,7 @@
40.4 }
40.5
40.6 public Control[] getControls() {
40.7 - return controls;
40.8 + return Arrays.copyOf(controls, controls.length);
40.9 }
40.10
40.11 public boolean isControlSupported(Type control) {
41.1 --- a/src/share/classes/com/sun/media/sound/SoftProvider.java Tue Apr 19 16:01:27 2011 -0700
41.2 +++ b/src/share/classes/com/sun/media/sound/SoftProvider.java Tue Apr 26 15:48:03 2011 -0700
41.3 @@ -24,6 +24,7 @@
41.4 */
41.5 package com.sun.media.sound;
41.6
41.7 +import java.util.Arrays;
41.8 import javax.sound.midi.MidiDevice;
41.9 import javax.sound.midi.MidiDevice.Info;
41.10 import javax.sound.midi.spi.MidiDeviceProvider;
41.11 @@ -39,7 +40,7 @@
41.12 private static Info[] softinfos = {softinfo};
41.13
41.14 public MidiDevice.Info[] getDeviceInfo() {
41.15 - return softinfos;
41.16 + return Arrays.copyOf(softinfos, softinfos.length);
41.17 }
41.18
41.19 public MidiDevice getDevice(MidiDevice.Info info) {
42.1 --- a/src/share/classes/com/sun/media/sound/SoftTuning.java Tue Apr 19 16:01:27 2011 -0700
42.2 +++ b/src/share/classes/com/sun/media/sound/SoftTuning.java Tue Apr 26 15:48:03 2011 -0700
42.3 @@ -25,6 +25,7 @@
42.4 package com.sun.media.sound;
42.5
42.6 import java.io.UnsupportedEncodingException;
42.7 +import java.util.Arrays;
42.8
42.9 import javax.sound.midi.Patch;
42.10
42.11 @@ -234,8 +235,10 @@
42.12 }
42.13 }
42.14
42.15 + // am: getTuning(int) is more effective.
42.16 + // currently getTuning() is used only by tests
42.17 public double[] getTuning() {
42.18 - return tuning;
42.19 + return Arrays.copyOf(tuning, tuning.length);
42.20 }
42.21
42.22 public double getTuning(int noteNumber) {
43.1 --- a/src/share/classes/com/sun/rowset/CachedRowSetImpl.java Tue Apr 19 16:01:27 2011 -0700
43.2 +++ b/src/share/classes/com/sun/rowset/CachedRowSetImpl.java Tue Apr 26 15:48:03 2011 -0700
43.3 @@ -1,5 +1,5 @@
43.4 /*
43.5 - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
43.6 + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
43.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
43.8 *
43.9 * This code is free software; you can redistribute it and/or modify it
43.10 @@ -111,13 +111,13 @@
43.11 */
43.12 private String tableName;
43.13
43.14 -
43.15 /**
43.16 * A <code>Vector</code> object containing the <code>Row</code>
43.17 * objects that comprise this <code>CachedRowSetImpl</code> object.
43.18 * @serial
43.19 */
43.20 - private Vector rvh;
43.21 + private Vector<Object> rvh;
43.22 +
43.23 /**
43.24 * The current postion of the cursor in this <code>CachedRowSetImpl</code>
43.25 * object.
43.26 @@ -293,12 +293,12 @@
43.27 /**
43.28 * The Vector holding the Match Columns
43.29 */
43.30 - private Vector iMatchColumns;
43.31 + private Vector<Integer> iMatchColumns;
43.32
43.33 /**
43.34 * The Vector that will hold the Match Column names.
43.35 */
43.36 - private Vector strMatchColumns;
43.37 + private Vector<String> strMatchColumns;
43.38
43.39 /**
43.40 * Trigger that indicates whether the active SyncProvider is exposes the
43.41 @@ -484,7 +484,7 @@
43.42 */
43.43 private void initContainer() {
43.44
43.45 - rvh = new Vector(100);
43.46 + rvh = new Vector<Object>(100);
43.47 cursorPos = 0;
43.48 absolutePos = 0;
43.49 numRows = 0;
43.50 @@ -523,12 +523,12 @@
43.51
43.52 //Instantiating the vector for MatchColumns
43.53
43.54 - iMatchColumns = new Vector(10);
43.55 + iMatchColumns = new Vector<Integer>(10);
43.56 for(int i = 0; i < 10 ; i++) {
43.57 iMatchColumns.add(i,Integer.valueOf(-1));
43.58 }
43.59
43.60 - strMatchColumns = new Vector(10);
43.61 + strMatchColumns = new Vector<String>(10);
43.62 for(int j = 0; j < 10; j++) {
43.63 strMatchColumns.add(j,null);
43.64 }
43.65 @@ -622,7 +622,7 @@
43.66 Row currentRow;
43.67 int numCols;
43.68 int i;
43.69 - Map map = getTypeMap();
43.70 + Map<String, Class<?>> map = getTypeMap();
43.71 Object obj;
43.72 int mRows;
43.73
43.74 @@ -939,14 +939,9 @@
43.75 */
43.76 public void acceptChanges(Connection con) throws SyncProviderException{
43.77
43.78 - try{
43.79 - setConnection(con);
43.80 - acceptChanges();
43.81 - } catch (SyncProviderException spe) {
43.82 - throw spe;
43.83 - } catch(SQLException sqle){
43.84 - throw new SyncProviderException(sqle.getMessage());
43.85 - }
43.86 + setConnection(con);
43.87 + acceptChanges();
43.88 +
43.89 }
43.90
43.91 /**
43.92 @@ -1289,14 +1284,7 @@
43.93 */
43.94 public Collection<?> toCollection() throws SQLException {
43.95
43.96 - TreeMap tMap;
43.97 - int count = 0;
43.98 - Row origRow;
43.99 - Vector newRow;
43.100 -
43.101 - int colCount = ((RowSetMetaDataImpl)this.getMetaData()).getColumnCount();
43.102 -
43.103 - tMap = new TreeMap();
43.104 + TreeMap<Integer, Object> tMap = new TreeMap<>();
43.105
43.106 for (int i = 0; i<numRows; i++) {
43.107 tMap.put(Integer.valueOf(i), rvh.get(i));
43.108 @@ -1325,10 +1313,8 @@
43.109 */
43.110 public Collection<?> toCollection(int column) throws SQLException {
43.111
43.112 - Vector vec;
43.113 - Row origRow;
43.114 int nRows = numRows;
43.115 - vec = new Vector(nRows);
43.116 + Vector<Object> vec = new Vector<>(nRows);
43.117
43.118 // create a copy
43.119 CachedRowSetImpl crsTemp;
43.120 @@ -2953,7 +2939,7 @@
43.121 */
43.122 public Object getObject(int columnIndex) throws SQLException {
43.123 Object value;
43.124 - java.util.Map map;
43.125 + Map<String, Class<?>> map;
43.126
43.127 // sanity check.
43.128 checkIndex(columnIndex);
43.129 @@ -7257,7 +7243,7 @@
43.130 Row currentRow;
43.131 int numCols;
43.132 int i;
43.133 - Map map = getTypeMap();
43.134 + Map<String, Class<?>> map = getTypeMap();
43.135 Object obj;
43.136 int mRows;
43.137
43.138 @@ -7304,11 +7290,11 @@
43.139 resultSet.absolute(start -1);
43.140 }
43.141 if( pageSize == 0) {
43.142 - rvh = new Vector(getMaxRows());
43.143 + rvh = new Vector<Object>(getMaxRows());
43.144
43.145 }
43.146 else{
43.147 - rvh = new Vector(getPageSize());
43.148 + rvh = new Vector<Object>(getPageSize());
43.149 }
43.150
43.151 if (data == null) {
44.1 --- a/src/share/classes/com/sun/rowset/JdbcRowSetImpl.java Tue Apr 19 16:01:27 2011 -0700
44.2 +++ b/src/share/classes/com/sun/rowset/JdbcRowSetImpl.java Tue Apr 26 15:48:03 2011 -0700
44.3 @@ -1,5 +1,5 @@
44.4 /*
44.5 - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
44.6 + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
44.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44.8 *
44.9 * This code is free software; you can redistribute it and/or modify it
44.10 @@ -93,12 +93,12 @@
44.11 /**
44.12 * The Vector holding the Match Columns
44.13 */
44.14 - private Vector iMatchColumns;
44.15 + private Vector<Integer> iMatchColumns;
44.16
44.17 /**
44.18 * The Vector that will hold the Match Column names.
44.19 */
44.20 - private Vector strMatchColumns;
44.21 + private Vector<String> strMatchColumns;
44.22
44.23
44.24 protected transient JdbcRowSetResourceBundle resBundle;
44.25 @@ -213,12 +213,12 @@
44.26
44.27 //Instantiating the vector for MatchColumns
44.28
44.29 - iMatchColumns = new Vector(10);
44.30 + iMatchColumns = new Vector<Integer>(10);
44.31 for(int i = 0; i < 10 ; i++) {
44.32 iMatchColumns.add(i,Integer.valueOf(-1));
44.33 }
44.34
44.35 - strMatchColumns = new Vector(10);
44.36 + strMatchColumns = new Vector<String>(10);
44.37 for(int j = 0; j < 10; j++) {
44.38 strMatchColumns.add(j,null);
44.39 }
44.40 @@ -286,12 +286,12 @@
44.41
44.42 //Instantiating the vector for MatchColumns
44.43
44.44 - iMatchColumns = new Vector(10);
44.45 + iMatchColumns = new Vector<Integer>(10);
44.46 for(int i = 0; i < 10 ; i++) {
44.47 iMatchColumns.add(i,Integer.valueOf(-1));
44.48 }
44.49
44.50 - strMatchColumns = new Vector(10);
44.51 + strMatchColumns = new Vector<String>(10);
44.52 for(int j = 0; j < 10; j++) {
44.53 strMatchColumns.add(j,null);
44.54 }
44.55 @@ -373,12 +373,12 @@
44.56
44.57 //Instantiating the vector for MatchColumns
44.58
44.59 - iMatchColumns = new Vector(10);
44.60 + iMatchColumns = new Vector<Integer>(10);
44.61 for(int i = 0; i < 10 ; i++) {
44.62 iMatchColumns.add(i,Integer.valueOf(-1));
44.63 }
44.64
44.65 - strMatchColumns = new Vector(10);
44.66 + strMatchColumns = new Vector<String>(10);
44.67 for(int j = 0; j < 10; j++) {
44.68 strMatchColumns.add(j,null);
44.69 }
44.70 @@ -463,12 +463,12 @@
44.71
44.72 //Instantiating the vector for MatchColumns
44.73
44.74 - iMatchColumns = new Vector(10);
44.75 + iMatchColumns = new Vector<Integer>(10);
44.76 for(int i = 0; i < 10 ; i++) {
44.77 iMatchColumns.add(i,Integer.valueOf(-1));
44.78 }
44.79
44.80 - strMatchColumns = new Vector(10);
44.81 + strMatchColumns = new Vector<String>(10);
44.82 for(int j = 0; j < 10; j++) {
44.83 strMatchColumns.add(j,null);
44.84 }
44.85 @@ -675,7 +675,7 @@
44.86
44.87 try {
44.88
44.89 - Map aMap = getTypeMap();
44.90 + Map<String, Class<?>> aMap = getTypeMap();
44.91 if( aMap != null) {
44.92 conn.setTypeMap(aMap);
44.93 }
45.1 --- a/src/share/classes/com/sun/rowset/JoinRowSetImpl.java Tue Apr 19 16:01:27 2011 -0700
45.2 +++ b/src/share/classes/com/sun/rowset/JoinRowSetImpl.java Tue Apr 26 15:48:03 2011 -0700
45.3 @@ -1,5 +1,5 @@
45.4 /*
45.5 - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
45.6 + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
45.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
45.8 *
45.9 * This code is free software; you can redistribute it and/or modify it
45.10 @@ -59,8 +59,8 @@
45.11 /**
45.12 * A <code>Vector</code> object that contains the <code>RowSet</code> objects
45.13 * that have been added to this <code>JoinRowSet</code> object.
45.14 - */
45.15 - private Vector vecRowSetsInJOIN;
45.16 + */
45.17 + private Vector<CachedRowSetImpl> vecRowSetsInJOIN;
45.18
45.19 /**
45.20 * The <code>CachedRowSet</code> object that encapsulates this
45.21 @@ -78,13 +78,13 @@
45.22 * for this <code>JoinRowSet</code> object.
45.23 * The last join type set forms the basis of succeeding joins.
45.24 */
45.25 - private Vector vecJoinType;
45.26 + private Vector<Integer> vecJoinType;
45.27
45.28 /**
45.29 * A <code>Vector</code> object containing the names of all the tables entering
45.30 * the join.
45.31 */
45.32 - private Vector vecTableNames;
45.33 + private Vector<String> vecTableNames;
45.34
45.35 /**
45.36 * An <code>int</code> that indicates the column index of the match column.
45.37 @@ -121,10 +121,10 @@
45.38 */
45.39 public JoinRowSetImpl() throws SQLException {
45.40
45.41 - vecRowSetsInJOIN = new Vector();
45.42 + vecRowSetsInJOIN = new Vector<CachedRowSetImpl>();
45.43 crsInternal = new CachedRowSetImpl();
45.44 - vecJoinType = new Vector();
45.45 - vecTableNames = new Vector();
45.46 + vecJoinType = new Vector<Integer>();
45.47 + vecTableNames = new Vector<String>();
45.48 iMatchKey = -1;
45.49 strMatchKey = null;
45.50 supportedJOINs =
45.51 @@ -222,7 +222,7 @@
45.52 // either of the setter methods have been set.
45.53 if(boolColId){
45.54 //
45.55 - ArrayList indices = new ArrayList();
45.56 + ArrayList<Integer> indices = new ArrayList<>();
45.57 for(int i=0;i<cRowset.getMatchColumnNames().length;i++) {
45.58 if( (strMatchKey = (cRowset.getMatchColumnNames())[i]) != null) {
45.59 iMatchKey = cRowset.findColumn(strMatchKey);
46.1 --- a/src/share/classes/java/awt/Dialog.java Tue Apr 19 16:01:27 2011 -0700
46.2 +++ b/src/share/classes/java/awt/Dialog.java Tue Apr 26 15:48:03 2011 -0700
46.3 @@ -903,7 +903,7 @@
46.4 if (peer == null) {
46.5 addNotify();
46.6 }
46.7 - validate();
46.8 + validateUnconditionally();
46.9 if (visible) {
46.10 toFront();
46.11 retval = false;
47.1 --- a/src/share/classes/java/awt/GraphicsDevice.java Tue Apr 19 16:01:27 2011 -0700
47.2 +++ b/src/share/classes/java/awt/GraphicsDevice.java Tue Apr 26 15:48:03 2011 -0700
47.3 @@ -243,8 +243,10 @@
47.4 * a non-client of the input method framework.
47.5 * </ul>
47.6 * <p>
47.7 - * Simulated full-screen mode resizes
47.8 - * the window to the size of the screen and positions it at (0,0).
47.9 + * The simulated full-screen mode places and resizes the window to the maximum
47.10 + * possible visible area of the screen. However, the native windowing system
47.11 + * may modify the requested geometry-related data, so that the {@code Window} object
47.12 + * is placed and sized in a way that corresponds closely to the desktop settings.
47.13 * <p>
47.14 * When entering full-screen mode, if the window to be used as a
47.15 * full-screen window is not visible, this method will make it visible.
48.1 --- a/src/share/classes/java/awt/Toolkit.java Tue Apr 19 16:01:27 2011 -0700
48.2 +++ b/src/share/classes/java/awt/Toolkit.java Tue Apr 26 15:48:03 2011 -0700
48.3 @@ -466,6 +466,10 @@
48.4 */
48.5 protected void loadSystemColors(int[] systemColors)
48.6 throws HeadlessException {
48.7 + if (GraphicsEnvironment.isHeadless()){
48.8 + throw new HeadlessException();
48.9 + }
48.10 +
48.11 }
48.12
48.13 /**
48.14 @@ -500,6 +504,10 @@
48.15 */
48.16 public void setDynamicLayout(boolean dynamic)
48.17 throws HeadlessException {
48.18 + if (GraphicsEnvironment.isHeadless()){
48.19 + throw new HeadlessException();
48.20 + }
48.21 +
48.22 }
48.23
48.24 /**
48.25 @@ -523,6 +531,9 @@
48.26 */
48.27 protected boolean isDynamicLayoutSet()
48.28 throws HeadlessException {
48.29 + if (GraphicsEnvironment.isHeadless()){
48.30 + throw new HeadlessException();
48.31 + }
48.32 if (this != Toolkit.getDefaultToolkit()) {
48.33 return Toolkit.getDefaultToolkit().isDynamicLayoutSet();
48.34 } else {
48.35 @@ -558,6 +569,9 @@
48.36 */
48.37 public boolean isDynamicLayoutActive()
48.38 throws HeadlessException {
48.39 + if (GraphicsEnvironment.isHeadless()){
48.40 + throw new HeadlessException();
48.41 + }
48.42 if (this != Toolkit.getDefaultToolkit()) {
48.43 return Toolkit.getDefaultToolkit().isDynamicLayoutActive();
48.44 } else {
48.45 @@ -601,6 +615,9 @@
48.46 */
48.47 public Insets getScreenInsets(GraphicsConfiguration gc)
48.48 throws HeadlessException {
48.49 + if (GraphicsEnvironment.isHeadless()){
48.50 + throw new HeadlessException();
48.51 + }
48.52 if (this != Toolkit.getDefaultToolkit()) {
48.53 return Toolkit.getDefaultToolkit().getScreenInsets(gc);
48.54 } else {
48.55 @@ -1342,6 +1359,9 @@
48.56 * @since 1.4
48.57 */
48.58 public Clipboard getSystemSelection() throws HeadlessException {
48.59 + if (GraphicsEnvironment.isHeadless()){
48.60 + throw new HeadlessException();
48.61 + }
48.62 if (this != Toolkit.getDefaultToolkit()) {
48.63 return Toolkit.getDefaultToolkit().getSystemSelection();
48.64 } else {
48.65 @@ -1371,6 +1391,10 @@
48.66 * @since JDK1.1
48.67 */
48.68 public int getMenuShortcutKeyMask() throws HeadlessException {
48.69 + if (GraphicsEnvironment.isHeadless()){
48.70 + throw new HeadlessException();
48.71 + }
48.72 +
48.73 return Event.CTRL_MASK;
48.74 }
48.75
48.76 @@ -1499,6 +1523,9 @@
48.77 */
48.78 public Dimension getBestCursorSize(int preferredWidth,
48.79 int preferredHeight) throws HeadlessException {
48.80 + if (GraphicsEnvironment.isHeadless()){
48.81 + throw new HeadlessException();
48.82 + }
48.83 // Override to implement custom cursor support.
48.84 if (this != Toolkit.getDefaultToolkit()) {
48.85 return Toolkit.getDefaultToolkit().
48.86 @@ -1526,6 +1553,9 @@
48.87 * @since 1.2
48.88 */
48.89 public int getMaximumCursorColors() throws HeadlessException {
48.90 + if (GraphicsEnvironment.isHeadless()){
48.91 + throw new HeadlessException();
48.92 + }
48.93 // Override to implement custom cursor support.
48.94 if (this != Toolkit.getDefaultToolkit()) {
48.95 return Toolkit.getDefaultToolkit().getMaximumCursorColors();
48.96 @@ -2561,8 +2591,6 @@
48.97 * initialized with {@code true}.
48.98 * Changing this value after the {@code Toolkit} class initialization will have no effect.
48.99 * <p>
48.100 - * The current value could be queried by using the
48.101 - * {@code System.getProperty("sun.awt.enableExtraMouseButtons")} method.
48.102 * @exception HeadlessException if GraphicsEnvironment.isHeadless() returns true
48.103 * @return {@code true} if events from extra mouse buttons are allowed to be processed and posted;
48.104 * {@code false} otherwise
48.105 @@ -2572,6 +2600,9 @@
48.106 * @since 1.7
48.107 */
48.108 public boolean areExtraMouseButtonsEnabled() throws HeadlessException {
48.109 + if (GraphicsEnvironment.isHeadless()){
48.110 + throw new HeadlessException();
48.111 + }
48.112 return Toolkit.getDefaultToolkit().areExtraMouseButtonsEnabled();
48.113 }
48.114 }
49.1 --- a/src/share/classes/java/awt/Window.java Tue Apr 19 16:01:27 2011 -0700
49.2 +++ b/src/share/classes/java/awt/Window.java Tue Apr 26 15:48:03 2011 -0700
49.3 @@ -870,6 +870,11 @@
49.4 * are automatically enlarged if either is less than
49.5 * the minimum size as specified by previous call to
49.6 * {@code setMinimumSize}.
49.7 + * <p>
49.8 + * The method changes the geometry-related data. Therefore,
49.9 + * the native windowing system may ignore such requests, or it may modify
49.10 + * the requested data, so that the {@code Window} object is placed and sized
49.11 + * in a way that corresponds closely to the desktop settings.
49.12 *
49.13 * @see #getSize
49.14 * @see #setBounds
49.15 @@ -887,6 +892,11 @@
49.16 * are automatically enlarged if either is less than
49.17 * the minimum size as specified by previous call to
49.18 * {@code setMinimumSize}.
49.19 + * <p>
49.20 + * The method changes the geometry-related data. Therefore,
49.21 + * the native windowing system may ignore such requests, or it may modify
49.22 + * the requested data, so that the {@code Window} object is placed and sized
49.23 + * in a way that corresponds closely to the desktop settings.
49.24 *
49.25 * @see #getSize
49.26 * @see #setBounds
49.27 @@ -898,6 +908,32 @@
49.28 }
49.29
49.30 /**
49.31 + * {@inheritDoc}
49.32 + * <p>
49.33 + * The method changes the geometry-related data. Therefore,
49.34 + * the native windowing system may ignore such requests, or it may modify
49.35 + * the requested data, so that the {@code Window} object is placed and sized
49.36 + * in a way that corresponds closely to the desktop settings.
49.37 + */
49.38 + @Override
49.39 + public void setLocation(int x, int y) {
49.40 + super.setLocation(x, y);
49.41 + }
49.42 +
49.43 + /**
49.44 + * {@inheritDoc}
49.45 + * <p>
49.46 + * The method changes the geometry-related data. Therefore,
49.47 + * the native windowing system may ignore such requests, or it may modify
49.48 + * the requested data, so that the {@code Window} object is placed and sized
49.49 + * in a way that corresponds closely to the desktop settings.
49.50 + */
49.51 + @Override
49.52 + public void setLocation(Point p) {
49.53 + super.setLocation(p);
49.54 + }
49.55 +
49.56 + /**
49.57 * @deprecated As of JDK version 1.1,
49.58 * replaced by <code>setBounds(int, int, int, int)</code>.
49.59 */
49.60 @@ -3147,6 +3183,11 @@
49.61 * placed at the left side of the screen. The similar placement
49.62 * will occur if both top and bottom edges are out of the screen.
49.63 * In that case, the window is placed at the top side of the screen.
49.64 + * <p>
49.65 + * The method changes the geometry-related data. Therefore,
49.66 + * the native windowing system may ignore such requests, or it may modify
49.67 + * the requested data, so that the {@code Window} object is placed and sized
49.68 + * in a way that corresponds closely to the desktop settings.
49.69 *
49.70 * @param c the component in relation to which the window's location
49.71 * is determined
49.72 @@ -3395,6 +3436,11 @@
49.73 * are automatically enlarged if either is less than
49.74 * the minimum size as specified by previous call to
49.75 * {@code setMinimumSize}.
49.76 + * <p>
49.77 + * The method changes the geometry-related data. Therefore,
49.78 + * the native windowing system may ignore such requests, or it may modify
49.79 + * the requested data, so that the {@code Window} object is placed and sized
49.80 + * in a way that corresponds closely to the desktop settings.
49.81 *
49.82 * @see #getBounds
49.83 * @see #setLocation(int, int)
49.84 @@ -3424,6 +3470,11 @@
49.85 * will be automatically enlarged if either is less than
49.86 * the minimum size as specified by previous call to
49.87 * {@code setMinimumSize}.
49.88 + * <p>
49.89 + * The method changes the geometry-related data. Therefore,
49.90 + * the native windowing system may ignore such requests, or it may modify
49.91 + * the requested data, so that the {@code Window} object is placed and sized
49.92 + * in a way that corresponds closely to the desktop settings.
49.93 *
49.94 * @see #getBounds
49.95 * @see #setLocation(int, int)
50.1 --- a/src/share/classes/java/awt/doc-files/AWTThreadIssues.html Tue Apr 19 16:01:27 2011 -0700
50.2 +++ b/src/share/classes/java/awt/doc-files/AWTThreadIssues.html Tue Apr 26 15:48:03 2011 -0700
50.3 @@ -40,10 +40,9 @@
50.4 <a name="Autoshutdown"></a>
50.5 <h2>Auto-shutdown</h2>
50.6
50.7 -According to <a href="http://java.sun.com/docs/books/vmspec/2nd-edition/html/VMSpecTOC.doc.html"><i>The
50.8 -Java</i><sup><small>TM</small></sup> <i>Virtual Machine Specification,
50.9 -Second edition</i></a> (see <a href="http://java.sun.com/docs/books/vmspec/2nd-edition/html/Concepts.doc.html#19152">§2.17.9</a>
50.10 -and <a href="http://java.sun.com/docs/books/vmspec/2nd-edition/html/Concepts.doc.html#33308">§2.19</a>),
50.11 +According to
50.12 +<cite>The Java™ Virtual Machine Specification</cite>,
50.13 +sections 2.17.9 and 2.19,
50.14 the Java virtual machine (JVM) initially starts up with a single non-daemon
50.15 thread, which typically calls the <code>main</code> method of some class.
50.16 The virtual machine terminates all its activity and exits when
50.17 @@ -183,7 +182,8 @@
50.18 <...>
50.19 </pre>
50.20
50.21 -The Java Virtual Machine Specification guarantees
50.22 +<cite>The Java™ Virtual Machine Specification</cite>
50.23 + guarantees
50.24 that the JVM doesn't exit until this thread terminates.
50.25 </body>
50.26 </html>
51.1 --- a/src/share/classes/java/io/Console.java Tue Apr 19 16:01:27 2011 -0700
51.2 +++ b/src/share/classes/java/io/Console.java Tue Apr 26 15:48:03 2011 -0700
51.3 @@ -148,8 +148,8 @@
51.4 * extra arguments are ignored. The number of arguments is
51.5 * variable and may be zero. The maximum number of arguments is
51.6 * limited by the maximum dimension of a Java array as defined by
51.7 - * the <a href="http://java.sun.com/docs/books/vmspec/">Java
51.8 - * Virtual Machine Specification</a>. The behaviour on a
51.9 + * <cite>The Java™ Virtual Machine Specification</cite>.
51.10 + * The behaviour on a
51.11 * <tt>null</tt> argument depends on the <a
51.12 * href="../util/Formatter.html#syntax">conversion</a>.
51.13 *
51.14 @@ -187,8 +187,8 @@
51.15 * extra arguments are ignored. The number of arguments is
51.16 * variable and may be zero. The maximum number of arguments is
51.17 * limited by the maximum dimension of a Java array as defined by
51.18 - * the <a href="http://java.sun.com/docs/books/vmspec/">Java
51.19 - * Virtual Machine Specification</a>. The behaviour on a
51.20 + * <cite>The Java™ Virtual Machine Specification</cite>.
51.21 + * The behaviour on a
51.22 * <tt>null</tt> argument depends on the <a
51.23 * href="../util/Formatter.html#syntax">conversion</a>.
51.24 *
51.25 @@ -220,8 +220,7 @@
51.26 * string. If there are more arguments than format specifiers, the
51.27 * extra arguments are ignored. The maximum number of arguments is
51.28 * limited by the maximum dimension of a Java array as defined by
51.29 - * the <a href="http://java.sun.com/docs/books/vmspec/">Java
51.30 - * Virtual Machine Specification</a>.
51.31 + * <cite>The Java™ Virtual Machine Specification</cite>.
51.32 *
51.33 * @throws IllegalFormatException
51.34 * If a format string contains an illegal syntax, a format
51.35 @@ -285,8 +284,7 @@
51.36 * string. If there are more arguments than format specifiers, the
51.37 * extra arguments are ignored. The maximum number of arguments is
51.38 * limited by the maximum dimension of a Java array as defined by
51.39 - * the <a href="http://java.sun.com/docs/books/vmspec/">Java
51.40 - * Virtual Machine Specification</a>.
51.41 + * <cite>The Java™ Virtual Machine Specification</cite>.
51.42 *
51.43 * @throws IllegalFormatException
51.44 * If a format string contains an illegal syntax, a format
52.1 --- a/src/share/classes/java/io/PrintStream.java Tue Apr 19 16:01:27 2011 -0700
52.2 +++ b/src/share/classes/java/io/PrintStream.java Tue Apr 26 15:48:03 2011 -0700
52.3 @@ -846,8 +846,8 @@
52.4 * extra arguments are ignored. The number of arguments is
52.5 * variable and may be zero. The maximum number of arguments is
52.6 * limited by the maximum dimension of a Java array as defined by
52.7 - * the <a href="http://java.sun.com/docs/books/vmspec/">Java
52.8 - * Virtual Machine Specification</a>. The behaviour on a
52.9 + * <cite>The Java™ Virtual Machine Specification</cite>.
52.10 + * The behaviour on a
52.11 * <tt>null</tt> argument depends on the <a
52.12 * href="../util/Formatter.html#syntax">conversion</a>.
52.13 *
52.14 @@ -896,8 +896,8 @@
52.15 * extra arguments are ignored. The number of arguments is
52.16 * variable and may be zero. The maximum number of arguments is
52.17 * limited by the maximum dimension of a Java array as defined by
52.18 - * the <a href="http://java.sun.com/docs/books/vmspec/">Java
52.19 - * Virtual Machine Specification</a>. The behaviour on a
52.20 + * <cite>The Java™ Virtual Machine Specification</cite>.
52.21 + * The behaviour on a
52.22 * <tt>null</tt> argument depends on the <a
52.23 * href="../util/Formatter.html#syntax">conversion</a>.
52.24 *
52.25 @@ -939,8 +939,8 @@
52.26 * extra arguments are ignored. The number of arguments is
52.27 * variable and may be zero. The maximum number of arguments is
52.28 * limited by the maximum dimension of a Java array as defined by
52.29 - * the <a href="http://java.sun.com/docs/books/vmspec/">Java
52.30 - * Virtual Machine Specification</a>. The behaviour on a
52.31 + * <cite>The Java™ Virtual Machine Specification</cite>.
52.32 + * The behaviour on a
52.33 * <tt>null</tt> argument depends on the <a
52.34 * href="../util/Formatter.html#syntax">conversion</a>.
52.35 *
52.36 @@ -996,8 +996,8 @@
52.37 * extra arguments are ignored. The number of arguments is
52.38 * variable and may be zero. The maximum number of arguments is
52.39 * limited by the maximum dimension of a Java array as defined by
52.40 - * the <a href="http://java.sun.com/docs/books/vmspec/">Java
52.41 - * Virtual Machine Specification</a>. The behaviour on a
52.42 + * <cite>The Java™ Virtual Machine Specification</cite>.
52.43 + * The behaviour on a
52.44 * <tt>null</tt> argument depends on the <a
52.45 * href="../util/Formatter.html#syntax">conversion</a>.
52.46 *
53.1 --- a/src/share/classes/java/io/PrintWriter.java Tue Apr 19 16:01:27 2011 -0700
53.2 +++ b/src/share/classes/java/io/PrintWriter.java Tue Apr 26 15:48:03 2011 -0700
53.3 @@ -779,8 +779,8 @@
53.4 * extra arguments are ignored. The number of arguments is
53.5 * variable and may be zero. The maximum number of arguments is
53.6 * limited by the maximum dimension of a Java array as defined by
53.7 - * the <a href="http://java.sun.com/docs/books/vmspec/">Java
53.8 - * Virtual Machine Specification</a>. The behaviour on a
53.9 + * <cite>The Java™ Virtual Machine Specification</cite>.
53.10 + * The behaviour on a
53.11 * <tt>null</tt> argument depends on the <a
53.12 * href="../util/Formatter.html#syntax">conversion</a>.
53.13 *
53.14 @@ -830,8 +830,8 @@
53.15 * extra arguments are ignored. The number of arguments is
53.16 * variable and may be zero. The maximum number of arguments is
53.17 * limited by the maximum dimension of a Java array as defined by
53.18 - * the <a href="http://java.sun.com/docs/books/vmspec/">Java
53.19 - * Virtual Machine Specification</a>. The behaviour on a
53.20 + * <cite>The Java™ Virtual Machine Specification</cite>.
53.21 + * The behaviour on a
53.22 * <tt>null</tt> argument depends on the <a
53.23 * href="../util/Formatter.html#syntax">conversion</a>.
53.24 *
53.25 @@ -874,8 +874,8 @@
53.26 * extra arguments are ignored. The number of arguments is
53.27 * variable and may be zero. The maximum number of arguments is
53.28 * limited by the maximum dimension of a Java array as defined by
53.29 - * the <a href="http://java.sun.com/docs/books/vmspec/">Java
53.30 - * Virtual Machine Specification</a>. The behaviour on a
53.31 + * <cite>The Java™ Virtual Machine Specification</cite>.
53.32 + * The behaviour on a
53.33 * <tt>null</tt> argument depends on the <a
53.34 * href="../util/Formatter.html#syntax">conversion</a>.
53.35 *
53.36 @@ -934,8 +934,8 @@
53.37 * extra arguments are ignored. The number of arguments is
53.38 * variable and may be zero. The maximum number of arguments is
53.39 * limited by the maximum dimension of a Java array as defined by
53.40 - * the <a href="http://java.sun.com/docs/books/vmspec/">Java
53.41 - * Virtual Machine Specification</a>. The behaviour on a
53.42 + * <cite>The Java™ Virtual Machine Specification</cite>.
53.43 + * The behaviour on a
53.44 * <tt>null</tt> argument depends on the <a
53.45 * href="../util/Formatter.html#syntax">conversion</a>.
53.46 *
54.1 --- a/src/share/classes/java/lang/AssertionError.java Tue Apr 19 16:01:27 2011 -0700
54.2 +++ b/src/share/classes/java/lang/AssertionError.java Tue Apr 26 15:48:03 2011 -0700
54.3 @@ -34,11 +34,9 @@
54.4 * new AssertionError(<i>expression</i>)
54.5 * </pre>
54.6 * has as its detail message the <i>string conversion</i> of
54.7 - * <i>expression</i> (as defined in <a
54.8 - * href="http://java.sun.com/docs/books/jls/second_edition/html/j.title.doc.html">
54.9 - * <i>The Java Language Specification, Second Edition</i></a>,
54.10 - * <a href="http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#40220">
54.11 - * Section 15.18.1.1</a>), regardless of the type of <i>expression</i>.
54.12 + * <i>expression</i> (as defined in section 15.18.1.1 of
54.13 + * <cite>The Java™ Language Specification</cite>),
54.14 + * regardless of the type of <i>expression</i>.
54.15 *
54.16 * @since 1.4
54.17 */
54.18 @@ -63,8 +61,8 @@
54.19 /**
54.20 * Constructs an AssertionError with its detail message derived
54.21 * from the specified object, which is converted to a string as
54.22 - * defined in <i>The Java Language Specification, Second
54.23 - * Edition</i>, Section 15.18.1.1.
54.24 + * defined in section 15.18.1.1 of
54.25 + * <cite>The Java™ Language Specification</cite>.
54.26 *<p>
54.27 * If the specified object is an instance of {@code Throwable}, it
54.28 * becomes the <i>cause</i> of the newly constructed assertion error.
54.29 @@ -81,8 +79,8 @@
54.30 /**
54.31 * Constructs an AssertionError with its detail message derived
54.32 * from the specified <code>boolean</code>, which is converted to
54.33 - * a string as defined in <i>The Java Language Specification,
54.34 - * Second Edition</i>, Section 15.18.1.1.
54.35 + * a string as defined in section 15.18.1.1 of
54.36 + * <cite>The Java™ Language Specification</cite>.
54.37 *
54.38 * @param detailMessage value to be used in constructing detail message
54.39 */
54.40 @@ -93,8 +91,8 @@
54.41 /**
54.42 * Constructs an AssertionError with its detail message derived
54.43 * from the specified <code>char</code>, which is converted to a
54.44 - * string as defined in <i>The Java Language Specification, Second
54.45 - * Edition</i>, Section 15.18.1.1.
54.46 + * string as defined in section 15.18.1.1 of
54.47 + * <cite>The Java™ Language Specification</cite>.
54.48 *
54.49 * @param detailMessage value to be used in constructing detail message
54.50 */
54.51 @@ -105,8 +103,8 @@
54.52 /**
54.53 * Constructs an AssertionError with its detail message derived
54.54 * from the specified <code>int</code>, which is converted to a
54.55 - * string as defined in <i>The Java Language Specification, Second
54.56 - * Edition</i>, Section 15.18.1.1.
54.57 + * string as defined in section 15.18.1.1 of
54.58 + * <cite>The Java™ Language Specification</cite>.
54.59 *
54.60 * @param detailMessage value to be used in constructing detail message
54.61 */
54.62 @@ -117,8 +115,8 @@
54.63 /**
54.64 * Constructs an AssertionError with its detail message derived
54.65 * from the specified <code>long</code>, which is converted to a
54.66 - * string as defined in <i>The Java Language Specification, Second
54.67 - * Edition</i>, Section 15.18.1.1.
54.68 + * string as defined in section 15.18.1.1 of
54.69 + * <cite>The Java™ Language Specification</cite>.
54.70 *
54.71 * @param detailMessage value to be used in constructing detail message
54.72 */
54.73 @@ -129,8 +127,8 @@
54.74 /**
54.75 * Constructs an AssertionError with its detail message derived
54.76 * from the specified <code>float</code>, which is converted to a
54.77 - * string as defined in <i>The Java Language Specification, Second
54.78 - * Edition</i>, Section 15.18.1.1.
54.79 + * string as defined in section 15.18.1.1 of
54.80 + * <cite>The Java™ Language Specification</cite>.
54.81 *
54.82 * @param detailMessage value to be used in constructing detail message
54.83 */
54.84 @@ -141,8 +139,8 @@
54.85 /**
54.86 * Constructs an AssertionError with its detail message derived
54.87 * from the specified <code>double</code>, which is converted to a
54.88 - * string as defined in <i>The Java Language Specification, Second
54.89 - * Edition</i>, Section 15.18.1.1.
54.90 + * string as defined in section 15.18.1.1 of
54.91 + * <cite>The Java™ Language Specification</cite>.
54.92 *
54.93 * @param detailMessage value to be used in constructing detail message
54.94 */
55.1 --- a/src/share/classes/java/lang/Byte.java Tue Apr 19 16:01:27 2011 -0700
55.2 +++ b/src/share/classes/java/lang/Byte.java Tue Apr 26 15:48:03 2011 -0700
55.3 @@ -251,9 +251,9 @@
55.4 * </blockquote>
55.5 *
55.6 * <i>DecimalNumeral</i>, <i>HexDigits</i>, and <i>OctalDigits</i>
55.7 - * are defined in <a href="http://java.sun.com/docs/books/jls/second_edition/html/lexical.doc.html#48282">§3.10.1</a>
55.8 - * of the <a href="http://java.sun.com/docs/books/jls/html/">Java
55.9 - * Language Specification</a>.
55.10 + * are as defined in section 3.10.1 of
55.11 + * <cite>The Java™ Language Specification</cite>,
55.12 + * except that underscores are not accepted between digits.
55.13 *
55.14 * <p>The sequence of characters following an optional
55.15 * sign and/or radix specifier ("{@code 0x}", "{@code 0X}",
56.1 --- a/src/share/classes/java/lang/Character.java Tue Apr 19 16:01:27 2011 -0700
56.2 +++ b/src/share/classes/java/lang/Character.java Tue Apr 26 15:48:03 2011 -0700
56.3 @@ -4182,9 +4182,11 @@
56.4 aliases.put("AVST", AVESTAN);
56.5 aliases.put("BALI", BALINESE);
56.6 aliases.put("BAMU", BAMUM);
56.7 + aliases.put("BATK", BATAK);
56.8 aliases.put("BENG", BENGALI);
56.9 aliases.put("BOPO", BOPOMOFO);
56.10 aliases.put("BRAI", BRAILLE);
56.11 + aliases.put("BRAH", BRAHMI);
56.12 aliases.put("BUGI", BUGINESE);
56.13 aliases.put("BUHD", BUHID);
56.14 aliases.put("CANS", CANADIAN_ABORIGINAL);
56.15 @@ -4228,6 +4230,7 @@
56.16 aliases.put("LISU", LISU);
56.17 aliases.put("LYCI", LYCIAN);
56.18 aliases.put("LYDI", LYDIAN);
56.19 + aliases.put("MAND", MANDAIC);
56.20 aliases.put("MLYM", MALAYALAM);
56.21 aliases.put("MONG", MONGOLIAN);
56.22 aliases.put("MTEI", MEETEI_MAYEK);
57.1 --- a/src/share/classes/java/lang/Class.java Tue Apr 19 16:01:27 2011 -0700
57.2 +++ b/src/share/classes/java/lang/Class.java Tue Apr 26 15:48:03 2011 -0700
57.3 @@ -95,8 +95,8 @@
57.4 * </pre></blockquote>
57.5 *
57.6 * <p> It is also possible to get the {@code Class} object for a named
57.7 - * type (or for void) using a class literal
57.8 - * (JLS Section <A HREF="http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#251530">15.8.2</A>).
57.9 + * type (or for void) using a class literal. See Section 15.8.2 of
57.10 + * <cite>The Java™ Language Specification</cite>.
57.11 * For example:
57.12 *
57.13 * <p> <blockquote>
57.14 @@ -521,7 +521,8 @@
57.15 *
57.16 * <p> If this class object represents a reference type that is not an
57.17 * array type then the binary name of the class is returned, as specified
57.18 - * by the Java Language Specification, Second Edition.
57.19 + * by
57.20 + * <cite>The Java™ Language Specification</cite>.
57.21 *
57.22 * <p> If this class object represents a primitive type or void, then the
57.23 * name returned is a {@code String} equal to the Java language
57.24 @@ -630,8 +631,8 @@
57.25 * the type variables declared by this generic declaration
57.26 * @throws java.lang.reflect.GenericSignatureFormatError if the generic
57.27 * signature of this generic declaration does not conform to
57.28 - * the format specified in the Java Virtual Machine Specification,
57.29 - * 3rd edition
57.30 + * the format specified in
57.31 + * <cite>The Java™ Virtual Machine Specification</cite>
57.32 * @since 1.5
57.33 */
57.34 public TypeVariable<Class<T>>[] getTypeParameters() {
57.35 @@ -675,8 +676,8 @@
57.36 * returned.
57.37 *
57.38 * @throws java.lang.reflect.GenericSignatureFormatError if the generic
57.39 - * class signature does not conform to the format specified in the
57.40 - * Java Virtual Machine Specification, 3rd edition
57.41 + * class signature does not conform to the format specified in
57.42 + * <cite>The Java™ Virtual Machine Specification</cite>
57.43 * @throws TypeNotPresentException if the generic superclass
57.44 * refers to a non-existent type declaration
57.45 * @throws java.lang.reflect.MalformedParameterizedTypeException if the
57.46 @@ -798,7 +799,8 @@
57.47 *
57.48 * @throws java.lang.reflect.GenericSignatureFormatError
57.49 * if the generic class signature does not conform to the format
57.50 - * specified in the Java Virtual Machine Specification, 3rd edition
57.51 + * specified in
57.52 + * <cite>The Java™ Virtual Machine Specification</cite>
57.53 * @throws TypeNotPresentException if any of the generic
57.54 * superinterfaces refers to a non-existent type declaration
57.55 * @throws java.lang.reflect.MalformedParameterizedTypeException
58.1 --- a/src/share/classes/java/lang/ClassLoader.java Tue Apr 19 16:01:27 2011 -0700
58.2 +++ b/src/share/classes/java/lang/ClassLoader.java Tue Apr 26 15:48:03 2011 -0700
58.3 @@ -160,8 +160,8 @@
58.4 * <h4> <a name="name">Binary names</a> </h4>
58.5 *
58.6 * <p> Any class name provided as a {@link String} parameter to methods in
58.7 - * <tt>ClassLoader</tt> must be a binary name as defined by the <a
58.8 - * href="http://java.sun.com/docs/books/jls/">Java Language Specification</a>.
58.9 + * <tt>ClassLoader</tt> must be a binary name as defined by
58.10 + * <cite>The Java™ Language Specification</cite>.
58.11 *
58.12 * <p> Examples of valid class names include:
58.13 * <blockquote><pre>
58.14 @@ -531,9 +531,8 @@
58.15 * @param b
58.16 * The bytes that make up the class data. The bytes in positions
58.17 * <tt>off</tt> through <tt>off+len-1</tt> should have the format
58.18 - * of a valid class file as defined by the <a
58.19 - * href="http://java.sun.com/docs/books/vmspec/">Java Virtual
58.20 - * Machine Specification</a>.
58.21 + * of a valid class file as defined by
58.22 + * <cite>The Java™ Virtual Machine Specification</cite>.
58.23 *
58.24 * @param off
58.25 * The start offset in <tt>b</tt> of the class data
58.26 @@ -597,9 +596,8 @@
58.27 * @param b
58.28 * The bytes that make up the class data. The bytes in positions
58.29 * <tt>off</tt> through <tt>off+len-1</tt> should have the format
58.30 - * of a valid class file as defined by the <a
58.31 - * href="http://java.sun.com/docs/books/vmspec/">Java Virtual
58.32 - * Machine Specification</a>.
58.33 + * of a valid class file as defined by
58.34 + * <cite>The Java™ Virtual Machine Specification</cite>.
58.35 *
58.36 * @param off
58.37 * The start offset in <tt>b</tt> of the class data
58.38 @@ -748,9 +746,8 @@
58.39 * @param b
58.40 * The bytes that make up the class data. The bytes in positions
58.41 * <tt>off</tt> through <tt>off+len-1</tt> should have the format
58.42 - * of a valid class file as defined by the <a
58.43 - * href="http://java.sun.com/docs/books/vmspec/">Java Virtual
58.44 - * Machine Specification</a>.
58.45 + * of a valid class file as defined by
58.46 + * <cite>The Java™ Virtual Machine Specification</cite>.
58.47 *
58.48 * @param off
58.49 * The start offset in <tt>b</tt> of the class data
58.50 @@ -838,8 +835,7 @@
58.51 * The bytes that make up the class data. The bytes from positions
58.52 * <tt>b.position()</tt> through <tt>b.position() + b.limit() -1
58.53 * </tt> should have the format of a valid class file as defined by
58.54 - * the <a href="http://java.sun.com/docs/books/vmspec/">Java Virtual
58.55 - * Machine Specification</a>.
58.56 + * <cite>The Java™ Virtual Machine Specification</cite>.
58.57 *
58.58 * @param protectionDomain
58.59 * The ProtectionDomain of the class, or <tt>null</tt>.
58.60 @@ -998,9 +994,8 @@
58.61 * Links the specified class. This (misleadingly named) method may be
58.62 * used by a class loader to link a class. If the class <tt>c</tt> has
58.63 * already been linked, then this method simply returns. Otherwise, the
58.64 - * class is linked as described in the "Execution" chapter of the <a
58.65 - * href="http://java.sun.com/docs/books/jls/">Java Language
58.66 - * Specification</a>.
58.67 + * class is linked as described in the "Execution" chapter of
58.68 + * <cite>The Java™ Language Specification</cite>.
58.69 * </p>
58.70 *
58.71 * @param c
58.72 @@ -2034,8 +2029,8 @@
58.73 * The name of the package whose package default assertion status
58.74 * is to be set. A <tt>null</tt> value indicates the unnamed
58.75 * package that is "current"
58.76 - * (<a href="http://java.sun.com/docs/books/jls/">Java Language
58.77 - * Specification</a>, section 7.4.2).
58.78 + * (see section 7.4.2 of
58.79 + * <cite>The Java™ Language Specification</cite>.)
58.80 *
58.81 * @param enabled
58.82 * <tt>true</tt> if classes loaded by this classloader and
59.1 --- a/src/share/classes/java/lang/Double.java Tue Apr 19 16:01:27 2011 -0700
59.2 +++ b/src/share/classes/java/lang/Double.java Tue Apr 26 15:48:03 2011 -0700
59.3 @@ -392,9 +392,10 @@
59.4 * where <i>Sign</i>, <i>FloatingPointLiteral</i>,
59.5 * <i>HexNumeral</i>, <i>HexDigits</i>, <i>SignedInteger</i> and
59.6 * <i>FloatTypeSuffix</i> are as defined in the lexical structure
59.7 - * sections of the <a
59.8 - * href="http://java.sun.com/docs/books/jls/html/">Java Language
59.9 - * Specification</a>. If {@code s} does not have the form of
59.10 + * sections of
59.11 + * <cite>The Java™ Language Specification</cite>,
59.12 + * except that underscores are not accepted between digits.
59.13 + * If {@code s} does not have the form of
59.14 * a <i>FloatValue</i>, then a {@code NumberFormatException}
59.15 * is thrown. Otherwise, {@code s} is regarded as
59.16 * representing an exact decimal value in the usual
59.17 @@ -464,8 +465,8 @@
59.18 * // Since this method allows integer-only strings as input
59.19 * // in addition to strings of floating-point literals, the
59.20 * // two sub-patterns below are simplifications of the grammar
59.21 - * // productions from the Java Language Specification, 2nd
59.22 - * // edition, section 3.10.2.
59.23 + * // productions from section 3.10.2 of
59.24 + * // <cite>The Java™ Language Specification</cite>.
59.25 *
59.26 * // Digits ._opt Digits_opt ExponentPart_opt FloatTypeSuffix_opt
59.27 * "((("+Digits+"(\\.)?("+Digits+"?)("+Exp+")?)|"+
60.1 --- a/src/share/classes/java/lang/Enum.java Tue Apr 19 16:01:27 2011 -0700
60.2 +++ b/src/share/classes/java/lang/Enum.java Tue Apr 26 15:48:03 2011 -0700
60.3 @@ -36,9 +36,8 @@
60.4 *
60.5 * More information about enums, including descriptions of the
60.6 * implicitly declared methods synthesized by the compiler, can be
60.7 - * found in <i>The Java™ Language Specification, Third
60.8 - * Edition</i>, <a
60.9 - * href="http://java.sun.com/docs/books/jls/third_edition/html/classes.html#8.9">§8.9</a>.
60.10 + * found in section 8.9 of
60.11 + * <cite>The Java™ Language Specification</cite>.
60.12 *
60.13 * <p> Note that when using an enumeration type as the type of a set
60.14 * or as the type of the keys in a map, specialized and efficient
61.1 --- a/src/share/classes/java/lang/Error.java Tue Apr 19 16:01:27 2011 -0700
61.2 +++ b/src/share/classes/java/lang/Error.java Tue Apr 26 15:48:03 2011 -0700
61.3 @@ -43,7 +43,7 @@
61.4 *
61.5 * @author Frank Yellin
61.6 * @see java.lang.ThreadDeath
61.7 - * @jls3 11.2 Compile-Time Checking of Exceptions
61.8 + * @jls 11.2 Compile-Time Checking of Exceptions
61.9 * @since JDK1.0
61.10 */
61.11 public class Error extends Throwable {
62.1 --- a/src/share/classes/java/lang/Exception.java Tue Apr 19 16:01:27 2011 -0700
62.2 +++ b/src/share/classes/java/lang/Exception.java Tue Apr 26 15:48:03 2011 -0700
62.3 @@ -39,7 +39,7 @@
62.4 *
62.5 * @author Frank Yellin
62.6 * @see java.lang.Error
62.7 - * @jls3 11.2 Compile-Time Checking of Exceptions
62.8 + * @jls 11.2 Compile-Time Checking of Exceptions
62.9 * @since JDK1.0
62.10 */
62.11 public class Exception extends Throwable {
63.1 --- a/src/share/classes/java/lang/Float.java Tue Apr 19 16:01:27 2011 -0700
63.2 +++ b/src/share/classes/java/lang/Float.java Tue Apr 26 15:48:03 2011 -0700
63.3 @@ -353,9 +353,10 @@
63.4 * where <i>Sign</i>, <i>FloatingPointLiteral</i>,
63.5 * <i>HexNumeral</i>, <i>HexDigits</i>, <i>SignedInteger</i> and
63.6 * <i>FloatTypeSuffix</i> are as defined in the lexical structure
63.7 - * sections of the <a
63.8 - * href="http://java.sun.com/docs/books/jls/html/">Java Language
63.9 - * Specification</a>. If {@code s} does not have the form of
63.10 + * sections of
63.11 + * <cite>The Java™ Language Specification</cite>,
63.12 + * except that underscores are not accepted between digits.
63.13 + * If {@code s} does not have the form of
63.14 * a <i>FloatValue</i>, then a {@code NumberFormatException}
63.15 * is thrown. Otherwise, {@code s} is regarded as
63.16 * representing an exact decimal value in the usual
64.1 --- a/src/share/classes/java/lang/Integer.java Tue Apr 19 16:01:27 2011 -0700
64.2 +++ b/src/share/classes/java/lang/Integer.java Tue Apr 26 15:48:03 2011 -0700
64.3 @@ -918,9 +918,9 @@
64.4 * </blockquote>
64.5 *
64.6 * <i>DecimalNumeral</i>, <i>HexDigits</i>, and <i>OctalDigits</i>
64.7 - * are defined in <a href="http://java.sun.com/docs/books/jls/second_edition/html/lexical.doc.html#48282">§3.10.1</a>
64.8 - * of the <a href="http://java.sun.com/docs/books/jls/html/">Java
64.9 - * Language Specification</a>.
64.10 + * are as defined in section 3.10.1 of
64.11 + * <cite>The Java™ Language Specification</cite>,
64.12 + * except that underscores are not accepted between digits.
64.13 *
64.14 * <p>The sequence of characters following an optional
64.15 * sign and/or radix specifier ("{@code 0x}", "{@code 0X}",
65.1 --- a/src/share/classes/java/lang/Long.java Tue Apr 19 16:01:27 2011 -0700
65.2 +++ b/src/share/classes/java/lang/Long.java Tue Apr 26 15:48:03 2011 -0700
65.3 @@ -598,9 +598,9 @@
65.4 * </blockquote>
65.5 *
65.6 * <i>DecimalNumeral</i>, <i>HexDigits</i>, and <i>OctalDigits</i>
65.7 - * are defined in <a href="http://java.sun.com/docs/books/jls/second_edition/html/lexical.doc.html#48282">§3.10.1</a>
65.8 - * of the <a href="http://java.sun.com/docs/books/jls/html/">Java
65.9 - * Language Specification</a>.
65.10 + * are as defined in section 3.10.1 of
65.11 + * <cite>The Java™ Language Specification</cite>,
65.12 + * except that underscores are not accepted between digits.
65.13 *
65.14 * <p>The sequence of characters following an optional
65.15 * sign and/or radix specifier ("{@code 0x}", "{@code 0X}",
66.1 --- a/src/share/classes/java/lang/Math.java Tue Apr 19 16:01:27 2011 -0700
66.2 +++ b/src/share/classes/java/lang/Math.java Tue Apr 26 15:48:03 2011 -0700
66.3 @@ -1,5 +1,5 @@
66.4 /*
66.5 - * Copyright (c) 1994, 2010, Oracle and/or its affiliates. All rights reserved.
66.6 + * Copyright (c) 1994, 2011, Oracle and/or its affiliates. All rights reserved.
66.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
66.8 *
66.9 * This code is free software; you can redistribute it and/or modify it
66.10 @@ -627,11 +627,9 @@
66.11 }
66.12
66.13 /**
66.14 - * Returns the closest {@code int} to the argument. The
66.15 - * result is rounded to an integer by adding 1/2, taking the
66.16 - * floor of the result, and casting the result to type {@code int}.
66.17 - * In other words, the result is equal to the value of the expression:
66.18 - * <p>{@code (int)Math.floor(a + 0.5f)}
66.19 + * Returns the closest {@code int} to the argument, with ties
66.20 + * rounding up.
66.21 + *
66.22 * <p>
66.23 * Special cases:
66.24 * <ul><li>If the argument is NaN, the result is 0.
66.25 @@ -649,17 +647,17 @@
66.26 * @see java.lang.Integer#MIN_VALUE
66.27 */
66.28 public static int round(float a) {
66.29 - return (int)floor(a + 0.5f);
66.30 + if (a != 0x1.fffffep-2f) // greatest float value less than 0.5
66.31 + return (int)floor(a + 0.5f);
66.32 + else
66.33 + return 0;
66.34 }
66.35
66.36 /**
66.37 - * Returns the closest {@code long} to the argument. The result
66.38 - * is rounded to an integer by adding 1/2, taking the floor of the
66.39 - * result, and casting the result to type {@code long}. In other
66.40 - * words, the result is equal to the value of the expression:
66.41 - * <p>{@code (long)Math.floor(a + 0.5d)}
66.42 - * <p>
66.43 - * Special cases:
66.44 + * Returns the closest {@code long} to the argument, with ties
66.45 + * rounding up.
66.46 + *
66.47 + * <p>Special cases:
66.48 * <ul><li>If the argument is NaN, the result is 0.
66.49 * <li>If the argument is negative infinity or any value less than or
66.50 * equal to the value of {@code Long.MIN_VALUE}, the result is
66.51 @@ -676,7 +674,10 @@
66.52 * @see java.lang.Long#MIN_VALUE
66.53 */
66.54 public static long round(double a) {
66.55 - return (long)floor(a + 0.5d);
66.56 + if (a != 0x1.fffffffffffffp-2) // greatest double value less than 0.5
66.57 + return (long)floor(a + 0.5d);
66.58 + else
66.59 + return 0;
66.60 }
66.61
66.62 private static Random randomNumberGenerator;
67.1 --- a/src/share/classes/java/lang/Object.java Tue Apr 19 16:01:27 2011 -0700
67.2 +++ b/src/share/classes/java/lang/Object.java Tue Apr 26 15:48:03 2011 -0700
67.3 @@ -58,9 +58,8 @@
67.4 *
67.5 * @return The {@code Class} object that represents the runtime
67.6 * class of this object.
67.7 - * @see <a href="http://java.sun.com/docs/books/jls/">The Java
67.8 - * Language Specification, Third Edition (15.8.2 Class
67.9 - * Literals)</a>
67.10 + * @see Class Literals, section 15.8.2 of
67.11 + * <cite>The Java™ Language Specification</cite>.
67.12 */
67.13 public final native Class<?> getClass();
67.14
68.1 --- a/src/share/classes/java/lang/Override.java Tue Apr 19 16:01:27 2011 -0700
68.2 +++ b/src/share/classes/java/lang/Override.java Tue Apr 26 15:48:03 2011 -0700
68.3 @@ -43,7 +43,7 @@
68.4 *
68.5 * @author Peter von der Ahé
68.6 * @author Joshua Bloch
68.7 - * @jls3 9.6.1.4 Override
68.8 + * @jls 9.6.1.4 Override
68.9 * @since 1.5
68.10 */
68.11 @Target(ElementType.METHOD)
69.1 --- a/src/share/classes/java/lang/Package.java Tue Apr 19 16:01:27 2011 -0700
69.2 +++ b/src/share/classes/java/lang/Package.java Tue Apr 26 15:48:03 2011 -0700
69.3 @@ -109,10 +109,9 @@
69.4 /**
69.5 * Return the name of this package.
69.6 *
69.7 - * @return The fully-qualified name of this package as defined in the
69.8 - * <em>Java Language Specification, Third Edition</em>
69.9 - * <a href="http://java.sun.com/docs/books/jls/third_edition/html/names.html#6.5.3">
69.10 - * §6.5.3</a>, for example, {@code java.lang}
69.11 + * @return The fully-qualified name of this package as defined in section 6.5.3 of
69.12 + * <cite>The Java™ Language Specification</cite>,
69.13 + * for example, {@code java.lang}
69.14 */
69.15 public String getName() {
69.16 return pkgName;
70.1 --- a/src/share/classes/java/lang/RuntimeException.java Tue Apr 19 16:01:27 2011 -0700
70.2 +++ b/src/share/classes/java/lang/RuntimeException.java Tue Apr 26 15:48:03 2011 -0700
70.3 @@ -37,7 +37,7 @@
70.4 * propagate outside the method or constructor boundary.
70.5 *
70.6 * @author Frank Yellin
70.7 - * @jls3 11.2 Compile-Time Checking of Exceptions
70.8 + * @jls 11.2 Compile-Time Checking of Exceptions
70.9 * @since JDK1.0
70.10 */
70.11 public class RuntimeException extends Exception {
71.1 --- a/src/share/classes/java/lang/SafeVarargs.java Tue Apr 19 16:01:27 2011 -0700
71.2 +++ b/src/share/classes/java/lang/SafeVarargs.java Tue Apr 26 15:48:03 2011 -0700
71.3 @@ -70,8 +70,8 @@
71.4 *
71.5 * </ul>
71.6 *
71.7 - * @jls3 4.7 Reifiable Types
71.8 - * @jls3 8.4.1 Formal Parameters
71.9 + * @jls 4.7 Reifiable Types
71.10 + * @jls 8.4.1 Formal Parameters
71.11 */
71.12 @Documented
71.13 @Retention(RetentionPolicy.RUNTIME)
72.1 --- a/src/share/classes/java/lang/Short.java Tue Apr 19 16:01:27 2011 -0700
72.2 +++ b/src/share/classes/java/lang/Short.java Tue Apr 26 15:48:03 2011 -0700
72.3 @@ -256,9 +256,9 @@
72.4 * </blockquote>
72.5 *
72.6 * <i>DecimalNumeral</i>, <i>HexDigits</i>, and <i>OctalDigits</i>
72.7 - * are defined in <a href="http://java.sun.com/docs/books/jls/second_edition/html/lexical.doc.html#48282">§3.10.1</a>
72.8 - * of the <a href="http://java.sun.com/docs/books/jls/html/">Java
72.9 - * Language Specification</a>.
72.10 + * are as defined in section 3.10.1 of
72.11 + * <cite>The Java™ Language Specification</cite>,
72.12 + * except that underscores are not accepted between digits.
72.13 *
72.14 * <p>The sequence of characters following an optional
72.15 * sign and/or radix specifier ("{@code 0x}", "{@code 0X}",
73.1 --- a/src/share/classes/java/lang/StrictMath.java Tue Apr 19 16:01:27 2011 -0700
73.2 +++ b/src/share/classes/java/lang/StrictMath.java Tue Apr 26 15:48:03 2011 -0700
73.3 @@ -1,5 +1,5 @@
73.4 /*
73.5 - * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
73.6 + * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
73.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
73.8 *
73.9 * This code is free software; you can redistribute it and/or modify it
73.10 @@ -613,11 +613,8 @@
73.11 public static native double pow(double a, double b);
73.12
73.13 /**
73.14 - * Returns the closest {@code int} to the argument. The
73.15 - * result is rounded to an integer by adding 1/2, taking the
73.16 - * floor of the result, and casting the result to type {@code int}.
73.17 - * In other words, the result is equal to the value of the expression:
73.18 - * <p>{@code (int)Math.floor(a + 0.5f)}
73.19 + * Returns the closest {@code int} to the argument, with ties
73.20 + * rounding up.
73.21 *
73.22 * <p>Special cases:
73.23 * <ul><li>If the argument is NaN, the result is 0.
73.24 @@ -635,15 +632,12 @@
73.25 * @see java.lang.Integer#MIN_VALUE
73.26 */
73.27 public static int round(float a) {
73.28 - return (int)floor(a + 0.5f);
73.29 + return Math.round(a);
73.30 }
73.31
73.32 /**
73.33 - * Returns the closest {@code long} to the argument. The result
73.34 - * is rounded to an integer by adding 1/2, taking the floor of the
73.35 - * result, and casting the result to type {@code long}. In other
73.36 - * words, the result is equal to the value of the expression:
73.37 - * <p>{@code (long)Math.floor(a + 0.5d)}
73.38 + * Returns the closest {@code long} to the argument, with ties
73.39 + * rounding up.
73.40 *
73.41 * <p>Special cases:
73.42 * <ul><li>If the argument is NaN, the result is 0.
73.43 @@ -662,7 +656,7 @@
73.44 * @see java.lang.Long#MIN_VALUE
73.45 */
73.46 public static long round(double a) {
73.47 - return (long)floor(a + 0.5d);
73.48 + return Math.round(a);
73.49 }
73.50
73.51 private static Random randomNumberGenerator;
74.1 --- a/src/share/classes/java/lang/String.java Tue Apr 19 16:01:27 2011 -0700
74.2 +++ b/src/share/classes/java/lang/String.java Tue Apr 26 15:48:03 2011 -0700
74.3 @@ -2819,8 +2819,8 @@
74.4 * extra arguments are ignored. The number of arguments is
74.5 * variable and may be zero. The maximum number of arguments is
74.6 * limited by the maximum dimension of a Java array as defined by
74.7 - * the <a href="http://java.sun.com/docs/books/vmspec/">Java
74.8 - * Virtual Machine Specification</a>. The behaviour on a
74.9 + * <cite>The Java™ Virtual Machine Specification</cite>.
74.10 + * The behaviour on a
74.11 * <tt>null</tt> argument depends on the <a
74.12 * href="../util/Formatter.html#syntax">conversion</a>.
74.13 *
74.14 @@ -2863,8 +2863,8 @@
74.15 * extra arguments are ignored. The number of arguments is
74.16 * variable and may be zero. The maximum number of arguments is
74.17 * limited by the maximum dimension of a Java array as defined by
74.18 - * the <a href="http://java.sun.com/docs/books/vmspec/">Java
74.19 - * Virtual Machine Specification</a>. The behaviour on a
74.20 + * <cite>The Java™ Virtual Machine Specification</cite>.
74.21 + * The behaviour on a
74.22 * <tt>null</tt> argument depends on the <a
74.23 * href="../util/Formatter.html#syntax">conversion</a>.
74.24 *
74.25 @@ -3066,9 +3066,8 @@
74.26 * if and only if <code>s.equals(t)</code> is <code>true</code>.
74.27 * <p>
74.28 * All literal strings and string-valued constant expressions are
74.29 - * interned. String literals are defined in §3.10.5 of the
74.30 - * <a href="http://java.sun.com/docs/books/jls/html/">Java Language
74.31 - * Specification</a>
74.32 + * interned. String literals are defined in section 3.10.5 of the
74.33 + * <cite>The Java™ Language Specification</cite>.
74.34 *
74.35 * @return a string that has the same contents as this string, but is
74.36 * guaranteed to be from a pool of unique strings.
75.1 --- a/src/share/classes/java/lang/Throwable.java Tue Apr 19 16:01:27 2011 -0700
75.2 +++ b/src/share/classes/java/lang/Throwable.java Tue Apr 26 15:48:03 2011 -0700
75.3 @@ -108,7 +108,7 @@
75.4 * @author unascribed
75.5 * @author Josh Bloch (Added exception chaining and programmatic access to
75.6 * stack trace in 1.4.)
75.7 - * @jls3 11.2 Compile-Time Checking of Exceptions
75.8 + * @jls 11.2 Compile-Time Checking of Exceptions
75.9 * @since JDK1.0
75.10 */
75.11 public class Throwable implements Serializable {
76.1 --- a/src/share/classes/java/lang/annotation/Annotation.java Tue Apr 19 16:01:27 2011 -0700
76.2 +++ b/src/share/classes/java/lang/annotation/Annotation.java Tue Apr 26 15:48:03 2011 -0700
76.3 @@ -31,9 +31,8 @@
76.4 * an annotation type. Also note that this interface does not itself
76.5 * define an annotation type.
76.6 *
76.7 - * More information about annotation types can be found in <i>The
76.8 - * Java™ Language Specification, Third Edition</i>, <a
76.9 - * href="http://java.sun.com/docs/books/jls/third_edition/html/interfaces.html#9.6">§9.6</a>.
76.10 + * More information about annotation types can be found in section 9.6 of
76.11 + * <cite>The Java™ Language Specification</cite>.
76.12 *
76.13 * @author Josh Bloch
76.14 * @since 1.5
77.1 --- a/src/share/classes/java/lang/instrument/ClassFileTransformer.java Tue Apr 19 16:01:27 2011 -0700
77.2 +++ b/src/share/classes/java/lang/instrument/ClassFileTransformer.java Tue Apr 26 15:48:03 2011 -0700
77.3 @@ -36,9 +36,9 @@
77.4 * to transform class files.
77.5 * The transformation occurs before the class is defined by the JVM.
77.6 * <P>
77.7 - * Note the term <i>class file</i> is used as defined in the chapter
77.8 - * <a href="http://java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc.html#80959">The class File Format</a>
77.9 - * of <i>The Java Virtual Machine Specification</i>, to mean a sequence
77.10 + * Note the term <i>class file</i> is used as defined in section 3.1 of
77.11 + * <cite>The Java™ Virtual Machine Specification</cite>,
77.12 + * to mean a sequence
77.13 * of bytes in class file format, whether or not they reside in a file.
77.14 *
77.15 * @see java.lang.instrument.Instrumentation
78.1 --- a/src/share/classes/java/lang/instrument/Instrumentation.java Tue Apr 19 16:01:27 2011 -0700
78.2 +++ b/src/share/classes/java/lang/instrument/Instrumentation.java Tue Apr 26 15:48:03 2011 -0700
78.3 @@ -434,8 +434,9 @@
78.4 * avoiding these types of issues, is to use a unique package name for the
78.5 * instrumentation classes.
78.6 *
78.7 - * <p> The <a href="http://java.sun.com/docs/books/vmspec/">Java Virtual Machine
78.8 - * Specification</a> specifies that a subsequent attempt to resolve a symbolic
78.9 + * <p>
78.10 + * <cite>The Java™ Virtual Machine Specification</cite>
78.11 + * specifies that a subsequent attempt to resolve a symbolic
78.12 * reference that the Java virtual machine has previously unsuccessfully attempted
78.13 * to resolve always fails with the same error that was thrown as a result of the
78.14 * initial resolution attempt. Consequently, if the JAR file contains an entry
78.15 @@ -487,8 +488,9 @@
78.16 * getName()} method on the <code>jarfile</code> and this is provided as the
78.17 * parameter to the <code>appendToClassPathForInstrumentation</code> method.
78.18 *
78.19 - * <p> The <a href="http://java.sun.com/docs/books/vmspec/">Java Virtual Machine
78.20 - * Specification</a> specifies that a subsequent attempt to resolve a symbolic
78.21 + * <p>
78.22 + * <cite>The Java™ Virtual Machine Specification</cite>
78.23 + * specifies that a subsequent attempt to resolve a symbolic
78.24 * reference that the Java virtual machine has previously unsuccessfully attempted
78.25 * to resolve always fails with the same error that was thrown as a result of the
78.26 * initial resolution attempt. Consequently, if the JAR file contains an entry
79.1 --- a/src/share/classes/java/lang/invoke/package-info.java Tue Apr 19 16:01:27 2011 -0700
79.2 +++ b/src/share/classes/java/lang/invoke/package-info.java Tue Apr 26 15:48:03 2011 -0700
79.3 @@ -194,8 +194,8 @@
79.4 * Method handle constants for subtags {@code REF_getStatic}, {@code REF_putStatic}, and {@code REF_invokeStatic}
79.5 * may force class initialization on their first invocation, just like the corresponding bytecodes.
79.6 * <p>
79.7 - * The rules of section 5.4.3 of the
79.8 - * <a href="http://java.sun.com/docs/books/jvms/second_edition/html/ConstantPool.doc.html#73492">JVM Specification</a>
79.9 + * The rules of section 5.4.3 of
79.10 + * <cite>The Java™ Virtual Machine Specification</cite>
79.11 * apply to the resolution of {@code CONSTANT_MethodType}, {@code CONSTANT_MethodHandle},
79.12 * and {@code CONSTANT_InvokeDynamic} constants,
79.13 * by the execution of {@code invokedynamic} and {@code ldc} instructions.
80.1 --- a/src/share/classes/java/lang/reflect/Constructor.java Tue Apr 19 16:01:27 2011 -0700
80.2 +++ b/src/share/classes/java/lang/reflect/Constructor.java Tue Apr 26 15:48:03 2011 -0700
80.3 @@ -186,8 +186,8 @@
80.4 * the type variables declared by this generic declaration
80.5 * @throws GenericSignatureFormatError if the generic
80.6 * signature of this generic declaration does not conform to
80.7 - * the format specified in the Java Virtual Machine Specification,
80.8 - * 3rd edition
80.9 + * the format specified in
80.10 + * <cite>The Java™ Virtual Machine Specification</cite>
80.11 * @since 1.5
80.12 */
80.13 public TypeVariable<Constructor<T>>[] getTypeParameters() {
80.14 @@ -229,7 +229,8 @@
80.15 * parameter types of the underlying method, in declaration order
80.16 * @throws GenericSignatureFormatError
80.17 * if the generic method signature does not conform to the format
80.18 - * specified in the Java Virtual Machine Specification, 3rd edition
80.19 + * specified in
80.20 + * <cite>The Java™ Virtual Machine Specification</cite>
80.21 * @throws TypeNotPresentException if any of the parameter
80.22 * types of the underlying method refers to a non-existent type
80.23 * declaration
80.24 @@ -273,7 +274,8 @@
80.25 * thrown by the underlying method
80.26 * @throws GenericSignatureFormatError
80.27 * if the generic method signature does not conform to the format
80.28 - * specified in the Java Virtual Machine Specification, 3rd edition
80.29 + * specified in
80.30 + * <cite>The Java™ Virtual Machine Specification</cite>
80.31 * @throws TypeNotPresentException if the underlying method's
80.32 * {@code throws} clause refers to a non-existent type declaration
80.33 * @throws MalformedParameterizedTypeException if
80.34 @@ -468,8 +470,8 @@
80.35 *
80.36 * <p>If the constructor's declaring class is an inner class in a
80.37 * non-static context, the first argument to the constructor needs
80.38 - * to be the enclosing instance; see <i>The Java Language
80.39 - * Specification</i>, section 15.9.3.
80.40 + * to be the enclosing instance; see section 15.9.3 of
80.41 + * <cite>The Java™ Language Specification</cite>.
80.42 *
80.43 * <p>If the required access and argument checks succeed and the
80.44 * instantiation will proceed, the constructor's declaring class
80.45 @@ -541,7 +543,8 @@
80.46 * constructor; returns {@code false} otherwise.
80.47 *
80.48 * @return true if and only if this constructor is a synthetic
80.49 - * constructor as defined by the Java Language Specification.
80.50 + * constructor as defined by
80.51 + * <cite>The Java™ Language Specification</cite>.
80.52 * @since 1.5
80.53 */
80.54 public boolean isSynthetic() {
81.1 --- a/src/share/classes/java/lang/reflect/Field.java Tue Apr 19 16:01:27 2011 -0700
81.2 +++ b/src/share/classes/java/lang/reflect/Field.java Tue Apr 26 15:48:03 2011 -0700
81.3 @@ -221,8 +221,8 @@
81.4 * @return a {@code Type} object that represents the declared type for
81.5 * the field represented by this {@code Field} object
81.6 * @throws GenericSignatureFormatError if the generic field
81.7 - * signature does not conform to the format specified in the Java
81.8 - * Virtual Machine Specification, 3rd edition
81.9 + * signature does not conform to the format specified in
81.10 + * <cite>The Java™ Virtual Machine Specification</cite>
81.11 * @throws TypeNotPresentException if the generic type
81.12 * signature of the underlying field refers to a non-existent
81.13 * type declaration
82.1 --- a/src/share/classes/java/lang/reflect/GenericDeclaration.java Tue Apr 19 16:01:27 2011 -0700
82.2 +++ b/src/share/classes/java/lang/reflect/GenericDeclaration.java Tue Apr 26 15:48:03 2011 -0700
82.3 @@ -42,8 +42,8 @@
82.4 * the type variables declared by this generic declaration
82.5 * @throws GenericSignatureFormatError if the generic
82.6 * signature of this generic declaration does not conform to
82.7 - * the format specified in the Java Virtual Machine Specification,
82.8 - * 3rd edition
82.9 + * the format specified in
82.10 + * <cite>The Java™ Virtual Machine Specification</cite>
82.11 */
82.12 public TypeVariable<?>[] getTypeParameters();
82.13 }
83.1 --- a/src/share/classes/java/lang/reflect/Method.java Tue Apr 19 16:01:27 2011 -0700
83.2 +++ b/src/share/classes/java/lang/reflect/Method.java Tue Apr 26 15:48:03 2011 -0700
83.3 @@ -194,8 +194,8 @@
83.4 * the type variables declared by this generic declaration
83.5 * @throws GenericSignatureFormatError if the generic
83.6 * signature of this generic declaration does not conform to
83.7 - * the format specified in the Java Virtual Machine Specification,
83.8 - * 3rd edition
83.9 + * the format specified in
83.10 + * <cite>The Java™ Virtual Machine Specification</cite>
83.11 * @since 1.5
83.12 */
83.13 public TypeVariable<Method>[] getTypeParameters() {
83.14 @@ -230,7 +230,8 @@
83.15 * type of the underlying method
83.16 * @throws GenericSignatureFormatError
83.17 * if the generic method signature does not conform to the format
83.18 - * specified in the Java Virtual Machine Specification, 3rd edition
83.19 + * specified in
83.20 + * <cite>The Java™ Virtual Machine Specification</cite>
83.21 * @throws TypeNotPresentException if the underlying method's
83.22 * return type refers to a non-existent type declaration
83.23 * @throws MalformedParameterizedTypeException if the
83.24 @@ -275,7 +276,8 @@
83.25 * parameter types of the underlying method, in declaration order
83.26 * @throws GenericSignatureFormatError
83.27 * if the generic method signature does not conform to the format
83.28 - * specified in the Java Virtual Machine Specification, 3rd edition
83.29 + * specified in
83.30 + * <cite>The Java™ Virtual Machine Specification</cite>
83.31 * @throws TypeNotPresentException if any of the parameter
83.32 * types of the underlying method refers to a non-existent type
83.33 * declaration
83.34 @@ -319,7 +321,8 @@
83.35 * thrown by the underlying method
83.36 * @throws GenericSignatureFormatError
83.37 * if the generic method signature does not conform to the format
83.38 - * specified in the Java Virtual Machine Specification, 3rd edition
83.39 + * specified in
83.40 + * <cite>The Java™ Virtual Machine Specification</cite>
83.41 * @throws TypeNotPresentException if the underlying method's
83.42 * {@code throws} clause refers to a non-existent type declaration
83.43 * @throws MalformedParameterizedTypeException if
84.1 --- a/src/share/classes/java/lang/reflect/Modifier.java Tue Apr 19 16:01:27 2011 -0700
84.2 +++ b/src/share/classes/java/lang/reflect/Modifier.java Tue Apr 26 15:48:03 2011 -0700
84.3 @@ -34,14 +34,8 @@
84.4 * constants to decode class and member access modifiers. The sets of
84.5 * modifiers are represented as integers with distinct bit positions
84.6 * representing different modifiers. The values for the constants
84.7 - * representing the modifiers are taken from <a
84.8 - * href="http://java.sun.com/docs/books/vmspec/2nd-edition/html/VMSpecTOC.doc.html"><i>The
84.9 - * Java</i><sup><small>TM</small></sup> <i>Virtual Machine Specification, Second
84.10 - * edition</i></a> tables
84.11 - * <a href="http://java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc.html#75734">4.1</a>,
84.12 - * <a href="http://java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc.html#88358">4.4</a>,
84.13 - * <a href="http://java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc.html#75568">4.5</a>, and
84.14 - * <a href="http://java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc.html#88478">4.7</a>.
84.15 + * representing the modifiers are taken from the tables in sections 4.1, 4.4, 4.5, and 4.7 of
84.16 + * <cite>The Java™ Virtual Machine Specification</cite>.
84.17 *
84.18 * @see Class#getModifiers()
84.19 * @see Member#getModifiers()
84.20 @@ -214,14 +208,8 @@
84.21 * public final synchronized strictfp
84.22 * </pre></blockquote>
84.23 * The modifier names are returned in an order consistent with the
84.24 - * suggested modifier orderings given in <a
84.25 - * href="http://java.sun.com/docs/books/jls/second_edition/html/j.title.doc.html"><em>The
84.26 - * Java Language Specification, Second Edition</em></a> sections
84.27 - * <a href="http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#21613">§8.1.1</a>,
84.28 - * <a href="http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#78091">§8.3.1</a>,
84.29 - * <a href="http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#78188">§8.4.3</a>,
84.30 - * <a href="http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#42018">§8.8.3</a>, and
84.31 - * <a href="http://java.sun.com/docs/books/jls/second_edition/html/interfaces.doc.html#235947">§9.1.1</a>.
84.32 + * suggested modifier orderings given in sections 8.1.1, 8.3.1, 8.4.3, 8.8.3, and 9.1.1 of
84.33 + * <cite>The Java™ Language Specification</cite>.
84.34 * The full modifier ordering used by this method is:
84.35 * <blockquote> {@code
84.36 * public protected private abstract static final transient
84.37 @@ -269,9 +257,8 @@
84.38 }
84.39
84.40 /*
84.41 - * Access modifier flag constants from <em>The Java Virtual
84.42 - * Machine Specification, Second Edition</em>, tables 4.1, 4.4,
84.43 - * 4.5, and 4.7.
84.44 + * Access modifier flag constants from tables 4.1, 4.4, 4.5, and 4.7 of
84.45 + * <cite>The Java™ Virtual Machine Specification</cite>
84.46 */
84.47
84.48 /**
84.49 @@ -403,7 +390,7 @@
84.50 * @return an {@code int} value OR-ing together the source language
84.51 * modifiers that can be applied to a class.
84.52 *
84.53 - * @jls3 8.1.1 Class Modifiers
84.54 + * @jls 8.1.1 Class Modifiers
84.55 * @since 1.7
84.56 */
84.57 public static int classModifiers() {
84.58 @@ -416,7 +403,7 @@
84.59 * @return an {@code int} value OR-ing together the source language
84.60 * modifiers that can be applied to an inteface.
84.61 *
84.62 - * @jls3 9.1.1 Interface Modifiers
84.63 + * @jls 9.1.1 Interface Modifiers
84.64 * @since 1.7
84.65 */
84.66 public static int interfaceModifiers() {
84.67 @@ -429,7 +416,7 @@
84.68 * @return an {@code int} value OR-ing together the source language
84.69 * modifiers that can be applied to a constructor.
84.70 *
84.71 - * @jls3 8.8.3 Constructor Modifiers
84.72 + * @jls 8.8.3 Constructor Modifiers
84.73 * @since 1.7
84.74 */
84.75 public static int constructorModifiers() {
84.76 @@ -442,7 +429,7 @@
84.77 * @return an {@code int} value OR-ing together the source language
84.78 * modifiers that can be applied to a method.
84.79 *
84.80 - * @jls3 8.4.3 Method Modifiers
84.81 + * @jls 8.4.3 Method Modifiers
84.82 * @since 1.7
84.83 */
84.84 public static int methodModifiers() {
84.85 @@ -456,7 +443,7 @@
84.86 * @return an {@code int} value OR-ing together the source language
84.87 * modifiers that can be applied to a field.
84.88 *
84.89 - * @jls3 8.3.1 Field Modifiers
84.90 + * @jls 8.3.1 Field Modifiers
84.91 * @since 1.7
84.92 */
84.93 public static int fieldModifiers() {
85.1 --- a/src/share/classes/java/math/BigDecimal.java Tue Apr 19 16:01:27 2011 -0700
85.2 +++ b/src/share/classes/java/math/BigDecimal.java Tue Apr 26 15:48:03 2011 -0700
85.3 @@ -2905,12 +2905,11 @@
85.4
85.5 /**
85.6 * Converts this {@code BigDecimal} to a {@code BigInteger}.
85.7 - * This conversion is analogous to a <a
85.8 - * href="http://java.sun.com/docs/books/jls/second_edition/html/conversions.doc.html#25363"><i>narrowing
85.9 - * primitive conversion</i></a> from {@code double} to
85.10 - * {@code long} as defined in the <a
85.11 - * href="http://java.sun.com/docs/books/jls/html/">Java Language
85.12 - * Specification</a>: any fractional part of this
85.13 + * This conversion is analogous to the
85.14 + * <i>narrowing primitive conversion</i> from {@code double} to
85.15 + * {@code long} as defined in section 5.1.3 of
85.16 + * <cite>The Java™ Language Specification</cite>:
85.17 + * any fractional part of this
85.18 * {@code BigDecimal} will be discarded. Note that this
85.19 * conversion can lose information about the precision of the
85.20 * {@code BigDecimal} value.
85.21 @@ -2942,13 +2941,12 @@
85.22 }
85.23
85.24 /**
85.25 - * Converts this {@code BigDecimal} to a {@code long}. This
85.26 - * conversion is analogous to a <a
85.27 - * href="http://java.sun.com/docs/books/jls/second_edition/html/conversions.doc.html#25363"><i>narrowing
85.28 - * primitive conversion</i></a> from {@code double} to
85.29 - * {@code short} as defined in the <a
85.30 - * href="http://java.sun.com/docs/books/jls/html/">Java Language
85.31 - * Specification</a>: any fractional part of this
85.32 + * Converts this {@code BigDecimal} to a {@code long}.
85.33 + * This conversion is analogous to the
85.34 + * <i>narrowing primitive conversion</i> from {@code double} to
85.35 + * {@code short} as defined in section 5.1.3 of
85.36 + * <cite>The Java™ Language Specification</cite>:
85.37 + * any fractional part of this
85.38 * {@code BigDecimal} will be discarded, and if the resulting
85.39 * "{@code BigInteger}" is too big to fit in a
85.40 * {@code long}, only the low-order 64 bits are returned.
85.41 @@ -3011,13 +3009,12 @@
85.42 }
85.43
85.44 /**
85.45 - * Converts this {@code BigDecimal} to an {@code int}. This
85.46 - * conversion is analogous to a <a
85.47 - * href="http://java.sun.com/docs/books/jls/second_edition/html/conversions.doc.html#25363"><i>narrowing
85.48 - * primitive conversion</i></a> from {@code double} to
85.49 - * {@code short} as defined in the <a
85.50 - * href="http://java.sun.com/docs/books/jls/html/">Java Language
85.51 - * Specification</a>: any fractional part of this
85.52 + * Converts this {@code BigDecimal} to an {@code int}.
85.53 + * This conversion is analogous to the
85.54 + * <i>narrowing primitive conversion</i> from {@code double} to
85.55 + * {@code short} as defined in section 5.1.3 of
85.56 + * <cite>The Java™ Language Specification</cite>:
85.57 + * any fractional part of this
85.58 * {@code BigDecimal} will be discarded, and if the resulting
85.59 * "{@code BigInteger}" is too big to fit in an
85.60 * {@code int}, only the low-order 32 bits are returned.
85.61 @@ -3095,12 +3092,11 @@
85.62
85.63 /**
85.64 * Converts this {@code BigDecimal} to a {@code float}.
85.65 - * This conversion is similar to the <a
85.66 - * href="http://java.sun.com/docs/books/jls/second_edition/html/conversions.doc.html#25363"><i>narrowing
85.67 - * primitive conversion</i></a> from {@code double} to
85.68 - * {@code float} defined in the <a
85.69 - * href="http://java.sun.com/docs/books/jls/html/">Java Language
85.70 - * Specification</a>: if this {@code BigDecimal} has too great a
85.71 + * This conversion is similar to the
85.72 + * <i>narrowing primitive conversion</i> from {@code double} to
85.73 + * {@code float} as defined in section 5.1.3 of
85.74 + * <cite>The Java™ Language Specification</cite>:
85.75 + * if this {@code BigDecimal} has too great a
85.76 * magnitude to represent as a {@code float}, it will be
85.77 * converted to {@link Float#NEGATIVE_INFINITY} or {@link
85.78 * Float#POSITIVE_INFINITY} as appropriate. Note that even when
85.79 @@ -3119,12 +3115,11 @@
85.80
85.81 /**
85.82 * Converts this {@code BigDecimal} to a {@code double}.
85.83 - * This conversion is similar to the <a
85.84 - * href="http://java.sun.com/docs/books/jls/second_edition/html/conversions.doc.html#25363"><i>narrowing
85.85 - * primitive conversion</i></a> from {@code double} to
85.86 - * {@code float} as defined in the <a
85.87 - * href="http://java.sun.com/docs/books/jls/html/">Java Language
85.88 - * Specification</a>: if this {@code BigDecimal} has too great a
85.89 + * This conversion is similar to the
85.90 + * <i>narrowing primitive conversion</i> from {@code double} to
85.91 + * {@code float} as defined in section 5.1.3 of
85.92 + * <cite>The Java™ Language Specification</cite>:
85.93 + * if this {@code BigDecimal} has too great a
85.94 * magnitude represent as a {@code double}, it will be
85.95 * converted to {@link Double#NEGATIVE_INFINITY} or {@link
85.96 * Double#POSITIVE_INFINITY} as appropriate. Note that even when
86.1 --- a/src/share/classes/java/math/BigInteger.java Tue Apr 19 16:01:27 2011 -0700
86.2 +++ b/src/share/classes/java/math/BigInteger.java Tue Apr 26 15:48:03 2011 -0700
86.3 @@ -2719,12 +2719,11 @@
86.4
86.5 /**
86.6 * Converts this BigInteger to an {@code int}. This
86.7 - * conversion is analogous to a <a
86.8 - * href="http://java.sun.com/docs/books/jls/second_edition/html/conversions.doc.html#25363"><i>narrowing
86.9 - * primitive conversion</i></a> from {@code long} to
86.10 - * {@code int} as defined in the <a
86.11 - * href="http://java.sun.com/docs/books/jls/html/">Java Language
86.12 - * Specification</a>: if this BigInteger is too big to fit in an
86.13 + * conversion is analogous to a
86.14 + * <i>narrowing primitive conversion</i> from {@code long} to
86.15 + * {@code int} as defined in section 5.1.3 of
86.16 + * <cite>The Java™ Language Specification</cite>:
86.17 + * if this BigInteger is too big to fit in an
86.18 * {@code int}, only the low-order 32 bits are returned.
86.19 * Note that this conversion can lose information about the
86.20 * overall magnitude of the BigInteger value as well as return a
86.21 @@ -2740,12 +2739,11 @@
86.22
86.23 /**
86.24 * Converts this BigInteger to a {@code long}. This
86.25 - * conversion is analogous to a <a
86.26 - * href="http://java.sun.com/docs/books/jls/second_edition/html/conversions.doc.html#25363"><i>narrowing
86.27 - * primitive conversion</i></a> from {@code long} to
86.28 - * {@code int} as defined in the <a
86.29 - * href="http://java.sun.com/docs/books/jls/html/">Java Language
86.30 - * Specification</a>: if this BigInteger is too big to fit in a
86.31 + * conversion is analogous to a
86.32 + * <i>narrowing primitive conversion</i> from {@code long} to
86.33 + * {@code int} as defined in section 5.1.3 of
86.34 + * <cite>The Java™ Language Specification</cite>:
86.35 + * if this BigInteger is too big to fit in a
86.36 * {@code long}, only the low-order 64 bits are returned.
86.37 * Note that this conversion can lose information about the
86.38 * overall magnitude of the BigInteger value as well as return a
86.39 @@ -2763,12 +2761,11 @@
86.40
86.41 /**
86.42 * Converts this BigInteger to a {@code float}. This
86.43 - * conversion is similar to the <a
86.44 - * href="http://java.sun.com/docs/books/jls/second_edition/html/conversions.doc.html#25363"><i>narrowing
86.45 - * primitive conversion</i></a> from {@code double} to
86.46 - * {@code float} defined in the <a
86.47 - * href="http://java.sun.com/docs/books/jls/html/">Java Language
86.48 - * Specification</a>: if this BigInteger has too great a magnitude
86.49 + * conversion is similar to the
86.50 + * <i>narrowing primitive conversion</i> from {@code double} to
86.51 + * {@code float} as defined in section 5.1.3 of
86.52 + * <cite>The Java™ Language Specification</cite>:
86.53 + * if this BigInteger has too great a magnitude
86.54 * to represent as a {@code float}, it will be converted to
86.55 * {@link Float#NEGATIVE_INFINITY} or {@link
86.56 * Float#POSITIVE_INFINITY} as appropriate. Note that even when
86.57 @@ -2784,12 +2781,11 @@
86.58
86.59 /**
86.60 * Converts this BigInteger to a {@code double}. This
86.61 - * conversion is similar to the <a
86.62 - * href="http://java.sun.com/docs/books/jls/second_edition/html/conversions.doc.html#25363"><i>narrowing
86.63 - * primitive conversion</i></a> from {@code double} to
86.64 - * {@code float} defined in the <a
86.65 - * href="http://java.sun.com/docs/books/jls/html/">Java Language
86.66 - * Specification</a>: if this BigInteger has too great a magnitude
86.67 + * conversion is similar to the
86.68 + * <i>narrowing primitive conversion</i> from {@code double} to
86.69 + * {@code float} as defined in section 5.1.3 of
86.70 + * <cite>The Java™ Language Specification</cite>:
86.71 + * if this BigInteger has too great a magnitude
86.72 * to represent as a {@code double}, it will be converted to
86.73 * {@link Double#NEGATIVE_INFINITY} or {@link
86.74 * Double#POSITIVE_INFINITY} as appropriate. Note that even when
87.1 --- a/src/share/classes/java/security/SecureClassLoader.java Tue Apr 19 16:01:27 2011 -0700
87.2 +++ b/src/share/classes/java/security/SecureClassLoader.java Tue Apr 26 15:48:03 2011 -0700
87.3 @@ -118,10 +118,8 @@
87.4 * and without a trailing ".class" suffix.
87.5 * @param b the bytes that make up the class data. The bytes in
87.6 * positions <code>off</code> through <code>off+len-1</code>
87.7 - * should have the format of a valid class file as defined
87.8 - * by the
87.9 - * <a href="http://java.sun.com/docs/books/vmspec/">Java
87.10 - * Virtual Machine Specification</a>.
87.11 + * should have the format of a valid class file as defined by
87.12 + * <cite>The Java™ Virtual Machine Specification</cite>.
87.13 * @param off the start offset in <code>b</code> of the class data
87.14 * @param len the length of the class data
87.15 * @param cs the associated CodeSource, or <code>null</code> if none
87.16 @@ -157,9 +155,8 @@
87.17 * and without a trailing ".class" suffix.
87.18 * @param b the bytes that make up the class data. The bytes from positions
87.19 * <tt>b.position()</tt> through <tt>b.position() + b.limit() -1</tt>
87.20 - * should have the format of a valid class file as defined by the
87.21 - * <a href="http://java.sun.com/docs/books/vmspec/">Java Virtual
87.22 - * Machine Specification</a>.
87.23 + * should have the format of a valid class file as defined by
87.24 + * <cite>The Java™ Virtual Machine Specification</cite>.
87.25 * @param cs the associated CodeSource, or <code>null</code> if none
87.26 * @return the <code>Class</code> object created from the data,
87.27 * and optional CodeSource.
88.1 --- a/src/share/classes/java/sql/DriverManager.java Tue Apr 19 16:01:27 2011 -0700
88.2 +++ b/src/share/classes/java/sql/DriverManager.java Tue Apr 26 15:48:03 2011 -0700
88.3 @@ -80,7 +80,7 @@
88.4
88.5
88.6 // List of registered JDBC drivers
88.7 - private final static CopyOnWriteArrayList<Driver> registeredDrivers = new CopyOnWriteArrayList<Driver>();
88.8 + private final static CopyOnWriteArrayList<DriverInfo> registeredDrivers = new CopyOnWriteArrayList<DriverInfo>();
88.9 private static volatile int loginTimeout = 0;
88.10 private static volatile java.io.PrintWriter logWriter = null;
88.11 private static volatile java.io.PrintStream logStream = null;
88.12 @@ -265,22 +265,22 @@
88.13
88.14 // Walk through the loaded registeredDrivers attempting to locate someone
88.15 // who understands the given URL.
88.16 - for (Driver aDriver : registeredDrivers) {
88.17 + for (DriverInfo aDriver : registeredDrivers) {
88.18 // If the caller does not have permission to load the driver then
88.19 // skip it.
88.20 - if(isDriverAllowed(aDriver, callerCL)) {
88.21 + if(isDriverAllowed(aDriver.driver, callerCL)) {
88.22 try {
88.23 - if(aDriver.acceptsURL(url)) {
88.24 + if(aDriver.driver.acceptsURL(url)) {
88.25 // Success!
88.26 - println("getDriver returning " + aDriver.getClass().getName());
88.27 - return (aDriver);
88.28 + println("getDriver returning " + aDriver.driver.getClass().getName());
88.29 + return (aDriver.driver);
88.30 }
88.31
88.32 } catch(SQLException sqe) {
88.33 // Drop through and try the next driver.
88.34 }
88.35 } else {
88.36 - println(" skipping: " + aDriver.getClass().getName());
88.37 + println(" skipping: " + aDriver.driver.getClass().getName());
88.38 }
88.39
88.40 }
88.41 @@ -305,7 +305,7 @@
88.42
88.43 /* Register the driver if it has not already been added to our list */
88.44 if(driver != null) {
88.45 - registeredDrivers.addIfAbsent(driver);
88.46 + registeredDrivers.addIfAbsent(new DriverInfo(driver));
88.47 } else {
88.48 // This is for compatibility with the original DriverManager
88.49 throw new NullPointerException();
88.50 @@ -333,9 +333,10 @@
88.51 ClassLoader callerCL = DriverManager.getCallerClassLoader();
88.52 println("DriverManager.deregisterDriver: " + driver);
88.53
88.54 - if(registeredDrivers.contains(driver)) {
88.55 + DriverInfo aDriver = new DriverInfo(driver);
88.56 + if(registeredDrivers.contains(aDriver)) {
88.57 if (isDriverAllowed(driver, callerCL)) {
88.58 - registeredDrivers.remove(driver);
88.59 + registeredDrivers.remove(aDriver);
88.60 } else {
88.61 // If the caller does not have permission to load the driver then
88.62 // throw a SecurityException.
88.63 @@ -363,11 +364,11 @@
88.64 ClassLoader callerCL = DriverManager.getCallerClassLoader();
88.65
88.66 // Walk through the loaded registeredDrivers.
88.67 - for(Driver aDriver : registeredDrivers) {
88.68 + for(DriverInfo aDriver : registeredDrivers) {
88.69 // If the caller does not have permission to load the driver then
88.70 // skip it.
88.71 - if(isDriverAllowed(aDriver, callerCL)) {
88.72 - result.addElement(aDriver);
88.73 + if(isDriverAllowed(aDriver.driver, callerCL)) {
88.74 + result.addElement(aDriver.driver);
88.75 } else {
88.76 println(" skipping: " + aDriver.getClass().getName());
88.77 }
88.78 @@ -482,8 +483,8 @@
88.79 private static void loadInitialDrivers() {
88.80 String drivers;
88.81 try {
88.82 - drivers = (String) AccessController.doPrivileged(new PrivilegedAction() {
88.83 - public Object run() {
88.84 + drivers = AccessController.doPrivileged(new PrivilegedAction<String>() {
88.85 + public String run() {
88.86 return System.getProperty("jdbc.drivers");
88.87 }
88.88 });
88.89 @@ -495,8 +496,8 @@
88.90 // exposed as a java.sql.Driver.class service.
88.91 // ServiceLoader.load() replaces the sun.misc.Providers()
88.92
88.93 - AccessController.doPrivileged(new PrivilegedAction() {
88.94 - public Object run() {
88.95 + AccessController.doPrivileged(new PrivilegedAction<Void>() {
88.96 + public Void run() {
88.97
88.98 ServiceLoader<Driver> loadedDrivers = ServiceLoader.load(Driver.class);
88.99 Iterator driversIterator = loadedDrivers.iterator();
88.100 @@ -569,16 +570,16 @@
88.101 // Remember the first exception that gets raised so we can reraise it.
88.102 SQLException reason = null;
88.103
88.104 - for(Driver aDriver : registeredDrivers) {
88.105 + for(DriverInfo aDriver : registeredDrivers) {
88.106 // If the caller does not have permission to load the driver then
88.107 // skip it.
88.108 - if(isDriverAllowed(aDriver, callerCL)) {
88.109 + if(isDriverAllowed(aDriver.driver, callerCL)) {
88.110 try {
88.111 - println(" trying " + aDriver.getClass().getName());
88.112 - Connection con = aDriver.connect(url, info);
88.113 + println(" trying " + aDriver.driver.getClass().getName());
88.114 + Connection con = aDriver.driver.connect(url, info);
88.115 if (con != null) {
88.116 // Success!
88.117 - println("getConnection returning " + aDriver.getClass().getName());
88.118 + println("getConnection returning " + aDriver.driver.getClass().getName());
88.119 return (con);
88.120 }
88.121 } catch (SQLException ex) {
88.122 @@ -607,3 +608,29 @@
88.123 private static native ClassLoader getCallerClassLoader();
88.124
88.125 }
88.126 +
88.127 +/*
88.128 + * Wrapper class for registered Drivers in order to not expose Driver.equals()
88.129 + * to avoid the capture of the Driver it being compared to as it might not
88.130 + * normally have access.
88.131 + */
88.132 +class DriverInfo {
88.133 +
88.134 + final Driver driver;
88.135 + DriverInfo(Driver driver) {
88.136 + this.driver = driver;
88.137 + }
88.138 +
88.139 + public boolean equals(Object other) {
88.140 + return (other instanceof DriverInfo)
88.141 + && this.driver == ((DriverInfo) other).driver;
88.142 + }
88.143 +
88.144 + public int hashCode() {
88.145 + return driver.hashCode();
88.146 + }
88.147 +
88.148 + public String toString() {
88.149 + return ("driver[className=" + driver + "]");
88.150 + }
88.151 +}
89.1 --- a/src/share/classes/java/sql/ResultSet.java Tue Apr 19 16:01:27 2011 -0700
89.2 +++ b/src/share/classes/java/sql/ResultSet.java Tue Apr 26 15:48:03 2011 -0700
89.3 @@ -1,5 +1,5 @@
89.4 /*
89.5 - * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
89.6 + * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
89.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
89.8 *
89.9 * This code is free software; you can redistribute it and/or modify it
89.10 @@ -137,7 +137,7 @@
89.11 * to retrieve the next result from a sequence of multiple results.
89.12 *
89.13 * <P>The number, types and properties of a <code>ResultSet</code>
89.14 - * object's columns are provided by the <code>ResulSetMetaData</code>
89.15 + * object's columns are provided by the <code>ResultSetMetaData</code>
89.16 * object returned by the <code>ResultSet.getMetaData</code> method.
89.17 *
89.18 * @see Statement#executeQuery
89.19 @@ -422,7 +422,7 @@
89.20 * of this <code>ResultSet</code> object as
89.21 * a stream of ASCII characters. The value can then be read in chunks from the
89.22 * stream. This method is particularly
89.23 - * suitable for retrieving large <char>LONGVARCHAR</char> values.
89.24 + * suitable for retrieving large <code>LONGVARCHAR</code> values.
89.25 * The JDBC driver will
89.26 * do any necessary conversion from the database format into ASCII.
89.27 *
90.1 --- a/src/share/classes/java/sql/SQLPermission.java Tue Apr 19 16:01:27 2011 -0700
90.2 +++ b/src/share/classes/java/sql/SQLPermission.java Tue Apr 26 15:48:03 2011 -0700
90.3 @@ -116,11 +116,11 @@
90.4
90.5 /**
90.6 * Creates a new <code>SQLPermission</code> object with the specified name.
90.7 - * The name is the symbolic name of the <code>SQLPermission</code>; currently,
90.8 - * the only name allowed is "setLog".
90.9 + * The name is the symbolic name of the <code>SQLPermission</code>.
90.10 *
90.11 * @param name the name of this <code>SQLPermission</code> object, which must
90.12 - * be <code>setLog</code>
90.13 + * be either {@code setLog}, {@code callAbort}, {@code setSyncFactory},
90.14 + * or {@code setNetworkTimeout}
90.15 * @throws NullPointerException if <code>name</code> is <code>null</code>.
90.16 * @throws IllegalArgumentException if <code>name</code> is empty.
90.17
90.18 @@ -134,10 +134,11 @@
90.19 * Creates a new <code>SQLPermission</code> object with the specified name.
90.20 * The name is the symbolic name of the <code>SQLPermission</code>; the
90.21 * actions <code>String</code> is currently unused and should be
90.22 - * <code>null</code>.
90.23 + * <code>null</code>.
90.24 *
90.25 * @param name the name of this <code>SQLPermission</code> object, which must
90.26 - * be <code>setLog</code>
90.27 + * be either {@code setLog}, {@code callAbort}, {@code setSyncFactory},
90.28 + * or {@code setNetworkTimeout}
90.29 * @param actions should be <code>null</code>
90.30 * @throws NullPointerException if <code>name</code> is <code>null</code>.
90.31 * @throws IllegalArgumentException if <code>name</code> is empty.
91.1 --- a/src/share/classes/java/sql/Timestamp.java Tue Apr 19 16:01:27 2011 -0700
91.2 +++ b/src/share/classes/java/sql/Timestamp.java Tue Apr 26 15:48:03 2011 -0700
91.3 @@ -54,7 +54,7 @@
91.4 * As a result, the <code>Timestamp.equals(Object)</code>
91.5 * method is not symmetric with respect to the
91.6 * <code>java.util.Date.equals(Object)</code>
91.7 - * method. Also, the <code>hashcode</code> method uses the underlying
91.8 + * method. Also, the <code>hashCode</code> method uses the underlying
91.9 * <code>java.util.Date</code>
91.10 * implementation and therefore does not include nanos in its computation.
91.11 * <P>
91.12 @@ -515,6 +515,18 @@
91.13 }
91.14 }
91.15
91.16 + /**
91.17 + * {@inheritDoc}
91.18 + *
91.19 + * The {@code hashCode} method uses the underlying {@code java.util.Date}
91.20 + * implementation and therefore does not include nanos in its computation.
91.21 + *
91.22 + */
91.23 + @Override
91.24 + public int hashCode() {
91.25 + return super.hashCode();
91.26 + }
91.27 +
91.28 static final long serialVersionUID = 2745179027874758501L;
91.29
91.30 }
92.1 --- a/src/share/classes/java/text/ChoiceFormat.java Tue Apr 19 16:01:27 2011 -0700
92.2 +++ b/src/share/classes/java/text/ChoiceFormat.java Tue Apr 26 15:48:03 2011 -0700
92.3 @@ -136,8 +136,8 @@
92.4 * </pre>
92.5 * </blockquote>
92.6 * And the output result would be like the following:
92.7 + * <blockquote>
92.8 * <pre>
92.9 - * <blockquote>
92.10 * Format with -INF : is negative
92.11 * Format with -1.0 : is negative
92.12 * Format with 0 : is zero or fraction
93.1 --- a/src/share/classes/java/util/AbstractQueue.java Tue Apr 19 16:01:27 2011 -0700
93.2 +++ b/src/share/classes/java/util/AbstractQueue.java Tue Apr 26 15:48:03 2011 -0700
93.3 @@ -30,7 +30,7 @@
93.4 *
93.5 * Written by Doug Lea with assistance from members of JCP JSR-166
93.6 * Expert Group and released to the public domain, as explained at
93.7 - * http://creativecommons.org/licenses/publicdomain
93.8 + * http://creativecommons.org/publicdomain/zero/1.0/
93.9 */
93.10
93.11 package java.util;
94.1 --- a/src/share/classes/java/util/ArrayDeque.java Tue Apr 19 16:01:27 2011 -0700
94.2 +++ b/src/share/classes/java/util/ArrayDeque.java Tue Apr 26 15:48:03 2011 -0700
94.3 @@ -29,7 +29,7 @@
94.4 * file:
94.5 *
94.6 * Written by Josh Bloch of Google Inc. and released to the public domain,
94.7 - * as explained at http://creativecommons.org/licenses/publicdomain.
94.8 + * as explained at http://creativecommons.org/publicdomain/zero/1.0/.
94.9 */
94.10
94.11 package java.util;
95.1 --- a/src/share/classes/java/util/Deque.java Tue Apr 19 16:01:27 2011 -0700
95.2 +++ b/src/share/classes/java/util/Deque.java Tue Apr 26 15:48:03 2011 -0700
95.3 @@ -30,7 +30,7 @@
95.4 *
95.5 * Written by Doug Lea and Josh Bloch with assistance from members of
95.6 * JCP JSR-166 Expert Group and released to the public domain, as explained
95.7 - * at http://creativecommons.org/licenses/publicdomain
95.8 + * at http://creativecommons.org/publicdomain/zero/1.0/
95.9 */
95.10
95.11 package java.util;
96.1 --- a/src/share/classes/java/util/EnumMap.java Tue Apr 19 16:01:27 2011 -0700
96.2 +++ b/src/share/classes/java/util/EnumMap.java Tue Apr 26 15:48:03 2011 -0700
96.3 @@ -106,7 +106,7 @@
96.4 /**
96.5 * Distinguished non-null value for representing null values.
96.6 */
96.7 - private static final Object NULL = new Object();
96.8 + private static final Object NULL = new Integer(0);
96.9
96.10 private Object maskNull(Object value) {
96.11 return (value == null ? NULL : value);
96.12 @@ -116,7 +116,7 @@
96.13 return (V) (value == NULL ? null : value);
96.14 }
96.15
96.16 - private static Enum[] ZERO_LENGTH_ENUM_ARRAY = new Enum[0];
96.17 + private static final Enum[] ZERO_LENGTH_ENUM_ARRAY = new Enum[0];
96.18
96.19 /**
96.20 * Creates an empty enum map with the specified key type.
96.21 @@ -464,6 +464,7 @@
96.22 public Iterator<Map.Entry<K,V>> iterator() {
96.23 return new EntryIterator();
96.24 }
96.25 +
96.26 public boolean contains(Object o) {
96.27 if (!(o instanceof Map.Entry))
96.28 return false;
96.29 @@ -552,70 +553,82 @@
96.30 }
96.31 }
96.32
96.33 - /**
96.34 - * Since we don't use Entry objects, we use the Iterator itself as entry.
96.35 - */
96.36 - private class EntryIterator extends EnumMapIterator<Map.Entry<K,V>>
96.37 - implements Map.Entry<K,V>
96.38 - {
96.39 + private class EntryIterator extends EnumMapIterator<Map.Entry<K,V>> {
96.40 + private Entry lastReturnedEntry = null;
96.41 +
96.42 public Map.Entry<K,V> next() {
96.43 if (!hasNext())
96.44 throw new NoSuchElementException();
96.45 - lastReturnedIndex = index++;
96.46 - return this;
96.47 + lastReturnedEntry = new Entry(index++);
96.48 + return lastReturnedEntry;
96.49 }
96.50
96.51 - public K getKey() {
96.52 - checkLastReturnedIndexForEntryUse();
96.53 - return keyUniverse[lastReturnedIndex];
96.54 + public void remove() {
96.55 + lastReturnedIndex =
96.56 + ((null == lastReturnedEntry) ? -1 : lastReturnedEntry.index);
96.57 + super.remove();
96.58 + lastReturnedEntry.index = lastReturnedIndex;
96.59 + lastReturnedEntry = null;
96.60 }
96.61
96.62 - public V getValue() {
96.63 - checkLastReturnedIndexForEntryUse();
96.64 - return unmaskNull(vals[lastReturnedIndex]);
96.65 - }
96.66 + private class Entry implements Map.Entry<K,V> {
96.67 + private int index;
96.68
96.69 - public V setValue(V value) {
96.70 - checkLastReturnedIndexForEntryUse();
96.71 - V oldValue = unmaskNull(vals[lastReturnedIndex]);
96.72 - vals[lastReturnedIndex] = maskNull(value);
96.73 - return oldValue;
96.74 - }
96.75 + private Entry(int index) {
96.76 + this.index = index;
96.77 + }
96.78
96.79 - public boolean equals(Object o) {
96.80 - if (lastReturnedIndex < 0)
96.81 - return o == this;
96.82 + public K getKey() {
96.83 + checkIndexForEntryUse();
96.84 + return keyUniverse[index];
96.85 + }
96.86
96.87 - if (!(o instanceof Map.Entry))
96.88 - return false;
96.89 - Map.Entry e = (Map.Entry)o;
96.90 - V ourValue = unmaskNull(vals[lastReturnedIndex]);
96.91 - Object hisValue = e.getValue();
96.92 - return e.getKey() == keyUniverse[lastReturnedIndex] &&
96.93 - (ourValue == hisValue ||
96.94 - (ourValue != null && ourValue.equals(hisValue)));
96.95 - }
96.96 + public V getValue() {
96.97 + checkIndexForEntryUse();
96.98 + return unmaskNull(vals[index]);
96.99 + }
96.100
96.101 - public int hashCode() {
96.102 - if (lastReturnedIndex < 0)
96.103 - return super.hashCode();
96.104 + public V setValue(V value) {
96.105 + checkIndexForEntryUse();
96.106 + V oldValue = unmaskNull(vals[index]);
96.107 + vals[index] = maskNull(value);
96.108 + return oldValue;
96.109 + }
96.110
96.111 - Object value = vals[lastReturnedIndex];
96.112 - return keyUniverse[lastReturnedIndex].hashCode()
96.113 - ^ (value == NULL ? 0 : value.hashCode());
96.114 - }
96.115 + public boolean equals(Object o) {
96.116 + if (index < 0)
96.117 + return o == this;
96.118
96.119 - public String toString() {
96.120 - if (lastReturnedIndex < 0)
96.121 - return super.toString();
96.122 + if (!(o instanceof Map.Entry))
96.123 + return false;
96.124
96.125 - return keyUniverse[lastReturnedIndex] + "="
96.126 - + unmaskNull(vals[lastReturnedIndex]);
96.127 - }
96.128 + Map.Entry e = (Map.Entry)o;
96.129 + V ourValue = unmaskNull(vals[index]);
96.130 + Object hisValue = e.getValue();
96.131 + return (e.getKey() == keyUniverse[index] &&
96.132 + (ourValue == hisValue ||
96.133 + (ourValue != null && ourValue.equals(hisValue))));
96.134 + }
96.135
96.136 - private void checkLastReturnedIndexForEntryUse() {
96.137 - if (lastReturnedIndex < 0)
96.138 - throw new IllegalStateException("Entry was removed");
96.139 + public int hashCode() {
96.140 + if (index < 0)
96.141 + return super.hashCode();
96.142 +
96.143 + return entryHashCode(index);
96.144 + }
96.145 +
96.146 + public String toString() {
96.147 + if (index < 0)
96.148 + return super.toString();
96.149 +
96.150 + return keyUniverse[index] + "="
96.151 + + unmaskNull(vals[index]);
96.152 + }
96.153 +
96.154 + private void checkIndexForEntryUse() {
96.155 + if (index < 0)
96.156 + throw new IllegalStateException("Entry was removed");
96.157 + }
96.158 }
96.159 }
96.160
96.161 @@ -631,10 +644,35 @@
96.162 * @return <tt>true</tt> if the specified object is equal to this map
96.163 */
96.164 public boolean equals(Object o) {
96.165 - if (!(o instanceof EnumMap))
96.166 - return super.equals(o);
96.167 + if (this == o)
96.168 + return true;
96.169 + if (o instanceof EnumMap)
96.170 + return equals((EnumMap)o);
96.171 + if (!(o instanceof Map))
96.172 + return false;
96.173
96.174 - EnumMap em = (EnumMap)o;
96.175 + Map<K,V> m = (Map<K,V>)o;
96.176 + if (size != m.size())
96.177 + return false;
96.178 +
96.179 + for (int i = 0; i < keyUniverse.length; i++) {
96.180 + if (null != vals[i]) {
96.181 + K key = keyUniverse[i];
96.182 + V value = unmaskNull(vals[i]);
96.183 + if (null == value) {
96.184 + if (!((null == m.get(key)) && m.containsKey(key)))
96.185 + return false;
96.186 + } else {
96.187 + if (!value.equals(m.get(key)))
96.188 + return false;
96.189 + }
96.190 + }
96.191 + }
96.192 +
96.193 + return true;
96.194 + }
96.195 +
96.196 + private boolean equals(EnumMap em) {
96.197 if (em.keyType != keyType)
96.198 return size == 0 && em.size == 0;
96.199
96.200 @@ -650,6 +688,26 @@
96.201 }
96.202
96.203 /**
96.204 + * Returns the hash code value for this map. The hash code of a map is
96.205 + * defined to be the sum of the hash codes of each entry in the map.
96.206 + */
96.207 + public int hashCode() {
96.208 + int h = 0;
96.209 +
96.210 + for (int i = 0; i < keyUniverse.length; i++) {
96.211 + if (null != vals[i]) {
96.212 + h += entryHashCode(i);
96.213 + }
96.214 + }
96.215 +
96.216 + return h;
96.217 + }
96.218 +
96.219 + private int entryHashCode(int index) {
96.220 + return (keyUniverse[index].hashCode() ^ vals[index].hashCode());
96.221 + }
96.222 +
96.223 + /**
96.224 * Returns a shallow copy of this enum map. (The values themselves
96.225 * are not cloned.
96.226 *
96.227 @@ -705,9 +763,13 @@
96.228 s.writeInt(size);
96.229
96.230 // Write out keys and values (alternating)
96.231 - for (Map.Entry<K,V> e : entrySet()) {
96.232 - s.writeObject(e.getKey());
96.233 - s.writeObject(e.getValue());
96.234 + int entriesToBeWritten = size;
96.235 + for (int i = 0; entriesToBeWritten > 0; i++) {
96.236 + if (null != vals[i]) {
96.237 + s.writeObject(keyUniverse[i]);
96.238 + s.writeObject(unmaskNull(vals[i]));
96.239 + entriesToBeWritten--;
96.240 + }
96.241 }
96.242 }
96.243
97.1 --- a/src/share/classes/java/util/Formatter.java Tue Apr 19 16:01:27 2011 -0700
97.2 +++ b/src/share/classes/java/util/Formatter.java Tue Apr 26 15:48:03 2011 -0700
97.3 @@ -1818,9 +1818,9 @@
97.4 * </pre></blockquote>
97.5 *
97.6 * <p> The maximum number of arguments is limited by the maximum dimension of a
97.7 - * Java array as defined by the <a
97.8 - * href="http://java.sun.com/docs/books/vmspec/">Java Virtual Machine
97.9 - * Specification</a>. If the argument index is does not correspond to an
97.10 + * Java array as defined by
97.11 + * <cite>The Java™ Virtual Machine Specification</cite>.
97.12 + * If the argument index is does not correspond to an
97.13 * available argument, then a {@link MissingFormatArgumentException} is thrown.
97.14 *
97.15 * <p> If there are more arguments than format specifiers, the extra arguments
97.16 @@ -2403,8 +2403,7 @@
97.17 * string. If there are more arguments than format specifiers, the
97.18 * extra arguments are ignored. The maximum number of arguments is
97.19 * limited by the maximum dimension of a Java array as defined by
97.20 - * the <a href="http://java.sun.com/docs/books/vmspec/">Java
97.21 - * Virtual Machine Specification</a>.
97.22 + * <cite>The Java™ Virtual Machine Specification</cite>.
97.23 *
97.24 * @throws IllegalFormatException
97.25 * If a format string contains an illegal syntax, a format
97.26 @@ -2443,8 +2442,7 @@
97.27 * string. If there are more arguments than format specifiers, the
97.28 * extra arguments are ignored. The maximum number of arguments is
97.29 * limited by the maximum dimension of a Java array as defined by
97.30 - * the <a href="http://java.sun.com/docs/books/vmspec/">Java
97.31 - * Virtual Machine Specification</a>
97.32 + * <cite>The Java™ Virtual Machine Specification</cite>.
97.33 *
97.34 * @throws IllegalFormatException
97.35 * If a format string contains an illegal syntax, a format
98.1 --- a/src/share/classes/java/util/IdentityHashMap.java Tue Apr 19 16:01:27 2011 -0700
98.2 +++ b/src/share/classes/java/util/IdentityHashMap.java Tue Apr 26 15:48:03 2011 -0700
98.3 @@ -1,5 +1,5 @@
98.4 /*
98.5 - * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
98.6 + * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
98.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
98.8 *
98.9 * This code is free software; you can redistribute it and/or modify it
98.10 @@ -829,71 +829,82 @@
98.11 }
98.12 }
98.13
98.14 - /**
98.15 - * Since we don't use Entry objects, we use the Iterator
98.16 - * itself as an entry.
98.17 - */
98.18 private class EntryIterator
98.19 extends IdentityHashMapIterator<Map.Entry<K,V>>
98.20 - implements Map.Entry<K,V>
98.21 {
98.22 + private Entry lastReturnedEntry = null;
98.23 +
98.24 public Map.Entry<K,V> next() {
98.25 - nextIndex();
98.26 - return this;
98.27 + lastReturnedEntry = new Entry(nextIndex());
98.28 + return lastReturnedEntry;
98.29 }
98.30
98.31 - public K getKey() {
98.32 - // Provide a better exception than out of bounds index
98.33 - if (lastReturnedIndex < 0)
98.34 - throw new IllegalStateException("Entry was removed");
98.35 -
98.36 - return (K) unmaskNull(traversalTable[lastReturnedIndex]);
98.37 + public void remove() {
98.38 + lastReturnedIndex =
98.39 + ((null == lastReturnedEntry) ? -1 : lastReturnedEntry.index);
98.40 + super.remove();
98.41 + lastReturnedEntry.index = lastReturnedIndex;
98.42 + lastReturnedEntry = null;
98.43 }
98.44
98.45 - public V getValue() {
98.46 - // Provide a better exception than out of bounds index
98.47 - if (lastReturnedIndex < 0)
98.48 - throw new IllegalStateException("Entry was removed");
98.49 + private class Entry implements Map.Entry<K,V> {
98.50 + private int index;
98.51
98.52 - return (V) traversalTable[lastReturnedIndex+1];
98.53 - }
98.54 + private Entry(int index) {
98.55 + this.index = index;
98.56 + }
98.57
98.58 - public V setValue(V value) {
98.59 - // It would be mean-spirited to proceed here if remove() called
98.60 - if (lastReturnedIndex < 0)
98.61 - throw new IllegalStateException("Entry was removed");
98.62 - V oldValue = (V) traversalTable[lastReturnedIndex+1];
98.63 - traversalTable[lastReturnedIndex+1] = value;
98.64 - // if shadowing, force into main table
98.65 - if (traversalTable != IdentityHashMap.this.table)
98.66 - put((K) traversalTable[lastReturnedIndex], value);
98.67 - return oldValue;
98.68 - }
98.69 + public K getKey() {
98.70 + checkIndexForEntryUse();
98.71 + return (K) unmaskNull(traversalTable[index]);
98.72 + }
98.73
98.74 - public boolean equals(Object o) {
98.75 - if (lastReturnedIndex < 0)
98.76 - return super.equals(o);
98.77 + public V getValue() {
98.78 + checkIndexForEntryUse();
98.79 + return (V) traversalTable[index+1];
98.80 + }
98.81
98.82 - if (!(o instanceof Map.Entry))
98.83 - return false;
98.84 - Map.Entry e = (Map.Entry)o;
98.85 - return e.getKey() == getKey() &&
98.86 - e.getValue() == getValue();
98.87 - }
98.88 + public V setValue(V value) {
98.89 + checkIndexForEntryUse();
98.90 + V oldValue = (V) traversalTable[index+1];
98.91 + traversalTable[index+1] = value;
98.92 + // if shadowing, force into main table
98.93 + if (traversalTable != IdentityHashMap.this.table)
98.94 + put((K) traversalTable[index], value);
98.95 + return oldValue;
98.96 + }
98.97
98.98 - public int hashCode() {
98.99 - if (lastReturnedIndex < 0)
98.100 - return super.hashCode();
98.101 + public boolean equals(Object o) {
98.102 + if (index < 0)
98.103 + return super.equals(o);
98.104
98.105 - return System.identityHashCode(getKey()) ^
98.106 - System.identityHashCode(getValue());
98.107 - }
98.108 + if (!(o instanceof Map.Entry))
98.109 + return false;
98.110 + Map.Entry e = (Map.Entry)o;
98.111 + return (e.getKey() == unmaskNull(traversalTable[index]) &&
98.112 + e.getValue() == traversalTable[index+1]);
98.113 + }
98.114
98.115 - public String toString() {
98.116 - if (lastReturnedIndex < 0)
98.117 - return super.toString();
98.118 + public int hashCode() {
98.119 + if (lastReturnedIndex < 0)
98.120 + return super.hashCode();
98.121
98.122 - return getKey() + "=" + getValue();
98.123 + return (System.identityHashCode(unmaskNull(traversalTable[index])) ^
98.124 + System.identityHashCode(traversalTable[index+1]));
98.125 + }
98.126 +
98.127 + public String toString() {
98.128 + if (index < 0)
98.129 + return super.toString();
98.130 +
98.131 + return (unmaskNull(traversalTable[index]) + "="
98.132 + + traversalTable[index+1]);
98.133 + }
98.134 +
98.135 + private void checkIndexForEntryUse() {
98.136 + if (index < 0)
98.137 + throw new IllegalStateException("Entry was removed");
98.138 + }
98.139 }
98.140 }
98.141
99.1 --- a/src/share/classes/java/util/Locale.java Tue Apr 19 16:01:27 2011 -0700
99.2 +++ b/src/share/classes/java/util/Locale.java Tue Apr 26 15:48:03 2011 -0700
99.3 @@ -51,13 +51,13 @@
99.4
99.5 import sun.security.action.GetPropertyAction;
99.6 import sun.util.LocaleServiceProviderPool;
99.7 -import sun.util.locale.AsciiUtil;
99.8 import sun.util.locale.BaseLocale;
99.9 import sun.util.locale.InternalLocaleBuilder;
99.10 import sun.util.locale.LanguageTag;
99.11 import sun.util.locale.LocaleExtensions;
99.12 import sun.util.locale.LocaleObjectCache;
99.13 import sun.util.locale.LocaleSyntaxException;
99.14 +import sun.util.locale.LocaleUtils;
99.15 import sun.util.locale.ParseStatus;
99.16 import sun.util.locale.UnicodeLocaleExtension;
99.17 import sun.util.resources.LocaleData;
99.18 @@ -412,59 +412,59 @@
99.19
99.20 /** Useful constant for language.
99.21 */
99.22 - static public final Locale ENGLISH = getInstance("en", "", "");
99.23 + static public final Locale ENGLISH = createConstant("en", "");
99.24
99.25 /** Useful constant for language.
99.26 */
99.27 - static public final Locale FRENCH = getInstance("fr", "", "");
99.28 + static public final Locale FRENCH = createConstant("fr", "");
99.29
99.30 /** Useful constant for language.
99.31 */
99.32 - static public final Locale GERMAN = getInstance("de", "", "");
99.33 + static public final Locale GERMAN = createConstant("de", "");
99.34
99.35 /** Useful constant for language.
99.36 */
99.37 - static public final Locale ITALIAN = getInstance("it", "", "");
99.38 + static public final Locale ITALIAN = createConstant("it", "");
99.39
99.40 /** Useful constant for language.
99.41 */
99.42 - static public final Locale JAPANESE = getInstance("ja", "", "");
99.43 + static public final Locale JAPANESE = createConstant("ja", "");
99.44
99.45 /** Useful constant for language.
99.46 */
99.47 - static public final Locale KOREAN = getInstance("ko", "", "");
99.48 + static public final Locale KOREAN = createConstant("ko", "");
99.49
99.50 /** Useful constant for language.
99.51 */
99.52 - static public final Locale CHINESE = getInstance("zh", "", "");
99.53 + static public final Locale CHINESE = createConstant("zh", "");
99.54
99.55 /** Useful constant for language.
99.56 */
99.57 - static public final Locale SIMPLIFIED_CHINESE = getInstance("zh", "CN", "");
99.58 + static public final Locale SIMPLIFIED_CHINESE = createConstant("zh", "CN");
99.59
99.60 /** Useful constant for language.
99.61 */
99.62 - static public final Locale TRADITIONAL_CHINESE = getInstance("zh", "TW", "");
99.63 + static public final Locale TRADITIONAL_CHINESE = createConstant("zh", "TW");
99.64
99.65 /** Useful constant for country.
99.66 */
99.67 - static public final Locale FRANCE = getInstance("fr", "FR", "");
99.68 + static public final Locale FRANCE = createConstant("fr", "FR");
99.69
99.70 /** Useful constant for country.
99.71 */
99.72 - static public final Locale GERMANY = getInstance("de", "DE", "");
99.73 + static public final Locale GERMANY = createConstant("de", "DE");
99.74
99.75 /** Useful constant for country.
99.76 */
99.77 - static public final Locale ITALY = getInstance("it", "IT", "");
99.78 + static public final Locale ITALY = createConstant("it", "IT");
99.79
99.80 /** Useful constant for country.
99.81 */
99.82 - static public final Locale JAPAN = getInstance("ja", "JP", "");
99.83 + static public final Locale JAPAN = createConstant("ja", "JP");
99.84
99.85 /** Useful constant for country.
99.86 */
99.87 - static public final Locale KOREA = getInstance("ko", "KR", "");
99.88 + static public final Locale KOREA = createConstant("ko", "KR");
99.89
99.90 /** Useful constant for country.
99.91 */
99.92 @@ -480,19 +480,19 @@
99.93
99.94 /** Useful constant for country.
99.95 */
99.96 - static public final Locale UK = getInstance("en", "GB", "");
99.97 + static public final Locale UK = createConstant("en", "GB");
99.98
99.99 /** Useful constant for country.
99.100 */
99.101 - static public final Locale US = getInstance("en", "US", "");
99.102 + static public final Locale US = createConstant("en", "US");
99.103
99.104 /** Useful constant for country.
99.105 */
99.106 - static public final Locale CANADA = getInstance("en", "CA", "");
99.107 + static public final Locale CANADA = createConstant("en", "CA");
99.108
99.109 /** Useful constant for country.
99.110 */
99.111 - static public final Locale CANADA_FRENCH = getInstance("fr", "CA", "");
99.112 + static public final Locale CANADA_FRENCH = createConstant("fr", "CA");
99.113
99.114 /**
99.115 * Useful constant for the root locale. The root locale is the locale whose
99.116 @@ -502,7 +502,7 @@
99.117 *
99.118 * @since 1.6
99.119 */
99.120 - static public final Locale ROOT = getInstance("", "", "");
99.121 + static public final Locale ROOT = createConstant("", "");
99.122
99.123 /**
99.124 * The key for the private use extension ('x').
99.125 @@ -532,14 +532,14 @@
99.126 private static final int DISPLAY_LANGUAGE = 0;
99.127 private static final int DISPLAY_COUNTRY = 1;
99.128 private static final int DISPLAY_VARIANT = 2;
99.129 - private static final int DISPLAY_SCRIPT = 3;
99.130 + private static final int DISPLAY_SCRIPT = 3;
99.131
99.132 /**
99.133 * Private constructor used by getInstance method
99.134 */
99.135 private Locale(BaseLocale baseLocale, LocaleExtensions extensions) {
99.136 - _baseLocale = baseLocale;
99.137 - _extensions = extensions;
99.138 + this.baseLocale = baseLocale;
99.139 + this.localeExtensions = extensions;
99.140 }
99.141
99.142 /**
99.143 @@ -572,8 +572,8 @@
99.144 if (language== null || country == null || variant == null) {
99.145 throw new NullPointerException();
99.146 }
99.147 - _baseLocale = BaseLocale.getInstance(convertOldISOCodes(language), "", country, variant);
99.148 - _extensions = getCompatibilityExtensions(language, "", country, variant);
99.149 + baseLocale = BaseLocale.getInstance(convertOldISOCodes(language), "", country, variant);
99.150 + localeExtensions = getCompatibilityExtensions(language, "", country, variant);
99.151 }
99.152
99.153 /**
99.154 @@ -627,6 +627,15 @@
99.155 }
99.156
99.157 /**
99.158 + * This method must be called only for creating the Locale.*
99.159 + * constants due to making shortcuts.
99.160 + */
99.161 + private static Locale createConstant(String lang, String country) {
99.162 + BaseLocale base = BaseLocale.createInstance(lang, country);
99.163 + return getInstance(base, null);
99.164 + }
99.165 +
99.166 + /**
99.167 * Returns a <code>Locale</code> constructed from the given
99.168 * <code>language</code>, <code>country</code> and
99.169 * <code>variant</code>. If the same <code>Locale</code> instance
99.170 @@ -641,7 +650,7 @@
99.171 * @exception NullPointerException if any argument is null.
99.172 */
99.173 static Locale getInstance(String language, String country, String variant) {
99.174 - return getInstance(language, "", country, variant, LocaleExtensions.EMPTY_EXTENSIONS);
99.175 + return getInstance(language, "", country, variant, null);
99.176 }
99.177
99.178 static Locale getInstance(String language, String script, String country,
99.179 @@ -651,10 +660,6 @@
99.180 }
99.181
99.182 if (extensions == null) {
99.183 - extensions = LocaleExtensions.EMPTY_EXTENSIONS;
99.184 - }
99.185 -
99.186 - if (extensions.equals(LocaleExtensions.EMPTY_EXTENSIONS)) {
99.187 extensions = getCompatibilityExtensions(language, script, country, variant);
99.188 }
99.189
99.190 @@ -668,22 +673,33 @@
99.191 }
99.192
99.193 private static class Cache extends LocaleObjectCache<LocaleKey, Locale> {
99.194 - public Cache() {
99.195 + private Cache() {
99.196 }
99.197 +
99.198 + @Override
99.199 protected Locale createObject(LocaleKey key) {
99.200 - return new Locale(key._base, key._exts);
99.201 + return new Locale(key.base, key.exts);
99.202 }
99.203 }
99.204
99.205 - private static class LocaleKey {
99.206 - private BaseLocale _base;
99.207 - private LocaleExtensions _exts;
99.208 + private static final class LocaleKey {
99.209 + private final BaseLocale base;
99.210 + private final LocaleExtensions exts;
99.211 + private final int hash;
99.212
99.213 private LocaleKey(BaseLocale baseLocale, LocaleExtensions extensions) {
99.214 - _base = baseLocale;
99.215 - _exts = extensions;
99.216 + base = baseLocale;
99.217 + exts = extensions;
99.218 +
99.219 + // Calculate the hash value here because it's always used.
99.220 + int h = base.hashCode();
99.221 + if (exts != null) {
99.222 + h ^= exts.hashCode();
99.223 + }
99.224 + hash = h;
99.225 }
99.226
99.227 + @Override
99.228 public boolean equals(Object obj) {
99.229 if (this == obj) {
99.230 return true;
99.231 @@ -692,11 +708,18 @@
99.232 return false;
99.233 }
99.234 LocaleKey other = (LocaleKey)obj;
99.235 - return _base.equals(other._base) && _exts.equals(other._exts);
99.236 + if (hash != other.hash || !base.equals(other.base)) {
99.237 + return false;
99.238 + }
99.239 + if (exts == null) {
99.240 + return other.exts == null;
99.241 + }
99.242 + return exts.equals(other.exts);
99.243 }
99.244
99.245 + @Override
99.246 public int hashCode() {
99.247 - return _base.hashCode() ^ _exts.hashCode();
99.248 + return hash;
99.249 }
99.250 }
99.251
99.252 @@ -981,7 +1004,7 @@
99.253 * @see #getDisplayLanguage
99.254 */
99.255 public String getLanguage() {
99.256 - return _baseLocale.getLanguage();
99.257 + return baseLocale.getLanguage();
99.258 }
99.259
99.260 /**
99.261 @@ -995,7 +1018,7 @@
99.262 * @since 1.7
99.263 */
99.264 public String getScript() {
99.265 - return _baseLocale.getScript();
99.266 + return baseLocale.getScript();
99.267 }
99.268
99.269 /**
99.270 @@ -1007,7 +1030,7 @@
99.271 * @see #getDisplayCountry
99.272 */
99.273 public String getCountry() {
99.274 - return _baseLocale.getRegion();
99.275 + return baseLocale.getRegion();
99.276 }
99.277
99.278 /**
99.279 @@ -1017,7 +1040,7 @@
99.280 * @see #getDisplayVariant
99.281 */
99.282 public String getVariant() {
99.283 - return _baseLocale.getVariant();
99.284 + return baseLocale.getVariant();
99.285 }
99.286
99.287 /**
99.288 @@ -1039,7 +1062,7 @@
99.289 if (!LocaleExtensions.isValidKey(key)) {
99.290 throw new IllegalArgumentException("Ill-formed extension key: " + key);
99.291 }
99.292 - return _extensions.getExtensionValue(key);
99.293 + return (localeExtensions == null) ? null : localeExtensions.getExtensionValue(key);
99.294 }
99.295
99.296 /**
99.297 @@ -1052,7 +1075,10 @@
99.298 * @since 1.7
99.299 */
99.300 public Set<Character> getExtensionKeys() {
99.301 - return _extensions.getKeys();
99.302 + if (localeExtensions == null) {
99.303 + return Collections.emptySet();
99.304 + }
99.305 + return localeExtensions.getKeys();
99.306 }
99.307
99.308 /**
99.309 @@ -1064,7 +1090,10 @@
99.310 * @since 1.7
99.311 */
99.312 public Set<String> getUnicodeLocaleAttributes() {
99.313 - return _extensions.getUnicodeLocaleAttributes();
99.314 + if (localeExtensions == null) {
99.315 + return Collections.emptySet();
99.316 + }
99.317 + return localeExtensions.getUnicodeLocaleAttributes();
99.318 }
99.319
99.320 /**
99.321 @@ -1085,7 +1114,7 @@
99.322 if (!UnicodeLocaleExtension.isKey(key)) {
99.323 throw new IllegalArgumentException("Ill-formed Unicode locale key: " + key);
99.324 }
99.325 - return _extensions.getUnicodeLocaleType(key);
99.326 + return (localeExtensions == null) ? null : localeExtensions.getUnicodeLocaleType(key);
99.327 }
99.328
99.329 /**
99.330 @@ -1097,7 +1126,10 @@
99.331 * @since 1.7
99.332 */
99.333 public Set<String> getUnicodeLocaleKeys() {
99.334 - return _extensions.getUnicodeLocaleKeys();
99.335 + if (localeExtensions == null) {
99.336 + return Collections.emptySet();
99.337 + }
99.338 + return localeExtensions.getUnicodeLocaleKeys();
99.339 }
99.340
99.341 /**
99.342 @@ -1106,16 +1138,17 @@
99.343 * @return base locale of this Locale
99.344 */
99.345 BaseLocale getBaseLocale() {
99.346 - return _baseLocale;
99.347 + return baseLocale;
99.348 }
99.349
99.350 /**
99.351 - * Package local method returning the Locale's LocaleExtensions,
99.352 - * used by ResourceBundle
99.353 - * @return locale exnteions of this Locale
99.354 + * Package private method returning the Locale's LocaleExtensions,
99.355 + * used by ResourceBundle.
99.356 + * @return locale exnteions of this Locale,
99.357 + * or {@code null} if no extensions are defined
99.358 */
99.359 LocaleExtensions getLocaleExtensions() {
99.360 - return _extensions;
99.361 + return localeExtensions;
99.362 }
99.363
99.364 /**
99.365 @@ -1160,26 +1193,27 @@
99.366 * @see #getDisplayName
99.367 * @see #toLanguageTag
99.368 */
99.369 + @Override
99.370 public final String toString() {
99.371 - boolean l = (_baseLocale.getLanguage().length() != 0);
99.372 - boolean s = (_baseLocale.getScript().length() != 0);
99.373 - boolean r = (_baseLocale.getRegion().length() != 0);
99.374 - boolean v = (_baseLocale.getVariant().length() != 0);
99.375 - boolean e = (_extensions.getID().length() != 0);
99.376 + boolean l = (baseLocale.getLanguage().length() != 0);
99.377 + boolean s = (baseLocale.getScript().length() != 0);
99.378 + boolean r = (baseLocale.getRegion().length() != 0);
99.379 + boolean v = (baseLocale.getVariant().length() != 0);
99.380 + boolean e = (localeExtensions != null && localeExtensions.getID().length() != 0);
99.381
99.382 - StringBuilder result = new StringBuilder(_baseLocale.getLanguage());
99.383 + StringBuilder result = new StringBuilder(baseLocale.getLanguage());
99.384 if (r || (l && (v || s || e))) {
99.385 result.append('_')
99.386 - .append(_baseLocale.getRegion()); // This may just append '_'
99.387 + .append(baseLocale.getRegion()); // This may just append '_'
99.388 }
99.389 if (v && (l || r)) {
99.390 result.append('_')
99.391 - .append(_baseLocale.getVariant());
99.392 + .append(baseLocale.getVariant());
99.393 }
99.394
99.395 if (s && (l || r)) {
99.396 result.append("_#")
99.397 - .append(_baseLocale.getScript());
99.398 + .append(baseLocale.getScript());
99.399 }
99.400
99.401 if (e && (l || r)) {
99.402 @@ -1187,7 +1221,7 @@
99.403 if (!s) {
99.404 result.append('#');
99.405 }
99.406 - result.append(_extensions.getID());
99.407 + result.append(localeExtensions.getID());
99.408 }
99.409
99.410 return result.toString();
99.411 @@ -1261,7 +1295,7 @@
99.412 * @since 1.7
99.413 */
99.414 public String toLanguageTag() {
99.415 - LanguageTag tag = LanguageTag.parseLocale(_baseLocale, _extensions);
99.416 + LanguageTag tag = LanguageTag.parseLocale(baseLocale, localeExtensions);
99.417 StringBuilder buf = new StringBuilder();
99.418
99.419 String subtag = tag.getLanguage();
99.420 @@ -1433,8 +1467,9 @@
99.421 bldr.setLanguageTag(tag);
99.422 BaseLocale base = bldr.getBaseLocale();
99.423 LocaleExtensions exts = bldr.getLocaleExtensions();
99.424 - if (exts.isEmpty() && base.getVariant().length() > 0) {
99.425 - exts = getCompatibilityExtensions(base.getLanguage(), base.getScript(), base.getRegion(), base.getVariant());
99.426 + if (exts == null && base.getVariant().length() > 0) {
99.427 + exts = getCompatibilityExtensions(base.getLanguage(), base.getScript(),
99.428 + base.getRegion(), base.getVariant());
99.429 }
99.430 return getInstance(base, exts);
99.431 }
99.432 @@ -1454,7 +1489,7 @@
99.433 * three-letter language abbreviation is not available for this locale.
99.434 */
99.435 public String getISO3Language() throws MissingResourceException {
99.436 - String lang = _baseLocale.getLanguage();
99.437 + String lang = baseLocale.getLanguage();
99.438 if (lang.length() == 3) {
99.439 return lang;
99.440 }
99.441 @@ -1481,10 +1516,10 @@
99.442 * three-letter country abbreviation is not available for this locale.
99.443 */
99.444 public String getISO3Country() throws MissingResourceException {
99.445 - String country3 = getISO3Code(_baseLocale.getRegion(), LocaleISOData.isoCountryTable);
99.446 + String country3 = getISO3Code(baseLocale.getRegion(), LocaleISOData.isoCountryTable);
99.447 if (country3 == null) {
99.448 throw new MissingResourceException("Couldn't find 3-letter country code for "
99.449 - + _baseLocale.getRegion(), "FormatData_" + toString(), "ShortCountry");
99.450 + + baseLocale.getRegion(), "FormatData_" + toString(), "ShortCountry");
99.451 }
99.452 return country3;
99.453 }
99.454 @@ -1542,7 +1577,7 @@
99.455 * @exception NullPointerException if <code>inLocale</code> is <code>null</code>
99.456 */
99.457 public String getDisplayLanguage(Locale inLocale) {
99.458 - return getDisplayString(_baseLocale.getLanguage(), inLocale, DISPLAY_LANGUAGE);
99.459 + return getDisplayString(baseLocale.getLanguage(), inLocale, DISPLAY_LANGUAGE);
99.460 }
99.461
99.462 /**
99.463 @@ -1568,7 +1603,7 @@
99.464 * @since 1.7
99.465 */
99.466 public String getDisplayScript(Locale inLocale) {
99.467 - return getDisplayString(_baseLocale.getScript(), inLocale, DISPLAY_SCRIPT);
99.468 + return getDisplayString(baseLocale.getScript(), inLocale, DISPLAY_SCRIPT);
99.469 }
99.470
99.471 /**
99.472 @@ -1603,7 +1638,7 @@
99.473 * @exception NullPointerException if <code>inLocale</code> is <code>null</code>
99.474 */
99.475 public String getDisplayCountry(Locale inLocale) {
99.476 - return getDisplayString(_baseLocale.getRegion(), inLocale, DISPLAY_COUNTRY);
99.477 + return getDisplayString(baseLocale.getRegion(), inLocale, DISPLAY_COUNTRY);
99.478 }
99.479
99.480 private String getDisplayString(String code, Locale inLocale, int type) {
99.481 @@ -1662,7 +1697,7 @@
99.482 * @exception NullPointerException if <code>inLocale</code> is <code>null</code>
99.483 */
99.484 public String getDisplayVariant(Locale inLocale) {
99.485 - if (_baseLocale.getVariant().length() == 0)
99.486 + if (baseLocale.getVariant().length() == 0)
99.487 return "";
99.488
99.489 OpenListResourceBundle bundle = LocaleData.getLocaleNames(inLocale);
99.490 @@ -1758,7 +1793,7 @@
99.491 return formatList(variantNames, listPattern, listCompositionPattern);
99.492 }
99.493 }
99.494 - ArrayList<String> names = new ArrayList<String>(4);
99.495 + ArrayList<String> names = new ArrayList<>(4);
99.496 if (languageName.length() != 0) {
99.497 names.add(languageName);
99.498 }
99.499 @@ -1833,10 +1868,14 @@
99.500 * Since Locales are often used in hashtables, caches the value
99.501 * for speed.
99.502 */
99.503 + @Override
99.504 public int hashCode() {
99.505 int hc = hashCodeValue;
99.506 if (hc == 0) {
99.507 - hc = _baseLocale.hashCode() ^ _extensions.hashCode();
99.508 + hc = baseLocale.hashCode();
99.509 + if (localeExtensions != null) {
99.510 + hc ^= localeExtensions.hashCode();
99.511 + }
99.512 hashCodeValue = hc;
99.513 }
99.514 return hc;
99.515 @@ -1851,21 +1890,26 @@
99.516 *
99.517 * @return true if this Locale is equal to the specified object.
99.518 */
99.519 -
99.520 + @Override
99.521 public boolean equals(Object obj) {
99.522 if (this == obj) // quick check
99.523 return true;
99.524 if (!(obj instanceof Locale))
99.525 return false;
99.526 - BaseLocale otherBase = ((Locale)obj)._baseLocale;
99.527 - LocaleExtensions otherExt = ((Locale)obj)._extensions;
99.528 - return _baseLocale.equals(otherBase) && _extensions.equals(otherExt);
99.529 + BaseLocale otherBase = ((Locale)obj).baseLocale;
99.530 + if (!baseLocale.equals(otherBase)) {
99.531 + return false;
99.532 + }
99.533 + if (localeExtensions == null) {
99.534 + return ((Locale)obj).localeExtensions == null;
99.535 + }
99.536 + return localeExtensions.equals(((Locale)obj).localeExtensions);
99.537 }
99.538
99.539 // ================= privates =====================================
99.540
99.541 - private transient BaseLocale _baseLocale;
99.542 - private transient LocaleExtensions _extensions;
99.543 + private transient BaseLocale baseLocale;
99.544 + private transient LocaleExtensions localeExtensions;
99.545
99.546 /**
99.547 * Calculated hashcode
99.548 @@ -1883,7 +1927,7 @@
99.549 */
99.550 private String[] getDisplayVariantArray(OpenListResourceBundle bundle, Locale inLocale) {
99.551 // Split the variant name into tokens separated by '_'.
99.552 - StringTokenizer tokenizer = new StringTokenizer(_baseLocale.getVariant(), "_");
99.553 + StringTokenizer tokenizer = new StringTokenizer(baseLocale.getVariant(), "_");
99.554 String[] names = new String[tokenizer.countTokens()];
99.555
99.556 // For each variant token, lookup the display name. If
99.557 @@ -1996,11 +2040,11 @@
99.558 */
99.559 private void writeObject(ObjectOutputStream out) throws IOException {
99.560 ObjectOutputStream.PutField fields = out.putFields();
99.561 - fields.put("language", _baseLocale.getLanguage());
99.562 - fields.put("script", _baseLocale.getScript());
99.563 - fields.put("country", _baseLocale.getRegion());
99.564 - fields.put("variant", _baseLocale.getVariant());
99.565 - fields.put("extensions", _extensions.getID());
99.566 + fields.put("language", baseLocale.getLanguage());
99.567 + fields.put("script", baseLocale.getScript());
99.568 + fields.put("country", baseLocale.getRegion());
99.569 + fields.put("variant", baseLocale.getVariant());
99.570 + fields.put("extensions", localeExtensions == null ? "" : localeExtensions.getID());
99.571 fields.put("hashcode", -1); // place holder just for backward support
99.572 out.writeFields();
99.573 }
99.574 @@ -2020,13 +2064,17 @@
99.575 String country = (String)fields.get("country", "");
99.576 String variant = (String)fields.get("variant", "");
99.577 String extStr = (String)fields.get("extensions", "");
99.578 - _baseLocale = BaseLocale.getInstance(convertOldISOCodes(language), script, country, variant);
99.579 - try {
99.580 - InternalLocaleBuilder bldr = new InternalLocaleBuilder();
99.581 - bldr.setExtensions(extStr);
99.582 - _extensions = bldr.getLocaleExtensions();
99.583 - } catch (LocaleSyntaxException e) {
99.584 - throw new IllformedLocaleException(e.getMessage());
99.585 + baseLocale = BaseLocale.getInstance(convertOldISOCodes(language), script, country, variant);
99.586 + if (extStr.length() > 0) {
99.587 + try {
99.588 + InternalLocaleBuilder bldr = new InternalLocaleBuilder();
99.589 + bldr.setExtensions(extStr);
99.590 + localeExtensions = bldr.getLocaleExtensions();
99.591 + } catch (LocaleSyntaxException e) {
99.592 + throw new IllformedLocaleException(e.getMessage());
99.593 + }
99.594 + } else {
99.595 + localeExtensions = null;
99.596 }
99.597 }
99.598
99.599 @@ -2045,8 +2093,8 @@
99.600 * @throws java.io.ObjectStreamException
99.601 */
99.602 private Object readResolve() throws java.io.ObjectStreamException {
99.603 - return getInstance(_baseLocale.getLanguage(), _baseLocale.getScript(),
99.604 - _baseLocale.getRegion(), _baseLocale.getVariant(), _extensions);
99.605 + return getInstance(baseLocale.getLanguage(), baseLocale.getScript(),
99.606 + baseLocale.getRegion(), baseLocale.getVariant(), localeExtensions);
99.607 }
99.608
99.609 private static volatile String[] isoLanguages = null;
99.610 @@ -2056,7 +2104,7 @@
99.611 private static String convertOldISOCodes(String language) {
99.612 // we accept both the old and the new ISO codes for the languages whose ISO
99.613 // codes have changed, but we always store the OLD code, for backward compatibility
99.614 - language = AsciiUtil.toLowerString(language).intern();
99.615 + language = LocaleUtils.toLowerString(language).intern();
99.616 if (language == "he") {
99.617 return "iw";
99.618 } else if (language == "yi") {
99.619 @@ -2068,19 +2116,22 @@
99.620 }
99.621 }
99.622
99.623 - private static LocaleExtensions getCompatibilityExtensions(String language, String script, String country, String variant) {
99.624 - LocaleExtensions extensions = LocaleExtensions.EMPTY_EXTENSIONS;
99.625 + private static LocaleExtensions getCompatibilityExtensions(String language,
99.626 + String script,
99.627 + String country,
99.628 + String variant) {
99.629 + LocaleExtensions extensions = null;
99.630 // Special cases for backward compatibility support
99.631 - if (AsciiUtil.caseIgnoreMatch(language, "ja")
99.632 + if (LocaleUtils.caseIgnoreMatch(language, "ja")
99.633 && script.length() == 0
99.634 - && AsciiUtil.caseIgnoreMatch(country, "JP")
99.635 - && AsciiUtil.caseIgnoreMatch(variant, "JP")) {
99.636 + && LocaleUtils.caseIgnoreMatch(country, "jp")
99.637 + && "JP".equals(variant)) {
99.638 // ja_JP_JP -> u-ca-japanese (calendar = japanese)
99.639 extensions = LocaleExtensions.CALENDAR_JAPANESE;
99.640 - } else if (AsciiUtil.caseIgnoreMatch(language, "th")
99.641 + } else if (LocaleUtils.caseIgnoreMatch(language, "th")
99.642 && script.length() == 0
99.643 - && AsciiUtil.caseIgnoreMatch(country, "TH")
99.644 - && AsciiUtil.caseIgnoreMatch(variant, "TH")) {
99.645 + && LocaleUtils.caseIgnoreMatch(country, "th")
99.646 + && "TH".equals(variant)) {
99.647 // th_TH_TH -> u-nu-thai (numbersystem = thai)
99.648 extensions = LocaleExtensions.NUMBER_THAI;
99.649 }
99.650 @@ -2196,7 +2247,7 @@
99.651 * @since 1.7
99.652 */
99.653 public static final class Builder {
99.654 - private InternalLocaleBuilder _locbld;
99.655 + private final InternalLocaleBuilder localeBuilder;
99.656
99.657 /**
99.658 * Constructs an empty Builder. The default value of all
99.659 @@ -2204,7 +2255,7 @@
99.660 * empty string.
99.661 */
99.662 public Builder() {
99.663 - _locbld = new InternalLocaleBuilder();
99.664 + localeBuilder = new InternalLocaleBuilder();
99.665 }
99.666
99.667 /**
99.668 @@ -2229,7 +2280,7 @@
99.669 */
99.670 public Builder setLocale(Locale locale) {
99.671 try {
99.672 - _locbld.setLocale(locale._baseLocale, locale._extensions);
99.673 + localeBuilder.setLocale(locale.baseLocale, locale.localeExtensions);
99.674 } catch (LocaleSyntaxException e) {
99.675 throw new IllformedLocaleException(e.getMessage(), e.getErrorIndex());
99.676 }
99.677 @@ -2259,8 +2310,7 @@
99.678 if (sts.isError()) {
99.679 throw new IllformedLocaleException(sts.getErrorMessage(), sts.getErrorIndex());
99.680 }
99.681 - _locbld.setLanguageTag(tag);
99.682 -
99.683 + localeBuilder.setLanguageTag(tag);
99.684 return this;
99.685 }
99.686
99.687 @@ -2279,7 +2329,7 @@
99.688 */
99.689 public Builder setLanguage(String language) {
99.690 try {
99.691 - _locbld.setLanguage(language);
99.692 + localeBuilder.setLanguage(language);
99.693 } catch (LocaleSyntaxException e) {
99.694 throw new IllformedLocaleException(e.getMessage(), e.getErrorIndex());
99.695 }
99.696 @@ -2300,7 +2350,7 @@
99.697 */
99.698 public Builder setScript(String script) {
99.699 try {
99.700 - _locbld.setScript(script);
99.701 + localeBuilder.setScript(script);
99.702 } catch (LocaleSyntaxException e) {
99.703 throw new IllformedLocaleException(e.getMessage(), e.getErrorIndex());
99.704 }
99.705 @@ -2325,7 +2375,7 @@
99.706 */
99.707 public Builder setRegion(String region) {
99.708 try {
99.709 - _locbld.setRegion(region);
99.710 + localeBuilder.setRegion(region);
99.711 } catch (LocaleSyntaxException e) {
99.712 throw new IllformedLocaleException(e.getMessage(), e.getErrorIndex());
99.713 }
99.714 @@ -2352,7 +2402,7 @@
99.715 */
99.716 public Builder setVariant(String variant) {
99.717 try {
99.718 - _locbld.setVariant(variant);
99.719 + localeBuilder.setVariant(variant);
99.720 } catch (LocaleSyntaxException e) {
99.721 throw new IllformedLocaleException(e.getMessage(), e.getErrorIndex());
99.722 }
99.723 @@ -2384,7 +2434,7 @@
99.724 */
99.725 public Builder setExtension(char key, String value) {
99.726 try {
99.727 - _locbld.setExtension(key, value);
99.728 + localeBuilder.setExtension(key, value);
99.729 } catch (LocaleSyntaxException e) {
99.730 throw new IllformedLocaleException(e.getMessage(), e.getErrorIndex());
99.731 }
99.732 @@ -2414,7 +2464,7 @@
99.733 */
99.734 public Builder setUnicodeLocaleKeyword(String key, String type) {
99.735 try {
99.736 - _locbld.setUnicodeLocaleKeyword(key, type);
99.737 + localeBuilder.setUnicodeLocaleKeyword(key, type);
99.738 } catch (LocaleSyntaxException e) {
99.739 throw new IllformedLocaleException(e.getMessage(), e.getErrorIndex());
99.740 }
99.741 @@ -2435,7 +2485,7 @@
99.742 */
99.743 public Builder addUnicodeLocaleAttribute(String attribute) {
99.744 try {
99.745 - _locbld.addUnicodeLocaleAttribute(attribute);
99.746 + localeBuilder.addUnicodeLocaleAttribute(attribute);
99.747 } catch (LocaleSyntaxException e) {
99.748 throw new IllformedLocaleException(e.getMessage(), e.getErrorIndex());
99.749 }
99.750 @@ -2458,7 +2508,7 @@
99.751 */
99.752 public Builder removeUnicodeLocaleAttribute(String attribute) {
99.753 try {
99.754 - _locbld.removeUnicodeLocaleAttribute(attribute);
99.755 + localeBuilder.removeUnicodeLocaleAttribute(attribute);
99.756 } catch (LocaleSyntaxException e) {
99.757 throw new IllformedLocaleException(e.getMessage(), e.getErrorIndex());
99.758 }
99.759 @@ -2471,7 +2521,7 @@
99.760 * @return This builder.
99.761 */
99.762 public Builder clear() {
99.763 - _locbld.clear();
99.764 + localeBuilder.clear();
99.765 return this;
99.766 }
99.767
99.768 @@ -2483,7 +2533,7 @@
99.769 * @see #setExtension(char, String)
99.770 */
99.771 public Builder clearExtensions() {
99.772 - _locbld.clearExtensions();
99.773 + localeBuilder.clearExtensions();
99.774 return this;
99.775 }
99.776
99.777 @@ -2498,9 +2548,9 @@
99.778 * @return A Locale.
99.779 */
99.780 public Locale build() {
99.781 - BaseLocale baseloc = _locbld.getBaseLocale();
99.782 - LocaleExtensions extensions = _locbld.getLocaleExtensions();
99.783 - if (extensions.isEmpty() && baseloc.getVariant().length() > 0) {
99.784 + BaseLocale baseloc = localeBuilder.getBaseLocale();
99.785 + LocaleExtensions extensions = localeBuilder.getLocaleExtensions();
99.786 + if (extensions == null && baseloc.getVariant().length() > 0) {
99.787 extensions = getCompatibilityExtensions(baseloc.getLanguage(), baseloc.getScript(),
99.788 baseloc.getRegion(), baseloc.getVariant());
99.789 }
100.1 --- a/src/share/classes/java/util/NavigableMap.java Tue Apr 19 16:01:27 2011 -0700
100.2 +++ b/src/share/classes/java/util/NavigableMap.java Tue Apr 26 15:48:03 2011 -0700
100.3 @@ -30,7 +30,7 @@
100.4 *
100.5 * Written by Doug Lea and Josh Bloch with assistance from members of JCP
100.6 * JSR-166 Expert Group and released to the public domain, as explained at
100.7 - * http://creativecommons.org/licenses/publicdomain
100.8 + * http://creativecommons.org/publicdomain/zero/1.0/
100.9 */
100.10
100.11 package java.util;
101.1 --- a/src/share/classes/java/util/NavigableSet.java Tue Apr 19 16:01:27 2011 -0700
101.2 +++ b/src/share/classes/java/util/NavigableSet.java Tue Apr 26 15:48:03 2011 -0700
101.3 @@ -30,7 +30,7 @@
101.4 *
101.5 * Written by Doug Lea and Josh Bloch with assistance from members of JCP
101.6 * JSR-166 Expert Group and released to the public domain, as explained at
101.7 - * http://creativecommons.org/licenses/publicdomain
101.8 + * http://creativecommons.org/publicdomain/zero/1.0/
101.9 */
101.10
101.11 package java.util;
102.1 --- a/src/share/classes/java/util/Properties.java Tue Apr 19 16:01:27 2011 -0700
102.2 +++ b/src/share/classes/java/util/Properties.java Tue Apr 26 15:48:03 2011 -0700
102.3 @@ -68,8 +68,9 @@
102.4 * methods work the same way as the load(Reader)/store(Writer, String) pair, except
102.5 * the input/output stream is encoded in ISO 8859-1 character encoding.
102.6 * Characters that cannot be directly represented in this encoding can be written using
102.7 - * <a href="http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.3">Unicode escapes</a>
102.8 - * ; only a single 'u' character is allowed in an escape
102.9 + * Unicode escapes as defined in section 3.3 of
102.10 + * <cite>The Java™ Language Specification</cite>;
102.11 + * only a single 'u' character is allowed in an escape
102.12 * sequence. The native2ascii tool can be used to convert property files to and
102.13 * from other character encodings.
102.14 *
102.15 @@ -272,11 +273,8 @@
102.16 * <a name="unicodeescapes"></a>
102.17 * Characters in keys and elements can be represented in escape
102.18 * sequences similar to those used for character and string literals
102.19 - * (see <a
102.20 - * href="http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.3">§3.3</a>
102.21 - * and <a
102.22 - * href="http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.10.6">§3.10.6</a>
102.23 - * of the <i>Java Language Specification</i>).
102.24 + * (see sections 3.3 and 3.10.6 of
102.25 + * <cite>The Java™ Language Specification</cite>).
102.26 *
102.27 * The differences from the character escape sequences and Unicode
102.28 * escapes used for characters and strings are:
102.29 @@ -326,8 +324,9 @@
102.30 * {@link #load(java.io.Reader) load(Reader)} and is assumed to use
102.31 * the ISO 8859-1 character encoding; that is each byte is one Latin1
102.32 * character. Characters not in Latin1, and certain special characters,
102.33 - * are represented in keys and elements using
102.34 - * <a href="http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.3">Unicode escapes</a>.
102.35 + * are represented in keys and elements using Unicode escapes as defined in
102.36 + * section 3.3 of
102.37 + * <cite>The Java™ Language Specification</cite>.
102.38 * <p>
102.39 * The specified stream remains open after this method returns.
102.40 *
103.1 --- a/src/share/classes/java/util/PropertyResourceBundle.java Tue Apr 19 16:01:27 2011 -0700
103.2 +++ b/src/share/classes/java/util/PropertyResourceBundle.java Tue Apr 26 15:48:03 2011 -0700
103.3 @@ -104,8 +104,9 @@
103.4 * from an InputStream or a Reader, which represents a property file.
103.5 * Constructing a PropertyResourceBundle instance from an InputStream requires
103.6 * that the input stream be encoded in ISO-8859-1. In that case, characters
103.7 - * that cannot be represented in ISO-8859-1 encoding must be represented by
103.8 - * <a href="http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.3">Unicode Escapes</a>,
103.9 + * that cannot be represented in ISO-8859-1 encoding must be represented by Unicode Escapes
103.10 + * as defined in section 3.3 of
103.11 + * <cite>The Java™ Language Specification</cite>
103.12 * whereas the other constructor which takes a Reader does not have that limitation.
103.13 *
103.14 * @see ResourceBundle
104.1 --- a/src/share/classes/java/util/Queue.java Tue Apr 19 16:01:27 2011 -0700
104.2 +++ b/src/share/classes/java/util/Queue.java Tue Apr 26 15:48:03 2011 -0700
104.3 @@ -30,7 +30,7 @@
104.4 *
104.5 * Written by Doug Lea with assistance from members of JCP JSR-166
104.6 * Expert Group and released to the public domain, as explained at
104.7 - * http://creativecommons.org/licenses/publicdomain
104.8 + * http://creativecommons.org/publicdomain/zero/1.0/
104.9 */
104.10
104.11 package java.util;
105.1 --- a/src/share/classes/java/util/ResourceBundle.java Tue Apr 19 16:01:27 2011 -0700
105.2 +++ b/src/share/classes/java/util/ResourceBundle.java Tue Apr 26 15:48:03 2011 -0700
105.3 @@ -1,5 +1,5 @@
105.4 /*
105.5 - * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
105.6 + * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
105.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
105.8 *
105.9 * This code is free software; you can redistribute it and/or modify it
105.10 @@ -57,7 +57,6 @@
105.11 import java.util.jar.JarEntry;
105.12
105.13 import sun.util.locale.BaseLocale;
105.14 -import sun.util.locale.LocaleExtensions;
105.15 import sun.util.locale.LocaleObjectCache;
105.16
105.17
105.18 @@ -290,7 +289,7 @@
105.19 * name for compatibility with some workarounds for bug 4212439.
105.20 */
105.21 private static final ConcurrentMap<CacheKey, BundleReference> cacheList
105.22 - = new ConcurrentHashMap<CacheKey, BundleReference>(INITIAL_CACHE_SIZE);
105.23 + = new ConcurrentHashMap<>(INITIAL_CACHE_SIZE);
105.24
105.25 /**
105.26 * Queue for reference objects referring to class loaders or bundles.
105.27 @@ -1755,7 +1754,7 @@
105.28 * @since 1.6
105.29 */
105.30 public Set<String> keySet() {
105.31 - Set<String> keys = new HashSet<String>();
105.32 + Set<String> keys = new HashSet<>();
105.33 for (ResourceBundle rb = this; rb != null; rb = rb.parent) {
105.34 keys.addAll(rb.handleKeySet());
105.35 }
105.36 @@ -1783,7 +1782,7 @@
105.37 if (keySet == null) {
105.38 synchronized (this) {
105.39 if (keySet == null) {
105.40 - Set<String> keys = new HashSet<String>();
105.41 + Set<String> keys = new HashSet<>();
105.42 Enumeration<String> enumKeys = getKeys();
105.43 while (enumKeys.hasMoreElements()) {
105.44 String key = enumKeys.nextElement();
105.45 @@ -2301,7 +2300,7 @@
105.46 if (baseName == null) {
105.47 throw new NullPointerException();
105.48 }
105.49 - return new ArrayList<Locale>(CANDIDATES_CACHE.get(locale.getBaseLocale()));
105.50 + return new ArrayList<>(CANDIDATES_CACHE.get(locale.getBaseLocale()));
105.51 }
105.52
105.53 private static final CandidateListCache CANDIDATES_CACHE = new CandidateListCache();
105.54 @@ -2327,14 +2326,14 @@
105.55 if (language.equals("nb") || isNorwegianBokmal) {
105.56 List<Locale> tmpList = getDefaultList("nb", script, region, variant);
105.57 // Insert a locale replacing "nb" with "no" for every list entry
105.58 - List<Locale> bokmalList = new LinkedList<Locale>();
105.59 + List<Locale> bokmalList = new LinkedList<>();
105.60 for (Locale l : tmpList) {
105.61 bokmalList.add(l);
105.62 if (l.getLanguage().length() == 0) {
105.63 break;
105.64 }
105.65 bokmalList.add(Locale.getInstance("no", l.getScript(), l.getCountry(),
105.66 - l.getVariant(), LocaleExtensions.EMPTY_EXTENSIONS));
105.67 + l.getVariant(), null));
105.68 }
105.69 return bokmalList;
105.70 } else if (language.equals("nn") || isNorwegianNynorsk) {
105.71 @@ -2374,7 +2373,7 @@
105.72 List<String> variants = null;
105.73
105.74 if (variant.length() > 0) {
105.75 - variants = new LinkedList<String>();
105.76 + variants = new LinkedList<>();
105.77 int idx = variant.length();
105.78 while (idx != -1) {
105.79 variants.add(variant.substring(0, idx));
105.80 @@ -2382,32 +2381,32 @@
105.81 }
105.82 }
105.83
105.84 - LinkedList<Locale> list = new LinkedList<Locale>();
105.85 + List<Locale> list = new LinkedList<>();
105.86
105.87 if (variants != null) {
105.88 for (String v : variants) {
105.89 - list.add(Locale.getInstance(language, script, region, v, LocaleExtensions.EMPTY_EXTENSIONS));
105.90 + list.add(Locale.getInstance(language, script, region, v, null));
105.91 }
105.92 }
105.93 if (region.length() > 0) {
105.94 - list.add(Locale.getInstance(language, script, region, "", LocaleExtensions.EMPTY_EXTENSIONS));
105.95 + list.add(Locale.getInstance(language, script, region, "", null));
105.96 }
105.97 if (script.length() > 0) {
105.98 - list.add(Locale.getInstance(language, script, "", "", LocaleExtensions.EMPTY_EXTENSIONS));
105.99 + list.add(Locale.getInstance(language, script, "", "", null));
105.100
105.101 // With script, after truncating variant, region and script,
105.102 // start over without script.
105.103 if (variants != null) {
105.104 for (String v : variants) {
105.105 - list.add(Locale.getInstance(language, "", region, v, LocaleExtensions.EMPTY_EXTENSIONS));
105.106 + list.add(Locale.getInstance(language, "", region, v, null));
105.107 }
105.108 }
105.109 if (region.length() > 0) {
105.110 - list.add(Locale.getInstance(language, "", region, "", LocaleExtensions.EMPTY_EXTENSIONS));
105.111 + list.add(Locale.getInstance(language, "", region, "", null));
105.112 }
105.113 }
105.114 if (language.length() > 0) {
105.115 - list.add(Locale.getInstance(language, "", "", "", LocaleExtensions.EMPTY_EXTENSIONS));
105.116 + list.add(Locale.getInstance(language, "", "", "", null));
105.117 }
105.118 // Add root locale at the end
105.119 list.add(Locale.ROOT);
106.1 --- a/src/share/classes/java/util/concurrent/AbstractExecutorService.java Tue Apr 19 16:01:27 2011 -0700
106.2 +++ b/src/share/classes/java/util/concurrent/AbstractExecutorService.java Tue Apr 26 15:48:03 2011 -0700
106.3 @@ -30,7 +30,7 @@
106.4 *
106.5 * Written by Doug Lea with assistance from members of JCP JSR-166
106.6 * Expert Group and released to the public domain, as explained at
106.7 - * http://creativecommons.org/licenses/publicdomain
106.8 + * http://creativecommons.org/publicdomain/zero/1.0/
106.9 */
106.10
106.11 package java.util.concurrent;
107.1 --- a/src/share/classes/java/util/concurrent/ArrayBlockingQueue.java Tue Apr 19 16:01:27 2011 -0700
107.2 +++ b/src/share/classes/java/util/concurrent/ArrayBlockingQueue.java Tue Apr 26 15:48:03 2011 -0700
107.3 @@ -30,7 +30,7 @@
107.4 *
107.5 * Written by Doug Lea with assistance from members of JCP JSR-166
107.6 * Expert Group and released to the public domain, as explained at
107.7 - * http://creativecommons.org/licenses/publicdomain
107.8 + * http://creativecommons.org/publicdomain/zero/1.0/
107.9 */
107.10
107.11 package java.util.concurrent;
108.1 --- a/src/share/classes/java/util/concurrent/BlockingDeque.java Tue Apr 19 16:01:27 2011 -0700
108.2 +++ b/src/share/classes/java/util/concurrent/BlockingDeque.java Tue Apr 26 15:48:03 2011 -0700
108.3 @@ -30,7 +30,7 @@
108.4 *
108.5 * Written by Doug Lea with assistance from members of JCP JSR-166
108.6 * Expert Group and released to the public domain, as explained at
108.7 - * http://creativecommons.org/licenses/publicdomain
108.8 + * http://creativecommons.org/publicdomain/zero/1.0/
108.9 */
108.10
108.11 package java.util.concurrent;
109.1 --- a/src/share/classes/java/util/concurrent/BlockingQueue.java Tue Apr 19 16:01:27 2011 -0700
109.2 +++ b/src/share/classes/java/util/concurrent/BlockingQueue.java Tue Apr 26 15:48:03 2011 -0700
109.3 @@ -30,7 +30,7 @@
109.4 *
109.5 * Written by Doug Lea with assistance from members of JCP JSR-166
109.6 * Expert Group and released to the public domain, as explained at
109.7 - * http://creativecommons.org/licenses/publicdomain
109.8 + * http://creativecommons.org/publicdomain/zero/1.0/
109.9 */
109.10
109.11 package java.util.concurrent;
110.1 --- a/src/share/classes/java/util/concurrent/BrokenBarrierException.java Tue Apr 19 16:01:27 2011 -0700
110.2 +++ b/src/share/classes/java/util/concurrent/BrokenBarrierException.java Tue Apr 26 15:48:03 2011 -0700
110.3 @@ -30,7 +30,7 @@
110.4 *
110.5 * Written by Doug Lea with assistance from members of JCP JSR-166
110.6 * Expert Group and released to the public domain, as explained at
110.7 - * http://creativecommons.org/licenses/publicdomain
110.8 + * http://creativecommons.org/publicdomain/zero/1.0/
110.9 */
110.10
110.11 package java.util.concurrent;
111.1 --- a/src/share/classes/java/util/concurrent/Callable.java Tue Apr 19 16:01:27 2011 -0700
111.2 +++ b/src/share/classes/java/util/concurrent/Callable.java Tue Apr 26 15:48:03 2011 -0700
111.3 @@ -30,7 +30,7 @@
111.4 *
111.5 * Written by Doug Lea with assistance from members of JCP JSR-166
111.6 * Expert Group and released to the public domain, as explained at
111.7 - * http://creativecommons.org/licenses/publicdomain
111.8 + * http://creativecommons.org/publicdomain/zero/1.0/
111.9 */
111.10
111.11 package java.util.concurrent;
112.1 --- a/src/share/classes/java/util/concurrent/CancellationException.java Tue Apr 19 16:01:27 2011 -0700
112.2 +++ b/src/share/classes/java/util/concurrent/CancellationException.java Tue Apr 26 15:48:03 2011 -0700
112.3 @@ -30,7 +30,7 @@
112.4 *
112.5 * Written by Doug Lea with assistance from members of JCP JSR-166
112.6 * Expert Group and released to the public domain, as explained at
112.7 - * http://creativecommons.org/licenses/publicdomain
112.8 + * http://creativecommons.org/publicdomain/zero/1.0/
112.9 */
112.10
112.11 package java.util.concurrent;
113.1 --- a/src/share/classes/java/util/concurrent/CompletionService.java Tue Apr 19 16:01:27 2011 -0700
113.2 +++ b/src/share/classes/java/util/concurrent/CompletionService.java Tue Apr 26 15:48:03 2011 -0700
113.3 @@ -30,7 +30,7 @@
113.4 *
113.5 * Written by Doug Lea with assistance from members of JCP JSR-166
113.6 * Expert Group and released to the public domain, as explained at
113.7 - * http://creativecommons.org/licenses/publicdomain
113.8 + * http://creativecommons.org/publicdomain/zero/1.0/
113.9 */
113.10
113.11 package java.util.concurrent;
114.1 --- a/src/share/classes/java/util/concurrent/ConcurrentHashMap.java Tue Apr 19 16:01:27 2011 -0700
114.2 +++ b/src/share/classes/java/util/concurrent/ConcurrentHashMap.java Tue Apr 26 15:48:03 2011 -0700
114.3 @@ -30,7 +30,7 @@
114.4 *
114.5 * Written by Doug Lea with assistance from members of JCP JSR-166
114.6 * Expert Group and released to the public domain, as explained at
114.7 - * http://creativecommons.org/licenses/publicdomain
114.8 + * http://creativecommons.org/publicdomain/zero/1.0/
114.9 */
114.10
114.11 package java.util.concurrent;
114.12 @@ -105,7 +105,25 @@
114.13
114.14 /*
114.15 * The basic strategy is to subdivide the table among Segments,
114.16 - * each of which itself is a concurrently readable hash table.
114.17 + * each of which itself is a concurrently readable hash table. To
114.18 + * reduce footprint, all but one segments are constructed only
114.19 + * when first needed (see ensureSegment). To maintain visibility
114.20 + * in the presence of lazy construction, accesses to segments as
114.21 + * well as elements of segment's table must use volatile access,
114.22 + * which is done via Unsafe within methods segmentAt etc
114.23 + * below. These provide the functionality of AtomicReferenceArrays
114.24 + * but reduce the levels of indirection. Additionally,
114.25 + * volatile-writes of table elements and entry "next" fields
114.26 + * within locked operations use the cheaper "lazySet" forms of
114.27 + * writes (via putOrderedObject) because these writes are always
114.28 + * followed by lock releases that maintain sequential consistency
114.29 + * of table updates.
114.30 + *
114.31 + * Historical note: The previous version of this class relied
114.32 + * heavily on "final" fields, which avoided some volatile reads at
114.33 + * the expense of a large initial footprint. Some remnants of
114.34 + * that design (including forced construction of segment 0) exist
114.35 + * to ensure serialization compatibility.
114.36 */
114.37
114.38 /* ---------------- Constants -------------- */
114.39 @@ -137,8 +155,15 @@
114.40 static final int MAXIMUM_CAPACITY = 1 << 30;
114.41
114.42 /**
114.43 + * The minimum capacity for per-segment tables. Must be a power
114.44 + * of two, at least two to avoid immediate resizing on next use
114.45 + * after lazy construction.
114.46 + */
114.47 + static final int MIN_SEGMENT_TABLE_CAPACITY = 2;
114.48 +
114.49 + /**
114.50 * The maximum number of segments to allow; used to bound
114.51 - * constructor arguments.
114.52 + * constructor arguments. Must be power of two less than 1 << 24.
114.53 */
114.54 static final int MAX_SEGMENTS = 1 << 16; // slightly conservative
114.55
114.56 @@ -164,7 +189,7 @@
114.57 final int segmentShift;
114.58
114.59 /**
114.60 - * The segments, each of which is a specialized hash table
114.61 + * The segments, each of which is a specialized hash table.
114.62 */
114.63 final Segment<K,V>[] segments;
114.64
114.65 @@ -172,7 +197,65 @@
114.66 transient Set<Map.Entry<K,V>> entrySet;
114.67 transient Collection<V> values;
114.68
114.69 - /* ---------------- Small Utilities -------------- */
114.70 + /**
114.71 + * ConcurrentHashMap list entry. Note that this is never exported
114.72 + * out as a user-visible Map.Entry.
114.73 + */
114.74 + static final class HashEntry<K,V> {
114.75 + final int hash;
114.76 + final K key;
114.77 + volatile V value;
114.78 + volatile HashEntry<K,V> next;
114.79 +
114.80 + HashEntry(int hash, K key, V value, HashEntry<K,V> next) {
114.81 + this.hash = hash;
114.82 + this.key = key;
114.83 + this.value = value;
114.84 + this.next = next;
114.85 + }
114.86 +
114.87 + /**
114.88 + * Sets next field with volatile write semantics. (See above
114.89 + * about use of putOrderedObject.)
114.90 + */
114.91 + final void setNext(HashEntry<K,V> n) {
114.92 + UNSAFE.putOrderedObject(this, nextOffset, n);
114.93 + }
114.94 +
114.95 + // Unsafe mechanics
114.96 + static final sun.misc.Unsafe UNSAFE;
114.97 + static final long nextOffset;
114.98 + static {
114.99 + try {
114.100 + UNSAFE = sun.misc.Unsafe.getUnsafe();
114.101 + Class k = HashEntry.class;
114.102 + nextOffset = UNSAFE.objectFieldOffset
114.103 + (k.getDeclaredField("next"));
114.104 + } catch (Exception e) {
114.105 + throw new Error(e);
114.106 + }
114.107 + }
114.108 + }
114.109 +
114.110 + /**
114.111 + * Gets the ith element of given table (if nonnull) with volatile
114.112 + * read semantics.
114.113 + */
114.114 + @SuppressWarnings("unchecked")
114.115 + static final <K,V> HashEntry<K,V> entryAt(HashEntry<K,V>[] tab, int i) {
114.116 + return (tab == null) ? null :
114.117 + (HashEntry<K,V>) UNSAFE.getObjectVolatile
114.118 + (tab, ((long)i << TSHIFT) + TBASE);
114.119 + }
114.120 +
114.121 + /**
114.122 + * Sets the ith element of given table, with volatile write
114.123 + * semantics. (See above about use of putOrderedObject.)
114.124 + */
114.125 + static final <K,V> void setEntryAt(HashEntry<K,V>[] tab, int i,
114.126 + HashEntry<K,V> e) {
114.127 + UNSAFE.putOrderedObject(tab, ((long)i << TSHIFT) + TBASE, e);
114.128 + }
114.129
114.130 /**
114.131 * Applies a supplemental hash function to a given hashCode, which
114.132 @@ -193,104 +276,67 @@
114.133 }
114.134
114.135 /**
114.136 - * Returns the segment that should be used for key with given hash
114.137 - * @param hash the hash code for the key
114.138 - * @return the segment
114.139 - */
114.140 - final Segment<K,V> segmentFor(int hash) {
114.141 - return segments[(hash >>> segmentShift) & segmentMask];
114.142 - }
114.143 -
114.144 - /* ---------------- Inner Classes -------------- */
114.145 -
114.146 - /**
114.147 - * ConcurrentHashMap list entry. Note that this is never exported
114.148 - * out as a user-visible Map.Entry.
114.149 - *
114.150 - * Because the value field is volatile, not final, it is legal wrt
114.151 - * the Java Memory Model for an unsynchronized reader to see null
114.152 - * instead of initial value when read via a data race. Although a
114.153 - * reordering leading to this is not likely to ever actually
114.154 - * occur, the Segment.readValueUnderLock method is used as a
114.155 - * backup in case a null (pre-initialized) value is ever seen in
114.156 - * an unsynchronized access method.
114.157 - */
114.158 - static final class HashEntry<K,V> {
114.159 - final K key;
114.160 - final int hash;
114.161 - volatile V value;
114.162 - final HashEntry<K,V> next;
114.163 -
114.164 - HashEntry(K key, int hash, HashEntry<K,V> next, V value) {
114.165 - this.key = key;
114.166 - this.hash = hash;
114.167 - this.next = next;
114.168 - this.value = value;
114.169 - }
114.170 -
114.171 - @SuppressWarnings("unchecked")
114.172 - static final <K,V> HashEntry<K,V>[] newArray(int i) {
114.173 - return new HashEntry[i];
114.174 - }
114.175 - }
114.176 -
114.177 - /**
114.178 * Segments are specialized versions of hash tables. This
114.179 * subclasses from ReentrantLock opportunistically, just to
114.180 * simplify some locking and avoid separate construction.
114.181 */
114.182 static final class Segment<K,V> extends ReentrantLock implements Serializable {
114.183 /*
114.184 - * Segments maintain a table of entry lists that are ALWAYS
114.185 - * kept in a consistent state, so can be read without locking.
114.186 - * Next fields of nodes are immutable (final). All list
114.187 - * additions are performed at the front of each bin. This
114.188 - * makes it easy to check changes, and also fast to traverse.
114.189 - * When nodes would otherwise be changed, new nodes are
114.190 - * created to replace them. This works well for hash tables
114.191 - * since the bin lists tend to be short. (The average length
114.192 - * is less than two for the default load factor threshold.)
114.193 + * Segments maintain a table of entry lists that are always
114.194 + * kept in a consistent state, so can be read (via volatile
114.195 + * reads of segments and tables) without locking. This
114.196 + * requires replicating nodes when necessary during table
114.197 + * resizing, so the old lists can be traversed by readers
114.198 + * still using old version of table.
114.199 *
114.200 - * Read operations can thus proceed without locking, but rely
114.201 - * on selected uses of volatiles to ensure that completed
114.202 - * write operations performed by other threads are
114.203 - * noticed. For most purposes, the "count" field, tracking the
114.204 - * number of elements, serves as that volatile variable
114.205 - * ensuring visibility. This is convenient because this field
114.206 - * needs to be read in many read operations anyway:
114.207 - *
114.208 - * - All (unsynchronized) read operations must first read the
114.209 - * "count" field, and should not look at table entries if
114.210 - * it is 0.
114.211 - *
114.212 - * - All (synchronized) write operations should write to
114.213 - * the "count" field after structurally changing any bin.
114.214 - * The operations must not take any action that could even
114.215 - * momentarily cause a concurrent read operation to see
114.216 - * inconsistent data. This is made easier by the nature of
114.217 - * the read operations in Map. For example, no operation
114.218 - * can reveal that the table has grown but the threshold
114.219 - * has not yet been updated, so there are no atomicity
114.220 - * requirements for this with respect to reads.
114.221 - *
114.222 - * As a guide, all critical volatile reads and writes to the
114.223 - * count field are marked in code comments.
114.224 + * This class defines only mutative methods requiring locking.
114.225 + * Except as noted, the methods of this class perform the
114.226 + * per-segment versions of ConcurrentHashMap methods. (Other
114.227 + * methods are integrated directly into ConcurrentHashMap
114.228 + * methods.) These mutative methods use a form of controlled
114.229 + * spinning on contention via methods scanAndLock and
114.230 + * scanAndLockForPut. These intersperse tryLocks with
114.231 + * traversals to locate nodes. The main benefit is to absorb
114.232 + * cache misses (which are very common for hash tables) while
114.233 + * obtaining locks so that traversal is faster once
114.234 + * acquired. We do not actually use the found nodes since they
114.235 + * must be re-acquired under lock anyway to ensure sequential
114.236 + * consistency of updates (and in any case may be undetectably
114.237 + * stale), but they will normally be much faster to re-locate.
114.238 + * Also, scanAndLockForPut speculatively creates a fresh node
114.239 + * to use in put if no node is found.
114.240 */
114.241
114.242 private static final long serialVersionUID = 2249069246763182397L;
114.243
114.244 /**
114.245 - * The number of elements in this segment's region.
114.246 + * The maximum number of times to tryLock in a prescan before
114.247 + * possibly blocking on acquire in preparation for a locked
114.248 + * segment operation. On multiprocessors, using a bounded
114.249 + * number of retries maintains cache acquired while locating
114.250 + * nodes.
114.251 */
114.252 - transient volatile int count;
114.253 + static final int MAX_SCAN_RETRIES =
114.254 + Runtime.getRuntime().availableProcessors() > 1 ? 64 : 1;
114.255
114.256 /**
114.257 - * Number of updates that alter the size of the table. This is
114.258 - * used during bulk-read methods to make sure they see a
114.259 - * consistent snapshot: If modCounts change during a traversal
114.260 - * of segments computing size or checking containsValue, then
114.261 - * we might have an inconsistent view of state so (usually)
114.262 - * must retry.
114.263 + * The per-segment table. Elements are accessed via
114.264 + * entryAt/setEntryAt providing volatile semantics.
114.265 + */
114.266 + transient volatile HashEntry<K,V>[] table;
114.267 +
114.268 + /**
114.269 + * The number of elements. Accessed only either within locks
114.270 + * or among other volatile reads that maintain visibility.
114.271 + */
114.272 + transient int count;
114.273 +
114.274 + /**
114.275 + * The total number of mutative operations in this segment.
114.276 + * Even though this may overflows 32 bits, it provides
114.277 + * sufficient accuracy for stability checks in CHM isEmpty()
114.278 + * and size() methods. Accessed only either within locks or
114.279 + * among other volatile reads that maintain visibility.
114.280 */
114.281 transient int modCount;
114.282
114.283 @@ -302,11 +348,6 @@
114.284 transient int threshold;
114.285
114.286 /**
114.287 - * The per-segment table.
114.288 - */
114.289 - transient volatile HashEntry<K,V>[] table;
114.290 -
114.291 - /**
114.292 * The load factor for the hash table. Even though this value
114.293 * is same for all segments, it is replicated to avoid needing
114.294 * links to outer object.
114.295 @@ -314,202 +355,94 @@
114.296 */
114.297 final float loadFactor;
114.298
114.299 - Segment(int initialCapacity, float lf) {
114.300 - loadFactor = lf;
114.301 - setTable(HashEntry.<K,V>newArray(initialCapacity));
114.302 + Segment(float lf, int threshold, HashEntry<K,V>[] tab) {
114.303 + this.loadFactor = lf;
114.304 + this.threshold = threshold;
114.305 + this.table = tab;
114.306 }
114.307
114.308 - @SuppressWarnings("unchecked")
114.309 - static final <K,V> Segment<K,V>[] newArray(int i) {
114.310 - return new Segment[i];
114.311 + final V put(K key, int hash, V value, boolean onlyIfAbsent) {
114.312 + HashEntry<K,V> node = tryLock() ? null :
114.313 + scanAndLockForPut(key, hash, value);
114.314 + V oldValue;
114.315 + try {
114.316 + HashEntry<K,V>[] tab = table;
114.317 + int index = (tab.length - 1) & hash;
114.318 + HashEntry<K,V> first = entryAt(tab, index);
114.319 + for (HashEntry<K,V> e = first;;) {
114.320 + if (e != null) {
114.321 + K k;
114.322 + if ((k = e.key) == key ||
114.323 + (e.hash == hash && key.equals(k))) {
114.324 + oldValue = e.value;
114.325 + if (!onlyIfAbsent) {
114.326 + e.value = value;
114.327 + ++modCount;
114.328 + }
114.329 + break;
114.330 + }
114.331 + e = e.next;
114.332 + }
114.333 + else {
114.334 + if (node != null)
114.335 + node.setNext(first);
114.336 + else
114.337 + node = new HashEntry<K,V>(hash, key, value, first);
114.338 + int c = count + 1;
114.339 + if (c > threshold && first != null &&
114.340 + tab.length < MAXIMUM_CAPACITY)
114.341 + rehash(node);
114.342 + else
114.343 + setEntryAt(tab, index, node);
114.344 + ++modCount;
114.345 + count = c;
114.346 + oldValue = null;
114.347 + break;
114.348 + }
114.349 + }
114.350 + } finally {
114.351 + unlock();
114.352 + }
114.353 + return oldValue;
114.354 }
114.355
114.356 /**
114.357 - * Sets table to new HashEntry array.
114.358 - * Call only while holding lock or in constructor.
114.359 + * Doubles size of table and repacks entries, also adding the
114.360 + * given node to new table
114.361 */
114.362 - void setTable(HashEntry<K,V>[] newTable) {
114.363 - threshold = (int)(newTable.length * loadFactor);
114.364 - table = newTable;
114.365 - }
114.366 -
114.367 - /**
114.368 - * Returns properly casted first entry of bin for given hash.
114.369 - */
114.370 - HashEntry<K,V> getFirst(int hash) {
114.371 - HashEntry<K,V>[] tab = table;
114.372 - return tab[hash & (tab.length - 1)];
114.373 - }
114.374 -
114.375 - /**
114.376 - * Reads value field of an entry under lock. Called if value
114.377 - * field ever appears to be null. This is possible only if a
114.378 - * compiler happens to reorder a HashEntry initialization with
114.379 - * its table assignment, which is legal under memory model
114.380 - * but is not known to ever occur.
114.381 - */
114.382 - V readValueUnderLock(HashEntry<K,V> e) {
114.383 - lock();
114.384 - try {
114.385 - return e.value;
114.386 - } finally {
114.387 - unlock();
114.388 - }
114.389 - }
114.390 -
114.391 - /* Specialized implementations of map methods */
114.392 -
114.393 - V get(Object key, int hash) {
114.394 - if (count != 0) { // read-volatile
114.395 - HashEntry<K,V> e = getFirst(hash);
114.396 - while (e != null) {
114.397 - if (e.hash == hash && key.equals(e.key)) {
114.398 - V v = e.value;
114.399 - if (v != null)
114.400 - return v;
114.401 - return readValueUnderLock(e); // recheck
114.402 - }
114.403 - e = e.next;
114.404 - }
114.405 - }
114.406 - return null;
114.407 - }
114.408 -
114.409 - boolean containsKey(Object key, int hash) {
114.410 - if (count != 0) { // read-volatile
114.411 - HashEntry<K,V> e = getFirst(hash);
114.412 - while (e != null) {
114.413 - if (e.hash == hash && key.equals(e.key))
114.414 - return true;
114.415 - e = e.next;
114.416 - }
114.417 - }
114.418 - return false;
114.419 - }
114.420 -
114.421 - boolean containsValue(Object value) {
114.422 - if (count != 0) { // read-volatile
114.423 - HashEntry<K,V>[] tab = table;
114.424 - int len = tab.length;
114.425 - for (int i = 0 ; i < len; i++) {
114.426 - for (HashEntry<K,V> e = tab[i]; e != null; e = e.next) {
114.427 - V v = e.value;
114.428 - if (v == null) // recheck
114.429 - v = readValueUnderLock(e);
114.430 - if (value.equals(v))
114.431 - return true;
114.432 - }
114.433 - }
114.434 - }
114.435 - return false;
114.436 - }
114.437 -
114.438 - boolean replace(K key, int hash, V oldValue, V newValue) {
114.439 - lock();
114.440 - try {
114.441 - HashEntry<K,V> e = getFirst(hash);
114.442 - while (e != null && (e.hash != hash || !key.equals(e.key)))
114.443 - e = e.next;
114.444 -
114.445 - boolean replaced = false;
114.446 - if (e != null && oldValue.equals(e.value)) {
114.447 - replaced = true;
114.448 - e.value = newValue;
114.449 - }
114.450 - return replaced;
114.451 - } finally {
114.452 - unlock();
114.453 - }
114.454 - }
114.455 -
114.456 - V replace(K key, int hash, V newValue) {
114.457 - lock();
114.458 - try {
114.459 - HashEntry<K,V> e = getFirst(hash);
114.460 - while (e != null && (e.hash != hash || !key.equals(e.key)))
114.461 - e = e.next;
114.462 -
114.463 - V oldValue = null;
114.464 - if (e != null) {
114.465 - oldValue = e.value;
114.466 - e.value = newValue;
114.467 - }
114.468 - return oldValue;
114.469 - } finally {
114.470 - unlock();
114.471 - }
114.472 - }
114.473 -
114.474 -
114.475 - V put(K key, int hash, V value, boolean onlyIfAbsent) {
114.476 - lock();
114.477 - try {
114.478 - int c = count;
114.479 - if (c++ > threshold) // ensure capacity
114.480 - rehash();
114.481 - HashEntry<K,V>[] tab = table;
114.482 - int index = hash & (tab.length - 1);
114.483 - HashEntry<K,V> first = tab[index];
114.484 - HashEntry<K,V> e = first;
114.485 - while (e != null && (e.hash != hash || !key.equals(e.key)))
114.486 - e = e.next;
114.487 -
114.488 - V oldValue;
114.489 - if (e != null) {
114.490 - oldValue = e.value;
114.491 - if (!onlyIfAbsent)
114.492 - e.value = value;
114.493 - }
114.494 - else {
114.495 - oldValue = null;
114.496 - ++modCount;
114.497 - tab[index] = new HashEntry<K,V>(key, hash, first, value);
114.498 - count = c; // write-volatile
114.499 - }
114.500 - return oldValue;
114.501 - } finally {
114.502 - unlock();
114.503 - }
114.504 - }
114.505 -
114.506 - void rehash() {
114.507 + @SuppressWarnings("unchecked")
114.508 + private void rehash(HashEntry<K,V> node) {
114.509 + /*
114.510 + * Reclassify nodes in each list to new table. Because we
114.511 + * are using power-of-two expansion, the elements from
114.512 + * each bin must either stay at same index, or move with a
114.513 + * power of two offset. We eliminate unnecessary node
114.514 + * creation by catching cases where old nodes can be
114.515 + * reused because their next fields won't change.
114.516 + * Statistically, at the default threshold, only about
114.517 + * one-sixth of them need cloning when a table
114.518 + * doubles. The nodes they replace will be garbage
114.519 + * collectable as soon as they are no longer referenced by
114.520 + * any reader thread that may be in the midst of
114.521 + * concurrently traversing table. Entry accesses use plain
114.522 + * array indexing because they are followed by volatile
114.523 + * table write.
114.524 + */
114.525 HashEntry<K,V>[] oldTable = table;
114.526 int oldCapacity = oldTable.length;
114.527 - if (oldCapacity >= MAXIMUM_CAPACITY)
114.528 - return;
114.529 -
114.530 - /*
114.531 - * Reclassify nodes in each list to new Map. Because we are
114.532 - * using power-of-two expansion, the elements from each bin
114.533 - * must either stay at same index, or move with a power of two
114.534 - * offset. We eliminate unnecessary node creation by catching
114.535 - * cases where old nodes can be reused because their next
114.536 - * fields won't change. Statistically, at the default
114.537 - * threshold, only about one-sixth of them need cloning when
114.538 - * a table doubles. The nodes they replace will be garbage
114.539 - * collectable as soon as they are no longer referenced by any
114.540 - * reader thread that may be in the midst of traversing table
114.541 - * right now.
114.542 - */
114.543 -
114.544 - HashEntry<K,V>[] newTable = HashEntry.newArray(oldCapacity<<1);
114.545 - threshold = (int)(newTable.length * loadFactor);
114.546 - int sizeMask = newTable.length - 1;
114.547 + int newCapacity = oldCapacity << 1;
114.548 + threshold = (int)(newCapacity * loadFactor);
114.549 + HashEntry<K,V>[] newTable =
114.550 + (HashEntry<K,V>[]) new HashEntry[newCapacity];
114.551 + int sizeMask = newCapacity - 1;
114.552 for (int i = 0; i < oldCapacity ; i++) {
114.553 - // We need to guarantee that any existing reads of old Map can
114.554 - // proceed. So we cannot yet null out each bin.
114.555 HashEntry<K,V> e = oldTable[i];
114.556 -
114.557 if (e != null) {
114.558 HashEntry<K,V> next = e.next;
114.559 int idx = e.hash & sizeMask;
114.560 -
114.561 - // Single node on list
114.562 - if (next == null)
114.563 + if (next == null) // Single node on list
114.564 newTable[idx] = e;
114.565 -
114.566 - else {
114.567 - // Reuse trailing consecutive sequence at same slot
114.568 + else { // Reuse consecutive sequence at same slot
114.569 HashEntry<K,V> lastRun = e;
114.570 int lastIdx = idx;
114.571 for (HashEntry<K,V> last = next;
114.572 @@ -522,74 +455,259 @@
114.573 }
114.574 }
114.575 newTable[lastIdx] = lastRun;
114.576 -
114.577 - // Clone all remaining nodes
114.578 + // Clone remaining nodes
114.579 for (HashEntry<K,V> p = e; p != lastRun; p = p.next) {
114.580 - int k = p.hash & sizeMask;
114.581 + V v = p.value;
114.582 + int h = p.hash;
114.583 + int k = h & sizeMask;
114.584 HashEntry<K,V> n = newTable[k];
114.585 - newTable[k] = new HashEntry<K,V>(p.key, p.hash,
114.586 - n, p.value);
114.587 + newTable[k] = new HashEntry<K,V>(h, p.key, v, n);
114.588 }
114.589 }
114.590 }
114.591 }
114.592 + int nodeIndex = node.hash & sizeMask; // add the new node
114.593 + node.setNext(newTable[nodeIndex]);
114.594 + newTable[nodeIndex] = node;
114.595 table = newTable;
114.596 }
114.597
114.598 /**
114.599 + * Scans for a node containing given key while trying to
114.600 + * acquire lock, creating and returning one if not found. Upon
114.601 + * return, guarantees that lock is held. UNlike in most
114.602 + * methods, calls to method equals are not screened: Since
114.603 + * traversal speed doesn't matter, we might as well help warm
114.604 + * up the associated code and accesses as well.
114.605 + *
114.606 + * @return a new node if key not found, else null
114.607 + */
114.608 + private HashEntry<K,V> scanAndLockForPut(K key, int hash, V value) {
114.609 + HashEntry<K,V> first = entryForHash(this, hash);
114.610 + HashEntry<K,V> e = first;
114.611 + HashEntry<K,V> node = null;
114.612 + int retries = -1; // negative while locating node
114.613 + while (!tryLock()) {
114.614 + HashEntry<K,V> f; // to recheck first below
114.615 + if (retries < 0) {
114.616 + if (e == null) {
114.617 + if (node == null) // speculatively create node
114.618 + node = new HashEntry<K,V>(hash, key, value, null);
114.619 + retries = 0;
114.620 + }
114.621 + else if (key.equals(e.key))
114.622 + retries = 0;
114.623 + else
114.624 + e = e.next;
114.625 + }
114.626 + else if (++retries > MAX_SCAN_RETRIES) {
114.627 + lock();
114.628 + break;
114.629 + }
114.630 + else if ((retries & 1) == 0 &&
114.631 + (f = entryForHash(this, hash)) != first) {
114.632 + e = first = f; // re-traverse if entry changed
114.633 + retries = -1;
114.634 + }
114.635 + }
114.636 + return node;
114.637 + }
114.638 +
114.639 + /**
114.640 + * Scans for a node containing the given key while trying to
114.641 + * acquire lock for a remove or replace operation. Upon
114.642 + * return, guarantees that lock is held. Note that we must
114.643 + * lock even if the key is not found, to ensure sequential
114.644 + * consistency of updates.
114.645 + */
114.646 + private void scanAndLock(Object key, int hash) {
114.647 + // similar to but simpler than scanAndLockForPut
114.648 + HashEntry<K,V> first = entryForHash(this, hash);
114.649 + HashEntry<K,V> e = first;
114.650 + int retries = -1;
114.651 + while (!tryLock()) {
114.652 + HashEntry<K,V> f;
114.653 + if (retries < 0) {
114.654 + if (e == null || key.equals(e.key))
114.655 + retries = 0;
114.656 + else
114.657 + e = e.next;
114.658 + }
114.659 + else if (++retries > MAX_SCAN_RETRIES) {
114.660 + lock();
114.661 + break;
114.662 + }
114.663 + else if ((retries & 1) == 0 &&
114.664 + (f = entryForHash(this, hash)) != first) {
114.665 + e = first = f;
114.666 + retries = -1;
114.667 + }
114.668 + }
114.669 + }
114.670 +
114.671 + /**
114.672 * Remove; match on key only if value null, else match both.
114.673 */
114.674 - V remove(Object key, int hash, Object value) {
114.675 + final V remove(Object key, int hash, Object value) {
114.676 + if (!tryLock())
114.677 + scanAndLock(key, hash);
114.678 + V oldValue = null;
114.679 + try {
114.680 + HashEntry<K,V>[] tab = table;
114.681 + int index = (tab.length - 1) & hash;
114.682 + HashEntry<K,V> e = entryAt(tab, index);
114.683 + HashEntry<K,V> pred = null;
114.684 + while (e != null) {
114.685 + K k;
114.686 + HashEntry<K,V> next = e.next;
114.687 + if ((k = e.key) == key ||
114.688 + (e.hash == hash && key.equals(k))) {
114.689 + V v = e.value;
114.690 + if (value == null || value == v || value.equals(v)) {
114.691 + if (pred == null)
114.692 + setEntryAt(tab, index, next);
114.693 + else
114.694 + pred.setNext(next);
114.695 + ++modCount;
114.696 + --count;
114.697 + oldValue = v;
114.698 + }
114.699 + break;
114.700 + }
114.701 + pred = e;
114.702 + e = next;
114.703 + }
114.704 + } finally {
114.705 + unlock();
114.706 + }
114.707 + return oldValue;
114.708 + }
114.709 +
114.710 + final boolean replace(K key, int hash, V oldValue, V newValue) {
114.711 + if (!tryLock())
114.712 + scanAndLock(key, hash);
114.713 + boolean replaced = false;
114.714 + try {
114.715 + HashEntry<K,V> e;
114.716 + for (e = entryForHash(this, hash); e != null; e = e.next) {
114.717 + K k;
114.718 + if ((k = e.key) == key ||
114.719 + (e.hash == hash && key.equals(k))) {
114.720 + if (oldValue.equals(e.value)) {
114.721 + e.value = newValue;
114.722 + ++modCount;
114.723 + replaced = true;
114.724 + }
114.725 + break;
114.726 + }
114.727 + }
114.728 + } finally {
114.729 + unlock();
114.730 + }
114.731 + return replaced;
114.732 + }
114.733 +
114.734 + final V replace(K key, int hash, V value) {
114.735 + if (!tryLock())
114.736 + scanAndLock(key, hash);
114.737 + V oldValue = null;
114.738 + try {
114.739 + HashEntry<K,V> e;
114.740 + for (e = entryForHash(this, hash); e != null; e = e.next) {
114.741 + K k;
114.742 + if ((k = e.key) == key ||
114.743 + (e.hash == hash && key.equals(k))) {
114.744 + oldValue = e.value;
114.745 + e.value = value;
114.746 + ++modCount;
114.747 + break;
114.748 + }
114.749 + }
114.750 + } finally {
114.751 + unlock();
114.752 + }
114.753 + return oldValue;
114.754 + }
114.755 +
114.756 + final void clear() {
114.757 lock();
114.758 try {
114.759 - int c = count - 1;
114.760 HashEntry<K,V>[] tab = table;
114.761 - int index = hash & (tab.length - 1);
114.762 - HashEntry<K,V> first = tab[index];
114.763 - HashEntry<K,V> e = first;
114.764 - while (e != null && (e.hash != hash || !key.equals(e.key)))
114.765 - e = e.next;
114.766 -
114.767 - V oldValue = null;
114.768 - if (e != null) {
114.769 - V v = e.value;
114.770 - if (value == null || value.equals(v)) {
114.771 - oldValue = v;
114.772 - // All entries following removed node can stay
114.773 - // in list, but all preceding ones need to be
114.774 - // cloned.
114.775 - ++modCount;
114.776 - HashEntry<K,V> newFirst = e.next;
114.777 - for (HashEntry<K,V> p = first; p != e; p = p.next)
114.778 - newFirst = new HashEntry<K,V>(p.key, p.hash,
114.779 - newFirst, p.value);
114.780 - tab[index] = newFirst;
114.781 - count = c; // write-volatile
114.782 - }
114.783 - }
114.784 - return oldValue;
114.785 + for (int i = 0; i < tab.length ; i++)
114.786 + setEntryAt(tab, i, null);
114.787 + ++modCount;
114.788 + count = 0;
114.789 } finally {
114.790 unlock();
114.791 }
114.792 }
114.793 + }
114.794
114.795 - void clear() {
114.796 - if (count != 0) {
114.797 - lock();
114.798 - try {
114.799 - HashEntry<K,V>[] tab = table;
114.800 - for (int i = 0; i < tab.length ; i++)
114.801 - tab[i] = null;
114.802 - ++modCount;
114.803 - count = 0; // write-volatile
114.804 - } finally {
114.805 - unlock();
114.806 + // Accessing segments
114.807 +
114.808 + /**
114.809 + * Gets the jth element of given segment array (if nonnull) with
114.810 + * volatile element access semantics via Unsafe.
114.811 + */
114.812 + @SuppressWarnings("unchecked")
114.813 + static final <K,V> Segment<K,V> segmentAt(Segment<K,V>[] ss, int j) {
114.814 + long u = (j << SSHIFT) + SBASE;
114.815 + return ss == null ? null :
114.816 + (Segment<K,V>) UNSAFE.getObjectVolatile(ss, u);
114.817 + }
114.818 +
114.819 + /**
114.820 + * Returns the segment for the given index, creating it and
114.821 + * recording in segment table (via CAS) if not already present.
114.822 + *
114.823 + * @param k the index
114.824 + * @return the segment
114.825 + */
114.826 + @SuppressWarnings("unchecked")
114.827 + private Segment<K,V> ensureSegment(int k) {
114.828 + final Segment<K,V>[] ss = this.segments;
114.829 + long u = (k << SSHIFT) + SBASE; // raw offset
114.830 + Segment<K,V> seg;
114.831 + if ((seg = (Segment<K,V>)UNSAFE.getObjectVolatile(ss, u)) == null) {
114.832 + Segment<K,V> proto = ss[0]; // use segment 0 as prototype
114.833 + int cap = proto.table.length;
114.834 + float lf = proto.loadFactor;
114.835 + int threshold = (int)(cap * lf);
114.836 + HashEntry<K,V>[] tab = (HashEntry<K,V>[])new HashEntry[cap];
114.837 + if ((seg = (Segment<K,V>)UNSAFE.getObjectVolatile(ss, u))
114.838 + == null) { // recheck
114.839 + Segment<K,V> s = new Segment<K,V>(lf, threshold, tab);
114.840 + while ((seg = (Segment<K,V>)UNSAFE.getObjectVolatile(ss, u))
114.841 + == null) {
114.842 + if (UNSAFE.compareAndSwapObject(ss, u, null, seg = s))
114.843 + break;
114.844 }
114.845 }
114.846 }
114.847 + return seg;
114.848 }
114.849
114.850 + // Hash-based segment and entry accesses
114.851
114.852 + /**
114.853 + * Get the segment for the given hash
114.854 + */
114.855 + @SuppressWarnings("unchecked")
114.856 + private Segment<K,V> segmentForHash(int h) {
114.857 + long u = (((h >>> segmentShift) & segmentMask) << SSHIFT) + SBASE;
114.858 + return (Segment<K,V>) UNSAFE.getObjectVolatile(segments, u);
114.859 + }
114.860 +
114.861 + /**
114.862 + * Gets the table entry for the given segment and hash
114.863 + */
114.864 + @SuppressWarnings("unchecked")
114.865 + static final <K,V> HashEntry<K,V> entryForHash(Segment<K,V> seg, int h) {
114.866 + HashEntry<K,V>[] tab;
114.867 + return (seg == null || (tab = seg.table) == null) ? null :
114.868 + (HashEntry<K,V>) UNSAFE.getObjectVolatile
114.869 + (tab, ((long)(((tab.length - 1) & h)) << TSHIFT) + TBASE);
114.870 + }
114.871
114.872 /* ---------------- Public operations -------------- */
114.873
114.874 @@ -609,14 +727,13 @@
114.875 * negative or the load factor or concurrencyLevel are
114.876 * nonpositive.
114.877 */
114.878 + @SuppressWarnings("unchecked")
114.879 public ConcurrentHashMap(int initialCapacity,
114.880 float loadFactor, int concurrencyLevel) {
114.881 if (!(loadFactor > 0) || initialCapacity < 0 || concurrencyLevel <= 0)
114.882 throw new IllegalArgumentException();
114.883 -
114.884 if (concurrencyLevel > MAX_SEGMENTS)
114.885 concurrencyLevel = MAX_SEGMENTS;
114.886 -
114.887 // Find power-of-two sizes best matching arguments
114.888 int sshift = 0;
114.889 int ssize = 1;
114.890 @@ -624,21 +741,23 @@
114.891 ++sshift;
114.892 ssize <<= 1;
114.893 }
114.894 - segmentShift = 32 - sshift;
114.895 - segmentMask = ssize - 1;
114.896 - this.segments = Segment.newArray(ssize);
114.897 -
114.898 + this.segmentShift = 32 - sshift;
114.899 + this.segmentMask = ssize - 1;
114.900 if (initialCapacity > MAXIMUM_CAPACITY)
114.901 initialCapacity = MAXIMUM_CAPACITY;
114.902 int c = initialCapacity / ssize;
114.903 if (c * ssize < initialCapacity)
114.904 ++c;
114.905 - int cap = 1;
114.906 + int cap = MIN_SEGMENT_TABLE_CAPACITY;
114.907 while (cap < c)
114.908 cap <<= 1;
114.909 -
114.910 - for (int i = 0; i < this.segments.length; ++i)
114.911 - this.segments[i] = new Segment<K,V>(cap, loadFactor);
114.912 + // create segments and segments[0]
114.913 + Segment<K,V> s0 =
114.914 + new Segment<K,V>(loadFactor, (int)(cap * loadFactor),
114.915 + (HashEntry<K,V>[])new HashEntry[cap]);
114.916 + Segment<K,V>[] ss = (Segment<K,V>[])new Segment[ssize];
114.917 + UNSAFE.putOrderedObject(ss, SBASE, s0); // ordered write of segments[0]
114.918 + this.segments = ss;
114.919 }
114.920
114.921 /**
114.922 @@ -701,33 +820,36 @@
114.923 * @return <tt>true</tt> if this map contains no key-value mappings
114.924 */
114.925 public boolean isEmpty() {
114.926 + /*
114.927 + * Sum per-segment modCounts to avoid mis-reporting when
114.928 + * elements are concurrently added and removed in one segment
114.929 + * while checking another, in which case the table was never
114.930 + * actually empty at any point. (The sum ensures accuracy up
114.931 + * through at least 1<<31 per-segment modifications before
114.932 + * recheck.) Methods size() and containsValue() use similar
114.933 + * constructions for stability checks.
114.934 + */
114.935 + long sum = 0L;
114.936 final Segment<K,V>[] segments = this.segments;
114.937 - /*
114.938 - * We keep track of per-segment modCounts to avoid ABA
114.939 - * problems in which an element in one segment was added and
114.940 - * in another removed during traversal, in which case the
114.941 - * table was never actually empty at any point. Note the
114.942 - * similar use of modCounts in the size() and containsValue()
114.943 - * methods, which are the only other methods also susceptible
114.944 - * to ABA problems.
114.945 - */
114.946 - int[] mc = new int[segments.length];
114.947 - int mcsum = 0;
114.948 - for (int i = 0; i < segments.length; ++i) {
114.949 - if (segments[i].count != 0)
114.950 + for (int j = 0; j < segments.length; ++j) {
114.951 + Segment<K,V> seg = segmentAt(segments, j);
114.952 + if (seg != null) {
114.953 + if (seg.count != 0)
114.954 + return false;
114.955 + sum += seg.modCount;
114.956 + }
114.957 + }
114.958 + if (sum != 0L) { // recheck unless no modifications
114.959 + for (int j = 0; j < segments.length; ++j) {
114.960 + Segment<K,V> seg = segmentAt(segments, j);
114.961 + if (seg != null) {
114.962 + if (seg.count != 0)
114.963 + return false;
114.964 + sum -= seg.modCount;
114.965 + }
114.966 + }
114.967 + if (sum != 0L)
114.968 return false;
114.969 - else
114.970 - mcsum += mc[i] = segments[i].modCount;
114.971 - }
114.972 - // If mcsum happens to be zero, then we know we got a snapshot
114.973 - // before any modifications at all were made. This is
114.974 - // probably common enough to bother tracking.
114.975 - if (mcsum != 0) {
114.976 - for (int i = 0; i < segments.length; ++i) {
114.977 - if (segments[i].count != 0 ||
114.978 - mc[i] != segments[i].modCount)
114.979 - return false;
114.980 - }
114.981 }
114.982 return true;
114.983 }
114.984 @@ -740,45 +862,43 @@
114.985 * @return the number of key-value mappings in this map
114.986 */
114.987 public int size() {
114.988 - final Segment<K,V>[] segments = this.segments;
114.989 - long sum = 0;
114.990 - long check = 0;
114.991 - int[] mc = new int[segments.length];
114.992 // Try a few times to get accurate count. On failure due to
114.993 // continuous async changes in table, resort to locking.
114.994 - for (int k = 0; k < RETRIES_BEFORE_LOCK; ++k) {
114.995 - check = 0;
114.996 - sum = 0;
114.997 - int mcsum = 0;
114.998 - for (int i = 0; i < segments.length; ++i) {
114.999 - sum += segments[i].count;
114.1000 - mcsum += mc[i] = segments[i].modCount;
114.1001 - }
114.1002 - if (mcsum != 0) {
114.1003 - for (int i = 0; i < segments.length; ++i) {
114.1004 - check += segments[i].count;
114.1005 - if (mc[i] != segments[i].modCount) {
114.1006 - check = -1; // force retry
114.1007 - break;
114.1008 + final Segment<K,V>[] segments = this.segments;
114.1009 + int size;
114.1010 + boolean overflow; // true if size overflows 32 bits
114.1011 + long sum; // sum of modCounts
114.1012 + long last = 0L; // previous sum
114.1013 + int retries = -1; // first iteration isn't retry
114.1014 + try {
114.1015 + for (;;) {
114.1016 + if (retries++ == RETRIES_BEFORE_LOCK) {
114.1017 + for (int j = 0; j < segments.length; ++j)
114.1018 + ensureSegment(j).lock(); // force creation
114.1019 + }
114.1020 + sum = 0L;
114.1021 + size = 0;
114.1022 + overflow = false;
114.1023 + for (int j = 0; j < segments.length; ++j) {
114.1024 + Segment<K,V> seg = segmentAt(segments, j);
114.1025 + if (seg != null) {
114.1026 + sum += seg.modCount;
114.1027 + int c = seg.count;
114.1028 + if (c < 0 || (size += c) < 0)
114.1029 + overflow = true;
114.1030 }
114.1031 }
114.1032 + if (sum == last)
114.1033 + break;
114.1034 + last = sum;
114.1035 }
114.1036 - if (check == sum)
114.1037 - break;
114.1038 + } finally {
114.1039 + if (retries > RETRIES_BEFORE_LOCK) {
114.1040 + for (int j = 0; j < segments.length; ++j)
114.1041 + segmentAt(segments, j).unlock();
114.1042 + }
114.1043 }
114.1044 - if (check != sum) { // Resort to locking all segments
114.1045 - sum = 0;
114.1046 - for (int i = 0; i < segments.length; ++i)
114.1047 - segments[i].lock();
114.1048 - for (int i = 0; i < segments.length; ++i)
114.1049 - sum += segments[i].count;
114.1050 - for (int i = 0; i < segments.length; ++i)
114.1051 - segments[i].unlock();
114.1052 - }
114.1053 - if (sum > Integer.MAX_VALUE)
114.1054 - return Integer.MAX_VALUE;
114.1055 - else
114.1056 - return (int)sum;
114.1057 + return overflow ? Integer.MAX_VALUE : size;
114.1058 }
114.1059
114.1060 /**
114.1061 @@ -794,7 +914,13 @@
114.1062 */
114.1063 public V get(Object key) {
114.1064 int hash = hash(key.hashCode());
114.1065 - return segmentFor(hash).get(key, hash);
114.1066 + for (HashEntry<K,V> e = entryForHash(segmentForHash(hash), hash);
114.1067 + e != null; e = e.next) {
114.1068 + K k;
114.1069 + if ((k = e.key) == key || (e.hash == hash && key.equals(k)))
114.1070 + return e.value;
114.1071 + }
114.1072 + return null;
114.1073 }
114.1074
114.1075 /**
114.1076 @@ -808,7 +934,13 @@
114.1077 */
114.1078 public boolean containsKey(Object key) {
114.1079 int hash = hash(key.hashCode());
114.1080 - return segmentFor(hash).containsKey(key, hash);
114.1081 + for (HashEntry<K,V> e = entryForHash(segmentForHash(hash), hash);
114.1082 + e != null; e = e.next) {
114.1083 + K k;
114.1084 + if ((k = e.key) == key || (e.hash == hash && key.equals(k)))
114.1085 + return true;
114.1086 + }
114.1087 + return false;
114.1088 }
114.1089
114.1090 /**
114.1091 @@ -823,51 +955,47 @@
114.1092 * @throws NullPointerException if the specified value is null
114.1093 */
114.1094 public boolean containsValue(Object value) {
114.1095 + // Same idea as size()
114.1096 if (value == null)
114.1097 throw new NullPointerException();
114.1098 -
114.1099 - // See explanation of modCount use above
114.1100 -
114.1101 final Segment<K,V>[] segments = this.segments;
114.1102 - int[] mc = new int[segments.length];
114.1103 -
114.1104 - // Try a few times without locking
114.1105 - for (int k = 0; k < RETRIES_BEFORE_LOCK; ++k) {
114.1106 - int sum = 0;
114.1107 - int mcsum = 0;
114.1108 - for (int i = 0; i < segments.length; ++i) {
114.1109 - int c = segments[i].count;
114.1110 - mcsum += mc[i] = segments[i].modCount;
114.1111 - if (segments[i].containsValue(value))
114.1112 - return true;
114.1113 - }
114.1114 - boolean cleanSweep = true;
114.1115 - if (mcsum != 0) {
114.1116 - for (int i = 0; i < segments.length; ++i) {
114.1117 - int c = segments[i].count;
114.1118 - if (mc[i] != segments[i].modCount) {
114.1119 - cleanSweep = false;
114.1120 - break;
114.1121 + boolean found = false;
114.1122 + long last = 0;
114.1123 + int retries = -1;
114.1124 + try {
114.1125 + outer: for (;;) {
114.1126 + if (retries++ == RETRIES_BEFORE_LOCK) {
114.1127 + for (int j = 0; j < segments.length; ++j)
114.1128 + ensureSegment(j).lock(); // force creation
114.1129 + }
114.1130 + long hashSum = 0L;
114.1131 + int sum = 0;
114.1132 + for (int j = 0; j < segments.length; ++j) {
114.1133 + HashEntry<K,V>[] tab;
114.1134 + Segment<K,V> seg = segmentAt(segments, j);
114.1135 + if (seg != null && (tab = seg.table) != null) {
114.1136 + for (int i = 0 ; i < tab.length; i++) {
114.1137 + HashEntry<K,V> e;
114.1138 + for (e = entryAt(tab, i); e != null; e = e.next) {
114.1139 + V v = e.value;
114.1140 + if (v != null && value.equals(v)) {
114.1141 + found = true;
114.1142 + break outer;
114.1143 + }
114.1144 + }
114.1145 + }
114.1146 + sum += seg.modCount;
114.1147 }
114.1148 }
114.1149 - }
114.1150 - if (cleanSweep)
114.1151 - return false;
114.1152 - }
114.1153 - // Resort to locking all segments
114.1154 - for (int i = 0; i < segments.length; ++i)
114.1155 - segments[i].lock();
114.1156 - boolean found = false;
114.1157 - try {
114.1158 - for (int i = 0; i < segments.length; ++i) {
114.1159 - if (segments[i].containsValue(value)) {
114.1160 - found = true;
114.1161 + if (retries > 0 && sum == last)
114.1162 break;
114.1163 - }
114.1164 + last = sum;
114.1165 }
114.1166 } finally {
114.1167 - for (int i = 0; i < segments.length; ++i)
114.1168 - segments[i].unlock();
114.1169 + if (retries > RETRIES_BEFORE_LOCK) {
114.1170 + for (int j = 0; j < segments.length; ++j)
114.1171 + segmentAt(segments, j).unlock();
114.1172 + }
114.1173 }
114.1174 return found;
114.1175 }
114.1176 @@ -908,7 +1036,11 @@
114.1177 if (value == null)
114.1178 throw new NullPointerException();
114.1179 int hash = hash(key.hashCode());
114.1180 - return segmentFor(hash).put(key, hash, value, false);
114.1181 + int j = (hash >>> segmentShift) & segmentMask;
114.1182 + Segment<K,V> s = segmentAt(segments, j);
114.1183 + if (s == null)
114.1184 + s = ensureSegment(j);
114.1185 + return s.put(key, hash, value, false);
114.1186 }
114.1187
114.1188 /**
114.1189 @@ -922,7 +1054,11 @@
114.1190 if (value == null)
114.1191 throw new NullPointerException();
114.1192 int hash = hash(key.hashCode());
114.1193 - return segmentFor(hash).put(key, hash, value, true);
114.1194 + int j = (hash >>> segmentShift) & segmentMask;
114.1195 + Segment<K,V> s = segmentAt(segments, j);
114.1196 + if (s == null)
114.1197 + s = ensureSegment(j);
114.1198 + return s.put(key, hash, value, true);
114.1199 }
114.1200
114.1201 /**
114.1202 @@ -948,7 +1084,8 @@
114.1203 */
114.1204 public V remove(Object key) {
114.1205 int hash = hash(key.hashCode());
114.1206 - return segmentFor(hash).remove(key, hash, null);
114.1207 + Segment<K,V> s = segmentForHash(hash);
114.1208 + return s == null ? null : s.remove(key, hash, null);
114.1209 }
114.1210
114.1211 /**
114.1212 @@ -958,9 +1095,9 @@
114.1213 */
114.1214 public boolean remove(Object key, Object value) {
114.1215 int hash = hash(key.hashCode());
114.1216 - if (value == null)
114.1217 - return false;
114.1218 - return segmentFor(hash).remove(key, hash, value) != null;
114.1219 + Segment<K,V> s;
114.1220 + return value != null && (s = segmentForHash(hash)) != null &&
114.1221 + s.remove(key, hash, value) != null;
114.1222 }
114.1223
114.1224 /**
114.1225 @@ -969,10 +1106,11 @@
114.1226 * @throws NullPointerException if any of the arguments are null
114.1227 */
114.1228 public boolean replace(K key, V oldValue, V newValue) {
114.1229 + int hash = hash(key.hashCode());
114.1230 if (oldValue == null || newValue == null)
114.1231 throw new NullPointerException();
114.1232 - int hash = hash(key.hashCode());
114.1233 - return segmentFor(hash).replace(key, hash, oldValue, newValue);
114.1234 + Segment<K,V> s = segmentForHash(hash);
114.1235 + return s != null && s.replace(key, hash, oldValue, newValue);
114.1236 }
114.1237
114.1238 /**
114.1239 @@ -983,18 +1121,23 @@
114.1240 * @throws NullPointerException if the specified key or value is null
114.1241 */
114.1242 public V replace(K key, V value) {
114.1243 + int hash = hash(key.hashCode());
114.1244 if (value == null)
114.1245 throw new NullPointerException();
114.1246 - int hash = hash(key.hashCode());
114.1247 - return segmentFor(hash).replace(key, hash, value);
114.1248 + Segment<K,V> s = segmentForHash(hash);
114.1249 + return s == null ? null : s.replace(key, hash, value);
114.1250 }
114.1251
114.1252 /**
114.1253 * Removes all of the mappings from this map.
114.1254 */
114.1255 public void clear() {
114.1256 - for (int i = 0; i < segments.length; ++i)
114.1257 - segments[i].clear();
114.1258 + final Segment<K,V>[] segments = this.segments;
114.1259 + for (int j = 0; j < segments.length; ++j) {
114.1260 + Segment<K,V> s = segmentAt(segments, j);
114.1261 + if (s != null)
114.1262 + s.clear();
114.1263 + }
114.1264 }
114.1265
114.1266 /**
114.1267 @@ -1095,42 +1238,41 @@
114.1268 advance();
114.1269 }
114.1270
114.1271 - public boolean hasMoreElements() { return hasNext(); }
114.1272 -
114.1273 + /**
114.1274 + * Set nextEntry to first node of next non-empty table
114.1275 + * (in backwards order, to simplify checks).
114.1276 + */
114.1277 final void advance() {
114.1278 - if (nextEntry != null && (nextEntry = nextEntry.next) != null)
114.1279 - return;
114.1280 -
114.1281 - while (nextTableIndex >= 0) {
114.1282 - if ( (nextEntry = currentTable[nextTableIndex--]) != null)
114.1283 - return;
114.1284 - }
114.1285 -
114.1286 - while (nextSegmentIndex >= 0) {
114.1287 - Segment<K,V> seg = segments[nextSegmentIndex--];
114.1288 - if (seg.count != 0) {
114.1289 - currentTable = seg.table;
114.1290 - for (int j = currentTable.length - 1; j >= 0; --j) {
114.1291 - if ( (nextEntry = currentTable[j]) != null) {
114.1292 - nextTableIndex = j - 1;
114.1293 - return;
114.1294 - }
114.1295 - }
114.1296 + for (;;) {
114.1297 + if (nextTableIndex >= 0) {
114.1298 + if ((nextEntry = entryAt(currentTable,
114.1299 + nextTableIndex--)) != null)
114.1300 + break;
114.1301 }
114.1302 + else if (nextSegmentIndex >= 0) {
114.1303 + Segment<K,V> seg = segmentAt(segments, nextSegmentIndex--);
114.1304 + if (seg != null && (currentTable = seg.table) != null)
114.1305 + nextTableIndex = currentTable.length - 1;
114.1306 + }
114.1307 + else
114.1308 + break;
114.1309 }
114.1310 }
114.1311
114.1312 - public boolean hasNext() { return nextEntry != null; }
114.1313 -
114.1314 - HashEntry<K,V> nextEntry() {
114.1315 - if (nextEntry == null)
114.1316 + final HashEntry<K,V> nextEntry() {
114.1317 + HashEntry<K,V> e = nextEntry;
114.1318 + if (e == null)
114.1319 throw new NoSuchElementException();
114.1320 - lastReturned = nextEntry;
114.1321 - advance();
114.1322 - return lastReturned;
114.1323 + lastReturned = e; // cannot assign until after null check
114.1324 + if ((nextEntry = e.next) == null)
114.1325 + advance();
114.1326 + return e;
114.1327 }
114.1328
114.1329 - public void remove() {
114.1330 + public final boolean hasNext() { return nextEntry != null; }
114.1331 + public final boolean hasMoreElements() { return nextEntry != null; }
114.1332 +
114.1333 + public final void remove() {
114.1334 if (lastReturned == null)
114.1335 throw new IllegalStateException();
114.1336 ConcurrentHashMap.this.remove(lastReturned.key);
114.1337 @@ -1142,16 +1284,16 @@
114.1338 extends HashIterator
114.1339 implements Iterator<K>, Enumeration<K>
114.1340 {
114.1341 - public K next() { return super.nextEntry().key; }
114.1342 - public K nextElement() { return super.nextEntry().key; }
114.1343 + public final K next() { return super.nextEntry().key; }
114.1344 + public final K nextElement() { return super.nextEntry().key; }
114.1345 }
114.1346
114.1347 final class ValueIterator
114.1348 extends HashIterator
114.1349 implements Iterator<V>, Enumeration<V>
114.1350 {
114.1351 - public V next() { return super.nextEntry().value; }
114.1352 - public V nextElement() { return super.nextEntry().value; }
114.1353 + public final V next() { return super.nextEntry().value; }
114.1354 + public final V nextElement() { return super.nextEntry().value; }
114.1355 }
114.1356
114.1357 /**
114.1358 @@ -1271,15 +1413,20 @@
114.1359 * The key-value mappings are emitted in no particular order.
114.1360 */
114.1361 private void writeObject(java.io.ObjectOutputStream s) throws IOException {
114.1362 + // force all segments for serialization compatibility
114.1363 + for (int k = 0; k < segments.length; ++k)
114.1364 + ensureSegment(k);
114.1365 s.defaultWriteObject();
114.1366
114.1367 + final Segment<K,V>[] segments = this.segments;
114.1368 for (int k = 0; k < segments.length; ++k) {
114.1369 - Segment<K,V> seg = segments[k];
114.1370 + Segment<K,V> seg = segmentAt(segments, k);
114.1371 seg.lock();
114.1372 try {
114.1373 HashEntry<K,V>[] tab = seg.table;
114.1374 for (int i = 0; i < tab.length; ++i) {
114.1375 - for (HashEntry<K,V> e = tab[i]; e != null; e = e.next) {
114.1376 + HashEntry<K,V> e;
114.1377 + for (e = entryAt(tab, i); e != null; e = e.next) {
114.1378 s.writeObject(e.key);
114.1379 s.writeObject(e.value);
114.1380 }
114.1381 @@ -1297,13 +1444,20 @@
114.1382 * stream (i.e., deserialize it).
114.1383 * @param s the stream
114.1384 */
114.1385 + @SuppressWarnings("unchecked")
114.1386 private void readObject(java.io.ObjectInputStream s)
114.1387 throws IOException, ClassNotFoundException {
114.1388 s.defaultReadObject();
114.1389
114.1390 - // Initialize each segment to be minimally sized, and let grow.
114.1391 - for (int i = 0; i < segments.length; ++i) {
114.1392 - segments[i].setTable(new HashEntry[1]);
114.1393 + // Re-initialize segments to be minimally sized, and let grow.
114.1394 + int cap = MIN_SEGMENT_TABLE_CAPACITY;
114.1395 + final Segment<K,V>[] segments = this.segments;
114.1396 + for (int k = 0; k < segments.length; ++k) {
114.1397 + Segment<K,V> seg = segments[k];
114.1398 + if (seg != null) {
114.1399 + seg.threshold = (int)(cap * seg.loadFactor);
114.1400 + seg.table = (HashEntry<K,V>[]) new HashEntry[cap];
114.1401 + }
114.1402 }
114.1403
114.1404 // Read the keys and values, and put the mappings in the table
114.1405 @@ -1315,4 +1469,31 @@
114.1406 put(key, value);
114.1407 }
114.1408 }
114.1409 +
114.1410 + // Unsafe mechanics
114.1411 + private static final sun.misc.Unsafe UNSAFE;
114.1412 + private static final long SBASE;
114.1413 + private static final int SSHIFT;
114.1414 + private static final long TBASE;
114.1415 + private static final int TSHIFT;
114.1416 +
114.1417 + static {
114.1418 + int ss, ts;
114.1419 + try {
114.1420 + UNSAFE = sun.misc.Unsafe.getUnsafe();
114.1421 + Class tc = HashEntry[].class;
114.1422 + Class sc = Segment[].class;
114.1423 + TBASE = UNSAFE.arrayBaseOffset(tc);
114.1424 + SBASE = UNSAFE.arrayBaseOffset(sc);
114.1425 + ts = UNSAFE.arrayIndexScale(tc);
114.1426 + ss = UNSAFE.arrayIndexScale(sc);
114.1427 + } catch (Exception e) {
114.1428 + throw new Error(e);
114.1429 + }
114.1430 + if ((ss & (ss-1)) != 0 || (ts & (ts-1)) != 0)
114.1431 + throw new Error("data type scale not a power of two");
114.1432 + SSHIFT = 31 - Integer.numberOfLeadingZeros(ss);
114.1433 + TSHIFT = 31 - Integer.numberOfLeadingZeros(ts);
114.1434 + }
114.1435 +
114.1436 }
115.1 --- a/src/share/classes/java/util/concurrent/ConcurrentLinkedDeque.java Tue Apr 19 16:01:27 2011 -0700
115.2 +++ b/src/share/classes/java/util/concurrent/ConcurrentLinkedDeque.java Tue Apr 26 15:48:03 2011 -0700
115.3 @@ -30,7 +30,7 @@
115.4 *
115.5 * Written by Doug Lea and Martin Buchholz with assistance from members of
115.6 * JCP JSR-166 Expert Group and released to the public domain, as explained
115.7 - * at http://creativecommons.org/licenses/publicdomain
115.8 + * at http://creativecommons.org/publicdomain/zero/1.0/
115.9 */
115.10
115.11 package java.util.concurrent;
116.1 --- a/src/share/classes/java/util/concurrent/ConcurrentLinkedQueue.java Tue Apr 19 16:01:27 2011 -0700
116.2 +++ b/src/share/classes/java/util/concurrent/ConcurrentLinkedQueue.java Tue Apr 26 15:48:03 2011 -0700
116.3 @@ -30,7 +30,7 @@
116.4 *
116.5 * Written by Doug Lea and Martin Buchholz with assistance from members of
116.6 * JCP JSR-166 Expert Group and released to the public domain, as explained
116.7 - * at http://creativecommons.org/licenses/publicdomain
116.8 + * at http://creativecommons.org/publicdomain/zero/1.0/
116.9 */
116.10
116.11 package java.util.concurrent;
117.1 --- a/src/share/classes/java/util/concurrent/ConcurrentMap.java Tue Apr 19 16:01:27 2011 -0700
117.2 +++ b/src/share/classes/java/util/concurrent/ConcurrentMap.java Tue Apr 26 15:48:03 2011 -0700
117.3 @@ -30,7 +30,7 @@
117.4 *
117.5 * Written by Doug Lea with assistance from members of JCP JSR-166
117.6 * Expert Group and released to the public domain, as explained at
117.7 - * http://creativecommons.org/licenses/publicdomain
117.8 + * http://creativecommons.org/publicdomain/zero/1.0/
117.9 */
117.10
117.11 package java.util.concurrent;
118.1 --- a/src/share/classes/java/util/concurrent/ConcurrentNavigableMap.java Tue Apr 19 16:01:27 2011 -0700
118.2 +++ b/src/share/classes/java/util/concurrent/ConcurrentNavigableMap.java Tue Apr 26 15:48:03 2011 -0700
118.3 @@ -30,7 +30,7 @@
118.4 *
118.5 * Written by Doug Lea with assistance from members of JCP JSR-166
118.6 * Expert Group and released to the public domain, as explained at
118.7 - * http://creativecommons.org/licenses/publicdomain
118.8 + * http://creativecommons.org/publicdomain/zero/1.0/
118.9 */
118.10
118.11 package java.util.concurrent;
119.1 --- a/src/share/classes/java/util/concurrent/ConcurrentSkipListMap.java Tue Apr 19 16:01:27 2011 -0700
119.2 +++ b/src/share/classes/java/util/concurrent/ConcurrentSkipListMap.java Tue Apr 26 15:48:03 2011 -0700
119.3 @@ -30,7 +30,7 @@
119.4 *
119.5 * Written by Doug Lea with assistance from members of JCP JSR-166
119.6 * Expert Group and released to the public domain, as explained at
119.7 - * http://creativecommons.org/licenses/publicdomain
119.8 + * http://creativecommons.org/publicdomain/zero/1.0/
119.9 */
119.10
119.11 package java.util.concurrent;
120.1 --- a/src/share/classes/java/util/concurrent/ConcurrentSkipListSet.java Tue Apr 19 16:01:27 2011 -0700
120.2 +++ b/src/share/classes/java/util/concurrent/ConcurrentSkipListSet.java Tue Apr 26 15:48:03 2011 -0700
120.3 @@ -30,7 +30,7 @@
120.4 *
120.5 * Written by Doug Lea with assistance from members of JCP JSR-166
120.6 * Expert Group and released to the public domain, as explained at
120.7 - * http://creativecommons.org/licenses/publicdomain
120.8 + * http://creativecommons.org/publicdomain/zero/1.0/
120.9 */
120.10
120.11 package java.util.concurrent;
121.1 --- a/src/share/classes/java/util/concurrent/CopyOnWriteArraySet.java Tue Apr 19 16:01:27 2011 -0700
121.2 +++ b/src/share/classes/java/util/concurrent/CopyOnWriteArraySet.java Tue Apr 26 15:48:03 2011 -0700
121.3 @@ -30,7 +30,7 @@
121.4 *
121.5 * Written by Doug Lea with assistance from members of JCP JSR-166
121.6 * Expert Group and released to the public domain, as explained at
121.7 - * http://creativecommons.org/licenses/publicdomain
121.8 + * http://creativecommons.org/publicdomain/zero/1.0/
121.9 */
121.10
121.11 package java.util.concurrent;
122.1 --- a/src/share/classes/java/util/concurrent/CountDownLatch.java Tue Apr 19 16:01:27 2011 -0700
122.2 +++ b/src/share/classes/java/util/concurrent/CountDownLatch.java Tue Apr 26 15:48:03 2011 -0700
122.3 @@ -30,7 +30,7 @@
122.4 *
122.5 * Written by Doug Lea with assistance from members of JCP JSR-166
122.6 * Expert Group and released to the public domain, as explained at
122.7 - * http://creativecommons.org/licenses/publicdomain
122.8 + * http://creativecommons.org/publicdomain/zero/1.0/
122.9 */
122.10
122.11 package java.util.concurrent;
123.1 --- a/src/share/classes/java/util/concurrent/CyclicBarrier.java Tue Apr 19 16:01:27 2011 -0700
123.2 +++ b/src/share/classes/java/util/concurrent/CyclicBarrier.java Tue Apr 26 15:48:03 2011 -0700
123.3 @@ -30,7 +30,7 @@
123.4 *
123.5 * Written by Doug Lea with assistance from members of JCP JSR-166
123.6 * Expert Group and released to the public domain, as explained at
123.7 - * http://creativecommons.org/licenses/publicdomain
123.8 + * http://creativecommons.org/publicdomain/zero/1.0/
123.9 */
123.10
123.11 package java.util.concurrent;
124.1 --- a/src/share/classes/java/util/concurrent/DelayQueue.java Tue Apr 19 16:01:27 2011 -0700
124.2 +++ b/src/share/classes/java/util/concurrent/DelayQueue.java Tue Apr 26 15:48:03 2011 -0700
124.3 @@ -30,7 +30,7 @@
124.4 *
124.5 * Written by Doug Lea with assistance from members of JCP JSR-166
124.6 * Expert Group and released to the public domain, as explained at
124.7 - * http://creativecommons.org/licenses/publicdomain
124.8 + * http://creativecommons.org/publicdomain/zero/1.0/
124.9 */
124.10
124.11
125.1 --- a/src/share/classes/java/util/concurrent/Delayed.java Tue Apr 19 16:01:27 2011 -0700
125.2 +++ b/src/share/classes/java/util/concurrent/Delayed.java Tue Apr 26 15:48:03 2011 -0700
125.3 @@ -30,7 +30,7 @@
125.4 *
125.5 * Written by Doug Lea with assistance from members of JCP JSR-166
125.6 * Expert Group and released to the public domain, as explained at
125.7 - * http://creativecommons.org/licenses/publicdomain
125.8 + * http://creativecommons.org/publicdomain/zero/1.0/
125.9 */
125.10
125.11 package java.util.concurrent;
126.1 --- a/src/share/classes/java/util/concurrent/Exchanger.java Tue Apr 19 16:01:27 2011 -0700
126.2 +++ b/src/share/classes/java/util/concurrent/Exchanger.java Tue Apr 26 15:48:03 2011 -0700
126.3 @@ -31,7 +31,7 @@
126.4 * Written by Doug Lea, Bill Scherer, and Michael Scott with
126.5 * assistance from members of JCP JSR-166 Expert Group and released to
126.6 * the public domain, as explained at
126.7 - * http://creativecommons.org/licenses/publicdomain
126.8 + * http://creativecommons.org/publicdomain/zero/1.0/
126.9 */
126.10
126.11 package java.util.concurrent;
127.1 --- a/src/share/classes/java/util/concurrent/ExecutionException.java Tue Apr 19 16:01:27 2011 -0700
127.2 +++ b/src/share/classes/java/util/concurrent/ExecutionException.java Tue Apr 26 15:48:03 2011 -0700
127.3 @@ -30,7 +30,7 @@
127.4 *
127.5 * Written by Doug Lea with assistance from members of JCP JSR-166
127.6 * Expert Group and released to the public domain, as explained at
127.7 - * http://creativecommons.org/licenses/publicdomain
127.8 + * http://creativecommons.org/publicdomain/zero/1.0/
127.9 */
127.10
127.11 package java.util.concurrent;
128.1 --- a/src/share/classes/java/util/concurrent/Executor.java Tue Apr 19 16:01:27 2011 -0700
128.2 +++ b/src/share/classes/java/util/concurrent/Executor.java Tue Apr 26 15:48:03 2011 -0700
128.3 @@ -30,7 +30,7 @@
128.4 *
128.5 * Written by Doug Lea with assistance from members of JCP JSR-166
128.6 * Expert Group and released to the public domain, as explained at
128.7 - * http://creativecommons.org/licenses/publicdomain
128.8 + * http://creativecommons.org/publicdomain/zero/1.0/
128.9 */
128.10
128.11 package java.util.concurrent;
129.1 --- a/src/share/classes/java/util/concurrent/ExecutorCompletionService.java Tue Apr 19 16:01:27 2011 -0700
129.2 +++ b/src/share/classes/java/util/concurrent/ExecutorCompletionService.java Tue Apr 26 15:48:03 2011 -0700
129.3 @@ -30,7 +30,7 @@
129.4 *
129.5 * Written by Doug Lea with assistance from members of JCP JSR-166
129.6 * Expert Group and released to the public domain, as explained at
129.7 - * http://creativecommons.org/licenses/publicdomain
129.8 + * http://creativecommons.org/publicdomain/zero/1.0/
129.9 */
129.10
129.11 package java.util.concurrent;
130.1 --- a/src/share/classes/java/util/concurrent/ExecutorService.java Tue Apr 19 16:01:27 2011 -0700
130.2 +++ b/src/share/classes/java/util/concurrent/ExecutorService.java Tue Apr 26 15:48:03 2011 -0700
130.3 @@ -30,7 +30,7 @@
130.4 *
130.5 * Written by Doug Lea with assistance from members of JCP JSR-166
130.6 * Expert Group and released to the public domain, as explained at
130.7 - * http://creativecommons.org/licenses/publicdomain
130.8 + * http://creativecommons.org/publicdomain/zero/1.0/
130.9 */
130.10
130.11 package java.util.concurrent;
131.1 --- a/src/share/classes/java/util/concurrent/Executors.java Tue Apr 19 16:01:27 2011 -0700
131.2 +++ b/src/share/classes/java/util/concurrent/Executors.java Tue Apr 26 15:48:03 2011 -0700
131.3 @@ -30,7 +30,7 @@
131.4 *
131.5 * Written by Doug Lea with assistance from members of JCP JSR-166
131.6 * Expert Group and released to the public domain, as explained at
131.7 - * http://creativecommons.org/licenses/publicdomain
131.8 + * http://creativecommons.org/publicdomain/zero/1.0/
131.9 */
131.10
131.11 package java.util.concurrent;
132.1 --- a/src/share/classes/java/util/concurrent/ForkJoinPool.java Tue Apr 19 16:01:27 2011 -0700
132.2 +++ b/src/share/classes/java/util/concurrent/ForkJoinPool.java Tue Apr 26 15:48:03 2011 -0700
132.3 @@ -30,7 +30,7 @@
132.4 *
132.5 * Written by Doug Lea with assistance from members of JCP JSR-166
132.6 * Expert Group and released to the public domain, as explained at
132.7 - * http://creativecommons.org/licenses/publicdomain
132.8 + * http://creativecommons.org/publicdomain/zero/1.0/
132.9 */
132.10
132.11 package java.util.concurrent;
132.12 @@ -791,18 +791,19 @@
132.13
132.14 /**
132.15 * Tries to enqueue worker w in wait queue and await change in
132.16 - * worker's eventCount. If the pool is quiescent, possibly
132.17 - * terminates worker upon exit. Otherwise, before blocking,
132.18 - * rescans queues to avoid missed signals. Upon finding work,
132.19 - * releases at least one worker (which may be the current
132.20 - * worker). Rescans restart upon detected staleness or failure to
132.21 - * release due to contention. Note the unusual conventions about
132.22 - * Thread.interrupt here and elsewhere: Because interrupts are
132.23 - * used solely to alert threads to check termination, which is
132.24 - * checked here anyway, we clear status (using Thread.interrupted)
132.25 - * before any call to park, so that park does not immediately
132.26 - * return due to status being set via some other unrelated call to
132.27 - * interrupt in user code.
132.28 + * worker's eventCount. If the pool is quiescent and there is
132.29 + * more than one worker, possibly terminates worker upon exit.
132.30 + * Otherwise, before blocking, rescans queues to avoid missed
132.31 + * signals. Upon finding work, releases at least one worker
132.32 + * (which may be the current worker). Rescans restart upon
132.33 + * detected staleness or failure to release due to
132.34 + * contention. Note the unusual conventions about Thread.interrupt
132.35 + * here and elsewhere: Because interrupts are used solely to alert
132.36 + * threads to check termination, which is checked here anyway, we
132.37 + * clear status (using Thread.interrupted) before any call to
132.38 + * park, so that park does not immediately return due to status
132.39 + * being set via some other unrelated call to interrupt in user
132.40 + * code.
132.41 *
132.42 * @param w the calling worker
132.43 * @param c the ctl value on entry
132.44 @@ -823,7 +824,8 @@
132.45 else if (w.eventCount != v)
132.46 return true; // update next time
132.47 }
132.48 - if (parallelism + (int)(nc >> AC_SHIFT) == 0 &&
132.49 + if ((!shutdown || !tryTerminate(false)) &&
132.50 + (int)c != 0 && parallelism + (int)(nc >> AC_SHIFT) == 0 &&
132.51 blockedCount == 0 && quiescerCount == 0)
132.52 idleAwaitWork(w, nc, c, v); // quiescent
132.53 for (boolean rescanned = false;;) {
132.54 @@ -893,7 +895,8 @@
132.55 w.parked = false;
132.56 if (w.eventCount != v)
132.57 break;
132.58 - else if (System.nanoTime() - startTime < SHRINK_RATE)
132.59 + else if (System.nanoTime() - startTime <
132.60 + SHRINK_RATE - (SHRINK_RATE / 10)) // timing slop
132.61 Thread.interrupted(); // spurious wakeup
132.62 else if (UNSAFE.compareAndSwapLong(this, ctlOffset,
132.63 currentCtl, prevCtl)) {
132.64 @@ -1022,8 +1025,8 @@
132.65 do {} while (!UNSAFE.compareAndSwapLong(this, ctlOffset, // no mask
132.66 c = ctl, c + AC_UNIT));
132.67 int b;
132.68 - do {} while(!UNSAFE.compareAndSwapInt(this, blockedCountOffset,
132.69 - b = blockedCount, b - 1));
132.70 + do {} while (!UNSAFE.compareAndSwapInt(this, blockedCountOffset,
132.71 + b = blockedCount, b - 1));
132.72 }
132.73
132.74 /**
132.75 @@ -1175,7 +1178,7 @@
132.76 ws[k] = w;
132.77 nextWorkerIndex = k + 1;
132.78 int m = g & SMASK;
132.79 - g = k >= m? ((m << 1) + 1) & SMASK : g + (SG_UNIT<<1);
132.80 + g = (k > m) ? ((m << 1) + 1) & SMASK : g + (SG_UNIT<<1);
132.81 }
132.82 } finally {
132.83 scanGuard = g;
132.84 @@ -1358,8 +1361,8 @@
132.85 */
132.86 final void addQuiescerCount(int delta) {
132.87 int c;
132.88 - do {} while(!UNSAFE.compareAndSwapInt(this, quiescerCountOffset,
132.89 - c = quiescerCount, c + delta));
132.90 + do {} while (!UNSAFE.compareAndSwapInt(this, quiescerCountOffset,
132.91 + c = quiescerCount, c + delta));
132.92 }
132.93
132.94 /**
132.95 @@ -1712,7 +1715,7 @@
132.96 */
132.97 public int getRunningThreadCount() {
132.98 int r = parallelism + (int)(ctl >> AC_SHIFT);
132.99 - return r <= 0? 0 : r; // suppress momentarily negative values
132.100 + return (r <= 0) ? 0 : r; // suppress momentarily negative values
132.101 }
132.102
132.103 /**
132.104 @@ -1724,7 +1727,7 @@
132.105 */
132.106 public int getActiveThreadCount() {
132.107 int r = parallelism + (int)(ctl >> AC_SHIFT) + blockedCount;
132.108 - return r <= 0? 0 : r; // suppress momentarily negative values
132.109 + return (r <= 0) ? 0 : r; // suppress momentarily negative values
132.110 }
132.111
132.112 /**
132.113 @@ -1879,9 +1882,9 @@
132.114 int ac = rc + blockedCount;
132.115 String level;
132.116 if ((c & STOP_BIT) != 0)
132.117 - level = (tc == 0)? "Terminated" : "Terminating";
132.118 + level = (tc == 0) ? "Terminated" : "Terminating";
132.119 else
132.120 - level = shutdown? "Shutting down" : "Running";
132.121 + level = shutdown ? "Shutting down" : "Running";
132.122 return super.toString() +
132.123 "[" + level +
132.124 ", parallelism = " + pc +
133.1 --- a/src/share/classes/java/util/concurrent/ForkJoinTask.java Tue Apr 19 16:01:27 2011 -0700
133.2 +++ b/src/share/classes/java/util/concurrent/ForkJoinTask.java Tue Apr 26 15:48:03 2011 -0700
133.3 @@ -30,7 +30,7 @@
133.4 *
133.5 * Written by Doug Lea with assistance from members of JCP JSR-166
133.6 * Expert Group and released to the public domain, as explained at
133.7 - * http://creativecommons.org/licenses/publicdomain
133.8 + * http://creativecommons.org/publicdomain/zero/1.0/
133.9 */
133.10
133.11 package java.util.concurrent;
134.1 --- a/src/share/classes/java/util/concurrent/ForkJoinWorkerThread.java Tue Apr 19 16:01:27 2011 -0700
134.2 +++ b/src/share/classes/java/util/concurrent/ForkJoinWorkerThread.java Tue Apr 26 15:48:03 2011 -0700
134.3 @@ -30,7 +30,7 @@
134.4 *
134.5 * Written by Doug Lea with assistance from members of JCP JSR-166
134.6 * Expert Group and released to the public domain, as explained at
134.7 - * http://creativecommons.org/licenses/publicdomain
134.8 + * http://creativecommons.org/publicdomain/zero/1.0/
134.9 */
134.10
134.11 package java.util.concurrent;
134.12 @@ -361,7 +361,7 @@
134.13 protected void onStart() {
134.14 queue = new ForkJoinTask<?>[INITIAL_QUEUE_CAPACITY];
134.15 int r = pool.workerSeedGenerator.nextInt();
134.16 - seed = (r == 0)? 1 : r; // must be nonzero
134.17 + seed = (r == 0) ? 1 : r; // must be nonzero
134.18 }
134.19
134.20 /**
134.21 @@ -724,7 +724,7 @@
134.22 Thread.yield(); // for politeness
134.23 }
134.24 else
134.25 - retries = helpJoinTask(joinMe)? MAX_HELP : retries - 1;
134.26 + retries = helpJoinTask(joinMe) ? MAX_HELP : retries - 1;
134.27 }
134.28 else {
134.29 retries = MAX_HELP; // restart if not done
134.30 @@ -955,7 +955,7 @@
134.31 p.addActiveCount(1);
134.32 }
134.33 if ((t = (v != this) ? v.deqTask() :
134.34 - locallyFifo? locallyDeqTask() : popTask()) != null) {
134.35 + locallyFifo ? locallyDeqTask() : popTask()) != null) {
134.36 currentSteal = t;
134.37 t.doExec();
134.38 currentSteal = ps;
135.1 --- a/src/share/classes/java/util/concurrent/Future.java Tue Apr 19 16:01:27 2011 -0700
135.2 +++ b/src/share/classes/java/util/concurrent/Future.java Tue Apr 26 15:48:03 2011 -0700
135.3 @@ -30,7 +30,7 @@
135.4 *
135.5 * Written by Doug Lea with assistance from members of JCP JSR-166
135.6 * Expert Group and released to the public domain, as explained at
135.7 - * http://creativecommons.org/licenses/publicdomain
135.8 + * http://creativecommons.org/publicdomain/zero/1.0/
135.9 */
135.10
135.11 package java.util.concurrent;
136.1 --- a/src/share/classes/java/util/concurrent/FutureTask.java Tue Apr 19 16:01:27 2011 -0700
136.2 +++ b/src/share/classes/java/util/concurrent/FutureTask.java Tue Apr 26 15:48:03 2011 -0700
136.3 @@ -30,7 +30,7 @@
136.4 *
136.5 * Written by Doug Lea with assistance from members of JCP JSR-166
136.6 * Expert Group and released to the public domain, as explained at
136.7 - * http://creativecommons.org/licenses/publicdomain
136.8 + * http://creativecommons.org/publicdomain/zero/1.0/
136.9 */
136.10
136.11 package java.util.concurrent;
137.1 --- a/src/share/classes/java/util/concurrent/LinkedBlockingDeque.java Tue Apr 19 16:01:27 2011 -0700
137.2 +++ b/src/share/classes/java/util/concurrent/LinkedBlockingDeque.java Tue Apr 26 15:48:03 2011 -0700
137.3 @@ -30,7 +30,7 @@
137.4 *
137.5 * Written by Doug Lea with assistance from members of JCP JSR-166
137.6 * Expert Group and released to the public domain, as explained at
137.7 - * http://creativecommons.org/licenses/publicdomain
137.8 + * http://creativecommons.org/publicdomain/zero/1.0/
137.9 */
137.10
137.11 package java.util.concurrent;
138.1 --- a/src/share/classes/java/util/concurrent/LinkedBlockingQueue.java Tue Apr 19 16:01:27 2011 -0700
138.2 +++ b/src/share/classes/java/util/concurrent/LinkedBlockingQueue.java Tue Apr 26 15:48:03 2011 -0700
138.3 @@ -30,7 +30,7 @@
138.4 *
138.5 * Written by Doug Lea with assistance from members of JCP JSR-166
138.6 * Expert Group and released to the public domain, as explained at
138.7 - * http://creativecommons.org/licenses/publicdomain
138.8 + * http://creativecommons.org/publicdomain/zero/1.0/
138.9 */
138.10
138.11 package java.util.concurrent;
139.1 --- a/src/share/classes/java/util/concurrent/LinkedTransferQueue.java Tue Apr 19 16:01:27 2011 -0700
139.2 +++ b/src/share/classes/java/util/concurrent/LinkedTransferQueue.java Tue Apr 26 15:48:03 2011 -0700
139.3 @@ -30,7 +30,7 @@
139.4 *
139.5 * Written by Doug Lea with assistance from members of JCP JSR-166
139.6 * Expert Group and released to the public domain, as explained at
139.7 - * http://creativecommons.org/licenses/publicdomain
139.8 + * http://creativecommons.org/publicdomain/zero/1.0/
139.9 */
139.10
139.11 package java.util.concurrent;
140.1 --- a/src/share/classes/java/util/concurrent/Phaser.java Tue Apr 19 16:01:27 2011 -0700
140.2 +++ b/src/share/classes/java/util/concurrent/Phaser.java Tue Apr 26 15:48:03 2011 -0700
140.3 @@ -30,7 +30,7 @@
140.4 *
140.5 * Written by Doug Lea with assistance from members of JCP JSR-166
140.6 * Expert Group and released to the public domain, as explained at
140.7 - * http://creativecommons.org/licenses/publicdomain
140.8 + * http://creativecommons.org/publicdomain/zero/1.0/
140.9 */
140.10
140.11 package java.util.concurrent;
141.1 --- a/src/share/classes/java/util/concurrent/PriorityBlockingQueue.java Tue Apr 19 16:01:27 2011 -0700
141.2 +++ b/src/share/classes/java/util/concurrent/PriorityBlockingQueue.java Tue Apr 26 15:48:03 2011 -0700
141.3 @@ -30,7 +30,7 @@
141.4 *
141.5 * Written by Doug Lea with assistance from members of JCP JSR-166
141.6 * Expert Group and released to the public domain, as explained at
141.7 - * http://creativecommons.org/licenses/publicdomain
141.8 + * http://creativecommons.org/publicdomain/zero/1.0/
141.9 */
141.10
141.11 package java.util.concurrent;
142.1 --- a/src/share/classes/java/util/concurrent/RecursiveAction.java Tue Apr 19 16:01:27 2011 -0700
142.2 +++ b/src/share/classes/java/util/concurrent/RecursiveAction.java Tue Apr 26 15:48:03 2011 -0700
142.3 @@ -30,7 +30,7 @@
142.4 *
142.5 * Written by Doug Lea with assistance from members of JCP JSR-166
142.6 * Expert Group and released to the public domain, as explained at
142.7 - * http://creativecommons.org/licenses/publicdomain
142.8 + * http://creativecommons.org/publicdomain/zero/1.0/
142.9 */
142.10
142.11 package java.util.concurrent;
143.1 --- a/src/share/classes/java/util/concurrent/RecursiveTask.java Tue Apr 19 16:01:27 2011 -0700
143.2 +++ b/src/share/classes/java/util/concurrent/RecursiveTask.java Tue Apr 26 15:48:03 2011 -0700
143.3 @@ -30,7 +30,7 @@
143.4 *
143.5 * Written by Doug Lea with assistance from members of JCP JSR-166
143.6 * Expert Group and released to the public domain, as explained at
143.7 - * http://creativecommons.org/licenses/publicdomain
143.8 + * http://creativecommons.org/publicdomain/zero/1.0/
143.9 */
143.10
143.11 package java.util.concurrent;
144.1 --- a/src/share/classes/java/util/concurrent/RejectedExecutionException.java Tue Apr 19 16:01:27 2011 -0700
144.2 +++ b/src/share/classes/java/util/concurrent/RejectedExecutionException.java Tue Apr 26 15:48:03 2011 -0700
144.3 @@ -30,7 +30,7 @@
144.4 *
144.5 * Written by Doug Lea with assistance from members of JCP JSR-166
144.6 * Expert Group and released to the public domain, as explained at
144.7 - * http://creativecommons.org/licenses/publicdomain
144.8 + * http://creativecommons.org/publicdomain/zero/1.0/
144.9 */
144.10
144.11 package java.util.concurrent;
145.1 --- a/src/share/classes/java/util/concurrent/RejectedExecutionHandler.java Tue Apr 19 16:01:27 2011 -0700
145.2 +++ b/src/share/classes/java/util/concurrent/RejectedExecutionHandler.java Tue Apr 26 15:48:03 2011 -0700
145.3 @@ -30,7 +30,7 @@
145.4 *
145.5 * Written by Doug Lea with assistance from members of JCP JSR-166
145.6 * Expert Group and released to the public domain, as explained at
145.7 - * http://creativecommons.org/licenses/publicdomain
145.8 + * http://creativecommons.org/publicdomain/zero/1.0/
145.9 */
145.10
145.11 package java.util.concurrent;
146.1 --- a/src/share/classes/java/util/concurrent/RunnableFuture.java Tue Apr 19 16:01:27 2011 -0700
146.2 +++ b/src/share/classes/java/util/concurrent/RunnableFuture.java Tue Apr 26 15:48:03 2011 -0700
146.3 @@ -30,7 +30,7 @@
146.4 *
146.5 * Written by Doug Lea with assistance from members of JCP JSR-166
146.6 * Expert Group and released to the public domain, as explained at
146.7 - * http://creativecommons.org/licenses/publicdomain
146.8 + * http://creativecommons.org/publicdomain/zero/1.0/
146.9 */
146.10
146.11 package java.util.concurrent;
147.1 --- a/src/share/classes/java/util/concurrent/RunnableScheduledFuture.java Tue Apr 19 16:01:27 2011 -0700
147.2 +++ b/src/share/classes/java/util/concurrent/RunnableScheduledFuture.java Tue Apr 26 15:48:03 2011 -0700
147.3 @@ -30,7 +30,7 @@
147.4 *
147.5 * Written by Doug Lea with assistance from members of JCP JSR-166
147.6 * Expert Group and released to the public domain, as explained at
147.7 - * http://creativecommons.org/licenses/publicdomain
147.8 + * http://creativecommons.org/publicdomain/zero/1.0/
147.9 */
147.10
147.11 package java.util.concurrent;
148.1 --- a/src/share/classes/java/util/concurrent/ScheduledExecutorService.java Tue Apr 19 16:01:27 2011 -0700
148.2 +++ b/src/share/classes/java/util/concurrent/ScheduledExecutorService.java Tue Apr 26 15:48:03 2011 -0700
148.3 @@ -30,7 +30,7 @@
148.4 *
148.5 * Written by Doug Lea with assistance from members of JCP JSR-166
148.6 * Expert Group and released to the public domain, as explained at
148.7 - * http://creativecommons.org/licenses/publicdomain
148.8 + * http://creativecommons.org/publicdomain/zero/1.0/
148.9 */
148.10
148.11 package java.util.concurrent;
149.1 --- a/src/share/classes/java/util/concurrent/ScheduledFuture.java Tue Apr 19 16:01:27 2011 -0700
149.2 +++ b/src/share/classes/java/util/concurrent/ScheduledFuture.java Tue Apr 26 15:48:03 2011 -0700
149.3 @@ -30,7 +30,7 @@
149.4 *
149.5 * Written by Doug Lea with assistance from members of JCP JSR-166
149.6 * Expert Group and released to the public domain, as explained at
149.7 - * http://creativecommons.org/licenses/publicdomain
149.8 + * http://creativecommons.org/publicdomain/zero/1.0/
149.9 */
149.10
149.11 package java.util.concurrent;
150.1 --- a/src/share/classes/java/util/concurrent/ScheduledThreadPoolExecutor.java Tue Apr 19 16:01:27 2011 -0700
150.2 +++ b/src/share/classes/java/util/concurrent/ScheduledThreadPoolExecutor.java Tue Apr 26 15:48:03 2011 -0700
150.3 @@ -30,7 +30,7 @@
150.4 *
150.5 * Written by Doug Lea with assistance from members of JCP JSR-166
150.6 * Expert Group and released to the public domain, as explained at
150.7 - * http://creativecommons.org/licenses/publicdomain
150.8 + * http://creativecommons.org/publicdomain/zero/1.0/
150.9 */
150.10
150.11 package java.util.concurrent;
151.1 --- a/src/share/classes/java/util/concurrent/Semaphore.java Tue Apr 19 16:01:27 2011 -0700
151.2 +++ b/src/share/classes/java/util/concurrent/Semaphore.java Tue Apr 26 15:48:03 2011 -0700
151.3 @@ -30,7 +30,7 @@
151.4 *
151.5 * Written by Doug Lea with assistance from members of JCP JSR-166
151.6 * Expert Group and released to the public domain, as explained at
151.7 - * http://creativecommons.org/licenses/publicdomain
151.8 + * http://creativecommons.org/publicdomain/zero/1.0/
151.9 */
151.10
151.11 package java.util.concurrent;
152.1 --- a/src/share/classes/java/util/concurrent/SynchronousQueue.java Tue Apr 19 16:01:27 2011 -0700
152.2 +++ b/src/share/classes/java/util/concurrent/SynchronousQueue.java Tue Apr 26 15:48:03 2011 -0700
152.3 @@ -31,7 +31,7 @@
152.4 * Written by Doug Lea, Bill Scherer, and Michael Scott with
152.5 * assistance from members of JCP JSR-166 Expert Group and released to
152.6 * the public domain, as explained at
152.7 - * http://creativecommons.org/licenses/publicdomain
152.8 + * http://creativecommons.org/publicdomain/zero/1.0/
152.9 */
152.10
152.11 package java.util.concurrent;
153.1 --- a/src/share/classes/java/util/concurrent/ThreadFactory.java Tue Apr 19 16:01:27 2011 -0700
153.2 +++ b/src/share/classes/java/util/concurrent/ThreadFactory.java Tue Apr 26 15:48:03 2011 -0700
153.3 @@ -30,7 +30,7 @@
153.4 *
153.5 * Written by Doug Lea with assistance from members of JCP JSR-166
153.6 * Expert Group and released to the public domain, as explained at
153.7 - * http://creativecommons.org/licenses/publicdomain
153.8 + * http://creativecommons.org/publicdomain/zero/1.0/
153.9 */
153.10
153.11 package java.util.concurrent;
154.1 --- a/src/share/classes/java/util/concurrent/ThreadLocalRandom.java Tue Apr 19 16:01:27 2011 -0700
154.2 +++ b/src/share/classes/java/util/concurrent/ThreadLocalRandom.java Tue Apr 26 15:48:03 2011 -0700
154.3 @@ -30,7 +30,7 @@
154.4 *
154.5 * Written by Doug Lea with assistance from members of JCP JSR-166
154.6 * Expert Group and released to the public domain, as explained at
154.7 - * http://creativecommons.org/licenses/publicdomain
154.8 + * http://creativecommons.org/publicdomain/zero/1.0/
154.9 */
154.10
154.11 package java.util.concurrent;
155.1 --- a/src/share/classes/java/util/concurrent/ThreadPoolExecutor.java Tue Apr 19 16:01:27 2011 -0700
155.2 +++ b/src/share/classes/java/util/concurrent/ThreadPoolExecutor.java Tue Apr 26 15:48:03 2011 -0700
155.3 @@ -30,7 +30,7 @@
155.4 *
155.5 * Written by Doug Lea with assistance from members of JCP JSR-166
155.6 * Expert Group and released to the public domain, as explained at
155.7 - * http://creativecommons.org/licenses/publicdomain
155.8 + * http://creativecommons.org/publicdomain/zero/1.0/
155.9 */
155.10
155.11 package java.util.concurrent;
156.1 --- a/src/share/classes/java/util/concurrent/TimeUnit.java Tue Apr 19 16:01:27 2011 -0700
156.2 +++ b/src/share/classes/java/util/concurrent/TimeUnit.java Tue Apr 26 15:48:03 2011 -0700
156.3 @@ -30,7 +30,7 @@
156.4 *
156.5 * Written by Doug Lea with assistance from members of JCP JSR-166
156.6 * Expert Group and released to the public domain, as explained at
156.7 - * http://creativecommons.org/licenses/publicdomain
156.8 + * http://creativecommons.org/publicdomain/zero/1.0/
156.9 */
156.10
156.11 package java.util.concurrent;
157.1 --- a/src/share/classes/java/util/concurrent/TimeoutException.java Tue Apr 19 16:01:27 2011 -0700
157.2 +++ b/src/share/classes/java/util/concurrent/TimeoutException.java Tue Apr 26 15:48:03 2011 -0700
157.3 @@ -30,7 +30,7 @@
157.4 *
157.5 * Written by Doug Lea with assistance from members of JCP JSR-166
157.6 * Expert Group and released to the public domain, as explained at
157.7 - * http://creativecommons.org/licenses/publicdomain
157.8 + * http://creativecommons.org/publicdomain/zero/1.0/
157.9 */
157.10
157.11 package java.util.concurrent;
158.1 --- a/src/share/classes/java/util/concurrent/TransferQueue.java Tue Apr 19 16:01:27 2011 -0700
158.2 +++ b/src/share/classes/java/util/concurrent/TransferQueue.java Tue Apr 26 15:48:03 2011 -0700
158.3 @@ -30,7 +30,7 @@
158.4 *
158.5 * Written by Doug Lea with assistance from members of JCP JSR-166
158.6 * Expert Group and released to the public domain, as explained at
158.7 - * http://creativecommons.org/licenses/publicdomain
158.8 + * http://creativecommons.org/publicdomain/zero/1.0/
158.9 */
158.10
158.11 package java.util.concurrent;
159.1 --- a/src/share/classes/java/util/concurrent/atomic/AtomicBoolean.java Tue Apr 19 16:01:27 2011 -0700
159.2 +++ b/src/share/classes/java/util/concurrent/atomic/AtomicBoolean.java Tue Apr 26 15:48:03 2011 -0700
159.3 @@ -30,7 +30,7 @@
159.4 *
159.5 * Written by Doug Lea with assistance from members of JCP JSR-166
159.6 * Expert Group and released to the public domain, as explained at
159.7 - * http://creativecommons.org/licenses/publicdomain
159.8 + * http://creativecommons.org/publicdomain/zero/1.0/
159.9 */
159.10
159.11 package java.util.concurrent.atomic;
160.1 --- a/src/share/classes/java/util/concurrent/atomic/AtomicInteger.java Tue Apr 19 16:01:27 2011 -0700
160.2 +++ b/src/share/classes/java/util/concurrent/atomic/AtomicInteger.java Tue Apr 26 15:48:03 2011 -0700
160.3 @@ -30,7 +30,7 @@
160.4 *
160.5 * Written by Doug Lea with assistance from members of JCP JSR-166
160.6 * Expert Group and released to the public domain, as explained at
160.7 - * http://creativecommons.org/licenses/publicdomain
160.8 + * http://creativecommons.org/publicdomain/zero/1.0/
160.9 */
160.10
160.11 package java.util.concurrent.atomic;
161.1 --- a/src/share/classes/java/util/concurrent/atomic/AtomicIntegerArray.java Tue Apr 19 16:01:27 2011 -0700
161.2 +++ b/src/share/classes/java/util/concurrent/atomic/AtomicIntegerArray.java Tue Apr 26 15:48:03 2011 -0700
161.3 @@ -30,7 +30,7 @@
161.4 *
161.5 * Written by Doug Lea with assistance from members of JCP JSR-166
161.6 * Expert Group and released to the public domain, as explained at
161.7 - * http://creativecommons.org/licenses/publicdomain
161.8 + * http://creativecommons.org/publicdomain/zero/1.0/
161.9 */
161.10
161.11 package java.util.concurrent.atomic;
162.1 --- a/src/share/classes/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java Tue Apr 19 16:01:27 2011 -0700
162.2 +++ b/src/share/classes/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java Tue Apr 26 15:48:03 2011 -0700
162.3 @@ -30,7 +30,7 @@
162.4 *
162.5 * Written by Doug Lea with assistance from members of JCP JSR-166
162.6 * Expert Group and released to the public domain, as explained at
162.7 - * http://creativecommons.org/licenses/publicdomain
162.8 + * http://creativecommons.org/publicdomain/zero/1.0/
162.9 */
162.10
162.11 package java.util.concurrent.atomic;
163.1 --- a/src/share/classes/java/util/concurrent/atomic/AtomicLong.java Tue Apr 19 16:01:27 2011 -0700
163.2 +++ b/src/share/classes/java/util/concurrent/atomic/AtomicLong.java Tue Apr 26 15:48:03 2011 -0700
163.3 @@ -30,7 +30,7 @@
163.4 *
163.5 * Written by Doug Lea with assistance from members of JCP JSR-166
163.6 * Expert Group and released to the public domain, as explained at
163.7 - * http://creativecommons.org/licenses/publicdomain
163.8 + * http://creativecommons.org/publicdomain/zero/1.0/
163.9 */
163.10
163.11 package java.util.concurrent.atomic;
164.1 --- a/src/share/classes/java/util/concurrent/atomic/AtomicLongArray.java Tue Apr 19 16:01:27 2011 -0700
164.2 +++ b/src/share/classes/java/util/concurrent/atomic/AtomicLongArray.java Tue Apr 26 15:48:03 2011 -0700
164.3 @@ -30,7 +30,7 @@
164.4 *
164.5 * Written by Doug Lea with assistance from members of JCP JSR-166
164.6 * Expert Group and released to the public domain, as explained at
164.7 - * http://creativecommons.org/licenses/publicdomain
164.8 + * http://creativecommons.org/publicdomain/zero/1.0/
164.9 */
164.10
164.11 package java.util.concurrent.atomic;
165.1 --- a/src/share/classes/java/util/concurrent/atomic/AtomicLongFieldUpdater.java Tue Apr 19 16:01:27 2011 -0700
165.2 +++ b/src/share/classes/java/util/concurrent/atomic/AtomicLongFieldUpdater.java Tue Apr 26 15:48:03 2011 -0700
165.3 @@ -30,7 +30,7 @@
165.4 *
165.5 * Written by Doug Lea with assistance from members of JCP JSR-166
165.6 * Expert Group and released to the public domain, as explained at
165.7 - * http://creativecommons.org/licenses/publicdomain
165.8 + * http://creativecommons.org/publicdomain/zero/1.0/
165.9 */
165.10
165.11 package java.util.concurrent.atomic;
166.1 --- a/src/share/classes/java/util/concurrent/atomic/AtomicMarkableReference.java Tue Apr 19 16:01:27 2011 -0700
166.2 +++ b/src/share/classes/java/util/concurrent/atomic/AtomicMarkableReference.java Tue Apr 26 15:48:03 2011 -0700
166.3 @@ -30,7 +30,7 @@
166.4 *
166.5 * Written by Doug Lea with assistance from members of JCP JSR-166
166.6 * Expert Group and released to the public domain, as explained at
166.7 - * http://creativecommons.org/licenses/publicdomain
166.8 + * http://creativecommons.org/publicdomain/zero/1.0/
166.9 */
166.10
166.11 package java.util.concurrent.atomic;
167.1 --- a/src/share/classes/java/util/concurrent/atomic/AtomicReference.java Tue Apr 19 16:01:27 2011 -0700
167.2 +++ b/src/share/classes/java/util/concurrent/atomic/AtomicReference.java Tue Apr 26 15:48:03 2011 -0700
167.3 @@ -30,7 +30,7 @@
167.4 *
167.5 * Written by Doug Lea with assistance from members of JCP JSR-166
167.6 * Expert Group and released to the public domain, as explained at
167.7 - * http://creativecommons.org/licenses/publicdomain
167.8 + * http://creativecommons.org/publicdomain/zero/1.0/
167.9 */
167.10
167.11 package java.util.concurrent.atomic;
168.1 --- a/src/share/classes/java/util/concurrent/atomic/AtomicReferenceArray.java Tue Apr 19 16:01:27 2011 -0700
168.2 +++ b/src/share/classes/java/util/concurrent/atomic/AtomicReferenceArray.java Tue Apr 26 15:48:03 2011 -0700
168.3 @@ -30,7 +30,7 @@
168.4 *
168.5 * Written by Doug Lea with assistance from members of JCP JSR-166
168.6 * Expert Group and released to the public domain, as explained at
168.7 - * http://creativecommons.org/licenses/publicdomain
168.8 + * http://creativecommons.org/publicdomain/zero/1.0/
168.9 */
168.10
168.11 package java.util.concurrent.atomic;
169.1 --- a/src/share/classes/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java Tue Apr 19 16:01:27 2011 -0700
169.2 +++ b/src/share/classes/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java Tue Apr 26 15:48:03 2011 -0700
169.3 @@ -30,7 +30,7 @@
169.4 *
169.5 * Written by Doug Lea with assistance from members of JCP JSR-166
169.6 * Expert Group and released to the public domain, as explained at
169.7 - * http://creativecommons.org/licenses/publicdomain
169.8 + * http://creativecommons.org/publicdomain/zero/1.0/
169.9 */
169.10
169.11 package java.util.concurrent.atomic;
170.1 --- a/src/share/classes/java/util/concurrent/atomic/AtomicStampedReference.java Tue Apr 19 16:01:27 2011 -0700
170.2 +++ b/src/share/classes/java/util/concurrent/atomic/AtomicStampedReference.java Tue Apr 26 15:48:03 2011 -0700
170.3 @@ -30,7 +30,7 @@
170.4 *
170.5 * Written by Doug Lea with assistance from members of JCP JSR-166
170.6 * Expert Group and released to the public domain, as explained at
170.7 - * http://creativecommons.org/licenses/publicdomain
170.8 + * http://creativecommons.org/publicdomain/zero/1.0/
170.9 */
170.10
170.11 package java.util.concurrent.atomic;
171.1 --- a/src/share/classes/java/util/concurrent/atomic/package-info.java Tue Apr 19 16:01:27 2011 -0700
171.2 +++ b/src/share/classes/java/util/concurrent/atomic/package-info.java Tue Apr 26 15:48:03 2011 -0700
171.3 @@ -30,7 +30,7 @@
171.4 *
171.5 * Written by Doug Lea with assistance from members of JCP JSR-166
171.6 * Expert Group and released to the public domain, as explained at
171.7 - * http://creativecommons.org/licenses/publicdomain
171.8 + * http://creativecommons.org/publicdomain/zero/1.0/
171.9 */
171.10
171.11 /**
171.12 @@ -80,9 +80,8 @@
171.13 * </pre>
171.14 *
171.15 * <p>The memory effects for accesses and updates of atomics generally
171.16 - * follow the rules for volatiles, as stated in
171.17 - * <a href="http://java.sun.com/docs/books/jls/"> The Java Language
171.18 - * Specification, Third Edition (17.4 Memory Model)</a>:
171.19 + * follow the rules for volatiles, as stated in section 17.4 of
171.20 + * <cite>The Java™ Language Specification</cite>.
171.21 *
171.22 * <ul>
171.23 *
172.1 --- a/src/share/classes/java/util/concurrent/locks/AbstractOwnableSynchronizer.java Tue Apr 19 16:01:27 2011 -0700
172.2 +++ b/src/share/classes/java/util/concurrent/locks/AbstractOwnableSynchronizer.java Tue Apr 26 15:48:03 2011 -0700
172.3 @@ -30,7 +30,7 @@
172.4 *
172.5 * Written by Doug Lea with assistance from members of JCP JSR-166
172.6 * Expert Group and released to the public domain, as explained at
172.7 - * http://creativecommons.org/licenses/publicdomain
172.8 + * http://creativecommons.org/publicdomain/zero/1.0/
172.9 */
172.10
172.11 package java.util.concurrent.locks;
173.1 --- a/src/share/classes/java/util/concurrent/locks/AbstractQueuedLongSynchronizer.java Tue Apr 19 16:01:27 2011 -0700
173.2 +++ b/src/share/classes/java/util/concurrent/locks/AbstractQueuedLongSynchronizer.java Tue Apr 26 15:48:03 2011 -0700
173.3 @@ -30,7 +30,7 @@
173.4 *
173.5 * Written by Doug Lea with assistance from members of JCP JSR-166
173.6 * Expert Group and released to the public domain, as explained at
173.7 - * http://creativecommons.org/licenses/publicdomain
173.8 + * http://creativecommons.org/publicdomain/zero/1.0/
173.9 */
173.10
173.11 package java.util.concurrent.locks;
174.1 --- a/src/share/classes/java/util/concurrent/locks/AbstractQueuedSynchronizer.java Tue Apr 19 16:01:27 2011 -0700
174.2 +++ b/src/share/classes/java/util/concurrent/locks/AbstractQueuedSynchronizer.java Tue Apr 26 15:48:03 2011 -0700
174.3 @@ -30,7 +30,7 @@
174.4 *
174.5 * Written by Doug Lea with assistance from members of JCP JSR-166
174.6 * Expert Group and released to the public domain, as explained at
174.7 - * http://creativecommons.org/licenses/publicdomain
174.8 + * http://creativecommons.org/publicdomain/zero/1.0/
174.9 */
174.10
174.11 package java.util.concurrent.locks;
175.1 --- a/src/share/classes/java/util/concurrent/locks/Condition.java Tue Apr 19 16:01:27 2011 -0700
175.2 +++ b/src/share/classes/java/util/concurrent/locks/Condition.java Tue Apr 26 15:48:03 2011 -0700
175.3 @@ -30,7 +30,7 @@
175.4 *
175.5 * Written by Doug Lea with assistance from members of JCP JSR-166
175.6 * Expert Group and released to the public domain, as explained at
175.7 - * http://creativecommons.org/licenses/publicdomain
175.8 + * http://creativecommons.org/publicdomain/zero/1.0/
175.9 */
175.10
175.11 package java.util.concurrent.locks;
176.1 --- a/src/share/classes/java/util/concurrent/locks/Lock.java Tue Apr 19 16:01:27 2011 -0700
176.2 +++ b/src/share/classes/java/util/concurrent/locks/Lock.java Tue Apr 26 15:48:03 2011 -0700
176.3 @@ -30,7 +30,7 @@
176.4 *
176.5 * Written by Doug Lea with assistance from members of JCP JSR-166
176.6 * Expert Group and released to the public domain, as explained at
176.7 - * http://creativecommons.org/licenses/publicdomain
176.8 + * http://creativecommons.org/publicdomain/zero/1.0/
176.9 */
176.10
176.11 package java.util.concurrent.locks;
176.12 @@ -120,8 +120,8 @@
176.13 *
176.14 * <p>All {@code Lock} implementations <em>must</em> enforce the same
176.15 * memory synchronization semantics as provided by the built-in monitor
176.16 - * lock, as described in <a href="http://java.sun.com/docs/books/jls/">
176.17 - * The Java Language Specification, Third Edition (17.4 Memory Model)</a>:
176.18 + * lock, as described in section 17.4 of
176.19 + * <cite>The Java™ Language Specification</cite>:
176.20 * <ul>
176.21 * <li>A successful {@code lock} operation has the same memory
176.22 * synchronization effects as a successful <em>Lock</em> action.
177.1 --- a/src/share/classes/java/util/concurrent/locks/LockSupport.java Tue Apr 19 16:01:27 2011 -0700
177.2 +++ b/src/share/classes/java/util/concurrent/locks/LockSupport.java Tue Apr 26 15:48:03 2011 -0700
177.3 @@ -30,7 +30,7 @@
177.4 *
177.5 * Written by Doug Lea with assistance from members of JCP JSR-166
177.6 * Expert Group and released to the public domain, as explained at
177.7 - * http://creativecommons.org/licenses/publicdomain
177.8 + * http://creativecommons.org/publicdomain/zero/1.0/
177.9 */
177.10
177.11 package java.util.concurrent.locks;
178.1 --- a/src/share/classes/java/util/concurrent/locks/ReadWriteLock.java Tue Apr 19 16:01:27 2011 -0700
178.2 +++ b/src/share/classes/java/util/concurrent/locks/ReadWriteLock.java Tue Apr 26 15:48:03 2011 -0700
178.3 @@ -30,7 +30,7 @@
178.4 *
178.5 * Written by Doug Lea with assistance from members of JCP JSR-166
178.6 * Expert Group and released to the public domain, as explained at
178.7 - * http://creativecommons.org/licenses/publicdomain
178.8 + * http://creativecommons.org/publicdomain/zero/1.0/
178.9 */
178.10
178.11 package java.util.concurrent.locks;
179.1 --- a/src/share/classes/java/util/concurrent/locks/ReentrantLock.java Tue Apr 19 16:01:27 2011 -0700
179.2 +++ b/src/share/classes/java/util/concurrent/locks/ReentrantLock.java Tue Apr 26 15:48:03 2011 -0700
179.3 @@ -30,7 +30,7 @@
179.4 *
179.5 * Written by Doug Lea with assistance from members of JCP JSR-166
179.6 * Expert Group and released to the public domain, as explained at
179.7 - * http://creativecommons.org/licenses/publicdomain
179.8 + * http://creativecommons.org/publicdomain/zero/1.0/
179.9 */
179.10
179.11 package java.util.concurrent.locks;
180.1 --- a/src/share/classes/java/util/concurrent/locks/ReentrantReadWriteLock.java Tue Apr 19 16:01:27 2011 -0700
180.2 +++ b/src/share/classes/java/util/concurrent/locks/ReentrantReadWriteLock.java Tue Apr 26 15:48:03 2011 -0700
180.3 @@ -30,7 +30,7 @@
180.4 *
180.5 * Written by Doug Lea with assistance from members of JCP JSR-166
180.6 * Expert Group and released to the public domain, as explained at
180.7 - * http://creativecommons.org/licenses/publicdomain
180.8 + * http://creativecommons.org/publicdomain/zero/1.0/
180.9 */
180.10
180.11 package java.util.concurrent.locks;
181.1 --- a/src/share/classes/java/util/concurrent/locks/package-info.java Tue Apr 19 16:01:27 2011 -0700
181.2 +++ b/src/share/classes/java/util/concurrent/locks/package-info.java Tue Apr 26 15:48:03 2011 -0700
181.3 @@ -30,7 +30,7 @@
181.4 *
181.5 * Written by Doug Lea with assistance from members of JCP JSR-166
181.6 * Expert Group and released to the public domain, as explained at
181.7 - * http://creativecommons.org/licenses/publicdomain
181.8 + * http://creativecommons.org/publicdomain/zero/1.0/
181.9 */
181.10
181.11 /**
182.1 --- a/src/share/classes/java/util/concurrent/package-info.java Tue Apr 19 16:01:27 2011 -0700
182.2 +++ b/src/share/classes/java/util/concurrent/package-info.java Tue Apr 26 15:48:03 2011 -0700
182.3 @@ -30,7 +30,7 @@
182.4 *
182.5 * Written by Doug Lea with assistance from members of JCP JSR-166
182.6 * Expert Group and released to the public domain, as explained at
182.7 - * http://creativecommons.org/licenses/publicdomain
182.8 + * http://creativecommons.org/publicdomain/zero/1.0/
182.9 */
182.10
182.11 /**
182.12 @@ -218,8 +218,9 @@
182.13 *
182.14 * <h2><a name="MemoryVisibility">Memory Consistency Properties</a></h2>
182.15 *
182.16 - * <a href="http://java.sun.com/docs/books/jls/third_edition/html/memory.html">
182.17 - * Chapter 17 of the Java Language Specification</a> defines the
182.18 + * Chapter 17 of
182.19 + * <cite>The Java™ Language Specification</cite>
182.20 + * defines the
182.21 * <i>happens-before</i> relation on memory operations such as reads and
182.22 * writes of shared variables. The results of a write by one thread are
182.23 * guaranteed to be visible to a read by another thread only if the write
183.1 --- a/src/share/classes/java/util/jar/JarFile.java Tue Apr 19 16:01:27 2011 -0700
183.2 +++ b/src/share/classes/java/util/jar/JarFile.java Tue Apr 26 15:48:03 2011 -0700
183.3 @@ -37,6 +37,7 @@
183.4 import sun.security.action.GetPropertyAction;
183.5 import sun.security.util.ManifestEntryVerifier;
183.6 import sun.misc.SharedSecrets;
183.7 +import sun.security.util.SignatureFileVerifier;
183.8
183.9 /**
183.10 * The <code>JarFile</code> class is used to read the contents of a jar file
183.11 @@ -178,7 +179,7 @@
183.12 byte[] b = getBytes(manEntry);
183.13 man = new Manifest(new ByteArrayInputStream(b));
183.14 if (!jvInitialized) {
183.15 - jv = new JarVerifier(b);
183.16 + jv = new JarVerifier(b, man);
183.17 }
183.18 } else {
183.19 man = new Manifest(super.getInputStream(manEntry));
183.20 @@ -297,10 +298,7 @@
183.21 if (names != null) {
183.22 for (int i = 0; i < names.length; i++) {
183.23 String name = names[i].toUpperCase(Locale.ENGLISH);
183.24 - if (name.endsWith(".DSA") ||
183.25 - name.endsWith(".RSA") ||
183.26 - name.endsWith(".EC") ||
183.27 - name.endsWith(".SF")) {
183.28 + if (SignatureFileVerifier.isBlockOrSF(name)) {
183.29 // Assume since we found a signature-related file
183.30 // that the jar is signed and that we therefore
183.31 // need a JarVerifier and Manifest
183.32 @@ -329,17 +327,17 @@
183.33 if (names != null) {
183.34 for (int i = 0; i < names.length; i++) {
183.35 JarEntry e = getJarEntry(names[i]);
183.36 - if (!e.isDirectory()) {
183.37 + if (!e.isDirectory() &&
183.38 + SignatureFileVerifier.isBlock(names[i])) {
183.39 if (mev == null) {
183.40 mev = new ManifestEntryVerifier
183.41 (getManifestFromReference());
183.42 }
183.43 - byte[] b = getBytes(e);
183.44 - if (b != null && b.length > 0) {
183.45 - jv.beginEntry(e, mev);
183.46 - jv.update(b.length, b, 0, b.length, mev);
183.47 - jv.update(-1, null, 0, 0, mev);
183.48 - }
183.49 + String key = names[i].substring(
183.50 + 0, names[i].lastIndexOf("."));
183.51 + jv.verifyBlock(names[i],
183.52 + getBytes(e),
183.53 + super.getInputStream(getJarEntry(key + ".SF")));
183.54 }
183.55 }
183.56 }
184.1 --- a/src/share/classes/java/util/jar/JarInputStream.java Tue Apr 19 16:01:27 2011 -0700
184.2 +++ b/src/share/classes/java/util/jar/JarInputStream.java Tue Apr 26 15:48:03 2011 -0700
184.3 @@ -1,5 +1,5 @@
184.4 /*
184.5 - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
184.6 + * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
184.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
184.8 *
184.9 * This code is free software; you can redistribute it and/or modify it
184.10 @@ -95,7 +95,7 @@
184.11 man.read(new ByteArrayInputStream(bytes));
184.12 closeEntry();
184.13 if (doVerify) {
184.14 - jv = new JarVerifier(bytes);
184.15 + jv = new JarVerifier(bytes, man);
184.16 mev = new ManifestEntryVerifier(man);
184.17 }
184.18 return (JarEntry)super.getNextEntry();
185.1 --- a/src/share/classes/java/util/jar/JarVerifier.java Tue Apr 19 16:01:27 2011 -0700
185.2 +++ b/src/share/classes/java/util/jar/JarVerifier.java Tue Apr 26 15:48:03 2011 -0700
185.3 @@ -48,35 +48,18 @@
185.4
185.5 /* a table mapping names to code signers, for jar entries that have
185.6 had their actual hashes verified */
185.7 - private Hashtable verifiedSigners;
185.8 + private Map verifiedSigners;
185.9
185.10 /* a table mapping names to code signers, for jar entries that have
185.11 passed the .SF/.DSA/.EC -> MANIFEST check */
185.12 - private Hashtable sigFileSigners;
185.13 -
185.14 - /* a hash table to hold .SF bytes */
185.15 - private Hashtable sigFileData;
185.16 -
185.17 - /** "queue" of pending PKCS7 blocks that we couldn't parse
185.18 - * until we parsed the .SF file */
185.19 - private ArrayList pendingBlocks;
185.20 + private Map sigFileSigners;
185.21
185.22 /* cache of CodeSigner objects */
185.23 private ArrayList signerCache;
185.24
185.25 - /* Are we parsing a block? */
185.26 - private boolean parsingBlockOrSF = false;
185.27 -
185.28 - /* Are we done parsing META-INF entries? */
185.29 - private boolean parsingMeta = true;
185.30 -
185.31 /* Are there are files to verify? */
185.32 private boolean anyToVerify = true;
185.33
185.34 - /* The output stream to use when keeping track of files we are interested
185.35 - in */
185.36 - private ByteArrayOutputStream baos;
185.37 -
185.38 /** The ManifestDigester object */
185.39 private volatile ManifestDigester manDig;
185.40
185.41 @@ -92,20 +75,20 @@
185.42 /** collect -DIGEST-MANIFEST values for blacklist */
185.43 private List manifestDigests;
185.44
185.45 - public JarVerifier(byte rawBytes[]) {
185.46 + /** The manifest object */
185.47 + Manifest man = null;
185.48 +
185.49 + public JarVerifier(byte rawBytes[], Manifest man) {
185.50 + this.man = man;
185.51 manifestRawBytes = rawBytes;
185.52 - sigFileSigners = new Hashtable();
185.53 - verifiedSigners = new Hashtable();
185.54 - sigFileData = new Hashtable(11);
185.55 - pendingBlocks = new ArrayList();
185.56 - baos = new ByteArrayOutputStream();
185.57 + sigFileSigners = new HashMap();
185.58 + verifiedSigners = new HashMap();
185.59 manifestDigests = new ArrayList();
185.60 }
185.61
185.62 /**
185.63 - * This method scans to see which entry we're parsing and
185.64 - * keeps various state information depending on what type of
185.65 - * file is being parsed.
185.66 + * This method scans to see which entry we're parsing and keeps
185.67 + * various state information depending on the file being parsed.
185.68 */
185.69 public void beginEntry(JarEntry je, ManifestEntryVerifier mev)
185.70 throws IOException
185.71 @@ -129,30 +112,6 @@
185.72 * b. digest mismatch between the actual jar entry and the manifest
185.73 */
185.74
185.75 - if (parsingMeta) {
185.76 - String uname = name.toUpperCase(Locale.ENGLISH);
185.77 - if ((uname.startsWith("META-INF/") ||
185.78 - uname.startsWith("/META-INF/"))) {
185.79 -
185.80 - if (je.isDirectory()) {
185.81 - mev.setEntry(null, je);
185.82 - return;
185.83 - }
185.84 -
185.85 - if (SignatureFileVerifier.isBlockOrSF(uname)) {
185.86 - /* We parse only DSA, RSA or EC PKCS7 blocks. */
185.87 - parsingBlockOrSF = true;
185.88 - baos.reset();
185.89 - mev.setEntry(null, je);
185.90 - }
185.91 - return;
185.92 - }
185.93 - }
185.94 -
185.95 - if (parsingMeta) {
185.96 - doneWithMeta();
185.97 - }
185.98 -
185.99 if (je.isDirectory()) {
185.100 mev.setEntry(null, je);
185.101 return;
185.102 @@ -188,11 +147,7 @@
185.103 throws IOException
185.104 {
185.105 if (b != -1) {
185.106 - if (parsingBlockOrSF) {
185.107 - baos.write(b);
185.108 - } else {
185.109 - mev.update((byte)b);
185.110 - }
185.111 + mev.update((byte)b);
185.112 } else {
185.113 processEntry(mev);
185.114 }
185.115 @@ -207,11 +162,7 @@
185.116 throws IOException
185.117 {
185.118 if (n != -1) {
185.119 - if (parsingBlockOrSF) {
185.120 - baos.write(b, off, n);
185.121 - } else {
185.122 - mev.update(b, off, n);
185.123 - }
185.124 + mev.update(b, off, n);
185.125 } else {
185.126 processEntry(mev);
185.127 }
185.128 @@ -223,101 +174,10 @@
185.129 private void processEntry(ManifestEntryVerifier mev)
185.130 throws IOException
185.131 {
185.132 - if (!parsingBlockOrSF) {
185.133 - JarEntry je = mev.getEntry();
185.134 - if ((je != null) && (je.signers == null)) {
185.135 - je.signers = mev.verify(verifiedSigners, sigFileSigners);
185.136 - je.certs = mapSignersToCertArray(je.signers);
185.137 - }
185.138 - } else {
185.139 -
185.140 - try {
185.141 - parsingBlockOrSF = false;
185.142 -
185.143 - if (debug != null) {
185.144 - debug.println("processEntry: processing block");
185.145 - }
185.146 -
185.147 - String uname = mev.getEntry().getName()
185.148 - .toUpperCase(Locale.ENGLISH);
185.149 -
185.150 - if (uname.endsWith(".SF")) {
185.151 - String key = uname.substring(0, uname.length()-3);
185.152 - byte bytes[] = baos.toByteArray();
185.153 - // add to sigFileData in case future blocks need it
185.154 - sigFileData.put(key, bytes);
185.155 - // check pending blocks, we can now process
185.156 - // anyone waiting for this .SF file
185.157 - Iterator it = pendingBlocks.iterator();
185.158 - while (it.hasNext()) {
185.159 - SignatureFileVerifier sfv =
185.160 - (SignatureFileVerifier) it.next();
185.161 - if (sfv.needSignatureFile(key)) {
185.162 - if (debug != null) {
185.163 - debug.println(
185.164 - "processEntry: processing pending block");
185.165 - }
185.166 -
185.167 - sfv.setSignatureFile(bytes);
185.168 - sfv.process(sigFileSigners, manifestDigests);
185.169 - }
185.170 - }
185.171 - return;
185.172 - }
185.173 -
185.174 - // now we are parsing a signature block file
185.175 -
185.176 - String key = uname.substring(0, uname.lastIndexOf("."));
185.177 -
185.178 - if (signerCache == null)
185.179 - signerCache = new ArrayList();
185.180 -
185.181 - if (manDig == null) {
185.182 - synchronized(manifestRawBytes) {
185.183 - if (manDig == null) {
185.184 - manDig = new ManifestDigester(manifestRawBytes);
185.185 - manifestRawBytes = null;
185.186 - }
185.187 - }
185.188 - }
185.189 -
185.190 - SignatureFileVerifier sfv =
185.191 - new SignatureFileVerifier(signerCache,
185.192 - manDig, uname, baos.toByteArray());
185.193 -
185.194 - if (sfv.needSignatureFileBytes()) {
185.195 - // see if we have already parsed an external .SF file
185.196 - byte[] bytes = (byte[]) sigFileData.get(key);
185.197 -
185.198 - if (bytes == null) {
185.199 - // put this block on queue for later processing
185.200 - // since we don't have the .SF bytes yet
185.201 - // (uname, block);
185.202 - if (debug != null) {
185.203 - debug.println("adding pending block");
185.204 - }
185.205 - pendingBlocks.add(sfv);
185.206 - return;
185.207 - } else {
185.208 - sfv.setSignatureFile(bytes);
185.209 - }
185.210 - }
185.211 - sfv.process(sigFileSigners, manifestDigests);
185.212 -
185.213 - } catch (IOException ioe) {
185.214 - // e.g. sun.security.pkcs.ParsingException
185.215 - if (debug != null) debug.println("processEntry caught: "+ioe);
185.216 - // ignore and treat as unsigned
185.217 - } catch (SignatureException se) {
185.218 - if (debug != null) debug.println("processEntry caught: "+se);
185.219 - // ignore and treat as unsigned
185.220 - } catch (NoSuchAlgorithmException nsae) {
185.221 - if (debug != null) debug.println("processEntry caught: "+nsae);
185.222 - // ignore and treat as unsigned
185.223 - } catch (CertificateException ce) {
185.224 - if (debug != null) debug.println("processEntry caught: "+ce);
185.225 - // ignore and treat as unsigned
185.226 - }
185.227 + JarEntry je = mev.getEntry();
185.228 + if ((je != null) && (je.signers == null)) {
185.229 + je.signers = mev.verify(verifiedSigners, sigFileSigners);
185.230 + je.certs = mapSignersToCertArray(je.signers);
185.231 }
185.232 }
185.233
185.234 @@ -354,15 +214,15 @@
185.235 * Force a read of the entry data to generate the
185.236 * verification hash.
185.237 */
185.238 - try {
185.239 - InputStream s = jar.getInputStream(entry);
185.240 + try (InputStream s = jar.getInputStream(entry)) {
185.241 byte[] buffer = new byte[1024];
185.242 int n = buffer.length;
185.243 while (n != -1) {
185.244 n = s.read(buffer, 0, buffer.length);
185.245 }
185.246 - s.close();
185.247 } catch (IOException e) {
185.248 + // Ignore. When an exception is thrown, code signer
185.249 + // will not be assigned.
185.250 }
185.251 }
185.252 return getCodeSigners(name);
185.253 @@ -408,11 +268,7 @@
185.254 */
185.255 void doneWithMeta()
185.256 {
185.257 - parsingMeta = false;
185.258 anyToVerify = !sigFileSigners.isEmpty();
185.259 - baos = null;
185.260 - sigFileData = null;
185.261 - pendingBlocks = null;
185.262 signerCache = null;
185.263 manDig = null;
185.264 // MANIFEST.MF is always treated as signed and verified,
185.265 @@ -423,6 +279,41 @@
185.266 }
185.267 }
185.268
185.269 + /**
185.270 + * Verifies a PKCS7 SignedData block
185.271 + * @param key name of block
185.272 + * @param block the pkcs7 file
185.273 + * @param ins the clear data
185.274 + */
185.275 + void verifyBlock(String key, byte[] block, InputStream ins) {
185.276 + try {
185.277 + if (signerCache == null)
185.278 + signerCache = new ArrayList();
185.279 +
185.280 + if (manDig == null) {
185.281 + synchronized(manifestRawBytes) {
185.282 + if (manDig == null) {
185.283 + manDig = new ManifestDigester(manifestRawBytes);
185.284 + manifestRawBytes = null;
185.285 + }
185.286 + }
185.287 + }
185.288 + SignatureFileVerifier sfv =
185.289 + new SignatureFileVerifier(signerCache, man,
185.290 + manDig, key, block);
185.291 +
185.292 + if (sfv.needSignatureFile()) {
185.293 + // see if we have already parsed an external .SF file
185.294 + sfv.setSignatureFile(ins);
185.295 + }
185.296 + sfv.process(sigFileSigners, manifestDigests);
185.297 + } catch (Exception e) {
185.298 + if (debug != null) {
185.299 + e.printStackTrace();
185.300 + }
185.301 + }
185.302 + }
185.303 +
185.304 static class VerifierStream extends java.io.InputStream {
185.305
185.306 private InputStream is;
185.307 @@ -553,10 +444,7 @@
185.308 * but this handles a CodeSource of any type, just in case.
185.309 */
185.310 CodeSource[] sources = mapSignersToCodeSources(cs.getLocation(), getJarCodeSigners(), true);
185.311 - List sourceList = new ArrayList();
185.312 - for (int i = 0; i < sources.length; i++) {
185.313 - sourceList.add(sources[i]);
185.314 - }
185.315 + List sourceList = Arrays.asList(sources);
185.316 int j = sourceList.indexOf(cs);
185.317 if (j != -1) {
185.318 CodeSigner[] match;
186.1 --- a/src/share/classes/java/util/jar/Pack200.java Tue Apr 19 16:01:27 2011 -0700
186.2 +++ b/src/share/classes/java/util/jar/Pack200.java Tue Apr 26 15:48:03 2011 -0700
186.3 @@ -181,8 +181,8 @@
186.4 * The class files will not contain identical bytes, since the unpacker
186.5 * is free to change minor class file features such as constant pool order.
186.6 * However, the class files will be semantically identical,
186.7 - * as specified in the Java Virtual Machine Specification
186.8 - * <a href="http://java.sun.com/docs/books/vmspec/html/ClassFile.doc.html">http://java.sun.com/docs/books/vmspec/html/ClassFile.doc.html</a>.
186.9 + * as specified in
186.10 + * <cite>The Java™ Virtual Machine Specification</cite>.
186.11 * <p>
186.12 * By default, the packer does not change the order of JAR elements.
186.13 * Also, the modification time and deflation hint of each
187.1 --- a/src/share/classes/java/util/logging/FileHandler.java Tue Apr 19 16:01:27 2011 -0700
187.2 +++ b/src/share/classes/java/util/logging/FileHandler.java Tue Apr 26 15:48:03 2011 -0700
187.3 @@ -409,22 +409,25 @@
187.4 // Try the next file.
187.5 continue;
187.6 }
187.7 + boolean available;
187.8 try {
187.9 - FileLock fl = fc.tryLock();
187.10 - if (fl == null) {
187.11 - // We failed to get the lock. Try next file.
187.12 - continue;
187.13 - }
187.14 + available = fc.tryLock() != null;
187.15 // We got the lock OK.
187.16 } catch (IOException ix) {
187.17 // We got an IOException while trying to get the lock.
187.18 // This normally indicates that locking is not supported
187.19 // on the target directory. We have to proceed without
187.20 // getting a lock. Drop through.
187.21 + available = true;
187.22 }
187.23 - // We got the lock. Remember it.
187.24 - locks.put(lockFileName, lockFileName);
187.25 - break;
187.26 + if (available) {
187.27 + // We got the lock. Remember it.
187.28 + locks.put(lockFileName, lockFileName);
187.29 + break;
187.30 + }
187.31 +
187.32 + // We failed to get the lock. Try next file.
187.33 + fc.close();
187.34 }
187.35 }
187.36
188.1 --- a/src/share/classes/java/util/regex/Pattern.java Tue Apr 19 16:01:27 2011 -0700
188.2 +++ b/src/share/classes/java/util/regex/Pattern.java Tue Apr 26 15:48:03 2011 -0700
188.3 @@ -369,13 +369,10 @@
188.4 * part of an unescaped construct.
188.5 *
188.6 * <p> Backslashes within string literals in Java source code are interpreted
188.7 - * as required by the <a
188.8 - * href="http://java.sun.com/docs/books/jls">Java Language
188.9 - * Specification</a> as either <a
188.10 - * href="http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#100850">Unicode
188.11 - * escapes</a> or other <a
188.12 - * href="http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#101089">character
188.13 - * escapes</a>. It is therefore necessary to double backslashes in string
188.14 + * as required by
188.15 + * <cite>The Java™ Language Specification</cite>
188.16 + * as either Unicode escapes (section 3.3) or other character escapes (section 3.10.6)
188.17 + * It is therefore necessary to double backslashes in string
188.18 * literals that represent regular expressions to protect them from
188.19 * interpretation by the Java bytecode compiler. The string literal
188.20 * <tt>"\b"</tt>, for example, matches a single backspace character when
188.21 @@ -525,9 +522,9 @@
188.22 * Canonical Equivalents.
188.23 *
188.24 * <p> Unicode escape sequences such as <tt>\u2014</tt> in Java source code
188.25 - * are processed as described in <a
188.26 - * href="http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#100850">\u00A73.3</a>
188.27 - * of the Java Language Specification. Such escape sequences are also
188.28 + * are processed as described in section 3.3 of
188.29 + * <cite>The Java™ Language Specification</cite>.
188.30 + * Such escape sequences are also
188.31 * implemented directly by the regular-expression parser so that Unicode
188.32 * escapes can be used in expressions that are read from files or from the
188.33 * keyboard. Thus the strings <tt>"\u2014"</tt> and <tt>"\\u2014"</tt>,
189.1 --- a/src/share/classes/java/util/zip/ZipFile.java Tue Apr 19 16:01:27 2011 -0700
189.2 +++ b/src/share/classes/java/util/zip/ZipFile.java Tue Apr 26 15:48:03 2011 -0700
189.3 @@ -31,11 +31,13 @@
189.4 import java.io.EOFException;
189.5 import java.io.File;
189.6 import java.nio.charset.Charset;
189.7 -import java.util.Vector;
189.8 +import java.util.ArrayDeque;
189.9 +import java.util.Deque;
189.10 import java.util.Enumeration;
189.11 -import java.util.Set;
189.12 -import java.util.HashSet;
189.13 +import java.util.HashMap;
189.14 +import java.util.Map;
189.15 import java.util.NoSuchElementException;
189.16 +import java.util.WeakHashMap;
189.17 import java.security.AccessController;
189.18 import sun.security.action.GetPropertyAction;
189.19 import static java.util.zip.ZipConstants64.*;
189.20 @@ -54,7 +56,7 @@
189.21 private long jzfile; // address of jzfile data
189.22 private String name; // zip file name
189.23 private int total; // total number of entries
189.24 - private boolean closeRequested;
189.25 + private volatile boolean closeRequested = false;
189.26
189.27 private static final int STORED = ZipEntry.STORED;
189.28 private static final int DEFLATED = ZipEntry.DEFLATED;
189.29 @@ -314,8 +316,9 @@
189.30 // freeEntry releases the C jzentry struct.
189.31 private static native void freeEntry(long jzfile, long jzentry);
189.32
189.33 - // the outstanding inputstreams that need to be closed.
189.34 - private Set<InputStream> streams = new HashSet<>();
189.35 + // the outstanding inputstreams that need to be closed,
189.36 + // mapped to the inflater objects they use.
189.37 + private final Map<InputStream, Inflater> streams = new WeakHashMap<>();
189.38
189.39 /**
189.40 * Returns an input stream for reading the contents of the specified
189.41 @@ -351,51 +354,21 @@
189.42
189.43 switch (getEntryMethod(jzentry)) {
189.44 case STORED:
189.45 - streams.add(in);
189.46 + synchronized (streams) {
189.47 + streams.put(in, null);
189.48 + }
189.49 return in;
189.50 case DEFLATED:
189.51 - final ZipFileInputStream zfin = in;
189.52 // MORE: Compute good size for inflater stream:
189.53 long size = getEntrySize(jzentry) + 2; // Inflater likes a bit of slack
189.54 if (size > 65536) size = 8192;
189.55 if (size <= 0) size = 4096;
189.56 - InputStream is = new InflaterInputStream(zfin, getInflater(), (int)size) {
189.57 - private boolean isClosed = false;
189.58 -
189.59 - public void close() throws IOException {
189.60 - if (!isClosed) {
189.61 - super.close();
189.62 - releaseInflater(inf);
189.63 - isClosed = true;
189.64 - }
189.65 - }
189.66 - // Override fill() method to provide an extra "dummy" byte
189.67 - // at the end of the input stream. This is required when
189.68 - // using the "nowrap" Inflater option.
189.69 - protected void fill() throws IOException {
189.70 - if (eof) {
189.71 - throw new EOFException(
189.72 - "Unexpected end of ZLIB input stream");
189.73 - }
189.74 - len = this.in.read(buf, 0, buf.length);
189.75 - if (len == -1) {
189.76 - buf[0] = 0;
189.77 - len = 1;
189.78 - eof = true;
189.79 - }
189.80 - inf.setInput(buf, 0, len);
189.81 - }
189.82 - private boolean eof;
189.83 -
189.84 - public int available() throws IOException {
189.85 - if (isClosed)
189.86 - return 0;
189.87 - long avail = zfin.size() - inf.getBytesWritten();
189.88 - return avail > (long) Integer.MAX_VALUE ?
189.89 - Integer.MAX_VALUE : (int) avail;
189.90 - }
189.91 - };
189.92 - streams.add(is);
189.93 + Inflater inf = getInflater();
189.94 + InputStream is =
189.95 + new ZipFileInflaterInputStream(in, inf, (int)size);
189.96 + synchronized (streams) {
189.97 + streams.put(is, inf);
189.98 + }
189.99 return is;
189.100 default:
189.101 throw new ZipException("invalid compression method");
189.102 @@ -403,36 +376,91 @@
189.103 }
189.104 }
189.105
189.106 + private class ZipFileInflaterInputStream extends InflaterInputStream {
189.107 + private volatile boolean closeRequested = false;
189.108 + private boolean eof = false;
189.109 + private final ZipFileInputStream zfin;
189.110 +
189.111 + ZipFileInflaterInputStream(ZipFileInputStream zfin, Inflater inf,
189.112 + int size) {
189.113 + super(zfin, inf, size);
189.114 + this.zfin = zfin;
189.115 + }
189.116 +
189.117 + public void close() throws IOException {
189.118 + if (closeRequested)
189.119 + return;
189.120 + closeRequested = true;
189.121 +
189.122 + super.close();
189.123 + Inflater inf;
189.124 + synchronized (streams) {
189.125 + inf = streams.remove(this);
189.126 + }
189.127 + if (inf != null) {
189.128 + releaseInflater(inf);
189.129 + }
189.130 + }
189.131 +
189.132 + // Override fill() method to provide an extra "dummy" byte
189.133 + // at the end of the input stream. This is required when
189.134 + // using the "nowrap" Inflater option.
189.135 + protected void fill() throws IOException {
189.136 + if (eof) {
189.137 + throw new EOFException("Unexpected end of ZLIB input stream");
189.138 + }
189.139 + len = in.read(buf, 0, buf.length);
189.140 + if (len == -1) {
189.141 + buf[0] = 0;
189.142 + len = 1;
189.143 + eof = true;
189.144 + }
189.145 + inf.setInput(buf, 0, len);
189.146 + }
189.147 +
189.148 + public int available() throws IOException {
189.149 + if (closeRequested)
189.150 + return 0;
189.151 + long avail = zfin.size() - inf.getBytesWritten();
189.152 + return (avail > (long) Integer.MAX_VALUE ?
189.153 + Integer.MAX_VALUE : (int) avail);
189.154 + }
189.155 +
189.156 + protected void finalize() throws Throwable {
189.157 + close();
189.158 + }
189.159 + }
189.160 +
189.161 /*
189.162 * Gets an inflater from the list of available inflaters or allocates
189.163 * a new one.
189.164 */
189.165 private Inflater getInflater() {
189.166 - synchronized (inflaters) {
189.167 - int size = inflaters.size();
189.168 - if (size > 0) {
189.169 - Inflater inf = (Inflater)inflaters.remove(size - 1);
189.170 - return inf;
189.171 - } else {
189.172 - return new Inflater(true);
189.173 + Inflater inf;
189.174 + synchronized (inflaterCache) {
189.175 + while (null != (inf = inflaterCache.poll())) {
189.176 + if (false == inf.ended()) {
189.177 + return inf;
189.178 + }
189.179 }
189.180 }
189.181 + return new Inflater(true);
189.182 }
189.183
189.184 /*
189.185 * Releases the specified inflater to the list of available inflaters.
189.186 */
189.187 private void releaseInflater(Inflater inf) {
189.188 - synchronized (inflaters) {
189.189 - if (inf.ended())
189.190 - return;
189.191 + if (false == inf.ended()) {
189.192 inf.reset();
189.193 - inflaters.add(inf);
189.194 + synchronized (inflaterCache) {
189.195 + inflaterCache.add(inf);
189.196 + }
189.197 }
189.198 }
189.199
189.200 // List of available Inflater objects for decompression
189.201 - private Vector inflaters = new Vector();
189.202 + private Deque<Inflater> inflaterCache = new ArrayDeque<>();
189.203
189.204 /**
189.205 * Returns the path name of the ZIP file.
189.206 @@ -540,14 +568,32 @@
189.207 * @throws IOException if an I/O error has occurred
189.208 */
189.209 public void close() throws IOException {
189.210 + if (closeRequested)
189.211 + return;
189.212 + closeRequested = true;
189.213 +
189.214 synchronized (this) {
189.215 - closeRequested = true;
189.216 + // Close streams, release their inflaters
189.217 + synchronized (streams) {
189.218 + if (false == streams.isEmpty()) {
189.219 + Map<InputStream, Inflater> copy = new HashMap<>(streams);
189.220 + streams.clear();
189.221 + for (Map.Entry<InputStream, Inflater> e : copy.entrySet()) {
189.222 + e.getKey().close();
189.223 + Inflater inf = e.getValue();
189.224 + if (inf != null) {
189.225 + inf.end();
189.226 + }
189.227 + }
189.228 + }
189.229 + }
189.230
189.231 - if (streams.size() !=0) {
189.232 - Set<InputStream> copy = streams;
189.233 - streams = new HashSet<>();
189.234 - for (InputStream is: copy)
189.235 - is.close();
189.236 + // Release cached inflaters
189.237 + Inflater inf;
189.238 + synchronized (inflaterCache) {
189.239 + while (null != (inf = inflaterCache.poll())) {
189.240 + inf.end();
189.241 + }
189.242 }
189.243
189.244 if (jzfile != 0) {
189.245 @@ -556,23 +602,13 @@
189.246 jzfile = 0;
189.247
189.248 close(zf);
189.249 -
189.250 - // Release inflaters
189.251 - synchronized (inflaters) {
189.252 - int size = inflaters.size();
189.253 - for (int i = 0; i < size; i++) {
189.254 - Inflater inf = (Inflater)inflaters.get(i);
189.255 - inf.end();
189.256 - }
189.257 - }
189.258 }
189.259 }
189.260 }
189.261
189.262 -
189.263 /**
189.264 - * Ensures that the <code>close</code> method of this ZIP file is
189.265 - * called when there are no more references to it.
189.266 + * Ensures that the system resources held by this ZipFile object are
189.267 + * released when there are no more references to it.
189.268 *
189.269 * <p>
189.270 * Since the time when GC would invoke this method is undetermined,
189.271 @@ -611,6 +647,7 @@
189.272 * (possibly compressed) zip file entry.
189.273 */
189.274 private class ZipFileInputStream extends InputStream {
189.275 + private volatile boolean closeRequested = false;
189.276 protected long jzentry; // address of jzentry data
189.277 private long pos; // current position within entry data
189.278 protected long rem; // number of remaining bytes within entry
189.279 @@ -678,15 +715,25 @@
189.280 }
189.281
189.282 public void close() {
189.283 + if (closeRequested)
189.284 + return;
189.285 + closeRequested = true;
189.286 +
189.287 rem = 0;
189.288 synchronized (ZipFile.this) {
189.289 if (jzentry != 0 && ZipFile.this.jzfile != 0) {
189.290 freeEntry(ZipFile.this.jzfile, jzentry);
189.291 jzentry = 0;
189.292 }
189.293 + }
189.294 + synchronized (streams) {
189.295 streams.remove(this);
189.296 }
189.297 }
189.298 +
189.299 + protected void finalize() {
189.300 + close();
189.301 + }
189.302 }
189.303
189.304
190.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
190.2 +++ b/src/share/classes/javax/crypto/AEADBadTagException.java Tue Apr 26 15:48:03 2011 -0700
190.3 @@ -0,0 +1,55 @@
190.4 +/*
190.5 + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
190.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
190.7 + *
190.8 + * This code is free software; you can redistribute it and/or modify it
190.9 + * under the terms of the GNU General Public License version 2 only, as
190.10 + * published by the Free Software Foundation. Oracle designates this
190.11 + * particular file as subject to the "Classpath" exception as provided
190.12 + * by Oracle in the LICENSE file that accompanied this code.
190.13 + *
190.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
190.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
190.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
190.17 + * version 2 for more details (a copy is included in the LICENSE file that
190.18 + * accompanied this code).
190.19 + *
190.20 + * You should have received a copy of the GNU General Public License version
190.21 + * 2 along with this work; if not, write to the Free Software Foundation,
190.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
190.23 + *
190.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
190.25 + * or visit www.oracle.com if you need additional information or have any
190.26 + * questions.
190.27 + */
190.28 +
190.29 +package javax.crypto;
190.30 +
190.31 +/**
190.32 + * This exception is thrown when a {@link Cipher} operating in
190.33 + * an AEAD mode (such as GCM/CCM) is unable to verify the supplied
190.34 + * authentication tag.
190.35 + *
190.36 + * @since 1.7
190.37 + */
190.38 +public class AEADBadTagException extends BadPaddingException {
190.39 +
190.40 + private static final long serialVersionUID = -488059093241685509L;
190.41 +
190.42 + /**
190.43 + * Constructs a AEADBadTagException with no detail message.
190.44 + */
190.45 + public AEADBadTagException() {
190.46 + super();
190.47 + }
190.48 +
190.49 + /**
190.50 + * Constructs a AEADBadTagException with the specified
190.51 + * detail message.
190.52 + *
190.53 + * @param msg the detail message.
190.54 + */
190.55 + public AEADBadTagException(String msg) {
190.56 + super(msg);
190.57 + }
190.58 +}
191.1 --- a/src/share/classes/javax/crypto/Cipher.java Tue Apr 19 16:01:27 2011 -0700
191.2 +++ b/src/share/classes/javax/crypto/Cipher.java Tue Apr 26 15:48:03 2011 -0700
191.3 @@ -88,8 +88,35 @@
191.4 * example, the SunJCE provider uses a default of 64 bits for DES.)
191.5 * Thus, block ciphers can be turned into byte-oriented stream ciphers by
191.6 * using an 8 bit mode such as CFB8 or OFB8.
191.7 + * <p>
191.8 + * Modes such as Authenticated Encryption with Associated Data (AEAD)
191.9 + * provide authenticity assurances for both confidential data and
191.10 + * Additional Associated Data (AAD) that is not encrypted. (Please see
191.11 + * <a href="http://www.ietf.org/rfc/rfc5116.txt"> RFC 5116 </a> for more
191.12 + * information on AEAD and AEAD algorithms such as GCM/CCM.) Both
191.13 + * confidential and AAD data can be used when calculating the
191.14 + * authentication tag (similar to a {@link Mac}). This tag is appended
191.15 + * to the ciphertext during encryption, and is verified on decryption.
191.16 + * <p>
191.17 + * AEAD modes such as GCM/CCM perform all AAD authenticity calculations
191.18 + * before starting the ciphertext authenticity calculations. To avoid
191.19 + * implementations having to internally buffer ciphertext, all AAD data
191.20 + * must be supplied to GCM/CCM implementations (via the {@code
191.21 + * updateAAD} methods) <b>before</b> the ciphertext is processed (via
191.22 + * the {@code update} and {@code doFinal} methods).
191.23 *
191.24 - * <p> Every implementation of the Java platform is required to support
191.25 + * <pre>
191.26 + * GCMParameterSpec s = new GCMParameterSpec(...);
191.27 + * cipher.init(..., s);
191.28 + *
191.29 + * // If the GCMParameterSpec is needed again
191.30 + * cipher.getParameters().getParameterSpec(GCMParameterSpec.class));
191.31 + *
191.32 + * cipher.updateAAD(...); // AAD
191.33 + * cipher.update(...); // Multi-part update
191.34 + * cipher.doFinal(...); // conclusion of operation
191.35 + * </pre>
191.36 + * Every implementation of the Java platform is required to support
191.37 * the following standard <code>Cipher</code> transformations with the keysizes
191.38 * in parentheses:
191.39 * <ul>
191.40 @@ -894,7 +921,7 @@
191.41 * <code>inputLen</code> (in bytes).
191.42 *
191.43 * <p>This call takes into account any unprocessed (buffered) data from a
191.44 - * previous <code>update</code> call, and padding.
191.45 + * previous <code>update</code> call, padding, and AEAD tagging.
191.46 *
191.47 * <p>The actual output length of the next <code>update</code> or
191.48 * <code>doFinal</code> call may be smaller than the length returned by
191.49 @@ -1090,6 +1117,11 @@
191.50 * {@link #getParameters() getParameters} or
191.51 * {@link #getIV() getIV} (if the parameter is an IV).
191.52 *
191.53 + * <p>If this cipher requires algorithm parameters that cannot be
191.54 + * derived from the input parameters, and there are no reasonable
191.55 + * provider-specific default values, initialization will
191.56 + * necessarily fail.
191.57 + *
191.58 * <p>If this cipher (including its underlying feedback or padding scheme)
191.59 * requires any random bytes (e.g., for parameter generation), it will get
191.60 * them using the {@link SecureRandom <code>SecureRandom</code>}
191.61 @@ -1110,8 +1142,8 @@
191.62 * @param key the key
191.63 *
191.64 * @exception InvalidKeyException if the given key is inappropriate for
191.65 - * initializing this cipher, or if this cipher is being initialized for
191.66 - * decryption and requires algorithm parameters that cannot be
191.67 + * initializing this cipher, or requires
191.68 + * algorithm parameters that cannot be
191.69 * determined from the given key, or if the given key has a keysize that
191.70 * exceeds the maximum allowable keysize (as determined from the
191.71 * configured jurisdiction policy files).
191.72 @@ -1138,6 +1170,11 @@
191.73 * {@link #getParameters() getParameters} or
191.74 * {@link #getIV() getIV} (if the parameter is an IV).
191.75 *
191.76 + * <p>If this cipher requires algorithm parameters that cannot be
191.77 + * derived from the input parameters, and there are no reasonable
191.78 + * provider-specific default values, initialization will
191.79 + * necessarily fail.
191.80 + *
191.81 * <p>If this cipher (including its underlying feedback or padding scheme)
191.82 * requires any random bytes (e.g., for parameter generation), it will get
191.83 * them from <code>random</code>.
191.84 @@ -1155,8 +1192,8 @@
191.85 * @param random the source of randomness
191.86 *
191.87 * @exception InvalidKeyException if the given key is inappropriate for
191.88 - * initializing this cipher, or if this cipher is being initialized for
191.89 - * decryption and requires algorithm parameters that cannot be
191.90 + * initializing this cipher, or requires
191.91 + * algorithm parameters that cannot be
191.92 * determined from the given key, or if the given key has a keysize that
191.93 * exceeds the maximum allowable keysize (as determined from the
191.94 * configured jurisdiction policy files).
191.95 @@ -1202,6 +1239,11 @@
191.96 * {@link #getParameters() getParameters} or
191.97 * {@link #getIV() getIV} (if the parameter is an IV).
191.98 *
191.99 + * <p>If this cipher requires algorithm parameters that cannot be
191.100 + * derived from the input parameters, and there are no reasonable
191.101 + * provider-specific default values, initialization will
191.102 + * necessarily fail.
191.103 + *
191.104 * <p>If this cipher (including its underlying feedback or padding scheme)
191.105 * requires any random bytes (e.g., for parameter generation), it will get
191.106 * them using the {@link SecureRandom <code>SecureRandom</code>}
191.107 @@ -1227,7 +1269,7 @@
191.108 * keysize (as determined from the configured jurisdiction policy files).
191.109 * @exception InvalidAlgorithmParameterException if the given algorithm
191.110 * parameters are inappropriate for this cipher,
191.111 - * or this cipher is being initialized for decryption and requires
191.112 + * or this cipher requires
191.113 * algorithm parameters and <code>params</code> is null, or the given
191.114 * algorithm parameters imply a cryptographic strength that would exceed
191.115 * the legal limits (as determined from the configured jurisdiction
191.116 @@ -1258,6 +1300,11 @@
191.117 * {@link #getParameters() getParameters} or
191.118 * {@link #getIV() getIV} (if the parameter is an IV).
191.119 *
191.120 + * <p>If this cipher requires algorithm parameters that cannot be
191.121 + * derived from the input parameters, and there are no reasonable
191.122 + * provider-specific default values, initialization will
191.123 + * necessarily fail.
191.124 + *
191.125 * <p>If this cipher (including its underlying feedback or padding scheme)
191.126 * requires any random bytes (e.g., for parameter generation), it will get
191.127 * them from <code>random</code>.
191.128 @@ -1280,7 +1327,7 @@
191.129 * keysize (as determined from the configured jurisdiction policy files).
191.130 * @exception InvalidAlgorithmParameterException if the given algorithm
191.131 * parameters are inappropriate for this cipher,
191.132 - * or this cipher is being initialized for decryption and requires
191.133 + * or this cipher requires
191.134 * algorithm parameters and <code>params</code> is null, or the given
191.135 * algorithm parameters imply a cryptographic strength that would exceed
191.136 * the legal limits (as determined from the configured jurisdiction
191.137 @@ -1323,6 +1370,11 @@
191.138 * {@link #getParameters() getParameters} or
191.139 * {@link #getIV() getIV} (if the parameter is an IV).
191.140 *
191.141 + * <p>If this cipher requires algorithm parameters that cannot be
191.142 + * derived from the input parameters, and there are no reasonable
191.143 + * provider-specific default values, initialization will
191.144 + * necessarily fail.
191.145 + *
191.146 * <p>If this cipher (including its underlying feedback or padding scheme)
191.147 * requires any random bytes (e.g., for parameter generation), it will get
191.148 * them using the {@link SecureRandom <code>SecureRandom</code>}
191.149 @@ -1348,7 +1400,7 @@
191.150 * keysize (as determined from the configured jurisdiction policy files).
191.151 * @exception InvalidAlgorithmParameterException if the given algorithm
191.152 * parameters are inappropriate for this cipher,
191.153 - * or this cipher is being initialized for decryption and requires
191.154 + * or this cipher requires
191.155 * algorithm parameters and <code>params</code> is null, or the given
191.156 * algorithm parameters imply a cryptographic strength that would exceed
191.157 * the legal limits (as determined from the configured jurisdiction
191.158 @@ -1379,6 +1431,11 @@
191.159 * {@link #getParameters() getParameters} or
191.160 * {@link #getIV() getIV} (if the parameter is an IV).
191.161 *
191.162 + * <p>If this cipher requires algorithm parameters that cannot be
191.163 + * derived from the input parameters, and there are no reasonable
191.164 + * provider-specific default values, initialization will
191.165 + * necessarily fail.
191.166 + *
191.167 * <p>If this cipher (including its underlying feedback or padding scheme)
191.168 * requires any random bytes (e.g., for parameter generation), it will get
191.169 * them from <code>random</code>.
191.170 @@ -1401,7 +1458,7 @@
191.171 * keysize (as determined from the configured jurisdiction policy files).
191.172 * @exception InvalidAlgorithmParameterException if the given algorithm
191.173 * parameters are inappropriate for this cipher,
191.174 - * or this cipher is being initialized for decryption and requires
191.175 + * or this cipher requires
191.176 * algorithm parameters and <code>params</code> is null, or the given
191.177 * algorithm parameters imply a cryptographic strength that would exceed
191.178 * the legal limits (as determined from the configured jurisdiction
191.179 @@ -1444,7 +1501,7 @@
191.180 * derived from the public key in the given certificate, the underlying
191.181 * cipher
191.182 * implementation is supposed to generate the required parameters itself
191.183 - * (using provider-specific default or ramdom values) if it is being
191.184 + * (using provider-specific default or random values) if it is being
191.185 * initialized for encryption or key wrapping, and raise an <code>
191.186 * InvalidKeyException</code> if it is being initialized for decryption or
191.187 * key unwrapping.
191.188 @@ -1452,6 +1509,11 @@
191.189 * {@link #getParameters() getParameters} or
191.190 * {@link #getIV() getIV} (if the parameter is an IV).
191.191 *
191.192 + * <p>If this cipher requires algorithm parameters that cannot be
191.193 + * derived from the input parameters, and there are no reasonable
191.194 + * provider-specific default values, initialization will
191.195 + * necessarily fail.
191.196 + *
191.197 * <p>If this cipher (including its underlying feedback or padding scheme)
191.198 * requires any random bytes (e.g., for parameter generation), it will get
191.199 * them using the
191.200 @@ -1474,8 +1536,7 @@
191.201 *
191.202 * @exception InvalidKeyException if the public key in the given
191.203 * certificate is inappropriate for initializing this cipher, or this
191.204 - * cipher is being initialized for decryption or unwrapping keys and
191.205 - * requires algorithm parameters that cannot be determined from the
191.206 + * cipher requires algorithm parameters that cannot be determined from the
191.207 * public key in the given certificate, or the keysize of the public key
191.208 * in the given certificate has a keysize that exceeds the maximum
191.209 * allowable keysize (as determined by the configured jurisdiction policy
191.210 @@ -1518,6 +1579,11 @@
191.211 * {@link #getParameters() getParameters} or
191.212 * {@link #getIV() getIV} (if the parameter is an IV).
191.213 *
191.214 + * <p>If this cipher requires algorithm parameters that cannot be
191.215 + * derived from the input parameters, and there are no reasonable
191.216 + * provider-specific default values, initialization will
191.217 + * necessarily fail.
191.218 + *
191.219 * <p>If this cipher (including its underlying feedback or padding scheme)
191.220 * requires any random bytes (e.g., for parameter generation), it will get
191.221 * them from <code>random</code>.
191.222 @@ -1536,7 +1602,7 @@
191.223 *
191.224 * @exception InvalidKeyException if the public key in the given
191.225 * certificate is inappropriate for initializing this cipher, or this
191.226 - * cipher is being initialized for decryption or unwrapping keys and
191.227 + * cipher
191.228 * requires algorithm parameters that cannot be determined from the
191.229 * public key in the given certificate, or the keysize of the public key
191.230 * in the given certificate has a keysize that exceeds the maximum
191.231 @@ -1865,6 +1931,9 @@
191.232 * <p>Input data that may have been buffered during a previous
191.233 * <code>update</code> operation is processed, with padding (if requested)
191.234 * being applied.
191.235 + * If an AEAD mode such as GCM/CCM is being used, the authentication
191.236 + * tag is appended in the case of encryption, or verified in the
191.237 + * case of decryption.
191.238 * The result is stored in a new buffer.
191.239 *
191.240 * <p>Upon finishing, this method resets this cipher object to the state
191.241 @@ -1888,6 +1957,9 @@
191.242 * @exception BadPaddingException if this cipher is in decryption mode,
191.243 * and (un)padding has been requested, but the decrypted data is not
191.244 * bounded by the appropriate padding bytes
191.245 + * @exception AEADBadTagException if this cipher is decrypting in an
191.246 + * AEAD mode (such as GCM/CCM), and the received authentication tag
191.247 + * does not match the calculated value
191.248 */
191.249 public final byte[] doFinal()
191.250 throws IllegalBlockSizeException, BadPaddingException {
191.251 @@ -1904,6 +1976,9 @@
191.252 * <p>Input data that may have been buffered during a previous
191.253 * <code>update</code> operation is processed, with padding (if requested)
191.254 * being applied.
191.255 + * If an AEAD mode such as GCM/CCM is being used, the authentication
191.256 + * tag is appended in the case of encryption, or verified in the
191.257 + * case of decryption.
191.258 * The result is stored in the <code>output</code> buffer, starting at
191.259 * <code>outputOffset</code> inclusive.
191.260 *
191.261 @@ -1940,6 +2015,9 @@
191.262 * @exception BadPaddingException if this cipher is in decryption mode,
191.263 * and (un)padding has been requested, but the decrypted data is not
191.264 * bounded by the appropriate padding bytes
191.265 + * @exception AEADBadTagException if this cipher is decrypting in an
191.266 + * AEAD mode (such as GCM/CCM), and the received authentication tag
191.267 + * does not match the calculated value
191.268 */
191.269 public final int doFinal(byte[] output, int outputOffset)
191.270 throws IllegalBlockSizeException, ShortBufferException,
191.271 @@ -1963,6 +2041,9 @@
191.272 * <p>The bytes in the <code>input</code> buffer, and any input bytes that
191.273 * may have been buffered during a previous <code>update</code> operation,
191.274 * are processed, with padding (if requested) being applied.
191.275 + * If an AEAD mode such as GCM/CCM is being used, the authentication
191.276 + * tag is appended in the case of encryption, or verified in the
191.277 + * case of decryption.
191.278 * The result is stored in a new buffer.
191.279 *
191.280 * <p>Upon finishing, this method resets this cipher object to the state
191.281 @@ -1988,6 +2069,9 @@
191.282 * @exception BadPaddingException if this cipher is in decryption mode,
191.283 * and (un)padding has been requested, but the decrypted data is not
191.284 * bounded by the appropriate padding bytes
191.285 + * @exception AEADBadTagException if this cipher is decrypting in an
191.286 + * AEAD mode (such as GCM/CCM), and the received authentication tag
191.287 + * does not match the calculated value
191.288 */
191.289 public final byte[] doFinal(byte[] input)
191.290 throws IllegalBlockSizeException, BadPaddingException {
191.291 @@ -2011,6 +2095,9 @@
191.292 * buffer, starting at <code>inputOffset</code> inclusive, and any input
191.293 * bytes that may have been buffered during a previous <code>update</code>
191.294 * operation, are processed, with padding (if requested) being applied.
191.295 + * If an AEAD mode such as GCM/CCM is being used, the authentication
191.296 + * tag is appended in the case of encryption, or verified in the
191.297 + * case of decryption.
191.298 * The result is stored in a new buffer.
191.299 *
191.300 * <p>Upon finishing, this method resets this cipher object to the state
191.301 @@ -2039,6 +2126,9 @@
191.302 * @exception BadPaddingException if this cipher is in decryption mode,
191.303 * and (un)padding has been requested, but the decrypted data is not
191.304 * bounded by the appropriate padding bytes
191.305 + * @exception AEADBadTagException if this cipher is decrypting in an
191.306 + * AEAD mode (such as GCM/CCM), and the received authentication tag
191.307 + * does not match the calculated value
191.308 */
191.309 public final byte[] doFinal(byte[] input, int inputOffset, int inputLen)
191.310 throws IllegalBlockSizeException, BadPaddingException {
191.311 @@ -2063,6 +2153,9 @@
191.312 * buffer, starting at <code>inputOffset</code> inclusive, and any input
191.313 * bytes that may have been buffered during a previous <code>update</code>
191.314 * operation, are processed, with padding (if requested) being applied.
191.315 + * If an AEAD mode such as GCM/CCM is being used, the authentication
191.316 + * tag is appended in the case of encryption, or verified in the
191.317 + * case of decryption.
191.318 * The result is stored in the <code>output</code> buffer.
191.319 *
191.320 * <p>If the <code>output</code> buffer is too small to hold the result,
191.321 @@ -2105,6 +2198,9 @@
191.322 * @exception BadPaddingException if this cipher is in decryption mode,
191.323 * and (un)padding has been requested, but the decrypted data is not
191.324 * bounded by the appropriate padding bytes
191.325 + * @exception AEADBadTagException if this cipher is decrypting in an
191.326 + * AEAD mode (such as GCM/CCM), and the received authentication tag
191.327 + * does not match the calculated value
191.328 */
191.329 public final int doFinal(byte[] input, int inputOffset, int inputLen,
191.330 byte[] output)
191.331 @@ -2133,6 +2229,9 @@
191.332 * bytes that may have been buffered during a previous
191.333 * <code>update</code> operation, are processed, with padding
191.334 * (if requested) being applied.
191.335 + * If an AEAD mode such as GCM/CCM is being used, the authentication
191.336 + * tag is appended in the case of encryption, or verified in the
191.337 + * case of decryption.
191.338 * The result is stored in the <code>output</code> buffer, starting at
191.339 * <code>outputOffset</code> inclusive.
191.340 *
191.341 @@ -2178,6 +2277,9 @@
191.342 * @exception BadPaddingException if this cipher is in decryption mode,
191.343 * and (un)padding has been requested, but the decrypted data is not
191.344 * bounded by the appropriate padding bytes
191.345 + * @exception AEADBadTagException if this cipher is decrypting in an
191.346 + * AEAD mode (such as GCM/CCM), and the received authentication tag
191.347 + * does not match the calculated value
191.348 */
191.349 public final int doFinal(byte[] input, int inputOffset, int inputLen,
191.350 byte[] output, int outputOffset)
191.351 @@ -2203,8 +2305,11 @@
191.352 * depending on how this cipher was initialized.
191.353 *
191.354 * <p>All <code>input.remaining()</code> bytes starting at
191.355 - * <code>input.position()</code> are processed. The result is stored
191.356 - * in the output buffer.
191.357 + * <code>input.position()</code> are processed.
191.358 + * If an AEAD mode such as GCM/CCM is being used, the authentication
191.359 + * tag is appended in the case of encryption, or verified in the
191.360 + * case of decryption.
191.361 + * The result is stored in the output buffer.
191.362 * Upon return, the input buffer's position will be equal
191.363 * to its limit; its limit will not have changed. The output buffer's
191.364 * position will have advanced by n, where n is the value returned
191.365 @@ -2250,6 +2355,10 @@
191.366 * @exception BadPaddingException if this cipher is in decryption mode,
191.367 * and (un)padding has been requested, but the decrypted data is not
191.368 * bounded by the appropriate padding bytes
191.369 + * @exception AEADBadTagException if this cipher is decrypting in an
191.370 + * AEAD mode (such as GCM/CCM), and the received authentication tag
191.371 + * does not match the calculated value
191.372 + *
191.373 * @since 1.5
191.374 */
191.375 public final int doFinal(ByteBuffer input, ByteBuffer output)
191.376 @@ -2441,4 +2550,128 @@
191.377 CryptoPermission cp = getConfiguredPermission(transformation);
191.378 return cp.getAlgorithmParameterSpec();
191.379 }
191.380 +
191.381 + /**
191.382 + * Continues a multi-part update of the Additional Authentication
191.383 + * Data (AAD).
191.384 + * <p>
191.385 + * Calls to this method provide AAD to the cipher when operating in
191.386 + * modes such as AEAD (GCM/CCM). If this cipher is operating in
191.387 + * either GCM or CCM mode, all AAD must be supplied before beginning
191.388 + * operations on the ciphertext (via the {@code update} and {@code
191.389 + * doFinal} methods).
191.390 + *
191.391 + * @param src the buffer containing the Additional Authentication Data
191.392 + *
191.393 + * @throws IllegalArgumentException if the {@code src}
191.394 + * byte array is null
191.395 + * @throws IllegalStateException if this cipher is in a wrong state
191.396 + * (e.g., has not been initialized), does not accept AAD, or if
191.397 + * operating in either GCM or CCM mode and one of the {@code update}
191.398 + * methods has already been called for the active
191.399 + * encryption/decryption operation
191.400 + * @throws UnsupportedOperationException if the corresponding method
191.401 + * in the {@code CipherSpi} has not been overridden by an
191.402 + * implementation
191.403 + *
191.404 + * @since 1.7
191.405 + */
191.406 + public final void updateAAD(byte[] src) {
191.407 + if (src == null) {
191.408 + throw new IllegalArgumentException("src buffer is null");
191.409 + }
191.410 +
191.411 + updateAAD(src, 0, src.length);
191.412 + }
191.413 +
191.414 + /**
191.415 + * Continues a multi-part update of the Additional Authentication
191.416 + * Data (AAD), using a subset of the provided buffer.
191.417 + * <p>
191.418 + * Calls to this method provide AAD to the cipher when operating in
191.419 + * modes such as AEAD (GCM/CCM). If this cipher is operating in
191.420 + * either GCM or CCM mode, all AAD must be supplied before beginning
191.421 + * operations on the ciphertext (via the {@code update} and {@code
191.422 + * doFinal} methods).
191.423 + *
191.424 + * @param src the buffer containing the AAD
191.425 + * @param offset the offset in {@code src} where the AAD input starts
191.426 + * @param len the number of AAD bytes
191.427 + *
191.428 + * @throws IllegalArgumentException if the {@code src}
191.429 + * byte array is null, or the {@code offset} or {@code length}
191.430 + * is less than 0, or the sum of the {@code offset} and
191.431 + * {@code len} is greater than the length of the
191.432 + * {@code src} byte array
191.433 + * @throws IllegalStateException if this cipher is in a wrong state
191.434 + * (e.g., has not been initialized), does not accept AAD, or if
191.435 + * operating in either GCM or CCM mode and one of the {@code update}
191.436 + * methods has already been called for the active
191.437 + * encryption/decryption operation
191.438 + * @throws UnsupportedOperationException if the corresponding method
191.439 + * in the {@code CipherSpi} has not been overridden by an
191.440 + * implementation
191.441 + *
191.442 + * @since 1.7
191.443 + */
191.444 + public final void updateAAD(byte[] src, int offset, int len) {
191.445 + checkCipherState();
191.446 +
191.447 + // Input sanity check
191.448 + if ((src == null) || (offset < 0) || (len < 0)
191.449 + || ((len + offset) > src.length)) {
191.450 + throw new IllegalArgumentException("Bad arguments");
191.451 + }
191.452 +
191.453 + chooseFirstProvider();
191.454 + if (len == 0) {
191.455 + return;
191.456 + }
191.457 + spi.engineUpdateAAD(src, offset, len);
191.458 + }
191.459 +
191.460 + /**
191.461 + * Continues a multi-part update of the Additional Authentication
191.462 + * Data (AAD).
191.463 + * <p>
191.464 + * Calls to this method provide AAD to the cipher when operating in
191.465 + * modes such as AEAD (GCM/CCM). If this cipher is operating in
191.466 + * either GCM or CCM mode, all AAD must be supplied before beginning
191.467 + * operations on the ciphertext (via the {@code update} and {@code
191.468 + * doFinal} methods).
191.469 + * <p>
191.470 + * All {@code src.remaining()} bytes starting at
191.471 + * {@code src.position()} are processed.
191.472 + * Upon return, the input buffer's position will be equal
191.473 + * to its limit; its limit will not have changed.
191.474 + *
191.475 + * @param src the buffer containing the AAD
191.476 + *
191.477 + * @throws IllegalArgumentException if the {@code src ByteBuffer}
191.478 + * is null
191.479 + * @throws IllegalStateException if this cipher is in a wrong state
191.480 + * (e.g., has not been initialized), does not accept AAD, or if
191.481 + * operating in either GCM or CCM mode and one of the {@code update}
191.482 + * methods has already been called for the active
191.483 + * encryption/decryption operation
191.484 + * @throws UnsupportedOperationException if the corresponding method
191.485 + * in the {@code CipherSpi} has not been overridden by an
191.486 + * implementation
191.487 + *
191.488 + * @since 1.7
191.489 + */
191.490 + public final void updateAAD(ByteBuffer src) {
191.491 + checkCipherState();
191.492 +
191.493 + // Input sanity check
191.494 + if (src == null) {
191.495 + throw new IllegalArgumentException("src ByteBuffer is null");
191.496 + }
191.497 +
191.498 + chooseFirstProvider();
191.499 + if (src.remaining() == 0) {
191.500 + return;
191.501 + }
191.502 + spi.engineUpdateAAD(src);
191.503 + }
191.504 }
192.1 --- a/src/share/classes/javax/crypto/CipherSpi.java Tue Apr 19 16:01:27 2011 -0700
192.2 +++ b/src/share/classes/javax/crypto/CipherSpi.java Tue Apr 26 15:48:03 2011 -0700
192.3 @@ -1,5 +1,5 @@
192.4 /*
192.5 - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
192.6 + * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
192.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
192.8 *
192.9 * This code is free software; you can redistribute it and/or modify it
192.10 @@ -266,7 +266,7 @@
192.11 * <code>inputLen</code> (in bytes).
192.12 *
192.13 * <p>This call takes into account any unprocessed (buffered) data from a
192.14 - * previous <code>update</code> call, and padding.
192.15 + * previous <code>update</code> call, padding, and AEAD tagging.
192.16 *
192.17 * <p>The actual output length of the next <code>update</code> or
192.18 * <code>doFinal</code> call may be smaller than the length returned by
192.19 @@ -322,6 +322,11 @@
192.20 * {@link #engineGetParameters() engineGetParameters} or
192.21 * {@link #engineGetIV() engineGetIV} (if the parameter is an IV).
192.22 *
192.23 + * <p>If this cipher requires algorithm parameters that cannot be
192.24 + * derived from the input parameters, and there are no reasonable
192.25 + * provider-specific default values, initialization will
192.26 + * necessarily fail.
192.27 + *
192.28 * <p>If this cipher (including its underlying feedback or padding scheme)
192.29 * requires any random bytes (e.g., for parameter generation), it will get
192.30 * them from <code>random</code>.
192.31 @@ -339,8 +344,8 @@
192.32 * @param random the source of randomness
192.33 *
192.34 * @exception InvalidKeyException if the given key is inappropriate for
192.35 - * initializing this cipher, or if this cipher is being initialized for
192.36 - * decryption and requires algorithm parameters that cannot be
192.37 + * initializing this cipher, or requires
192.38 + * algorithm parameters that cannot be
192.39 * determined from the given key.
192.40 */
192.41 protected abstract void engineInit(int opmode, Key key,
192.42 @@ -366,6 +371,11 @@
192.43 * {@link #engineGetParameters() engineGetParameters} or
192.44 * {@link #engineGetIV() engineGetIV} (if the parameter is an IV).
192.45 *
192.46 + * <p>If this cipher requires algorithm parameters that cannot be
192.47 + * derived from the input parameters, and there are no reasonable
192.48 + * provider-specific default values, initialization will
192.49 + * necessarily fail.
192.50 + *
192.51 * <p>If this cipher (including its underlying feedback or padding scheme)
192.52 * requires any random bytes (e.g., for parameter generation), it will get
192.53 * them from <code>random</code>.
192.54 @@ -387,7 +397,7 @@
192.55 * initializing this cipher
192.56 * @exception InvalidAlgorithmParameterException if the given algorithm
192.57 * parameters are inappropriate for this cipher,
192.58 - * or if this cipher is being initialized for decryption and requires
192.59 + * or if this cipher requires
192.60 * algorithm parameters and <code>params</code> is null.
192.61 */
192.62 protected abstract void engineInit(int opmode, Key key,
192.63 @@ -414,6 +424,11 @@
192.64 * {@link #engineGetParameters() engineGetParameters} or
192.65 * {@link #engineGetIV() engineGetIV} (if the parameter is an IV).
192.66 *
192.67 + * <p>If this cipher requires algorithm parameters that cannot be
192.68 + * derived from the input parameters, and there are no reasonable
192.69 + * provider-specific default values, initialization will
192.70 + * necessarily fail.
192.71 + *
192.72 * <p>If this cipher (including its underlying feedback or padding scheme)
192.73 * requires any random bytes (e.g., for parameter generation), it will get
192.74 * them from <code>random</code>.
192.75 @@ -435,7 +450,7 @@
192.76 * initializing this cipher
192.77 * @exception InvalidAlgorithmParameterException if the given algorithm
192.78 * parameters are inappropriate for this cipher,
192.79 - * or if this cipher is being initialized for decryption and requires
192.80 + * or if this cipher requires
192.81 * algorithm parameters and <code>params</code> is null.
192.82 */
192.83 protected abstract void engineInit(int opmode, Key key,
192.84 @@ -548,6 +563,9 @@
192.85 * buffer, starting at <code>inputOffset</code> inclusive, and any input
192.86 * bytes that may have been buffered during a previous <code>update</code>
192.87 * operation, are processed, with padding (if requested) being applied.
192.88 + * If an AEAD mode such as GCM/CCM is being used, the authentication
192.89 + * tag is appended in the case of encryption, or verified in the
192.90 + * case of decryption.
192.91 * The result is stored in a new buffer.
192.92 *
192.93 * <p>Upon finishing, this method resets this cipher object to the state
192.94 @@ -575,6 +593,9 @@
192.95 * @exception BadPaddingException if this cipher is in decryption mode,
192.96 * and (un)padding has been requested, but the decrypted data is not
192.97 * bounded by the appropriate padding bytes
192.98 + * @exception AEADBadTagException if this cipher is decrypting in an
192.99 + * AEAD mode (such as GCM/CCM), and the received authentication tag
192.100 + * does not match the calculated value
192.101 */
192.102 protected abstract byte[] engineDoFinal(byte[] input, int inputOffset,
192.103 int inputLen)
192.104 @@ -590,6 +611,9 @@
192.105 * buffer, starting at <code>inputOffset</code> inclusive, and any input
192.106 * bytes that may have been buffered during a previous <code>update</code>
192.107 * operation, are processed, with padding (if requested) being applied.
192.108 + * If an AEAD mode such as GCM/CCM is being used, the authentication
192.109 + * tag is appended in the case of encryption, or verified in the
192.110 + * case of decryption.
192.111 * The result is stored in the <code>output</code> buffer, starting at
192.112 * <code>outputOffset</code> inclusive.
192.113 *
192.114 @@ -626,6 +650,9 @@
192.115 * @exception BadPaddingException if this cipher is in decryption mode,
192.116 * and (un)padding has been requested, but the decrypted data is not
192.117 * bounded by the appropriate padding bytes
192.118 + * @exception AEADBadTagException if this cipher is decrypting in an
192.119 + * AEAD mode (such as GCM/CCM), and the received authentication tag
192.120 + * does not match the calculated value
192.121 */
192.122 protected abstract int engineDoFinal(byte[] input, int inputOffset,
192.123 int inputLen, byte[] output,
192.124 @@ -640,8 +667,11 @@
192.125 * initialized.
192.126 *
192.127 * <p>All <code>input.remaining()</code> bytes starting at
192.128 - * <code>input.position()</code> are processed. The result is stored
192.129 - * in the output buffer.
192.130 + * <code>input.position()</code> are processed.
192.131 + * If an AEAD mode such as GCM/CCM is being used, the authentication
192.132 + * tag is appended in the case of encryption, or verified in the
192.133 + * case of decryption.
192.134 + * The result is stored in the output buffer.
192.135 * Upon return, the input buffer's position will be equal
192.136 * to its limit; its limit will not have changed. The output buffer's
192.137 * position will have advanced by n, where n is the value returned
192.138 @@ -678,6 +708,9 @@
192.139 * @exception BadPaddingException if this cipher is in decryption mode,
192.140 * and (un)padding has been requested, but the decrypted data is not
192.141 * bounded by the appropriate padding bytes
192.142 + * @exception AEADBadTagException if this cipher is decrypting in an
192.143 + * AEAD mode (such as GCM/CCM), and the received authentication tag
192.144 + * does not match the calculated value
192.145 *
192.146 * @throws NullPointerException if either parameter is <CODE>null</CODE>
192.147 * @since 1.5
192.148 @@ -892,4 +925,67 @@
192.149 {
192.150 throw new UnsupportedOperationException();
192.151 }
192.152 +
192.153 + /**
192.154 + * Continues a multi-part update of the Additional Authentication
192.155 + * Data (AAD), using a subset of the provided buffer.
192.156 + * <p>
192.157 + * Calls to this method provide AAD to the cipher when operating in
192.158 + * modes such as AEAD (GCM/CCM). If this cipher is operating in
192.159 + * either GCM or CCM mode, all AAD must be supplied before beginning
192.160 + * operations on the ciphertext (via the {@code update} and {@code
192.161 + * doFinal} methods).
192.162 + *
192.163 + * @param src the buffer containing the AAD
192.164 + * @param offset the offset in {@code src} where the AAD input starts
192.165 + * @param len the number of AAD bytes
192.166 + *
192.167 + * @throws IllegalStateException if this cipher is in a wrong state
192.168 + * (e.g., has not been initialized), does not accept AAD, or if
192.169 + * operating in either GCM or CCM mode and one of the {@code update}
192.170 + * methods has already been called for the active
192.171 + * encryption/decryption operation
192.172 + * @throws UnsupportedOperationException if this method
192.173 + * has not been overridden by an implementation
192.174 + *
192.175 + * @since 1.7
192.176 + */
192.177 + protected void engineUpdateAAD(byte[] src, int offset, int len) {
192.178 + throw new UnsupportedOperationException(
192.179 + "The underlying Cipher implementation "
192.180 + + "does not support this method");
192.181 + }
192.182 +
192.183 + /**
192.184 + * Continues a multi-part update of the Additional Authentication
192.185 + * Data (AAD).
192.186 + * <p>
192.187 + * Calls to this method provide AAD to the cipher when operating in
192.188 + * modes such as AEAD (GCM/CCM). If this cipher is operating in
192.189 + * either GCM or CCM mode, all AAD must be supplied before beginning
192.190 + * operations on the ciphertext (via the {@code update} and {@code
192.191 + * doFinal} methods).
192.192 + * <p>
192.193 + * All {@code src.remaining()} bytes starting at
192.194 + * {@code src.position()} are processed.
192.195 + * Upon return, the input buffer's position will be equal
192.196 + * to its limit; its limit will not have changed.
192.197 + *
192.198 + * @param src the buffer containing the AAD
192.199 + *
192.200 + * @throws IllegalStateException if this cipher is in a wrong state
192.201 + * (e.g., has not been initialized), does not accept AAD, or if
192.202 + * operating in either GCM or CCM mode and one of the {@code update}
192.203 + * methods has already been called for the active
192.204 + * encryption/decryption operation
192.205 + * @throws UnsupportedOperationException if this method
192.206 + * has not been overridden by an implementation
192.207 + *
192.208 + * @since 1.7
192.209 + */
192.210 + protected void engineUpdateAAD(ByteBuffer src) {
192.211 + throw new UnsupportedOperationException(
192.212 + "The underlying Cipher implementation "
192.213 + + "does not support this method");
192.214 + }
192.215 }
193.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
193.2 +++ b/src/share/classes/javax/crypto/spec/GCMParameterSpec.java Tue Apr 26 15:48:03 2011 -0700
193.3 @@ -0,0 +1,149 @@
193.4 +/*
193.5 + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
193.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
193.7 + *
193.8 + * This code is free software; you can redistribute it and/or modify it
193.9 + * under the terms of the GNU General Public License version 2 only, as
193.10 + * published by the Free Software Foundation. Oracle designates this
193.11 + * particular file as subject to the "Classpath" exception as provided
193.12 + * by Oracle in the LICENSE file that accompanied this code.
193.13 + *
193.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
193.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
193.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
193.17 + * version 2 for more details (a copy is included in the LICENSE file that
193.18 + * accompanied this code).
193.19 + *
193.20 + * You should have received a copy of the GNU General Public License version
193.21 + * 2 along with this work; if not, write to the Free Software Foundation,
193.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
193.23 + *
193.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
193.25 + * or visit www.oracle.com if you need additional information or have any
193.26 + * questions.
193.27 + */
193.28 +
193.29 +package javax.crypto.spec;
193.30 +
193.31 +import java.security.spec.AlgorithmParameterSpec;
193.32 +
193.33 +/**
193.34 + * Specifies the set of parameters required by a {@link
193.35 + * javax.crypto.Cipher} using the Galois/Counter Mode (GCM) mode.
193.36 + * <p>
193.37 + * Simple block cipher modes (such as CBC) generally require only an
193.38 + * initialization vector (such as {@code IvParameterSpec}),
193.39 + * but GCM needs these parameters:
193.40 + * <ul>
193.41 + * <li>{@code IV}: Initialization Vector (IV) </li>
193.42 + * <li>{@code tLen}: length (in bits) of authentication tag T</li>
193.43 + * </ul>
193.44 + * <p>
193.45 + * In addition to the parameters described here, other GCM inputs/output
193.46 + * (Additional Authenticated Data (AAD), Keys, block ciphers,
193.47 + * plain/ciphertext and authentication tags) are handled in the {@code
193.48 + * Cipher} class.
193.49 + <p>
193.50 + * Please see <a href="http://www.ietf.org/rfc/rfc5116.txt"> RFC 5116
193.51 + * </a> for more information on the Authenticated Encryption with
193.52 + * Associated Data (AEAD) algorithm, and <a href=
193.53 + * "http://csrc.nist.gov/publications/nistpubs/800-38D/SP-800-38D.pdf">
193.54 + * NIST Special Publication 800-38D</a>, "NIST Recommendation for Block
193.55 + * Cipher Modes of Operation: Galois/Counter Mode (GCM) and GMAC."
193.56 + * <p>
193.57 + * The GCM specification states that {@code tLen} may only have the
193.58 + * values {128, 120, 112, 104, 96}, or {64, 32} for certain
193.59 + * applications. Other values can be specified for this class, but not
193.60 + * all CSP implementations will support them.
193.61 + *
193.62 + * @see javax.crypto.Cipher
193.63 + *
193.64 + * @since 1.7
193.65 + */
193.66 +public class GCMParameterSpec implements AlgorithmParameterSpec {
193.67 +
193.68 + // Initialization Vector. Could use IvParameterSpec, but that
193.69 + // would add extra copies.
193.70 + private byte[] iv;
193.71 +
193.72 + // Required Tag length (in bits).
193.73 + private int tLen;
193.74 +
193.75 + /**
193.76 + * Constructs a GCMParameterSpec using the specified authentication
193.77 + * tag bit-length and IV buffer.
193.78 + *
193.79 + * @param tLen the authentication tag length (in bits)
193.80 + * @param src the IV source buffer. The contents of the buffer are
193.81 + * copied to protect against subsequent modification.
193.82 + *
193.83 + * @throws IllegalArgumentException if {@code tLen} is negative,
193.84 + * or {@code src} is null.
193.85 + */
193.86 + public GCMParameterSpec(int tLen, byte[] src) {
193.87 + if (src == null) {
193.88 + throw new IllegalArgumentException("src array is null");
193.89 + }
193.90 +
193.91 + init(tLen, src, 0, src.length);
193.92 + }
193.93 +
193.94 + /**
193.95 + * Constructs a GCMParameterSpec object using the specified
193.96 + * authentication tag bit-length and a subset of the specified
193.97 + * buffer as the IV.
193.98 + *
193.99 + * @param tLen the authentication tag length (in bits)
193.100 + * @param src the IV source buffer. The contents of the
193.101 + * buffer are copied to protect against subsequent modification.
193.102 + * @param offset the offset in {@code src} where the IV starts
193.103 + * @param len the number of IV bytes
193.104 + *
193.105 + * @throws IllegalArgumentException if {@code tLen} is negative,
193.106 + * {@code src} is null, {@code len} or {@code offset} is negative,
193.107 + * or the sum of {@code offset} and {@code len} is greater than the
193.108 + * length of the {@code src} byte array.
193.109 + */
193.110 + public GCMParameterSpec(int tLen, byte[] src, int offset, int len) {
193.111 + init(tLen, src, offset, len);
193.112 + }
193.113 +
193.114 + /*
193.115 + * Check input parameters.
193.116 + */
193.117 + private void init(int tLen, byte[] src, int offset, int len) {
193.118 + if (tLen < 0) {
193.119 + throw new IllegalArgumentException(
193.120 + "Length argument is negative");
193.121 + }
193.122 + this.tLen = tLen;
193.123 +
193.124 + // Input sanity check
193.125 + if ((src == null) ||(len < 0) || (offset < 0)
193.126 + || ((len + offset) > src.length)) {
193.127 + throw new IllegalArgumentException("Invalid buffer arguments");
193.128 + }
193.129 +
193.130 + iv = new byte[len];
193.131 + System.arraycopy(src, offset, iv, 0, len);
193.132 + }
193.133 +
193.134 + /**
193.135 + * Returns the authentication tag length.
193.136 + *
193.137 + * @return the authentication tag length (in bits)
193.138 + */
193.139 + public int getTLen() {
193.140 + return tLen;
193.141 + }
193.142 +
193.143 + /**
193.144 + * Returns the Initialization Vector (IV).
193.145 + *
193.146 + * @return the IV. Creates a new array each time this method
193.147 + * is called.
193.148 + */
193.149 + public byte[] getIV() {
193.150 + return iv.clone();
193.151 + }
193.152 +}
194.1 --- a/src/share/classes/javax/imageio/stream/FileCacheImageOutputStream.java Tue Apr 19 16:01:27 2011 -0700
194.2 +++ b/src/share/classes/javax/imageio/stream/FileCacheImageOutputStream.java Tue Apr 26 15:48:03 2011 -0700
194.3 @@ -214,7 +214,7 @@
194.4 }
194.5
194.6 /**
194.7 - * Closes this <code>FileCacheImageOututStream</code>. All
194.8 + * Closes this <code>FileCacheImageOutputStream</code>. All
194.9 * pending data is flushed to the output, and the cache file
194.10 * is closed and removed. The destination <code>OutputStream</code>
194.11 * is not closed.
195.1 --- a/src/share/classes/javax/management/remote/package.html Tue Apr 19 16:01:27 2011 -0700
195.2 +++ b/src/share/classes/javax/management/remote/package.html Tue Apr 26 15:48:03 2011 -0700
195.3 @@ -154,11 +154,8 @@
195.4 </pre>
195.5
195.6 <p>The formal grammar for connection ids that follow this
195.7 - convention is as follows (using the <a
195.8 - href="http://java.sun.com/docs/books/jls/second_edition/html/grammars.doc.html#90767">grammar
195.9 - notation</a> from <em>The Java Language Specification, Second
195.10 - Edition</em>):</p>
195.11 -
195.12 + convention is as follows (using the grammar notation from section 2.4 of
195.13 + <em>The Java™ Language Specification</em>):</p>
195.14 <pre>
195.15 <em>ConnectionId:</em>
195.16 <em>Protocol</em> : <em>ClientAddress<sub>opt</sub></em> Space <em>ClientId<sub>opt</sub></em> Space <em>ArbitraryText</em>
196.1 --- a/src/share/classes/javax/sound/midi/MidiSystem.java Tue Apr 19 16:01:27 2011 -0700
196.2 +++ b/src/share/classes/javax/sound/midi/MidiSystem.java Tue Apr 26 15:48:03 2011 -0700
196.3 @@ -239,6 +239,12 @@
196.4 * If a suitable MIDI port is not available, the Receiver is
196.5 * retrieved from an installed synthesizer.
196.6 *
196.7 + * <p>If a native receiver provided by the default device does not implement
196.8 + * the {@code MidiDeviceReceiver} interface, it will be wrapped in a
196.9 + * wrapper class that implements the {@code MidiDeviceReceiver} interface.
196.10 + * The corresponding {@code Receiver} method calls will be forwarded
196.11 + * to the native receiver.
196.12 + *
196.13 * <p>If this method returns successfully, the {@link
196.14 * javax.sound.midi.MidiDevice MidiDevice} the
196.15 * <code>Receiver</code> belongs to is opened implicitly, if it is
196.16 @@ -284,7 +290,13 @@
196.17 * it is used to identify the device that provides the default transmitter.
196.18 * For details, refer to the {@link MidiSystem class description}.
196.19 *
196.20 - * If this method returns successfully, the {@link
196.21 + * <p>If a native transmitter provided by the default device does not implement
196.22 + * the {@code MidiDeviceTransmitter} interface, it will be wrapped in a
196.23 + * wrapper class that implements the {@code MidiDeviceTransmitter} interface.
196.24 + * The corresponding {@code Transmitter} method calls will be forwarded
196.25 + * to the native transmitter.
196.26 + *
196.27 + * <p>If this method returns successfully, the {@link
196.28 * javax.sound.midi.MidiDevice MidiDevice} the
196.29 * <code>Transmitter</code> belongs to is opened implicitly, if it
196.30 * is not already open. It is possible to close an implicitly
197.1 --- a/src/share/classes/javax/sql/rowset/BaseRowSet.java Tue Apr 19 16:01:27 2011 -0700
197.2 +++ b/src/share/classes/javax/sql/rowset/BaseRowSet.java Tue Apr 26 15:48:03 2011 -0700
197.3 @@ -296,32 +296,32 @@
197.4
197.5 public abstract class BaseRowSet implements Serializable, Cloneable {
197.6
197.7 -/**
197.8 - * A constant indicating to a <code>RowSetReaderImpl</code> object
197.9 - * that a given parameter is a Unicode stream. This
197.10 - * <code>RowSetReaderImpl</code> object is provided as an extension of the
197.11 - * <code>SyncProvider</code> abstract class defined in the
197.12 - * <code>SyncFactory</code> static factory SPI mechanism.
197.13 - */
197.14 -public static final int UNICODE_STREAM_PARAM = 0;
197.15 -
197.16 -/**
197.17 - * A constant indicating to a <code>RowSetReaderImpl</code> object
197.18 - * that a given parameter is a binary stream. A
197.19 - * <code>RowSetReaderImpl</code> object is provided as an extension of the
197.20 - * <code>SyncProvider</code> abstract class defined in the
197.21 - * <code>SyncFactory</code> static factory SPI mechanism.
197.22 - */
197.23 -public static final int BINARY_STREAM_PARAM = 1;
197.24 -
197.25 -/**
197.26 - * A constant indicating to a <code>RowSetReaderImpl</code> object
197.27 - * that a given parameter is an ASCII stream. A
197.28 - * <code>RowSetReaderImpl</code> object is provided as an extension of the
197.29 - * <code>SyncProvider</code> abstract class defined in the
197.30 - * <code>SyncFactory</code> static factory SPI mechanism.
197.31 - */
197.32 -public static final int ASCII_STREAM_PARAM = 2;
197.33 + /**
197.34 + * A constant indicating to a <code>RowSetReaderImpl</code> object
197.35 + * that a given parameter is a Unicode stream. This
197.36 + * <code>RowSetReaderImpl</code> object is provided as an extension of the
197.37 + * <code>SyncProvider</code> abstract class defined in the
197.38 + * <code>SyncFactory</code> static factory SPI mechanism.
197.39 + */
197.40 + public static final int UNICODE_STREAM_PARAM = 0;
197.41 +
197.42 + /**
197.43 + * A constant indicating to a <code>RowSetReaderImpl</code> object
197.44 + * that a given parameter is a binary stream. A
197.45 + * <code>RowSetReaderImpl</code> object is provided as an extension of the
197.46 + * <code>SyncProvider</code> abstract class defined in the
197.47 + * <code>SyncFactory</code> static factory SPI mechanism.
197.48 + */
197.49 + public static final int BINARY_STREAM_PARAM = 1;
197.50 +
197.51 + /**
197.52 + * A constant indicating to a <code>RowSetReaderImpl</code> object
197.53 + * that a given parameter is an ASCII stream. A
197.54 + * <code>RowSetReaderImpl</code> object is provided as an extension of the
197.55 + * <code>SyncProvider</code> abstract class defined in the
197.56 + * <code>SyncFactory</code> static factory SPI mechanism.
197.57 + */
197.58 + public static final int ASCII_STREAM_PARAM = 2;
197.59
197.60 /**
197.61 * The <code>InputStream</code> object that will be
197.62 @@ -505,21 +505,21 @@
197.63 * custom mapping of user-defined types.
197.64 * @serial
197.65 */
197.66 - private Map map;
197.67 + private Map<String, Class<?>> map;
197.68
197.69 /**
197.70 * A <code>Vector</code> object that holds the list of listeners
197.71 * that have registered with this <code>RowSet</code> object.
197.72 * @serial
197.73 */
197.74 - private Vector listeners;
197.75 + private Vector<RowSetListener> listeners;
197.76
197.77 /**
197.78 * A <code>Vector</code> object that holds the parameters set
197.79 * for this <code>RowSet</code> object's current command.
197.80 * @serial
197.81 */
197.82 - private Hashtable params; // could be transient?
197.83 + private Hashtable<Integer, Object> params; // could be transient?
197.84
197.85 /**
197.86 * Constructs a new <code>BaseRowSet</code> object initialized with
197.87 @@ -529,7 +529,7 @@
197.88 */
197.89 public BaseRowSet() {
197.90 // allocate the listeners collection
197.91 - listeners = new Vector();
197.92 + listeners = new Vector<RowSetListener>();
197.93 }
197.94
197.95 /**
197.96 @@ -542,7 +542,7 @@
197.97 * a <code>RowSet</code> implementation extending this class.
197.98 */
197.99 protected void initParams() {
197.100 - params = new Hashtable();
197.101 + params = new Hashtable<Integer, Object>();
197.102 }
197.103
197.104 //--------------------------------------------------------------------
198.1 --- a/src/share/classes/javax/sql/rowset/RowSetMetaDataImpl.java Tue Apr 19 16:01:27 2011 -0700
198.2 +++ b/src/share/classes/javax/sql/rowset/RowSetMetaDataImpl.java Tue Apr 26 15:48:03 2011 -0700
198.3 @@ -912,7 +912,12 @@
198.4 * @since 1.6
198.5 */
198.6 public <T> T unwrap(java.lang.Class<T> iface) throws java.sql.SQLException {
198.7 - return (T)this;
198.8 +
198.9 + if(isWrapperFor(iface)) {
198.10 + return iface.cast(this);
198.11 + } else {
198.12 + throw new SQLException("unwrap failed for:"+ iface);
198.13 + }
198.14 }
198.15
198.16 /**
198.17 @@ -929,8 +934,9 @@
198.18 * @throws java.sql.SQLException if an error occurs while determining whether this is a wrapper
198.19 * for an object with the given interface.
198.20 * @since 1.6
198.21 - */ public boolean isWrapperFor(Class<?> interfaces) throws SQLException {
198.22 - return false;
198.23 + */
198.24 + public boolean isWrapperFor(Class<?> interfaces) throws SQLException {
198.25 + return interfaces.isInstance(this);
198.26 }
198.27
198.28 static final long serialVersionUID = 6893806403181801867L;
199.1 --- a/src/share/classes/javax/sql/rowset/RowSetProvider.java Tue Apr 19 16:01:27 2011 -0700
199.2 +++ b/src/share/classes/javax/sql/rowset/RowSetProvider.java Tue Apr 26 15:48:03 2011 -0700
199.3 @@ -204,9 +204,9 @@
199.4 *
199.5 */
199.6 static private ClassLoader getContextClassLoader() throws SecurityException {
199.7 - return (ClassLoader) AccessController.doPrivileged(new PrivilegedAction() {
199.8 + return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
199.9
199.10 - public Object run() {
199.11 + public ClassLoader run() {
199.12 ClassLoader cl = null;
199.13
199.14 cl = Thread.currentThread().getContextClassLoader();
199.15 @@ -284,9 +284,9 @@
199.16 static private String getSystemProperty(final String propName) {
199.17 String property = null;
199.18 try {
199.19 - property = (String) AccessController.doPrivileged(new PrivilegedAction() {
199.20 + property = AccessController.doPrivileged(new PrivilegedAction<String>() {
199.21
199.22 - public Object run() {
199.23 + public String run() {
199.24 return System.getProperty(propName);
199.25 }
199.26 });
200.1 --- a/src/share/classes/javax/swing/Painter.java Tue Apr 19 16:01:27 2011 -0700
200.2 +++ b/src/share/classes/javax/swing/Painter.java Tue Apr 26 15:48:03 2011 -0700
200.3 @@ -45,14 +45,16 @@
200.4 * <code>Painter</code> that only works with subclasses of {@link java.awt.Component}.
200.5 * In that case, when the <code>Painter</code> is declared, you may declare that
200.6 * it requires a <code>Component</code>, allowing the paint method to be type safe. Ex:
200.7 - * <pre><code>
200.8 - * Painter<Component> p = new Painter<Component>() {
200.9 - * public void paint(Graphics2D g, Component c, int width, int height) {
200.10 - * g.setColor(c.getBackground());
200.11 - * //and so forth
200.12 - * }
200.13 + * <pre>
200.14 + * {@code
200.15 + * Painter<Component> p = new Painter<Component>() {
200.16 + * public void paint(Graphics2D g, Component c, int width, int height) {
200.17 + * g.setColor(c.getBackground());
200.18 + * //and so forth
200.19 * }
200.20 - * </code></pre></p>
200.21 + * }
200.22 + * }
200.23 + * </pre></p>
200.24 *
200.25 * <p>This interface makes no guarantees of threadsafety.</p>
200.26 *
201.1 --- a/src/share/classes/javax/swing/border/TitledBorder.java Tue Apr 19 16:01:27 2011 -0700
201.2 +++ b/src/share/classes/javax/swing/border/TitledBorder.java Tue Apr 26 15:48:03 2011 -0700
201.3 @@ -240,9 +240,7 @@
201.4 int edge = (border instanceof TitledBorder) ? 0 : EDGE_SPACING;
201.5 JLabel label = getLabel(c);
201.6 Dimension size = label.getPreferredSize();
201.7 - Insets insets = (border != null)
201.8 - ? border.getBorderInsets(c)
201.9 - : new Insets(0, 0, 0, 0);
201.10 + Insets insets = getBorderInsets(border, c, new Insets(0, 0, 0, 0));
201.11
201.12 int borderX = x + edge;
201.13 int borderY = y + edge;
201.14 @@ -348,17 +346,8 @@
201.15 */
201.16 public Insets getBorderInsets(Component c, Insets insets) {
201.17 Border border = getBorder();
201.18 - if (border == null) {
201.19 - insets.set(0, 0, 0, 0);
201.20 - }
201.21 - else if (border instanceof AbstractBorder) {
201.22 - AbstractBorder ab = (AbstractBorder) border;
201.23 - insets = ab.getBorderInsets(c, insets);
201.24 - }
201.25 - else {
201.26 - Insets i = border.getBorderInsets(c);
201.27 - insets.set(i.top, i.left, i.bottom, i.right);
201.28 - }
201.29 + insets = getBorderInsets(border, c, insets);
201.30 +
201.31 String title = getTitle();
201.32 if ((title != null) && !title.isEmpty()) {
201.33 int edge = (border instanceof TitledBorder) ? 0 : EDGE_SPACING;
201.34 @@ -588,9 +577,7 @@
201.35 int edge = (border instanceof TitledBorder) ? 0 : EDGE_SPACING;
201.36 JLabel label = getLabel(c);
201.37 Dimension size = label.getPreferredSize();
201.38 - Insets insets = (border != null)
201.39 - ? border.getBorderInsets(c)
201.40 - : new Insets(0, 0, 0, 0);
201.41 + Insets insets = getBorderInsets(border, c, new Insets(0, 0, 0, 0));
201.42
201.43 int baseline = label.getBaseline(size.width, size.height);
201.44 switch (getPosition()) {
201.45 @@ -728,4 +715,19 @@
201.46 this.label.setEnabled(c.isEnabled());
201.47 return this.label;
201.48 }
201.49 +
201.50 + private static Insets getBorderInsets(Border border, Component c, Insets insets) {
201.51 + if (border == null) {
201.52 + insets.set(0, 0, 0, 0);
201.53 + }
201.54 + else if (border instanceof AbstractBorder) {
201.55 + AbstractBorder ab = (AbstractBorder) border;
201.56 + insets = ab.getBorderInsets(c, insets);
201.57 + }
201.58 + else {
201.59 + Insets i = border.getBorderInsets(c);
201.60 + insets.set(i.top, i.left, i.bottom, i.right);
201.61 + }
201.62 + return insets;
201.63 + }
201.64 }
202.1 --- a/src/share/classes/javax/swing/plaf/LayerUI.java Tue Apr 19 16:01:27 2011 -0700
202.2 +++ b/src/share/classes/javax/swing/plaf/LayerUI.java Tue Apr 26 15:48:03 2011 -0700
202.3 @@ -708,8 +708,8 @@
202.4 *
202.5 * @param x the x value of the region to be painted
202.6 * @param y the y value of the region to be painted
202.7 - * @param w the width of the region to be painted
202.8 - * @param h the height of the region to be painted
202.9 + * @param width the width of the region to be painted
202.10 + * @param height the height of the region to be painted
202.11 *
202.12 * @see JComponent#paintImmediately(int, int, int, int)
202.13 */
203.1 --- a/src/share/classes/javax/swing/plaf/basic/BasicColorChooserUI.java Tue Apr 19 16:01:27 2011 -0700
203.2 +++ b/src/share/classes/javax/swing/plaf/basic/BasicColorChooserUI.java Tue Apr 26 15:48:03 2011 -0700
203.3 @@ -335,9 +335,8 @@
203.4 }
203.5
203.6 /**
203.7 - * This inner class is marked "public" due to a compiler bug.
203.8 * This class should be treated as a "protected" inner class.
203.9 - * Instantiate it only within subclasses of <Foo>.
203.10 + * Instantiate it only within subclasses of {@code BasicColorChooserUI}.
203.11 */
203.12 public class PropertyHandler implements PropertyChangeListener {
203.13 public void propertyChange(PropertyChangeEvent e) {
204.1 --- a/src/share/classes/javax/swing/plaf/basic/BasicDesktopIconUI.java Tue Apr 19 16:01:27 2011 -0700
204.2 +++ b/src/share/classes/javax/swing/plaf/basic/BasicDesktopIconUI.java Tue Apr 26 15:48:03 2011 -0700
204.3 @@ -186,9 +186,8 @@
204.4 /**
204.5 * Listens for mouse movements and acts on them.
204.6 *
204.7 - * This inner class is marked "public" due to a compiler bug.
204.8 * This class should be treated as a "protected" inner class.
204.9 - * Instantiate it only within subclasses of <Foo>.
204.10 + * Instantiate it only within subclasses of {@code BasicDesktopIconUI}.
204.11 */
204.12 public class MouseInputHandler extends MouseInputAdapter
204.13 {
205.1 --- a/src/share/classes/javax/swing/plaf/basic/BasicLabelUI.java Tue Apr 19 16:01:27 2011 -0700
205.2 +++ b/src/share/classes/javax/swing/plaf/basic/BasicLabelUI.java Tue Apr 26 15:48:03 2011 -0700
205.3 @@ -455,6 +455,8 @@
205.4 }
205.5 int dka = label.getDisplayedMnemonic();
205.6 inputMap.put(KeyStroke.getKeyStroke(dka, ActionEvent.ALT_MASK, true), RELEASE);
205.7 + // Need this when the sticky keys are enabled
205.8 + inputMap.put(KeyStroke.getKeyStroke(dka, 0, true), RELEASE);
205.9 // Need this if ALT is released before the accelerator
205.10 inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_ALT, 0, true), RELEASE);
205.11 label.requestFocus();
205.12 @@ -467,7 +469,9 @@
205.13 InputMap inputMap = SwingUtilities.getUIInputMap(label, JComponent.WHEN_FOCUSED);
205.14 if (inputMap != null) {
205.15 // inputMap should never be null.
205.16 - inputMap.remove(KeyStroke.getKeyStroke(label.getDisplayedMnemonic(), ActionEvent.ALT_MASK, true));
205.17 + int dka = label.getDisplayedMnemonic();
205.18 + inputMap.remove(KeyStroke.getKeyStroke(dka, ActionEvent.ALT_MASK, true));
205.19 + inputMap.remove(KeyStroke.getKeyStroke(dka, 0, true));
205.20 inputMap.remove(KeyStroke.getKeyStroke(KeyEvent.VK_ALT, 0, true));
205.21 }
205.22 if (labelFor instanceof Container &&
206.1 --- a/src/share/classes/javax/swing/plaf/basic/BasicListUI.java Tue Apr 19 16:01:27 2011 -0700
206.2 +++ b/src/share/classes/javax/swing/plaf/basic/BasicListUI.java Tue Apr 26 15:48:03 2011 -0700
206.3 @@ -1555,9 +1555,8 @@
206.4 }
206.5
206.6 /**
206.7 - * This inner class is marked "public" due to a compiler bug.
206.8 * This class should be treated as a "protected" inner class.
206.9 - * Instantiate it only within subclasses of BasicTableUI.
206.10 + * Instantiate it only within subclasses of {@code BasicListUI}.
206.11 */
206.12 public class FocusHandler implements FocusListener
206.13 {
207.1 --- a/src/share/classes/javax/swing/plaf/basic/BasicOptionPaneUI.java Tue Apr 19 16:01:27 2011 -0700
207.2 +++ b/src/share/classes/javax/swing/plaf/basic/BasicOptionPaneUI.java Tue Apr 26 15:48:03 2011 -0700
207.3 @@ -911,9 +911,8 @@
207.4 * right. If <code>syncAllWidths</code> is true, the widths of each
207.5 * component will be set to the largest preferred size width.
207.6 *
207.7 - * This inner class is marked "public" due to a compiler bug.
207.8 * This class should be treated as a "protected" inner class.
207.9 - * Instantiate it only within subclasses of BasicOptionPaneUI.
207.10 + * Instantiate it only within subclasses of {@code BasicOptionPaneUI}.
207.11 */
207.12 public static class ButtonAreaLayout implements LayoutManager {
207.13 protected boolean syncAllWidths;
207.14 @@ -1115,9 +1114,8 @@
207.15
207.16
207.17 /**
207.18 - * This inner class is marked "public" due to a compiler bug.
207.19 * This class should be treated as a "protected" inner class.
207.20 - * Instantiate it only within subclasses of BasicOptionPaneUI.
207.21 + * Instantiate it only within subclasses of {@code BasicOptionPaneUI}.
207.22 */
207.23 public class PropertyChangeHandler implements PropertyChangeListener {
207.24 /**
207.25 @@ -1161,9 +1159,8 @@
207.26 }
207.27
207.28 /**
207.29 - * This inner class is marked "public" due to a compiler bug.
207.30 * This class should be treated as a "protected" inner class.
207.31 - * Instantiate it only within subclasses of BasicOptionPaneUI.
207.32 + * Instantiate it only within subclasses of {@code BasicOptionPaneUI}.
207.33 */
207.34 public class ButtonActionListener implements ActionListener {
207.35 protected int buttonIndex;
208.1 --- a/src/share/classes/javax/swing/plaf/basic/BasicProgressBarUI.java Tue Apr 19 16:01:27 2011 -0700
208.2 +++ b/src/share/classes/javax/swing/plaf/basic/BasicProgressBarUI.java Tue Apr 26 15:48:03 2011 -0700
208.3 @@ -1211,9 +1211,8 @@
208.4
208.5
208.6 /**
208.7 - * This inner class is marked "public" due to a compiler bug.
208.8 * This class should be treated as a "protected" inner class.
208.9 - * Instantiate it only within subclasses of BasicProgressBarUI.
208.10 + * Instantiate it only within subclasses of {@code BasicProgressBarUI}.
208.11 */
208.12 public class ChangeHandler implements ChangeListener {
208.13 // NOTE: This class exists only for backward compatability. All
209.1 --- a/src/share/classes/javax/swing/plaf/basic/BasicTableHeaderUI.java Tue Apr 19 16:01:27 2011 -0700
209.2 +++ b/src/share/classes/javax/swing/plaf/basic/BasicTableHeaderUI.java Tue Apr 26 15:48:03 2011 -0700
209.3 @@ -88,9 +88,8 @@
209.4 };
209.5
209.6 /**
209.7 - * This inner class is marked "public" due to a compiler bug.
209.8 * This class should be treated as a "protected" inner class.
209.9 - * Instantiate it only within subclasses of BasicTableUI.
209.10 + * Instantiate it only within subclasses of {@code BasicTableHeaderUI}.
209.11 */
209.12 public class MouseInputHandler implements MouseInputListener {
209.13
210.1 --- a/src/share/classes/javax/swing/plaf/basic/BasicTableUI.java Tue Apr 19 16:01:27 2011 -0700
210.2 +++ b/src/share/classes/javax/swing/plaf/basic/BasicTableUI.java Tue Apr 26 15:48:03 2011 -0700
210.3 @@ -730,9 +730,8 @@
210.4 //
210.5
210.6 /**
210.7 - * This inner class is marked "public" due to a compiler bug.
210.8 * This class should be treated as a "protected" inner class.
210.9 - * Instantiate it only within subclasses of BasicTableUI.
210.10 + * Instantiate it only within subclasses of {@code BasicTableUI}.
210.11 * <p>As of Java 2 platform v1.3 this class is no longer used.
210.12 * Instead <code>JTable</code>
210.13 * overrides <code>processKeyBinding</code> to dispatch the event to
210.14 @@ -761,9 +760,8 @@
210.15 //
210.16
210.17 /**
210.18 - * This inner class is marked "public" due to a compiler bug.
210.19 * This class should be treated as a "protected" inner class.
210.20 - * Instantiate it only within subclasses of BasicTableUI.
210.21 + * Instantiate it only within subclasses of {@code BasicTableUI}.
210.22 */
210.23 public class FocusHandler implements FocusListener {
210.24 // NOTE: This class exists only for backward compatability. All
210.25 @@ -784,7 +782,6 @@
210.26 //
210.27
210.28 /**
210.29 - * This inner class is marked "public" due to a compiler bug.
210.30 * This class should be treated as a "protected" inner class.
210.31 * Instantiate it only within subclasses of BasicTableUI.
210.32 */
211.1 --- a/src/share/classes/javax/swing/plaf/metal/MetalComboBoxUI.java Tue Apr 19 16:01:27 2011 -0700
211.2 +++ b/src/share/classes/javax/swing/plaf/metal/MetalComboBoxUI.java Tue Apr 26 15:48:03 2011 -0700
211.3 @@ -199,9 +199,8 @@
211.4 }
211.5
211.6 /**
211.7 - * This inner class is marked "public" due to a compiler bug.
211.8 * This class should be treated as a "protected" inner class.
211.9 - * Instantiate it only within subclasses of <FooUI>.
211.10 + * Instantiate it only within subclasses of {@code MetalComboBoxUI}.
211.11 */
211.12 public class MetalPropertyChangeListener extends BasicComboBoxUI.PropertyChangeHandler {
211.13 public void propertyChange(PropertyChangeEvent e) {
211.14 @@ -244,9 +243,8 @@
211.15 }
211.16
211.17 /**
211.18 - * This inner class is marked "public" due to a compiler bug.
211.19 * This class should be treated as a "protected" inner class.
211.20 - * Instantiate it only within subclasses of <FooUI>.
211.21 + * Instantiate it only within subclasses of {@code MetalComboBoxUI}.
211.22 */
211.23 public class MetalComboBoxLayoutManager extends BasicComboBoxUI.ComboBoxLayoutManager {
211.24 public void layoutContainer( Container parent ) {
211.25 @@ -356,9 +354,8 @@
211.26 }
211.27
211.28 /**
211.29 - * This inner class is marked "public" due to a compiler bug.
211.30 * This class should be treated as a "protected" inner class.
211.31 - * Instantiate it only within subclasses of <FooUI>.
211.32 + * Instantiate it only within subclasses of {@code MetalComboBoxUI}.
211.33 *
211.34 * This class is now obsolete and doesn't do anything and
211.35 * is only included for backwards API compatibility. Do not call or
212.1 --- a/src/share/classes/javax/swing/plaf/metal/MetalTabbedPaneUI.java Tue Apr 19 16:01:27 2011 -0700
212.2 +++ b/src/share/classes/javax/swing/plaf/metal/MetalTabbedPaneUI.java Tue Apr 26 15:48:03 2011 -0700
212.3 @@ -1196,9 +1196,8 @@
212.4 }
212.5
212.6 /**
212.7 - * This inner class is marked "public" due to a compiler bug.
212.8 * This class should be treated as a "protected" inner class.
212.9 - * Instantiate it only within subclasses of MetalTabbedPaneUI.
212.10 + * Instantiate it only within subclasses of {@code MetalTabbedPaneUI}.
212.11 */
212.12 public class TabbedPaneLayout extends BasicTabbedPaneUI.TabbedPaneLayout {
212.13
213.1 --- a/src/share/classes/javax/swing/text/GlyphPainter2.java Tue Apr 19 16:01:27 2011 -0700
213.2 +++ b/src/share/classes/javax/swing/text/GlyphPainter2.java Tue Apr 26 15:48:03 2011 -0700
213.3 @@ -172,6 +172,11 @@
213.4 //italic carets and we do not.
213.5 TextHitInfo hit = layout.hitTestChar(x - (float)alloc.getX(), 0);
213.6 int pos = hit.getInsertionIndex();
213.7 +
213.8 + if (pos == v.getEndOffset()) {
213.9 + pos--;
213.10 + }
213.11 +
213.12 biasReturn[0] = hit.isLeadingEdge() ? Position.Bias.Forward : Position.Bias.Backward;
213.13 return pos + v.getStartOffset();
213.14 }
214.1 --- a/src/share/classes/javax/swing/text/GlyphView.java Tue Apr 19 16:01:27 2011 -0700
214.2 +++ b/src/share/classes/javax/swing/text/GlyphView.java Tue Apr 26 15:48:03 2011 -0700
214.3 @@ -541,7 +541,30 @@
214.4 */
214.5 @Override
214.6 public float getMinimumSpan(int axis) {
214.7 - return super.getMinimumSpan(axis);
214.8 + switch (axis) {
214.9 + case View.X_AXIS:
214.10 + if (minimumSpan < 0) {
214.11 + minimumSpan = 0;
214.12 + int p0 = getStartOffset();
214.13 + int p1 = getEndOffset();
214.14 + while (p1 > p0) {
214.15 + int breakSpot = getBreakSpot(p0, p1);
214.16 + if (breakSpot == BreakIterator.DONE) {
214.17 + // the rest of the view is non-breakable
214.18 + breakSpot = p0;
214.19 + }
214.20 + minimumSpan = Math.max(minimumSpan,
214.21 + getPartialSpan(breakSpot, p1));
214.22 + // Note: getBreakSpot returns the *last* breakspot
214.23 + p1 = breakSpot - 1;
214.24 + }
214.25 + }
214.26 + return minimumSpan;
214.27 + case View.Y_AXIS:
214.28 + return super.getMinimumSpan(axis);
214.29 + default:
214.30 + throw new IllegalArgumentException("Invalid axis: " + axis);
214.31 + }
214.32 }
214.33
214.34 /**
215.1 --- a/src/share/classes/javax/swing/text/ParagraphView.java Tue Apr 19 16:01:27 2011 -0700
215.2 +++ b/src/share/classes/javax/swing/text/ParagraphView.java Tue Apr 26 15:48:03 2011 -0700
215.3 @@ -721,7 +721,34 @@
215.4 @Override
215.5 protected SizeRequirements calculateMinorAxisRequirements(int axis,
215.6 SizeRequirements r) {
215.7 - return super.calculateMinorAxisRequirements(axis, r);
215.8 + r = super.calculateMinorAxisRequirements(axis, r);
215.9 +
215.10 + float min = 0;
215.11 + float glue = 0;
215.12 + int n = getLayoutViewCount();
215.13 + for (int i = 0; i < n; i++) {
215.14 + View v = getLayoutView(i);
215.15 + float span = v.getMinimumSpan(axis);
215.16 + if (v.getBreakWeight(axis, 0, v.getMaximumSpan(axis)) > View.BadBreakWeight) {
215.17 + // find the longest non-breakable fragments at the view edges
215.18 + int p0 = v.getStartOffset();
215.19 + int p1 = v.getEndOffset();
215.20 + float start = findEdgeSpan(v, axis, p0, p0, p1);
215.21 + float end = findEdgeSpan(v, axis, p1, p0, p1);
215.22 + glue += start;
215.23 + min = Math.max(min, Math.max(span, glue));
215.24 + glue = end;
215.25 + } else {
215.26 + // non-breakable view
215.27 + glue += span;
215.28 + min = Math.max(min, glue);
215.29 + }
215.30 + }
215.31 + r.minimum = Math.max(r.minimum, (int) min);
215.32 + r.preferred = Math.max(r.minimum, r.preferred);
215.33 + r.maximum = Math.max(r.preferred, r.maximum);
215.34 +
215.35 + return r;
215.36 }
215.37
215.38 /**
216.1 --- a/src/share/classes/javax/swing/text/Utilities.java Tue Apr 19 16:01:27 2011 -0700
216.2 +++ b/src/share/classes/javax/swing/text/Utilities.java Tue Apr 26 15:48:03 2011 -0700
216.3 @@ -395,10 +395,10 @@
216.4 // the length of the string measured as a whole may differ from
216.5 // the sum of individual character lengths, for example if
216.6 // fractional metrics are enabled; and we must guard from this.
216.7 - while (metrics.charsWidth(txt, txtOffset, offset + 1) > (x - x0)) {
216.8 + while (offset > 0 && metrics.charsWidth(txt, txtOffset, offset) > (x - x0)) {
216.9 offset--;
216.10 }
216.11 - return (offset < 0 ? 0 : offset);
216.12 + return offset;
216.13 }
216.14 currX = nextX;
216.15 }
217.1 --- a/src/share/classes/javax/swing/text/html/CSS.java Tue Apr 19 16:01:27 2011 -0700
217.2 +++ b/src/share/classes/javax/swing/text/html/CSS.java Tue Apr 26 15:48:03 2011 -0700
217.3 @@ -62,7 +62,6 @@
217.4 * <li>background-repeat
217.5 * <li>background-position
217.6 * <li>background
217.7 - * <li>background-repeat
217.8 * <li>text-decoration (with the exception of blink and overline)
217.9 * <li>vertical-align (only sup and super)
217.10 * <li>text-align (justify is treated as center)
217.11 @@ -75,7 +74,18 @@
217.12 * <li>padding-right
217.13 * <li>padding-bottom
217.14 * <li>padding-left
217.15 + * <li>padding
217.16 + * <li>border-top-style
217.17 + * <li>border-right-style
217.18 + * <li>border-bottom-style
217.19 + * <li>border-left-style
217.20 * <li>border-style (only supports inset, outset and none)
217.21 + * <li>border-top-color
217.22 + * <li>border-right-color
217.23 + * <li>border-bottom-color
217.24 + * <li>border-left-color
217.25 + * <li>border-color
217.26 + * <li>list-style-image
217.27 * <li>list-style-type
217.28 * <li>list-style-position
217.29 * </ul>
218.1 --- a/src/share/classes/javax/swing/text/html/parser/Parser.java Tue Apr 19 16:01:27 2011 -0700
218.2 +++ b/src/share/classes/javax/swing/text/html/parser/Parser.java Tue Apr 26 15:48:03 2011 -0700
218.3 @@ -966,6 +966,9 @@
218.4 char data[] = {'&'};
218.5 return data;
218.6 }
218.7 +
218.8 + boolean semicolon = false;
218.9 +
218.10 switch (ch) {
218.11 case '\n':
218.12 ln++;
218.13 @@ -985,6 +988,8 @@
218.14 break;
218.15
218.16 case ';':
218.17 + semicolon = true;
218.18 +
218.19 ch = readCh();
218.20 break;
218.21 }
218.22 @@ -1006,7 +1011,7 @@
218.23 return new char[0];
218.24 }
218.25 /* given that there is not a match restore the entity reference */
218.26 - String str = "&" + nm + ";";
218.27 + String str = "&" + nm + (semicolon ? ";" : "");
218.28
218.29 char b[] = new char[str.length()];
218.30 str.getChars(0, b.length, b, 0);
219.1 --- a/src/share/classes/sun/misc/FloatingDecimal.java Tue Apr 19 16:01:27 2011 -0700
219.2 +++ b/src/share/classes/sun/misc/FloatingDecimal.java Tue Apr 26 15:48:03 2011 -0700
219.3 @@ -30,7 +30,7 @@
219.4 import sun.misc.FloatConsts;
219.5 import java.util.regex.*;
219.6
219.7 -public class FloatingDecimal{
219.8 +public strictfp class FloatingDecimal{
219.9 boolean isExceptional;
219.10 boolean isNegative;
219.11 int decExponent;
220.1 --- a/src/share/classes/sun/misc/FormattedFloatingDecimal.java Tue Apr 19 16:01:27 2011 -0700
220.2 +++ b/src/share/classes/sun/misc/FormattedFloatingDecimal.java Tue Apr 26 15:48:03 2011 -0700
220.3 @@ -1,5 +1,5 @@
220.4 /*
220.5 - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
220.6 + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
220.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
220.8 *
220.9 * This code is free software; you can redistribute it and/or modify it
220.10 @@ -30,7 +30,7 @@
220.11 import sun.misc.FloatConsts;
220.12 import java.util.regex.*;
220.13
220.14 -public class FormattedFloatingDecimal{
220.15 +public strictfp class FormattedFloatingDecimal{
220.16 boolean isExceptional;
220.17 boolean isNegative;
220.18 int decExponent; // value set at construction, then immutable
221.1 --- a/src/share/classes/sun/misc/FpUtils.java Tue Apr 19 16:01:27 2011 -0700
221.2 +++ b/src/share/classes/sun/misc/FpUtils.java Tue Apr 26 15:48:03 2011 -0700
221.3 @@ -531,10 +531,9 @@
221.4 * Return {@code d} ×
221.5 * 2<sup>{@code scale_factor}</sup> rounded as if performed
221.6 * by a single correctly rounded floating-point multiply to a
221.7 - * member of the double value set. See <a
221.8 - * href="http://java.sun.com/docs/books/jls/second_edition/html/typesValues.doc.html#9208">§4.2.3</a>
221.9 - * of the <a href="http://java.sun.com/docs/books/jls/html/">Java
221.10 - * Language Specification</a> for a discussion of floating-point
221.11 + * member of the double value set. See section 4.2.3 of
221.12 + * <cite>The Java™ Language Specification</cite>
221.13 + * for a discussion of floating-point
221.14 * value sets. If the exponent of the result is between the
221.15 * {@code double}'s minimum exponent and maximum exponent,
221.16 * the answer is calculated exactly. If the exponent of the
221.17 @@ -641,11 +640,10 @@
221.18 * Return {@code f} ×
221.19 * 2<sup>{@code scale_factor}</sup> rounded as if performed
221.20 * by a single correctly rounded floating-point multiply to a
221.21 - * member of the float value set. See <a
221.22 - * href="http://java.sun.com/docs/books/jls/second_edition/html/typesValues.doc.html#9208">§4.2.3</a>
221.23 - * of the <a href="http://java.sun.com/docs/books/jls/html/">Java
221.24 - * Language Specification</a> for a discussion of floating-point
221.25 - * value set. If the exponent of the result is between the
221.26 + * member of the float value set. See section 4.2.3 of
221.27 + * <cite>The Java™ Language Specification</cite>
221.28 + * for a discussion of floating-point
221.29 + * value sets. If the exponent of the result is between the
221.30 * {@code float}'s minimum exponent and maximum exponent, the
221.31 * answer is calculated exactly. If the exponent of the result
221.32 * would be larger than {@code float}'s maximum exponent, an
222.1 --- a/src/share/classes/sun/net/www/protocol/jar/Handler.java Tue Apr 19 16:01:27 2011 -0700
222.2 +++ b/src/share/classes/sun/net/www/protocol/jar/Handler.java Tue Apr 26 15:48:03 2011 -0700
222.3 @@ -1,5 +1,5 @@
222.4 /*
222.5 - * Copyright (c) 1997, 2000, Oracle and/or its affiliates. All rights reserved.
222.6 + * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
222.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
222.8 *
222.9 * This code is free software; you can redistribute it and/or modify it
222.10 @@ -25,9 +25,8 @@
222.11
222.12 package sun.net.www.protocol.jar;
222.13
222.14 -import java.io.*;
222.15 +import java.io.IOException;
222.16 import java.net.*;
222.17 -import java.util.*;
222.18 import sun.net.www.ParseUtil;
222.19
222.20 /*
222.21 @@ -42,7 +41,7 @@
222.22 return new JarURLConnection(u, this);
222.23 }
222.24
222.25 - private int indexOfBangSlash(String spec) {
222.26 + private static int indexOfBangSlash(String spec) {
222.27 int indexOfBang = spec.length();
222.28 while((indexOfBang = spec.lastIndexOf('!', indexOfBang)) != -1) {
222.29 if ((indexOfBang != (spec.length() - 1)) &&
222.30 @@ -55,6 +54,75 @@
222.31 return -1;
222.32 }
222.33
222.34 + /**
222.35 + * Compare two jar URLs
222.36 + */
222.37 + @Override
222.38 + protected boolean sameFile(URL u1, URL u2) {
222.39 + if (!u1.getProtocol().equals("jar") || !u2.getProtocol().equals("jar"))
222.40 + return false;
222.41 +
222.42 + String file1 = u1.getFile();
222.43 + String file2 = u2.getFile();
222.44 + int sep1 = file1.indexOf(separator);
222.45 + int sep2 = file2.indexOf(separator);
222.46 +
222.47 + if (sep1 == -1 || sep2 == -1) {
222.48 + return super.sameFile(u1, u2);
222.49 + }
222.50 +
222.51 + String entry1 = file1.substring(sep1 + 2);
222.52 + String entry2 = file2.substring(sep2 + 2);
222.53 +
222.54 + if (!entry1.equals(entry2))
222.55 + return false;
222.56 +
222.57 + URL enclosedURL1 = null, enclosedURL2 = null;
222.58 + try {
222.59 + enclosedURL1 = new URL(file1.substring(0, sep1));
222.60 + enclosedURL2 = new URL(file2.substring(0, sep2));
222.61 + } catch (MalformedURLException unused) {
222.62 + return super.sameFile(u1, u2);
222.63 + }
222.64 +
222.65 + if (!super.sameFile(enclosedURL1, enclosedURL2)) {
222.66 + return false;
222.67 + }
222.68 +
222.69 + return true;
222.70 + }
222.71 +
222.72 + @Override
222.73 + protected int hashCode(URL u) {
222.74 + int h = 0;
222.75 +
222.76 + String protocol = u.getProtocol();
222.77 + if (protocol != null)
222.78 + h += protocol.hashCode();
222.79 +
222.80 + String file = u.getFile();
222.81 + int sep = file.indexOf(separator);
222.82 +
222.83 + if (sep == -1)
222.84 + return h + file.hashCode();
222.85 +
222.86 + URL enclosedURL = null;
222.87 + String fileWithoutEntry = file.substring(0, sep);
222.88 + try {
222.89 + enclosedURL = new URL(fileWithoutEntry);
222.90 + h += enclosedURL.hashCode();
222.91 + } catch (MalformedURLException unused) {
222.92 + h += fileWithoutEntry.hashCode();
222.93 + }
222.94 +
222.95 + String entry = file.substring(sep + 2);
222.96 + h += entry.hashCode();
222.97 +
222.98 + return h;
222.99 + }
222.100 +
222.101 +
222.102 + @Override
222.103 protected void parseURL(URL url, String spec,
222.104 int start, int limit) {
222.105 String file = null;
223.1 --- a/src/share/classes/sun/nio/ch/DatagramChannelImpl.java Tue Apr 19 16:01:27 2011 -0700
223.2 +++ b/src/share/classes/sun/nio/ch/DatagramChannelImpl.java Tue Apr 26 15:48:03 2011 -0700
223.3 @@ -388,9 +388,8 @@
223.4 // we must instead use a nonempty buffer, otherwise the call
223.5 // will not block waiting for a datagram on some platforms.
223.6 int newSize = Math.max(rem, 1);
223.7 - ByteBuffer bb = null;
223.8 + ByteBuffer bb = Util.getTemporaryDirectBuffer(newSize);
223.9 try {
223.10 - bb = Util.getTemporaryDirectBuffer(newSize);
223.11 int n = receiveIntoNativeBuffer(fd, bb, newSize, 0);
223.12 bb.flip();
223.13 if (n > 0 && rem > 0)
223.14 @@ -482,9 +481,8 @@
223.15 assert (pos <= lim);
223.16 int rem = (pos <= lim ? lim - pos : 0);
223.17
223.18 - ByteBuffer bb = null;
223.19 + ByteBuffer bb = Util.getTemporaryDirectBuffer(rem);
223.20 try {
223.21 - bb = Util.getTemporaryDirectBuffer(rem);
223.22 bb.put(src);
223.23 bb.flip();
223.24 // Do not update src until we see how many bytes were written
223.25 @@ -766,10 +764,10 @@
223.26 // check multicast address is compatible with this socket
223.27 if (group instanceof Inet4Address) {
223.28 if (family == StandardProtocolFamily.INET6 && !Net.canIPv6SocketJoinIPv4Group())
223.29 - throw new IllegalArgumentException("Group is not IPv4 multicast address");
223.30 + throw new IllegalArgumentException("IPv6 socket cannot join IPv4 multicast group");
223.31 } else if (group instanceof Inet6Address) {
223.32 if (family != StandardProtocolFamily.INET6)
223.33 - throw new IllegalArgumentException("Group is not IPv6 multicast address");
223.34 + throw new IllegalArgumentException("Only IPv6 sockets can join IPv6 multicast group");
223.35 } else {
223.36 throw new IllegalArgumentException("Address type not supported");
223.37 }
224.1 --- a/src/share/classes/sun/nio/ch/IOUtil.java Tue Apr 19 16:01:27 2011 -0700
224.2 +++ b/src/share/classes/sun/nio/ch/IOUtil.java Tue Apr 26 15:48:03 2011 -0700
224.3 @@ -50,9 +50,8 @@
224.4 int lim = src.limit();
224.5 assert (pos <= lim);
224.6 int rem = (pos <= lim ? lim - pos : 0);
224.7 - ByteBuffer bb = null;
224.8 + ByteBuffer bb = Util.getTemporaryDirectBuffer(rem);
224.9 try {
224.10 - bb = Util.getTemporaryDirectBuffer(rem);
224.11 bb.put(src);
224.12 bb.flip();
224.13 // Do not update src until we see how many bytes were written
224.14 @@ -187,9 +186,8 @@
224.15 return readIntoNativeBuffer(fd, dst, position, nd, lock);
224.16
224.17 // Substitute a native buffer
224.18 - ByteBuffer bb = null;
224.19 + ByteBuffer bb = Util.getTemporaryDirectBuffer(dst.remaining());
224.20 try {
224.21 - bb = Util.getTemporaryDirectBuffer(dst.remaining());
224.22 int n = readIntoNativeBuffer(fd, bb, position, nd, lock);
224.23 bb.flip();
224.24 if (n > 0)
225.1 --- a/src/share/classes/sun/rmi/transport/ObjectTable.java Tue Apr 19 16:01:27 2011 -0700
225.2 +++ b/src/share/classes/sun/rmi/transport/ObjectTable.java Tue Apr 26 15:48:03 2011 -0700
225.3 @@ -175,25 +175,26 @@
225.4 DGCImpl.dgcLog.log(Log.VERBOSE, "add object " + oe);
225.5 }
225.6
225.7 - Remote impl = target.getImpl();
225.8 - if (impl == null) {
225.9 - throw new ExportException(
225.10 - "internal error: attempt to export collected object");
225.11 - }
225.12 + synchronized (tableLock) {
225.13 + /**
225.14 + * Do nothing if impl has already been collected (see 6597112). Check while
225.15 + * holding tableLock to ensure that Reaper cannot process weakImpl in between
225.16 + * null check and put/increment effects.
225.17 + */
225.18 + if (target.getImpl() != null) {
225.19 + if (objTable.containsKey(oe)) {
225.20 + throw new ExportException(
225.21 + "internal error: ObjID already in use");
225.22 + } else if (implTable.containsKey(weakImpl)) {
225.23 + throw new ExportException("object already exported");
225.24 + }
225.25
225.26 - synchronized (tableLock) {
225.27 - if (objTable.containsKey(oe)) {
225.28 - throw new ExportException(
225.29 - "internal error: ObjID already in use");
225.30 - } else if (implTable.containsKey(weakImpl)) {
225.31 - throw new ExportException("object already exported");
225.32 - }
225.33 + objTable.put(oe, target);
225.34 + implTable.put(weakImpl, target);
225.35
225.36 - objTable.put(oe, target);
225.37 - implTable.put(weakImpl, target);
225.38 -
225.39 - if (!target.isPermanent()) {
225.40 - incrementKeepAliveCount();
225.41 + if (!target.isPermanent()) {
225.42 + incrementKeepAliveCount();
225.43 + }
225.44 }
225.45 }
225.46 }
226.1 --- a/src/share/classes/sun/security/jgss/krb5/InitSecContextToken.java Tue Apr 19 16:01:27 2011 -0700
226.2 +++ b/src/share/classes/sun/security/jgss/krb5/InitSecContextToken.java Tue Apr 26 15:48:03 2011 -0700
226.3 @@ -1,5 +1,5 @@
226.4 /*
226.5 - * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.
226.6 + * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
226.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
226.8 *
226.9 * This code is free software; you can redistribute it and/or modify it
226.10 @@ -127,8 +127,8 @@
226.11 //System.out.println("Sub-Session Key Missing in Authenticator.\n");
226.12 }
226.13
226.14 - OverloadedChecksum gssChecksum =
226.15 - new OverloadedChecksum(context, apReq.getChecksum(), sessionKey);
226.16 + OverloadedChecksum gssChecksum = new OverloadedChecksum(
226.17 + context, apReq.getChecksum(), sessionKey, subKey);
226.18 gssChecksum.setContextFlags(context);
226.19 Credentials delegCred = gssChecksum.getDelegatedCreds();
226.20 if (delegCred != null) {
227.1 --- a/src/share/classes/sun/security/jgss/krb5/InitialToken.java Tue Apr 19 16:01:27 2011 -0700
227.2 +++ b/src/share/classes/sun/security/jgss/krb5/InitialToken.java Tue Apr 26 15:48:03 2011 -0700
227.3 @@ -1,5 +1,5 @@
227.4 /*
227.5 - * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
227.6 + * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
227.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
227.8 *
227.9 * This code is free software; you can redistribute it and/or modify it
227.10 @@ -210,8 +210,8 @@
227.11 // be passed in if this checksum type denotes a
227.12 // raw_checksum. In that case, make Checksum class krb5
227.13 // internal.
227.14 - public OverloadedChecksum(Krb5Context context,
227.15 - Checksum checksum, EncryptionKey key)
227.16 + public OverloadedChecksum(Krb5Context context, Checksum checksum,
227.17 + EncryptionKey key, EncryptionKey subKey)
227.18 throws GSSException, KrbException, IOException {
227.19
227.20 int pos = 0;
227.21 @@ -283,9 +283,17 @@
227.22 new KrbCred(credBytes, EncryptionKey.NULL_KEY).
227.23 getDelegatedCreds()[0];
227.24 } else {
227.25 - delegCreds =
227.26 - new KrbCred(credBytes, key).
227.27 - getDelegatedCreds()[0];
227.28 + KrbCred cred;
227.29 + try {
227.30 + cred = new KrbCred(credBytes, key);
227.31 + } catch (KrbException e) {
227.32 + if (subKey != null) {
227.33 + cred = new KrbCred(credBytes, subKey);
227.34 + } else {
227.35 + throw e;
227.36 + }
227.37 + }
227.38 + delegCreds = cred.getDelegatedCreds()[0];
227.39 }
227.40 }
227.41 }
228.1 --- a/src/share/classes/sun/security/krb5/KrbApReq.java Tue Apr 19 16:01:27 2011 -0700
228.2 +++ b/src/share/classes/sun/security/krb5/KrbApReq.java Tue Apr 26 15:48:03 2011 -0700
228.3 @@ -1,5 +1,5 @@
228.4 /*
228.5 - * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
228.6 + * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
228.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
228.8 *
228.9 * This code is free software; you can redistribute it and/or modify it
228.10 @@ -37,6 +37,7 @@
228.11 import java.net.InetAddress;
228.12 import sun.security.util.*;
228.13 import java.io.IOException;
228.14 +import java.util.Arrays;
228.15
228.16 /**
228.17 * This class encapsulates a KRB-AP-REQ that a client sends to a
228.18 @@ -54,9 +55,6 @@
228.19 private static CacheTable table = new CacheTable();
228.20 private static boolean DEBUG = Krb5.DEBUG;
228.21
228.22 - // default is address-less tickets
228.23 - private boolean KDC_EMPTY_ADDRESSES_ALLOWED = true;
228.24 -
228.25 /**
228.26 * Contructs a AP-REQ message to send to the peer.
228.27 * @param tgsCred the <code>Credentials</code> to be used to construct the
228.28 @@ -312,23 +310,19 @@
228.29 table.put(client, time, currTime.getTime());
228.30 }
228.31
228.32 - // check to use addresses in tickets
228.33 - if (Config.getInstance().useAddresses()) {
228.34 - KDC_EMPTY_ADDRESSES_ALLOWED = false;
228.35 - }
228.36 -
228.37 - // sender host address
228.38 - HostAddress sender = null;
228.39 if (initiator != null) {
228.40 - sender = new HostAddress(initiator);
228.41 - }
228.42 -
228.43 - if (sender != null || !KDC_EMPTY_ADDRESSES_ALLOWED) {
228.44 - if (enc_ticketPart.caddr != null) {
228.45 - if (sender == null)
228.46 - throw new KrbApErrException(Krb5.KRB_AP_ERR_BADADDR);
228.47 - if (!enc_ticketPart.caddr.inList(sender))
228.48 - throw new KrbApErrException(Krb5.KRB_AP_ERR_BADADDR);
228.49 + // sender host address
228.50 + HostAddress sender = new HostAddress(initiator);
228.51 + if (enc_ticketPart.caddr != null
228.52 + && !enc_ticketPart.caddr.inList(sender)) {
228.53 + if (DEBUG) {
228.54 + System.out.println(">>> KrbApReq: initiator is "
228.55 + + sender.getInetAddress()
228.56 + + ", but caddr is "
228.57 + + Arrays.toString(
228.58 + enc_ticketPart.caddr.getInetAddresses()));
228.59 + }
228.60 + throw new KrbApErrException(Krb5.KRB_AP_ERR_BADADDR);
228.61 }
228.62 }
228.63
229.1 --- a/src/share/classes/sun/security/krb5/internal/NetClient.java Tue Apr 19 16:01:27 2011 -0700
229.2 +++ b/src/share/classes/sun/security/krb5/internal/NetClient.java Tue Apr 26 15:48:03 2011 -0700
229.3 @@ -1,5 +1,5 @@
229.4 /*
229.5 - * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
229.6 + * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
229.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
229.8 *
229.9 * This code is free software; you can redistribute it and/or modify it
229.10 @@ -59,7 +59,8 @@
229.11
229.12 TCPClient(String hostname, int port, int timeout)
229.13 throws IOException {
229.14 - tcpSocket = new Socket(hostname, port);
229.15 + tcpSocket = new Socket();
229.16 + tcpSocket.connect(new InetSocketAddress(hostname, port), timeout);
229.17 out = new BufferedOutputStream(tcpSocket.getOutputStream());
229.18 in = new BufferedInputStream(tcpSocket.getInputStream());
229.19 tcpSocket.setSoTimeout(timeout);
230.1 --- a/src/share/classes/sun/security/pkcs/PKCS7.java Tue Apr 19 16:01:27 2011 -0700
230.2 +++ b/src/share/classes/sun/security/pkcs/PKCS7.java Tue Apr 26 15:48:03 2011 -0700
230.3 @@ -1,5 +1,5 @@
230.4 /*
230.5 - * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
230.6 + * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
230.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
230.8 *
230.9 * This code is free software; you can redistribute it and/or modify it
230.10 @@ -38,6 +38,7 @@
230.11 import sun.security.util.*;
230.12 import sun.security.x509.AlgorithmId;
230.13 import sun.security.x509.CertificateIssuerName;
230.14 +import sun.security.x509.KeyUsageExtension;
230.15 import sun.security.x509.X509CertImpl;
230.16 import sun.security.x509.X509CertInfo;
230.17 import sun.security.x509.X509CRLImpl;
230.18 @@ -492,7 +493,7 @@
230.19 // CRLs (optional)
230.20 if (crls != null && crls.length != 0) {
230.21 // cast to X509CRLImpl[] since X509CRLImpl implements DerEncoder
230.22 - Set<X509CRLImpl> implCRLs = new HashSet<X509CRLImpl>(crls.length);
230.23 + Set<X509CRLImpl> implCRLs = new HashSet<>(crls.length);
230.24 for (X509CRL crl: crls) {
230.25 if (crl instanceof X509CRLImpl)
230.26 implCRLs.add((X509CRLImpl) crl);
230.27 @@ -530,6 +531,168 @@
230.28 }
230.29
230.30 /**
230.31 + * Verifying signed data using an external chunked data source.
230.32 + */
230.33 + public static class PKCS7Verifier {
230.34 +
230.35 + private final SignerInfo si; // Signer to verify
230.36 + private final MessageDigest md; // MessageDigest object for chunks
230.37 + private final Signature sig; // Signature object for chunks
230.38 +
230.39 + private PKCS7Verifier(SignerInfo si, MessageDigest md, Signature sig) {
230.40 + this.si = si;
230.41 + this.md = md;
230.42 + this.sig = sig;
230.43 + }
230.44 +
230.45 + public static PKCS7Verifier from(PKCS7 block, SignerInfo si) throws
230.46 + SignatureException, NoSuchAlgorithmException {
230.47 +
230.48 + try {
230.49 + MessageDigest md = null;
230.50 + Signature sig;
230.51 +
230.52 + ContentInfo content = block.getContentInfo();
230.53 + String digestAlgname = si.getDigestAlgorithmId().getName();
230.54 +
230.55 + // if there are authenticate attributes, feed data chunks to
230.56 + // the message digest. In this case, pv.md is not null
230.57 + if (si.authenticatedAttributes != null) {
230.58 + // first, check content type
230.59 + ObjectIdentifier contentType = (ObjectIdentifier)
230.60 + si.authenticatedAttributes.getAttributeValue(
230.61 + PKCS9Attribute.CONTENT_TYPE_OID);
230.62 + if (contentType == null ||
230.63 + !contentType.equals(content.contentType))
230.64 + return null; // contentType does not match, bad SignerInfo
230.65 +
230.66 + // now, check message digest
230.67 + byte[] messageDigest = (byte[])
230.68 + si.authenticatedAttributes.getAttributeValue(
230.69 + PKCS9Attribute.MESSAGE_DIGEST_OID);
230.70 +
230.71 + if (messageDigest == null) // fail if there is no message digest
230.72 + return null;
230.73 +
230.74 + md = MessageDigest.getInstance(digestAlgname);
230.75 + }
230.76 +
230.77 + // put together digest algorithm and encryption algorithm
230.78 + // to form signing algorithm
230.79 + String encryptionAlgname =
230.80 + si.getDigestEncryptionAlgorithmId().getName();
230.81 +
230.82 + // Workaround: sometimes the encryptionAlgname is actually
230.83 + // a signature name
230.84 + String tmp = AlgorithmId.getEncAlgFromSigAlg(encryptionAlgname);
230.85 + if (tmp != null) encryptionAlgname = tmp;
230.86 + String algname = AlgorithmId.makeSigAlg(
230.87 + digestAlgname, encryptionAlgname);
230.88 +
230.89 + sig = Signature.getInstance(algname);
230.90 + X509Certificate cert = si.getCertificate(block);
230.91 +
230.92 + if (cert == null) {
230.93 + return null;
230.94 + }
230.95 + if (cert.hasUnsupportedCriticalExtension()) {
230.96 + throw new SignatureException("Certificate has unsupported "
230.97 + + "critical extension(s)");
230.98 + }
230.99 +
230.100 + // Make sure that if the usage of the key in the certificate is
230.101 + // restricted, it can be used for digital signatures.
230.102 + // XXX We may want to check for additional extensions in the
230.103 + // future.
230.104 + boolean[] keyUsageBits = cert.getKeyUsage();
230.105 + if (keyUsageBits != null) {
230.106 + KeyUsageExtension keyUsage;
230.107 + try {
230.108 + // We don't care whether or not this extension was marked
230.109 + // critical in the certificate.
230.110 + // We're interested only in its value (i.e., the bits set)
230.111 + // and treat the extension as critical.
230.112 + keyUsage = new KeyUsageExtension(keyUsageBits);
230.113 + } catch (IOException ioe) {
230.114 + throw new SignatureException("Failed to parse keyUsage "
230.115 + + "extension");
230.116 + }
230.117 +
230.118 + boolean digSigAllowed = ((Boolean)keyUsage.get(
230.119 + KeyUsageExtension.DIGITAL_SIGNATURE)).booleanValue();
230.120 +
230.121 + boolean nonRepuAllowed = ((Boolean)keyUsage.get(
230.122 + KeyUsageExtension.NON_REPUDIATION)).booleanValue();
230.123 +
230.124 + if (!digSigAllowed && !nonRepuAllowed) {
230.125 + throw new SignatureException("Key usage restricted: "
230.126 + + "cannot be used for "
230.127 + + "digital signatures");
230.128 + }
230.129 + }
230.130 +
230.131 + PublicKey key = cert.getPublicKey();
230.132 + sig.initVerify(key);
230.133 + return new PKCS7Verifier(si, md, sig);
230.134 + } catch (IOException e) {
230.135 + throw new SignatureException("IO error verifying signature:\n" +
230.136 + e.getMessage());
230.137 +
230.138 + } catch (InvalidKeyException e) {
230.139 + throw new SignatureException("InvalidKey: " + e.getMessage());
230.140 +
230.141 + }
230.142 + }
230.143 +
230.144 + public void update(byte[] data, int off, int end)
230.145 + throws SignatureException {
230.146 + if (md != null) {
230.147 + md.update(data, off, end-off);
230.148 + } else {
230.149 + sig.update(data, off, end-off);
230.150 + }
230.151 + }
230.152 +
230.153 + public SignerInfo verify() throws SignatureException {
230.154 + try {
230.155 + // if there are authenticate attributes, get the message
230.156 + // digest and compare it with the digest of data
230.157 + if (md != null) {
230.158 + // now, check message digest
230.159 + byte[] messageDigest = (byte[])
230.160 + si.authenticatedAttributes.getAttributeValue(
230.161 + PKCS9Attribute.MESSAGE_DIGEST_OID);
230.162 +
230.163 + byte[] computedMessageDigest = md.digest();
230.164 +
230.165 + if (!MessageDigest.isEqual(
230.166 + messageDigest, computedMessageDigest)) {
230.167 + return null;
230.168 + }
230.169 +
230.170 + // message digest attribute matched
230.171 + // digest of original data
230.172 +
230.173 + // the data actually signed is the DER encoding of
230.174 + // the authenticated attributes (tagged with
230.175 + // the "SET OF" tag, not 0xA0).
230.176 + byte[] dataSigned = si.authenticatedAttributes.getDerEncoding();
230.177 + sig.update(dataSigned);
230.178 + }
230.179 +
230.180 + if (sig.verify(si.getEncryptedDigest())) {
230.181 + return si;
230.182 + }
230.183 +
230.184 + } catch (IOException e) {
230.185 + throw new SignatureException("IO error verifying signature:\n" +
230.186 + e.getMessage());
230.187 + }
230.188 + return null;
230.189 + }
230.190 + }
230.191 +
230.192 + /**
230.193 * This verifies a given SignerInfo.
230.194 *
230.195 * @param info the signer information.
230.196 @@ -554,19 +717,16 @@
230.197 public SignerInfo[] verify(byte[] bytes)
230.198 throws NoSuchAlgorithmException, SignatureException {
230.199
230.200 - Vector<SignerInfo> intResult = new Vector<SignerInfo>();
230.201 + List<SignerInfo> intResult = new ArrayList<>();
230.202 for (int i = 0; i < signerInfos.length; i++) {
230.203
230.204 SignerInfo signerInfo = verify(signerInfos[i], bytes);
230.205 if (signerInfo != null) {
230.206 - intResult.addElement(signerInfo);
230.207 + intResult.add(signerInfo);
230.208 }
230.209 }
230.210 - if (intResult.size() != 0) {
230.211 -
230.212 - SignerInfo[] result = new SignerInfo[intResult.size()];
230.213 - intResult.copyInto(result);
230.214 - return result;
230.215 + if (!intResult.isEmpty()) {
230.216 + return intResult.toArray(new SignerInfo[intResult.size()]);
230.217 }
230.218 return null;
230.219 }
231.1 --- a/src/share/classes/sun/security/pkcs/SignerInfo.java Tue Apr 19 16:01:27 2011 -0700
231.2 +++ b/src/share/classes/sun/security/pkcs/SignerInfo.java Tue Apr 26 15:48:03 2011 -0700
231.3 @@ -1,5 +1,5 @@
231.4 /*
231.5 - * Copyright (c) 1996, 2009, Oracle and/or its affiliates. All rights reserved.
231.6 + * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
231.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
231.8 *
231.9 * This code is free software; you can redistribute it and/or modify it
231.10 @@ -230,7 +230,7 @@
231.11 if (userCert == null)
231.12 return null;
231.13
231.14 - ArrayList<X509Certificate> certList = new ArrayList<X509Certificate>();
231.15 + ArrayList<X509Certificate> certList = new ArrayList<>();
231.16 certList.add(userCert);
231.17
231.18 X509Certificate[] pkcsCerts = block.getCertificates();
231.19 @@ -276,132 +276,20 @@
231.20 /* Returns null if verify fails, this signerInfo if
231.21 verify succeeds. */
231.22 SignerInfo verify(PKCS7 block, byte[] data)
231.23 - throws NoSuchAlgorithmException, SignatureException {
231.24 + throws NoSuchAlgorithmException, SignatureException {
231.25
231.26 - try {
231.27 -
231.28 - ContentInfo content = block.getContentInfo();
231.29 - if (data == null) {
231.30 - data = content.getContentBytes();
231.31 + PKCS7.PKCS7Verifier p7v = PKCS7.PKCS7Verifier.from(block, this);
231.32 + if (p7v == null) return null;
231.33 + if (data == null) {
231.34 + try {
231.35 + data = block.getContentInfo().getContentBytes();
231.36 + } catch (IOException e) {
231.37 + throw new SignatureException("IO error verifying signature:\n" +
231.38 + e.getMessage());
231.39 }
231.40 -
231.41 - String digestAlgname = getDigestAlgorithmId().getName();
231.42 -
231.43 - byte[] dataSigned;
231.44 -
231.45 - // if there are authenticate attributes, get the message
231.46 - // digest and compare it with the digest of data
231.47 - if (authenticatedAttributes == null) {
231.48 - dataSigned = data;
231.49 - } else {
231.50 -
231.51 - // first, check content type
231.52 - ObjectIdentifier contentType = (ObjectIdentifier)
231.53 - authenticatedAttributes.getAttributeValue(
231.54 - PKCS9Attribute.CONTENT_TYPE_OID);
231.55 - if (contentType == null ||
231.56 - !contentType.equals(content.contentType))
231.57 - return null; // contentType does not match, bad SignerInfo
231.58 -
231.59 - // now, check message digest
231.60 - byte[] messageDigest = (byte[])
231.61 - authenticatedAttributes.getAttributeValue(
231.62 - PKCS9Attribute.MESSAGE_DIGEST_OID);
231.63 -
231.64 - if (messageDigest == null) // fail if there is no message digest
231.65 - return null;
231.66 -
231.67 - MessageDigest md = MessageDigest.getInstance(digestAlgname);
231.68 - byte[] computedMessageDigest = md.digest(data);
231.69 -
231.70 - if (messageDigest.length != computedMessageDigest.length)
231.71 - return null;
231.72 - for (int i = 0; i < messageDigest.length; i++) {
231.73 - if (messageDigest[i] != computedMessageDigest[i])
231.74 - return null;
231.75 - }
231.76 -
231.77 - // message digest attribute matched
231.78 - // digest of original data
231.79 -
231.80 - // the data actually signed is the DER encoding of
231.81 - // the authenticated attributes (tagged with
231.82 - // the "SET OF" tag, not 0xA0).
231.83 - dataSigned = authenticatedAttributes.getDerEncoding();
231.84 - }
231.85 -
231.86 - // put together digest algorithm and encryption algorithm
231.87 - // to form signing algorithm
231.88 - String encryptionAlgname =
231.89 - getDigestEncryptionAlgorithmId().getName();
231.90 -
231.91 - // Workaround: sometimes the encryptionAlgname is actually
231.92 - // a signature name
231.93 - String tmp = AlgorithmId.getEncAlgFromSigAlg(encryptionAlgname);
231.94 - if (tmp != null) encryptionAlgname = tmp;
231.95 - String algname = AlgorithmId.makeSigAlg(
231.96 - digestAlgname, encryptionAlgname);
231.97 -
231.98 - Signature sig = Signature.getInstance(algname);
231.99 - X509Certificate cert = getCertificate(block);
231.100 -
231.101 - if (cert == null) {
231.102 - return null;
231.103 - }
231.104 - if (cert.hasUnsupportedCriticalExtension()) {
231.105 - throw new SignatureException("Certificate has unsupported "
231.106 - + "critical extension(s)");
231.107 - }
231.108 -
231.109 - // Make sure that if the usage of the key in the certificate is
231.110 - // restricted, it can be used for digital signatures.
231.111 - // XXX We may want to check for additional extensions in the
231.112 - // future.
231.113 - boolean[] keyUsageBits = cert.getKeyUsage();
231.114 - if (keyUsageBits != null) {
231.115 - KeyUsageExtension keyUsage;
231.116 - try {
231.117 - // We don't care whether or not this extension was marked
231.118 - // critical in the certificate.
231.119 - // We're interested only in its value (i.e., the bits set)
231.120 - // and treat the extension as critical.
231.121 - keyUsage = new KeyUsageExtension(keyUsageBits);
231.122 - } catch (IOException ioe) {
231.123 - throw new SignatureException("Failed to parse keyUsage "
231.124 - + "extension");
231.125 - }
231.126 -
231.127 - boolean digSigAllowed = ((Boolean)keyUsage.get(
231.128 - KeyUsageExtension.DIGITAL_SIGNATURE)).booleanValue();
231.129 -
231.130 - boolean nonRepuAllowed = ((Boolean)keyUsage.get(
231.131 - KeyUsageExtension.NON_REPUDIATION)).booleanValue();
231.132 -
231.133 - if (!digSigAllowed && !nonRepuAllowed) {
231.134 - throw new SignatureException("Key usage restricted: "
231.135 - + "cannot be used for "
231.136 - + "digital signatures");
231.137 - }
231.138 - }
231.139 -
231.140 - PublicKey key = cert.getPublicKey();
231.141 - sig.initVerify(key);
231.142 -
231.143 - sig.update(dataSigned);
231.144 -
231.145 - if (sig.verify(encryptedDigest)) {
231.146 - return this;
231.147 - }
231.148 -
231.149 - } catch (IOException e) {
231.150 - throw new SignatureException("IO error verifying signature:\n" +
231.151 - e.getMessage());
231.152 -
231.153 - } catch (InvalidKeyException e) {
231.154 - throw new SignatureException("InvalidKey: " + e.getMessage());
231.155 -
231.156 }
231.157 - return null;
231.158 + p7v.update(data, 0, data.length);
231.159 + return p7v.verify();
231.160 }
231.161
231.162 /* Verify the content of the pkcs7 block. */
232.1 --- a/src/share/classes/sun/security/pkcs11/Config.java Tue Apr 19 16:01:27 2011 -0700
232.2 +++ b/src/share/classes/sun/security/pkcs11/Config.java Tue Apr 26 15:48:03 2011 -0700
232.3 @@ -343,6 +343,7 @@
232.4 st.wordChars('{', '{'); // need {} for property subst
232.5 st.wordChars('}', '}');
232.6 st.wordChars('*', '*');
232.7 + st.wordChars('+', '+');
232.8 st.wordChars('~', '~');
232.9 // XXX check ASCII table and add all other characters except special
232.10
233.1 --- a/src/share/classes/sun/security/pkcs11/SessionManager.java Tue Apr 19 16:01:27 2011 -0700
233.2 +++ b/src/share/classes/sun/security/pkcs11/SessionManager.java Tue Apr 26 15:48:03 2011 -0700
233.3 @@ -1,5 +1,5 @@
233.4 /*
233.5 - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
233.6 + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
233.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
233.8 *
233.9 * This code is free software; you can redistribute it and/or modify it
233.10 @@ -76,6 +76,9 @@
233.11 // maximum number of sessions to open with this token
233.12 private final int maxSessions;
233.13
233.14 + // total number of active sessions
233.15 + private int activeSessions;
233.16 +
233.17 // pool of available object sessions
233.18 private final Pool objSessions;
233.19
233.20 @@ -115,11 +118,6 @@
233.21 return (maxSessions <= DEFAULT_MAX_SESSIONS);
233.22 }
233.23
233.24 - // returns the total number of active sessions
233.25 - int totalSessionCount() {
233.26 - return SessionRef.totalCount();
233.27 - }
233.28 -
233.29 synchronized Session getObjSession() throws PKCS11Exception {
233.30 Session session = objSessions.poll();
233.31 if (session != null) {
233.32 @@ -141,7 +139,7 @@
233.33 // create a new session rather than re-using an obj session
233.34 // that avoids potential expensive cancels() for Signatures & RSACipher
233.35 if (maxSessions == Integer.MAX_VALUE ||
233.36 - totalSessionCount() < maxSessions) {
233.37 + activeSessions < maxSessions) {
233.38 session = openSession();
233.39 return ensureValid(session);
233.40 }
233.41 @@ -164,7 +162,7 @@
233.42 if (debug != null) {
233.43 String location = new Exception().getStackTrace()[2].toString();
233.44 System.out.println("Killing session (" + location + ") active: "
233.45 - + totalSessionCount());
233.46 + + activeSessions);
233.47 }
233.48 closeSession(session);
233.49 return null;
233.50 @@ -189,7 +187,7 @@
233.51 }
233.52 if (debug != null) {
233.53 System.out.println("Demoting session, active: " +
233.54 - totalSessionCount());
233.55 + activeSessions);
233.56 }
233.57 boolean present = objSessions.remove(session);
233.58 if (present == false) {
233.59 @@ -202,16 +200,16 @@
233.60
233.61 private Session openSession() throws PKCS11Exception {
233.62 if ((maxSessions != Integer.MAX_VALUE) &&
233.63 - (totalSessionCount() >= maxSessions)) {
233.64 + (activeSessions >= maxSessions)) {
233.65 throw new ProviderException("No more sessions available");
233.66 }
233.67 long id = token.p11.C_OpenSession
233.68 (token.provider.slotID, openSessionFlags, null, null);
233.69 Session session = new Session(token, id);
233.70 + activeSessions++;
233.71 if (debug != null) {
233.72 - int currTotal = totalSessionCount();
233.73 - if (currTotal > maxActiveSessions) {
233.74 - maxActiveSessions = currTotal;
233.75 + if (activeSessions > maxActiveSessions) {
233.76 + maxActiveSessions = activeSessions;
233.77 if (maxActiveSessions % 10 == 0) {
233.78 System.out.println("Open sessions: " + maxActiveSessions);
233.79 }
233.80 @@ -222,6 +220,7 @@
233.81
233.82 private void closeSession(Session session) {
233.83 session.close();
233.84 + activeSessions--;
233.85 }
233.86
233.87 private static final class Pool {
233.88 @@ -275,7 +274,7 @@
233.89 }
233.90 if (debug != null) {
233.91 System.out.println("Closing " + i + " idle sessions, active: "
233.92 - + mgr.totalSessionCount());
233.93 + + mgr.activeSessions);
233.94 }
233.95 List<Session> subList = pool.subList(0, i);
233.96 subList.clear();
234.1 --- a/src/share/classes/sun/security/provider/certpath/CrlRevocationChecker.java Tue Apr 19 16:01:27 2011 -0700
234.2 +++ b/src/share/classes/sun/security/provider/certpath/CrlRevocationChecker.java Tue Apr 26 15:48:03 2011 -0700
234.3 @@ -1,5 +1,5 @@
234.4 /*
234.5 - * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.
234.6 + * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
234.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
234.8 *
234.9 * This code is free software; you can redistribute it and/or modify it
234.10 @@ -249,7 +249,7 @@
234.11 throws CertPathValidatorException
234.12 {
234.13 verifyRevocationStatus(currCert, prevKey, signFlag,
234.14 - allowSeparateKey, null);
234.15 + allowSeparateKey, null, mParams.getTrustAnchors());
234.16 }
234.17
234.18 /**
234.19 @@ -260,11 +260,12 @@
234.20 * circular dependencies, we assume they're
234.21 * revoked while checking the revocation
234.22 * status of this cert.
234.23 + * @param trustAnchors a <code>Set</code> of <code>TrustAnchor</code>s
234.24 */
234.25 private void verifyRevocationStatus(X509Certificate currCert,
234.26 PublicKey prevKey, boolean signFlag, boolean allowSeparateKey,
234.27 - Set<X509Certificate> stackedCerts) throws CertPathValidatorException
234.28 - {
234.29 + Set<X509Certificate> stackedCerts,
234.30 + Set<TrustAnchor> trustAnchors) throws CertPathValidatorException {
234.31
234.32 String msg = "revocation status";
234.33 if (debug != null) {
234.34 @@ -311,7 +312,7 @@
234.35 DistributionPointFetcher.getInstance();
234.36 // all CRLs returned by the DP Fetcher have also been verified
234.37 mApprovedCRLs.addAll(store.getCRLs(sel, signFlag, prevKey,
234.38 - mSigProvider, mStores, reasonsMask, mAnchor));
234.39 + mSigProvider, mStores, reasonsMask, trustAnchors));
234.40 } catch (Exception e) {
234.41 if (debug != null) {
234.42 debug.println("CrlRevocationChecker.verifyRevocationStatus() "
234.43 @@ -328,7 +329,7 @@
234.44 // Now that we have a list of possible CRLs, see which ones can
234.45 // be approved
234.46 mApprovedCRLs.addAll(verifyPossibleCRLs(mPossibleCRLs, currCert,
234.47 - signFlag, prevKey, reasonsMask));
234.48 + signFlag, prevKey, reasonsMask, trustAnchors));
234.49 }
234.50 if (debug != null) {
234.51 debug.println("CrlRevocationChecker.verifyRevocationStatus() " +
234.52 @@ -353,9 +354,10 @@
234.53 // See if the cert is in the set of approved crls.
234.54 if (debug != null) {
234.55 BigInteger sn = currCert.getSerialNumber();
234.56 - debug.println("starting the final sweep...");
234.57 + debug.println("CrlRevocationChecker.verifyRevocationStatus() " +
234.58 + "starting the final sweep...");
234.59 debug.println("CrlRevocationChecker.verifyRevocationStatus" +
234.60 - " cert SN: " + sn.toString());
234.61 + " cert SN: " + sn.toString());
234.62 }
234.63
234.64 CRLReason reasonCode = CRLReason.UNSPECIFIED;
234.65 @@ -497,9 +499,9 @@
234.66 certSel.setSubject(currCert.getIssuerX500Principal());
234.67 certSel.setKeyUsage(mCrlSignUsage);
234.68
234.69 - Set<TrustAnchor> newAnchors = mAnchor == null
234.70 - ? mParams.getTrustAnchors()
234.71 - : Collections.singleton(mAnchor);
234.72 + Set<TrustAnchor> newAnchors =
234.73 + (mAnchor == null ? mParams.getTrustAnchors() :
234.74 + Collections.singleton(mAnchor));
234.75
234.76 PKIXBuilderParameters builderParams;
234.77 if (mParams instanceof PKIXBuilderParameters) {
234.78 @@ -617,8 +619,8 @@
234.79 debug.println("CrlRevocationChecker.buildToNewKey()"
234.80 + " index " + i + " checking " + cert);
234.81 }
234.82 - verifyRevocationStatus(cert, prevKey2, signFlag,
234.83 - true, stackedCerts);
234.84 + verifyRevocationStatus(cert, prevKey2, signFlag, true,
234.85 + stackedCerts, newAnchors);
234.86 signFlag = certCanSignCrl(cert);
234.87 prevKey2 = cert.getPublicKey();
234.88 }
234.89 @@ -727,12 +729,14 @@
234.90 * @param signFlag <code>true</code> if prevKey was trusted to sign CRLs
234.91 * @param prevKey the public key of the issuer of cert
234.92 * @param reasonsMask the reason code mask
234.93 + * @param trustAnchors a <code>Set</code> of <code>TrustAnchor</code>s>
234.94 * @return a collection of approved crls (or an empty collection)
234.95 */
234.96 private Collection<X509CRL> verifyPossibleCRLs(Set<X509CRL> crls,
234.97 X509Certificate cert, boolean signFlag, PublicKey prevKey,
234.98 - boolean[] reasonsMask) throws CertPathValidatorException
234.99 - {
234.100 + boolean[] reasonsMask,
234.101 + Set<TrustAnchor> trustAnchors) throws CertPathValidatorException {
234.102 +
234.103 try {
234.104 X509CertImpl certImpl = X509CertImpl.toImpl(cert);
234.105 if (debug != null) {
234.106 @@ -764,7 +768,8 @@
234.107 DistributionPoint point = t.next();
234.108 for (X509CRL crl : crls) {
234.109 if (dpf.verifyCRL(certImpl, point, crl, reasonsMask,
234.110 - signFlag, prevKey, mSigProvider, mAnchor, mStores)) {
234.111 + signFlag, prevKey, mSigProvider,
234.112 + trustAnchors, mStores)) {
234.113 results.add(crl);
234.114 }
234.115 }
235.1 --- a/src/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java Tue Apr 19 16:01:27 2011 -0700
235.2 +++ b/src/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java Tue Apr 26 15:48:03 2011 -0700
235.3 @@ -90,8 +90,9 @@
235.4 */
235.5 Collection<X509CRL> getCRLs(X509CRLSelector selector, boolean signFlag,
235.6 PublicKey prevKey, String provider, List<CertStore> certStores,
235.7 - boolean[] reasonsMask, TrustAnchor anchor) throws CertStoreException
235.8 - {
235.9 + boolean[] reasonsMask,
235.10 + Set<TrustAnchor> trustAnchors) throws CertStoreException {
235.11 +
235.12 if (USE_CRLDP == false) {
235.13 return Collections.emptySet();
235.14 }
235.15 @@ -121,7 +122,7 @@
235.16 DistributionPoint point = t.next();
235.17 Collection<X509CRL> crls = getCRLs(selector, certImpl,
235.18 point, reasonsMask, signFlag, prevKey, provider,
235.19 - certStores, anchor);
235.20 + certStores, trustAnchors);
235.21 results.addAll(crls);
235.22 }
235.23 if (debug != null) {
235.24 @@ -142,8 +143,8 @@
235.25 private Collection<X509CRL> getCRLs(X509CRLSelector selector,
235.26 X509CertImpl certImpl, DistributionPoint point, boolean[] reasonsMask,
235.27 boolean signFlag, PublicKey prevKey, String provider,
235.28 - List<CertStore> certStores, TrustAnchor anchor)
235.29 - {
235.30 + List<CertStore> certStores, Set<TrustAnchor> trustAnchors) {
235.31 +
235.32 // check for full name
235.33 GeneralNames fullName = point.getFullName();
235.34 if (fullName == null) {
235.35 @@ -194,7 +195,7 @@
235.36 // we check the issuer in verifyCRLs method
235.37 selector.setIssuerNames(null);
235.38 if (selector.match(crl) && verifyCRL(certImpl, point, crl,
235.39 - reasonsMask, signFlag, prevKey, provider, anchor,
235.40 + reasonsMask, signFlag, prevKey, provider, trustAnchors,
235.41 certStores)) {
235.42 crls.add(crl);
235.43 }
235.44 @@ -276,12 +277,17 @@
235.45 * @param signFlag true if prevKey can be used to verify the CRL
235.46 * @param prevKey the public key that verifies the certificate's signature
235.47 * @param provider the Signature provider to use
235.48 + * @param trustAnchors a {@code Set} of {@code TrustAnchor}s
235.49 + * @param certStores a {@code List} of {@code CertStore}s to be used in
235.50 + * finding certificates and CRLs
235.51 * @return true if ok, false if not
235.52 */
235.53 boolean verifyCRL(X509CertImpl certImpl, DistributionPoint point,
235.54 X509CRL crl, boolean[] reasonsMask, boolean signFlag,
235.55 - PublicKey prevKey, String provider, TrustAnchor anchor,
235.56 + PublicKey prevKey, String provider,
235.57 + Set<TrustAnchor> trustAnchors,
235.58 List<CertStore> certStores) throws CRLException, IOException {
235.59 +
235.60 boolean indirectCRL = false;
235.61 X509CRLImpl crlImpl = X509CRLImpl.toImpl(crl);
235.62 IssuingDistributionPointExtension idpExt =
235.63 @@ -335,7 +341,16 @@
235.64 byte[] crlAKID = crlImpl.getExtensionValue(
235.65 PKIXExtensions.AuthorityKey_Id.toString());
235.66
235.67 - if (!Arrays.equals(certAKID, crlAKID)) {
235.68 + if (certAKID == null || crlAKID == null) {
235.69 + // cannot recognize indirect CRL without AKID
235.70 +
235.71 + // we accept the case that a CRL issuer provide status
235.72 + // information for itself.
235.73 + if (issues(certImpl, crlImpl, provider)) {
235.74 + // reset the public key used to verify the CRL's signature
235.75 + prevKey = certImpl.getPublicKey();
235.76 + }
235.77 + } else if (!Arrays.equals(certAKID, crlAKID)) {
235.78 // we accept the case that a CRL issuer provide status
235.79 // information for itself.
235.80 if (issues(certImpl, crlImpl, provider)) {
235.81 @@ -572,46 +587,19 @@
235.82 // Except the performance improvement, another benefit is to break
235.83 // the dead loop while looking for the issuer back and forth
235.84 // between the delegated self-issued certificate and its issuer.
235.85 - Set<TrustAnchor> trustAnchors = new HashSet<TrustAnchor>();
235.86 - if (anchor != null) {
235.87 - trustAnchors.add(anchor);
235.88 - }
235.89 + Set<TrustAnchor> newTrustAnchors = new HashSet<>(trustAnchors);
235.90
235.91 if (prevKey != null) {
235.92 - // if the previous key is of the anchor, don't bother to
235.93 - // duplicate the trust.
235.94 - boolean duplicated = false;
235.95 - PublicKey publicKey = prevKey;
235.96 + // Add the previous certificate as a trust anchor.
235.97 X500Principal principal = certImpl.getIssuerX500Principal();
235.98 -
235.99 - if (anchor != null) {
235.100 - X509Certificate trustedCert = anchor.getTrustedCert();
235.101 - X500Principal trustedPrincipal;
235.102 - PublicKey trustedPublicKey;
235.103 - if (trustedCert != null) {
235.104 - trustedPrincipal = trustedCert.getSubjectX500Principal();
235.105 - trustedPublicKey = trustedCert.getPublicKey();
235.106 - } else {
235.107 - trustedPrincipal = anchor.getCA();
235.108 - trustedPublicKey = anchor.getCAPublicKey();
235.109 - }
235.110 -
235.111 - if (principal.equals(trustedPrincipal) &&
235.112 - publicKey.equals(trustedPublicKey)) {
235.113 - duplicated = true;
235.114 - }
235.115 - }
235.116 -
235.117 - if (!duplicated) {
235.118 - TrustAnchor temporary =
235.119 - new TrustAnchor(principal, publicKey, null);
235.120 - trustAnchors.add(temporary);
235.121 - }
235.122 + TrustAnchor temporary =
235.123 + new TrustAnchor(principal, prevKey, null);
235.124 + newTrustAnchors.add(temporary);
235.125 }
235.126
235.127 PKIXBuilderParameters params = null;
235.128 try {
235.129 - params = new PKIXBuilderParameters(trustAnchors, certSel);
235.130 + params = new PKIXBuilderParameters(newTrustAnchors, certSel);
235.131 } catch (InvalidAlgorithmParameterException iape) {
235.132 throw new CRLException(iape);
235.133 }
235.134 @@ -697,6 +685,8 @@
235.135 private static boolean issues(X509CertImpl cert, X509CRLImpl crl,
235.136 String provider) throws IOException {
235.137
235.138 + boolean matched = false;
235.139 +
235.140 AdaptableX509CertSelector issuerSelector =
235.141 new AdaptableX509CertSelector();
235.142
235.143 @@ -719,9 +709,24 @@
235.144 * and MUST include authority key identifier extension in all CRLs
235.145 * issued. [section 5.2.1, RFC 2459]
235.146 */
235.147 - issuerSelector.parseAuthorityKeyIdentifierExtension(
235.148 - crl.getAuthKeyIdExtension());
235.149 + AuthorityKeyIdentifierExtension crlAKID = crl.getAuthKeyIdExtension();
235.150 + if (crlAKID != null) {
235.151 + issuerSelector.parseAuthorityKeyIdentifierExtension(crlAKID);
235.152 + }
235.153
235.154 - return issuerSelector.match(cert);
235.155 + matched = issuerSelector.match(cert);
235.156 +
235.157 + // if AKID is unreliable, verify the CRL signature with the cert
235.158 + if (matched && (crlAKID == null ||
235.159 + cert.getAuthorityKeyIdentifierExtension() == null)) {
235.160 + try {
235.161 + crl.verify(cert.getPublicKey(), provider);
235.162 + matched = true;
235.163 + } catch (Exception e) {
235.164 + matched = false;
235.165 + }
235.166 + }
235.167 +
235.168 + return matched;
235.169 }
235.170 }
236.1 --- a/src/share/classes/sun/security/ssl/CipherSuiteList.java Tue Apr 19 16:01:27 2011 -0700
236.2 +++ b/src/share/classes/sun/security/ssl/CipherSuiteList.java Tue Apr 26 15:48:03 2011 -0700
236.3 @@ -40,10 +40,6 @@
236.4 */
236.5 final class CipherSuiteList {
236.6
236.7 - // lists of supported and default enabled ciphersuites
236.8 - // created on demand
236.9 - private static CipherSuiteList supportedSuites, defaultSuites;
236.10 -
236.11 private final Collection<CipherSuite> cipherSuites;
236.12 private String[] suiteNames;
236.13
236.14 @@ -206,57 +202,8 @@
236.15 */
236.16 static synchronized void clearAvailableCache() {
236.17 if (CipherSuite.DYNAMIC_AVAILABILITY) {
236.18 - supportedSuites = null;
236.19 - defaultSuites = null;
236.20 CipherSuite.BulkCipher.clearAvailableCache();
236.21 JsseJce.clearEcAvailable();
236.22 }
236.23 }
236.24 -
236.25 - /**
236.26 - * Return the list of all available CipherSuites with a priority of
236.27 - * minPriority or above.
236.28 - * Should be called with the Class lock held.
236.29 - */
236.30 - private static CipherSuiteList buildAvailableCache(int minPriority) {
236.31 - // SortedSet automatically arranges ciphersuites in default
236.32 - // preference order
236.33 - Set<CipherSuite> cipherSuites = new TreeSet<>();
236.34 - Collection<CipherSuite> allowedCipherSuites =
236.35 - CipherSuite.allowedCipherSuites();
236.36 - for (CipherSuite c : allowedCipherSuites) {
236.37 - if ((c.allowed == false) || (c.priority < minPriority)) {
236.38 - continue;
236.39 - }
236.40 -
236.41 - if (c.isAvailable()) {
236.42 - cipherSuites.add(c);
236.43 - }
236.44 - }
236.45 -
236.46 - return new CipherSuiteList(cipherSuites);
236.47 - }
236.48 -
236.49 - /**
236.50 - * Return supported CipherSuites in preference order.
236.51 - */
236.52 - static synchronized CipherSuiteList getSupported() {
236.53 - if (supportedSuites == null) {
236.54 - supportedSuites =
236.55 - buildAvailableCache(CipherSuite.SUPPORTED_SUITES_PRIORITY);
236.56 - }
236.57 - return supportedSuites;
236.58 - }
236.59 -
236.60 - /**
236.61 - * Return default enabled CipherSuites in preference order.
236.62 - */
236.63 - static synchronized CipherSuiteList getDefault() {
236.64 - if (defaultSuites == null) {
236.65 - defaultSuites =
236.66 - buildAvailableCache(CipherSuite.DEFAULT_SUITES_PRIORITY);
236.67 - }
236.68 - return defaultSuites;
236.69 - }
236.70 -
236.71 }
237.1 --- a/src/share/classes/sun/security/ssl/DefaultSSLContextImpl.java Tue Apr 19 16:01:27 2011 -0700
237.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
237.3 @@ -1,193 +0,0 @@
237.4 -/*
237.5 - * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
237.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
237.7 - *
237.8 - * This code is free software; you can redistribute it and/or modify it
237.9 - * under the terms of the GNU General Public License version 2 only, as
237.10 - * published by the Free Software Foundation. Oracle designates this
237.11 - * particular file as subject to the "Classpath" exception as provided
237.12 - * by Oracle in the LICENSE file that accompanied this code.
237.13 - *
237.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
237.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
237.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
237.17 - * version 2 for more details (a copy is included in the LICENSE file that
237.18 - * accompanied this code).
237.19 - *
237.20 - * You should have received a copy of the GNU General Public License version
237.21 - * 2 along with this work; if not, write to the Free Software Foundation,
237.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
237.23 - *
237.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
237.25 - * or visit www.oracle.com if you need additional information or have any
237.26 - * questions.
237.27 - */
237.28 -
237.29 -package sun.security.ssl;
237.30 -
237.31 -import java.io.*;
237.32 -import java.util.*;
237.33 -
237.34 -import java.security.*;
237.35 -
237.36 -import javax.net.ssl.*;
237.37 -
237.38 -/**
237.39 - * "Default" SSLContext as returned by SSLContext.getDefault(). It comes
237.40 - * initialized with default KeyManagers and TrustManagers created using
237.41 - * various system properties.
237.42 - *
237.43 - * @since 1.6
237.44 - */
237.45 -public final class DefaultSSLContextImpl extends SSLContextImpl {
237.46 -
237.47 - private static final String NONE = "NONE";
237.48 - private static final String P11KEYSTORE = "PKCS11";
237.49 - private static final Debug debug = Debug.getInstance("ssl");
237.50 -
237.51 - private static volatile SSLContextImpl defaultImpl;
237.52 -
237.53 - private static TrustManager[] defaultTrustManagers;
237.54 -
237.55 - private static KeyManager[] defaultKeyManagers;
237.56 -
237.57 - public DefaultSSLContextImpl() throws Exception {
237.58 - super(defaultImpl);
237.59 - try {
237.60 - super.engineInit(getDefaultKeyManager(), getDefaultTrustManager(), null);
237.61 - } catch (Exception e) {
237.62 - if (debug != null && Debug.isOn("defaultctx")) {
237.63 - System.out.println("default context init failed: " + e);
237.64 - }
237.65 - throw e;
237.66 - }
237.67 - if (defaultImpl == null) {
237.68 - defaultImpl = this;
237.69 - }
237.70 - }
237.71 -
237.72 - protected void engineInit(KeyManager[] km, TrustManager[] tm,
237.73 - SecureRandom sr) throws KeyManagementException {
237.74 - throw new KeyManagementException
237.75 - ("Default SSLContext is initialized automatically");
237.76 - }
237.77 -
237.78 - static synchronized SSLContextImpl getDefaultImpl() throws Exception {
237.79 - if (defaultImpl == null) {
237.80 - new DefaultSSLContextImpl();
237.81 - }
237.82 - return defaultImpl;
237.83 - }
237.84 -
237.85 - private static synchronized TrustManager[] getDefaultTrustManager() throws Exception {
237.86 - if (defaultTrustManagers != null) {
237.87 - return defaultTrustManagers;
237.88 - }
237.89 -
237.90 - KeyStore ks = TrustManagerFactoryImpl.getCacertsKeyStore("defaultctx");
237.91 -
237.92 - TrustManagerFactory tmf = TrustManagerFactory.getInstance(
237.93 - TrustManagerFactory.getDefaultAlgorithm());
237.94 - tmf.init(ks);
237.95 - defaultTrustManagers = tmf.getTrustManagers();
237.96 - return defaultTrustManagers;
237.97 - }
237.98 -
237.99 - private static synchronized KeyManager[] getDefaultKeyManager() throws Exception {
237.100 - if (defaultKeyManagers != null) {
237.101 - return defaultKeyManagers;
237.102 - }
237.103 -
237.104 - final Map<String,String> props = new HashMap<>();
237.105 - AccessController.doPrivileged(
237.106 - new PrivilegedExceptionAction<Object>() {
237.107 - public Object run() throws Exception {
237.108 - props.put("keyStore", System.getProperty(
237.109 - "javax.net.ssl.keyStore", ""));
237.110 - props.put("keyStoreType", System.getProperty(
237.111 - "javax.net.ssl.keyStoreType",
237.112 - KeyStore.getDefaultType()));
237.113 - props.put("keyStoreProvider", System.getProperty(
237.114 - "javax.net.ssl.keyStoreProvider", ""));
237.115 - props.put("keyStorePasswd", System.getProperty(
237.116 - "javax.net.ssl.keyStorePassword", ""));
237.117 - return null;
237.118 - }
237.119 - });
237.120 -
237.121 - final String defaultKeyStore = props.get("keyStore");
237.122 - String defaultKeyStoreType = props.get("keyStoreType");
237.123 - String defaultKeyStoreProvider = props.get("keyStoreProvider");
237.124 - if (debug != null && Debug.isOn("defaultctx")) {
237.125 - System.out.println("keyStore is : " + defaultKeyStore);
237.126 - System.out.println("keyStore type is : " +
237.127 - defaultKeyStoreType);
237.128 - System.out.println("keyStore provider is : " +
237.129 - defaultKeyStoreProvider);
237.130 - }
237.131 -
237.132 - if (P11KEYSTORE.equals(defaultKeyStoreType) &&
237.133 - !NONE.equals(defaultKeyStore)) {
237.134 - throw new IllegalArgumentException("if keyStoreType is "
237.135 - + P11KEYSTORE + ", then keyStore must be " + NONE);
237.136 - }
237.137 -
237.138 - FileInputStream fs = null;
237.139 - if (defaultKeyStore.length() != 0 && !NONE.equals(defaultKeyStore)) {
237.140 - fs = AccessController.doPrivileged(
237.141 - new PrivilegedExceptionAction<FileInputStream>() {
237.142 - public FileInputStream run() throws Exception {
237.143 - return new FileInputStream(defaultKeyStore);
237.144 - }
237.145 - });
237.146 - }
237.147 -
237.148 - String defaultKeyStorePassword = props.get("keyStorePasswd");
237.149 - char[] passwd = null;
237.150 - if (defaultKeyStorePassword.length() != 0) {
237.151 - passwd = defaultKeyStorePassword.toCharArray();
237.152 - }
237.153 -
237.154 - /**
237.155 - * Try to initialize key store.
237.156 - */
237.157 - KeyStore ks = null;
237.158 - if ((defaultKeyStoreType.length()) != 0) {
237.159 - if (debug != null && Debug.isOn("defaultctx")) {
237.160 - System.out.println("init keystore");
237.161 - }
237.162 - if (defaultKeyStoreProvider.length() == 0) {
237.163 - ks = KeyStore.getInstance(defaultKeyStoreType);
237.164 - } else {
237.165 - ks = KeyStore.getInstance(defaultKeyStoreType,
237.166 - defaultKeyStoreProvider);
237.167 - }
237.168 -
237.169 - // if defaultKeyStore is NONE, fs will be null
237.170 - ks.load(fs, passwd);
237.171 - }
237.172 - if (fs != null) {
237.173 - fs.close();
237.174 - fs = null;
237.175 - }
237.176 -
237.177 - /*
237.178 - * Try to initialize key manager.
237.179 - */
237.180 - if (debug != null && Debug.isOn("defaultctx")) {
237.181 - System.out.println("init keymanager of type " +
237.182 - KeyManagerFactory.getDefaultAlgorithm());
237.183 - }
237.184 - KeyManagerFactory kmf = KeyManagerFactory.getInstance(
237.185 - KeyManagerFactory.getDefaultAlgorithm());
237.186 -
237.187 - if (P11KEYSTORE.equals(defaultKeyStoreType)) {
237.188 - kmf.init(ks, null); // do not pass key passwd if using token
237.189 - } else {
237.190 - kmf.init(ks, passwd);
237.191 - }
237.192 -
237.193 - defaultKeyManagers = kmf.getKeyManagers();
237.194 - return defaultKeyManagers;
237.195 - }
237.196 -}
238.1 --- a/src/share/classes/sun/security/ssl/JsseJce.java Tue Apr 19 16:01:27 2011 -0700
238.2 +++ b/src/share/classes/sun/security/ssl/JsseJce.java Tue Apr 26 15:48:03 2011 -0700
238.3 @@ -1,5 +1,5 @@
238.4 /*
238.5 - * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved.
238.6 + * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
238.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
238.8 *
238.9 * This code is free software; you can redistribute it and/or modify it
238.10 @@ -247,9 +247,9 @@
238.11 // the SunJSSE implementation does the actual crypto using
238.12 // a NONEwithRSA signature obtained from the cryptoProvider.
238.13 if (cryptoProvider.getService("Signature", algorithm) == null) {
238.14 - // Calling Signature.getInstance() and catching the exception
238.15 - // would be cleaner, but exceptions are a little expensive.
238.16 - // So we check directly via getService().
238.17 + // Calling Signature.getInstance() and catching the
238.18 + // exception would be cleaner, but exceptions are a little
238.19 + // expensive. So we check directly via getService().
238.20 try {
238.21 return Signature.getInstance(algorithm, "SunJSSE");
238.22 } catch (NoSuchProviderException e) {
239.1 --- a/src/share/classes/sun/security/ssl/ProtocolList.java Tue Apr 19 16:01:27 2011 -0700
239.2 +++ b/src/share/classes/sun/security/ssl/ProtocolList.java Tue Apr 26 15:48:03 2011 -0700
239.3 @@ -37,10 +37,6 @@
239.4 */
239.5 final class ProtocolList {
239.6
239.7 - private static final ProtocolList SUPPORTED;
239.8 - private static final ProtocolList CLIENT_DEFAULT;
239.9 - private static final ProtocolList SERVER_DEFAULT;
239.10 -
239.11 // the sorted protocol version list
239.12 private final ArrayList<ProtocolVersion> protocols;
239.13
239.14 @@ -154,66 +150,4 @@
239.15 public String toString() {
239.16 return protocols.toString();
239.17 }
239.18 -
239.19 - /**
239.20 - * Return the list of default enabled protocols.
239.21 - */
239.22 - static ProtocolList getDefault(boolean isServer) {
239.23 - return isServer ? SERVER_DEFAULT : CLIENT_DEFAULT;
239.24 - }
239.25 -
239.26 - /**
239.27 - * Return whether a protocol list is the original default enabled
239.28 - * protocols. See: SSLSocket/SSLEngine.setEnabledProtocols()
239.29 - */
239.30 - static boolean isDefaultProtocolList(ProtocolList protocols) {
239.31 - return protocols == CLIENT_DEFAULT || protocols == SERVER_DEFAULT;
239.32 - }
239.33 -
239.34 - /**
239.35 - * Return the list of supported protocols.
239.36 - */
239.37 - static ProtocolList getSupported() {
239.38 - return SUPPORTED;
239.39 - }
239.40 -
239.41 - static {
239.42 - if (SunJSSE.isFIPS()) {
239.43 - SUPPORTED = new ProtocolList(new String[] {
239.44 - ProtocolVersion.TLS10.name,
239.45 - ProtocolVersion.TLS11.name,
239.46 - ProtocolVersion.TLS12.name
239.47 - });
239.48 -
239.49 - SERVER_DEFAULT = SUPPORTED;
239.50 - CLIENT_DEFAULT = new ProtocolList(new String[] {
239.51 - ProtocolVersion.TLS10.name
239.52 - });
239.53 - } else {
239.54 - SUPPORTED = new ProtocolList(new String[] {
239.55 - ProtocolVersion.SSL20Hello.name,
239.56 - ProtocolVersion.SSL30.name,
239.57 - ProtocolVersion.TLS10.name,
239.58 - ProtocolVersion.TLS11.name,
239.59 - ProtocolVersion.TLS12.name
239.60 - });
239.61 -
239.62 - SERVER_DEFAULT = SUPPORTED;
239.63 -
239.64 - /*
239.65 - * RFC 5246 says that sending SSLv2 backward-compatible
239.66 - * hello SHOULD NOT be done any longer.
239.67 - *
239.68 - * We are not enabling TLS 1.1/1.2 by default yet on clients
239.69 - * out of concern for interop with existing
239.70 - * SSLv3/TLS1.0-only servers. When these versions of TLS
239.71 - * gain more traction, we'll enable them.
239.72 - */
239.73 - CLIENT_DEFAULT = new ProtocolList(new String[] {
239.74 - ProtocolVersion.SSL30.name,
239.75 - ProtocolVersion.TLS10.name
239.76 - });
239.77 - }
239.78 - }
239.79 -
239.80 }
240.1 --- a/src/share/classes/sun/security/ssl/SSLContextImpl.java Tue Apr 19 16:01:27 2011 -0700
240.2 +++ b/src/share/classes/sun/security/ssl/SSLContextImpl.java Tue Apr 26 15:48:03 2011 -0700
240.3 @@ -1,5 +1,5 @@
240.4 /*
240.5 - * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
240.6 + * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
240.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
240.8 *
240.9 * This code is free software; you can redistribute it and/or modify it
240.10 @@ -27,6 +27,7 @@
240.11
240.12 import java.net.Socket;
240.13
240.14 +import java.io.*;
240.15 import java.util.*;
240.16 import java.security.*;
240.17 import java.security.cert.*;
240.18 @@ -36,7 +37,7 @@
240.19
240.20 import sun.security.provider.certpath.AlgorithmChecker;
240.21
240.22 -public class SSLContextImpl extends SSLContextSpi {
240.23 +public abstract class SSLContextImpl extends SSLContextSpi {
240.24
240.25 private static final Debug debug = Debug.getInstance("ssl");
240.26
240.27 @@ -50,20 +51,24 @@
240.28 private X509TrustManager trustManager;
240.29 private SecureRandom secureRandom;
240.30
240.31 - public SSLContextImpl() {
240.32 - this(null);
240.33 - }
240.34 + // The default algrithm constraints
240.35 + private AlgorithmConstraints defaultAlgorithmConstraints =
240.36 + new SSLAlgorithmConstraints(null);
240.37
240.38 - SSLContextImpl(SSLContextImpl other) {
240.39 - if (other == null) {
240.40 - ephemeralKeyManager = new EphemeralKeyManager();
240.41 - clientCache = new SSLSessionContextImpl();
240.42 - serverCache = new SSLSessionContextImpl();
240.43 - } else {
240.44 - ephemeralKeyManager = other.ephemeralKeyManager;
240.45 - clientCache = other.clientCache;
240.46 - serverCache = other.serverCache;
240.47 - }
240.48 + // supported and default protocols
240.49 + private ProtocolList defaultServerProtocolList;
240.50 + private ProtocolList defaultClientProtocolList;
240.51 + private ProtocolList supportedProtocolList;
240.52 +
240.53 + // supported and default cipher suites
240.54 + private CipherSuiteList defaultServerCipherSuiteList;
240.55 + private CipherSuiteList defaultClientCipherSuiteList;
240.56 + private CipherSuiteList supportedCipherSuiteList;
240.57 +
240.58 + SSLContextImpl() {
240.59 + ephemeralKeyManager = new EphemeralKeyManager();
240.60 + clientCache = new SSLSessionContextImpl();
240.61 + serverCache = new SSLSessionContextImpl();
240.62 }
240.63
240.64 protected void engineInit(KeyManager[] km, TrustManager[] tm,
240.65 @@ -177,7 +182,7 @@
240.66 throw new IllegalStateException(
240.67 "SSLContextImpl is not initialized");
240.68 }
240.69 - return new SSLSocketFactoryImpl(this);
240.70 + return new SSLSocketFactoryImpl(this);
240.71 }
240.72
240.73 protected SSLServerSocketFactory engineGetServerSocketFactory() {
240.74 @@ -227,6 +232,535 @@
240.75 return ephemeralKeyManager;
240.76 }
240.77
240.78 + abstract SSLParameters getDefaultServerSSLParams();
240.79 + abstract SSLParameters getDefaultClientSSLParams();
240.80 + abstract SSLParameters getSupportedSSLParams();
240.81 +
240.82 + // Get suported ProtoclList.
240.83 + ProtocolList getSuportedProtocolList() {
240.84 + if (supportedProtocolList == null) {
240.85 + supportedProtocolList =
240.86 + new ProtocolList(getSupportedSSLParams().getProtocols());
240.87 + }
240.88 +
240.89 + return supportedProtocolList;
240.90 + }
240.91 +
240.92 + // Get default ProtoclList.
240.93 + ProtocolList getDefaultProtocolList(boolean roleIsServer) {
240.94 + if (roleIsServer) {
240.95 + if (defaultServerProtocolList == null) {
240.96 + defaultServerProtocolList = new ProtocolList(
240.97 + getDefaultServerSSLParams().getProtocols());
240.98 + }
240.99 +
240.100 + return defaultServerProtocolList;
240.101 + } else {
240.102 + if (defaultClientProtocolList == null) {
240.103 + defaultClientProtocolList = new ProtocolList(
240.104 + getDefaultClientSSLParams().getProtocols());
240.105 + }
240.106 +
240.107 + return defaultClientProtocolList;
240.108 + }
240.109 + }
240.110 +
240.111 + // Get suported CipherSuiteList.
240.112 + CipherSuiteList getSuportedCipherSuiteList() {
240.113 + // Clear cache of available ciphersuites.
240.114 + clearAvailableCache();
240.115 +
240.116 + if (supportedCipherSuiteList == null) {
240.117 + supportedCipherSuiteList =
240.118 + getApplicableCipherSuiteList(getSuportedProtocolList(), false);
240.119 + }
240.120 +
240.121 + return supportedCipherSuiteList;
240.122 + }
240.123 +
240.124 + // Get default CipherSuiteList.
240.125 + CipherSuiteList getDefaultCipherSuiteList(boolean roleIsServer) {
240.126 + // Clear cache of available ciphersuites.
240.127 + clearAvailableCache();
240.128 +
240.129 + if (roleIsServer) {
240.130 + if (defaultServerCipherSuiteList == null) {
240.131 + defaultServerCipherSuiteList = getApplicableCipherSuiteList(
240.132 + getDefaultProtocolList(true), true);
240.133 + }
240.134 +
240.135 + return defaultServerCipherSuiteList;
240.136 + } else {
240.137 + if (defaultClientCipherSuiteList == null) {
240.138 + defaultClientCipherSuiteList = getApplicableCipherSuiteList(
240.139 + getDefaultProtocolList(false), true);
240.140 + }
240.141 +
240.142 + return defaultClientCipherSuiteList;
240.143 + }
240.144 + }
240.145 +
240.146 + /**
240.147 + * Return whether a protocol list is the original default enabled
240.148 + * protocols. See: SSLSocket/SSLEngine.setEnabledProtocols()
240.149 + */
240.150 + boolean isDefaultProtocolList(ProtocolList protocols) {
240.151 + return (protocols == defaultServerProtocolList) ||
240.152 + (protocols == defaultClientProtocolList);
240.153 + }
240.154 +
240.155 +
240.156 + /*
240.157 + * Return the list of all available CipherSuites with a priority of
240.158 + * minPriority or above.
240.159 + */
240.160 + private CipherSuiteList getApplicableCipherSuiteList(
240.161 + ProtocolList protocols, boolean onlyEnabled) {
240.162 +
240.163 + int minPriority = CipherSuite.SUPPORTED_SUITES_PRIORITY;
240.164 + if (onlyEnabled) {
240.165 + minPriority = CipherSuite.DEFAULT_SUITES_PRIORITY;
240.166 + }
240.167 +
240.168 + Collection<CipherSuite> allowedCipherSuites =
240.169 + CipherSuite.allowedCipherSuites();
240.170 +
240.171 + ArrayList<CipherSuite> suites = new ArrayList<>();
240.172 + if (!(protocols.collection().isEmpty()) &&
240.173 + protocols.min.v != ProtocolVersion.NONE.v) {
240.174 + for (CipherSuite suite : allowedCipherSuites) {
240.175 + if (suite.allowed == false || suite.priority < minPriority) {
240.176 + continue;
240.177 + }
240.178 +
240.179 + if (suite.isAvailable() &&
240.180 + suite.obsoleted > protocols.min.v &&
240.181 + suite.supported <= protocols.max.v) {
240.182 + if (defaultAlgorithmConstraints.permits(
240.183 + EnumSet.of(CryptoPrimitive.KEY_AGREEMENT),
240.184 + suite.name, null)) {
240.185 + suites.add(suite);
240.186 + }
240.187 + } else if (debug != null &&
240.188 + Debug.isOn("sslctx") && Debug.isOn("verbose")) {
240.189 + if (suite.obsoleted <= protocols.min.v) {
240.190 + System.out.println(
240.191 + "Ignoring obsoleted cipher suite: " + suite);
240.192 + } else if (suite.supported > protocols.max.v) {
240.193 + System.out.println(
240.194 + "Ignoring unsupported cipher suite: " + suite);
240.195 + } else {
240.196 + System.out.println(
240.197 + "Ignoring unavailable cipher suite: " + suite);
240.198 + }
240.199 + }
240.200 + }
240.201 + }
240.202 +
240.203 + return new CipherSuiteList(suites);
240.204 + }
240.205 +
240.206 + /**
240.207 + * Clear cache of available ciphersuites. If we support all ciphers
240.208 + * internally, there is no need to clear the cache and calling this
240.209 + * method has no effect.
240.210 + */
240.211 + synchronized void clearAvailableCache() {
240.212 + if (CipherSuite.DYNAMIC_AVAILABILITY) {
240.213 + supportedCipherSuiteList = null;
240.214 + defaultServerCipherSuiteList = null;
240.215 + defaultClientCipherSuiteList = null;
240.216 + CipherSuite.BulkCipher.clearAvailableCache();
240.217 + JsseJce.clearEcAvailable();
240.218 + }
240.219 + }
240.220 +
240.221 + /*
240.222 + * The SSLContext implementation for TLS/SSL algorithm
240.223 + *
240.224 + * SSL/TLS protocols specify the forward compatibility and version
240.225 + * roll-back attack protections, however, a number of SSL/TLS server
240.226 + * vendors did not implement these aspects properly, and some current
240.227 + * SSL/TLS servers may refuse to talk to a TLS 1.1 or later client.
240.228 + *
240.229 + * Considering above interoperability issues, SunJSSE will not set
240.230 + * TLS 1.1 and TLS 1.2 as the enabled protocols for client by default.
240.231 + *
240.232 + * For SSL/TLS servers, there is no such interoperability issues as
240.233 + * SSL/TLS clients. In SunJSSE, TLS 1.1 or later version will be the
240.234 + * enabled protocols for server by default.
240.235 + *
240.236 + * We may change the behavior when popular TLS/SSL vendors support TLS
240.237 + * forward compatibility properly.
240.238 + *
240.239 + * SSLv2Hello is no longer necessary. This interoperability option was
240.240 + * put in place in the late 90's when SSLv3/TLS1.0 were relatively new
240.241 + * and there were a fair number of SSLv2-only servers deployed. Because
240.242 + * of the security issues in SSLv2, it is rarely (if ever) used, as
240.243 + * deployments should now be using SSLv3 and TLSv1.
240.244 + *
240.245 + * Considering the issues of SSLv2Hello, we should not enable SSLv2Hello
240.246 + * by default. Applications still can use it by enabling SSLv2Hello with
240.247 + * the series of setEnabledProtocols APIs.
240.248 + */
240.249 +
240.250 + /*
240.251 + * The conservative SSLContext implementation for TLS, SSL, SSLv3 and
240.252 + * TLS10 algorithm.
240.253 + *
240.254 + * This is a super class of DefaultSSLContext and TLS10Context.
240.255 + *
240.256 + * @see SSLContext
240.257 + */
240.258 + private static class ConservativeSSLContext extends SSLContextImpl {
240.259 + // parameters
240.260 + private static SSLParameters defaultServerSSLParams;
240.261 + private static SSLParameters defaultClientSSLParams;
240.262 + private static SSLParameters supportedSSLParams;
240.263 +
240.264 + static {
240.265 + if (SunJSSE.isFIPS()) {
240.266 + supportedSSLParams = new SSLParameters();
240.267 + supportedSSLParams.setProtocols(new String[] {
240.268 + ProtocolVersion.TLS10.name,
240.269 + ProtocolVersion.TLS11.name,
240.270 + ProtocolVersion.TLS12.name
240.271 + });
240.272 +
240.273 + defaultServerSSLParams = supportedSSLParams;
240.274 +
240.275 + defaultClientSSLParams = new SSLParameters();
240.276 + defaultClientSSLParams.setProtocols(new String[] {
240.277 + ProtocolVersion.TLS10.name
240.278 + });
240.279 +
240.280 + } else {
240.281 + supportedSSLParams = new SSLParameters();
240.282 + supportedSSLParams.setProtocols(new String[] {
240.283 + ProtocolVersion.SSL20Hello.name,
240.284 + ProtocolVersion.SSL30.name,
240.285 + ProtocolVersion.TLS10.name,
240.286 + ProtocolVersion.TLS11.name,
240.287 + ProtocolVersion.TLS12.name
240.288 + });
240.289 +
240.290 + defaultServerSSLParams = supportedSSLParams;
240.291 +
240.292 + defaultClientSSLParams = new SSLParameters();
240.293 + defaultClientSSLParams.setProtocols(new String[] {
240.294 + ProtocolVersion.SSL30.name,
240.295 + ProtocolVersion.TLS10.name
240.296 + });
240.297 + }
240.298 + }
240.299 +
240.300 + SSLParameters getDefaultServerSSLParams() {
240.301 + return defaultServerSSLParams;
240.302 + }
240.303 +
240.304 + SSLParameters getDefaultClientSSLParams() {
240.305 + return defaultClientSSLParams;
240.306 + }
240.307 +
240.308 + SSLParameters getSupportedSSLParams() {
240.309 + return supportedSSLParams;
240.310 + }
240.311 + }
240.312 +
240.313 + /*
240.314 + * The SSLContext implementation for default algorithm
240.315 + *
240.316 + * @see SSLContext
240.317 + */
240.318 + public static final class DefaultSSLContext extends ConservativeSSLContext {
240.319 + private static final String NONE = "NONE";
240.320 + private static final String P11KEYSTORE = "PKCS11";
240.321 +
240.322 + private static volatile SSLContextImpl defaultImpl;
240.323 +
240.324 + private static TrustManager[] defaultTrustManagers;
240.325 + private static KeyManager[] defaultKeyManagers;
240.326 +
240.327 + public DefaultSSLContext() throws Exception {
240.328 + try {
240.329 + super.engineInit(getDefaultKeyManager(),
240.330 + getDefaultTrustManager(), null);
240.331 + } catch (Exception e) {
240.332 + if (debug != null && Debug.isOn("defaultctx")) {
240.333 + System.out.println("default context init failed: " + e);
240.334 + }
240.335 + throw e;
240.336 + }
240.337 +
240.338 + if (defaultImpl == null) {
240.339 + defaultImpl = this;
240.340 + }
240.341 + }
240.342 +
240.343 + protected void engineInit(KeyManager[] km, TrustManager[] tm,
240.344 + SecureRandom sr) throws KeyManagementException {
240.345 + throw new KeyManagementException
240.346 + ("Default SSLContext is initialized automatically");
240.347 + }
240.348 +
240.349 + static synchronized SSLContextImpl getDefaultImpl() throws Exception {
240.350 + if (defaultImpl == null) {
240.351 + new DefaultSSLContext();
240.352 + }
240.353 + return defaultImpl;
240.354 + }
240.355 +
240.356 + private static synchronized TrustManager[] getDefaultTrustManager()
240.357 + throws Exception {
240.358 + if (defaultTrustManagers != null) {
240.359 + return defaultTrustManagers;
240.360 + }
240.361 +
240.362 + KeyStore ks =
240.363 + TrustManagerFactoryImpl.getCacertsKeyStore("defaultctx");
240.364 +
240.365 + TrustManagerFactory tmf = TrustManagerFactory.getInstance(
240.366 + TrustManagerFactory.getDefaultAlgorithm());
240.367 + tmf.init(ks);
240.368 + defaultTrustManagers = tmf.getTrustManagers();
240.369 + return defaultTrustManagers;
240.370 + }
240.371 +
240.372 + private static synchronized KeyManager[] getDefaultKeyManager()
240.373 + throws Exception {
240.374 + if (defaultKeyManagers != null) {
240.375 + return defaultKeyManagers;
240.376 + }
240.377 +
240.378 + final Map<String,String> props = new HashMap<>();
240.379 + AccessController.doPrivileged(
240.380 + new PrivilegedExceptionAction<Object>() {
240.381 + public Object run() throws Exception {
240.382 + props.put("keyStore", System.getProperty(
240.383 + "javax.net.ssl.keyStore", ""));
240.384 + props.put("keyStoreType", System.getProperty(
240.385 + "javax.net.ssl.keyStoreType",
240.386 + KeyStore.getDefaultType()));
240.387 + props.put("keyStoreProvider", System.getProperty(
240.388 + "javax.net.ssl.keyStoreProvider", ""));
240.389 + props.put("keyStorePasswd", System.getProperty(
240.390 + "javax.net.ssl.keyStorePassword", ""));
240.391 + return null;
240.392 + }
240.393 + });
240.394 +
240.395 + final String defaultKeyStore = props.get("keyStore");
240.396 + String defaultKeyStoreType = props.get("keyStoreType");
240.397 + String defaultKeyStoreProvider = props.get("keyStoreProvider");
240.398 + if (debug != null && Debug.isOn("defaultctx")) {
240.399 + System.out.println("keyStore is : " + defaultKeyStore);
240.400 + System.out.println("keyStore type is : " +
240.401 + defaultKeyStoreType);
240.402 + System.out.println("keyStore provider is : " +
240.403 + defaultKeyStoreProvider);
240.404 + }
240.405 +
240.406 + if (P11KEYSTORE.equals(defaultKeyStoreType) &&
240.407 + !NONE.equals(defaultKeyStore)) {
240.408 + throw new IllegalArgumentException("if keyStoreType is "
240.409 + + P11KEYSTORE + ", then keyStore must be " + NONE);
240.410 + }
240.411 +
240.412 + FileInputStream fs = null;
240.413 + if (defaultKeyStore.length() != 0 && !NONE.equals(defaultKeyStore)) {
240.414 + fs = AccessController.doPrivileged(
240.415 + new PrivilegedExceptionAction<FileInputStream>() {
240.416 + public FileInputStream run() throws Exception {
240.417 + return new FileInputStream(defaultKeyStore);
240.418 + }
240.419 + });
240.420 + }
240.421 +
240.422 + String defaultKeyStorePassword = props.get("keyStorePasswd");
240.423 + char[] passwd = null;
240.424 + if (defaultKeyStorePassword.length() != 0) {
240.425 + passwd = defaultKeyStorePassword.toCharArray();
240.426 + }
240.427 +
240.428 + /**
240.429 + * Try to initialize key store.
240.430 + */
240.431 + KeyStore ks = null;
240.432 + if ((defaultKeyStoreType.length()) != 0) {
240.433 + if (debug != null && Debug.isOn("defaultctx")) {
240.434 + System.out.println("init keystore");
240.435 + }
240.436 + if (defaultKeyStoreProvider.length() == 0) {
240.437 + ks = KeyStore.getInstance(defaultKeyStoreType);
240.438 + } else {
240.439 + ks = KeyStore.getInstance(defaultKeyStoreType,
240.440 + defaultKeyStoreProvider);
240.441 + }
240.442 +
240.443 + // if defaultKeyStore is NONE, fs will be null
240.444 + ks.load(fs, passwd);
240.445 + }
240.446 + if (fs != null) {
240.447 + fs.close();
240.448 + fs = null;
240.449 + }
240.450 +
240.451 + /*
240.452 + * Try to initialize key manager.
240.453 + */
240.454 + if (debug != null && Debug.isOn("defaultctx")) {
240.455 + System.out.println("init keymanager of type " +
240.456 + KeyManagerFactory.getDefaultAlgorithm());
240.457 + }
240.458 + KeyManagerFactory kmf = KeyManagerFactory.getInstance(
240.459 + KeyManagerFactory.getDefaultAlgorithm());
240.460 +
240.461 + if (P11KEYSTORE.equals(defaultKeyStoreType)) {
240.462 + kmf.init(ks, null); // do not pass key passwd if using token
240.463 + } else {
240.464 + kmf.init(ks, passwd);
240.465 + }
240.466 +
240.467 + defaultKeyManagers = kmf.getKeyManagers();
240.468 + return defaultKeyManagers;
240.469 + }
240.470 + }
240.471 +
240.472 + /*
240.473 + * The SSLContext implementation for TLS, SSL, SSLv3 and TLS10 algorithm
240.474 + *
240.475 + * @see SSLContext
240.476 + */
240.477 + public static final class TLS10Context extends ConservativeSSLContext {
240.478 + // use the default constructor and methods
240.479 + }
240.480 +
240.481 + /*
240.482 + * The SSLContext implementation for TLS11 algorithm
240.483 + *
240.484 + * @see SSLContext
240.485 + */
240.486 + public static final class TLS11Context extends SSLContextImpl {
240.487 + // parameters
240.488 + private static SSLParameters defaultServerSSLParams;
240.489 + private static SSLParameters defaultClientSSLParams;
240.490 + private static SSLParameters supportedSSLParams;
240.491 +
240.492 + static {
240.493 + if (SunJSSE.isFIPS()) {
240.494 + supportedSSLParams = new SSLParameters();
240.495 + supportedSSLParams.setProtocols(new String[] {
240.496 + ProtocolVersion.TLS10.name,
240.497 + ProtocolVersion.TLS11.name,
240.498 + ProtocolVersion.TLS12.name
240.499 + });
240.500 +
240.501 + defaultServerSSLParams = supportedSSLParams;
240.502 +
240.503 + defaultClientSSLParams = new SSLParameters();
240.504 + defaultClientSSLParams.setProtocols(new String[] {
240.505 + ProtocolVersion.TLS10.name,
240.506 + ProtocolVersion.TLS11.name
240.507 + });
240.508 +
240.509 + } else {
240.510 + supportedSSLParams = new SSLParameters();
240.511 + supportedSSLParams.setProtocols(new String[] {
240.512 + ProtocolVersion.SSL20Hello.name,
240.513 + ProtocolVersion.SSL30.name,
240.514 + ProtocolVersion.TLS10.name,
240.515 + ProtocolVersion.TLS11.name,
240.516 + ProtocolVersion.TLS12.name
240.517 + });
240.518 +
240.519 + defaultServerSSLParams = supportedSSLParams;
240.520 +
240.521 + defaultClientSSLParams = new SSLParameters();
240.522 + defaultClientSSLParams.setProtocols(new String[] {
240.523 + ProtocolVersion.SSL30.name,
240.524 + ProtocolVersion.TLS10.name,
240.525 + ProtocolVersion.TLS11.name
240.526 + });
240.527 + }
240.528 + }
240.529 +
240.530 + SSLParameters getDefaultServerSSLParams() {
240.531 + return defaultServerSSLParams;
240.532 + }
240.533 +
240.534 + SSLParameters getDefaultClientSSLParams() {
240.535 + return defaultClientSSLParams;
240.536 + }
240.537 +
240.538 + SSLParameters getSupportedSSLParams() {
240.539 + return supportedSSLParams;
240.540 + }
240.541 + }
240.542 +
240.543 + /*
240.544 + * The SSLContext implementation for TLS12 algorithm
240.545 + *
240.546 + * @see SSLContext
240.547 + */
240.548 + public static final class TLS12Context extends SSLContextImpl {
240.549 + // parameters
240.550 + private static SSLParameters defaultServerSSLParams;
240.551 + private static SSLParameters defaultClientSSLParams;
240.552 + private static SSLParameters supportedSSLParams;
240.553 +
240.554 + static {
240.555 + if (SunJSSE.isFIPS()) {
240.556 + supportedSSLParams = new SSLParameters();
240.557 + supportedSSLParams.setProtocols(new String[] {
240.558 + ProtocolVersion.TLS10.name,
240.559 + ProtocolVersion.TLS11.name,
240.560 + ProtocolVersion.TLS12.name
240.561 + });
240.562 +
240.563 + defaultServerSSLParams = supportedSSLParams;
240.564 +
240.565 + defaultClientSSLParams = new SSLParameters();
240.566 + defaultClientSSLParams.setProtocols(new String[] {
240.567 + ProtocolVersion.TLS10.name,
240.568 + ProtocolVersion.TLS11.name,
240.569 + ProtocolVersion.TLS12.name
240.570 + });
240.571 +
240.572 + } else {
240.573 + supportedSSLParams = new SSLParameters();
240.574 + supportedSSLParams.setProtocols(new String[] {
240.575 + ProtocolVersion.SSL20Hello.name,
240.576 + ProtocolVersion.SSL30.name,
240.577 + ProtocolVersion.TLS10.name,
240.578 + ProtocolVersion.TLS11.name,
240.579 + ProtocolVersion.TLS12.name
240.580 + });
240.581 +
240.582 + defaultServerSSLParams = supportedSSLParams;
240.583 +
240.584 + defaultClientSSLParams = new SSLParameters();
240.585 + defaultClientSSLParams.setProtocols(new String[] {
240.586 + ProtocolVersion.SSL30.name,
240.587 + ProtocolVersion.TLS10.name,
240.588 + ProtocolVersion.TLS11.name,
240.589 + ProtocolVersion.TLS12.name
240.590 + });
240.591 + }
240.592 + }
240.593 +
240.594 + SSLParameters getDefaultServerSSLParams() {
240.595 + return defaultServerSSLParams;
240.596 + }
240.597 +
240.598 + SSLParameters getDefaultClientSSLParams() {
240.599 + return defaultClientSSLParams;
240.600 + }
240.601 +
240.602 + SSLParameters getSupportedSSLParams() {
240.603 + return supportedSSLParams;
240.604 + }
240.605 + }
240.606 +
240.607 }
240.608
240.609
241.1 --- a/src/share/classes/sun/security/ssl/SSLEngineImpl.java Tue Apr 19 16:01:27 2011 -0700
241.2 +++ b/src/share/classes/sun/security/ssl/SSLEngineImpl.java Tue Apr 26 15:48:03 2011 -0700
241.3 @@ -1,5 +1,5 @@
241.4 /*
241.5 - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
241.6 + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
241.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
241.8 *
241.9 * This code is free software; you can redistribute it and/or modify it
241.10 @@ -374,8 +374,10 @@
241.11 clientVerifyData = new byte[0];
241.12 serverVerifyData = new byte[0];
241.13
241.14 - enabledCipherSuites = CipherSuiteList.getDefault();
241.15 - enabledProtocols = ProtocolList.getDefault(roleIsServer);
241.16 + enabledCipherSuites =
241.17 + sslContext.getDefaultCipherSuiteList(roleIsServer);
241.18 + enabledProtocols =
241.19 + sslContext.getDefaultProtocolList(roleIsServer);
241.20
241.21 wrapLock = new Object();
241.22 unwrapLock = new Object();
241.23 @@ -1883,8 +1885,8 @@
241.24 * change them to the corresponding default ones.
241.25 */
241.26 if (roleIsServer != (!flag) &&
241.27 - ProtocolList.isDefaultProtocolList(enabledProtocols)) {
241.28 - enabledProtocols = ProtocolList.getDefault(!flag);
241.29 + sslContext.isDefaultProtocolList(enabledProtocols)) {
241.30 + enabledProtocols = sslContext.getDefaultProtocolList(!flag);
241.31 }
241.32
241.33 roleIsServer = !flag;
241.34 @@ -1907,8 +1909,8 @@
241.35 * change them to the corresponding default ones.
241.36 */
241.37 if (roleIsServer != (!flag) &&
241.38 - ProtocolList.isDefaultProtocolList(enabledProtocols)) {
241.39 - enabledProtocols = ProtocolList.getDefault(!flag);
241.40 + sslContext.isDefaultProtocolList(enabledProtocols)) {
241.41 + enabledProtocols = sslContext.getDefaultProtocolList(!flag);
241.42 }
241.43
241.44 roleIsServer = !flag;
241.45 @@ -1951,8 +1953,7 @@
241.46 * @return an array of cipher suite names
241.47 */
241.48 public String[] getSupportedCipherSuites() {
241.49 - CipherSuiteList.clearAvailableCache();
241.50 - return CipherSuiteList.getSupported().toStringArray();
241.51 + return sslContext.getSuportedCipherSuiteList().toStringArray();
241.52 }
241.53
241.54 /**
241.55 @@ -1992,7 +1993,7 @@
241.56 * @return an array of protocol names.
241.57 */
241.58 public String[] getSupportedProtocols() {
241.59 - return ProtocolList.getSupported().toStringArray();
241.60 + return sslContext.getSuportedProtocolList().toStringArray();
241.61 }
241.62
241.63 /**
242.1 --- a/src/share/classes/sun/security/ssl/SSLServerSocketFactoryImpl.java Tue Apr 19 16:01:27 2011 -0700
242.2 +++ b/src/share/classes/sun/security/ssl/SSLServerSocketFactoryImpl.java Tue Apr 26 15:48:03 2011 -0700
242.3 @@ -1,5 +1,5 @@
242.4 /*
242.5 - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
242.6 + * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
242.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
242.8 *
242.9 * This code is free software; you can redistribute it and/or modify it
242.10 @@ -49,7 +49,7 @@
242.11 * java.security file is set.
242.12 */
242.13 public SSLServerSocketFactoryImpl() throws Exception {
242.14 - this.context = DefaultSSLContextImpl.getDefaultImpl();
242.15 + this.context = SSLContextImpl.DefaultSSLContext.getDefaultImpl();
242.16 }
242.17
242.18 /**
242.19 @@ -99,8 +99,7 @@
242.20 * is encrypted to provide confidentiality.
242.21 */
242.22 public String[] getDefaultCipherSuites() {
242.23 - CipherSuiteList.clearAvailableCache();
242.24 - return CipherSuiteList.getDefault().toStringArray();
242.25 + return context.getDefaultCipherSuiteList(true).toStringArray();
242.26 }
242.27
242.28 /**
242.29 @@ -114,8 +113,7 @@
242.30 * @return an array of cipher suite names
242.31 */
242.32 public String[] getSupportedCipherSuites() {
242.33 - CipherSuiteList.clearAvailableCache();
242.34 - return CipherSuiteList.getSupported().toStringArray();
242.35 + return context.getSuportedCipherSuiteList().toStringArray();
242.36 }
242.37
242.38 }
243.1 --- a/src/share/classes/sun/security/ssl/SSLServerSocketImpl.java Tue Apr 19 16:01:27 2011 -0700
243.2 +++ b/src/share/classes/sun/security/ssl/SSLServerSocketImpl.java Tue Apr 26 15:48:03 2011 -0700
243.3 @@ -1,5 +1,5 @@
243.4 /*
243.5 - * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
243.6 + * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
243.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
243.8 *
243.9 * This code is free software; you can redistribute it and/or modify it
243.10 @@ -153,8 +153,8 @@
243.11 throw new SSLException("No Authentication context given");
243.12 }
243.13 sslContext = context;
243.14 - enabledCipherSuites = CipherSuiteList.getDefault();
243.15 - enabledProtocols = ProtocolList.getDefault(true);
243.16 + enabledCipherSuites = sslContext.getDefaultCipherSuiteList(true);
243.17 + enabledProtocols = sslContext.getDefaultProtocolList(true);
243.18 }
243.19
243.20 /**
243.21 @@ -168,8 +168,7 @@
243.22 * @return an array of cipher suite names
243.23 */
243.24 public String[] getSupportedCipherSuites() {
243.25 - CipherSuiteList.clearAvailableCache();
243.26 - return CipherSuiteList.getSupported().toStringArray();
243.27 + return sslContext.getSuportedCipherSuiteList().toStringArray();
243.28 }
243.29
243.30 /**
243.31 @@ -194,7 +193,7 @@
243.32 }
243.33
243.34 public String[] getSupportedProtocols() {
243.35 - return ProtocolList.getSupported().toStringArray();
243.36 + return sslContext.getSuportedProtocolList().toStringArray();
243.37 }
243.38
243.39 /**
243.40 @@ -253,8 +252,8 @@
243.41 * change them to the corresponding default ones.
243.42 */
243.43 if (useServerMode != (!flag) &&
243.44 - ProtocolList.isDefaultProtocolList(enabledProtocols)) {
243.45 - enabledProtocols = ProtocolList.getDefault(!flag);
243.46 + sslContext.isDefaultProtocolList(enabledProtocols)) {
243.47 + enabledProtocols = sslContext.getDefaultProtocolList(!flag);
243.48 }
243.49
243.50 useServerMode = !flag;
244.1 --- a/src/share/classes/sun/security/ssl/SSLSocketFactoryImpl.java Tue Apr 19 16:01:27 2011 -0700
244.2 +++ b/src/share/classes/sun/security/ssl/SSLSocketFactoryImpl.java Tue Apr 26 15:48:03 2011 -0700
244.3 @@ -1,5 +1,5 @@
244.4 /*
244.5 - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
244.6 + * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
244.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
244.8 *
244.9 * This code is free software; you can redistribute it and/or modify it
244.10 @@ -42,20 +42,18 @@
244.11 *
244.12 * @author David Brownell
244.13 */
244.14 -final
244.15 -public class SSLSocketFactoryImpl extends SSLSocketFactory
244.16 -{
244.17 +final public class SSLSocketFactoryImpl extends SSLSocketFactory {
244.18 +
244.19 private static SSLContextImpl defaultContext;
244.20 private SSLContextImpl context;
244.21
244.22 -
244.23 /**
244.24 * Constructor used to instantiate the default factory. This method is
244.25 * only called if the old "ssl.SocketFactory.provider" property in the
244.26 * java.security file is set.
244.27 */
244.28 public SSLSocketFactoryImpl() throws Exception {
244.29 - this.context = DefaultSSLContextImpl.getDefaultImpl();
244.30 + this.context = SSLContextImpl.DefaultSSLContext.getDefaultImpl();
244.31 }
244.32
244.33 /**
244.34 @@ -167,11 +165,9 @@
244.35 * is encrypted to provide confidentiality.
244.36 */
244.37 public String[] getDefaultCipherSuites() {
244.38 - CipherSuiteList.clearAvailableCache();
244.39 - return CipherSuiteList.getDefault().toStringArray();
244.40 + return context.getDefaultCipherSuiteList(false).toStringArray();
244.41 }
244.42
244.43 -
244.44 /**
244.45 * Returns the names of the cipher suites which could be enabled for use
244.46 * on an SSL connection. Normally, only a subset of these will actually
244.47 @@ -181,7 +177,6 @@
244.48 * certain kinds of certificates to use certain cipher suites.
244.49 */
244.50 public String[] getSupportedCipherSuites() {
244.51 - CipherSuiteList.clearAvailableCache();
244.52 - return CipherSuiteList.getSupported().toStringArray();
244.53 + return context.getSuportedCipherSuiteList().toStringArray();
244.54 }
244.55 }
245.1 --- a/src/share/classes/sun/security/ssl/SSLSocketImpl.java Tue Apr 19 16:01:27 2011 -0700
245.2 +++ b/src/share/classes/sun/security/ssl/SSLSocketImpl.java Tue Apr 26 15:48:03 2011 -0700
245.3 @@ -1,5 +1,5 @@
245.4 /*
245.5 - * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
245.6 + * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
245.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
245.8 *
245.9 * This code is free software; you can redistribute it and/or modify it
245.10 @@ -562,8 +562,11 @@
245.11 clientVerifyData = new byte[0];
245.12 serverVerifyData = new byte[0];
245.13
245.14 - enabledCipherSuites = CipherSuiteList.getDefault();
245.15 - enabledProtocols = ProtocolList.getDefault(roleIsServer);
245.16 + enabledCipherSuites =
245.17 + sslContext.getDefaultCipherSuiteList(roleIsServer);
245.18 + enabledProtocols =
245.19 + sslContext.getDefaultProtocolList(roleIsServer);
245.20 +
245.21 inrec = null;
245.22
245.23 // save the acc
245.24 @@ -2170,8 +2173,8 @@
245.25 * change them to the corresponding default ones.
245.26 */
245.27 if (roleIsServer != (!flag) &&
245.28 - ProtocolList.isDefaultProtocolList(enabledProtocols)) {
245.29 - enabledProtocols = ProtocolList.getDefault(!flag);
245.30 + sslContext.isDefaultProtocolList(enabledProtocols)) {
245.31 + enabledProtocols = sslContext.getDefaultProtocolList(!flag);
245.32 }
245.33 roleIsServer = !flag;
245.34 break;
245.35 @@ -2192,8 +2195,8 @@
245.36 * change them to the corresponding default ones.
245.37 */
245.38 if (roleIsServer != (!flag) &&
245.39 - ProtocolList.isDefaultProtocolList(enabledProtocols)) {
245.40 - enabledProtocols = ProtocolList.getDefault(!flag);
245.41 + sslContext.isDefaultProtocolList(enabledProtocols)) {
245.42 + enabledProtocols = sslContext.getDefaultProtocolList(!flag);
245.43 }
245.44 roleIsServer = !flag;
245.45 connectionState = cs_START;
245.46 @@ -2230,8 +2233,7 @@
245.47 * @return an array of cipher suite names
245.48 */
245.49 public String[] getSupportedCipherSuites() {
245.50 - CipherSuiteList.clearAvailableCache();
245.51 - return CipherSuiteList.getSupported().toStringArray();
245.52 + return sslContext.getSuportedCipherSuiteList().toStringArray();
245.53 }
245.54
245.55 /**
245.56 @@ -2271,7 +2273,7 @@
245.57 * @return an array of protocol names.
245.58 */
245.59 public String[] getSupportedProtocols() {
245.60 - return ProtocolList.getSupported().toStringArray();
245.61 + return sslContext.getSuportedProtocolList().toStringArray();
245.62 }
245.63
245.64 /**
246.1 --- a/src/share/classes/sun/security/ssl/SunJSSE.java Tue Apr 19 16:01:27 2011 -0700
246.2 +++ b/src/share/classes/sun/security/ssl/SunJSSE.java Tue Apr 26 15:48:03 2011 -0700
246.3 @@ -204,22 +204,21 @@
246.4 put("Alg.Alias.TrustManagerFactory.SunPKIX", "PKIX");
246.5 put("Alg.Alias.TrustManagerFactory.X509", "PKIX");
246.6 put("Alg.Alias.TrustManagerFactory.X.509", "PKIX");
246.7 +
246.8 + put("SSLContext.TLSv1",
246.9 + "sun.security.ssl.SSLContextImpl$TLS10Context");
246.10 + put("Alg.Alias.SSLContext.TLS", "TLSv1");
246.11 if (isfips == false) {
246.12 - put("SSLContext.SSL",
246.13 - "sun.security.ssl.SSLContextImpl");
246.14 - put("SSLContext.SSLv3",
246.15 - "sun.security.ssl.SSLContextImpl");
246.16 + put("Alg.Alias.SSLContext.SSL", "TLSv1");
246.17 + put("Alg.Alias.SSLContext.SSLv3", "TLSv1");
246.18 }
246.19 - put("SSLContext.TLS",
246.20 - "sun.security.ssl.SSLContextImpl");
246.21 - put("SSLContext.TLSv1",
246.22 - "sun.security.ssl.SSLContextImpl");
246.23 +
246.24 put("SSLContext.TLSv1.1",
246.25 - "sun.security.ssl.SSLContextImpl");
246.26 + "sun.security.ssl.SSLContextImpl$TLS11Context");
246.27 put("SSLContext.TLSv1.2",
246.28 - "sun.security.ssl.SSLContextImpl");
246.29 + "sun.security.ssl.SSLContextImpl$TLS12Context");
246.30 put("SSLContext.Default",
246.31 - "sun.security.ssl.DefaultSSLContextImpl");
246.32 + "sun.security.ssl.SSLContextImpl$DefaultSSLContext");
246.33
246.34 /*
246.35 * KeyStore
247.1 --- a/src/share/classes/sun/security/util/ManifestEntryVerifier.java Tue Apr 19 16:01:27 2011 -0700
247.2 +++ b/src/share/classes/sun/security/util/ManifestEntryVerifier.java Tue Apr 26 15:48:03 2011 -0700
247.3 @@ -1,5 +1,5 @@
247.4 /*
247.5 - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
247.6 + * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
247.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
247.8 *
247.9 * This code is free software; you can redistribute it and/or modify it
247.10 @@ -191,8 +191,8 @@
247.11 *
247.12 *
247.13 */
247.14 - public CodeSigner[] verify(Hashtable<String, CodeSigner[]> verifiedSigners,
247.15 - Hashtable<String, CodeSigner[]> sigFileSigners)
247.16 + public CodeSigner[] verify(Map<String, CodeSigner[]> verifiedSigners,
247.17 + Map<String, CodeSigner[]> sigFileSigners)
247.18 throws JarException
247.19 {
247.20 if (skip) {
248.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
248.2 +++ b/src/share/classes/sun/security/util/SignatureFileManifest.java Tue Apr 26 15:48:03 2011 -0700
248.3 @@ -0,0 +1,251 @@
248.4 +/*
248.5 + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
248.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
248.7 + *
248.8 + * This code is free software; you can redistribute it and/or modify it
248.9 + * under the terms of the GNU General Public License version 2 only, as
248.10 + * published by the Free Software Foundation. Oracle designates this
248.11 + * particular file as subject to the "Classpath" exception as provided
248.12 + * by Oracle in the LICENSE file that accompanied this code.
248.13 + *
248.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
248.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
248.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
248.17 + * version 2 for more details (a copy is included in the LICENSE file that
248.18 + * accompanied this code).
248.19 + *
248.20 + * You should have received a copy of the GNU General Public License version
248.21 + * 2 along with this work; if not, write to the Free Software Foundation,
248.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
248.23 + *
248.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
248.25 + * or visit www.oracle.com if you need additional information or have any
248.26 + * questions.
248.27 + */
248.28 +
248.29 +package sun.security.util;
248.30 +
248.31 +import java.io.IOException;
248.32 +import java.io.InputStream;
248.33 +import java.util.Arrays;
248.34 +import java.util.jar.Attributes;
248.35 +import java.util.jar.Manifest;
248.36 +
248.37 +/**
248.38 + * This class provides streaming mode reading of manifest files.
248.39 + * Used by {@link SignatureFileVerifier}.
248.40 + */
248.41 +class SignatureFileManifest extends Manifest {
248.42 +
248.43 + /*
248.44 + * Reading a manifest into this object by calling update(byte[]) on chunks.
248.45 + * During the reading, the bytes are saved in (@code current} until a line
248.46 + * is complete and the key-value pair is saved in {@code currentAttr}. When
248.47 + * a section is complete, {@code consumeAttr} is called to merge
248.48 + * {@code currentAttr} into main attributes or a named entry.
248.49 + */
248.50 +
248.51 + // Internal state during update() style reading
248.52 + // 0. not in update mode
248.53 + // 1, in update mode but main attributes not completed yet
248.54 + // 2. main attributes completed, still reading the entries
248.55 + private int state = 0;
248.56 +
248.57 + // The partial line read
248.58 + private byte[] current;
248.59 +
248.60 + // Number of bytes in current
248.61 + private int currentPos = 0;
248.62 +
248.63 + // The current Attribute
248.64 + private Attributes currentAttr;
248.65 +
248.66 + /**
248.67 + * Reads a manifest in chunks.
248.68 + * <p>
248.69 + * This method must be called in a row, reading chunks from a single
248.70 + * manifest file by order. After all chunks are read, caller must call
248.71 + * {@code update(null)} to fully consume the manifest.
248.72 + * <p>
248.73 + * The entry names and attributes read will be merged in with the current
248.74 + * manifest entries. The {@link #read} method cannot be called inside a
248.75 + * row of update calls.
248.76 + * <p>
248.77 + * Along with the calls, caller can call {@link #getMainAttributes()},
248.78 + * {@link #getAttributes(java.lang.String)} or {@link #getEntries()}
248.79 + * to get already available contents. However, in order not to return
248.80 + * partial result, when the main attributes in the new manifest is not
248.81 + * consumed completely, {@link #getMainAttributes()} throws an
248.82 + * {@code IllegalStateException}. When a certain named entry is not
248.83 + * consumed completely, {@link #getAttributes(java.lang.String)}
248.84 + * returns the old {@code Attributes} for the name (if it exists).
248.85 + *
248.86 + * @param data null for last call, otherwise, feeding chunks
248.87 + * @param offset offset into data to begin read
248.88 + * @param length length of data after offset to read
248.89 + * @exception IOException if an I/O error has occurred
248.90 + * @exception IllegalStateException if {@code update(null)} is called
248.91 + * without any previous {@code update(non-null)} call
248.92 + */
248.93 + public void update(byte[] data, int offset, int length) throws IOException {
248.94 +
248.95 + // The last call
248.96 + if (data == null) {
248.97 + if (state == 0) {
248.98 + throw new IllegalStateException("No data to update");
248.99 + }
248.100 + // We accept manifest not ended with \n or \n\n
248.101 + if (hasLastByte()) {
248.102 + consumeCurrent();
248.103 + }
248.104 + // We accept empty lines at the end
248.105 + if (!currentAttr.isEmpty()) {
248.106 + consumeAttr();
248.107 + }
248.108 + state = 0; // back to non-update state
248.109 + current = null;
248.110 + currentAttr = null;
248.111 + return;
248.112 + }
248.113 +
248.114 + // The first call
248.115 + if (state == 0) {
248.116 + current = new byte[1024];
248.117 + currentAttr = super.getMainAttributes(); // the main attribute
248.118 + state = 1;
248.119 + }
248.120 +
248.121 + int end = offset + length;
248.122 +
248.123 + while (offset < end) {
248.124 + switch (data[offset]) {
248.125 + case '\r':
248.126 + break; // always skip
248.127 + case '\n':
248.128 + if (hasLastByte() && lastByte() == '\n') { // new section
248.129 + consumeCurrent();
248.130 + consumeAttr();
248.131 + if (state == 1) {
248.132 + state = 2;
248.133 + }
248.134 + currentAttr = new Attributes(2);
248.135 + } else {
248.136 + if (hasLastByte()) {
248.137 + // save \n into current but do not parse,
248.138 + // there might be a continuation later
248.139 + ensureCapacity();
248.140 + current[currentPos++] = data[offset];
248.141 + } else if (state == 1) {
248.142 + // there can be multiple empty lines between
248.143 + // sections, but cannot be at the beginning
248.144 + throw new IOException("invalid manifest format");
248.145 + }
248.146 + }
248.147 + break;
248.148 + case ' ':
248.149 + if (!hasLastByte()) {
248.150 + throw new IOException("invalid manifest format");
248.151 + } else if (lastByte() == '\n') {
248.152 + currentPos--; // continuation, remove last \n
248.153 + } else { // a very normal ' '
248.154 + ensureCapacity();
248.155 + current[currentPos++] = data[offset];
248.156 + }
248.157 + break;
248.158 + default:
248.159 + if (hasLastByte() && lastByte() == '\n') {
248.160 + // The start of a new pair, not continuation
248.161 + consumeCurrent(); // the last line read
248.162 + }
248.163 + ensureCapacity();
248.164 + current[currentPos++] = data[offset];
248.165 + break;
248.166 + }
248.167 + offset++;
248.168 + }
248.169 + }
248.170 +
248.171 + /**
248.172 + * Returns the main Attributes for the Manifest.
248.173 + * @exception IllegalStateException the main attributes is being read
248.174 + * @return the main Attributes for the Manifest
248.175 + */
248.176 + public Attributes getMainAttributes() {
248.177 + if (state == 1) {
248.178 + throw new IllegalStateException();
248.179 + }
248.180 + return super.getMainAttributes();
248.181 + }
248.182 +
248.183 + /**
248.184 + * Reads the Manifest from the specified InputStream. The entry
248.185 + * names and attributes read will be merged in with the current
248.186 + * manifest entries.
248.187 + *
248.188 + * @param is the input stream
248.189 + * @exception IOException if an I/O error has occurred
248.190 + * @exception IllegalStateException if called between two {@link #update}
248.191 + * calls
248.192 + */
248.193 + public void read(InputStream is) throws IOException {
248.194 + if (state != 0) {
248.195 + throw new IllegalStateException("Cannot call read between updates");
248.196 + }
248.197 + super.read(is);
248.198 + }
248.199 +
248.200 + /*
248.201 + * ---------- Helper methods -----------------
248.202 + */
248.203 +
248.204 + private void ensureCapacity() {
248.205 + if (currentPos >= current.length-1) {
248.206 + current = Arrays.copyOf(current, current.length*2);
248.207 + }
248.208 + }
248.209 +
248.210 + private boolean hasLastByte() {
248.211 + return currentPos > 0;
248.212 + }
248.213 +
248.214 + private byte lastByte() {
248.215 + return current[currentPos-1];
248.216 + }
248.217 +
248.218 + // Parse current as key:value and save into currentAttr.
248.219 + // There MUST be something inside current.
248.220 + private void consumeCurrent() throws IOException {
248.221 + // current normally has a \n end, except for the last line
248.222 + if (current[currentPos-1] == '\n') currentPos--;
248.223 + for (int i=0; i<currentPos; i++) {
248.224 + if (current[i] == ':') {
248.225 + String key = new String(current, 0, 0, i);
248.226 + i++;
248.227 + while (i < currentPos && current[i] == ' ') { i++; }
248.228 + String value = new String(current, i, currentPos-i, "UTF-8");
248.229 + currentAttr.putValue(key, value);
248.230 + currentPos = 0;
248.231 + return;
248.232 + }
248.233 + }
248.234 + throw new IOException("invalid header field");
248.235 + }
248.236 +
248.237 + // Merge currentAttr into Manifest
248.238 + private void consumeAttr() throws IOException {
248.239 + // Only needed for named entries. For the main attribute, key/value
248.240 + // is added into attr directly, but since getMainAttributes() throws
248.241 + // an exception, the partial data is not leaked.
248.242 + if (state != 1) {
248.243 + String name = currentAttr.getValue("Name");
248.244 + if (name != null) {
248.245 + currentAttr.remove(new Attributes.Name("Name"));
248.246 + Attributes old = getAttributes(name);
248.247 + if (old != null) old.putAll(currentAttr);
248.248 + else getEntries().put(name, currentAttr);
248.249 + } else {
248.250 + throw new IOException("invalid manifest format");
248.251 + }
248.252 + }
248.253 + }
248.254 +}
249.1 --- a/src/share/classes/sun/security/util/SignatureFileVerifier.java Tue Apr 19 16:01:27 2011 -0700
249.2 +++ b/src/share/classes/sun/security/util/SignatureFileVerifier.java Tue Apr 26 15:48:03 2011 -0700
249.3 @@ -55,8 +55,8 @@
249.4 /** the PKCS7 block for this .DSA/.RSA/.EC file */
249.5 private PKCS7 block;
249.6
249.7 - /** the raw bytes of the .SF file */
249.8 - private byte sfBytes[];
249.9 + // the content of the raw .SF file as an InputStream
249.10 + private InputStream sfStream;
249.11
249.12 /** the name of the signature block file, uppercased and without
249.13 * the extension (.DSA/.RSA/.EC)
249.14 @@ -66,6 +66,9 @@
249.15 /** the ManifestDigester */
249.16 private ManifestDigester md;
249.17
249.18 + /** The MANIFEST.MF */
249.19 + private Manifest man;
249.20 +
249.21 /** cache of created MessageDigest objects */
249.22 private HashMap<String, MessageDigest> createdDigests;
249.23
249.24 @@ -83,6 +86,7 @@
249.25 * @param rawBytes the raw bytes of the signature block file
249.26 */
249.27 public SignatureFileVerifier(ArrayList<CodeSigner[]> signerCache,
249.28 + Manifest man,
249.29 ManifestDigester md,
249.30 String name,
249.31 byte rawBytes[])
249.32 @@ -94,13 +98,18 @@
249.33 try {
249.34 obj = Providers.startJarVerification();
249.35 block = new PKCS7(rawBytes);
249.36 - sfBytes = block.getContentInfo().getData();
249.37 + byte[] contentData = block.getContentInfo().getData();
249.38 + if (contentData != null) {
249.39 + sfStream = new ByteArrayInputStream(contentData);
249.40 + }
249.41 certificateFactory = CertificateFactory.getInstance("X509");
249.42 } finally {
249.43 Providers.stopJarVerification(obj);
249.44 }
249.45 this.name = name.substring(0, name.lastIndexOf("."))
249.46 .toUpperCase(Locale.ENGLISH);
249.47 +
249.48 + this.man = man;
249.49 this.md = md;
249.50 this.signerCache = signerCache;
249.51 }
249.52 @@ -108,31 +117,13 @@
249.53 /**
249.54 * returns true if we need the .SF file
249.55 */
249.56 - public boolean needSignatureFileBytes()
249.57 + public boolean needSignatureFile()
249.58 {
249.59 -
249.60 - return sfBytes == null;
249.61 + return sfStream == null;
249.62 }
249.63
249.64 -
249.65 - /**
249.66 - * returns true if we need this .SF file.
249.67 - *
249.68 - * @param name the name of the .SF file without the extension
249.69 - *
249.70 - */
249.71 - public boolean needSignatureFile(String name)
249.72 - {
249.73 - return this.name.equalsIgnoreCase(name);
249.74 - }
249.75 -
249.76 - /**
249.77 - * used to set the raw bytes of the .SF file when it
249.78 - * is external to the signature block file.
249.79 - */
249.80 - public void setSignatureFile(byte sfBytes[])
249.81 - {
249.82 - this.sfBytes = sfBytes;
249.83 + public void setSignatureFile(InputStream ins) {
249.84 + this.sfStream = ins;
249.85 }
249.86
249.87 /**
249.88 @@ -145,12 +136,18 @@
249.89 * Signature File or PKCS7 block file name
249.90 */
249.91 public static boolean isBlockOrSF(String s) {
249.92 - // we currently only support DSA and RSA PKCS7 blocks
249.93 - if (s.endsWith(".SF") || s.endsWith(".DSA") ||
249.94 - s.endsWith(".RSA") || s.endsWith(".EC")) {
249.95 - return true;
249.96 - }
249.97 - return false;
249.98 + return s.endsWith(".SF") || isBlock(s);
249.99 + }
249.100 +
249.101 + /**
249.102 + * Utility method used by JarVerifier to determine PKCS7 block
249.103 + * files names that are supported
249.104 + *
249.105 + * @param s file name
249.106 + * @return true if the input file name is a PKCS7 block file name
249.107 + */
249.108 + public static boolean isBlock(String s) {
249.109 + return s.endsWith(".DSA") || s.endsWith(".RSA") || s.endsWith(".EC");
249.110 }
249.111
249.112 /** get digest from cache */
249.113 @@ -180,7 +177,7 @@
249.114 *
249.115 *
249.116 */
249.117 - public void process(Hashtable<String, CodeSigner[]> signers,
249.118 + public void process(Map<String, CodeSigner[]> signers,
249.119 List manifestDigests)
249.120 throws IOException, SignatureException, NoSuchAlgorithmException,
249.121 JarException, CertificateException
249.122 @@ -197,31 +194,86 @@
249.123
249.124 }
249.125
249.126 - private void processImpl(Hashtable<String, CodeSigner[]> signers,
249.127 + private void processImpl(Map<String, CodeSigner[]> signers,
249.128 List manifestDigests)
249.129 throws IOException, SignatureException, NoSuchAlgorithmException,
249.130 JarException, CertificateException
249.131 {
249.132 - Manifest sf = new Manifest();
249.133 - sf.read(new ByteArrayInputStream(sfBytes));
249.134 + SignatureFileManifest sf = new SignatureFileManifest();
249.135 + InputStream ins = sfStream;
249.136
249.137 - String version =
249.138 - sf.getMainAttributes().getValue(Attributes.Name.SIGNATURE_VERSION);
249.139 + byte[] buffer = new byte[4096];
249.140 + int sLen = block.getSignerInfos().length;
249.141 + boolean mainOK = false; // main attributes of SF is available...
249.142 + boolean manifestSigned = false; // and it matches MANIFEST.MF
249.143 + BASE64Decoder decoder = new BASE64Decoder();
249.144
249.145 - if ((version == null) || !(version.equalsIgnoreCase("1.0"))) {
249.146 - // XXX: should this be an exception?
249.147 - // for now we just ignore this signature file
249.148 - return;
249.149 + PKCS7.PKCS7Verifier[] pvs = new PKCS7.PKCS7Verifier[sLen];
249.150 + for (int i=0; i<sLen; i++) {
249.151 + pvs[i] = PKCS7.PKCS7Verifier.from(block, block.getSignerInfos()[i]);
249.152 }
249.153
249.154 - SignerInfo[] infos = block.verify(sfBytes);
249.155 + /*
249.156 + * Verify SF in streaming mode. The chunks of the file are fed into
249.157 + * the Manifest object sf and all PKCS7Verifiers. As soon as the main
249.158 + * attributes is available, we'll check if manifestSigned is true. If
249.159 + * yes, there is no need to fill in sf's entries field, since it should
249.160 + * be identical to entries in man.
249.161 + */
249.162 + while (true) {
249.163 + int len = ins.read(buffer);
249.164 + if (len < 0) {
249.165 + if (!manifestSigned) {
249.166 + sf.update(null, 0, 0);
249.167 + }
249.168 + break;
249.169 + } else {
249.170 + for (int i=0; i<sLen; i++) {
249.171 + if (pvs[i] != null) pvs[i].update(buffer, 0, len);
249.172 + }
249.173 + // Continue reading if verifyManifestHash fails (or, the
249.174 + // main attributes is not available yet)
249.175 + if (!manifestSigned) {
249.176 + sf.update(buffer, 0, len);
249.177 + if (!mainOK) {
249.178 + try {
249.179 + Attributes attr = sf.getMainAttributes();
249.180 + String version = attr.getValue(
249.181 + Attributes.Name.SIGNATURE_VERSION);
249.182
249.183 - if (infos == null) {
249.184 + if ((version == null) ||
249.185 + !(version.equalsIgnoreCase("1.0"))) {
249.186 + // XXX: should this be an exception?
249.187 + // for now we just ignore this signature file
249.188 + return;
249.189 + }
249.190 +
249.191 + mainOK = true;
249.192 + manifestSigned = verifyManifestHash(
249.193 + sf, md, decoder, manifestDigests);
249.194 + } catch (IllegalStateException ise) {
249.195 + // main attributes not available yet
249.196 + }
249.197 + }
249.198 + }
249.199 + }
249.200 + }
249.201 + List<SignerInfo> intResult = new ArrayList<>(sLen);
249.202 + for (int i = 0; i < sLen; i++) {
249.203 + if (pvs[i] != null) {
249.204 + SignerInfo signerInfo = pvs[i].verify();
249.205 + if (signerInfo != null) {
249.206 + intResult.add(signerInfo);
249.207 + }
249.208 + }
249.209 + }
249.210 + if (intResult.isEmpty()) {
249.211 throw new SecurityException("cannot verify signature block file " +
249.212 name);
249.213 }
249.214
249.215 - BASE64Decoder decoder = new BASE64Decoder();
249.216 + SignerInfo[] infos =
249.217 + intResult.toArray(new SignerInfo[intResult.size()]);
249.218
249.219 CodeSigner[] newSigners = getSigners(infos, block);
249.220
249.221 @@ -229,26 +281,37 @@
249.222 if (newSigners == null)
249.223 return;
249.224
249.225 - Iterator<Map.Entry<String,Attributes>> entries =
249.226 - sf.getEntries().entrySet().iterator();
249.227 -
249.228 - // see if we can verify the whole manifest first
249.229 - boolean manifestSigned = verifyManifestHash(sf, md, decoder, manifestDigests);
249.230 -
249.231 // verify manifest main attributes
249.232 if (!manifestSigned && !verifyManifestMainAttrs(sf, md, decoder)) {
249.233 throw new SecurityException
249.234 ("Invalid signature file digest for Manifest main attributes");
249.235 }
249.236
249.237 - // go through each section in the signature file
249.238 + Iterator<Map.Entry<String,Attributes>> entries;
249.239 +
249.240 + if (manifestSigned) {
249.241 + if (debug != null) {
249.242 + debug.println("full manifest signature match, "
249.243 + + "update signer info from MANIFEST.MF");
249.244 + }
249.245 + entries = man.getEntries().entrySet().iterator();
249.246 + } else {
249.247 + if (debug != null) {
249.248 + debug.println("full manifest signature unmatch, "
249.249 + + "update signer info from SF file");
249.250 + }
249.251 + entries = sf.getEntries().entrySet().iterator();
249.252 + }
249.253 +
249.254 + // go through each section
249.255 +
249.256 while(entries.hasNext()) {
249.257
249.258 Map.Entry<String,Attributes> e = entries.next();
249.259 String name = e.getKey();
249.260
249.261 if (manifestSigned ||
249.262 - (verifySection(e.getValue(), name, md, decoder))) {
249.263 + (verifySection(e.getValue(), name, md, decoder))) {
249.264
249.265 if (name.startsWith("./"))
249.266 name = name.substring(2);
249.267 @@ -593,7 +656,6 @@
249.268 if (set == subset)
249.269 return true;
249.270
249.271 - boolean match;
249.272 for (int i = 0; i < subset.length; i++) {
249.273 if (!contains(set, subset[i]))
249.274 return false;
249.275 @@ -613,8 +675,6 @@
249.276 if ((oldSigners == null) && (signers == newSigners))
249.277 return true;
249.278
249.279 - boolean match;
249.280 -
249.281 // make sure all oldSigners are in signers
249.282 if ((oldSigners != null) && !isSubSet(oldSigners, signers))
249.283 return false;
249.284 @@ -638,7 +698,7 @@
249.285 }
249.286
249.287 void updateSigners(CodeSigner[] newSigners,
249.288 - Hashtable<String, CodeSigner[]> signers, String name) {
249.289 + Map<String, CodeSigner[]> signers, String name) {
249.290
249.291 CodeSigner[] oldSigners = signers.get(name);
249.292
250.1 --- a/src/share/classes/sun/swing/SwingUtilities2.java Tue Apr 19 16:01:27 2011 -0700
250.2 +++ b/src/share/classes/sun/swing/SwingUtilities2.java Tue Apr 26 15:48:03 2011 -0700
250.3 @@ -270,11 +270,10 @@
250.4 */
250.5 public static int getLeftSideBearing(JComponent c, FontMetrics fm,
250.6 String string) {
250.7 - int res = 0;
250.8 - if (!string.isEmpty()) {
250.9 - res = getLeftSideBearing(c, fm, string.charAt(0));
250.10 + if ((string == null) || (string.length() == 0)) {
250.11 + return 0;
250.12 }
250.13 - return res;
250.14 + return getLeftSideBearing(c, fm, string.charAt(0));
250.15 }
250.16
250.17 /**
251.1 --- a/src/share/classes/sun/util/locale/BaseLocale.java Tue Apr 19 16:01:27 2011 -0700
251.2 +++ b/src/share/classes/sun/util/locale/BaseLocale.java Tue Apr 26 15:48:03 2011 -0700
251.3 @@ -1,5 +1,5 @@
251.4 /*
251.5 - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
251.6 + * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
251.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
251.8 *
251.9 * This code is free software; you can redistribute it and/or modify it
251.10 @@ -38,38 +38,46 @@
251.11 public static final String SEP = "_";
251.12
251.13 private static final Cache CACHE = new Cache();
251.14 - public static final BaseLocale ROOT = BaseLocale.getInstance("", "", "", "");
251.15
251.16 - private String _language = "";
251.17 - private String _script = "";
251.18 - private String _region = "";
251.19 - private String _variant = "";
251.20 + private final String language;
251.21 + private final String script;
251.22 + private final String region;
251.23 + private final String variant;
251.24
251.25 - private transient volatile int _hash = 0;
251.26 + private volatile int hash = 0;
251.27 +
251.28 + // This method must be called only when creating the Locale.* constants.
251.29 + private BaseLocale(String language, String region) {
251.30 + this.language = language;
251.31 + this.script = "";
251.32 + this.region = region;
251.33 + this.variant = "";
251.34 + }
251.35
251.36 private BaseLocale(String language, String script, String region, String variant) {
251.37 - if (language != null) {
251.38 - _language = AsciiUtil.toLowerString(language).intern();
251.39 - }
251.40 - if (script != null) {
251.41 - _script = AsciiUtil.toTitleString(script).intern();
251.42 - }
251.43 - if (region != null) {
251.44 - _region = AsciiUtil.toUpperString(region).intern();
251.45 - }
251.46 - if (variant != null) {
251.47 - _variant = variant.intern();
251.48 - }
251.49 + this.language = (language != null) ? LocaleUtils.toLowerString(language).intern() : "";
251.50 + this.script = (script != null) ? LocaleUtils.toTitleString(script).intern() : "";
251.51 + this.region = (region != null) ? LocaleUtils.toUpperString(region).intern() : "";
251.52 + this.variant = (variant != null) ? variant.intern() : "";
251.53 }
251.54
251.55 - public static BaseLocale getInstance(String language, String script, String region, String variant) {
251.56 + // Called for creating the Locale.* constants. No argument
251.57 + // validation is performed.
251.58 + public static BaseLocale createInstance(String language, String region) {
251.59 + BaseLocale base = new BaseLocale(language, region);
251.60 + CACHE.put(new Key(language, region), base);
251.61 + return base;
251.62 + }
251.63 +
251.64 + public static BaseLocale getInstance(String language, String script,
251.65 + String region, String variant) {
251.66 // JDK uses deprecated ISO639.1 language codes for he, yi and id
251.67 if (language != null) {
251.68 - if (AsciiUtil.caseIgnoreMatch(language, "he")) {
251.69 + if (LocaleUtils.caseIgnoreMatch(language, "he")) {
251.70 language = "iw";
251.71 - } else if (AsciiUtil.caseIgnoreMatch(language, "yi")) {
251.72 + } else if (LocaleUtils.caseIgnoreMatch(language, "yi")) {
251.73 language = "ji";
251.74 - } else if (AsciiUtil.caseIgnoreMatch(language, "id")) {
251.75 + } else if (LocaleUtils.caseIgnoreMatch(language, "id")) {
251.76 language = "in";
251.77 }
251.78 }
251.79 @@ -80,21 +88,22 @@
251.80 }
251.81
251.82 public String getLanguage() {
251.83 - return _language;
251.84 + return language;
251.85 }
251.86
251.87 public String getScript() {
251.88 - return _script;
251.89 + return script;
251.90 }
251.91
251.92 public String getRegion() {
251.93 - return _region;
251.94 + return region;
251.95 }
251.96
251.97 public String getVariant() {
251.98 - return _variant;
251.99 + return variant;
251.100 }
251.101
251.102 + @Override
251.103 public boolean equals(Object obj) {
251.104 if (this == obj) {
251.105 return true;
251.106 @@ -103,138 +112,178 @@
251.107 return false;
251.108 }
251.109 BaseLocale other = (BaseLocale)obj;
251.110 - return hashCode() == other.hashCode()
251.111 - && _language.equals(other._language)
251.112 - && _script.equals(other._script)
251.113 - && _region.equals(other._region)
251.114 - && _variant.equals(other._variant);
251.115 + return language == other.language
251.116 + && script == other.script
251.117 + && region == other.region
251.118 + && variant == other.variant;
251.119 }
251.120
251.121 + @Override
251.122 public String toString() {
251.123 StringBuilder buf = new StringBuilder();
251.124 - if (_language.length() > 0) {
251.125 + if (language.length() > 0) {
251.126 buf.append("language=");
251.127 - buf.append(_language);
251.128 + buf.append(language);
251.129 }
251.130 - if (_script.length() > 0) {
251.131 + if (script.length() > 0) {
251.132 if (buf.length() > 0) {
251.133 buf.append(", ");
251.134 }
251.135 buf.append("script=");
251.136 - buf.append(_script);
251.137 + buf.append(script);
251.138 }
251.139 - if (_region.length() > 0) {
251.140 + if (region.length() > 0) {
251.141 if (buf.length() > 0) {
251.142 buf.append(", ");
251.143 }
251.144 buf.append("region=");
251.145 - buf.append(_region);
251.146 + buf.append(region);
251.147 }
251.148 - if (_variant.length() > 0) {
251.149 + if (variant.length() > 0) {
251.150 if (buf.length() > 0) {
251.151 buf.append(", ");
251.152 }
251.153 buf.append("variant=");
251.154 - buf.append(_variant);
251.155 + buf.append(variant);
251.156 }
251.157 return buf.toString();
251.158 }
251.159
251.160 + @Override
251.161 public int hashCode() {
251.162 - int h = _hash;
251.163 + int h = hash;
251.164 if (h == 0) {
251.165 // Generating a hash value from language, script, region and variant
251.166 - for (int i = 0; i < _language.length(); i++) {
251.167 - h = 31*h + _language.charAt(i);
251.168 - }
251.169 - for (int i = 0; i < _script.length(); i++) {
251.170 - h = 31*h + _script.charAt(i);
251.171 - }
251.172 - for (int i = 0; i < _region.length(); i++) {
251.173 - h = 31*h + _region.charAt(i);
251.174 - }
251.175 - for (int i = 0; i < _variant.length(); i++) {
251.176 - h = 31*h + _variant.charAt(i);
251.177 - }
251.178 - _hash = h;
251.179 + h = language.hashCode();
251.180 + h = 31 * h + script.hashCode();
251.181 + h = 31 * h + region.hashCode();
251.182 + h = 31 * h + variant.hashCode();
251.183 + hash = h;
251.184 }
251.185 return h;
251.186 }
251.187
251.188 - private static class Key implements Comparable<Key> {
251.189 - private String _lang = "";
251.190 - private String _scrt = "";
251.191 - private String _regn = "";
251.192 - private String _vart = "";
251.193 + private static final class Key implements Comparable<Key> {
251.194 + private final String lang;
251.195 + private final String scrt;
251.196 + private final String regn;
251.197 + private final String vart;
251.198 + private final boolean normalized;
251.199 + private final int hash;
251.200
251.201 - private volatile int _hash; // Default to 0
251.202 + /**
251.203 + * Creates a Key. language and region must be normalized
251.204 + * (intern'ed in the proper case).
251.205 + */
251.206 + private Key(String language, String region) {
251.207 + assert language.intern() == language
251.208 + && region.intern() == region;
251.209 +
251.210 + lang = language;
251.211 + scrt = "";
251.212 + regn = region;
251.213 + vart = "";
251.214 + this.normalized = true;
251.215 +
251.216 + int h = language.hashCode();
251.217 + if (region != "") {
251.218 + int len = region.length();
251.219 + for (int i = 0; i < len; i++) {
251.220 + h = 31 * h + LocaleUtils.toLower(region.charAt(i));
251.221 + }
251.222 + }
251.223 + hash = h;
251.224 + }
251.225
251.226 public Key(String language, String script, String region, String variant) {
251.227 + this(language, script, region, variant, false);
251.228 + }
251.229 +
251.230 + private Key(String language, String script, String region,
251.231 + String variant, boolean normalized) {
251.232 + int h = 0;
251.233 if (language != null) {
251.234 - _lang = language;
251.235 + lang = language;
251.236 + int len = language.length();
251.237 + for (int i = 0; i < len; i++) {
251.238 + h = 31*h + LocaleUtils.toLower(language.charAt(i));
251.239 + }
251.240 + } else {
251.241 + lang = "";
251.242 }
251.243 if (script != null) {
251.244 - _scrt = script;
251.245 + scrt = script;
251.246 + int len = script.length();
251.247 + for (int i = 0; i < len; i++) {
251.248 + h = 31*h + LocaleUtils.toLower(script.charAt(i));
251.249 + }
251.250 + } else {
251.251 + scrt = "";
251.252 }
251.253 if (region != null) {
251.254 - _regn = region;
251.255 + regn = region;
251.256 + int len = region.length();
251.257 + for (int i = 0; i < len; i++) {
251.258 + h = 31*h + LocaleUtils.toLower(region.charAt(i));
251.259 + }
251.260 + } else {
251.261 + regn = "";
251.262 }
251.263 if (variant != null) {
251.264 - _vart = variant;
251.265 + vart = variant;
251.266 + int len = variant.length();
251.267 + for (int i = 0; i < len; i++) {
251.268 + h = 31*h + variant.charAt(i);
251.269 + }
251.270 + } else {
251.271 + vart = "";
251.272 }
251.273 + hash = h;
251.274 + this.normalized = normalized;
251.275 }
251.276
251.277 + @Override
251.278 public boolean equals(Object obj) {
251.279 return (this == obj) ||
251.280 (obj instanceof Key)
251.281 - && AsciiUtil.caseIgnoreMatch(((Key)obj)._lang, this._lang)
251.282 - && AsciiUtil.caseIgnoreMatch(((Key)obj)._scrt, this._scrt)
251.283 - && AsciiUtil.caseIgnoreMatch(((Key)obj)._regn, this._regn)
251.284 - && ((Key)obj)._vart.equals(_vart); // variant is case sensitive in JDK!
251.285 + && this.hash == ((Key)obj).hash
251.286 + && LocaleUtils.caseIgnoreMatch(((Key)obj).lang, this.lang)
251.287 + && LocaleUtils.caseIgnoreMatch(((Key)obj).scrt, this.scrt)
251.288 + && LocaleUtils.caseIgnoreMatch(((Key)obj).regn, this.regn)
251.289 + && ((Key)obj).vart.equals(vart); // variant is case sensitive in JDK!
251.290 }
251.291
251.292 + @Override
251.293 public int compareTo(Key other) {
251.294 - int res = AsciiUtil.caseIgnoreCompare(this._lang, other._lang);
251.295 + int res = LocaleUtils.caseIgnoreCompare(this.lang, other.lang);
251.296 if (res == 0) {
251.297 - res = AsciiUtil.caseIgnoreCompare(this._scrt, other._scrt);
251.298 + res = LocaleUtils.caseIgnoreCompare(this.scrt, other.scrt);
251.299 if (res == 0) {
251.300 - res = AsciiUtil.caseIgnoreCompare(this._regn, other._regn);
251.301 + res = LocaleUtils.caseIgnoreCompare(this.regn, other.regn);
251.302 if (res == 0) {
251.303 - res = this._vart.compareTo(other._vart);
251.304 + res = this.vart.compareTo(other.vart);
251.305 }
251.306 }
251.307 }
251.308 return res;
251.309 }
251.310
251.311 + @Override
251.312 public int hashCode() {
251.313 - int h = _hash;
251.314 - if (h == 0) {
251.315 - // Generating a hash value from language, script, region and variant
251.316 - for (int i = 0; i < _lang.length(); i++) {
251.317 - h = 31*h + AsciiUtil.toLower(_lang.charAt(i));
251.318 - }
251.319 - for (int i = 0; i < _scrt.length(); i++) {
251.320 - h = 31*h + AsciiUtil.toLower(_scrt.charAt(i));
251.321 - }
251.322 - for (int i = 0; i < _regn.length(); i++) {
251.323 - h = 31*h + AsciiUtil.toLower(_regn.charAt(i));
251.324 - }
251.325 - for (int i = 0; i < _vart.length(); i++) {
251.326 - h = 31*h + _vart.charAt(i);
251.327 - }
251.328 - _hash = h;
251.329 - }
251.330 - return h;
251.331 + return hash;
251.332 }
251.333
251.334 public static Key normalize(Key key) {
251.335 - String lang = AsciiUtil.toLowerString(key._lang).intern();
251.336 - String scrt = AsciiUtil.toTitleString(key._scrt).intern();
251.337 - String regn = AsciiUtil.toUpperString(key._regn).intern();
251.338 - String vart = key._vart.intern(); // preserve upper/lower cases
251.339 + if (key.normalized) {
251.340 + return key;
251.341 + }
251.342
251.343 - return new Key(lang, scrt, regn, vart);
251.344 + String lang = LocaleUtils.toLowerString(key.lang).intern();
251.345 + String scrt = LocaleUtils.toTitleString(key.scrt).intern();
251.346 + String regn = LocaleUtils.toUpperString(key.regn).intern();
251.347 + String vart = key.vart.intern(); // preserve upper/lower cases
251.348 +
251.349 + return new Key(lang, scrt, regn, vart, true);
251.350 }
251.351 }
251.352
251.353 @@ -243,13 +292,14 @@
251.354 public Cache() {
251.355 }
251.356
251.357 + @Override
251.358 protected Key normalizeKey(Key key) {
251.359 return Key.normalize(key);
251.360 }
251.361
251.362 + @Override
251.363 protected BaseLocale createObject(Key key) {
251.364 - return new BaseLocale(key._lang, key._scrt, key._regn, key._vart);
251.365 + return new BaseLocale(key.lang, key.scrt, key.regn, key.vart);
251.366 }
251.367 -
251.368 }
251.369 }
252.1 --- a/src/share/classes/sun/util/locale/Extension.java Tue Apr 19 16:01:27 2011 -0700
252.2 +++ b/src/share/classes/sun/util/locale/Extension.java Tue Apr 26 15:48:03 2011 -0700
252.3 @@ -1,5 +1,5 @@
252.4 /*
252.5 - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
252.6 + * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
252.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
252.8 *
252.9 * This code is free software; you can redistribute it and/or modify it
252.10 @@ -32,29 +32,34 @@
252.11 package sun.util.locale;
252.12
252.13
252.14 -public class Extension {
252.15 - private char _key;
252.16 - protected String _value;
252.17 +class Extension {
252.18 + private final char key;
252.19 + private String value, id;
252.20
252.21 protected Extension(char key) {
252.22 - _key = key;
252.23 + this.key = key;
252.24 }
252.25
252.26 Extension(char key, String value) {
252.27 - _key = key;
252.28 - _value = value;
252.29 + this.key = key;
252.30 + setValue(value);
252.31 + }
252.32 +
252.33 + protected void setValue(String value) {
252.34 + this.value = value;
252.35 + this.id = key + LanguageTag.SEP + value;
252.36 }
252.37
252.38 public char getKey() {
252.39 - return _key;
252.40 + return key;
252.41 }
252.42
252.43 public String getValue() {
252.44 - return _value;
252.45 + return value;
252.46 }
252.47
252.48 public String getID() {
252.49 - return _key + LanguageTag.SEP + _value;
252.50 + return id;
252.51 }
252.52
252.53 public String toString() {
253.1 --- a/src/share/classes/sun/util/locale/InternalLocaleBuilder.java Tue Apr 19 16:01:27 2011 -0700
253.2 +++ b/src/share/classes/sun/util/locale/InternalLocaleBuilder.java Tue Apr 26 15:48:03 2011 -0700
253.3 @@ -1,5 +1,5 @@
253.4 /*
253.5 - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
253.6 + * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
253.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
253.8 *
253.9 * This code is free software; you can redistribute it and/or modify it
253.10 @@ -35,64 +35,66 @@
253.11 import java.util.HashMap;
253.12 import java.util.HashSet;
253.13 import java.util.List;
253.14 +import java.util.Map;
253.15 import java.util.Set;
253.16
253.17 public final class InternalLocaleBuilder {
253.18
253.19 - private String _language = "";
253.20 - private String _script = "";
253.21 - private String _region = "";
253.22 - private String _variant = "";
253.23 + private static final CaseInsensitiveChar PRIVATEUSE_KEY
253.24 + = new CaseInsensitiveChar(LanguageTag.PRIVATEUSE);
253.25
253.26 - private static final CaseInsensitiveChar PRIVUSE_KEY = new CaseInsensitiveChar(LanguageTag.PRIVATEUSE.charAt(0));
253.27 + private String language = "";
253.28 + private String script = "";
253.29 + private String region = "";
253.30 + private String variant = "";
253.31
253.32 - private HashMap<CaseInsensitiveChar, String> _extensions;
253.33 - private HashSet<CaseInsensitiveString> _uattributes;
253.34 - private HashMap<CaseInsensitiveString, String> _ukeywords;
253.35 + private Map<CaseInsensitiveChar, String> extensions;
253.36 + private Set<CaseInsensitiveString> uattributes;
253.37 + private Map<CaseInsensitiveString, String> ukeywords;
253.38
253.39
253.40 public InternalLocaleBuilder() {
253.41 }
253.42
253.43 public InternalLocaleBuilder setLanguage(String language) throws LocaleSyntaxException {
253.44 - if (language == null || language.length() == 0) {
253.45 - _language = "";
253.46 + if (LocaleUtils.isEmpty(language)) {
253.47 + this.language = "";
253.48 } else {
253.49 if (!LanguageTag.isLanguage(language)) {
253.50 throw new LocaleSyntaxException("Ill-formed language: " + language, 0);
253.51 }
253.52 - _language = language;
253.53 + this.language = language;
253.54 }
253.55 return this;
253.56 }
253.57
253.58 public InternalLocaleBuilder setScript(String script) throws LocaleSyntaxException {
253.59 - if (script == null || script.length() == 0) {
253.60 - _script = "";
253.61 + if (LocaleUtils.isEmpty(script)) {
253.62 + this.script = "";
253.63 } else {
253.64 if (!LanguageTag.isScript(script)) {
253.65 throw new LocaleSyntaxException("Ill-formed script: " + script, 0);
253.66 }
253.67 - _script = script;
253.68 + this.script = script;
253.69 }
253.70 return this;
253.71 }
253.72
253.73 public InternalLocaleBuilder setRegion(String region) throws LocaleSyntaxException {
253.74 - if (region == null || region.length() == 0) {
253.75 - _region = "";
253.76 + if (LocaleUtils.isEmpty(region)) {
253.77 + this.region = "";
253.78 } else {
253.79 if (!LanguageTag.isRegion(region)) {
253.80 throw new LocaleSyntaxException("Ill-formed region: " + region, 0);
253.81 }
253.82 - _region = region;
253.83 + this.region = region;
253.84 }
253.85 return this;
253.86 }
253.87
253.88 public InternalLocaleBuilder setVariant(String variant) throws LocaleSyntaxException {
253.89 - if (variant == null || variant.length() == 0) {
253.90 - _variant = "";
253.91 + if (LocaleUtils.isEmpty(variant)) {
253.92 + this.variant = "";
253.93 } else {
253.94 // normalize separators to "_"
253.95 String var = variant.replaceAll(LanguageTag.SEP, BaseLocale.SEP);
253.96 @@ -100,7 +102,7 @@
253.97 if (errIdx != -1) {
253.98 throw new LocaleSyntaxException("Ill-formed variant: " + variant, errIdx);
253.99 }
253.100 - _variant = var;
253.101 + this.variant = var;
253.102 }
253.103 return this;
253.104 }
253.105 @@ -110,10 +112,10 @@
253.106 throw new LocaleSyntaxException("Ill-formed Unicode locale attribute: " + attribute);
253.107 }
253.108 // Use case insensitive string to prevent duplication
253.109 - if (_uattributes == null) {
253.110 - _uattributes = new HashSet<CaseInsensitiveString>(4);
253.111 + if (uattributes == null) {
253.112 + uattributes = new HashSet<>(4);
253.113 }
253.114 - _uattributes.add(new CaseInsensitiveString(attribute));
253.115 + uattributes.add(new CaseInsensitiveString(attribute));
253.116 return this;
253.117 }
253.118
253.119 @@ -121,8 +123,8 @@
253.120 if (attribute == null || !UnicodeLocaleExtension.isAttribute(attribute)) {
253.121 throw new LocaleSyntaxException("Ill-formed Unicode locale attribute: " + attribute);
253.122 }
253.123 - if (_uattributes != null) {
253.124 - _uattributes.remove(new CaseInsensitiveString(attribute));
253.125 + if (uattributes != null) {
253.126 + uattributes.remove(new CaseInsensitiveString(attribute));
253.127 }
253.128 return this;
253.129 }
253.130 @@ -134,9 +136,9 @@
253.131
253.132 CaseInsensitiveString cikey = new CaseInsensitiveString(key);
253.133 if (type == null) {
253.134 - if (_ukeywords != null) {
253.135 + if (ukeywords != null) {
253.136 // null type is used for remove the key
253.137 - _ukeywords.remove(cikey);
253.138 + ukeywords.remove(cikey);
253.139 }
253.140 } else {
253.141 if (type.length() != 0) {
253.142 @@ -147,15 +149,17 @@
253.143 while (!itr.isDone()) {
253.144 String s = itr.current();
253.145 if (!UnicodeLocaleExtension.isTypeSubtag(s)) {
253.146 - throw new LocaleSyntaxException("Ill-formed Unicode locale keyword type: " + type, itr.currentStart());
253.147 + throw new LocaleSyntaxException("Ill-formed Unicode locale keyword type: "
253.148 + + type,
253.149 + itr.currentStart());
253.150 }
253.151 itr.next();
253.152 }
253.153 }
253.154 - if (_ukeywords == null) {
253.155 - _ukeywords = new HashMap<CaseInsensitiveString, String>(4);
253.156 + if (ukeywords == null) {
253.157 + ukeywords = new HashMap<>(4);
253.158 }
253.159 - _ukeywords.put(cikey, type);
253.160 + ukeywords.put(cikey, type);
253.161 }
253.162 return this;
253.163 }
253.164 @@ -167,21 +171,21 @@
253.165 throw new LocaleSyntaxException("Ill-formed extension key: " + singleton);
253.166 }
253.167
253.168 - boolean remove = (value == null || value.length() == 0);
253.169 + boolean remove = LocaleUtils.isEmpty(value);
253.170 CaseInsensitiveChar key = new CaseInsensitiveChar(singleton);
253.171
253.172 if (remove) {
253.173 if (UnicodeLocaleExtension.isSingletonChar(key.value())) {
253.174 // clear entire Unicode locale extension
253.175 - if (_uattributes != null) {
253.176 - _uattributes.clear();
253.177 + if (uattributes != null) {
253.178 + uattributes.clear();
253.179 }
253.180 - if (_ukeywords != null) {
253.181 - _ukeywords.clear();
253.182 + if (ukeywords != null) {
253.183 + ukeywords.clear();
253.184 }
253.185 } else {
253.186 - if (_extensions != null && _extensions.containsKey(key)) {
253.187 - _extensions.remove(key);
253.188 + if (extensions != null && extensions.containsKey(key)) {
253.189 + extensions.remove(key);
253.190 }
253.191 }
253.192 } else {
253.193 @@ -197,7 +201,8 @@
253.194 validSubtag = LanguageTag.isExtensionSubtag(s);
253.195 }
253.196 if (!validSubtag) {
253.197 - throw new LocaleSyntaxException("Ill-formed extension value: " + s, itr.currentStart());
253.198 + throw new LocaleSyntaxException("Ill-formed extension value: " + s,
253.199 + itr.currentStart());
253.200 }
253.201 itr.next();
253.202 }
253.203 @@ -205,10 +210,10 @@
253.204 if (UnicodeLocaleExtension.isSingletonChar(key.value())) {
253.205 setUnicodeLocaleExtension(val);
253.206 } else {
253.207 - if (_extensions == null) {
253.208 - _extensions = new HashMap<CaseInsensitiveChar, String>(4);
253.209 + if (extensions == null) {
253.210 + extensions = new HashMap<>(4);
253.211 }
253.212 - _extensions.put(key, val);
253.213 + extensions.put(key, val);
253.214 }
253.215 }
253.216 return this;
253.217 @@ -218,7 +223,7 @@
253.218 * Set extension/private subtags in a single string representation
253.219 */
253.220 public InternalLocaleBuilder setExtensions(String subtags) throws LocaleSyntaxException {
253.221 - if (subtags == null || subtags.length() == 0) {
253.222 + if (LocaleUtils.isEmpty(subtags)) {
253.223 clearExtensions();
253.224 return this;
253.225 }
253.226 @@ -252,11 +257,12 @@
253.227 }
253.228
253.229 if (parsed < start) {
253.230 - throw new LocaleSyntaxException("Incomplete extension '" + singleton + "'", start);
253.231 + throw new LocaleSyntaxException("Incomplete extension '" + singleton + "'",
253.232 + start);
253.233 }
253.234
253.235 if (extensions == null) {
253.236 - extensions = new ArrayList<String>(4);
253.237 + extensions = new ArrayList<>(4);
253.238 }
253.239 extensions.add(sb.toString());
253.240 } else {
253.241 @@ -281,7 +287,9 @@
253.242 itr.next();
253.243 }
253.244 if (parsed <= start) {
253.245 - throw new LocaleSyntaxException("Incomplete privateuse:" + subtags.substring(start), start);
253.246 + throw new LocaleSyntaxException("Incomplete privateuse:"
253.247 + + subtags.substring(start),
253.248 + start);
253.249 } else {
253.250 privateuse = sb.toString();
253.251 }
253.252 @@ -289,7 +297,9 @@
253.253 }
253.254
253.255 if (!itr.isDone()) {
253.256 - throw new LocaleSyntaxException("Ill-formed extension subtags:" + subtags.substring(itr.currentStart()), itr.currentStart());
253.257 + throw new LocaleSyntaxException("Ill-formed extension subtags:"
253.258 + + subtags.substring(itr.currentStart()),
253.259 + itr.currentStart());
253.260 }
253.261
253.262 return setExtensions(extensions, privateuse);
253.263 @@ -302,30 +312,31 @@
253.264 private InternalLocaleBuilder setExtensions(List<String> bcpExtensions, String privateuse) {
253.265 clearExtensions();
253.266
253.267 - if (bcpExtensions != null && bcpExtensions.size() > 0) {
253.268 - HashSet<CaseInsensitiveChar> processedExntensions = new HashSet<CaseInsensitiveChar>(bcpExtensions.size());
253.269 + if (!LocaleUtils.isEmpty(bcpExtensions)) {
253.270 + Set<CaseInsensitiveChar> done = new HashSet<>(bcpExtensions.size());
253.271 for (String bcpExt : bcpExtensions) {
253.272 - CaseInsensitiveChar key = new CaseInsensitiveChar(bcpExt.charAt(0));
253.273 + CaseInsensitiveChar key = new CaseInsensitiveChar(bcpExt);
253.274 // ignore duplicates
253.275 - if (!processedExntensions.contains(key)) {
253.276 + if (!done.contains(key)) {
253.277 // each extension string contains singleton, e.g. "a-abc-def"
253.278 if (UnicodeLocaleExtension.isSingletonChar(key.value())) {
253.279 setUnicodeLocaleExtension(bcpExt.substring(2));
253.280 } else {
253.281 - if (_extensions == null) {
253.282 - _extensions = new HashMap<CaseInsensitiveChar, String>(4);
253.283 + if (extensions == null) {
253.284 + extensions = new HashMap<>(4);
253.285 }
253.286 - _extensions.put(key, bcpExt.substring(2));
253.287 + extensions.put(key, bcpExt.substring(2));
253.288 }
253.289 }
253.290 + done.add(key);
253.291 }
253.292 }
253.293 if (privateuse != null && privateuse.length() > 0) {
253.294 // privateuse string contains prefix, e.g. "x-abc-def"
253.295 - if (_extensions == null) {
253.296 - _extensions = new HashMap<CaseInsensitiveChar, String>(1);
253.297 + if (extensions == null) {
253.298 + extensions = new HashMap<>(1);
253.299 }
253.300 - _extensions.put(new CaseInsensitiveChar(privateuse.charAt(0)), privateuse.substring(2));
253.301 + extensions.put(new CaseInsensitiveChar(privateuse), privateuse.substring(2));
253.302 }
253.303
253.304 return this;
253.305 @@ -336,24 +347,25 @@
253.306 */
253.307 public InternalLocaleBuilder setLanguageTag(LanguageTag langtag) {
253.308 clear();
253.309 - if (langtag.getExtlangs().size() > 0) {
253.310 - _language = langtag.getExtlangs().get(0);
253.311 + if (!langtag.getExtlangs().isEmpty()) {
253.312 + language = langtag.getExtlangs().get(0);
253.313 } else {
253.314 - String language = langtag.getLanguage();
253.315 - if (!language.equals(LanguageTag.UNDETERMINED)) {
253.316 - _language = language;
253.317 + String lang = langtag.getLanguage();
253.318 + if (!lang.equals(LanguageTag.UNDETERMINED)) {
253.319 + language = lang;
253.320 }
253.321 }
253.322 - _script = langtag.getScript();
253.323 - _region = langtag.getRegion();
253.324 + script = langtag.getScript();
253.325 + region = langtag.getRegion();
253.326
253.327 List<String> bcpVariants = langtag.getVariants();
253.328 - if (bcpVariants.size() > 0) {
253.329 + if (!bcpVariants.isEmpty()) {
253.330 StringBuilder var = new StringBuilder(bcpVariants.get(0));
253.331 - for (int i = 1; i < bcpVariants.size(); i++) {
253.332 + int size = bcpVariants.size();
253.333 + for (int i = 1; i < size; i++) {
253.334 var.append(BaseLocale.SEP).append(bcpVariants.get(i));
253.335 }
253.336 - _variant = var.toString();
253.337 + variant = var.toString();
253.338 }
253.339
253.340 setExtensions(langtag.getExtensions(), langtag.getPrivateuse());
253.341 @@ -361,7 +373,7 @@
253.342 return this;
253.343 }
253.344
253.345 - public InternalLocaleBuilder setLocale(BaseLocale base, LocaleExtensions extensions) throws LocaleSyntaxException {
253.346 + public InternalLocaleBuilder setLocale(BaseLocale base, LocaleExtensions localeExtensions) throws LocaleSyntaxException {
253.347 String language = base.getLanguage();
253.348 String script = base.getScript();
253.349 String region = base.getRegion();
253.350 @@ -373,14 +385,14 @@
253.351 if (language.equals("ja") && region.equals("JP") && variant.equals("JP")) {
253.352 // When locale ja_JP_JP is created, ca-japanese is always there.
253.353 // The builder ignores the variant "JP"
253.354 - assert("japanese".equals(extensions.getUnicodeLocaleType("ca")));
253.355 + assert("japanese".equals(localeExtensions.getUnicodeLocaleType("ca")));
253.356 variant = "";
253.357 }
253.358 // Exception 2 - th_TH_TH
253.359 else if (language.equals("th") && region.equals("TH") && variant.equals("TH")) {
253.360 // When locale th_TH_TH is created, nu-thai is always there.
253.361 // The builder ignores the variant "TH"
253.362 - assert("thai".equals(extensions.getUnicodeLocaleType("nu")));
253.363 + assert("thai".equals(localeExtensions.getUnicodeLocaleType("nu")));
253.364 variant = "";
253.365 }
253.366 // Exception 3 - no_NO_NY
253.367 @@ -415,36 +427,36 @@
253.368
253.369 // The input locale is validated at this point.
253.370 // Now, updating builder's internal fields.
253.371 - _language = language;
253.372 - _script = script;
253.373 - _region = region;
253.374 - _variant = variant;
253.375 + this.language = language;
253.376 + this.script = script;
253.377 + this.region = region;
253.378 + this.variant = variant;
253.379 clearExtensions();
253.380
253.381 - Set<Character> extKeys = (extensions == null) ? null : extensions.getKeys();
253.382 + Set<Character> extKeys = (localeExtensions == null) ? null : localeExtensions.getKeys();
253.383 if (extKeys != null) {
253.384 - // map extensions back to builder's internal format
253.385 + // map localeExtensions back to builder's internal format
253.386 for (Character key : extKeys) {
253.387 - Extension e = extensions.getExtension(key);
253.388 + Extension e = localeExtensions.getExtension(key);
253.389 if (e instanceof UnicodeLocaleExtension) {
253.390 UnicodeLocaleExtension ue = (UnicodeLocaleExtension)e;
253.391 for (String uatr : ue.getUnicodeLocaleAttributes()) {
253.392 - if (_uattributes == null) {
253.393 - _uattributes = new HashSet<CaseInsensitiveString>(4);
253.394 + if (uattributes == null) {
253.395 + uattributes = new HashSet<>(4);
253.396 }
253.397 - _uattributes.add(new CaseInsensitiveString(uatr));
253.398 + uattributes.add(new CaseInsensitiveString(uatr));
253.399 }
253.400 for (String ukey : ue.getUnicodeLocaleKeys()) {
253.401 - if (_ukeywords == null) {
253.402 - _ukeywords = new HashMap<CaseInsensitiveString, String>(4);
253.403 + if (ukeywords == null) {
253.404 + ukeywords = new HashMap<>(4);
253.405 }
253.406 - _ukeywords.put(new CaseInsensitiveString(ukey), ue.getUnicodeLocaleType(ukey));
253.407 + ukeywords.put(new CaseInsensitiveString(ukey), ue.getUnicodeLocaleType(ukey));
253.408 }
253.409 } else {
253.410 - if (_extensions == null) {
253.411 - _extensions = new HashMap<CaseInsensitiveChar, String>(4);
253.412 + if (extensions == null) {
253.413 + extensions = new HashMap<>(4);
253.414 }
253.415 - _extensions.put(new CaseInsensitiveChar(key.charValue()), e.getValue());
253.416 + extensions.put(new CaseInsensitiveChar(key), e.getValue());
253.417 }
253.418 }
253.419 }
253.420 @@ -452,37 +464,37 @@
253.421 }
253.422
253.423 public InternalLocaleBuilder clear() {
253.424 - _language = "";
253.425 - _script = "";
253.426 - _region = "";
253.427 - _variant = "";
253.428 + language = "";
253.429 + script = "";
253.430 + region = "";
253.431 + variant = "";
253.432 clearExtensions();
253.433 return this;
253.434 }
253.435
253.436 public InternalLocaleBuilder clearExtensions() {
253.437 - if (_extensions != null) {
253.438 - _extensions.clear();
253.439 + if (extensions != null) {
253.440 + extensions.clear();
253.441 }
253.442 - if (_uattributes != null) {
253.443 - _uattributes.clear();
253.444 + if (uattributes != null) {
253.445 + uattributes.clear();
253.446 }
253.447 - if (_ukeywords != null) {
253.448 - _ukeywords.clear();
253.449 + if (ukeywords != null) {
253.450 + ukeywords.clear();
253.451 }
253.452 return this;
253.453 }
253.454
253.455 public BaseLocale getBaseLocale() {
253.456 - String language = _language;
253.457 - String script = _script;
253.458 - String region = _region;
253.459 - String variant = _variant;
253.460 + String language = this.language;
253.461 + String script = this.script;
253.462 + String region = this.region;
253.463 + String variant = this.variant;
253.464
253.465 // Special private use subtag sequence identified by "lvariant" will be
253.466 // interpreted as Java variant.
253.467 - if (_extensions != null) {
253.468 - String privuse = _extensions.get(PRIVUSE_KEY);
253.469 + if (extensions != null) {
253.470 + String privuse = extensions.get(PRIVATEUSE_KEY);
253.471 if (privuse != null) {
253.472 StringTokenIterator itr = new StringTokenIterator(privuse, LanguageTag.SEP);
253.473 boolean sawPrefix = false;
253.474 @@ -492,7 +504,7 @@
253.475 privVarStart = itr.currentStart();
253.476 break;
253.477 }
253.478 - if (AsciiUtil.caseIgnoreMatch(itr.current(), LanguageTag.PRIVUSE_VARIANT_PREFIX)) {
253.479 + if (LocaleUtils.caseIgnoreMatch(itr.current(), LanguageTag.PRIVUSE_VARIANT_PREFIX)) {
253.480 sawPrefix = true;
253.481 }
253.482 itr.next();
253.483 @@ -502,7 +514,8 @@
253.484 if (sb.length() != 0) {
253.485 sb.append(BaseLocale.SEP);
253.486 }
253.487 - sb.append(privuse.substring(privVarStart).replaceAll(LanguageTag.SEP, BaseLocale.SEP));
253.488 + sb.append(privuse.substring(privVarStart).replaceAll(LanguageTag.SEP,
253.489 + BaseLocale.SEP));
253.490 variant = sb.toString();
253.491 }
253.492 }
253.493 @@ -512,13 +525,13 @@
253.494 }
253.495
253.496 public LocaleExtensions getLocaleExtensions() {
253.497 - if ((_extensions == null || _extensions.size() == 0)
253.498 - && (_uattributes == null || _uattributes.size() == 0)
253.499 - && (_ukeywords == null || _ukeywords.size() == 0)) {
253.500 - return LocaleExtensions.EMPTY_EXTENSIONS;
253.501 + if (LocaleUtils.isEmpty(extensions) && LocaleUtils.isEmpty(uattributes)
253.502 + && LocaleUtils.isEmpty(ukeywords)) {
253.503 + return null;
253.504 }
253.505
253.506 - return new LocaleExtensions(_extensions, _uattributes, _ukeywords);
253.507 + LocaleExtensions lext = new LocaleExtensions(extensions, uattributes, ukeywords);
253.508 + return lext.isEmpty() ? null : lext;
253.509 }
253.510
253.511 /*
253.512 @@ -540,7 +553,7 @@
253.513 sawPrivuseVar = true;
253.514 break;
253.515 }
253.516 - if (AsciiUtil.caseIgnoreMatch(itr.current(), LanguageTag.PRIVUSE_VARIANT_PREFIX)) {
253.517 + if (LocaleUtils.caseIgnoreMatch(itr.current(), LanguageTag.PRIVUSE_VARIANT_PREFIX)) {
253.518 prefixStart = itr.currentStart();
253.519 }
253.520 itr.next();
253.521 @@ -576,11 +589,11 @@
253.522 */
253.523 private void setUnicodeLocaleExtension(String subtags) {
253.524 // wipe out existing attributes/keywords
253.525 - if (_uattributes != null) {
253.526 - _uattributes.clear();
253.527 + if (uattributes != null) {
253.528 + uattributes.clear();
253.529 }
253.530 - if (_ukeywords != null) {
253.531 - _ukeywords.clear();
253.532 + if (ukeywords != null) {
253.533 + ukeywords.clear();
253.534 }
253.535
253.536 StringTokenIterator itr = new StringTokenIterator(subtags, LanguageTag.SEP);
253.537 @@ -590,10 +603,10 @@
253.538 if (!UnicodeLocaleExtension.isAttribute(itr.current())) {
253.539 break;
253.540 }
253.541 - if (_uattributes == null) {
253.542 - _uattributes = new HashSet<CaseInsensitiveString>(4);
253.543 + if (uattributes == null) {
253.544 + uattributes = new HashSet<>(4);
253.545 }
253.546 - _uattributes.add(new CaseInsensitiveString(itr.current()));
253.547 + uattributes.add(new CaseInsensitiveString(itr.current()));
253.548 itr.next();
253.549 }
253.550
253.551 @@ -608,14 +621,14 @@
253.552 // next keyword - emit previous one
253.553 assert(typeStart == -1 || typeEnd != -1);
253.554 type = (typeStart == -1) ? "" : subtags.substring(typeStart, typeEnd);
253.555 - if (_ukeywords == null) {
253.556 - _ukeywords = new HashMap<CaseInsensitiveString, String>(4);
253.557 + if (ukeywords == null) {
253.558 + ukeywords = new HashMap<>(4);
253.559 }
253.560 - _ukeywords.put(key, type);
253.561 + ukeywords.put(key, type);
253.562
253.563 // reset keyword info
253.564 CaseInsensitiveString tmpKey = new CaseInsensitiveString(itr.current());
253.565 - key = _ukeywords.containsKey(tmpKey) ? null : tmpKey;
253.566 + key = ukeywords.containsKey(tmpKey) ? null : tmpKey;
253.567 typeStart = typeEnd = -1;
253.568 } else {
253.569 if (typeStart == -1) {
253.570 @@ -627,7 +640,7 @@
253.571 // 1. first keyword or
253.572 // 2. next keyword, but previous one was duplicate
253.573 key = new CaseInsensitiveString(itr.current());
253.574 - if (_ukeywords != null && _ukeywords.containsKey(key)) {
253.575 + if (ukeywords != null && ukeywords.containsKey(key)) {
253.576 // duplicate
253.577 key = null;
253.578 }
253.579 @@ -638,10 +651,10 @@
253.580 // last keyword
253.581 assert(typeStart == -1 || typeEnd != -1);
253.582 type = (typeStart == -1) ? "" : subtags.substring(typeStart, typeEnd);
253.583 - if (_ukeywords == null) {
253.584 - _ukeywords = new HashMap<CaseInsensitiveString, String>(4);
253.585 + if (ukeywords == null) {
253.586 + ukeywords = new HashMap<>(4);
253.587 }
253.588 - _ukeywords.put(key, type);
253.589 + ukeywords.put(key, type);
253.590 }
253.591 break;
253.592 }
253.593 @@ -650,21 +663,24 @@
253.594 }
253.595 }
253.596
253.597 - static class CaseInsensitiveString {
253.598 - private String _s;
253.599 + static final class CaseInsensitiveString {
253.600 + private final String str, lowerStr;
253.601
253.602 CaseInsensitiveString(String s) {
253.603 - _s = s;
253.604 + str = s;
253.605 + lowerStr = LocaleUtils.toLowerString(s);
253.606 }
253.607
253.608 public String value() {
253.609 - return _s;
253.610 + return str;
253.611 }
253.612
253.613 + @Override
253.614 public int hashCode() {
253.615 - return AsciiUtil.toLowerString(_s).hashCode();
253.616 + return lowerStr.hashCode();
253.617 }
253.618
253.619 + @Override
253.620 public boolean equals(Object obj) {
253.621 if (this == obj) {
253.622 return true;
253.623 @@ -672,25 +688,36 @@
253.624 if (!(obj instanceof CaseInsensitiveString)) {
253.625 return false;
253.626 }
253.627 - return AsciiUtil.caseIgnoreMatch(_s, ((CaseInsensitiveString)obj).value());
253.628 + return lowerStr.equals(((CaseInsensitiveString)obj).lowerStr);
253.629 }
253.630 }
253.631
253.632 - static class CaseInsensitiveChar {
253.633 - private char _c;
253.634 + static final class CaseInsensitiveChar {
253.635 + private final char ch, lowerCh;
253.636 +
253.637 + /**
253.638 + * Constructs a CaseInsensitiveChar with the first char of the
253.639 + * given s.
253.640 + */
253.641 + private CaseInsensitiveChar(String s) {
253.642 + this(s.charAt(0));
253.643 + }
253.644
253.645 CaseInsensitiveChar(char c) {
253.646 - _c = c;
253.647 + ch = c;
253.648 + lowerCh = LocaleUtils.toLower(ch);
253.649 }
253.650
253.651 public char value() {
253.652 - return _c;
253.653 + return ch;
253.654 }
253.655
253.656 + @Override
253.657 public int hashCode() {
253.658 - return AsciiUtil.toLower(_c);
253.659 + return lowerCh;
253.660 }
253.661
253.662 + @Override
253.663 public boolean equals(Object obj) {
253.664 if (this == obj) {
253.665 return true;
253.666 @@ -698,8 +725,7 @@
253.667 if (!(obj instanceof CaseInsensitiveChar)) {
253.668 return false;
253.669 }
253.670 - return _c == AsciiUtil.toLower(((CaseInsensitiveChar)obj).value());
253.671 + return lowerCh == ((CaseInsensitiveChar)obj).lowerCh;
253.672 }
253.673 -
253.674 }
253.675 }
254.1 --- a/src/share/classes/sun/util/locale/LanguageTag.java Tue Apr 19 16:01:27 2011 -0700
254.2 +++ b/src/share/classes/sun/util/locale/LanguageTag.java Tue Apr 26 15:48:03 2011 -0700
254.3 @@ -44,25 +44,25 @@
254.4 //
254.5 public static final String SEP = "-";
254.6 public static final String PRIVATEUSE = "x";
254.7 - public static String UNDETERMINED = "und";
254.8 + public static final String UNDETERMINED = "und";
254.9 public static final String PRIVUSE_VARIANT_PREFIX = "lvariant";
254.10
254.11 //
254.12 // Language subtag fields
254.13 //
254.14 - private String _language = ""; // language subtag
254.15 - private String _script = ""; // script subtag
254.16 - private String _region = ""; // region subtag
254.17 - private String _privateuse = ""; // privateuse
254.18 + private String language = ""; // language subtag
254.19 + private String script = ""; // script subtag
254.20 + private String region = ""; // region subtag
254.21 + private String privateuse = ""; // privateuse
254.22
254.23 - private List<String> _extlangs = Collections.emptyList(); // extlang subtags
254.24 - private List<String> _variants = Collections.emptyList(); // variant subtags
254.25 - private List<String> _extensions = Collections.emptyList(); // extensions
254.26 + private List<String> extlangs = Collections.emptyList(); // extlang subtags
254.27 + private List<String> variants = Collections.emptyList(); // variant subtags
254.28 + private List<String> extensions = Collections.emptyList(); // extensions
254.29
254.30 // Map contains grandfathered tags and its preferred mappings from
254.31 // http://www.ietf.org/rfc/rfc5646.txt
254.32 - private static final Map<AsciiUtil.CaseInsensitiveKey, String[]> GRANDFATHERED =
254.33 - new HashMap<AsciiUtil.CaseInsensitiveKey, String[]>();
254.34 + // Keys are lower-case strings.
254.35 + private static final Map<String, String[]> GRANDFATHERED = new HashMap<>();
254.36
254.37 static {
254.38 // grandfathered = irregular ; non-redundant tags registered
254.39 @@ -126,7 +126,7 @@
254.40 {"zh-xiang", "hsn"},
254.41 };
254.42 for (String[] e : entries) {
254.43 - GRANDFATHERED.put(new AsciiUtil.CaseInsensitiveKey(e[0]), e);
254.44 + GRANDFATHERED.put(LocaleUtils.toLowerString(e[0]), e);
254.45 }
254.46 }
254.47
254.48 @@ -188,7 +188,7 @@
254.49 StringTokenIterator itr;
254.50
254.51 // Check if the tag is grandfathered
254.52 - String[] gfmap = GRANDFATHERED.get(new AsciiUtil.CaseInsensitiveKey(languageTag));
254.53 + String[] gfmap = GRANDFATHERED.get(LocaleUtils.toLowerString(languageTag));
254.54 if (gfmap != null) {
254.55 // use preferred mapping
254.56 itr = new StringTokenIterator(gfmap[1], SEP);
254.57 @@ -210,11 +210,11 @@
254.58
254.59 if (!itr.isDone() && !sts.isError()) {
254.60 String s = itr.current();
254.61 - sts._errorIndex = itr.currentStart();
254.62 + sts.errorIndex = itr.currentStart();
254.63 if (s.length() == 0) {
254.64 - sts._errorMsg = "Empty subtag";
254.65 + sts.errorMsg = "Empty subtag";
254.66 } else {
254.67 - sts._errorMsg = "Invalid subtag: " + s;
254.68 + sts.errorMsg = "Invalid subtag: " + s;
254.69 }
254.70 }
254.71
254.72 @@ -235,8 +235,8 @@
254.73 String s = itr.current();
254.74 if (isLanguage(s)) {
254.75 found = true;
254.76 - _language = s;
254.77 - sts._parseLength = itr.currentEnd();
254.78 + language = s;
254.79 + sts.parseLength = itr.currentEnd();
254.80 itr.next();
254.81 }
254.82
254.83 @@ -256,14 +256,14 @@
254.84 break;
254.85 }
254.86 found = true;
254.87 - if (_extlangs.isEmpty()) {
254.88 - _extlangs = new ArrayList<String>(3);
254.89 + if (extlangs.isEmpty()) {
254.90 + extlangs = new ArrayList<>(3);
254.91 }
254.92 - _extlangs.add(s);
254.93 - sts._parseLength = itr.currentEnd();
254.94 + extlangs.add(s);
254.95 + sts.parseLength = itr.currentEnd();
254.96 itr.next();
254.97
254.98 - if (_extlangs.size() == 3) {
254.99 + if (extlangs.size() == 3) {
254.100 // Maximum 3 extlangs
254.101 break;
254.102 }
254.103 @@ -282,8 +282,8 @@
254.104 String s = itr.current();
254.105 if (isScript(s)) {
254.106 found = true;
254.107 - _script = s;
254.108 - sts._parseLength = itr.currentEnd();
254.109 + script = s;
254.110 + sts.parseLength = itr.currentEnd();
254.111 itr.next();
254.112 }
254.113
254.114 @@ -300,8 +300,8 @@
254.115 String s = itr.current();
254.116 if (isRegion(s)) {
254.117 found = true;
254.118 - _region = s;
254.119 - sts._parseLength = itr.currentEnd();
254.120 + region = s;
254.121 + sts.parseLength = itr.currentEnd();
254.122 itr.next();
254.123 }
254.124
254.125 @@ -321,11 +321,11 @@
254.126 break;
254.127 }
254.128 found = true;
254.129 - if (_variants.isEmpty()) {
254.130 - _variants = new ArrayList<String>(3);
254.131 + if (variants.isEmpty()) {
254.132 + variants = new ArrayList<>(3);
254.133 }
254.134 - _variants.add(s);
254.135 - sts._parseLength = itr.currentEnd();
254.136 + variants.add(s);
254.137 + sts.parseLength = itr.currentEnd();
254.138 itr.next();
254.139 }
254.140
254.141 @@ -351,23 +351,23 @@
254.142 s = itr.current();
254.143 if (isExtensionSubtag(s)) {
254.144 sb.append(SEP).append(s);
254.145 - sts._parseLength = itr.currentEnd();
254.146 + sts.parseLength = itr.currentEnd();
254.147 } else {
254.148 break;
254.149 }
254.150 itr.next();
254.151 }
254.152
254.153 - if (sts._parseLength <= start) {
254.154 - sts._errorIndex = start;
254.155 - sts._errorMsg = "Incomplete extension '" + singleton + "'";
254.156 + if (sts.parseLength <= start) {
254.157 + sts.errorIndex = start;
254.158 + sts.errorMsg = "Incomplete extension '" + singleton + "'";
254.159 break;
254.160 }
254.161
254.162 - if (_extensions.size() == 0) {
254.163 - _extensions = new ArrayList<String>(4);
254.164 + if (extensions.isEmpty()) {
254.165 + extensions = new ArrayList<>(4);
254.166 }
254.167 - _extensions.add(sb.toString());
254.168 + extensions.add(sb.toString());
254.169 found = true;
254.170 } else {
254.171 break;
254.172 @@ -395,17 +395,17 @@
254.173 break;
254.174 }
254.175 sb.append(SEP).append(s);
254.176 - sts._parseLength = itr.currentEnd();
254.177 + sts.parseLength = itr.currentEnd();
254.178
254.179 itr.next();
254.180 }
254.181
254.182 - if (sts._parseLength <= start) {
254.183 + if (sts.parseLength <= start) {
254.184 // need at least 1 private subtag
254.185 - sts._errorIndex = start;
254.186 - sts._errorMsg = "Incomplete privateuse";
254.187 + sts.errorIndex = start;
254.188 + sts.errorMsg = "Incomplete privateuse";
254.189 } else {
254.190 - _privateuse = sb.toString();
254.191 + privateuse = sb.toString();
254.192 found = true;
254.193 }
254.194 }
254.195 @@ -425,9 +425,8 @@
254.196
254.197 String privuseVar = null; // store ill-formed variant subtags
254.198
254.199 - if (language.length() > 0 && isLanguage(language)) {
254.200 - // Convert a deprecated language code used by Java to
254.201 - // a new code
254.202 + if (isLanguage(language)) {
254.203 + // Convert a deprecated language code to its new code
254.204 if (language.equals("iw")) {
254.205 language = "he";
254.206 } else if (language.equals("ji")) {
254.207 @@ -435,22 +434,22 @@
254.208 } else if (language.equals("in")) {
254.209 language = "id";
254.210 }
254.211 - tag._language = language;
254.212 + tag.language = language;
254.213 }
254.214
254.215 - if (script.length() > 0 && isScript(script)) {
254.216 - tag._script = canonicalizeScript(script);
254.217 + if (isScript(script)) {
254.218 + tag.script = canonicalizeScript(script);
254.219 hasSubtag = true;
254.220 }
254.221
254.222 - if (region.length() > 0 && isRegion(region)) {
254.223 - tag._region = canonicalizeRegion(region);
254.224 + if (isRegion(region)) {
254.225 + tag.region = canonicalizeRegion(region);
254.226 hasSubtag = true;
254.227 }
254.228
254.229 // Special handling for no_NO_NY - use nn_NO for language tag
254.230 - if (tag._language.equals("no") && tag._region.equals("NO") && variant.equals("NY")) {
254.231 - tag._language = "nn";
254.232 + if (tag.language.equals("no") && tag.region.equals("NO") && variant.equals("NY")) {
254.233 + tag.language = "nn";
254.234 variant = "";
254.235 }
254.236
254.237 @@ -463,13 +462,13 @@
254.238 break;
254.239 }
254.240 if (variants == null) {
254.241 - variants = new ArrayList<String>();
254.242 + variants = new ArrayList<>();
254.243 }
254.244 variants.add(var); // Do not canonicalize!
254.245 varitr.next();
254.246 }
254.247 if (variants != null) {
254.248 - tag._variants = variants;
254.249 + tag.variants = variants;
254.250 hasSubtag = true;
254.251 }
254.252 if (!varitr.isDone()) {
254.253 @@ -496,21 +495,23 @@
254.254 List<String> extensions = null;
254.255 String privateuse = null;
254.256
254.257 - Set<Character> locextKeys = localeExtensions.getKeys();
254.258 - for (Character locextKey : locextKeys) {
254.259 - Extension ext = localeExtensions.getExtension(locextKey);
254.260 - if (isPrivateusePrefixChar(locextKey.charValue())) {
254.261 - privateuse = ext.getValue();
254.262 - } else {
254.263 - if (extensions == null) {
254.264 - extensions = new ArrayList<String>();
254.265 + if (localeExtensions != null) {
254.266 + Set<Character> locextKeys = localeExtensions.getKeys();
254.267 + for (Character locextKey : locextKeys) {
254.268 + Extension ext = localeExtensions.getExtension(locextKey);
254.269 + if (isPrivateusePrefixChar(locextKey)) {
254.270 + privateuse = ext.getValue();
254.271 + } else {
254.272 + if (extensions == null) {
254.273 + extensions = new ArrayList<>();
254.274 + }
254.275 + extensions.add(locextKey.toString() + SEP + ext.getValue());
254.276 }
254.277 - extensions.add(locextKey.toString() + SEP + ext.getValue());
254.278 }
254.279 }
254.280
254.281 if (extensions != null) {
254.282 - tag._extensions = extensions;
254.283 + tag.extensions = extensions;
254.284 hasSubtag = true;
254.285 }
254.286
254.287 @@ -519,19 +520,20 @@
254.288 if (privateuse == null) {
254.289 privateuse = PRIVUSE_VARIANT_PREFIX + SEP + privuseVar;
254.290 } else {
254.291 - privateuse = privateuse + SEP + PRIVUSE_VARIANT_PREFIX + SEP + privuseVar.replace(BaseLocale.SEP, SEP);
254.292 + privateuse = privateuse + SEP + PRIVUSE_VARIANT_PREFIX
254.293 + + SEP + privuseVar.replace(BaseLocale.SEP, SEP);
254.294 }
254.295 }
254.296
254.297 if (privateuse != null) {
254.298 - tag._privateuse = privateuse;
254.299 + tag.privateuse = privateuse;
254.300 }
254.301
254.302 - if (tag._language.length() == 0 && (hasSubtag || privateuse == null)) {
254.303 + if (tag.language.length() == 0 && (hasSubtag || privateuse == null)) {
254.304 // use lang "und" when 1) no language is available AND
254.305 // 2) any of other subtags other than private use are available or
254.306 // no private use tag is available
254.307 - tag._language = UNDETERMINED;
254.308 + tag.language = UNDETERMINED;
254.309 }
254.310
254.311 return tag;
254.312 @@ -542,31 +544,40 @@
254.313 //
254.314
254.315 public String getLanguage() {
254.316 - return _language;
254.317 + return language;
254.318 }
254.319
254.320 public List<String> getExtlangs() {
254.321 - return Collections.unmodifiableList(_extlangs);
254.322 + if (extlangs.isEmpty()) {
254.323 + return Collections.emptyList();
254.324 + }
254.325 + return Collections.unmodifiableList(extlangs);
254.326 }
254.327
254.328 public String getScript() {
254.329 - return _script;
254.330 + return script;
254.331 }
254.332
254.333 public String getRegion() {
254.334 - return _region;
254.335 + return region;
254.336 }
254.337
254.338 public List<String> getVariants() {
254.339 - return Collections.unmodifiableList(_variants);
254.340 + if (variants.isEmpty()) {
254.341 + return Collections.emptyList();
254.342 + }
254.343 + return Collections.unmodifiableList(variants);
254.344 }
254.345
254.346 public List<String> getExtensions() {
254.347 - return Collections.unmodifiableList(_extensions);
254.348 + if (extensions.isEmpty()) {
254.349 + return Collections.emptyList();
254.350 + }
254.351 + return Collections.unmodifiableList(extensions);
254.352 }
254.353
254.354 public String getPrivateuse() {
254.355 - return _privateuse;
254.356 + return privateuse;
254.357 }
254.358
254.359 //
254.360 @@ -579,25 +590,26 @@
254.361 // ; extended language subtags
254.362 // / 4ALPHA ; or reserved for future use
254.363 // / 5*8ALPHA ; or registered language subtag
254.364 - return (s.length() >= 2) && (s.length() <= 8) && AsciiUtil.isAlphaString(s);
254.365 + int len = s.length();
254.366 + return (len >= 2) && (len <= 8) && LocaleUtils.isAlphaString(s);
254.367 }
254.368
254.369 public static boolean isExtlang(String s) {
254.370 // extlang = 3ALPHA ; selected ISO 639 codes
254.371 // *2("-" 3ALPHA) ; permanently reserved
254.372 - return (s.length() == 3) && AsciiUtil.isAlphaString(s);
254.373 + return (s.length() == 3) && LocaleUtils.isAlphaString(s);
254.374 }
254.375
254.376 public static boolean isScript(String s) {
254.377 // script = 4ALPHA ; ISO 15924 code
254.378 - return (s.length() == 4) && AsciiUtil.isAlphaString(s);
254.379 + return (s.length() == 4) && LocaleUtils.isAlphaString(s);
254.380 }
254.381
254.382 public static boolean isRegion(String s) {
254.383 // region = 2ALPHA ; ISO 3166-1 code
254.384 // / 3DIGIT ; UN M.49 code
254.385 - return ((s.length() == 2) && AsciiUtil.isAlphaString(s))
254.386 - || ((s.length() == 3) && AsciiUtil.isNumericString(s));
254.387 + return ((s.length() == 2) && LocaleUtils.isAlphaString(s))
254.388 + || ((s.length() == 3) && LocaleUtils.isNumericString(s));
254.389 }
254.390
254.391 public static boolean isVariant(String s) {
254.392 @@ -605,13 +617,13 @@
254.393 // / (DIGIT 3alphanum)
254.394 int len = s.length();
254.395 if (len >= 5 && len <= 8) {
254.396 - return AsciiUtil.isAlphaNumericString(s);
254.397 + return LocaleUtils.isAlphaNumericString(s);
254.398 }
254.399 if (len == 4) {
254.400 - return AsciiUtil.isNumeric(s.charAt(0))
254.401 - && AsciiUtil.isAlphaNumeric(s.charAt(1))
254.402 - && AsciiUtil.isAlphaNumeric(s.charAt(2))
254.403 - && AsciiUtil.isAlphaNumeric(s.charAt(3));
254.404 + return LocaleUtils.isNumeric(s.charAt(0))
254.405 + && LocaleUtils.isAlphaNumeric(s.charAt(1))
254.406 + && LocaleUtils.isAlphaNumeric(s.charAt(2))
254.407 + && LocaleUtils.isAlphaNumeric(s.charAt(3));
254.408 }
254.409 return false;
254.410 }
254.411 @@ -624,8 +636,8 @@
254.412 // / %x79-7A ; y - z
254.413
254.414 return (s.length() == 1)
254.415 - && AsciiUtil.isAlphaString(s)
254.416 - && !AsciiUtil.caseIgnoreMatch(PRIVATEUSE, s);
254.417 + && LocaleUtils.isAlphaString(s)
254.418 + && !LocaleUtils.caseIgnoreMatch(PRIVATEUSE, s);
254.419 }
254.420
254.421 public static boolean isExtensionSingletonChar(char c) {
254.422 @@ -634,22 +646,24 @@
254.423
254.424 public static boolean isExtensionSubtag(String s) {
254.425 // extension = singleton 1*("-" (2*8alphanum))
254.426 - return (s.length() >= 2) && (s.length() <= 8) && AsciiUtil.isAlphaNumericString(s);
254.427 + int len = s.length();
254.428 + return (len >= 2) && (len <= 8) && LocaleUtils.isAlphaNumericString(s);
254.429 }
254.430
254.431 public static boolean isPrivateusePrefix(String s) {
254.432 // privateuse = "x" 1*("-" (1*8alphanum))
254.433 return (s.length() == 1)
254.434 - && AsciiUtil.caseIgnoreMatch(PRIVATEUSE, s);
254.435 + && LocaleUtils.caseIgnoreMatch(PRIVATEUSE, s);
254.436 }
254.437
254.438 public static boolean isPrivateusePrefixChar(char c) {
254.439 - return (AsciiUtil.caseIgnoreMatch(PRIVATEUSE, String.valueOf(c)));
254.440 + return (LocaleUtils.caseIgnoreMatch(PRIVATEUSE, String.valueOf(c)));
254.441 }
254.442
254.443 public static boolean isPrivateuseSubtag(String s) {
254.444 // privateuse = "x" 1*("-" (1*8alphanum))
254.445 - return (s.length() >= 1) && (s.length() <= 8) && AsciiUtil.isAlphaNumericString(s);
254.446 + int len = s.length();
254.447 + return (len >= 1) && (len <= 8) && LocaleUtils.isAlphaNumericString(s);
254.448 }
254.449
254.450 //
254.451 @@ -657,76 +671,77 @@
254.452 //
254.453
254.454 public static String canonicalizeLanguage(String s) {
254.455 - return AsciiUtil.toLowerString(s);
254.456 + return LocaleUtils.toLowerString(s);
254.457 }
254.458
254.459 public static String canonicalizeExtlang(String s) {
254.460 - return AsciiUtil.toLowerString(s);
254.461 + return LocaleUtils.toLowerString(s);
254.462 }
254.463
254.464 public static String canonicalizeScript(String s) {
254.465 - return AsciiUtil.toTitleString(s);
254.466 + return LocaleUtils.toTitleString(s);
254.467 }
254.468
254.469 public static String canonicalizeRegion(String s) {
254.470 - return AsciiUtil.toUpperString(s);
254.471 + return LocaleUtils.toUpperString(s);
254.472 }
254.473
254.474 public static String canonicalizeVariant(String s) {
254.475 - return AsciiUtil.toLowerString(s);
254.476 + return LocaleUtils.toLowerString(s);
254.477 }
254.478
254.479 public static String canonicalizeExtension(String s) {
254.480 - return AsciiUtil.toLowerString(s);
254.481 + return LocaleUtils.toLowerString(s);
254.482 }
254.483
254.484 public static String canonicalizeExtensionSingleton(String s) {
254.485 - return AsciiUtil.toLowerString(s);
254.486 + return LocaleUtils.toLowerString(s);
254.487 }
254.488
254.489 public static String canonicalizeExtensionSubtag(String s) {
254.490 - return AsciiUtil.toLowerString(s);
254.491 + return LocaleUtils.toLowerString(s);
254.492 }
254.493
254.494 public static String canonicalizePrivateuse(String s) {
254.495 - return AsciiUtil.toLowerString(s);
254.496 + return LocaleUtils.toLowerString(s);
254.497 }
254.498
254.499 public static String canonicalizePrivateuseSubtag(String s) {
254.500 - return AsciiUtil.toLowerString(s);
254.501 + return LocaleUtils.toLowerString(s);
254.502 }
254.503
254.504 + @Override
254.505 public String toString() {
254.506 StringBuilder sb = new StringBuilder();
254.507
254.508 - if (_language.length() > 0) {
254.509 - sb.append(_language);
254.510 + if (language.length() > 0) {
254.511 + sb.append(language);
254.512
254.513 - for (String extlang : _extlangs) {
254.514 + for (String extlang : extlangs) {
254.515 sb.append(SEP).append(extlang);
254.516 }
254.517
254.518 - if (_script.length() > 0) {
254.519 - sb.append(SEP).append(_script);
254.520 + if (script.length() > 0) {
254.521 + sb.append(SEP).append(script);
254.522 }
254.523
254.524 - if (_region.length() > 0) {
254.525 - sb.append(SEP).append(_region);
254.526 + if (region.length() > 0) {
254.527 + sb.append(SEP).append(region);
254.528 }
254.529
254.530 - for (String variant : _extlangs) {
254.531 + for (String variant : variants) {
254.532 sb.append(SEP).append(variant);
254.533 }
254.534
254.535 - for (String extension : _extensions) {
254.536 + for (String extension : extensions) {
254.537 sb.append(SEP).append(extension);
254.538 }
254.539 }
254.540 - if (_privateuse.length() > 0) {
254.541 + if (privateuse.length() > 0) {
254.542 if (sb.length() > 0) {
254.543 sb.append(SEP);
254.544 }
254.545 - sb.append(_privateuse);
254.546 + sb.append(privateuse);
254.547 }
254.548
254.549 return sb.toString();
255.1 --- a/src/share/classes/sun/util/locale/LocaleExtensions.java Tue Apr 19 16:01:27 2011 -0700
255.2 +++ b/src/share/classes/sun/util/locale/LocaleExtensions.java Tue Apr 26 15:48:03 2011 -0700
255.3 @@ -1,5 +1,5 @@
255.4 /*
255.5 - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
255.6 + * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
255.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
255.8 *
255.9 * This code is free software; you can redistribute it and/or modify it
255.10 @@ -36,6 +36,7 @@
255.11 import java.util.Map.Entry;
255.12 import java.util.Set;
255.13 import java.util.SortedMap;
255.14 +import java.util.SortedSet;
255.15 import java.util.TreeMap;
255.16 import java.util.TreeSet;
255.17
255.18 @@ -45,55 +46,45 @@
255.19
255.20 public class LocaleExtensions {
255.21
255.22 - private SortedMap<Character, Extension> _map;
255.23 - private String _id;
255.24 + private final Map<Character, Extension> extensionMap;
255.25 + private final String id;
255.26
255.27 - private static final SortedMap<Character, Extension> EMPTY_MAP =
255.28 - Collections.unmodifiableSortedMap(new TreeMap<Character, Extension>());
255.29 + public static final LocaleExtensions CALENDAR_JAPANESE
255.30 + = new LocaleExtensions("u-ca-japanese",
255.31 + UnicodeLocaleExtension.SINGLETON,
255.32 + UnicodeLocaleExtension.CA_JAPANESE);
255.33
255.34 - public static final LocaleExtensions EMPTY_EXTENSIONS;
255.35 - public static final LocaleExtensions CALENDAR_JAPANESE;
255.36 - public static final LocaleExtensions NUMBER_THAI;
255.37 + public static final LocaleExtensions NUMBER_THAI
255.38 + = new LocaleExtensions("u-nu-thai",
255.39 + UnicodeLocaleExtension.SINGLETON,
255.40 + UnicodeLocaleExtension.NU_THAI);
255.41
255.42 - static {
255.43 - EMPTY_EXTENSIONS = new LocaleExtensions();
255.44 - EMPTY_EXTENSIONS._id = "";
255.45 - EMPTY_EXTENSIONS._map = EMPTY_MAP;
255.46 -
255.47 - CALENDAR_JAPANESE = new LocaleExtensions();
255.48 - CALENDAR_JAPANESE._id = "u-ca-japanese";
255.49 - CALENDAR_JAPANESE._map = new TreeMap<Character, Extension>();
255.50 - CALENDAR_JAPANESE._map.put(Character.valueOf(UnicodeLocaleExtension.SINGLETON), UnicodeLocaleExtension.CA_JAPANESE);
255.51 -
255.52 - NUMBER_THAI = new LocaleExtensions();
255.53 - NUMBER_THAI._id = "u-nu-thai";
255.54 - NUMBER_THAI._map = new TreeMap<Character, Extension>();
255.55 - NUMBER_THAI._map.put(Character.valueOf(UnicodeLocaleExtension.SINGLETON), UnicodeLocaleExtension.NU_THAI);
255.56 - }
255.57 -
255.58 - private LocaleExtensions() {
255.59 + private LocaleExtensions(String id, Character key, Extension value) {
255.60 + this.id = id;
255.61 + this.extensionMap = Collections.singletonMap(key, value);
255.62 }
255.63
255.64 /*
255.65 - * Package local constructor, only used by InternalLocaleBuilder.
255.66 + * Package private constructor, only used by InternalLocaleBuilder.
255.67 */
255.68 LocaleExtensions(Map<CaseInsensitiveChar, String> extensions,
255.69 - Set<CaseInsensitiveString> uattributes, Map<CaseInsensitiveString, String> ukeywords) {
255.70 - boolean hasExtension = (extensions != null && extensions.size() > 0);
255.71 - boolean hasUAttributes = (uattributes != null && uattributes.size() > 0);
255.72 - boolean hasUKeywords = (ukeywords != null && ukeywords.size() > 0);
255.73 + Set<CaseInsensitiveString> uattributes,
255.74 + Map<CaseInsensitiveString, String> ukeywords) {
255.75 + boolean hasExtension = !LocaleUtils.isEmpty(extensions);
255.76 + boolean hasUAttributes = !LocaleUtils.isEmpty(uattributes);
255.77 + boolean hasUKeywords = !LocaleUtils.isEmpty(ukeywords);
255.78
255.79 if (!hasExtension && !hasUAttributes && !hasUKeywords) {
255.80 - _map = EMPTY_MAP;
255.81 - _id = "";
255.82 + id = "";
255.83 + extensionMap = Collections.emptyMap();
255.84 return;
255.85 }
255.86
255.87 // Build extension map
255.88 - _map = new TreeMap<Character, Extension>();
255.89 + SortedMap<Character, Extension> map = new TreeMap<>();
255.90 if (hasExtension) {
255.91 for (Entry<CaseInsensitiveChar, String> ext : extensions.entrySet()) {
255.92 - char key = AsciiUtil.toLower(ext.getKey().value());
255.93 + char key = LocaleUtils.toLower(ext.getKey().value());
255.94 String value = ext.getValue();
255.95
255.96 if (LanguageTag.isPrivateusePrefixChar(key)) {
255.97 @@ -104,54 +95,57 @@
255.98 }
255.99 }
255.100
255.101 - Extension e = new Extension(key, AsciiUtil.toLowerString(value));
255.102 - _map.put(Character.valueOf(key), e);
255.103 + map.put(key, new Extension(key, LocaleUtils.toLowerString(value)));
255.104 }
255.105 }
255.106
255.107 if (hasUAttributes || hasUKeywords) {
255.108 - TreeSet<String> uaset = null;
255.109 - TreeMap<String, String> ukmap = null;
255.110 + SortedSet<String> uaset = null;
255.111 + SortedMap<String, String> ukmap = null;
255.112
255.113 if (hasUAttributes) {
255.114 - uaset = new TreeSet<String>();
255.115 + uaset = new TreeSet<>();
255.116 for (CaseInsensitiveString cis : uattributes) {
255.117 - uaset.add(AsciiUtil.toLowerString(cis.value()));
255.118 + uaset.add(LocaleUtils.toLowerString(cis.value()));
255.119 }
255.120 }
255.121
255.122 if (hasUKeywords) {
255.123 - ukmap = new TreeMap<String, String>();
255.124 + ukmap = new TreeMap<>();
255.125 for (Entry<CaseInsensitiveString, String> kwd : ukeywords.entrySet()) {
255.126 - String key = AsciiUtil.toLowerString(kwd.getKey().value());
255.127 - String type = AsciiUtil.toLowerString(kwd.getValue());
255.128 + String key = LocaleUtils.toLowerString(kwd.getKey().value());
255.129 + String type = LocaleUtils.toLowerString(kwd.getValue());
255.130 ukmap.put(key, type);
255.131 }
255.132 }
255.133
255.134 UnicodeLocaleExtension ule = new UnicodeLocaleExtension(uaset, ukmap);
255.135 - _map.put(Character.valueOf(UnicodeLocaleExtension.SINGLETON), ule);
255.136 + map.put(UnicodeLocaleExtension.SINGLETON, ule);
255.137 }
255.138
255.139 - if (_map.size() == 0) {
255.140 + if (map.isEmpty()) {
255.141 // this could happen when only privuateuse with special variant
255.142 - _map = EMPTY_MAP;
255.143 - _id = "";
255.144 + id = "";
255.145 + extensionMap = Collections.emptyMap();
255.146 } else {
255.147 - _id = toID(_map);
255.148 + id = toID(map);
255.149 + extensionMap = map;
255.150 }
255.151 }
255.152
255.153 public Set<Character> getKeys() {
255.154 - return Collections.unmodifiableSet(_map.keySet());
255.155 + if (extensionMap.isEmpty()) {
255.156 + return Collections.emptySet();
255.157 + }
255.158 + return Collections.unmodifiableSet(extensionMap.keySet());
255.159 }
255.160
255.161 public Extension getExtension(Character key) {
255.162 - return _map.get(Character.valueOf(AsciiUtil.toLower(key.charValue())));
255.163 + return extensionMap.get(LocaleUtils.toLower(key));
255.164 }
255.165
255.166 public String getExtensionValue(Character key) {
255.167 - Extension ext = _map.get(Character.valueOf(AsciiUtil.toLower(key.charValue())));
255.168 + Extension ext = extensionMap.get(LocaleUtils.toLower(key));
255.169 if (ext == null) {
255.170 return null;
255.171 }
255.172 @@ -159,7 +153,7 @@
255.173 }
255.174
255.175 public Set<String> getUnicodeLocaleAttributes() {
255.176 - Extension ext = _map.get(Character.valueOf(UnicodeLocaleExtension.SINGLETON));
255.177 + Extension ext = extensionMap.get(UnicodeLocaleExtension.SINGLETON);
255.178 if (ext == null) {
255.179 return Collections.emptySet();
255.180 }
255.181 @@ -168,7 +162,7 @@
255.182 }
255.183
255.184 public Set<String> getUnicodeLocaleKeys() {
255.185 - Extension ext = _map.get(Character.valueOf(UnicodeLocaleExtension.SINGLETON));
255.186 + Extension ext = extensionMap.get(UnicodeLocaleExtension.SINGLETON);
255.187 if (ext == null) {
255.188 return Collections.emptySet();
255.189 }
255.190 @@ -177,16 +171,16 @@
255.191 }
255.192
255.193 public String getUnicodeLocaleType(String unicodeLocaleKey) {
255.194 - Extension ext = _map.get(Character.valueOf(UnicodeLocaleExtension.SINGLETON));
255.195 + Extension ext = extensionMap.get(UnicodeLocaleExtension.SINGLETON);
255.196 if (ext == null) {
255.197 return null;
255.198 }
255.199 assert (ext instanceof UnicodeLocaleExtension);
255.200 - return ((UnicodeLocaleExtension)ext).getUnicodeLocaleType(AsciiUtil.toLowerString(unicodeLocaleKey));
255.201 + return ((UnicodeLocaleExtension)ext).getUnicodeLocaleType(LocaleUtils.toLowerString(unicodeLocaleKey));
255.202 }
255.203
255.204 public boolean isEmpty() {
255.205 - return _map.isEmpty();
255.206 + return extensionMap.isEmpty();
255.207 }
255.208
255.209 public static boolean isValidKey(char c) {
255.210 @@ -201,7 +195,7 @@
255.211 StringBuilder buf = new StringBuilder();
255.212 Extension privuse = null;
255.213 for (Entry<Character, Extension> entry : map.entrySet()) {
255.214 - char singleton = entry.getKey().charValue();
255.215 + char singleton = entry.getKey();
255.216 Extension extension = entry.getValue();
255.217 if (LanguageTag.isPrivateusePrefixChar(singleton)) {
255.218 privuse = extension;
255.219 @@ -221,19 +215,21 @@
255.220 return buf.toString();
255.221 }
255.222
255.223 -
255.224 + @Override
255.225 public String toString() {
255.226 - return _id;
255.227 + return id;
255.228 }
255.229
255.230 public String getID() {
255.231 - return _id;
255.232 + return id;
255.233 }
255.234
255.235 + @Override
255.236 public int hashCode() {
255.237 - return _id.hashCode();
255.238 + return id.hashCode();
255.239 }
255.240
255.241 + @Override
255.242 public boolean equals(Object other) {
255.243 if (this == other) {
255.244 return true;
255.245 @@ -241,6 +237,6 @@
255.246 if (!(other instanceof LocaleExtensions)) {
255.247 return false;
255.248 }
255.249 - return this._id.equals(((LocaleExtensions)other)._id);
255.250 + return id.equals(((LocaleExtensions)other).id);
255.251 }
255.252 }
256.1 --- a/src/share/classes/sun/util/locale/LocaleObjectCache.java Tue Apr 19 16:01:27 2011 -0700
256.2 +++ b/src/share/classes/sun/util/locale/LocaleObjectCache.java Tue Apr 26 15:48:03 2011 -0700
256.3 @@ -1,5 +1,5 @@
256.4 /*
256.5 - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
256.6 + * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
256.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
256.8 *
256.9 * This code is free software; you can redistribute it and/or modify it
256.10 @@ -34,24 +34,25 @@
256.11 import java.lang.ref.ReferenceQueue;
256.12 import java.lang.ref.SoftReference;
256.13 import java.util.concurrent.ConcurrentHashMap;
256.14 +import java.util.concurrent.ConcurrentMap;
256.15
256.16 public abstract class LocaleObjectCache<K, V> {
256.17 - private ConcurrentHashMap<K, CacheEntry<K, V>> _map;
256.18 - private ReferenceQueue<V> _queue = new ReferenceQueue<V>();
256.19 + private ConcurrentMap<K, CacheEntry<K, V>> map;
256.20 + private ReferenceQueue<V> queue = new ReferenceQueue<>();
256.21
256.22 public LocaleObjectCache() {
256.23 this(16, 0.75f, 16);
256.24 }
256.25
256.26 public LocaleObjectCache(int initialCapacity, float loadFactor, int concurrencyLevel) {
256.27 - _map = new ConcurrentHashMap<K, CacheEntry<K, V>>(initialCapacity, loadFactor, concurrencyLevel);
256.28 + map = new ConcurrentHashMap<>(initialCapacity, loadFactor, concurrencyLevel);
256.29 }
256.30
256.31 public V get(K key) {
256.32 V value = null;
256.33
256.34 cleanStaleEntries();
256.35 - CacheEntry<K, V> entry = _map.get(key);
256.36 + CacheEntry<K, V> entry = map.get(key);
256.37 if (entry != null) {
256.38 value = entry.get();
256.39 }
256.40 @@ -63,11 +64,11 @@
256.41 return null;
256.42 }
256.43
256.44 - CacheEntry<K, V> newEntry = new CacheEntry<K, V>(key, newVal, _queue);
256.45 + CacheEntry<K, V> newEntry = new CacheEntry<>(key, newVal, queue);
256.46
256.47 while (value == null) {
256.48 cleanStaleEntries();
256.49 - entry = _map.putIfAbsent(key, newEntry);
256.50 + entry = map.putIfAbsent(key, newEntry);
256.51 if (entry == null) {
256.52 value = newVal;
256.53 break;
256.54 @@ -79,11 +80,17 @@
256.55 return value;
256.56 }
256.57
256.58 + protected V put(K key, V value) {
256.59 + CacheEntry<K, V> entry = new CacheEntry<>(key, value, queue);
256.60 + CacheEntry<K, V> oldEntry = map.put(key, entry);
256.61 + return (oldEntry == null) ? null : oldEntry.get();
256.62 + }
256.63 +
256.64 @SuppressWarnings("unchecked")
256.65 private void cleanStaleEntries() {
256.66 CacheEntry<K, V> entry;
256.67 - while ((entry = (CacheEntry<K, V>)_queue.poll()) != null) {
256.68 - _map.remove(entry.getKey());
256.69 + while ((entry = (CacheEntry<K, V>)queue.poll()) != null) {
256.70 + map.remove(entry.getKey());
256.71 }
256.72 }
256.73
256.74 @@ -94,15 +101,15 @@
256.75 }
256.76
256.77 private static class CacheEntry<K, V> extends SoftReference<V> {
256.78 - private K _key;
256.79 + private K key;
256.80
256.81 CacheEntry(K key, V value, ReferenceQueue<V> queue) {
256.82 super(value, queue);
256.83 - _key = key;
256.84 + this.key = key;
256.85 }
256.86
256.87 K getKey() {
256.88 - return _key;
256.89 + return key;
256.90 }
256.91 }
256.92 }
257.1 --- a/src/share/classes/sun/util/locale/LocaleSyntaxException.java Tue Apr 19 16:01:27 2011 -0700
257.2 +++ b/src/share/classes/sun/util/locale/LocaleSyntaxException.java Tue Apr 26 15:48:03 2011 -0700
257.3 @@ -1,5 +1,5 @@
257.4 /*
257.5 - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
257.6 + * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
257.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
257.8 *
257.9 * This code is free software; you can redistribute it and/or modify it
257.10 @@ -35,7 +35,7 @@
257.11
257.12 private static final long serialVersionUID = 1L;
257.13
257.14 - private int _index = -1;
257.15 + private int index = -1;
257.16
257.17 public LocaleSyntaxException(String msg) {
257.18 this(msg, 0);
257.19 @@ -43,10 +43,10 @@
257.20
257.21 public LocaleSyntaxException(String msg, int errorIndex) {
257.22 super(msg);
257.23 - _index = errorIndex;
257.24 + index = errorIndex;
257.25 }
257.26
257.27 public int getErrorIndex() {
257.28 - return _index;
257.29 + return index;
257.30 }
257.31 }
258.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
258.2 +++ b/src/share/classes/sun/util/locale/LocaleUtils.java Tue Apr 26 15:48:03 2011 -0700
258.3 @@ -0,0 +1,224 @@
258.4 +/*
258.5 + * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
258.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
258.7 + *
258.8 + * This code is free software; you can redistribute it and/or modify it
258.9 + * under the terms of the GNU General Public License version 2 only, as
258.10 + * published by the Free Software Foundation. Oracle designates this
258.11 + * particular file as subject to the "Classpath" exception as provided
258.12 + * by Oracle in the LICENSE file that accompanied this code.
258.13 + *
258.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
258.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
258.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
258.17 + * version 2 for more details (a copy is included in the LICENSE file that
258.18 + * accompanied this code).
258.19 + *
258.20 + * You should have received a copy of the GNU General Public License version
258.21 + * 2 along with this work; if not, write to the Free Software Foundation,
258.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
258.23 + *
258.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
258.25 + * or visit www.oracle.com if you need additional information or have any
258.26 + * questions.
258.27 + */
258.28 +
258.29 +/*
258.30 + *******************************************************************************
258.31 + * Copyright (C) 2009, International Business Machines Corporation and *
258.32 + * others. All Rights Reserved. *
258.33 + *******************************************************************************
258.34 + */
258.35 +package sun.util.locale;
258.36 +
258.37 +import java.util.List;
258.38 +import java.util.Map;
258.39 +import java.util.Set;
258.40 +
258.41 +/**
258.42 + * Collection of static utility methods for Locale support. The
258.43 + * methods which manipulate characters or strings support ASCII only.
258.44 + */
258.45 +public final class LocaleUtils {
258.46 +
258.47 + private LocaleUtils() {
258.48 + }
258.49 +
258.50 + /**
258.51 + * Compares two ASCII Strings s1 and s2, ignoring case.
258.52 + */
258.53 + public static boolean caseIgnoreMatch(String s1, String s2) {
258.54 + if (s1 == s2) {
258.55 + return true;
258.56 + }
258.57 +
258.58 + int len = s1.length();
258.59 + if (len != s2.length()) {
258.60 + return false;
258.61 + }
258.62 +
258.63 + for (int i = 0; i < len; i++) {
258.64 + char c1 = s1.charAt(i);
258.65 + char c2 = s2.charAt(i);
258.66 + if (c1 != c2 && toLower(c1) != toLower(c2)) {
258.67 + return false;
258.68 + }
258.69 + }
258.70 + return true;
258.71 + }
258.72 +
258.73 + static int caseIgnoreCompare(String s1, String s2) {
258.74 + if (s1 == s2) {
258.75 + return 0;
258.76 + }
258.77 + return toLowerString(s1).compareTo(toLowerString(s2));
258.78 + }
258.79 +
258.80 + static char toUpper(char c) {
258.81 + return isLower(c) ? (char)(c - 0x20) : c;
258.82 + }
258.83 +
258.84 + static char toLower(char c) {
258.85 + return isUpper(c) ? (char)(c + 0x20) : c;
258.86 + }
258.87 +
258.88 + /**
258.89 + * Converts the given ASCII String to lower-case.
258.90 + */
258.91 + public static String toLowerString(String s) {
258.92 + int len = s.length();
258.93 + int idx = 0;
258.94 + for (; idx < len; idx++) {
258.95 + if (isUpper(s.charAt(idx))) {
258.96 + break;
258.97 + }
258.98 + }
258.99 + if (idx == len) {
258.100 + return s;
258.101 + }
258.102 +
258.103 + char[] buf = new char[len];
258.104 + for (int i = 0; i < len; i++) {
258.105 + char c = s.charAt(i);
258.106 + buf[i] = (i < idx) ? c : toLower(c);
258.107 + }
258.108 + return new String(buf);
258.109 + }
258.110 +
258.111 + static String toUpperString(String s) {
258.112 + int len = s.length();
258.113 + int idx = 0;
258.114 + for (; idx < len; idx++) {
258.115 + if (isLower(s.charAt(idx))) {
258.116 + break;
258.117 + }
258.118 + }
258.119 + if (idx == len) {
258.120 + return s;
258.121 + }
258.122 +
258.123 + char[] buf = new char[len];
258.124 + for (int i = 0; i < len; i++) {
258.125 + char c = s.charAt(i);
258.126 + buf[i] = (i < idx) ? c : toUpper(c);
258.127 + }
258.128 + return new String(buf);
258.129 + }
258.130 +
258.131 + static String toTitleString(String s) {
258.132 + int len;
258.133 + if ((len = s.length()) == 0) {
258.134 + return s;
258.135 + }
258.136 + int idx = 0;
258.137 + if (!isLower(s.charAt(idx))) {
258.138 + for (idx = 1; idx < len; idx++) {
258.139 + if (isUpper(s.charAt(idx))) {
258.140 + break;
258.141 + }
258.142 + }
258.143 + }
258.144 + if (idx == len) {
258.145 + return s;
258.146 + }
258.147 +
258.148 + char[] buf = new char[len];
258.149 + for (int i = 0; i < len; i++) {
258.150 + char c = s.charAt(i);
258.151 + if (i == 0 && idx == 0) {
258.152 + buf[i] = toUpper(c);
258.153 + } else if (i < idx) {
258.154 + buf[i] = c;
258.155 + } else {
258.156 + buf[i] = toLower(c);
258.157 + }
258.158 + }
258.159 + return new String(buf);
258.160 + }
258.161 +
258.162 + private static boolean isUpper(char c) {
258.163 + return c >= 'A' && c <= 'Z';
258.164 + }
258.165 +
258.166 + private static boolean isLower(char c) {
258.167 + return c >= 'a' && c <= 'z';
258.168 + }
258.169 +
258.170 + static boolean isAlpha(char c) {
258.171 + return (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z');
258.172 + }
258.173 +
258.174 + static boolean isAlphaString(String s) {
258.175 + int len = s.length();
258.176 + for (int i = 0; i < len; i++) {
258.177 + if (!isAlpha(s.charAt(i))) {
258.178 + return false;
258.179 + }
258.180 + }
258.181 + return true;
258.182 + }
258.183 +
258.184 + static boolean isNumeric(char c) {
258.185 + return (c >= '0' && c <= '9');
258.186 + }
258.187 +
258.188 + static boolean isNumericString(String s) {
258.189 + int len = s.length();
258.190 + for (int i = 0; i < len; i++) {
258.191 + if (!isNumeric(s.charAt(i))) {
258.192 + return false;
258.193 + }
258.194 + }
258.195 + return true;
258.196 + }
258.197 +
258.198 + static boolean isAlphaNumeric(char c) {
258.199 + return isAlpha(c) || isNumeric(c);
258.200 + }
258.201 +
258.202 + static boolean isAlphaNumericString(String s) {
258.203 + int len = s.length();
258.204 + for (int i = 0; i < len; i++) {
258.205 + if (!isAlphaNumeric(s.charAt(i))) {
258.206 + return false;
258.207 + }
258.208 + }
258.209 + return true;
258.210 + }
258.211 +
258.212 + static boolean isEmpty(String str) {
258.213 + return str == null || str.length() == 0;
258.214 + }
258.215 +
258.216 + static boolean isEmpty(Set<?> set) {
258.217 + return set == null || set.isEmpty();
258.218 + }
258.219 +
258.220 + static boolean isEmpty(Map<?, ?> map) {
258.221 + return map == null || map.isEmpty();
258.222 + }
258.223 +
258.224 + static boolean isEmpty(List<?> list) {
258.225 + return list == null || list.isEmpty();
258.226 + }
258.227 +}
259.1 --- a/src/share/classes/sun/util/locale/ParseStatus.java Tue Apr 19 16:01:27 2011 -0700
259.2 +++ b/src/share/classes/sun/util/locale/ParseStatus.java Tue Apr 26 15:48:03 2011 -0700
259.3 @@ -1,5 +1,5 @@
259.4 /*
259.5 - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
259.6 + * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
259.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
259.8 *
259.9 * This code is free software; you can redistribute it and/or modify it
259.10 @@ -32,29 +32,33 @@
259.11 package sun.util.locale;
259.12
259.13 public class ParseStatus {
259.14 - int _parseLength = 0;
259.15 - int _errorIndex = -1;
259.16 - String _errorMsg = null;
259.17 + int parseLength;
259.18 + int errorIndex;
259.19 + String errorMsg;
259.20 +
259.21 + public ParseStatus() {
259.22 + reset();
259.23 + }
259.24
259.25 public void reset() {
259.26 - _parseLength = 0;
259.27 - _errorIndex = -1;
259.28 - _errorMsg = null;
259.29 + parseLength = 0;
259.30 + errorIndex = -1;
259.31 + errorMsg = null;
259.32 }
259.33
259.34 public boolean isError() {
259.35 - return (_errorIndex >= 0);
259.36 + return (errorIndex >= 0);
259.37 }
259.38
259.39 public int getErrorIndex() {
259.40 - return _errorIndex;
259.41 + return errorIndex;
259.42 }
259.43
259.44 public int getParseLength() {
259.45 - return _parseLength;
259.46 + return parseLength;
259.47 }
259.48
259.49 public String getErrorMessage() {
259.50 - return _errorMsg;
259.51 + return errorMsg;
259.52 }
259.53 }
260.1 --- a/src/share/classes/sun/util/locale/StringTokenIterator.java Tue Apr 19 16:01:27 2011 -0700
260.2 +++ b/src/share/classes/sun/util/locale/StringTokenIterator.java Tue Apr 26 15:48:03 2011 -0700
260.3 @@ -1,5 +1,5 @@
260.4 /*
260.5 - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
260.6 + * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
260.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
260.8 *
260.9 * This code is free software; you can redistribute it and/or modify it
260.10 @@ -31,87 +31,99 @@
260.11 package sun.util.locale;
260.12
260.13 public class StringTokenIterator {
260.14 - private String _text;
260.15 - private String _dlms;
260.16 + private String text;
260.17 + private String dlms; // null if a single char delimiter
260.18 + private char delimiterChar; // delimiter if a single char delimiter
260.19
260.20 - private String _token;
260.21 - private int _start;
260.22 - private int _end;
260.23 - private boolean _done;
260.24 + private String token;
260.25 + private int start;
260.26 + private int end;
260.27 + private boolean done;
260.28
260.29 public StringTokenIterator(String text, String dlms) {
260.30 - _text = text;
260.31 - _dlms = dlms;
260.32 + this.text = text;
260.33 + if (dlms.length() == 1) {
260.34 + delimiterChar = dlms.charAt(0);
260.35 + } else {
260.36 + this.dlms = dlms;
260.37 + }
260.38 setStart(0);
260.39 }
260.40
260.41 public String first() {
260.42 setStart(0);
260.43 - return _token;
260.44 + return token;
260.45 }
260.46
260.47 public String current() {
260.48 - return _token;
260.49 + return token;
260.50 }
260.51
260.52 public int currentStart() {
260.53 - return _start;
260.54 + return start;
260.55 }
260.56
260.57 public int currentEnd() {
260.58 - return _end;
260.59 + return end;
260.60 }
260.61
260.62 public boolean isDone() {
260.63 - return _done;
260.64 + return done;
260.65 }
260.66
260.67 public String next() {
260.68 if (hasNext()) {
260.69 - _start = _end + 1;
260.70 - _end = nextDelimiter(_start);
260.71 - _token = _text.substring(_start, _end);
260.72 + start = end + 1;
260.73 + end = nextDelimiter(start);
260.74 + token = text.substring(start, end);
260.75 } else {
260.76 - _start = _end;
260.77 - _token = null;
260.78 - _done = true;
260.79 + start = end;
260.80 + token = null;
260.81 + done = true;
260.82 }
260.83 - return _token;
260.84 + return token;
260.85 }
260.86
260.87 public boolean hasNext() {
260.88 - return (_end < _text.length());
260.89 + return (end < text.length());
260.90 }
260.91
260.92 public StringTokenIterator setStart(int offset) {
260.93 - if (offset > _text.length()) {
260.94 + if (offset > text.length()) {
260.95 throw new IndexOutOfBoundsException();
260.96 }
260.97 - _start = offset;
260.98 - _end = nextDelimiter(_start);
260.99 - _token = _text.substring(_start, _end);
260.100 - _done = false;
260.101 + start = offset;
260.102 + end = nextDelimiter(start);
260.103 + token = text.substring(start, end);
260.104 + done = false;
260.105 return this;
260.106 }
260.107
260.108 public StringTokenIterator setText(String text) {
260.109 - _text = text;
260.110 + this.text = text;
260.111 setStart(0);
260.112 return this;
260.113 }
260.114
260.115 private int nextDelimiter(int start) {
260.116 - int idx = start;
260.117 - outer: while (idx < _text.length()) {
260.118 - char c = _text.charAt(idx);
260.119 - for (int i = 0; i < _dlms.length(); i++) {
260.120 - if (c == _dlms.charAt(i)) {
260.121 - break outer;
260.122 + int textlen = this.text.length();
260.123 + if (dlms == null) {
260.124 + for (int idx = start; idx < textlen; idx++) {
260.125 + if (text.charAt(idx) == delimiterChar) {
260.126 + return idx;
260.127 }
260.128 }
260.129 - idx++;
260.130 + } else {
260.131 + int dlmslen = dlms.length();
260.132 + for (int idx = start; idx < textlen; idx++) {
260.133 + char c = text.charAt(idx);
260.134 + for (int i = 0; i < dlmslen; i++) {
260.135 + if (c == dlms.charAt(i)) {
260.136 + return idx;
260.137 + }
260.138 + }
260.139 + }
260.140 }
260.141 - return idx;
260.142 + return textlen;
260.143 }
260.144 }
260.145 -
261.1 --- a/src/share/classes/sun/util/locale/UnicodeLocaleExtension.java Tue Apr 19 16:01:27 2011 -0700
261.2 +++ b/src/share/classes/sun/util/locale/UnicodeLocaleExtension.java Tue Apr 26 15:48:03 2011 -0700
261.3 @@ -1,5 +1,6 @@
261.4 +
261.5 /*
261.6 - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
261.7 + * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
261.8 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
261.9 *
261.10 * This code is free software; you can redistribute it and/or modify it
261.11 @@ -32,56 +33,48 @@
261.12 package sun.util.locale;
261.13
261.14 import java.util.Collections;
261.15 +import java.util.Map;
261.16 import java.util.Map.Entry;
261.17 import java.util.Set;
261.18 import java.util.SortedMap;
261.19 import java.util.SortedSet;
261.20 -import java.util.TreeMap;
261.21 -import java.util.TreeSet;
261.22
261.23 public class UnicodeLocaleExtension extends Extension {
261.24 public static final char SINGLETON = 'u';
261.25
261.26 - private static final SortedSet<String> EMPTY_SORTED_SET = new TreeSet<String>();
261.27 - private static final SortedMap<String, String> EMPTY_SORTED_MAP = new TreeMap<String, String>();
261.28 + private final Set<String> attributes;
261.29 + private final Map<String, String> keywords;
261.30
261.31 - private SortedSet<String> _attributes = EMPTY_SORTED_SET;
261.32 - private SortedMap<String, String> _keywords = EMPTY_SORTED_MAP;
261.33 + public static final UnicodeLocaleExtension CA_JAPANESE
261.34 + = new UnicodeLocaleExtension("ca", "japanese");
261.35 + public static final UnicodeLocaleExtension NU_THAI
261.36 + = new UnicodeLocaleExtension("nu", "thai");
261.37
261.38 - public static final UnicodeLocaleExtension CA_JAPANESE;
261.39 - public static final UnicodeLocaleExtension NU_THAI;
261.40 -
261.41 - static {
261.42 - CA_JAPANESE = new UnicodeLocaleExtension();
261.43 - CA_JAPANESE._keywords = new TreeMap<String, String>();
261.44 - CA_JAPANESE._keywords.put("ca", "japanese");
261.45 - CA_JAPANESE._value = "ca-japanese";
261.46 -
261.47 - NU_THAI = new UnicodeLocaleExtension();
261.48 - NU_THAI._keywords = new TreeMap<String, String>();
261.49 - NU_THAI._keywords.put("nu", "thai");
261.50 - NU_THAI._value = "nu-thai";
261.51 - }
261.52 -
261.53 - private UnicodeLocaleExtension() {
261.54 - super(SINGLETON);
261.55 + private UnicodeLocaleExtension(String key, String value) {
261.56 + super(SINGLETON, key + "-" + value);
261.57 + attributes = Collections.emptySet();
261.58 + keywords = Collections.singletonMap(key, value);
261.59 }
261.60
261.61 UnicodeLocaleExtension(SortedSet<String> attributes, SortedMap<String, String> keywords) {
261.62 - this();
261.63 - if (attributes != null && attributes.size() > 0) {
261.64 - _attributes = attributes;
261.65 + super(SINGLETON);
261.66 + if (attributes != null) {
261.67 + this.attributes = attributes;
261.68 + } else {
261.69 + this.attributes = Collections.emptySet();
261.70 }
261.71 - if (keywords != null && keywords.size() > 0) {
261.72 - _keywords = keywords;
261.73 + if (keywords != null) {
261.74 + this.keywords = keywords;
261.75 + } else {
261.76 + this.keywords = Collections.emptyMap();
261.77 }
261.78
261.79 - if (_attributes.size() > 0 || _keywords.size() > 0) {
261.80 + if (!this.attributes.isEmpty() || !this.keywords.isEmpty()) {
261.81 StringBuilder sb = new StringBuilder();
261.82 - for (String attribute : _attributes) {
261.83 + for (String attribute : this.attributes) {
261.84 sb.append(LanguageTag.SEP).append(attribute);
261.85 }
261.86 - for (Entry<String, String> keyword : _keywords.entrySet()) {
261.87 + for (Entry<String, String> keyword : this.keywords.entrySet()) {
261.88 String key = keyword.getKey();
261.89 String value = keyword.getValue();
261.90
261.91 @@ -90,38 +83,46 @@
261.92 sb.append(LanguageTag.SEP).append(value);
261.93 }
261.94 }
261.95 - _value = sb.substring(1); // skip leading '-'
261.96 + setValue(sb.substring(1)); // skip leading '-'
261.97 }
261.98 }
261.99
261.100 public Set<String> getUnicodeLocaleAttributes() {
261.101 - return Collections.unmodifiableSet(_attributes);
261.102 + if (attributes == Collections.EMPTY_SET) {
261.103 + return attributes;
261.104 + }
261.105 + return Collections.unmodifiableSet(attributes);
261.106 }
261.107
261.108 public Set<String> getUnicodeLocaleKeys() {
261.109 - return Collections.unmodifiableSet(_keywords.keySet());
261.110 + if (keywords == Collections.EMPTY_MAP) {
261.111 + return Collections.emptySet();
261.112 + }
261.113 + return Collections.unmodifiableSet(keywords.keySet());
261.114 }
261.115
261.116 public String getUnicodeLocaleType(String unicodeLocaleKey) {
261.117 - return _keywords.get(unicodeLocaleKey);
261.118 + return keywords.get(unicodeLocaleKey);
261.119 }
261.120
261.121 public static boolean isSingletonChar(char c) {
261.122 - return (SINGLETON == AsciiUtil.toLower(c));
261.123 + return (SINGLETON == LocaleUtils.toLower(c));
261.124 }
261.125
261.126 public static boolean isAttribute(String s) {
261.127 // 3*8alphanum
261.128 - return (s.length() >= 3) && (s.length() <= 8) && AsciiUtil.isAlphaNumericString(s);
261.129 + int len = s.length();
261.130 + return (len >= 3) && (len <= 8) && LocaleUtils.isAlphaNumericString(s);
261.131 }
261.132
261.133 public static boolean isKey(String s) {
261.134 // 2alphanum
261.135 - return (s.length() == 2) && AsciiUtil.isAlphaNumericString(s);
261.136 + return (s.length() == 2) && LocaleUtils.isAlphaNumericString(s);
261.137 }
261.138
261.139 public static boolean isTypeSubtag(String s) {
261.140 // 3*8alphanum
261.141 - return (s.length() >= 3) && (s.length() <= 8) && AsciiUtil.isAlphaNumericString(s);
261.142 + int len = s.length();
261.143 + return (len >= 3) && (len <= 8) && LocaleUtils.isAlphaNumericString(s);
261.144 }
261.145 }
262.1 --- a/src/share/classes/sun/util/resources/CurrencyNames_de.properties Tue Apr 19 16:01:27 2011 -0700
262.2 +++ b/src/share/classes/sun/util/resources/CurrencyNames_de.properties Tue Apr 26 15:48:03 2011 -0700
262.3 @@ -65,6 +65,8 @@
262.4 #
262.5 adp=Andorranische Pesete
262.6 aed=UAE Dirham
262.7 +afa=Afghani (1927-2002)
262.8 +afn=Afghani
262.9 all=Lek
262.10 amd=Dram
262.11 ang=Niederl. Antillen Gulden
262.12 @@ -85,6 +87,7 @@
262.13 bif=Burundi-Franc
262.14 bmd=Bermuda-Dollar
262.15 bnd=Brunei-Dollar
262.16 +bob=Boliviano
262.17 bov=Mvdol
262.18 brl=Real
262.19 bsd=Bahama-Dollar
262.20 @@ -106,6 +109,7 @@
262.21 cve=Kap Verde Escudo
262.22 cyp=Zypern-Pfund
262.23 czk=Tschechische Krone
262.24 +dem=Deutsche Mark
262.25 djf=Dschibuti-Franc
262.26 dkk=D\u00e4nische Krone
262.27 dop=Dominikanischer Peso
262.28 @@ -176,7 +180,9 @@
262.29 mtl=Maltesische Lira
262.30 mur=Mauritius-Rupie
262.31 mvr=Rufiyaa
262.32 +mwk=Malawi Kwacha
262.33 mxn=Mexikanischer Peso
262.34 +mxv=Mexican Unidad de Inversion (UDI)
262.35 myr=Malaysischer Ringgit
262.36 mzm=Alter Metical
262.37 mzn=Metical
262.38 @@ -217,6 +223,7 @@
262.39 srd=Surinamischer Dollar
262.40 srg=Suriname Gulden
262.41 std=Dobra
262.42 +svc=El Salvador Colon
262.43 syp=Syrisches Pfund
262.44 szl=Lilangeni
262.45 thb=Baht
263.1 --- a/src/share/classes/sun/util/resources/CurrencyNames_it.properties Tue Apr 19 16:01:27 2011 -0700
263.2 +++ b/src/share/classes/sun/util/resources/CurrencyNames_it.properties Tue Apr 26 15:48:03 2011 -0700
263.3 @@ -86,6 +86,7 @@
263.4 bif=Franco del Burundi
263.5 bmd=Dollaro delle Bermuda
263.6 bnd=Dollaro del Brunei
263.7 +bob=Boliviano
263.8 bov=Mvdol Boliviano
263.9 brl=Real Brasiliano
263.10 bsd=Dollaro delle Bahamas
264.1 --- a/src/share/classes/sun/util/resources/TimeZoneNames_pt_BR.java Tue Apr 19 16:01:27 2011 -0700
264.2 +++ b/src/share/classes/sun/util/resources/TimeZoneNames_pt_BR.java Tue Apr 26 15:48:03 2011 -0700
264.3 @@ -43,822 +43,824 @@
264.4 public final class TimeZoneNames_pt_BR extends TimeZoneNamesBundle {
264.5
264.6 protected final Object[][] getContents() {
264.7 - String ACT[] = new String[] {"Fuso hor\u00e1rio do Acre", "ACT",
264.8 - "Fuso hor\u00e1rio de ver\u00e3o do Acre", "ACST"};
264.9 - String ADELAIDE[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o central (Austr\u00e1lia do Sul)", "CST",
264.10 - "Fuso hor\u00e1rio de ver\u00e3o central (Austr\u00e1lia do Sul)", "CST"};
264.11 - String AGT[] = new String[] {"Fuso hor\u00e1rio da Argentina", "ART",
264.12 - "Fuso hor\u00e1rio de ver\u00e3o da Argentina", "ARST"};
264.13 - String AKST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o do Alaska", "AKST",
264.14 - "Hor\u00e1rio de luz natural do Alaska", "AKDT"};
264.15 - String AMT[] = new String[] {"Fuso hor\u00e1rio do Amazonas", "AMT",
264.16 - "Fuso hor\u00e1rio de ver\u00e3o do Amazonas", "AMST"};
264.17 - String ARAST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o da Ar\u00e1bia", "AST",
264.18 - "Hor\u00e1rio de luz natural da Ar\u00e1bia", "ADT"};
264.19 - String ARMT[] = new String[] {"Fuso hor\u00e1rio da Arm\u00eania", "AMT",
264.20 - "Fuso hor\u00e1rio de ver\u00e3o da Arm\u00eania", "AMST"};
264.21 - String AST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o do Atl\u00e2ntico", "AST",
264.22 - "Hor\u00e1rio de luz natural do Atl\u00e2ntico", "ADT"};
264.23 - String BDT[] = new String[] {"Fuso hor\u00e1rio de Bangladesh", "BDT",
264.24 - "Fuso hor\u00e1rio de ver\u00e3o de Bangladesh", "BDST"};
264.25 - String BRISBANE[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o oriental (Queensland)", "EST",
264.26 - "Fuso hor\u00e1rio de ver\u00e3o oriental (Queensland)", "EST"};
264.27 - String BROKEN_HILL[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o central (Austr\u00e1lia do Sul/Nova Gales do Sul)", "CST",
264.28 - "Fuso hor\u00e1rio de ver\u00e3o central (Austr\u00e1lia do Sul/Nova Gales do Sul)", "CST"};
264.29 - String BRT[] = new String[] {"Fuso hor\u00e1rio de Bras\u00edlia", "BRT",
264.30 - "Fuso hor\u00e1rio de ver\u00e3o de Bras\u00edlia", "BRST"};
264.31 - String BTT[] = new String[] {"Fuso hor\u00e1rio de But\u00e3o", "BTT",
264.32 - "Fuso hor\u00e1rio de ver\u00e3o de But\u00e3o", "BTST"};
264.33 - String CAT[] = new String[] {"Fuso hor\u00e1rio da \u00c1frica Central", "CAT",
264.34 - "Fuso hor\u00e1rio de ver\u00e3o da \u00c1frica Central", "CAST"};
264.35 - String CET[] = new String[] {"Fuso hor\u00e1rio da Europa Central", "CET",
264.36 - "Fuso hor\u00e1rio de ver\u00e3o da Europa Central", "CEST"};
264.37 - String CHAST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o de Chatham", "CHAST",
264.38 - "Hor\u00e1rio de luz natural de Chatham", "CHADT"};
264.39 - String CIT[] = new String[] {"Fuso hor\u00e1rio da Indon\u00e9sia Central", "CIT",
264.40 - "Fuso hor\u00e1rio de ver\u00e3o da Indon\u00e9sia Central", "CIST"};
264.41 - String CLT[] = new String[] {"Fuso hor\u00e1rio do Chile", "CLT",
264.42 - "Fuso hor\u00e1rio de ver\u00e3o do Chile", "CLST"};
264.43 - String CST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o central", "CST",
264.44 - "Hor\u00e1rio de luz natural central", "CDT"};
264.45 - String CTT[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o da China", "CST",
264.46 - "Hor\u00e1rio de luz natural da China", "CDT"};
264.47 - String CUBA[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o de Cuba", "CST",
264.48 - "Hor\u00e1rio de luz natural de Cuba", "CDT"};
264.49 - String DARWIN[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o central (Territ\u00f3rio do Norte)", "CST",
264.50 - "Fuso hor\u00e1rio de ver\u00e3o central (Territ\u00f3rio do Norte)", "CST"};
264.51 - String DUBLIN[] = new String[] {"Fuso hor\u00e1rio do meridiano de Greenwich", "GMT",
264.52 - "Fuso hor\u00e1rio de ver\u00e3o da Irlanda", "IST"};
264.53 - String EAT[] = new String[] {"Fuso hor\u00e1rio da \u00c1frica Oriental", "EAT",
264.54 - "Fuso hor\u00e1rio padr\u00e3o da \u00c1frica Oriental", "EAST"};
264.55 - String EASTER[] = new String[] {"Fuso hor\u00e1rio da Ilha de P\u00e1scoa", "EAST",
264.56 - "Fuso hor\u00e1rio de ver\u00e3o da Ilha de P\u00e1scoa", "EASST"};
264.57 - String EET[] = new String[] {"Fuso hor\u00e1rio da Europa Oriental", "EET",
264.58 - "Fuso hor\u00e1rio de ver\u00e3o da Europa Oriental", "EEST"};
264.59 - String EGT[] = new String[] {"Fuso hor\u00e1rio da Groenl\u00e2ndia Oriental", "EGT",
264.60 - "Fuso hor\u00e1rio de ver\u00e3o da Groenl\u00e2ndia Oriental", "EGST"};
264.61 - String EST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o oriental", "EST",
264.62 - "Hor\u00e1rio de luz natural oriental", "EDT"};
264.63 - String EST_NSW[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o oriental (Nova Gales do Sul)", "EST",
264.64 - "Fuso hor\u00e1rio de ver\u00e3o oriental (Nova Gales do Sul)", "EST"};
264.65 - String GHMT[] = new String[] {"Fuso hor\u00e1rio do meridiano de Gana", "GMT",
264.66 - "Fuso hor\u00e1rio de ver\u00e3o de Gana", "GHST"};
264.67 - String GAMBIER[] = new String[] {"Fuso hor\u00e1rio de Gambier", "GAMT",
264.68 - "Fuso hor\u00e1rio de ver\u00e3o de Gambier", "GAMST"};
264.69 - String GMT[] = new String[] {"Fuso hor\u00e1rio do meridiano de Greenwich", "GMT",
264.70 - "Fuso hor\u00e1rio do meridiano de Greenwich", "GMT"};
264.71 - String GMTBST[] = new String[] {"Fuso hor\u00e1rio do meridiano de Greenwich", "GMT",
264.72 - "Fuso hor\u00e1rio de ver\u00e3o da Gr\u00e3-Bretanha", "BST"};
264.73 - String GST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o do golfo", "GST",
264.74 - "Hor\u00e1rio de luz natural do golfo", "GDT"};
264.75 - String HAST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o do Hava\u00ed-Aleutian", "HAST",
264.76 - "Hor\u00e1rio de luz natural do Hava\u00ed-Aleutian", "HADT"};
264.77 - String HKT[] = new String[] {"Fuso hor\u00e1rio de Hong Kong", "HKT",
264.78 - "Fuso hor\u00e1rio de ver\u00e3o de Hong Kong", "HKST"};
264.79 - String HST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o do Hava\u00ed", "HST",
264.80 - "Hor\u00e1rio de luz natural do Hava\u00ed", "HDT"};
264.81 - String ICT[] = new String[] {"Fuso hor\u00e1rio da Indochina", "ICT",
264.82 - "Fuso hor\u00e1rio de ver\u00e3o da Indochina", "ICST"};
264.83 - String IRT[] = new String[] {"Fuso hor\u00e1rio do Ir\u00e3", "IRST",
264.84 - "Hor\u00e1rio de luz natural do Ir\u00e3", "IRDT"};
264.85 - String ISRAEL[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o de Israel", "IST",
264.86 - "Hor\u00e1rio de luz natural de Israel", "IDT"};
264.87 - String IST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o da \u00cdndia", "IST",
264.88 - "Hor\u00e1rio de luz natural da \u00cdndia", "IDT"};
264.89 - String JST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o do Jap\u00e3o", "JST",
264.90 - "Hor\u00e1rio de luz natural do Jap\u00e3o", "JDT"};
264.91 - String KST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o da Coreia", "KST",
264.92 - "Hor\u00e1rio de luz natural da Coreia", "KDT"};
264.93 - String LORD_HOWE[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o de Lord Howe", "LHST",
264.94 - "Fuso hor\u00e1rio de ver\u00e3o de Lord Howe", "LHST"};
264.95 - String MHT[] = new String[] {"Fuso hor\u00e1rio das Ilhas Marshall", "MHT",
264.96 - "Fuso hor\u00e1rio de ver\u00e3o das Ilhas Marshall", "MHST"};
264.97 - String MSK[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o de Moscou", "MSK",
264.98 - "Hor\u00e1rio de luz natural de Moscou", "MSD"};
264.99 - String MST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o das montanhas", "MST",
264.100 - "Hor\u00e1rio de luz natural das montanhas", "MDT"};
264.101 - String MYT[] = new String[] {"Fuso hor\u00e1rio da Mal\u00e1sia", "MYT",
264.102 - "Fuso hor\u00e1rio de ver\u00e3o da Mal\u00e1sia", "MYST"};
264.103 - String NORONHA[] = new String[] {"Fuso hor\u00e1rio de Fernando de Noronha", "FNT",
264.104 - "Fuso hor\u00e1rio de ver\u00e3o de Fernando de Noronha", "FNST"};
264.105 - String NOVT[] = new String[] {"Fuso hor\u00e1rio de Novosibirsk", "NOVT",
264.106 - "Fuso hor\u00e1rio de ver\u00e3o de Novosibirsk", "NOVST"};
264.107 + String ACT[] = new String[] {"Fuso hor\u00e1rio do Acre", "ACT",
264.108 + "Fuso hor\u00e1rio de ver\u00e3o do Acre", "ACST"};
264.109 + String ADELAIDE[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o central (Austr\u00e1lia do Sul)", "CST",
264.110 + "Fuso hor\u00e1rio de ver\u00e3o central (Austr\u00e1lia do Sul)", "CST"};
264.111 + String AGT[] = new String[] {"Fuso hor\u00e1rio da Argentina", "ART",
264.112 + "Fuso hor\u00e1rio de ver\u00e3o da Argentina", "ARST"};
264.113 + String AKST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o do Alaska", "AKST",
264.114 + "Hor\u00e1rio de luz natural do Alaska", "AKDT"};
264.115 + String AMT[] = new String[] {"Fuso hor\u00e1rio do Amazonas", "AMT",
264.116 + "Fuso hor\u00e1rio de ver\u00e3o do Amazonas", "AMST"};
264.117 + String ARAST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o da Ar\u00e1bia", "AST",
264.118 + "Hor\u00e1rio de luz natural da Ar\u00e1bia", "ADT"};
264.119 + String ARMT[] = new String[] {"Fuso hor\u00e1rio da Arm\u00eania", "AMT",
264.120 + "Fuso hor\u00e1rio de ver\u00e3o da Arm\u00eania", "AMST"};
264.121 + String AST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o do Atl\u00e2ntico", "AST",
264.122 + "Hor\u00e1rio de luz natural do Atl\u00e2ntico", "ADT"};
264.123 + String BDT[] = new String[] {"Fuso hor\u00e1rio de Bangladesh", "BDT",
264.124 + "Fuso hor\u00e1rio de ver\u00e3o de Bangladesh", "BDST"};
264.125 + String BRISBANE[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o oriental (Queensland)", "EST",
264.126 + "Fuso hor\u00e1rio de ver\u00e3o oriental (Queensland)", "EST"};
264.127 + String BROKEN_HILL[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o central (Austr\u00e1lia do Sul/Nova Gales do Sul)", "CST",
264.128 + "Fuso hor\u00e1rio de ver\u00e3o central (Austr\u00e1lia do Sul/Nova Gales do Sul)", "CST"};
264.129 + String BRT[] = new String[] {"Fuso hor\u00e1rio de Bras\u00edlia", "BRT",
264.130 + "Fuso hor\u00e1rio de ver\u00e3o de Bras\u00edlia", "BRST"};
264.131 + String BTT[] = new String[] {"Fuso hor\u00e1rio de But\u00e3o", "BTT",
264.132 + "Fuso hor\u00e1rio de ver\u00e3o de But\u00e3o", "BTST"};
264.133 + String CAT[] = new String[] {"Fuso hor\u00e1rio da \u00c1frica Central", "CAT",
264.134 + "Fuso hor\u00e1rio de ver\u00e3o da \u00c1frica Central", "CAST"};
264.135 + String CET[] = new String[] {"Fuso hor\u00e1rio da Europa Central", "CET",
264.136 + "Fuso hor\u00e1rio de ver\u00e3o da Europa Central", "CEST"};
264.137 + String CHAST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o de Chatham", "CHAST",
264.138 + "Hor\u00e1rio de luz natural de Chatham", "CHADT"};
264.139 + String CIT[] = new String[] {"Fuso hor\u00e1rio da Indon\u00e9sia Central", "CIT",
264.140 + "Fuso hor\u00e1rio de ver\u00e3o da Indon\u00e9sia Central", "CIST"};
264.141 + String CLT[] = new String[] {"Fuso hor\u00e1rio do Chile", "CLT",
264.142 + "Fuso hor\u00e1rio de ver\u00e3o do Chile", "CLST"};
264.143 + String CST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o central", "CST",
264.144 + "Hor\u00e1rio de luz natural central", "CDT"};
264.145 + String CTT[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o da China", "CST",
264.146 + "Hor\u00e1rio de luz natural da China", "CDT"};
264.147 + String CUBA[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o de Cuba", "CST",
264.148 + "Hor\u00e1rio de luz natural de Cuba", "CDT"};
264.149 + String DARWIN[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o central (Territ\u00f3rio do Norte)", "CST",
264.150 + "Fuso hor\u00e1rio de ver\u00e3o central (Territ\u00f3rio do Norte)", "CST"};
264.151 + String DUBLIN[] = new String[] {"Fuso hor\u00e1rio do meridiano de Greenwich", "GMT",
264.152 + "Fuso hor\u00e1rio de ver\u00e3o da Irlanda", "IST"};
264.153 + String EAT[] = new String[] {"Fuso hor\u00e1rio da \u00c1frica Oriental", "EAT",
264.154 + "Fuso hor\u00e1rio padr\u00e3o da \u00c1frica Oriental", "EAST"};
264.155 + String EASTER[] = new String[] {"Fuso hor\u00e1rio da Ilha de P\u00e1scoa", "EAST",
264.156 + "Fuso hor\u00e1rio de ver\u00e3o da Ilha de P\u00e1scoa", "EASST"};
264.157 + String EET[] = new String[] {"Fuso hor\u00e1rio da Europa Oriental", "EET",
264.158 + "Fuso hor\u00e1rio de ver\u00e3o da Europa Oriental", "EEST"};
264.159 + String EGT[] = new String[] {"Fuso hor\u00e1rio da Groenl\u00e2ndia Oriental", "EGT",
264.160 + "Fuso hor\u00e1rio de ver\u00e3o da Groenl\u00e2ndia Oriental", "EGST"};
264.161 + String EST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o oriental", "EST",
264.162 + "Hor\u00e1rio de luz natural oriental", "EDT"};
264.163 + String EST_NSW[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o oriental (Nova Gales do Sul)", "EST",
264.164 + "Fuso hor\u00e1rio de ver\u00e3o oriental (Nova Gales do Sul)", "EST"};
264.165 + String GHMT[] = new String[] {"Fuso hor\u00e1rio do meridiano de Gana", "GMT",
264.166 + "Fuso hor\u00e1rio de ver\u00e3o de Gana", "GHST"};
264.167 + String GAMBIER[] = new String[] {"Fuso hor\u00e1rio de Gambier", "GAMT",
264.168 + "Fuso hor\u00e1rio de ver\u00e3o de Gambier", "GAMST"};
264.169 + String GMT[] = new String[] {"Fuso hor\u00e1rio do meridiano de Greenwich", "GMT",
264.170 + "Fuso hor\u00e1rio do meridiano de Greenwich", "GMT"};
264.171 + String GMTBST[] = new String[] {"Fuso hor\u00e1rio do meridiano de Greenwich", "GMT",
264.172 + "Fuso hor\u00e1rio de ver\u00e3o da Gr\u00e3-Bretanha", "BST"};
264.173 + String GST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o do golfo", "GST",
264.174 + "Hor\u00e1rio de luz natural do golfo", "GDT"};
264.175 + String HAST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o do Hava\u00ed-Aleutian", "HAST",
264.176 + "Hor\u00e1rio de luz natural do Hava\u00ed-Aleutian", "HADT"};
264.177 + String HKT[] = new String[] {"Fuso hor\u00e1rio de Hong Kong", "HKT",
264.178 + "Fuso hor\u00e1rio de ver\u00e3o de Hong Kong", "HKST"};
264.179 + String HST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o do Hava\u00ed", "HST",
264.180 + "Hor\u00e1rio de luz natural do Hava\u00ed", "HDT"};
264.181 + String ICT[] = new String[] {"Fuso hor\u00e1rio da Indochina", "ICT",
264.182 + "Fuso hor\u00e1rio de ver\u00e3o da Indochina", "ICST"};
264.183 + String IRT[] = new String[] {"Fuso hor\u00e1rio do Ir\u00e3", "IRST",
264.184 + "Hor\u00e1rio de luz natural do Ir\u00e3", "IRDT"};
264.185 + String ISRAEL[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o de Israel", "IST",
264.186 + "Hor\u00e1rio de luz natural de Israel", "IDT"};
264.187 + String IST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o da \u00cdndia", "IST",
264.188 + "Hor\u00e1rio de luz natural da \u00cdndia", "IDT"};
264.189 + String JST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o do Jap\u00e3o", "JST",
264.190 + "Hor\u00e1rio de luz natural do Jap\u00e3o", "JDT"};
264.191 + String KST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o da Coreia", "KST",
264.192 + "Hor\u00e1rio de luz natural da Coreia", "KDT"};
264.193 + String LORD_HOWE[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o de Lord Howe", "LHST",
264.194 + "Fuso hor\u00e1rio de ver\u00e3o de Lord Howe", "LHST"};
264.195 + String MHT[] = new String[] {"Fuso hor\u00e1rio das Ilhas Marshall", "MHT",
264.196 + "Fuso hor\u00e1rio de ver\u00e3o das Ilhas Marshall", "MHST"};
264.197 + String MSK[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o de Moscou", "MSK",
264.198 + "Hor\u00e1rio de luz natural de Moscou", "MSD"};
264.199 + String MST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o das montanhas", "MST",
264.200 + "Hor\u00e1rio de luz natural das montanhas", "MDT"};
264.201 + String MYT[] = new String[] {"Fuso hor\u00e1rio da Mal\u00e1sia", "MYT",
264.202 + "Fuso hor\u00e1rio de ver\u00e3o da Mal\u00e1sia", "MYST"};
264.203 + String NORONHA[] = new String[] {"Fuso hor\u00e1rio de Fernando de Noronha", "FNT",
264.204 + "Fuso hor\u00e1rio de ver\u00e3o de Fernando de Noronha", "FNST"};
264.205 + String NOVT[] = new String[] {"Fuso hor\u00e1rio de Novosibirsk", "NOVT",
264.206 + "Fuso hor\u00e1rio de ver\u00e3o de Novosibirsk", "NOVST"};
264.207 String NPT[] = new String[] {"Fuso hor\u00e1rio do Nepal", "NPT",
264.208 "Fuso hor\u00e1rio de ver\u00e3o do Nepal", "NPST"};
264.209 - String NST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o de Terra Nova", "NST",
264.210 - "Hor\u00e1rio de luz natural de Terra Nova", "NDT"};
264.211 - String NZST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o da Nova Zel\u00e2ndia", "NZST",
264.212 - "Hor\u00e1rio de luz natural da Nova Zel\u00e2ndia", "NZDT"};
264.213 + String NST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o de Terra Nova", "NST",
264.214 + "Hor\u00e1rio de luz natural de Terra Nova", "NDT"};
264.215 + String NZST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o da Nova Zel\u00e2ndia", "NZST",
264.216 + "Hor\u00e1rio de luz natural da Nova Zel\u00e2ndia", "NZDT"};
264.217 String PITCAIRN[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o de Pitcairn", "PST",
264.218 - "Hor\u00e1rio de luz natural de Pitcairn", "PDT"};
264.219 - String PKT[] = new String[] {"Fuso hor\u00e1rio do Paquist\u00e3o", "PKT",
264.220 - "Fuso hor\u00e1rio de ver\u00e3o do Paquist\u00e3o", "PKST"};
264.221 - String PONT[] = new String[] {"Fuso hor\u00e1rio de Pohnpei", "PONT",
264.222 - "Fuso hor\u00e1rio de ver\u00e3o de Pohnpei", "PONST"};
264.223 - String PST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o do Pac\u00edfico", "PST",
264.224 - "Hor\u00e1rio de luz natural do Pac\u00edfico", "PDT"};
264.225 + "Hor\u00e1rio de luz natural de Pitcairn", "PDT"};
264.226 + String PKT[] = new String[] {"Fuso hor\u00e1rio do Paquist\u00e3o", "PKT",
264.227 + "Fuso hor\u00e1rio de ver\u00e3o do Paquist\u00e3o", "PKST"};
264.228 + String PONT[] = new String[] {"Fuso hor\u00e1rio de Pohnpei", "PONT",
264.229 + "Fuso hor\u00e1rio de ver\u00e3o de Pohnpei", "PONST"};
264.230 + String PST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o do Pac\u00edfico", "PST",
264.231 + "Hor\u00e1rio de luz natural do Pac\u00edfico", "PDT"};
264.232 String RST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o oriental", "EST",
264.233 "Hor\u00e1rio de luz natural central", "CDT"};
264.234 - String SAST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o da \u00c1frica do Sul", "SAST",
264.235 - "Fuso hor\u00e1rio de ver\u00e3o da \u00c1frica do Sul", "SAST"};
264.236 - String SBT[] = new String[] {"Fuso hor\u00e1rio das Ilhas Salom\u00e3o", "SBT",
264.237 - "Fuso hor\u00e1rio de ver\u00e3o das Ilhas Salom\u00e3o", "SBST"};
264.238 - String SGT[] = new String[] {"Fuso hor\u00e1rio de Cingapura", "SGT",
264.239 - "Fuso hor\u00e1rio de ver\u00e1 de Cingapura", "SGST"};
264.240 - String SLST[] = new String[] {"Fuso hor\u00e1rio do meridiano de Greenwich", "GMT",
264.241 - "Fuso hor\u00e1rio de ver\u00e3o de Serra Leoa", "SLST"};
264.242 - String TASMANIA[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o oriental (Tasm\u00e2nia)", "EST",
264.243 - "Fuso hor\u00e1rio de ver\u00e3o oriental (Tasm\u00e2nia)", "EST"};
264.244 - String TMT[] = new String[] {"Fuso hor\u00e1rio do Turcomenist\u00e3o", "TMT",
264.245 - "Fuso hor\u00e1rio de ver\u00e3o do Turcomenist\u00e3o", "TMST"};
264.246 - String TRUT[] = new String[] {"Fuso hor\u00e1rio de Chuuk", "CHUT",
264.247 - "Fuso hor\u00e1rio de ver\u00e3o de Chuuk", "CHUST"};
264.248 - String ULAT[]= new String[] {"Fuso hor\u00e1rio de Ulan Bator", "ULAT",
264.249 - "Fuso hor\u00e1rio de ver\u00e3o de Ulan Bator", "ULAST"};
264.250 - String WAT[] = new String[] {"Fuso hor\u00e1rio da \u00c1frica Ocidental", "WAT",
264.251 - "Fuso hor\u00e1rio de ver\u00e3o da \u00c1frica Ocidental", "WAST"};
264.252 - String WET[] = new String[] {"Fuso hor\u00e1rio da Europa Ocidental", "WET",
264.253 - "Fuso hor\u00e1rio de ver\u00e3o da Europa Ocidental", "WEST"};
264.254 - String WIT[] = new String[] {"Fuso hor\u00e1rio da Indon\u00e9sia Ocidental", "WIT",
264.255 - "Fuso hor\u00e1rio de ver\u00e3o da Indon\u00e9sia Ocidental", "WIST"};
264.256 - String WST_AUS[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o ocidental (Austr\u00e1lia)", "WST",
264.257 - "Fuso hor\u00e1rio de ver\u00e3o ocidental (Austr\u00e1lia)", "WST"};
264.258 - String SAMOA[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o de Samoa", "SST",
264.259 - "Hor\u00e1rio de luz natural de Samoa", "SDT"};
264.260 - String WST_SAMOA[] = new String[] {"Fuso hor\u00e1rio de Samoa Ocidental", "WST",
264.261 - "Fuso hor\u00e1rio de ver\u00e3o de Samoa Ocidental", "WSST"};
264.262 - String ChST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o de Chamorro", "ChST",
264.263 - "Hor\u00e1rio de luz natural de Chamorro", "ChDT"};
264.264 - String VICTORIA[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o oriental (Victoria)", "EST",
264.265 - "Fuso hor\u00e1rio de ver\u00e3o oriental (Victoria)", "EST"};
264.266 - String UTC[] = new String[] {"Tempo universal coordenado", "UTC",
264.267 - "Tempo universal coordenado", "UTC"};
264.268 - String UZT[] = new String[] {"Fuso hor\u00e1rio do Uzbequist\u00e3o", "UZT",
264.269 - "Fuso hor\u00e1rio de ver\u00e3o do Uzbequist\u00e3o", "UZST"};
264.270 - String WART[] = new String[] {"Fuso hor\u00e1rio da Argentina Ocidental", "WART",
264.271 - "Fuso hor\u00e1rio de ver\u00e3o da Argentina Ocidental", "WARST"};
264.272 + String SAST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o da \u00c1frica do Sul", "SAST",
264.273 + "Fuso hor\u00e1rio de ver\u00e3o da \u00c1frica do Sul", "SAST"};
264.274 + String SBT[] = new String[] {"Fuso hor\u00e1rio das Ilhas Salom\u00e3o", "SBT",
264.275 + "Fuso hor\u00e1rio de ver\u00e3o das Ilhas Salom\u00e3o", "SBST"};
264.276 + String SGT[] = new String[] {"Fuso hor\u00e1rio de Cingapura", "SGT",
264.277 + "Fuso hor\u00e1rio de ver\u00e1 de Cingapura", "SGST"};
264.278 + String SLST[] = new String[] {"Fuso hor\u00e1rio do meridiano de Greenwich", "GMT",
264.279 + "Fuso hor\u00e1rio de ver\u00e3o de Serra Leoa", "SLST"};
264.280 + String TASMANIA[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o oriental (Tasm\u00e2nia)", "EST",
264.281 + "Fuso hor\u00e1rio de ver\u00e3o oriental (Tasm\u00e2nia)", "EST"};
264.282 + String TMT[] = new String[] {"Fuso hor\u00e1rio do Turcomenist\u00e3o", "TMT",
264.283 + "Fuso hor\u00e1rio de ver\u00e3o do Turcomenist\u00e3o", "TMST"};
264.284 + String TRUT[] = new String[] {"Fuso hor\u00e1rio de Chuuk", "CHUT",
264.285 + "Fuso hor\u00e1rio de ver\u00e3o de Chuuk", "CHUST"};
264.286 + String ULAT[]= new String[] {"Fuso hor\u00e1rio de Ulan Bator", "ULAT",
264.287 + "Fuso hor\u00e1rio de ver\u00e3o de Ulan Bator", "ULAST"};
264.288 + String WAT[] = new String[] {"Fuso hor\u00e1rio da \u00c1frica Ocidental", "WAT",
264.289 + "Fuso hor\u00e1rio de ver\u00e3o da \u00c1frica Ocidental", "WAST"};
264.290 + String WET[] = new String[] {"Fuso hor\u00e1rio da Europa Ocidental", "WET",
264.291 + "Fuso hor\u00e1rio de ver\u00e3o da Europa Ocidental", "WEST"};
264.292 + String WIT[] = new String[] {"Fuso hor\u00e1rio da Indon\u00e9sia Ocidental", "WIT",
264.293 + "Fuso hor\u00e1rio de ver\u00e3o da Indon\u00e9sia Ocidental", "WIST"};
264.294 + String WST_AUS[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o ocidental (Austr\u00e1lia)", "WST",
264.295 + "Fuso hor\u00e1rio de ver\u00e3o ocidental (Austr\u00e1lia)", "WST"};
264.296 + String SAMOA[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o de Samoa", "SST",
264.297 + "Hor\u00e1rio de luz natural de Samoa", "SDT"};
264.298 + String WST_SAMOA[] = new String[] {"Fuso hor\u00e1rio de Samoa Ocidental", "WST",
264.299 + "Fuso hor\u00e1rio de ver\u00e3o de Samoa Ocidental", "WSST"};
264.300 + String ChST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o de Chamorro", "ChST",
264.301 + "Hor\u00e1rio de luz natural de Chamorro", "ChDT"};
264.302 + String VICTORIA[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o oriental (Victoria)", "EST",
264.303 + "Fuso hor\u00e1rio de ver\u00e3o oriental (Victoria)", "EST"};
264.304 + String UTC[] = new String[] {"Tempo universal coordenado", "UTC",
264.305 + "Tempo universal coordenado", "UTC"};
264.306 + String UZT[] = new String[] {"Fuso hor\u00e1rio do Uzbequist\u00e3o", "UZT",
264.307 + "Fuso hor\u00e1rio de ver\u00e3o do Uzbequist\u00e3o", "UZST"};
264.308 + String WART[] = new String[] {"Fuso hor\u00e1rio da Argentina Ocidental", "WART",
264.309 + "Fuso hor\u00e1rio de ver\u00e3o da Argentina Ocidental", "WARST"};
264.310
264.311 + return new Object[][] {
264.312 + {"America/Los_Angeles", PST},
264.313 + {"PST", PST},
264.314 + {"America/Denver", MST},
264.315 + {"MST", MST},
264.316 + {"America/Phoenix", MST},
264.317 + {"PNT", MST},
264.318 + {"America/Chicago", CST},
264.319 + {"CST", CST},
264.320 + {"America/New_York", EST},
264.321 + {"EST", EST},
264.322 + {"America/Indianapolis", EST},
264.323 + {"IET", EST},
264.324 + {"Pacific/Honolulu", HST},
264.325 + {"HST", HST},
264.326 + {"America/Anchorage", AKST},
264.327 + {"AST", AKST},
264.328 + {"America/Halifax", AST},
264.329 + {"America/Sitka", AKST},
264.330 + {"America/St_Johns", NST},
264.331 + {"CNT", NST},
264.332 + {"Europe/Paris", CET},
264.333 + {"ECT", CET},
264.334 + {"GMT", GMT},
264.335 + {"Africa/Casablanca", WET},
264.336 + {"Asia/Jerusalem", ISRAEL},
264.337 + {"Asia/Tokyo", JST},
264.338 + {"JST", JST},
264.339 + {"Europe/Bucharest", EET},
264.340 + {"Asia/Shanghai", CTT},
264.341 + {"CTT", CTT},
264.342 + /* Don't change the order of the above zones
264.343 + * to keep compatibility with the previous version.
264.344 + */
264.345
264.346 - return new Object[][] {
264.347 - {"America/Los_Angeles", PST},
264.348 - {"PST", PST},
264.349 - {"America/Denver", MST},
264.350 - {"MST", MST},
264.351 - {"America/Phoenix", MST},
264.352 - {"PNT", MST},
264.353 - {"America/Chicago", CST},
264.354 - {"CST", CST},
264.355 - {"America/New_York", EST},
264.356 - {"EST", EST},
264.357 - {"America/Indianapolis", EST},
264.358 - {"IET", EST},
264.359 - {"Pacific/Honolulu", HST},
264.360 - {"HST", HST},
264.361 - {"America/Anchorage", AKST},
264.362 - {"AST", AKST},
264.363 - {"America/Halifax", AST},
264.364 - {"America/Sitka", AKST},
264.365 - {"America/St_Johns", NST},
264.366 - {"CNT", NST},
264.367 - {"Europe/Paris", CET},
264.368 - {"ECT", CET},
264.369 - {"GMT", GMT},
264.370 - {"Africa/Casablanca", WET},
264.371 - {"Asia/Jerusalem", ISRAEL},
264.372 - {"Asia/Tokyo", JST},
264.373 - {"JST", JST},
264.374 - {"Europe/Bucharest", EET},
264.375 - {"Asia/Shanghai", CTT},
264.376 - {"CTT", CTT},
264.377 - /* Don't change the order of the above zones
264.378 - * to keep compatibility with the previous version.
264.379 - */
264.380 -
264.381 - {"ACT", DARWIN},
264.382 - {"AET", EST_NSW},
264.383 - {"AGT", AGT},
264.384 - {"ART", EET},
264.385 - {"Africa/Abidjan", GMT},
264.386 - {"Africa/Accra", GHMT},
264.387 - {"Africa/Addis_Ababa", EAT},
264.388 - {"Africa/Algiers", CET},
264.389 - {"Africa/Asmara", EAT},
264.390 - {"Africa/Asmera", EAT},
264.391 - {"Africa/Bamako", GMT},
264.392 - {"Africa/Bangui", WAT},
264.393 - {"Africa/Banjul", GMT},
264.394 - {"Africa/Bissau", GMT},
264.395 - {"Africa/Blantyre", CAT},
264.396 - {"Africa/Brazzaville", WAT},
264.397 - {"Africa/Bujumbura", CAT},
264.398 - {"Africa/Cairo", EET},
264.399 - {"Africa/Ceuta", CET},
264.400 - {"Africa/Conakry", GMT},
264.401 - {"Africa/Dakar", GMT},
264.402 - {"Africa/Dar_es_Salaam", EAT},
264.403 - {"Africa/Djibouti", EAT},
264.404 - {"Africa/Douala", WAT},
264.405 - {"Africa/El_Aaiun", WET},
264.406 - {"Africa/Freetown", SLST},
264.407 - {"Africa/Gaborone", CAT},
264.408 - {"Africa/Harare", CAT},
264.409 - {"Africa/Johannesburg", SAST},
264.410 - {"Africa/Kampala", EAT},
264.411 - {"Africa/Khartoum", EAT},
264.412 - {"Africa/Kigali", CAT},
264.413 - {"Africa/Kinshasa", WAT},
264.414 - {"Africa/Lagos", WAT},
264.415 - {"Africa/Libreville", WAT},
264.416 - {"Africa/Lome", GMT},
264.417 - {"Africa/Luanda", WAT},
264.418 - {"Africa/Lubumbashi", CAT},
264.419 - {"Africa/Lusaka", CAT},
264.420 - {"Africa/Malabo", WAT},
264.421 - {"Africa/Maputo", CAT},
264.422 - {"Africa/Maseru", SAST},
264.423 - {"Africa/Mbabane", SAST},
264.424 - {"Africa/Mogadishu", EAT},
264.425 - {"Africa/Monrovia", GMT},
264.426 - {"Africa/Nairobi", EAT},
264.427 - {"Africa/Ndjamena", WAT},
264.428 - {"Africa/Niamey", WAT},
264.429 - {"Africa/Nouakchott", GMT},
264.430 - {"Africa/Ouagadougou", GMT},
264.431 - {"Africa/Porto-Novo", WAT},
264.432 - {"Africa/Sao_Tome", GMT},
264.433 - {"Africa/Timbuktu", GMT},
264.434 - {"Africa/Tripoli", EET},
264.435 - {"Africa/Tunis", CET},
264.436 - {"Africa/Windhoek", WAT},
264.437 - {"America/Adak", HAST},
264.438 - {"America/Anguilla", AST},
264.439 - {"America/Antigua", AST},
264.440 - {"America/Araguaina", BRT},
264.441 - {"America/Argentina/Buenos_Aires", AGT},
264.442 - {"America/Argentina/Catamarca", AGT},
264.443 - {"America/Argentina/ComodRivadavia", AGT},
264.444 - {"America/Argentina/Cordoba", AGT},
264.445 - {"America/Argentina/Jujuy", AGT},
264.446 - {"America/Argentina/La_Rioja", AGT},
264.447 - {"America/Argentina/Mendoza", AGT},
264.448 - {"America/Argentina/Rio_Gallegos", AGT},
264.449 - {"America/Argentina/Salta", AGT},
264.450 - {"America/Argentina/San_Juan", AGT},
264.451 - {"America/Argentina/San_Luis", WART},
264.452 - {"America/Argentina/Tucuman", AGT},
264.453 - {"America/Argentina/Ushuaia", AGT},
264.454 - {"America/Aruba", AST},
264.455 - {"America/Asuncion", new String[] {"Fuso hor\u00e1rio do Paraguai", "PYT",
264.456 - "Fuso hor\u00e1rio de ver\u00e3o do Paraguai", "PYST"}},
264.457 + {"ACT", DARWIN},
264.458 + {"AET", EST_NSW},
264.459 + {"AGT", AGT},
264.460 + {"ART", EET},
264.461 + {"Africa/Abidjan", GMT},
264.462 + {"Africa/Accra", GHMT},
264.463 + {"Africa/Addis_Ababa", EAT},
264.464 + {"Africa/Algiers", CET},
264.465 + {"Africa/Asmara", EAT},
264.466 + {"Africa/Asmera", EAT},
264.467 + {"Africa/Bamako", GMT},
264.468 + {"Africa/Bangui", WAT},
264.469 + {"Africa/Banjul", GMT},
264.470 + {"Africa/Bissau", GMT},
264.471 + {"Africa/Blantyre", CAT},
264.472 + {"Africa/Brazzaville", WAT},
264.473 + {"Africa/Bujumbura", CAT},
264.474 + {"Africa/Cairo", EET},
264.475 + {"Africa/Ceuta", CET},
264.476 + {"Africa/Conakry", GMT},
264.477 + {"Africa/Dakar", GMT},
264.478 + {"Africa/Dar_es_Salaam", EAT},
264.479 + {"Africa/Djibouti", EAT},
264.480 + {"Africa/Douala", WAT},
264.481 + {"Africa/El_Aaiun", WET},
264.482 + {"Africa/Freetown", SLST},
264.483 + {"Africa/Gaborone", CAT},
264.484 + {"Africa/Harare", CAT},
264.485 + {"Africa/Johannesburg", SAST},
264.486 + {"Africa/Kampala", EAT},
264.487 + {"Africa/Khartoum", EAT},
264.488 + {"Africa/Kigali", CAT},
264.489 + {"Africa/Kinshasa", WAT},
264.490 + {"Africa/Lagos", WAT},
264.491 + {"Africa/Libreville", WAT},
264.492 + {"Africa/Lome", GMT},
264.493 + {"Africa/Luanda", WAT},
264.494 + {"Africa/Lubumbashi", CAT},
264.495 + {"Africa/Lusaka", CAT},
264.496 + {"Africa/Malabo", WAT},
264.497 + {"Africa/Maputo", CAT},
264.498 + {"Africa/Maseru", SAST},
264.499 + {"Africa/Mbabane", SAST},
264.500 + {"Africa/Mogadishu", EAT},
264.501 + {"Africa/Monrovia", GMT},
264.502 + {"Africa/Nairobi", EAT},
264.503 + {"Africa/Ndjamena", WAT},
264.504 + {"Africa/Niamey", WAT},
264.505 + {"Africa/Nouakchott", GMT},
264.506 + {"Africa/Ouagadougou", GMT},
264.507 + {"Africa/Porto-Novo", WAT},
264.508 + {"Africa/Sao_Tome", GMT},
264.509 + {"Africa/Timbuktu", GMT},
264.510 + {"Africa/Tripoli", EET},
264.511 + {"Africa/Tunis", CET},
264.512 + {"Africa/Windhoek", WAT},
264.513 + {"America/Adak", HAST},
264.514 + {"America/Anguilla", AST},
264.515 + {"America/Antigua", AST},
264.516 + {"America/Araguaina", BRT},
264.517 + {"America/Argentina/Buenos_Aires", AGT},
264.518 + {"America/Argentina/Catamarca", AGT},
264.519 + {"America/Argentina/ComodRivadavia", AGT},
264.520 + {"America/Argentina/Cordoba", AGT},
264.521 + {"America/Argentina/Jujuy", AGT},
264.522 + {"America/Argentina/La_Rioja", AGT},
264.523 + {"America/Argentina/Mendoza", AGT},
264.524 + {"America/Argentina/Rio_Gallegos", AGT},
264.525 + {"America/Argentina/Salta", AGT},
264.526 + {"America/Argentina/San_Juan", AGT},
264.527 + {"America/Argentina/San_Luis", WART},
264.528 + {"America/Argentina/Tucuman", AGT},
264.529 + {"America/Argentina/Ushuaia", AGT},
264.530 + {"America/Aruba", AST},
264.531 + {"America/Asuncion", new String[] {"Fuso hor\u00e1rio do Paraguai", "PYT",
264.532 + "Fuso hor\u00e1rio de ver\u00e3o do Paraguai", "PYST"}},
264.533 {"America/Atikokan", EST},
264.534 - {"America/Atka", HAST},
264.535 - {"America/Bahia", BRT},
264.536 - {"America/Bahia_Banderas", CST},
264.537 - {"America/Barbados", AST},
264.538 - {"America/Belem", BRT},
264.539 - {"America/Belize", CST},
264.540 + {"America/Atka", HAST},
264.541 + {"America/Bahia", BRT},
264.542 + {"America/Bahia_Banderas", CST},
264.543 + {"America/Barbados", AST},
264.544 + {"America/Belem", BRT},
264.545 + {"America/Belize", CST},
264.546 {"America/Blanc-Sablon", AST},
264.547 - {"America/Boa_Vista", AMT},
264.548 - {"America/Bogota", new String[] {"Fuso hor\u00e1rio da Col\u00f4mbia", "COT",
264.549 - "Fuso hor\u00e1rio de ver\u00e3o da Col\u00f4mbia", "COST"}},
264.550 - {"America/Boise", MST},
264.551 - {"America/Buenos_Aires", AGT},
264.552 - {"America/Cambridge_Bay", MST},
264.553 - {"America/Campo_Grande", AMT},
264.554 - {"America/Cancun", CST},
264.555 - {"America/Caracas", new String[] {"Fuso hor\u00e1rio da Venezuela", "VET",
264.556 - "Fuso hor\u00e1rio de ver\u00e3o da Venezuela", "VEST"}},
264.557 - {"America/Catamarca", AGT},
264.558 - {"America/Cayenne", new String[] {"Fuso hor\u00e1rio da Guiana Francesa", "GFT",
264.559 - "Fuso hor\u00e1rio de ver\u00e3o da Guiana Francesa", "GFST"}},
264.560 - {"America/Cayman", EST},
264.561 - {"America/Chihuahua", MST},
264.562 - {"America/Coral_Harbour", EST},
264.563 - {"America/Cordoba", AGT},
264.564 - {"America/Costa_Rica", CST},
264.565 - {"America/Cuiaba", AMT},
264.566 - {"America/Curacao", AST},
264.567 - {"America/Danmarkshavn", GMT},
264.568 - {"America/Dawson", PST},
264.569 - {"America/Dawson_Creek", MST},
264.570 - {"America/Detroit", EST},
264.571 - {"America/Dominica", AST},
264.572 - {"America/Edmonton", MST},
264.573 - {"America/Eirunepe", AMT},
264.574 - {"America/El_Salvador", CST},
264.575 - {"America/Ensenada", PST},
264.576 - {"America/Fort_Wayne", EST},
264.577 - {"America/Fortaleza", BRT},
264.578 - {"America/Glace_Bay", AST},
264.579 - {"America/Godthab", new String[] {"Fuso hor\u00e1rio da Groenl\u00e2ndia Ocidental", "WGT",
264.580 - "Fuso hor\u00e1rio de ver\u00e3o da Groenl\u00e2ndia Ocidental", "WGST"}},
264.581 - {"America/Goose_Bay", AST},
264.582 - {"America/Grand_Turk", EST},
264.583 - {"America/Grenada", AST},
264.584 - {"America/Guadeloupe", AST},
264.585 - {"America/Guatemala", CST},
264.586 - {"America/Guayaquil", new String[] {"Fuso hor\u00e1rio do Equador", "ECT",
264.587 - "Fuso hor\u00e1rio de ver\u00e3o do Equador", "ECST"}},
264.588 - {"America/Guyana", new String[] {"Fuso hor\u00e1rio da Guiana", "GYT",
264.589 - "Fuso hor\u00e1rio de ver\u00e3o da Guiana", "GYST"}},
264.590 - {"America/Havana", CUBA},
264.591 - {"America/Hermosillo", MST},
264.592 - {"America/Indiana/Indianapolis", EST},
264.593 - {"America/Indiana/Knox", CST},
264.594 - {"America/Indiana/Marengo", EST},
264.595 - {"America/Indiana/Petersburg", EST},
264.596 - {"America/Indiana/Tell_City", CST},
264.597 - {"America/Indiana/Vevay", EST},
264.598 - {"America/Indiana/Vincennes", EST},
264.599 - {"America/Indiana/Winamac", EST},
264.600 - {"America/Inuvik", MST},
264.601 - {"America/Iqaluit", EST},
264.602 - {"America/Jamaica", EST},
264.603 - {"America/Jujuy", AGT},
264.604 - {"America/Juneau", AKST},
264.605 - {"America/Kentucky/Louisville", EST},
264.606 - {"America/Kentucky/Monticello", EST},
264.607 - {"America/Knox_IN", CST},
264.608 - {"America/La_Paz", new String[] {"Fuso hor\u00e1rio da Bol\u00edvia", "BOT",
264.609 - "Fuso hor\u00e1rio de ver\u00e3o da Bol\u00edvia", "BOST"}},
264.610 - {"America/Lima", new String[] {"Fuso hor\u00e1rio do Peru", "PET",
264.611 - "Fuso hor\u00e1rio de ver\u00e3o do Peru", "PEST"}},
264.612 - {"America/Louisville", EST},
264.613 - {"America/Maceio", BRT},
264.614 - {"America/Managua", CST},
264.615 - {"America/Manaus", AMT},
264.616 - {"America/Marigot", AST},
264.617 - {"America/Martinique", AST},
264.618 - {"America/Mazatlan", MST},
264.619 - {"America/Mendoza", AGT},
264.620 - {"America/Menominee", CST},
264.621 - {"America/Merida", CST},
264.622 - {"America/Metlakatla", new String[] {"Metlakatla Standard Time", "MeST",
264.623 - "Metlakatla Daylight Time", "MeDT"}},
264.624 - {"America/Mexico_City", CST},
264.625 - {"America/Miquelon", new String[] {"Fuso hor\u00e1rio padr\u00e3o de S\u00e3o Pedro e Miquelon", "PMST",
264.626 - "Hor\u00e1rio de luz natural de S\u00e3o Pedro e Miquelon", "PMDT"}},
264.627 - {"America/Moncton", AST},
264.628 - {"America/Montevideo", new String[] {"Fuso hor\u00e1rio do Uruguai", "UYT",
264.629 - "Fuso hor\u00e1rio de ver\u00e3o do Uruguai", "UYST"}},
264.630 - {"America/Monterrey", CST},
264.631 - {"America/Montreal", EST},
264.632 - {"America/Montserrat", AST},
264.633 - {"America/Nassau", EST},
264.634 - {"America/Nipigon", EST},
264.635 - {"America/Nome", AKST},
264.636 - {"America/Noronha", NORONHA},
264.637 + {"America/Boa_Vista", AMT},
264.638 + {"America/Bogota", new String[] {"Fuso hor\u00e1rio da Col\u00f4mbia", "COT",
264.639 + "Fuso hor\u00e1rio de ver\u00e3o da Col\u00f4mbia", "COST"}},
264.640 + {"America/Boise", MST},
264.641 + {"America/Buenos_Aires", AGT},
264.642 + {"America/Cambridge_Bay", MST},
264.643 + {"America/Campo_Grande", AMT},
264.644 + {"America/Cancun", CST},
264.645 + {"America/Caracas", new String[] {"Fuso hor\u00e1rio da Venezuela", "VET",
264.646 + "Fuso hor\u00e1rio de ver\u00e3o da Venezuela", "VEST"}},
264.647 + {"America/Catamarca", AGT},
264.648 + {"America/Cayenne", new String[] {"Fuso hor\u00e1rio da Guiana Francesa", "GFT",
264.649 + "Fuso hor\u00e1rio de ver\u00e3o da Guiana Francesa", "GFST"}},
264.650 + {"America/Cayman", EST},
264.651 + {"America/Chihuahua", MST},
264.652 + {"America/Coral_Harbour", EST},
264.653 + {"America/Cordoba", AGT},
264.654 + {"America/Costa_Rica", CST},
264.655 + {"America/Cuiaba", AMT},
264.656 + {"America/Curacao", AST},
264.657 + {"America/Danmarkshavn", GMT},
264.658 + {"America/Dawson", PST},
264.659 + {"America/Dawson_Creek", MST},
264.660 + {"America/Detroit", EST},
264.661 + {"America/Dominica", AST},
264.662 + {"America/Edmonton", MST},
264.663 + {"America/Eirunepe", AMT},
264.664 + {"America/El_Salvador", CST},
264.665 + {"America/Ensenada", PST},
264.666 + {"America/Fort_Wayne", EST},
264.667 + {"America/Fortaleza", BRT},
264.668 + {"America/Glace_Bay", AST},
264.669 + {"America/Godthab", new String[] {"Fuso hor\u00e1rio da Groenl\u00e2ndia Ocidental", "WGT",
264.670 + "Fuso hor\u00e1rio de ver\u00e3o da Groenl\u00e2ndia Ocidental", "WGST"}},
264.671 + {"America/Goose_Bay", AST},
264.672 + {"America/Grand_Turk", EST},
264.673 + {"America/Grenada", AST},
264.674 + {"America/Guadeloupe", AST},
264.675 + {"America/Guatemala", CST},
264.676 + {"America/Guayaquil", new String[] {"Fuso hor\u00e1rio do Equador", "ECT",
264.677 + "Fuso hor\u00e1rio de ver\u00e3o do Equador", "ECST"}},
264.678 + {"America/Guyana", new String[] {"Fuso hor\u00e1rio da Guiana", "GYT",
264.679 + "Fuso hor\u00e1rio de ver\u00e3o da Guiana", "GYST"}},
264.680 + {"America/Havana", CUBA},
264.681 + {"America/Hermosillo", MST},
264.682 + {"America/Indiana/Indianapolis", EST},
264.683 + {"America/Indiana/Knox", CST},
264.684 + {"America/Indiana/Marengo", EST},
264.685 + {"America/Indiana/Petersburg", EST},
264.686 + {"America/Indiana/Tell_City", CST},
264.687 + {"America/Indiana/Vevay", EST},
264.688 + {"America/Indiana/Vincennes", EST},
264.689 + {"America/Indiana/Winamac", EST},
264.690 + {"America/Inuvik", MST},
264.691 + {"America/Iqaluit", EST},
264.692 + {"America/Jamaica", EST},
264.693 + {"America/Jujuy", AGT},
264.694 + {"America/Juneau", AKST},
264.695 + {"America/Kentucky/Louisville", EST},
264.696 + {"America/Kentucky/Monticello", EST},
264.697 + {"America/Knox_IN", CST},
264.698 + {"America/La_Paz", new String[] {"Fuso hor\u00e1rio da Bol\u00edvia", "BOT",
264.699 + "Fuso hor\u00e1rio de ver\u00e3o da Bol\u00edvia", "BOST"}},
264.700 + {"America/Lima", new String[] {"Fuso hor\u00e1rio do Peru", "PET",
264.701 + "Fuso hor\u00e1rio de ver\u00e3o do Peru", "PEST"}},
264.702 + {"America/Louisville", EST},
264.703 + {"America/Maceio", BRT},
264.704 + {"America/Managua", CST},
264.705 + {"America/Manaus", AMT},
264.706 + {"America/Marigot", AST},
264.707 + {"America/Martinique", AST},
264.708 + {"America/Matamoros", CST},
264.709 + {"America/Mazatlan", MST},
264.710 + {"America/Mendoza", AGT},
264.711 + {"America/Menominee", CST},
264.712 + {"America/Merida", CST},
264.713 + {"America/Metlakatla", new String[] {"Metlakatla Standard Time", "MeST",
264.714 + "Metlakatla Daylight Time", "MeDT"}},
264.715 + {"America/Mexico_City", CST},
264.716 + {"America/Miquelon", new String[] {"Fuso hor\u00e1rio padr\u00e3o de S\u00e3o Pedro e Miquelon", "PMST",
264.717 + "Hor\u00e1rio de luz natural de S\u00e3o Pedro e Miquelon", "PMDT"}},
264.718 + {"America/Moncton", AST},
264.719 + {"America/Montevideo", new String[] {"Fuso hor\u00e1rio do Uruguai", "UYT",
264.720 + "Fuso hor\u00e1rio de ver\u00e3o do Uruguai", "UYST"}},
264.721 + {"America/Monterrey", CST},
264.722 + {"America/Montreal", EST},
264.723 + {"America/Montserrat", AST},
264.724 + {"America/Nassau", EST},
264.725 + {"America/Nipigon", EST},
264.726 + {"America/Nome", AKST},
264.727 + {"America/Noronha", NORONHA},
264.728 {"America/North_Dakota/Beulah", CST},
264.729 - {"America/North_Dakota/Center", CST},
264.730 + {"America/North_Dakota/Center", CST},
264.731 {"America/North_Dakota/New_Salem", CST},
264.732 - {"America/Panama", EST},
264.733 - {"America/Pangnirtung", EST},
264.734 - {"America/Paramaribo", new String[] {"Fuso hor\u00e1rio do Suriname", "SRT",
264.735 - "Fuso hor\u00e1rio de ver\u00e3o do Suriname", "SRST"}},
264.736 - {"America/Port-au-Prince", EST},
264.737 - {"America/Port_of_Spain", AST},
264.738 - {"America/Porto_Acre", AMT},
264.739 - {"America/Porto_Velho", AMT},
264.740 - {"America/Puerto_Rico", AST},
264.741 - {"America/Rainy_River", CST},
264.742 - {"America/Rankin_Inlet", CST},
264.743 - {"America/Recife", BRT},
264.744 - {"America/Regina", CST},
264.745 - {"America/Resolute", RST},
264.746 - {"America/Rio_Branco", AMT},
264.747 - {"America/Rosario", AGT},
264.748 - {"America/Santarem", BRT},
264.749 - {"America/Santiago", CLT},
264.750 - {"America/Santo_Domingo", AST},
264.751 - {"America/Sao_Paulo", BRT},
264.752 - {"America/Scoresbysund", EGT},
264.753 - {"America/Shiprock", MST},
264.754 - {"America/St_Barthelemy", AST},
264.755 - {"America/St_Kitts", AST},
264.756 - {"America/St_Lucia", AST},
264.757 - {"America/St_Thomas", AST},
264.758 - {"America/St_Vincent", AST},
264.759 - {"America/Swift_Current", CST},
264.760 - {"America/Tegucigalpa", CST},
264.761 - {"America/Thule", AST},
264.762 - {"America/Thunder_Bay", EST},
264.763 - {"America/Tijuana", PST},
264.764 - {"America/Toronto", EST},
264.765 - {"America/Tortola", AST},
264.766 - {"America/Vancouver", PST},
264.767 - {"America/Virgin", AST},
264.768 - {"America/Whitehorse", PST},
264.769 - {"America/Winnipeg", CST},
264.770 - {"America/Yakutat", AKST},
264.771 - {"America/Yellowknife", MST},
264.772 - {"Antarctica/Casey", WST_AUS},
264.773 - {"Antarctica/Davis", new String[] {"Fuso hor\u00e1rio de Davis", "DAVT",
264.774 - "Fuso hor\u00e1rio de ver\u00e3o de Davis", "DAVST"}},
264.775 - {"Antarctica/DumontDUrville", new String[] {"Fuso hor\u00e1rio de Dumont-d'Urville", "DDUT",
264.776 - "Fuso hor\u00e1rio de ver\u00e3o de Dumont-d'Urville", "DDUST"}},
264.777 - {"Antarctica/Mawson", new String[] {"Fuso hor\u00e1rio de Mawson", "MAWT",
264.778 - "Fuso hor\u00e1rio de ver\u00e3o de Mawson", "MAWST"}},
264.779 - {"Antarctica/McMurdo", NZST},
264.780 - {"Antarctica/Palmer", CLT},
264.781 - {"Antarctica/Rothera", new String[] {"Fuso hor\u00e1rio de Rothera", "ROTT",
264.782 - "Fuso hor\u00e1rio de ver\u00e3o de Rothera", "ROTST"}},
264.783 - {"Antarctica/South_Pole", NZST},
264.784 - {"Antarctica/Syowa", new String[] {"Fuso hor\u00e1rio de Syowa", "SYOT",
264.785 - "Fuso hor\u00e1rio de ver\u00e3o de Syowa", "SYOST"}},
264.786 - {"Antarctica/Vostok", new String[] {"Fuso hor\u00e1rio de Vostok", "VOST",
264.787 - "Fuso hor\u00e1rio de ver\u00e3o de Vostok", "VOSST"}},
264.788 - {"Arctic/Longyearbyen", CET},
264.789 - {"Asia/Aden", ARAST},
264.790 - {"Asia/Almaty", new String[] {"Fuso hor\u00e1rio de Alma-Ata", "ALMT",
264.791 - "Fuso hor\u00e1rio de ver\u00e3o de Alma-Ata", "ALMST"}},
264.792 - {"Asia/Amman", EET},
264.793 - {"Asia/Anadyr", new String[] {"Fuso hor\u00e1rio de Anadyr", "ANAT",
264.794 - "Fuso hor\u00e1rio de ver\u00e3o de Anadyr", "ANAST"}},
264.795 - {"Asia/Aqtau", new String[] {"Fuso hor\u00e1rio de Aqtau", "AQTT",
264.796 - "Fuso hor\u00e1rio de ver\u00e3o de Aqtau", "AQTST"}},
264.797 - {"Asia/Aqtobe", new String[] {"Fuso hor\u00e1rio de Aqtobe", "AQTT",
264.798 - "Fuso hor\u00e1rio de ver\u00e3o de Aqtobe", "AQTST"}},
264.799 - {"Asia/Ashgabat", TMT},
264.800 - {"Asia/Ashkhabad", TMT},
264.801 - {"Asia/Baghdad", ARAST},
264.802 - {"Asia/Bahrain", ARAST},
264.803 - {"Asia/Baku", new String[] {"Fuso hor\u00e1rio do Azerbaij\u00e3o", "AZT",
264.804 - "Fuso hor\u00e1rio de ver\u00e3o do Azerbaij\u00e3o", "AZST"}},
264.805 - {"Asia/Bangkok", ICT},
264.806 - {"Asia/Beirut", EET},
264.807 - {"Asia/Bishkek", new String[] {"Fuso hor\u00e1rio do Quirguist\u00e3o", "KGT",
264.808 - "Fuso hor\u00e1rio de ver\u00e3o do Quirguist\u00e3o", "KGST"}},
264.809 - {"Asia/Brunei", new String[] {"Fuso hor\u00e1rio de Brunei", "BNT",
264.810 - "Fuso hor\u00e1rio de ver\u00e3o de Brunei", "BNST"}},
264.811 - {"Asia/Calcutta", IST},
264.812 - {"Asia/Choibalsan", new String[] {"Fuso hor\u00e1rio de Choibalsan", "CHOT",
264.813 - "Fuso hor\u00e1rio de ver\u00e3o de Choibalsan", "CHOST"}},
264.814 - {"Asia/Chongqing", CTT},
264.815 - {"Asia/Chungking", CTT},
264.816 - {"Asia/Colombo", IST},
264.817 - {"Asia/Dacca", BDT},
264.818 - {"Asia/Dhaka", BDT},
264.819 - {"Asia/Dili", new String[] {"Fuso hor\u00e1rio do Timor-Leste", "TLT",
264.820 - "Fuso hor\u00e1rio de ver\u00e3o do Timor-Leste", "TLST"}},
264.821 - {"Asia/Damascus", EET},
264.822 - {"Asia/Dubai", GST},
264.823 - {"Asia/Dushanbe", new String[] {"Fuso hor\u00e1rio do Tadjiquist\u00e3o", "TJT",
264.824 - "Fuso hor\u00e1rio de ver\u00e3o do Tadjiquist\u00e3o", "TJST"}},
264.825 - {"Asia/Gaza", EET},
264.826 - {"Asia/Harbin", CTT},
264.827 - {"Asia/Ho_Chi_Minh", ICT},
264.828 - {"Asia/Hong_Kong", HKT},
264.829 - {"Asia/Hovd", new String[] {"Fuso hor\u00e1rio de Hovd", "HOVT",
264.830 - "Fuso hor\u00e1rio de ver\u00e3o de Hovd", "HOVST"}},
264.831 - {"Asia/Irkutsk", new String[] {"Fuso hor\u00e1rio de Irkutsk", "IRKT",
264.832 - "Fuso hor\u00e1rio de ver\u00e3o de Irkutsk", "IRKST"}},
264.833 - {"Asia/Istanbul", EET},
264.834 - {"Asia/Jakarta", WIT},
264.835 - {"Asia/Jayapura", new String[] {"Fuso hor\u00e1rio da Indon\u00e9sia Oriental", "EIT",
264.836 - "Fuso hor\u00e1rio de ver\u00e3o da Indon\u00e9sia Oriental", "EIST"}},
264.837 - {"Asia/Kabul", new String[] {"Fuso hor\u00e1rio do Afeganist\u00e3o", "AFT",
264.838 - "Fuso hor\u00e1rio de ver\u00e3o do Afeganist\u00e3o", "AFST"}},
264.839 - {"Asia/Kamchatka", new String[] {"Fuso hor\u00e1rio de Petropavlovsk-Kamchatski", "PETT",
264.840 - "Fuso hor\u00e1rio de ver\u00e3o de Petropavlovsk-Kamchatski", "PETST"}},
264.841 - {"Asia/Karachi", PKT},
264.842 - {"Asia/Kashgar", CTT},
264.843 - {"Asia/Kathmandu", NPT},
264.844 - {"Asia/Katmandu", NPT},
264.845 - {"Asia/Kolkata", IST},
264.846 - {"Asia/Krasnoyarsk", new String[] {"Fuso hor\u00e1rio de Krasnoyarsk", "KRAT",
264.847 - "Fuso hor\u00e1rio de ver\u00e3o de Krasnoyarsk", "KRAST"}},
264.848 - {"Asia/Kuala_Lumpur", MYT},
264.849 - {"Asia/Kuching", MYT},
264.850 - {"Asia/Kuwait", ARAST},
264.851 - {"Asia/Macao", CTT},
264.852 - {"Asia/Macau", CTT},
264.853 - {"Asia/Magadan", new String[] {"Fuso hor\u00e1rio de Magadan", "MAGT",
264.854 - "Fuso hor\u00e1rio de ver\u00e3o de Magadan", "MAGST"}},
264.855 - {"Asia/Makassar", CIT},
264.856 - {"Asia/Manila", new String[] {"Fuso hor\u00e1rio das Filipinas", "PHT",
264.857 - "Fuso hor\u00e1rio de ver\u00e3o das Filipinas", "PHST"}},
264.858 - {"Asia/Muscat", GST},
264.859 - {"Asia/Nicosia", EET},
264.860 - {"Asia/Novokuznetsk", NOVT},
264.861 - {"Asia/Novosibirsk", NOVT},
264.862 - {"Asia/Oral", new String[] {"Fuso hor\u00e1rio de Uralsk", "ORAT",
264.863 - "Fuso hor\u00e1rio de ver\u00e3o de Uralsk", "ORAST"}},
264.864 - {"Asia/Omsk", new String[] {"Fuso hor\u00e1rio de Omsk", "OMST",
264.865 - "Fuso hor\u00e1rio de ver\u00e3o de Omsk", "OMSST"}},
264.866 - {"Asia/Phnom_Penh", ICT},
264.867 - {"Asia/Pontianak", WIT},
264.868 - {"Asia/Pyongyang", KST},
264.869 - {"Asia/Qatar", ARAST},
264.870 - {"Asia/Qyzylorda", new String[] {"Fuso hor\u00e1rio de Kizil-Orda", "QYZT",
264.871 - "Fuso hor\u00e1rio de ver\u00e3o de Kizil-Orda", "QYZST"}},
264.872 - {"Asia/Rangoon", new String[] {"Fuso hor\u00e1rio de Mianmar", "MMT",
264.873 - "Fuso hor\u00e1rio de ver\u00e3o de Mianmar", "MMST"}},
264.874 - {"Asia/Riyadh", ARAST},
264.875 - {"Asia/Saigon", ICT},
264.876 - {"Asia/Sakhalin", new String[] {"Fuso hor\u00e1rio de Sakhalina", "SAKT",
264.877 - "Fuso hor\u00e1rio de ver\u00e3o de Sakhalina", "SAKST"}},
264.878 - {"Asia/Samarkand", UZT},
264.879 - {"Asia/Seoul", KST},
264.880 - {"Asia/Singapore", SGT},
264.881 - {"Asia/Taipei", CTT},
264.882 - {"Asia/Tel_Aviv", ISRAEL},
264.883 - {"Asia/Tashkent", UZT},
264.884 - {"Asia/Tbilisi", new String[] {"Fuso hor\u00e1rio da Ge\u00f3rgia", "GET",
264.885 - "Fuso hor\u00e1rio de ver\u00e3o da Ge\u00f3rgia", "GEST"}},
264.886 - {"Asia/Tehran", IRT},
264.887 - {"Asia/Thimbu", BTT},
264.888 - {"Asia/Thimphu", BTT},
264.889 - {"Asia/Ujung_Pandang", CIT},
264.890 - {"Asia/Ulaanbaatar", ULAT},
264.891 - {"Asia/Ulan_Bator", ULAT},
264.892 - {"Asia/Urumqi", CTT},
264.893 - {"Asia/Vientiane", ICT},
264.894 - {"Asia/Vladivostok", new String[] {"Fuso hor\u00e1rio de Vladivostok", "VLAT",
264.895 - "Fuso hor\u00e1rio de ver\u00e3o de Vladivostok", "VLAST"}},
264.896 - {"Asia/Yakutsk", new String[] {"Fuso hor\u00e1rio de Yakutsk", "YAKT",
264.897 - "Fuso hor\u00e1rio de ver\u00e3o de Yakutsk", "YAKST"}},
264.898 - {"Asia/Yekaterinburg", new String[] {"Fuso hor\u00e1rio de Yekaterinburgo", "YEKT",
264.899 - "Fuso hor\u00e1rio de ver\u00e3o de Yekaterinburgo", "YEKST"}},
264.900 - {"Asia/Yerevan", ARMT},
264.901 - {"Atlantic/Azores", new String[] {"Fuso hor\u00e1rio das A\u00e7ores", "AZOT",
264.902 - "Fuso hor\u00e1rio de ver\u00e3o das A\u00e7ores", "AZOST"}},
264.903 - {"Atlantic/Bermuda", AST},
264.904 - {"Atlantic/Canary", WET},
264.905 - {"Atlantic/Cape_Verde", new String[] {"Fuso hor\u00e1rio de Cabo Verde", "CVT",
264.906 - "Fuso hor\u00e1rio de ver\u00e3o de Cabo Verde", "CVST"}},
264.907 - {"Atlantic/Faeroe", WET},
264.908 - {"Atlantic/Faroe", WET},
264.909 - {"Atlantic/Jan_Mayen", CET},
264.910 - {"Atlantic/Madeira", WET},
264.911 - {"Atlantic/Reykjavik", GMT},
264.912 - {"Atlantic/South_Georgia", new String[] {"Fuso hor\u00e1rio padr\u00e3o da Ge\u00f3rgia do Sul", "GST",
264.913 - "Hor\u00e1rio de luz natural da Ge\u00f3rgia do Sul", "GDT"}},
264.914 - {"Atlantic/St_Helena", GMT},
264.915 - {"Atlantic/Stanley", new String[] {"Fuso hor\u00e1rio das Ilhas Falkland", "FKT",
264.916 - "Fuso hor\u00e1rio de ver\u00e3o das Ilhas Falkland", "FKST"}},
264.917 - {"Australia/ACT", EST_NSW},
264.918 - {"Australia/Adelaide", ADELAIDE},
264.919 - {"Australia/Brisbane", BRISBANE},
264.920 - {"Australia/Broken_Hill", BROKEN_HILL},
264.921 - {"Australia/Canberra", EST_NSW},
264.922 - {"Australia/Currie", EST_NSW},
264.923 - {"Australia/Darwin", DARWIN},
264.924 - {"Australia/Eucla", new String[] {"Fuso hor\u00e1rio ocidental central (Austr\u00e1lia)", "CWST",
264.925 - "Fuso hor\u00e1rio de ver\u00e3o ocidental central (Austr\u00e1lia)", "CWST"}},
264.926 - {"Australia/Hobart", TASMANIA},
264.927 - {"Australia/LHI", LORD_HOWE},
264.928 - {"Australia/Lindeman", BRISBANE},
264.929 - {"Australia/Lord_Howe", LORD_HOWE},
264.930 - {"Australia/Melbourne", VICTORIA},
264.931 - {"Australia/North", DARWIN},
264.932 - {"Australia/NSW", EST_NSW},
264.933 - {"Australia/Perth", WST_AUS},
264.934 - {"Australia/Queensland", BRISBANE},
264.935 - {"Australia/South", ADELAIDE},
264.936 - {"Australia/Sydney", EST_NSW},
264.937 - {"Australia/Tasmania", TASMANIA},
264.938 - {"Australia/Victoria", VICTORIA},
264.939 - {"Australia/West", WST_AUS},
264.940 - {"Australia/Yancowinna", BROKEN_HILL},
264.941 - {"BET", BRT},
264.942 - {"BST", BDT},
264.943 - {"Brazil/Acre", AMT},
264.944 - {"Brazil/DeNoronha", NORONHA},
264.945 - {"Brazil/East", BRT},
264.946 - {"Brazil/West", AMT},
264.947 - {"Canada/Atlantic", AST},
264.948 - {"Canada/Central", CST},
264.949 - {"Canada/East-Saskatchewan", CST},
264.950 - {"Canada/Eastern", EST},
264.951 - {"Canada/Mountain", MST},
264.952 - {"Canada/Newfoundland", NST},
264.953 - {"Canada/Pacific", PST},
264.954 - {"Canada/Yukon", PST},
264.955 - {"Canada/Saskatchewan", CST},
264.956 - {"CAT", CAT},
264.957 - {"CET", CET},
264.958 - {"Chile/Continental", CLT},
264.959 - {"Chile/EasterIsland", EASTER},
264.960 - {"CST6CDT", CST},
264.961 - {"Cuba", CUBA},
264.962 - {"EAT", EAT},
264.963 - {"EET", EET},
264.964 - {"Egypt", EET},
264.965 - {"Eire", DUBLIN},
264.966 - {"EST5EDT", EST},
264.967 - {"Etc/Greenwich", GMT},
264.968 - {"Etc/UCT", UTC},
264.969 - {"Etc/Universal", UTC},
264.970 - {"Etc/UTC", UTC},
264.971 - {"Etc/Zulu", UTC},
264.972 - {"Europe/Amsterdam", CET},
264.973 - {"Europe/Andorra", CET},
264.974 - {"Europe/Athens", EET},
264.975 - {"Europe/Belfast", GMTBST},
264.976 - {"Europe/Belgrade", CET},
264.977 - {"Europe/Berlin", CET},
264.978 - {"Europe/Bratislava", CET},
264.979 - {"Europe/Brussels", CET},
264.980 - {"Europe/Budapest", CET},
264.981 - {"Europe/Chisinau", EET},
264.982 - {"Europe/Copenhagen", CET},
264.983 - {"Europe/Dublin", DUBLIN},
264.984 - {"Europe/Gibraltar", CET},
264.985 + {"America/Ojinaga", MST},
264.986 + {"America/Panama", EST},
264.987 + {"America/Pangnirtung", EST},
264.988 + {"America/Paramaribo", new String[] {"Fuso hor\u00e1rio do Suriname", "SRT",
264.989 + "Fuso hor\u00e1rio de ver\u00e3o do Suriname", "SRST"}},
264.990 + {"America/Port-au-Prince", EST},
264.991 + {"America/Port_of_Spain", AST},
264.992 + {"America/Porto_Acre", AMT},
264.993 + {"America/Porto_Velho", AMT},
264.994 + {"America/Puerto_Rico", AST},
264.995 + {"America/Rainy_River", CST},
264.996 + {"America/Rankin_Inlet", CST},
264.997 + {"America/Recife", BRT},
264.998 + {"America/Regina", CST},
264.999 + {"America/Resolute", RST},
264.1000 + {"America/Rio_Branco", AMT},
264.1001 + {"America/Rosario", AGT},
264.1002 + {"America/Santa_Isabel", PST},
264.1003 + {"America/Santarem", BRT},
264.1004 + {"America/Santiago", CLT},
264.1005 + {"America/Santo_Domingo", AST},
264.1006 + {"America/Sao_Paulo", BRT},
264.1007 + {"America/Scoresbysund", EGT},
264.1008 + {"America/Shiprock", MST},
264.1009 + {"America/St_Barthelemy", AST},
264.1010 + {"America/St_Kitts", AST},
264.1011 + {"America/St_Lucia", AST},
264.1012 + {"America/St_Thomas", AST},
264.1013 + {"America/St_Vincent", AST},
264.1014 + {"America/Swift_Current", CST},
264.1015 + {"America/Tegucigalpa", CST},
264.1016 + {"America/Thule", AST},
264.1017 + {"America/Thunder_Bay", EST},
264.1018 + {"America/Tijuana", PST},
264.1019 + {"America/Toronto", EST},
264.1020 + {"America/Tortola", AST},
264.1021 + {"America/Vancouver", PST},
264.1022 + {"America/Virgin", AST},
264.1023 + {"America/Whitehorse", PST},
264.1024 + {"America/Winnipeg", CST},
264.1025 + {"America/Yakutat", AKST},
264.1026 + {"America/Yellowknife", MST},
264.1027 + {"Antarctica/Casey", WST_AUS},
264.1028 + {"Antarctica/Davis", new String[] {"Fuso hor\u00e1rio de Davis", "DAVT",
264.1029 + "Fuso hor\u00e1rio de ver\u00e3o de Davis", "DAVST"}},
264.1030 + {"Antarctica/DumontDUrville", new String[] {"Fuso hor\u00e1rio de Dumont-d'Urville", "DDUT",
264.1031 + "Fuso hor\u00e1rio de ver\u00e3o de Dumont-d'Urville", "DDUST"}},
264.1032 + {"Antarctica/Macquarie", new String[] {"Macquarie Island Time", "MIST",
264.1033 + "Macquarie Island Summer Time", "MIST"}},
264.1034 + {"Antarctica/Mawson", new String[] {"Fuso hor\u00e1rio de Mawson", "MAWT",
264.1035 + "Fuso hor\u00e1rio de ver\u00e3o de Mawson", "MAWST"}},
264.1036 + {"Antarctica/McMurdo", NZST},
264.1037 + {"Antarctica/Palmer", CLT},
264.1038 + {"Antarctica/Rothera", new String[] {"Fuso hor\u00e1rio de Rothera", "ROTT",
264.1039 + "Fuso hor\u00e1rio de ver\u00e3o de Rothera", "ROTST"}},
264.1040 + {"Antarctica/South_Pole", NZST},
264.1041 + {"Antarctica/Syowa", new String[] {"Fuso hor\u00e1rio de Syowa", "SYOT",
264.1042 + "Fuso hor\u00e1rio de ver\u00e3o de Syowa", "SYOST"}},
264.1043 + {"Antarctica/Vostok", new String[] {"Fuso hor\u00e1rio de Vostok", "VOST",
264.1044 + "Fuso hor\u00e1rio de ver\u00e3o de Vostok", "VOSST"}},
264.1045 + {"Arctic/Longyearbyen", CET},
264.1046 + {"Asia/Aden", ARAST},
264.1047 + {"Asia/Almaty", new String[] {"Fuso hor\u00e1rio de Alma-Ata", "ALMT",
264.1048 + "Fuso hor\u00e1rio de ver\u00e3o de Alma-Ata", "ALMST"}},
264.1049 + {"Asia/Amman", EET},
264.1050 + {"Asia/Anadyr", new String[] {"Fuso hor\u00e1rio de Anadyr", "ANAT",
264.1051 + "Fuso hor\u00e1rio de ver\u00e3o de Anadyr", "ANAST"}},
264.1052 + {"Asia/Aqtau", new String[] {"Fuso hor\u00e1rio de Aqtau", "AQTT",
264.1053 + "Fuso hor\u00e1rio de ver\u00e3o de Aqtau", "AQTST"}},
264.1054 + {"Asia/Aqtobe", new String[] {"Fuso hor\u00e1rio de Aqtobe", "AQTT",
264.1055 + "Fuso hor\u00e1rio de ver\u00e3o de Aqtobe", "AQTST"}},
264.1056 + {"Asia/Ashgabat", TMT},
264.1057 + {"Asia/Ashkhabad", TMT},
264.1058 + {"Asia/Baghdad", ARAST},
264.1059 + {"Asia/Bahrain", ARAST},
264.1060 + {"Asia/Baku", new String[] {"Fuso hor\u00e1rio do Azerbaij\u00e3o", "AZT",
264.1061 + "Fuso hor\u00e1rio de ver\u00e3o do Azerbaij\u00e3o", "AZST"}},
264.1062 + {"Asia/Bangkok", ICT},
264.1063 + {"Asia/Beirut", EET},
264.1064 + {"Asia/Bishkek", new String[] {"Fuso hor\u00e1rio do Quirguist\u00e3o", "KGT",
264.1065 + "Fuso hor\u00e1rio de ver\u00e3o do Quirguist\u00e3o", "KGST"}},
264.1066 + {"Asia/Brunei", new String[] {"Fuso hor\u00e1rio de Brunei", "BNT",
264.1067 + "Fuso hor\u00e1rio de ver\u00e3o de Brunei", "BNST"}},
264.1068 + {"Asia/Calcutta", IST},
264.1069 + {"Asia/Choibalsan", new String[] {"Fuso hor\u00e1rio de Choibalsan", "CHOT",
264.1070 + "Fuso hor\u00e1rio de ver\u00e3o de Choibalsan", "CHOST"}},
264.1071 + {"Asia/Chongqing", CTT},
264.1072 + {"Asia/Chungking", CTT},
264.1073 + {"Asia/Colombo", IST},
264.1074 + {"Asia/Dacca", BDT},
264.1075 + {"Asia/Dhaka", BDT},
264.1076 + {"Asia/Dili", new String[] {"Fuso hor\u00e1rio do Timor-Leste", "TLT",
264.1077 + "Fuso hor\u00e1rio de ver\u00e3o do Timor-Leste", "TLST"}},
264.1078 + {"Asia/Damascus", EET},
264.1079 + {"Asia/Dubai", GST},
264.1080 + {"Asia/Dushanbe", new String[] {"Fuso hor\u00e1rio do Tadjiquist\u00e3o", "TJT",
264.1081 + "Fuso hor\u00e1rio de ver\u00e3o do Tadjiquist\u00e3o", "TJST"}},
264.1082 + {"Asia/Gaza", EET},
264.1083 + {"Asia/Harbin", CTT},
264.1084 + {"Asia/Ho_Chi_Minh", ICT},
264.1085 + {"Asia/Hong_Kong", HKT},
264.1086 + {"Asia/Hovd", new String[] {"Fuso hor\u00e1rio de Hovd", "HOVT",
264.1087 + "Fuso hor\u00e1rio de ver\u00e3o de Hovd", "HOVST"}},
264.1088 + {"Asia/Irkutsk", new String[] {"Fuso hor\u00e1rio de Irkutsk", "IRKT",
264.1089 + "Fuso hor\u00e1rio de ver\u00e3o de Irkutsk", "IRKST"}},
264.1090 + {"Asia/Istanbul", EET},
264.1091 + {"Asia/Jakarta", WIT},
264.1092 + {"Asia/Jayapura", new String[] {"Fuso hor\u00e1rio da Indon\u00e9sia Oriental", "EIT",
264.1093 + "Fuso hor\u00e1rio de ver\u00e3o da Indon\u00e9sia Oriental", "EIST"}},
264.1094 + {"Asia/Kabul", new String[] {"Fuso hor\u00e1rio do Afeganist\u00e3o", "AFT",
264.1095 + "Fuso hor\u00e1rio de ver\u00e3o do Afeganist\u00e3o", "AFST"}},
264.1096 + {"Asia/Kamchatka", new String[] {"Fuso hor\u00e1rio de Petropavlovsk-Kamchatski", "PETT",
264.1097 + "Fuso hor\u00e1rio de ver\u00e3o de Petropavlovsk-Kamchatski", "PETST"}},
264.1098 + {"Asia/Karachi", PKT},
264.1099 + {"Asia/Kashgar", CTT},
264.1100 + {"Asia/Kathmandu", NPT},
264.1101 + {"Asia/Katmandu", NPT},
264.1102 + {"Asia/Kolkata", IST},
264.1103 + {"Asia/Krasnoyarsk", new String[] {"Fuso hor\u00e1rio de Krasnoyarsk", "KRAT",
264.1104 + "Fuso hor\u00e1rio de ver\u00e3o de Krasnoyarsk", "KRAST"}},
264.1105 + {"Asia/Kuala_Lumpur", MYT},
264.1106 + {"Asia/Kuching", MYT},
264.1107 + {"Asia/Kuwait", ARAST},
264.1108 + {"Asia/Macao", CTT},
264.1109 + {"Asia/Macau", CTT},
264.1110 + {"Asia/Magadan", new String[] {"Fuso hor\u00e1rio de Magadan", "MAGT",
264.1111 + "Fuso hor\u00e1rio de ver\u00e3o de Magadan", "MAGST"}},
264.1112 + {"Asia/Makassar", CIT},
264.1113 + {"Asia/Manila", new String[] {"Fuso hor\u00e1rio das Filipinas", "PHT",
264.1114 + "Fuso hor\u00e1rio de ver\u00e3o das Filipinas", "PHST"}},
264.1115 + {"Asia/Muscat", GST},
264.1116 + {"Asia/Nicosia", EET},
264.1117 + {"Asia/Novokuznetsk", NOVT},
264.1118 + {"Asia/Novosibirsk", NOVT},
264.1119 + {"Asia/Oral", new String[] {"Fuso hor\u00e1rio de Uralsk", "ORAT",
264.1120 + "Fuso hor\u00e1rio de ver\u00e3o de Uralsk", "ORAST"}},
264.1121 + {"Asia/Omsk", new String[] {"Fuso hor\u00e1rio de Omsk", "OMST",
264.1122 + "Fuso hor\u00e1rio de ver\u00e3o de Omsk", "OMSST"}},
264.1123 + {"Asia/Phnom_Penh", ICT},
264.1124 + {"Asia/Pontianak", WIT},
264.1125 + {"Asia/Pyongyang", KST},
264.1126 + {"Asia/Qatar", ARAST},
264.1127 + {"Asia/Qyzylorda", new String[] {"Fuso hor\u00e1rio de Kizil-Orda", "QYZT",
264.1128 + "Fuso hor\u00e1rio de ver\u00e3o de Kizil-Orda", "QYZST"}},
264.1129 + {"Asia/Rangoon", new String[] {"Fuso hor\u00e1rio de Mianmar", "MMT",
264.1130 + "Fuso hor\u00e1rio de ver\u00e3o de Mianmar", "MMST"}},
264.1131 + {"Asia/Riyadh", ARAST},
264.1132 + {"Asia/Saigon", ICT},
264.1133 + {"Asia/Sakhalin", new String[] {"Fuso hor\u00e1rio de Sakhalina", "SAKT",
264.1134 + "Fuso hor\u00e1rio de ver\u00e3o de Sakhalina", "SAKST"}},
264.1135 + {"Asia/Samarkand", UZT},
264.1136 + {"Asia/Seoul", KST},
264.1137 + {"Asia/Singapore", SGT},
264.1138 + {"Asia/Taipei", CTT},
264.1139 + {"Asia/Tel_Aviv", ISRAEL},
264.1140 + {"Asia/Tashkent", UZT},
264.1141 + {"Asia/Tbilisi", new String[] {"Fuso hor\u00e1rio da Ge\u00f3rgia", "GET",
264.1142 + "Fuso hor\u00e1rio de ver\u00e3o da Ge\u00f3rgia", "GEST"}},
264.1143 + {"Asia/Tehran", IRT},
264.1144 + {"Asia/Thimbu", BTT},
264.1145 + {"Asia/Thimphu", BTT},
264.1146 + {"Asia/Ujung_Pandang", CIT},
264.1147 + {"Asia/Ulaanbaatar", ULAT},
264.1148 + {"Asia/Ulan_Bator", ULAT},
264.1149 + {"Asia/Urumqi", CTT},
264.1150 + {"Asia/Vientiane", ICT},
264.1151 + {"Asia/Vladivostok", new String[] {"Fuso hor\u00e1rio de Vladivostok", "VLAT",
264.1152 + "Fuso hor\u00e1rio de ver\u00e3o de Vladivostok", "VLAST"}},
264.1153 + {"Asia/Yakutsk", new String[] {"Fuso hor\u00e1rio de Yakutsk", "YAKT",
264.1154 + "Fuso hor\u00e1rio de ver\u00e3o de Yakutsk", "YAKST"}},
264.1155 + {"Asia/Yekaterinburg", new String[] {"Fuso hor\u00e1rio de Yekaterinburgo", "YEKT",
264.1156 + "Fuso hor\u00e1rio de ver\u00e3o de Yekaterinburgo", "YEKST"}},
264.1157 + {"Asia/Yerevan", ARMT},
264.1158 + {"Atlantic/Azores", new String[] {"Fuso hor\u00e1rio das A\u00e7ores", "AZOT",
264.1159 + "Fuso hor\u00e1rio de ver\u00e3o das A\u00e7ores", "AZOST"}},
264.1160 + {"Atlantic/Bermuda", AST},
264.1161 + {"Atlantic/Canary", WET},
264.1162 + {"Atlantic/Cape_Verde", new String[] {"Fuso hor\u00e1rio de Cabo Verde", "CVT",
264.1163 + "Fuso hor\u00e1rio de ver\u00e3o de Cabo Verde", "CVST"}},
264.1164 + {"Atlantic/Faeroe", WET},
264.1165 + {"Atlantic/Faroe", WET},
264.1166 + {"Atlantic/Jan_Mayen", CET},
264.1167 + {"Atlantic/Madeira", WET},
264.1168 + {"Atlantic/Reykjavik", GMT},
264.1169 + {"Atlantic/South_Georgia", new String[] {"Fuso hor\u00e1rio padr\u00e3o da Ge\u00f3rgia do Sul", "GST",
264.1170 + "Hor\u00e1rio de luz natural da Ge\u00f3rgia do Sul", "GDT"}},
264.1171 + {"Atlantic/St_Helena", GMT},
264.1172 + {"Atlantic/Stanley", new String[] {"Fuso hor\u00e1rio das Ilhas Falkland", "FKT",
264.1173 + "Fuso hor\u00e1rio de ver\u00e3o das Ilhas Falkland", "FKST"}},
264.1174 + {"Australia/ACT", EST_NSW},
264.1175 + {"Australia/Adelaide", ADELAIDE},
264.1176 + {"Australia/Brisbane", BRISBANE},
264.1177 + {"Australia/Broken_Hill", BROKEN_HILL},
264.1178 + {"Australia/Canberra", EST_NSW},
264.1179 + {"Australia/Currie", EST_NSW},
264.1180 + {"Australia/Darwin", DARWIN},
264.1181 + {"Australia/Eucla", new String[] {"Fuso hor\u00e1rio ocidental central (Austr\u00e1lia)", "CWST",
264.1182 + "Fuso hor\u00e1rio de ver\u00e3o ocidental central (Austr\u00e1lia)", "CWST"}},
264.1183 + {"Australia/Hobart", TASMANIA},
264.1184 + {"Australia/LHI", LORD_HOWE},
264.1185 + {"Australia/Lindeman", BRISBANE},
264.1186 + {"Australia/Lord_Howe", LORD_HOWE},
264.1187 + {"Australia/Melbourne", VICTORIA},
264.1188 + {"Australia/North", DARWIN},
264.1189 + {"Australia/NSW", EST_NSW},
264.1190 + {"Australia/Perth", WST_AUS},
264.1191 + {"Australia/Queensland", BRISBANE},
264.1192 + {"Australia/South", ADELAIDE},
264.1193 + {"Australia/Sydney", EST_NSW},
264.1194 + {"Australia/Tasmania", TASMANIA},
264.1195 + {"Australia/Victoria", VICTORIA},
264.1196 + {"Australia/West", WST_AUS},
264.1197 + {"Australia/Yancowinna", BROKEN_HILL},
264.1198 + {"BET", BRT},
264.1199 + {"BST", BDT},
264.1200 + {"Brazil/Acre", AMT},
264.1201 + {"Brazil/DeNoronha", NORONHA},
264.1202 + {"Brazil/East", BRT},
264.1203 + {"Brazil/West", AMT},
264.1204 + {"Canada/Atlantic", AST},
264.1205 + {"Canada/Central", CST},
264.1206 + {"Canada/East-Saskatchewan", CST},
264.1207 + {"Canada/Eastern", EST},
264.1208 + {"Canada/Mountain", MST},
264.1209 + {"Canada/Newfoundland", NST},
264.1210 + {"Canada/Pacific", PST},
264.1211 + {"Canada/Yukon", PST},
264.1212 + {"Canada/Saskatchewan", CST},
264.1213 + {"CAT", CAT},
264.1214 + {"CET", CET},
264.1215 + {"Chile/Continental", CLT},
264.1216 + {"Chile/EasterIsland", EASTER},
264.1217 + {"CST6CDT", CST},
264.1218 + {"Cuba", CUBA},
264.1219 + {"EAT", EAT},
264.1220 + {"EET", EET},
264.1221 + {"Egypt", EET},
264.1222 + {"Eire", DUBLIN},
264.1223 + {"EST5EDT", EST},
264.1224 + {"Etc/Greenwich", GMT},
264.1225 + {"Etc/UCT", UTC},
264.1226 + {"Etc/Universal", UTC},
264.1227 + {"Etc/UTC", UTC},
264.1228 + {"Etc/Zulu", UTC},
264.1229 + {"Europe/Amsterdam", CET},
264.1230 + {"Europe/Andorra", CET},
264.1231 + {"Europe/Athens", EET},
264.1232 + {"Europe/Belfast", GMTBST},
264.1233 + {"Europe/Belgrade", CET},
264.1234 + {"Europe/Berlin", CET},
264.1235 + {"Europe/Bratislava", CET},
264.1236 + {"Europe/Brussels", CET},
264.1237 + {"Europe/Budapest", CET},
264.1238 + {"Europe/Chisinau", EET},
264.1239 + {"Europe/Copenhagen", CET},
264.1240 + {"Europe/Dublin", DUBLIN},
264.1241 + {"Europe/Gibraltar", CET},
264.1242 {"Europe/Guernsey", GMTBST},
264.1243 - {"Europe/Helsinki", EET},
264.1244 + {"Europe/Helsinki", EET},
264.1245 {"Europe/Isle_of_Man", GMTBST},
264.1246 - {"Europe/Istanbul", EET},
264.1247 + {"Europe/Istanbul", EET},
264.1248 {"Europe/Jersey", GMTBST},
264.1249 - {"Europe/Kaliningrad", EET},
264.1250 - {"Europe/Kiev", EET},
264.1251 - {"Europe/Lisbon", WET},
264.1252 - {"Europe/Ljubljana", CET},
264.1253 - {"Europe/London", GMTBST},
264.1254 - {"Europe/Luxembourg", CET},
264.1255 - {"Europe/Madrid", CET},
264.1256 - {"Europe/Malta", CET},
264.1257 - {"Europe/Mariehamn", EET},
264.1258 - {"Europe/Minsk", EET},
264.1259 - {"Europe/Monaco", CET},
264.1260 - {"Europe/Moscow", MSK},
264.1261 - {"Europe/Nicosia", EET},
264.1262 - {"Europe/Oslo", CET},
264.1263 - {"Europe/Podgorica", CET},
264.1264 - {"Europe/Prague", CET},
264.1265 - {"Europe/Riga", EET},
264.1266 - {"Europe/Rome", CET},
264.1267 - {"Europe/Samara", new String[] {"Fuso hor\u00e1rio de Samara", "SAMT",
264.1268 - "Fuso hor\u00e1rio de ver\u00e3o de Samara", "SAMST"}},
264.1269 - {"Europe/San_Marino", CET},
264.1270 - {"Europe/Sarajevo", CET},
264.1271 - {"Europe/Simferopol", EET},
264.1272 - {"Europe/Skopje", CET},
264.1273 - {"Europe/Sofia", EET},
264.1274 - {"Europe/Stockholm", CET},
264.1275 - {"Europe/Tallinn", EET},
264.1276 - {"Europe/Tirane", CET},
264.1277 - {"Europe/Tiraspol", EET},
264.1278 - {"Europe/Uzhgorod", EET},
264.1279 - {"Europe/Vaduz", CET},
264.1280 - {"Europe/Vatican", CET},
264.1281 - {"Europe/Vienna", CET},
264.1282 - {"Europe/Vilnius", EET},
264.1283 + {"Europe/Kaliningrad", EET},
264.1284 + {"Europe/Kiev", EET},
264.1285 + {"Europe/Lisbon", WET},
264.1286 + {"Europe/Ljubljana", CET},
264.1287 + {"Europe/London", GMTBST},
264.1288 + {"Europe/Luxembourg", CET},
264.1289 + {"Europe/Madrid", CET},
264.1290 + {"Europe/Malta", CET},
264.1291 + {"Europe/Mariehamn", EET},
264.1292 + {"Europe/Minsk", EET},
264.1293 + {"Europe/Monaco", CET},
264.1294 + {"Europe/Moscow", MSK},
264.1295 + {"Europe/Nicosia", EET},
264.1296 + {"Europe/Oslo", CET},
264.1297 + {"Europe/Podgorica", CET},
264.1298 + {"Europe/Prague", CET},
264.1299 + {"Europe/Riga", EET},
264.1300 + {"Europe/Rome", CET},
264.1301 + {"Europe/Samara", new String[] {"Fuso hor\u00e1rio de Samara", "SAMT",
264.1302 + "Fuso hor\u00e1rio de ver\u00e3o de Samara", "SAMST"}},
264.1303 + {"Europe/San_Marino", CET},
264.1304 + {"Europe/Sarajevo", CET},
264.1305 + {"Europe/Simferopol", EET},
264.1306 + {"Europe/Skopje", CET},
264.1307 + {"Europe/Sofia", EET},
264.1308 + {"Europe/Stockholm", CET},
264.1309 + {"Europe/Tallinn", EET},
264.1310 + {"Europe/Tirane", CET},
264.1311 + {"Europe/Tiraspol", EET},
264.1312 + {"Europe/Uzhgorod", EET},
264.1313 + {"Europe/Vaduz", CET},
264.1314 + {"Europe/Vatican", CET},
264.1315 + {"Europe/Vienna", CET},
264.1316 + {"Europe/Vilnius", EET},
264.1317 {"Europe/Volgograd", new String[] {"Fuso hor\u00e1rio de Volgogrado", "VOLT",
264.1318 "Fuso hor\u00e1rio de ver\u00e3o de Volgogrado", "VOLST"}},
264.1319 - {"Europe/Warsaw", CET},
264.1320 - {"Europe/Zagreb", CET},
264.1321 - {"Europe/Zaporozhye", EET},
264.1322 - {"Europe/Zurich", CET},
264.1323 - {"GB", GMTBST},
264.1324 - {"GB-Eire", GMTBST},
264.1325 - {"Greenwich", GMT},
264.1326 - {"Hongkong", HKT},
264.1327 - {"Iceland", GMT},
264.1328 - {"Iran", IRT},
264.1329 - {"IST", IST},
264.1330 - {"Indian/Antananarivo", EAT},
264.1331 - {"Indian/Chagos", new String[] {"Fuso hor\u00e1rio dos territ\u00f3rios do Oceano \u00cdndico", "IOT",
264.1332 - "Fuso hor\u00e1rio de ver\u00e3o dos territ\u00f3rios do Oceano \u00cdndico", "IOST"}},
264.1333 - {"Indian/Christmas", new String[] {"Fuso hor\u00e1rio das Ilhas Christmas", "CXT",
264.1334 - "Fuso hor\u00e1rio de ver\u00e3o das Ilhas Christmas", "CXST"}},
264.1335 - {"Indian/Cocos", new String[] {"Fuso hor\u00e1rio das Ilhas Cocos", "CCT",
264.1336 - "Fuso hor\u00e1rio de ver\u00e3o das Ilhas Cocos", "CCST"}},
264.1337 - {"Indian/Comoro", EAT},
264.1338 - {"Indian/Kerguelen", new String[] {"Fuso hor\u00e1rio das Terras Austrais e Ant\u00e1rticas Francesas", "TFT",
264.1339 - "Fuso hor\u00e1rio de ver\u00e3o das Terras Austrais e Ant\u00e1rticas Francesas", "TFST"}},
264.1340 - {"Indian/Mahe", new String[] {"Fuso hor\u00e1rio das Seychelles", "SCT",
264.1341 - "Fuso hor\u00e1rio de ver\u00e3o das Seychelles", "SCST"}},
264.1342 - {"Indian/Maldives", new String[] {"Fuso hor\u00e1rio das Maldivas", "MVT",
264.1343 - "Fuso hor\u00e1rio de ver\u00e3o das Maldivas", "MVST"}},
264.1344 - {"Indian/Mauritius", new String[] {"Fuso hor\u00e1rio das Ilhas Maur\u00edcio", "MUT",
264.1345 - "Fuso hor\u00e1rio de ver\u00e3o das Ilhas Maur\u00edcio", "MUST"}},
264.1346 - {"Indian/Mayotte", EAT},
264.1347 - {"Indian/Reunion", new String[] {"Fuso hor\u00e1rio de Reuni\u00e3o", "RET",
264.1348 - "Fuso hor\u00e1rio de ver\u00e3o de Reuni\u00e3o", "REST"}},
264.1349 - {"Israel", ISRAEL},
264.1350 - {"Jamaica", EST},
264.1351 - {"Japan", JST},
264.1352 - {"Kwajalein", MHT},
264.1353 - {"Libya", EET},
264.1354 - {"MET", new String[] {"Fuso hor\u00e1rio da Europa M\u00e9dia", "MET",
264.1355 - "Fuso hor\u00e1rio de ver\u00e3o da Europa M\u00e9dia", "MEST"}},
264.1356 - {"Mexico/BajaNorte", PST},
264.1357 - {"Mexico/BajaSur", MST},
264.1358 - {"Mexico/General", CST},
264.1359 - {"MIT", WST_SAMOA},
264.1360 - {"MST7MDT", MST},
264.1361 - {"Navajo", MST},
264.1362 - {"NET", ARMT},
264.1363 - {"NST", NZST},
264.1364 - {"NZ", NZST},
264.1365 - {"NZ-CHAT", CHAST},
264.1366 - {"PLT", PKT},
264.1367 - {"Portugal", WET},
264.1368 - {"PRT", AST},
264.1369 - {"Pacific/Apia", WST_SAMOA},
264.1370 - {"Pacific/Auckland", NZST},
264.1371 - {"Pacific/Chatham", CHAST},
264.1372 - {"Pacific/Chuuk", TRUT},
264.1373 - {"Pacific/Easter", EASTER},
264.1374 - {"Pacific/Efate", new String[] {"Fuso hor\u00e1rio de Vanuatu", "VUT",
264.1375 - "Fuso hor\u00e1rio de ver\u00e3o de Vanuatu", "VUST"}},
264.1376 - {"Pacific/Enderbury", new String[] {"Fuso hor\u00e1rio das Ilhas F\u00e9nix", "PHOT",
264.1377 - "Fuso hor\u00e1rio de ver\u00e3o das Ilhas F\u00e9nix", "PHOST"}},
264.1378 - {"Pacific/Fakaofo", new String[] {"Fuso hor\u00e1rio de Tokelau", "TKT",
264.1379 - "Fuso hor\u00e1rio de ver\u00e3o de Tokelau", "TKST"}},
264.1380 - {"Pacific/Fiji", new String[] {"Fuso hor\u00e1rio de Fiji", "FJT",
264.1381 - "Fuso hor\u00e1rio de ver\u00e3o de Fiji", "FJST"}},
264.1382 - {"Pacific/Funafuti", new String[] {"Fuso hor\u00e1rio de Tuvalu", "TVT",
264.1383 - "Fuso hor\u00e1rio de ver\u00e3o de Tuvalu", "TVST"}},
264.1384 - {"Pacific/Galapagos", new String[] {"Fuso hor\u00e1rio das Ilhas Gal\u00e1pagos", "GALT",
264.1385 - "Fuso hor\u00e1rio de ver\u00e3o das Ilhas Gal\u00e1pagos", "GALST"}},
264.1386 - {"Pacific/Gambier", GAMBIER},
264.1387 - {"Pacific/Guadalcanal", SBT},
264.1388 - {"Pacific/Guam", ChST},
264.1389 - {"Pacific/Johnston", HST},
264.1390 - {"Pacific/Kiritimati", new String[] {"Fuso hor\u00e1rio das Esp\u00f3rades Equatoriais", "LINT",
264.1391 - "Fuso hor\u00e1rio de ver\u00e3o das Esp\u00f3rades Equatoriais", "LINST"}},
264.1392 - {"Pacific/Kosrae", new String[] {"Fuso hor\u00e1rio de Kosrae", "KOST",
264.1393 - "Fuso hor\u00e1rio de ver\u00e3o de Kosrae", "KOSST"}},
264.1394 - {"Pacific/Kwajalein", MHT},
264.1395 - {"Pacific/Majuro", MHT},
264.1396 - {"Pacific/Marquesas", new String[] {"Fuso hor\u00e1rio das Ilhas Marquesas", "MART",
264.1397 - "Fuso hor\u00e1rio de ver\u00e3o das Ilhas Marquesas", "MARST"}},
264.1398 - {"Pacific/Midway", SAMOA},
264.1399 - {"Pacific/Nauru", new String[] {"Fuso hor\u00e1rio de Nauru", "NRT",
264.1400 - "Fuso hor\u00e1rio de ver\u00e3o de Nauru", "NRST"}},
264.1401 - {"Pacific/Niue", new String[] {"Fuso hor\u00e1rio de Niue", "NUT",
264.1402 - "Fuso hor\u00e1rio de ver\u00e3o de Niue", "NUST"}},
264.1403 - {"Pacific/Norfolk", new String[] {"Fuso hor\u00e1rio da Ilha de Norfolk", "NFT",
264.1404 - "Fuso hor\u00e1rio de ver\u00e3o da Ilha de Norfolk", "NFST"}},
264.1405 - {"Pacific/Noumea", new String[] {"Fuso hor\u00e1rio da Nova Caled\u00f4nia", "NCT",
264.1406 - "Fuso hor\u00e1rio de ver\u00e3o da Nova Caled\u00f4nia", "NCST"}},
264.1407 - {"Pacific/Pago_Pago", SAMOA},
264.1408 - {"Pacific/Palau", new String[] {"Fuso hor\u00e1rio de Palau", "PWT",
264.1409 - "Fuso hor\u00e1rio de ver\u00e3o de Palau", "PWST"}},
264.1410 - {"Pacific/Pitcairn", PITCAIRN},
264.1411 - {"Pacific/Pohnpei", PONT},
264.1412 - {"Pacific/Ponape", PONT},
264.1413 - {"Pacific/Port_Moresby", new String[] {"Fuso hor\u00e1rio de Papua-Nova Guin\u00e9", "PGT",
264.1414 - "Fuso hor\u00e1rio de ver\u00e3o de Papua-Nova Guin\u00e9", "PGST"}},
264.1415 - {"Pacific/Rarotonga", new String[] {"Fuso hor\u00e1rio das Ilhas Cook", "CKT",
264.1416 - "Fuso hor\u00e1rio de ver\u00e3o das Ilhas Cook", "CKHST"}},
264.1417 - {"Pacific/Saipan", ChST},
264.1418 - {"Pacific/Samoa", SAMOA},
264.1419 - {"Pacific/Tahiti", new String[] {"Fuso hor\u00e1rio do Taiti", "TAHT",
264.1420 - "Fuso hor\u00e1rio de ver\u00e3o do Taiti", "TAHST"}},
264.1421 - {"Pacific/Tarawa", new String[] {"Fuso hor\u00e1rio das Ilhas Gilbert", "GILT",
264.1422 - "Fuso hor\u00e1rio de ver\u00e3o das Ilhas Gilbert", "GILST"}},
264.1423 - {"Pacific/Tongatapu", new String[] {"Fuso hor\u00e1rio de Tonga", "TOT",
264.1424 - "Fuso hor\u00e1rio de ver\u00e3o de Tonga", "TOST"}},
264.1425 - {"Pacific/Truk", TRUT},
264.1426 - {"Pacific/Wake", new String[] {"Fuso hor\u00e1rio de Wake", "WAKT",
264.1427 - "Fuso hor\u00e1rio de ver\u00e3o de Wake", "WAKST"}},
264.1428 - {"Pacific/Wallis", new String[] {"Fuso hor\u00e1rio de Wallis e Futuna", "WFT",
264.1429 - "Fuso hor\u00e1rio de ver\u00e3o de Wallis e Futuna", "WFST"}},
264.1430 - {"Pacific/Yap", TRUT},
264.1431 - {"Poland", CET},
264.1432 - {"PRC", CTT},
264.1433 - {"PST8PDT", PST},
264.1434 - {"ROK", KST},
264.1435 - {"Singapore", SGT},
264.1436 - {"SST", SBT},
264.1437 - {"SystemV/AST4", AST},
264.1438 - {"SystemV/AST4ADT", AST},
264.1439 - {"SystemV/CST6", CST},
264.1440 - {"SystemV/CST6CDT", CST},
264.1441 - {"SystemV/EST5", EST},
264.1442 - {"SystemV/EST5EDT", EST},
264.1443 - {"SystemV/HST10", HST},
264.1444 - {"SystemV/MST7", MST},
264.1445 - {"SystemV/MST7MDT", MST},
264.1446 - {"SystemV/PST8", PST},
264.1447 - {"SystemV/PST8PDT", PST},
264.1448 - {"SystemV/YST9", AKST},
264.1449 - {"SystemV/YST9YDT", AKST},
264.1450 - {"Turkey", EET},
264.1451 - {"UCT", UTC},
264.1452 - {"Universal", UTC},
264.1453 - {"US/Alaska", AKST},
264.1454 - {"US/Aleutian", HAST},
264.1455 - {"US/Arizona", MST},
264.1456 - {"US/Central", CST},
264.1457 - {"US/Eastern", EST},
264.1458 - {"US/Hawaii", HST},
264.1459 - {"US/Indiana-Starke", CST},
264.1460 - {"US/East-Indiana", EST},
264.1461 - {"US/Michigan", EST},
264.1462 - {"US/Mountain", MST},
264.1463 - {"US/Pacific", PST},
264.1464 - {"US/Pacific-New", PST},
264.1465 - {"US/Samoa", SAMOA},
264.1466 - {"UTC", UTC},
264.1467 - {"VST", ICT},
264.1468 - {"W-SU", MSK},
264.1469 - {"WET", WET},
264.1470 - {"Zulu", UTC},
264.1471 + {"Europe/Warsaw", CET},
264.1472 + {"Europe/Zagreb", CET},
264.1473 + {"Europe/Zaporozhye", EET},
264.1474 + {"Europe/Zurich", CET},
264.1475 + {"GB", GMTBST},
264.1476 + {"GB-Eire", GMTBST},
264.1477 + {"Greenwich", GMT},
264.1478 + {"Hongkong", HKT},
264.1479 + {"Iceland", GMT},
264.1480 + {"Iran", IRT},
264.1481 + {"IST", IST},
264.1482 + {"Indian/Antananarivo", EAT},
264.1483 + {"Indian/Chagos", new String[] {"Fuso hor\u00e1rio dos territ\u00f3rios do Oceano \u00cdndico", "IOT",
264.1484 + "Fuso hor\u00e1rio de ver\u00e3o dos territ\u00f3rios do Oceano \u00cdndico", "IOST"}},
264.1485 + {"Indian/Christmas", new String[] {"Fuso hor\u00e1rio das Ilhas Christmas", "CXT",
264.1486 + "Fuso hor\u00e1rio de ver\u00e3o das Ilhas Christmas", "CXST"}},
264.1487 + {"Indian/Cocos", new String[] {"Fuso hor\u00e1rio das Ilhas Cocos", "CCT",
264.1488 + "Fuso hor\u00e1rio de ver\u00e3o das Ilhas Cocos", "CCST"}},
264.1489 + {"Indian/Comoro", EAT},
264.1490 + {"Indian/Kerguelen", new String[] {"Fuso hor\u00e1rio das Terras Austrais e Ant\u00e1rticas Francesas", "TFT",
264.1491 + "Fuso hor\u00e1rio de ver\u00e3o das Terras Austrais e Ant\u00e1rticas Francesas", "TFST"}},
264.1492 + {"Indian/Mahe", new String[] {"Fuso hor\u00e1rio das Seychelles", "SCT",
264.1493 + "Fuso hor\u00e1rio de ver\u00e3o das Seychelles", "SCST"}},
264.1494 + {"Indian/Maldives", new String[] {"Fuso hor\u00e1rio das Maldivas", "MVT",
264.1495 + "Fuso hor\u00e1rio de ver\u00e3o das Maldivas", "MVST"}},
264.1496 + {"Indian/Mauritius", new String[] {"Fuso hor\u00e1rio das Ilhas Maur\u00edcio", "MUT",
264.1497 + "Fuso hor\u00e1rio de ver\u00e3o das Ilhas Maur\u00edcio", "MUST"}},
264.1498 + {"Indian/Mayotte", EAT},
264.1499 + {"Indian/Reunion", new String[] {"Fuso hor\u00e1rio de Reuni\u00e3o", "RET",
264.1500 + "Fuso hor\u00e1rio de ver\u00e3o de Reuni\u00e3o", "REST"}},
264.1501 + {"Israel", ISRAEL},
264.1502 + {"Jamaica", EST},
264.1503 + {"Japan", JST},
264.1504 + {"Kwajalein", MHT},
264.1505 + {"Libya", EET},
264.1506 + {"MET", new String[] {"Fuso hor\u00e1rio da Europa M\u00e9dia", "MET",
264.1507 + "Fuso hor\u00e1rio de ver\u00e3o da Europa M\u00e9dia", "MEST"}},
264.1508 + {"Mexico/BajaNorte", PST},
264.1509 + {"Mexico/BajaSur", MST},
264.1510 + {"Mexico/General", CST},
264.1511 + {"MIT", WST_SAMOA},
264.1512 + {"MST7MDT", MST},
264.1513 + {"Navajo", MST},
264.1514 + {"NET", ARMT},
264.1515 + {"NST", NZST},
264.1516 + {"NZ", NZST},
264.1517 + {"NZ-CHAT", CHAST},
264.1518 + {"PLT", PKT},
264.1519 + {"Portugal", WET},
264.1520 + {"PRT", AST},
264.1521 + {"Pacific/Apia", WST_SAMOA},
264.1522 + {"Pacific/Auckland", NZST},
264.1523 + {"Pacific/Chatham", CHAST},
264.1524 + {"Pacific/Chuuk", TRUT},
264.1525 + {"Pacific/Easter", EASTER},
264.1526 + {"Pacific/Efate", new String[] {"Fuso hor\u00e1rio de Vanuatu", "VUT",
264.1527 + "Fuso hor\u00e1rio de ver\u00e3o de Vanuatu", "VUST"}},
264.1528 + {"Pacific/Enderbury", new String[] {"Fuso hor\u00e1rio das Ilhas F\u00e9nix", "PHOT",
264.1529 + "Fuso hor\u00e1rio de ver\u00e3o das Ilhas F\u00e9nix", "PHOST"}},
264.1530 + {"Pacific/Fakaofo", new String[] {"Fuso hor\u00e1rio de Tokelau", "TKT",
264.1531 + "Fuso hor\u00e1rio de ver\u00e3o de Tokelau", "TKST"}},
264.1532 + {"Pacific/Fiji", new String[] {"Fuso hor\u00e1rio de Fiji", "FJT",
264.1533 + "Fuso hor\u00e1rio de ver\u00e3o de Fiji", "FJST"}},
264.1534 + {"Pacific/Funafuti", new String[] {"Fuso hor\u00e1rio de Tuvalu", "TVT",
264.1535 + "Fuso hor\u00e1rio de ver\u00e3o de Tuvalu", "TVST"}},
264.1536 + {"Pacific/Galapagos", new String[] {"Fuso hor\u00e1rio das Ilhas Gal\u00e1pagos", "GALT",
264.1537 + "Fuso hor\u00e1rio de ver\u00e3o das Ilhas Gal\u00e1pagos", "GALST"}},
264.1538 + {"Pacific/Gambier", GAMBIER},
264.1539 + {"Pacific/Guadalcanal", SBT},
264.1540 + {"Pacific/Guam", ChST},
264.1541 + {"Pacific/Johnston", HST},
264.1542 + {"Pacific/Kiritimati", new String[] {"Fuso hor\u00e1rio das Esp\u00f3rades Equatoriais", "LINT",
264.1543 + "Fuso hor\u00e1rio de ver\u00e3o das Esp\u00f3rades Equatoriais", "LINST"}},
264.1544 + {"Pacific/Kosrae", new String[] {"Fuso hor\u00e1rio de Kosrae", "KOST",
264.1545 + "Fuso hor\u00e1rio de ver\u00e3o de Kosrae", "KOSST"}},
264.1546 + {"Pacific/Kwajalein", MHT},
264.1547 + {"Pacific/Majuro", MHT},
264.1548 + {"Pacific/Marquesas", new String[] {"Fuso hor\u00e1rio das Ilhas Marquesas", "MART",
264.1549 + "Fuso hor\u00e1rio de ver\u00e3o das Ilhas Marquesas", "MARST"}},
264.1550 + {"Pacific/Midway", SAMOA},
264.1551 + {"Pacific/Nauru", new String[] {"Fuso hor\u00e1rio de Nauru", "NRT",
264.1552 + "Fuso hor\u00e1rio de ver\u00e3o de Nauru", "NRST"}},
264.1553 + {"Pacific/Niue", new String[] {"Fuso hor\u00e1rio de Niue", "NUT",
264.1554 + "Fuso hor\u00e1rio de ver\u00e3o de Niue", "NUST"}},
264.1555 + {"Pacific/Norfolk", new String[] {"Fuso hor\u00e1rio da Ilha de Norfolk", "NFT",
264.1556 + "Fuso hor\u00e1rio de ver\u00e3o da Ilha de Norfolk", "NFST"}},
264.1557 + {"Pacific/Noumea", new String[] {"Fuso hor\u00e1rio da Nova Caled\u00f4nia", "NCT",
264.1558 + "Fuso hor\u00e1rio de ver\u00e3o da Nova Caled\u00f4nia", "NCST"}},
264.1559 + {"Pacific/Pago_Pago", SAMOA},
264.1560 + {"Pacific/Palau", new String[] {"Fuso hor\u00e1rio de Palau", "PWT",
264.1561 + "Fuso hor\u00e1rio de ver\u00e3o de Palau", "PWST"}},
264.1562 + {"Pacific/Pitcairn", PITCAIRN},
264.1563 + {"Pacific/Pohnpei", PONT},
264.1564 + {"Pacific/Ponape", PONT},
264.1565 + {"Pacific/Port_Moresby", new String[] {"Fuso hor\u00e1rio de Papua-Nova Guin\u00e9", "PGT",
264.1566 + "Fuso hor\u00e1rio de ver\u00e3o de Papua-Nova Guin\u00e9", "PGST"}},
264.1567 + {"Pacific/Rarotonga", new String[] {"Fuso hor\u00e1rio das Ilhas Cook", "CKT",
264.1568 + "Fuso hor\u00e1rio de ver\u00e3o das Ilhas Cook", "CKHST"}},
264.1569 + {"Pacific/Saipan", ChST},
264.1570 + {"Pacific/Samoa", SAMOA},
264.1571 + {"Pacific/Tahiti", new String[] {"Fuso hor\u00e1rio do Taiti", "TAHT",
264.1572 + "Fuso hor\u00e1rio de ver\u00e3o do Taiti", "TAHST"}},
264.1573 + {"Pacific/Tarawa", new String[] {"Fuso hor\u00e1rio das Ilhas Gilbert", "GILT",
264.1574 + "Fuso hor\u00e1rio de ver\u00e3o das Ilhas Gilbert", "GILST"}},
264.1575 + {"Pacific/Tongatapu", new String[] {"Fuso hor\u00e1rio de Tonga", "TOT",
264.1576 + "Fuso hor\u00e1rio de ver\u00e3o de Tonga", "TOST"}},
264.1577 + {"Pacific/Truk", TRUT},
264.1578 + {"Pacific/Wake", new String[] {"Fuso hor\u00e1rio de Wake", "WAKT",
264.1579 + "Fuso hor\u00e1rio de ver\u00e3o de Wake", "WAKST"}},
264.1580 + {"Pacific/Wallis", new String[] {"Fuso hor\u00e1rio de Wallis e Futuna", "WFT",
264.1581 + "Fuso hor\u00e1rio de ver\u00e3o de Wallis e Futuna", "WFST"}},
264.1582 + {"Pacific/Yap", TRUT},
264.1583 + {"Poland", CET},
264.1584 + {"PRC", CTT},
264.1585 + {"PST8PDT", PST},
264.1586 + {"ROK", KST},
264.1587 + {"Singapore", SGT},
264.1588 + {"SST", SBT},
264.1589 + {"SystemV/AST4", AST},
264.1590 + {"SystemV/AST4ADT", AST},
264.1591 + {"SystemV/CST6", CST},
264.1592 + {"SystemV/CST6CDT", CST},
264.1593 + {"SystemV/EST5", EST},
264.1594 + {"SystemV/EST5EDT", EST},
264.1595 + {"SystemV/HST10", HST},
264.1596 + {"SystemV/MST7", MST},
264.1597 + {"SystemV/MST7MDT", MST},
264.1598 + {"SystemV/PST8", PST},
264.1599 + {"SystemV/PST8PDT", PST},
264.1600 + {"SystemV/YST9", AKST},
264.1601 + {"SystemV/YST9YDT", AKST},
264.1602 + {"Turkey", EET},
264.1603 + {"UCT", UTC},
264.1604 + {"Universal", UTC},
264.1605 + {"US/Alaska", AKST},
264.1606 + {"US/Aleutian", HAST},
264.1607 + {"US/Arizona", MST},
264.1608 + {"US/Central", CST},
264.1609 + {"US/Eastern", EST},
264.1610 + {"US/Hawaii", HST},
264.1611 + {"US/Indiana-Starke", CST},
264.1612 + {"US/East-Indiana", EST},
264.1613 + {"US/Michigan", EST},
264.1614 + {"US/Mountain", MST},
264.1615 + {"US/Pacific", PST},
264.1616 + {"US/Pacific-New", PST},
264.1617 + {"US/Samoa", SAMOA},
264.1618 + {"UTC", UTC},
264.1619 + {"VST", ICT},
264.1620 + {"W-SU", MSK},
264.1621 + {"WET", WET},
264.1622 + {"Zulu", UTC},
264.1623 };
264.1624 }
264.1625 }
264.1626 -
264.1627 -
265.1 --- a/src/share/native/sun/font/layout/Features.h Tue Apr 19 16:01:27 2011 -0700
265.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
265.3 @@ -1,69 +0,0 @@
265.4 -/*
265.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
265.6 - *
265.7 - * This code is free software; you can redistribute it and/or modify it
265.8 - * under the terms of the GNU General Public License version 2 only, as
265.9 - * published by the Free Software Foundation. Oracle designates this
265.10 - * particular file as subject to the "Classpath" exception as provided
265.11 - * by Oracle in the LICENSE file that accompanied this code.
265.12 - *
265.13 - * This code is distributed in the hope that it will be useful, but WITHOUT
265.14 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
265.15 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
265.16 - * version 2 for more details (a copy is included in the LICENSE file that
265.17 - * accompanied this code).
265.18 - *
265.19 - * You should have received a copy of the GNU General Public License version
265.20 - * 2 along with this work; if not, write to the Free Software Foundation,
265.21 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
265.22 - *
265.23 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
265.24 - * or visit www.oracle.com if you need additional information or have any
265.25 - * questions.
265.26 - *
265.27 - */
265.28 -
265.29 -/*
265.30 - *
265.31 - * (C) Copyright IBM Corp. 1998-2004 - All Rights Reserved
265.32 - *
265.33 - */
265.34 -
265.35 -#ifndef __FEATURES_H
265.36 -#define __FEATURES_H
265.37 -
265.38 -/**
265.39 - * \file
265.40 - * \internal
265.41 - */
265.42 -
265.43 -#include "LETypes.h"
265.44 -#include "OpenTypeTables.h"
265.45 -
265.46 -U_NAMESPACE_BEGIN
265.47 -
265.48 -struct FeatureRecord
265.49 -{
265.50 - ATag featureTag;
265.51 - Offset featureTableOffset;
265.52 -};
265.53 -
265.54 -struct FeatureTable
265.55 -{
265.56 - Offset featureParamsOffset;
265.57 - le_uint16 lookupCount;
265.58 - le_uint16 lookupListIndexArray[ANY_NUMBER];
265.59 -};
265.60 -
265.61 -struct FeatureListTable
265.62 -{
265.63 - le_uint16 featureCount;
265.64 - FeatureRecord featureRecordArray[ANY_NUMBER];
265.65 -
265.66 - const FeatureTable *getFeatureTable(le_uint16 featureIndex, LETag *featureTag) const;
265.67 -
265.68 - const FeatureTable *getFeatureTable(LETag featureTag) const;
265.69 -};
265.70 -
265.71 -U_NAMESPACE_END
265.72 -#endif
266.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
266.2 +++ b/src/share/sample/forkjoin/mergesort/MergeDemo.java Tue Apr 26 15:48:03 2011 -0700
266.3 @@ -0,0 +1,287 @@
266.4 +/*
266.5 + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
266.6 + *
266.7 + * Redistribution and use in source and binary forms, with or without
266.8 + * modification, are permitted provided that the following conditions
266.9 + * are met:
266.10 + *
266.11 + * - Redistributions of source code must retain the above copyright
266.12 + * notice, this list of conditions and the following disclaimer.
266.13 + *
266.14 + * - Redistributions in binary form must reproduce the above copyright
266.15 + * notice, this list of conditions and the following disclaimer in the
266.16 + * documentation and/or other materials provided with the distribution.
266.17 + *
266.18 + * - Neither the name of Oracle nor the names of its
266.19 + * contributors may be used to endorse or promote products derived
266.20 + * from this software without specific prior written permission.
266.21 + *
266.22 + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
266.23 + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
266.24 + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
266.25 + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
266.26 + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
266.27 + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
266.28 + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
266.29 + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
266.30 + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
266.31 + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
266.32 + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
266.33 + */
266.34 +
266.35 +import java.util.Arrays;
266.36 +import java.util.Random;
266.37 +
266.38 +import static java.lang.Integer.parseInt;
266.39 +
266.40 +/**
266.41 + * MergeExample is a class that runs a demo benchmark of the {@code ForkJoin} framework
266.42 + * by benchmarking a {@link MergeSort} algorithm that is implemented using
266.43 + * {@link java.util.concurrent.RecursiveAction}.
266.44 + * The {@code ForkJoin} framework is setup with different parallelism levels
266.45 + * and the sort is executed with arrays of different sizes to see the
266.46 + * trade offs by using multiple threads for different sizes of the array.
266.47 + */
266.48 +public class MergeDemo {
266.49 + // Use a fixed seed to always get the same random values back
266.50 + private final Random random = new Random(759123751834L);
266.51 + private static final int ITERATIONS = 10;
266.52 +
266.53 + /**
266.54 + * Represents the formula {@code f(n) = start + (step * n)} for n = 0 & n < iterations
266.55 + */
266.56 + private static class Range {
266.57 + private final int start;
266.58 + private final int step;
266.59 + private final int iterations;
266.60 +
266.61 + private Range(int start, int step, int iterations) {
266.62 + this.start = start;
266.63 + this.step = step;
266.64 + this.iterations = iterations;
266.65 + }
266.66 +
266.67 + /**
266.68 + * Parses start, step and iterations from args
266.69 + * @param args the string array containing the arguments
266.70 + * @param start which element to start the start argument from
266.71 + * @return the constructed range
266.72 + */
266.73 + public static Range parse(String[] args, int start) {
266.74 + if (args.length < start + 3) {
266.75 + throw new IllegalArgumentException("Too few elements in array");
266.76 + }
266.77 + return new Range(parseInt(args[start]), parseInt(args[start + 1]), parseInt(args[start + 2]));
266.78 + }
266.79 +
266.80 + public int get(int iteration) {
266.81 + return start + (step * iteration);
266.82 + }
266.83 +
266.84 + public int getIterations() {
266.85 + return iterations;
266.86 + }
266.87 +
266.88 + @Override
266.89 + public String toString() {
266.90 + StringBuilder builder = new StringBuilder();
266.91 + builder.append(start).append(" ").append(step).append(" ").append(iterations);
266.92 + return builder.toString();
266.93 + }
266.94 + }
266.95 +
266.96 + /**
266.97 + * Wraps the different parameters that is used when running the MergeExample.
266.98 + * {@code sizes} represents the different array sizes
266.99 + * {@code parallelism} represents the different parallelism levels
266.100 + */
266.101 + private static class Configuration {
266.102 + private final Range sizes;
266.103 + private final Range parallelism;
266.104 +
266.105 + private final static Configuration defaultConfig = new Configuration(new Range(20000, 20000, 10),
266.106 + new Range(2, 2, 10));
266.107 +
266.108 + private Configuration(Range sizes, Range parallelism) {
266.109 + this.sizes = sizes;
266.110 + this.parallelism = parallelism;
266.111 + }
266.112 +
266.113 + /**
266.114 + * Parses the arguments and attempts to create a configuration containing the
266.115 + * parameters for creating the array sizes and parallelism sizes
266.116 + * @param args the input arguments
266.117 + * @return the configuration
266.118 + */
266.119 + public static Configuration parse(String[] args) {
266.120 + if (args.length == 0) {
266.121 + return defaultConfig;
266.122 + } else {
266.123 + try {
266.124 + if (args.length == 6) {
266.125 + return new Configuration(Range.parse(args, 0), Range.parse(args, 3));
266.126 + }
266.127 + } catch (NumberFormatException e) {
266.128 + System.err.println("MergeExample: error: Argument was not a number.");
266.129 + }
266.130 + System.err.println("MergeExample <size start> <size step> <size steps> <parallel start> <parallel step>" +
266.131 + " <parallel steps>");
266.132 + System.err.println("example: MergeExample 20000 10000 3 1 1 4");
266.133 + System.err.println("example: will run with arrays of sizes 20000, 30000, 40000" +
266.134 + " and parallelism: 1, 2, 3, 4");
266.135 + return null;
266.136 + }
266.137 + }
266.138 +
266.139 + /**
266.140 + * Creates an array for reporting the test result time in
266.141 + * @return an array containing {@code sizes.iterations * parallelism.iterations} elements
266.142 + */
266.143 + private long[][] createTimesArray() {
266.144 + return new long[sizes.getIterations()][parallelism.getIterations()];
266.145 + }
266.146 +
266.147 + @Override
266.148 + public String toString() {
266.149 + StringBuilder builder = new StringBuilder("");
266.150 + if (this == defaultConfig) {
266.151 + builder.append("Default configuration. ");
266.152 + }
266.153 + builder.append("Running with parameters: ");
266.154 + builder.append(sizes);
266.155 + builder.append(" ");
266.156 + builder.append(parallelism);
266.157 + return builder.toString();
266.158 + }
266.159 + }
266.160 +
266.161 + /**
266.162 + * Generates an array of {@code elements} random elements
266.163 + * @param elements the number of elements requested in the array
266.164 + * @return an array of {@code elements} random elements
266.165 + */
266.166 + private int[] generateArray(int elements) {
266.167 + int[] array = new int[elements];
266.168 + for (int i = 0; i < elements; ++i) {
266.169 + array[i] = random.nextInt();
266.170 + }
266.171 + return array;
266.172 + }
266.173 +
266.174 + /**
266.175 + * Runs the test
266.176 + * @param config contains the settings for the test
266.177 + */
266.178 + private void run(Configuration config) {
266.179 + Range sizes = config.sizes;
266.180 + Range parallelism = config.parallelism;
266.181 +
266.182 + // Run a couple of sorts to make the JIT compile / optimize the code
266.183 + // which should produce somewhat more fair times
266.184 + warmup();
266.185 +
266.186 + long[][] times = config.createTimesArray();
266.187 +
266.188 + for (int size = 0; size < sizes.getIterations(); size++) {
266.189 + runForSize(parallelism, sizes.get(size), times, size);
266.190 + }
266.191 +
266.192 + printResults(sizes, parallelism, times);
266.193 + }
266.194 +
266.195 + /**
266.196 + * Prints the results as a table
266.197 + * @param sizes the different sizes of the arrays
266.198 + * @param parallelism the different parallelism levels used
266.199 + * @param times the median times for the different sizes / parallelism
266.200 + */
266.201 + private void printResults(Range sizes, Range parallelism, long[][] times) {
266.202 + System.out.println("Time in milliseconds. Y-axis: number of elements. X-axis parallelism used.");
266.203 + long[] sums = new long[times[0].length];
266.204 + System.out.format("%8s ", "");
266.205 + for (int i = 0; i < times[0].length; i++) {
266.206 + System.out.format("%4d ", parallelism.get(i));
266.207 + }
266.208 + System.out.println("");
266.209 + for (int size = 0; size < sizes.getIterations(); size++) {
266.210 + System.out.format("%8d: ", sizes.get(size));
266.211 + for (int i = 0; i < times[size].length; i++) {
266.212 + sums[i] += times[size][i];
266.213 + System.out.format("%4d ", times[size][i]);
266.214 + }
266.215 + System.out.println("");
266.216 + }
266.217 + System.out.format("%8s: ", "Total");
266.218 + for (long sum : sums) {
266.219 + System.out.format("%4d ", sum);
266.220 + }
266.221 + System.out.println("");
266.222 + }
266.223 +
266.224 + private void runForSize(Range parallelism, int elements, long[][] times, int size) {
266.225 + for (int step = 0; step < parallelism.getIterations(); step++) {
266.226 + long time = runForParallelism(ITERATIONS, elements, parallelism.get(step));
266.227 + times[size][step] = time;
266.228 + }
266.229 + }
266.230 +
266.231 + /**
266.232 + * Runs <i>iterations</i> number of test sorts of a random array of <i>element</i> length
266.233 + * @param iterations number of iterations
266.234 + * @param elements number of elements in the random array
266.235 + * @param parallelism parallelism for the ForkJoin framework
266.236 + * @return the median time of runs
266.237 + */
266.238 + private long runForParallelism(int iterations, int elements, int parallelism) {
266.239 + MergeSort mergeSort = new MergeSort(parallelism);
266.240 + long[] times = new long[iterations];
266.241 +
266.242 + for (int i = 0; i < iterations; i++) {
266.243 + // Suggest the VM to run a garbage collection to reduce the risk of getting one
266.244 + // while running the test run
266.245 + System.gc();
266.246 + long start = System.currentTimeMillis();
266.247 + mergeSort.sort(generateArray(elements));
266.248 + times[i] = System.currentTimeMillis() - start;
266.249 + }
266.250 +
266.251 + return medianValue(times);
266.252 + }
266.253 +
266.254 + /**
266.255 + * Calculates the median value of the array
266.256 + * @param times array of times
266.257 + * @return the median value
266.258 + */
266.259 + private long medianValue(long[] times) {
266.260 + if (times.length == 0) {
266.261 + throw new IllegalArgumentException("Empty array");
266.262 + }
266.263 + // Make a copy of times to avoid having side effects on the parameter value
266.264 + Arrays.sort(times.clone());
266.265 + long median = times[times.length / 2];
266.266 + if (times.length > 1 && times.length % 2 != 0) {
266.267 + median = (median + times[times.length / 2 + 1]) / 2;
266.268 + }
266.269 + return median;
266.270 + }
266.271 +
266.272 + /**
266.273 + * Generates 1000 arrays of 1000 elements and sorts them as a warmup
266.274 + */
266.275 + private void warmup() {
266.276 + MergeSort mergeSort = new MergeSort(Runtime.getRuntime().availableProcessors());
266.277 + for (int i = 0; i < 1000; i++) {
266.278 + mergeSort.sort(generateArray(1000));
266.279 + }
266.280 + }
266.281 +
266.282 + public static void main(String[] args) {
266.283 + Configuration configuration = Configuration.parse(args);
266.284 + if (configuration == null) {
266.285 + System.exit(1);
266.286 + }
266.287 + System.out.println(configuration);
266.288 + new MergeDemo().run(configuration);
266.289 + }
266.290 +}
267.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
267.2 +++ b/src/share/sample/forkjoin/mergesort/MergeSort.java Tue Apr 26 15:48:03 2011 -0700
267.3 @@ -0,0 +1,128 @@
267.4 +/*
267.5 + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
267.6 + *
267.7 + * Redistribution and use in source and binary forms, with or without
267.8 + * modification, are permitted provided that the following conditions
267.9 + * are met:
267.10 + *
267.11 + * - Redistributions of source code must retain the above copyright
267.12 + * notice, this list of conditions and the following disclaimer.
267.13 + *
267.14 + * - Redistributions in binary form must reproduce the above copyright
267.15 + * notice, this list of conditions and the following disclaimer in the
267.16 + * documentation and/or other materials provided with the distribution.
267.17 + *
267.18 + * - Neither the name of Oracle nor the names of its
267.19 + * contributors may be used to endorse or promote products derived
267.20 + * from this software without specific prior written permission.
267.21 + *
267.22 + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
267.23 + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
267.24 + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
267.25 + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
267.26 + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
267.27 + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
267.28 + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
267.29 + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
267.30 + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
267.31 + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
267.32 + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
267.33 + */
267.34 +
267.35 +import java.util.Arrays;
267.36 +import java.util.concurrent.ForkJoinPool;
267.37 +import java.util.concurrent.ForkJoinTask;
267.38 +import java.util.concurrent.RecursiveAction;
267.39 +
267.40 +/**
267.41 + * A class for sorting an array of {@code ints} in parallel.
267.42 + * A {@code ForkJoinPool} is used for the parallelism, using the merge sort
267.43 + * algorithm the array is split into halves and a new sub task is created
267.44 + * for each part. Each sub task is dispatched to the {@code ForkJoinPool}
267.45 + * which will schedule the task to a {@code Thread}.
267.46 + * This happens until the size of the array is at most 2
267.47 + * elements long. At this point the array is sorted using a simple compare
267.48 + * and possibly a swap. The tasks then finish by using insert sort to
267.49 + * merge the two just sorted arrays.
267.50 + *
267.51 + * The idea of this class is to demonstrate the usage of RecursiveAction not
267.52 + * to implement the best possible parallel merge sort. This version creates
267.53 + * a small array for each merge (creating a lot of objects), this could
267.54 + * be avoided by keeping a single array.
267.55 + */
267.56 +public class MergeSort {
267.57 + private final ForkJoinPool pool;
267.58 +
267.59 + private static class MergeSortTask extends RecursiveAction {
267.60 + private final int[] array;
267.61 + private final int low;
267.62 + private final int high;
267.63 + private static final int THRESHOLD = 8;
267.64 +
267.65 + /**
267.66 + * Creates a {@code MergeSortTask} containing the array and the bounds of the array
267.67 + *
267.68 + * @param array the array to sort
267.69 + * @param low the lower element to start sorting at
267.70 + * @param high the non-inclusive high element to sort to
267.71 + */
267.72 + protected MergeSortTask(int[] array, int low, int high) {
267.73 + this.array = array;
267.74 + this.low = low;
267.75 + this.high = high;
267.76 + }
267.77 +
267.78 + @Override
267.79 + protected void compute() {
267.80 + if (high - low <= THRESHOLD) {
267.81 + Arrays.sort(array, low, high);
267.82 + } else {
267.83 + int middle = low + ((high - low) >> 1);
267.84 + // Execute the sub tasks and wait for them to finish
267.85 + invokeAll(new MergeSortTask(array, low, middle), new MergeSortTask(array, middle, high));
267.86 + // Then merge the results
267.87 + merge(middle);
267.88 + }
267.89 + }
267.90 +
267.91 + /**
267.92 + * Merges the two sorted arrays this.low, middle - 1 and middle, this.high - 1
267.93 + * @param middle the index in the array where the second sorted list begins
267.94 + */
267.95 + private void merge(int middle) {
267.96 + if (array[middle - 1] < array[middle]) {
267.97 + return; // the arrays are already correctly sorted, so we can skip the merge
267.98 + }
267.99 + int[] copy = new int[high - low];
267.100 + System.arraycopy(array, low, copy, 0, copy.length);
267.101 + int copyLow = 0;
267.102 + int copyHigh = high - low;
267.103 + int copyMiddle = middle - low;
267.104 +
267.105 + for (int i = low, p = copyLow, q = copyMiddle; i < high; i++) {
267.106 + if (q >= copyHigh || (p < copyMiddle && copy[p] < copy[q]) ) {
267.107 + array[i] = copy[p++];
267.108 + } else {
267.109 + array[i] = copy[q++];
267.110 + }
267.111 + }
267.112 + }
267.113 + }
267.114 +
267.115 + /**
267.116 + * Creates a {@code MergeSort} containing a ForkJoinPool with the indicated parallelism level
267.117 + * @param parallelism the parallelism level used
267.118 + */
267.119 + public MergeSort(int parallelism) {
267.120 + pool = new ForkJoinPool(parallelism);
267.121 + }
267.122 +
267.123 + /**
267.124 + * Sorts all the elements of the given array using the ForkJoin framework
267.125 + * @param array the array to sort
267.126 + */
267.127 + public void sort(int[] array) {
267.128 + ForkJoinTask<Void> job = pool.submit(new MergeSortTask(array, 0, array.length));
267.129 + job.join();
267.130 + }
267.131 +}
268.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
268.2 +++ b/src/share/sample/nio/chatserver/ChatServer.java Tue Apr 26 15:48:03 2011 -0700
268.3 @@ -0,0 +1,179 @@
268.4 +/*
268.5 + * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved.
268.6 + *
268.7 + * Redistribution and use in source and binary forms, with or without
268.8 + * modification, are permitted provided that the following conditions
268.9 + * are met:
268.10 + *
268.11 + * - Redistributions of source code must retain the above copyright
268.12 + * notice, this list of conditions and the following disclaimer.
268.13 + *
268.14 + * - Redistributions in binary form must reproduce the above copyright
268.15 + * notice, this list of conditions and the following disclaimer in the
268.16 + * documentation and/or other materials provided with the distribution.
268.17 + *
268.18 + * - Neither the name of Oracle nor the names of its
268.19 + * contributors may be used to endorse or promote products derived
268.20 + * from this software without specific prior written permission.
268.21 + *
268.22 + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
268.23 + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
268.24 + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
268.25 + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
268.26 + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
268.27 + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
268.28 + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
268.29 + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
268.30 + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
268.31 + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
268.32 + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
268.33 + */
268.34 +
268.35 +import java.io.IOException;
268.36 +import java.net.InetSocketAddress;
268.37 +import java.net.SocketAddress;
268.38 +import java.net.StandardSocketOption;
268.39 +import java.nio.channels.*;
268.40 +import java.util.*;
268.41 +import java.util.concurrent.Executors;
268.42 +import java.util.concurrent.TimeUnit;
268.43 +
268.44 +/**
268.45 + * Implements a chat server, this class holds the list of {@code clients} connected to the server.
268.46 + * It sets up a server socket using AsynchronousServerSocketChannel listening to a specified port.
268.47 + */
268.48 +public class ChatServer implements Runnable {
268.49 + private final List<Client> connections = Collections.synchronizedList(new ArrayList<Client>());
268.50 + private int port;
268.51 + private final AsynchronousServerSocketChannel listener;
268.52 + private final AsynchronousChannelGroup channelGroup;
268.53 +
268.54 + /**
268.55 + *
268.56 + * @param port to listen to
268.57 + * @throws java.io.IOException when failing to start the server
268.58 + */
268.59 + public ChatServer(int port) throws IOException {
268.60 + channelGroup = AsynchronousChannelGroup.withFixedThreadPool(Runtime.getRuntime().availableProcessors(),
268.61 + Executors.defaultThreadFactory());
268.62 + this.port = port;
268.63 + listener = createListener(channelGroup);
268.64 + }
268.65 +
268.66 + /**
268.67 + *
268.68 + * @return The socket address that the server is bound to
268.69 + * @throws java.io.IOException if an I/O error occurs
268.70 + */
268.71 + public SocketAddress getSocketAddress() throws IOException {
268.72 + return listener.getLocalAddress();
268.73 + }
268.74 +
268.75 + /**
268.76 + * Start accepting connections
268.77 + */
268.78 + public void run() {
268.79 +
268.80 + // call accept to wait for connections, tell it to call our CompletionHandler when there
268.81 + // is a new incoming connection
268.82 + listener.accept(null, new CompletionHandler<AsynchronousSocketChannel, Void>() {
268.83 + @Override
268.84 + public void completed(AsynchronousSocketChannel result, Void attachment) {
268.85 + // request a new accept and handle the incoming connection
268.86 + listener.accept(null, this);
268.87 + handleNewConnection(result);
268.88 + }
268.89 +
268.90 + @Override
268.91 + public void failed(Throwable exc, Void attachment) {
268.92 + }
268.93 + });
268.94 + }
268.95 +
268.96 + /**
268.97 + * Shuts down the server
268.98 + * @throws InterruptedException if terminated while waiting for shutdown
268.99 + * @throws IOException if failing to shutdown the channel group
268.100 + */
268.101 + public void shutdown() throws InterruptedException, IOException {
268.102 + channelGroup.shutdownNow();
268.103 + channelGroup.awaitTermination(1, TimeUnit.SECONDS);
268.104 + }
268.105 +
268.106 + /*
268.107 + * Creates a listener and starts accepting connections
268.108 + */
268.109 + private AsynchronousServerSocketChannel createListener(AsynchronousChannelGroup channelGroup) throws IOException {
268.110 + final AsynchronousServerSocketChannel listener = openChannel(channelGroup);
268.111 + listener.setOption(StandardSocketOption.SO_REUSEADDR, true);
268.112 + listener.bind(new InetSocketAddress(port));
268.113 + return listener;
268.114 + }
268.115 +
268.116 + private AsynchronousServerSocketChannel openChannel(AsynchronousChannelGroup channelGroup) throws IOException {
268.117 + return AsynchronousServerSocketChannel.open(channelGroup);
268.118 + }
268.119 +
268.120 + /**
268.121 + * Creates a new client and adds it to the list of connections.
268.122 + * Sets the clients handler to the initial state of NameReader
268.123 + *
268.124 + * @param channel the newly accepted channel
268.125 + */
268.126 + private void handleNewConnection(AsynchronousSocketChannel channel) {
268.127 + Client client = new Client(channel, new ClientReader(this, new NameReader(this)));
268.128 + try {
268.129 + channel.setOption(StandardSocketOption.TCP_NODELAY, true);
268.130 + } catch (IOException e) {
268.131 + // ignore
268.132 + }
268.133 + connections.add(client);
268.134 + client.run();
268.135 + }
268.136 +
268.137 + /**
268.138 + * Sends a message to all clients except the source.
268.139 + * The method is synchronized as it is desired that messages are sent to
268.140 + * all clients in the same order as received.
268.141 + *
268.142 + * @param client the message source
268.143 + * @param message the message to be sent
268.144 + */
268.145 + public void writeMessageToClients(Client client, String message) {
268.146 + synchronized (connections) {
268.147 + for (Client clientConnection : connections) {
268.148 + if (clientConnection != client) {
268.149 + clientConnection.writeMessageFrom(client, message);
268.150 + }
268.151 + }
268.152 + }
268.153 + }
268.154 +
268.155 + public void removeClient(Client client) {
268.156 + connections.remove(client);
268.157 + }
268.158 +
268.159 + private static void usage() {
268.160 + System.err.println("ChatServer [-port <port number>]");
268.161 + System.exit(1);
268.162 + }
268.163 +
268.164 + public static void main(String[] args) throws IOException {
268.165 + int port = 5000;
268.166 + if (args.length != 0 && args.length != 2) {
268.167 + usage();
268.168 + } else if (args.length == 2) {
268.169 + try {
268.170 + if (args[0].equals("-port")) {
268.171 + port = Integer.parseInt(args[1]);
268.172 + } else {
268.173 + usage();
268.174 + }
268.175 + } catch (NumberFormatException e) {
268.176 + usage();
268.177 + }
268.178 + }
268.179 + System.out.println("Running on port " + port);
268.180 + new ChatServer(port).run();
268.181 + }
268.182 +}
269.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
269.2 +++ b/src/share/sample/nio/chatserver/Client.java Tue Apr 26 15:48:03 2011 -0700
269.3 @@ -0,0 +1,204 @@
269.4 +/*
269.5 + * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved.
269.6 + *
269.7 + * Redistribution and use in source and binary forms, with or without
269.8 + * modification, are permitted provided that the following conditions
269.9 + * are met:
269.10 + *
269.11 + * - Redistributions of source code must retain the above copyright
269.12 + * notice, this list of conditions and the following disclaimer.
269.13 + *
269.14 + * - Redistributions in binary form must reproduce the above copyright
269.15 + * notice, this list of conditions and the following disclaimer in the
269.16 + * documentation and/or other materials provided with the distribution.
269.17 + *
269.18 + * - Neither the name of Oracle nor the names of its
269.19 + * contributors may be used to endorse or promote products derived
269.20 + * from this software without specific prior written permission.
269.21 + *
269.22 + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
269.23 + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
269.24 + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
269.25 + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
269.26 + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
269.27 + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
269.28 + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
269.29 + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
269.30 + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
269.31 + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
269.32 + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
269.33 + */
269.34 +
269.35 +import java.io.IOException;
269.36 +import java.nio.ByteBuffer;
269.37 +import java.nio.channels.AsynchronousSocketChannel;
269.38 +import java.nio.channels.CompletionHandler;
269.39 +import java.util.LinkedList;
269.40 +import java.util.Queue;
269.41 +import java.util.concurrent.atomic.AtomicReference;
269.42 +
269.43 +/**
269.44 + * Client represents a remote connection to the chat server.
269.45 + * It contains methods for reading and writing messages from the
269.46 + * channel.
269.47 + * Messages are considered to be separated by newline, so incomplete
269.48 + * messages are buffered in the {@code Client}.
269.49 + *
269.50 + * All reads and writes are asynchronous and uses the nio2 asynchronous
269.51 + * elements.
269.52 + */
269.53 +class Client {
269.54 + private final AsynchronousSocketChannel channel;
269.55 + private AtomicReference<ClientReader> reader;
269.56 + private String userName;
269.57 + private final StringBuilder messageBuffer = new StringBuilder();
269.58 +
269.59 + private final Queue<ByteBuffer> queue = new LinkedList<ByteBuffer>();
269.60 + private boolean writing = false;
269.61 +
269.62 + public Client(AsynchronousSocketChannel channel, ClientReader reader) {
269.63 + this.channel = channel;
269.64 + this.reader = new AtomicReference<ClientReader>(reader);
269.65 + }
269.66 +
269.67 + /**
269.68 + * Enqueues a write of the buffer to the channel.
269.69 + * The call is asynchronous so the buffer is not safe to modify after
269.70 + * passing the buffer here.
269.71 + *
269.72 + * @param buffer the buffer to send to the channel
269.73 + */
269.74 + private void writeMessage(final ByteBuffer buffer) {
269.75 + boolean threadShouldWrite = false;
269.76 +
269.77 + synchronized(queue) {
269.78 + queue.add(buffer);
269.79 + // Currently no thread writing, make this thread dispatch a write
269.80 + if (!writing) {
269.81 + writing = true;
269.82 + threadShouldWrite = true;
269.83 + }
269.84 + }
269.85 +
269.86 + if (threadShouldWrite) {
269.87 + writeFromQueue();
269.88 + }
269.89 + }
269.90 +
269.91 + private void writeFromQueue() {
269.92 + ByteBuffer buffer;
269.93 +
269.94 + synchronized (queue) {
269.95 + buffer = queue.poll();
269.96 + if (buffer == null) {
269.97 + writing = false;
269.98 + }
269.99 + }
269.100 +
269.101 + // No new data in buffer to write
269.102 + if (writing) {
269.103 + writeBuffer(buffer);
269.104 + }
269.105 + }
269.106 +
269.107 + private void writeBuffer(ByteBuffer buffer) {
269.108 + channel.write(buffer, buffer, new CompletionHandler<Integer, ByteBuffer>() {
269.109 + @Override
269.110 + public void completed(Integer result, ByteBuffer buffer) {
269.111 + if (buffer.hasRemaining()) {
269.112 + channel.write(buffer, buffer, this);
269.113 + } else {
269.114 + // Go back and check if there is new data to write
269.115 + writeFromQueue();
269.116 + }
269.117 + }
269.118 +
269.119 + @Override
269.120 + public void failed(Throwable exc, ByteBuffer attachment) {
269.121 + }
269.122 + });
269.123 + }
269.124 +
269.125 + /**
269.126 + * Sends a message
269.127 + * @param string the message
269.128 + */
269.129 + public void writeStringMessage(String string) {
269.130 + writeMessage(ByteBuffer.wrap(string.getBytes()));
269.131 + }
269.132 +
269.133 + /**
269.134 + * Send a message from a specific client
269.135 + * @param client the message is sent from
269.136 + * @param message to send
269.137 + */
269.138 + public void writeMessageFrom(Client client, String message) {
269.139 + if (reader.get().acceptsMessages()) {
269.140 + writeStringMessage(client.getUserName() + ": " + message);
269.141 + }
269.142 + }
269.143 +
269.144 + /**
269.145 + * Enqueue a read
269.146 + * @param completionHandler callback on completed read
269.147 + */
269.148 + public void read(CompletionHandler<Integer, ? super ByteBuffer> completionHandler) {
269.149 + ByteBuffer input = ByteBuffer.allocate(256);
269.150 + if (!channel.isOpen()) {
269.151 + return;
269.152 + }
269.153 + channel.read(input, input, completionHandler);
269.154 + }
269.155 +
269.156 + /**
269.157 + * Closes the channel
269.158 + */
269.159 + public void close() {
269.160 + try {
269.161 + channel.close();
269.162 + } catch (IOException e) {
269.163 + e.printStackTrace();
269.164 + }
269.165 + }
269.166 +
269.167 + /**
269.168 + * Run the current states actions.
269.169 + */
269.170 + public void run() {
269.171 + reader.get().run(this);
269.172 + }
269.173 +
269.174 + public void setUserName(String userName) {
269.175 + this.userName = userName;
269.176 + }
269.177 +
269.178 + public void setReader(ClientReader reader) {
269.179 + this.reader.set(reader);
269.180 + }
269.181 +
269.182 + public String getUserName() {
269.183 + return userName;
269.184 + }
269.185 +
269.186 + public void appendMessage(String message) {
269.187 + synchronized (messageBuffer) {
269.188 + messageBuffer.append(message);
269.189 + }
269.190 + }
269.191 +
269.192 + /**
269.193 + * @return the next newline separated message in the buffer. null is returned if the buffer
269.194 + * doesn't contain any newline.
269.195 + */
269.196 + public String nextMessage() {
269.197 + synchronized(messageBuffer) {
269.198 + int nextNewline = messageBuffer.indexOf("\n");
269.199 + if (nextNewline == -1) {
269.200 + return null;
269.201 + }
269.202 + String message = messageBuffer.substring(0, nextNewline + 1);
269.203 + messageBuffer.delete(0, nextNewline + 1);
269.204 + return message;
269.205 + }
269.206 + }
269.207 +}
270.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
270.2 +++ b/src/share/sample/nio/chatserver/ClientReader.java Tue Apr 26 15:48:03 2011 -0700
270.3 @@ -0,0 +1,80 @@
270.4 +/*
270.5 + * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved.
270.6 + *
270.7 + * Redistribution and use in source and binary forms, with or without
270.8 + * modification, are permitted provided that the following conditions
270.9 + * are met:
270.10 + *
270.11 + * - Redistributions of source code must retain the above copyright
270.12 + * notice, this list of conditions and the following disclaimer.
270.13 + *
270.14 + * - Redistributions in binary form must reproduce the above copyright
270.15 + * notice, this list of conditions and the following disclaimer in the
270.16 + * documentation and/or other materials provided with the distribution.
270.17 + *
270.18 + * - Neither the name of Oracle nor the names of its
270.19 + * contributors may be used to endorse or promote products derived
270.20 + * from this software without specific prior written permission.
270.21 + *
270.22 + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
270.23 + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
270.24 + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
270.25 + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
270.26 + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
270.27 + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
270.28 + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
270.29 + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
270.30 + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
270.31 + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
270.32 + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
270.33 + */
270.34 +
270.35 +import java.nio.ByteBuffer;
270.36 +import java.nio.channels.CompletionHandler;
270.37 +
270.38 +/**
270.39 + * Handles a cycle of reading / writing on the {@code Client}.
270.40 + */
270.41 +class ClientReader {
270.42 + private final DataReader callback;
270.43 + private final ChatServer chatServer;
270.44 +
270.45 + ClientReader(ChatServer chatServer, DataReader callback) {
270.46 + this.chatServer = chatServer;
270.47 + this.callback = callback;
270.48 + }
270.49 +
270.50 + public boolean acceptsMessages() {
270.51 + return callback.acceptsMessages();
270.52 + }
270.53 +
270.54 + /**
270.55 + * Runs a cycle of doing a beforeRead action and then enqueing a new
270.56 + * read on the client. Handles closed channels and errors while reading.
270.57 + * If the client is still connected a new round of actions are called.
270.58 + */
270.59 + public void run(final Client client) {
270.60 + callback.beforeRead(client);
270.61 + client.read(new CompletionHandler<Integer, ByteBuffer>() {
270.62 + @Override
270.63 + public void completed(Integer result, ByteBuffer buffer) {
270.64 + // if result is negative or zero the connection has been closed or something gone wrong
270.65 + if (result < 1) {
270.66 + client.close();
270.67 + System.out.println("Closing connection to " + client);
270.68 + chatServer.removeClient(client);
270.69 + } else {
270.70 + callback.onData(client, buffer, result);
270.71 + // enqueue next round of actions
270.72 + client.run();
270.73 + }
270.74 + }
270.75 +
270.76 + @Override
270.77 + public void failed(Throwable exc, ByteBuffer buffer) {
270.78 + client.close();
270.79 + chatServer.removeClient(client);
270.80 + }
270.81 + });
270.82 + }
270.83 +}
271.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
271.2 +++ b/src/share/sample/nio/chatserver/DataReader.java Tue Apr 26 15:48:03 2011 -0700
271.3 @@ -0,0 +1,38 @@
271.4 +/*
271.5 + * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved.
271.6 + *
271.7 + * Redistribution and use in source and binary forms, with or without
271.8 + * modification, are permitted provided that the following conditions
271.9 + * are met:
271.10 + *
271.11 + * - Redistributions of source code must retain the above copyright
271.12 + * notice, this list of conditions and the following disclaimer.
271.13 + *
271.14 + * - Redistributions in binary form must reproduce the above copyright
271.15 + * notice, this list of conditions and the following disclaimer in the
271.16 + * documentation and/or other materials provided with the distribution.
271.17 + *
271.18 + * - Neither the name of Oracle nor the names of its
271.19 + * contributors may be used to endorse or promote products derived
271.20 + * from this software without specific prior written permission.
271.21 + *
271.22 + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
271.23 + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
271.24 + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
271.25 + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
271.26 + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
271.27 + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
271.28 + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
271.29 + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
271.30 + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
271.31 + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
271.32 + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
271.33 + */
271.34 +
271.35 +import java.nio.ByteBuffer;
271.36 +
271.37 +public interface DataReader {
271.38 + void beforeRead(Client client);
271.39 + void onData(Client client, ByteBuffer buffer, int bytes);
271.40 + boolean acceptsMessages();
271.41 +}
272.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
272.2 +++ b/src/share/sample/nio/chatserver/MessageReader.java Tue Apr 26 15:48:03 2011 -0700
272.3 @@ -0,0 +1,77 @@
272.4 +/*
272.5 + * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved.
272.6 + *
272.7 + * Redistribution and use in source and binary forms, with or without
272.8 + * modification, are permitted provided that the following conditions
272.9 + * are met:
272.10 + *
272.11 + * - Redistributions of source code must retain the above copyright
272.12 + * notice, this list of conditions and the following disclaimer.
272.13 + *
272.14 + * - Redistributions in binary form must reproduce the above copyright
272.15 + * notice, this list of conditions and the following disclaimer in the
272.16 + * documentation and/or other materials provided with the distribution.
272.17 + *
272.18 + * - Neither the name of Oracle nor the names of its
272.19 + * contributors may be used to endorse or promote products derived
272.20 + * from this software without specific prior written permission.
272.21 + *
272.22 + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
272.23 + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
272.24 + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
272.25 + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
272.26 + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
272.27 + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
272.28 + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
272.29 + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
272.30 + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
272.31 + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
272.32 + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
272.33 + */
272.34 +
272.35 +import java.nio.ByteBuffer;
272.36 +
272.37 +/**
272.38 + * Writes all messages in our buffer to the other clients
272.39 + * and appends new data read from the socket to our buffer
272.40 + */
272.41 +class MessageReader implements DataReader {
272.42 + private final ChatServer chatServer;
272.43 +
272.44 + public MessageReader(ChatServer chatServer) {
272.45 + this.chatServer = chatServer;
272.46 + }
272.47 +
272.48 + public boolean acceptsMessages() {
272.49 + return true;
272.50 + }
272.51 +
272.52 + /**
272.53 + * Write all full messages in our buffer to
272.54 + * the other clients
272.55 + *
272.56 + * @param client the client to read messages from
272.57 + */
272.58 + @Override
272.59 + public void beforeRead(Client client) {
272.60 + // Check if we have any messages buffered and send them
272.61 + String message = client.nextMessage();
272.62 + while (message != null) {
272.63 + chatServer.writeMessageToClients(client, message);
272.64 + message = client.nextMessage();
272.65 + }
272.66 + }
272.67 +
272.68 + /**
272.69 + * Append the read buffer to the clients message buffer
272.70 + * @param client the client to append messages to
272.71 + * @param buffer the buffer we received from the socket
272.72 + * @param bytes the number of bytes read into the buffer
272.73 + */
272.74 + @Override
272.75 + public void onData(Client client, ByteBuffer buffer, int bytes) {
272.76 + buffer.flip();
272.77 + // Just append the message on the buffer
272.78 + client.appendMessage(new String(buffer.array(), 0, bytes));
272.79 + }
272.80 +}
273.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
273.2 +++ b/src/share/sample/nio/chatserver/NameReader.java Tue Apr 26 15:48:03 2011 -0700
273.3 @@ -0,0 +1,111 @@
273.4 +/*
273.5 + * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved.
273.6 + *
273.7 + * Redistribution and use in source and binary forms, with or without
273.8 + * modification, are permitted provided that the following conditions
273.9 + * are met:
273.10 + *
273.11 + * - Redistributions of source code must retain the above copyright
273.12 + * notice, this list of conditions and the following disclaimer.
273.13 + *
273.14 + * - Redistributions in binary form must reproduce the above copyright
273.15 + * notice, this list of conditions and the following disclaimer in the
273.16 + * documentation and/or other materials provided with the distribution.
273.17 + *
273.18 + * - Neither the name of Oracle nor the names of its
273.19 + * contributors may be used to endorse or promote products derived
273.20 + * from this software without specific prior written permission.
273.21 + *
273.22 + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
273.23 + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
273.24 + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
273.25 + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
273.26 + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
273.27 + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
273.28 + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
273.29 + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
273.30 + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
273.31 + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
273.32 + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
273.33 + */
273.34 +
273.35 +import java.nio.ByteBuffer;
273.36 +
273.37 +/**
273.38 + * The first state a newly connected {@code Client} is in, this
273.39 + * handles writing out the welcoming message and reads the response
273.40 + * up to a newline. When a newline character have been received
273.41 + * it changes the handler from NameReader to MessageReader on the
273.42 + * client.
273.43 + */
273.44 +class NameReader implements DataReader {
273.45 + private final StringBuilder buffer = new StringBuilder();
273.46 + private final ChatServer chatServer;
273.47 + private boolean once = true;
273.48 + private static final String NEWLINE = "\n";
273.49 +
273.50 + public NameReader(ChatServer chatServer) {
273.51 + this.chatServer = chatServer;
273.52 + }
273.53 +
273.54 + /**
273.55 + * Writes the welcoming message to the client the first time this method
273.56 + * is called.
273.57 + *
273.58 + * @param client the client to receive the message
273.59 + */
273.60 + @Override
273.61 + public void beforeRead(Client client) {
273.62 + // if it is a long name that takes more than one read we only want to display Name: once.
273.63 + if (once) {
273.64 + client.writeStringMessage("Name: ");
273.65 + once = false;
273.66 + }
273.67 + }
273.68 +
273.69 + public boolean acceptsMessages() {
273.70 + return false;
273.71 + }
273.72 +
273.73 + /**
273.74 + * Receives incoming data from the socket, searches for a newline
273.75 + * and tries to set the username if one is found
273.76 + */
273.77 + @Override
273.78 + public void onData(Client client, ByteBuffer buffer, int bytes) {
273.79 + buffer.flip();
273.80 + String name;
273.81 + name = this.buffer.append(new String(buffer.array(), 0, bytes)).toString();
273.82 + if (name.contains(NEWLINE)) {
273.83 + onUserNameRead(client, name);
273.84 + }
273.85 + }
273.86 +
273.87 + /**
273.88 + * Splits the name on the newlines, takes the first as the username
273.89 + * and appends everything else to the clients message buffer.
273.90 + * Sets the clients handler to MessageReader.
273.91 + *
273.92 + * @param client the client to set the username for
273.93 + * @param name the string containing the buffered input
273.94 + */
273.95 + private void onUserNameRead(Client client, String name) {
273.96 + String[] strings = name.split(NEWLINE, 2);
273.97 + client.setUserName(strings[0].trim());
273.98 + sendRemainingParts(client, strings);
273.99 + client.setReader(new ClientReader(chatServer, new MessageReader(chatServer)));
273.100 + client.writeStringMessage("Welcome " + client.getUserName() + "\n");
273.101 + }
273.102 +
273.103 + /**
273.104 + * Appends the remaining parts to the clients message buffer
273.105 + *
273.106 + * @param client the client
273.107 + * @param strings the messages to append to the buffer
273.108 + */
273.109 + private void sendRemainingParts(Client client, String[] strings) {
273.110 + for (int i = 1; i < strings.length; ++i) {
273.111 + client.appendMessage(strings[i]);
273.112 + }
273.113 + }
273.114 +}
274.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
274.2 +++ b/src/share/sample/nio/chatserver/README.txt Tue Apr 26 15:48:03 2011 -0700
274.3 @@ -0,0 +1,62 @@
274.4 +A Simple Chat Server Example
274.5 +
274.6 +INTRODUCTION
274.7 +============
274.8 +This directory contains a very simple chat server, the server takes input from a
274.9 +socket ("user") and sends it to all other connected sockets ("users") along with
274.10 +the provided name the user was asked for when first connecting.
274.11 +
274.12 +The server was written to demonstrate the asynchronous I/O API in JDK 7.
274.13 +The sample assumes the reader has some familiarity with the subject matter.
274.14 +
274.15 +SETUP
274.16 +=====
274.17 +
274.18 +The server must be built with version 7 (or later) of the JDK.
274.19 +The server is built with:
274.20 +
274.21 + % mkdir build
274.22 + % javac -source 7 -target 7 -d build *.java
274.23 +
274.24 +EXECUTION
274.25 +=========
274.26 +
274.27 + % java -classpath build ChatServer [-port <port number>]
274.28 +
274.29 + Usage: ChatServer [options]
274.30 + options:
274.31 + -port port port number
274.32 + default: 5000
274.33 +
274.34 +CLIENT EXECUTION
274.35 +================
274.36 +
274.37 +No client binary is included in the sample.
274.38 +Connections can be made using for example the telnet command or any program
274.39 +that supports a raw TCP connection to a port.
274.40 +
274.41 +SOURCE CODE OVERVIEW
274.42 +====================
274.43 +ChatServer is the main class, it handles the startup and handles incoming
274.44 +connections on the listening sockets. It keeps a list of connected client
274.45 +and provides methods for sending a message to them.
274.46 +
274.47 +Client represents a connected user, it provides methods for reading/writing
274.48 +from/to the underlying socket. It also contains a buffer of input read from
274.49 +the user.
274.50 +
274.51 +DataReader provides the interface of the two states a user can
274.52 +be in. Waiting for a name (and not receiving any messages while doing so, implemented
274.53 +by NameReader) and waiting for messages from the user (implemented by MessageReader).
274.54 +
274.55 +ClientReader contains the "main loop" for a connected client.
274.56 +
274.57 +NameReader is the initial state for a new client, it sends the user a string and
274.58 +waits for a response before changing the state to MessageReader.
274.59 +
274.60 +MessageReader is the main state for a client, it checks for new messages to send to
274.61 +other clients and reads messages from the client.
274.62 +
274.63 +FINALLY
274.64 +=======
274.65 +This is a sample: it is not production quality and isn't optimized for performance.
275.1 --- a/src/solaris/bin/java_md.c Tue Apr 19 16:01:27 2011 -0700
275.2 +++ b/src/solaris/bin/java_md.c Tue Apr 26 15:48:03 2011 -0700
275.3 @@ -1,5 +1,5 @@
275.4 /*
275.5 - * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
275.6 + * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
275.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
275.8 *
275.9 * This code is free software; you can redistribute it and/or modify it
275.10 @@ -46,6 +46,10 @@
275.11 #define JVM_DLL "libjvm.so"
275.12 #define JAVA_DLL "libjava.so"
275.13
275.14 +/* help jettison the LD_LIBRARY_PATH settings in the future */
275.15 +#ifndef SETENV_REQUIRED
275.16 +#define SETENV_REQUIRED
275.17 +#endif
275.18 /*
275.19 * If a processor / os combination has the ability to run binaries of
275.20 * two data models and cohabitation of jre/jdk bits with both data
275.21 @@ -106,10 +110,22 @@
275.22 * Previously the launcher modified the LD_LIBRARY_PATH appropriately for the
275.23 * desired data model path, regardless if data models matched or not. The
275.24 * launcher subsequently exec'ed the desired executable, in order to make the
275.25 - * LD_LIBRARY_PATH path available for the runtime linker. This is no longer the
275.26 - * case, the launcher dlopens the target libjvm.so. All other required
275.27 - * libraries are loaded by the runtime linker, by virtue of the $ORIGIN paths
275.28 - * baked into the shared libraries, by the build infrastructure at compile time.
275.29 + * LD_LIBRARY_PATH path available, for the runtime linker.
275.30 + *
275.31 + * Now, in most cases,the launcher will dlopen the target libjvm.so. All
275.32 + * required libraries are loaded by the runtime linker, using the
275.33 + * $RPATH/$ORIGIN baked into the shared libraries at compile time. Therefore,
275.34 + * in most cases, the launcher will only exec, if the data models are
275.35 + * mismatched, and will not set any environment variables, regardless of the
275.36 + * data models.
275.37 + *
275.38 + * However, if the environment contains a LD_LIBRARY_PATH, this will cause the
275.39 + * launcher to inspect the LD_LIBRARY_PATH. The launcher will check
275.40 + * a. if the LD_LIBRARY_PATH's first component is the the path to the desired
275.41 + * libjvm.so
275.42 + * b. if any other libjvm.so is found in any of the paths.
275.43 + * If case b is true, then the launcher will set the LD_LIBRARY_PATH to the
275.44 + * desired JRE and reexec, in order to propagate the environment.
275.45 *
275.46 * Main
275.47 * (incoming argv)
275.48 @@ -137,11 +153,11 @@
275.49 * | |
275.50 * | |
275.51 * \|/ \|/
275.52 - * YES (find the desired executable and exec child)
275.53 + * YES Find the desired executable/library
275.54 * | |
275.55 * | |
275.56 * \|/ \|/
275.57 - * CheckJvmType Main
275.58 + * CheckJvmType RequiresSetenv
275.59 * (removes -client, -server, etc.)
275.60 * |
275.61 * |
275.62 @@ -156,7 +172,42 @@
275.63 * processes version options,
275.64 * creates argument list for vm,
275.65 * etc.)
275.66 - *
275.67 + * |
275.68 + * |
275.69 + * \|/
275.70 + * RequiresSetenv
275.71 + * Is LD_LIBRARY_PATH
275.72 + * and friends set ? --> NO --> Have Desired Model ? NO --> Re-exec --> Main
275.73 + * YES YES --> Continue
275.74 + * |
275.75 + * |
275.76 + * \|/
275.77 + * Path is desired JRE ? YES --> Have Desired Model ? NO --> Re-exec --> Main
275.78 + * NO YES --> Continue
275.79 + * |
275.80 + * |
275.81 + * \|/
275.82 + * Paths have well known
275.83 + * jvm paths ? --> NO --> Have Desired Model ? NO --> Re-exec --> Main
275.84 + * YES YES --> Continue
275.85 + * |
275.86 + * |
275.87 + * \|/
275.88 + * Does libjvm.so exit
275.89 + * in any of them ? --> NO --> Have Desired Model ? NO --> Re-exec --> Main
275.90 + * YES YES --> Continue
275.91 + * |
275.92 + * |
275.93 + * \|/
275.94 + * Set the LD_LIBRARY_PATH
275.95 + * |
275.96 + * |
275.97 + * \|/
275.98 + * Re-exec
275.99 + * |
275.100 + * |
275.101 + * \|/
275.102 + * Main
275.103 */
275.104
275.105 static const char * SetExecname(char **argv);
275.106 @@ -182,6 +233,130 @@
275.107 }
275.108 }
275.109
275.110 +#ifdef SETENV_REQUIRED
275.111 +static jboolean
275.112 +JvmExists(const char *path) {
275.113 + char tmp[PATH_MAX + 1];
275.114 + struct stat statbuf;
275.115 + JLI_Snprintf(tmp, PATH_MAX, "%s/%s", path, JVM_DLL);
275.116 + if (stat(tmp, &statbuf) == 0) {
275.117 + return JNI_TRUE;
275.118 + }
275.119 + return JNI_FALSE;
275.120 +}
275.121 +/*
275.122 + * contains a lib/$LIBARCH/{server,client}/libjvm.so ?
275.123 + */
275.124 +static jboolean
275.125 +ContainsLibJVM(int wanted, const char *env) {
275.126 + char clientPattern[PATH_MAX + 1];
275.127 + char serverPattern[PATH_MAX + 1];
275.128 + char *envpath;
275.129 + char *path;
275.130 + jboolean clientPatternFound;
275.131 + jboolean serverPatternFound;
275.132 +
275.133 + /* fastest path */
275.134 + if (env == NULL) {
275.135 + return JNI_FALSE;
275.136 + }
275.137 +
275.138 + /* the usual suspects */
275.139 + JLI_Snprintf(clientPattern, PATH_MAX, "lib/%s/client", GetArchPath(wanted));
275.140 + JLI_Snprintf(serverPattern, PATH_MAX, "lib/%s/server", GetArchPath(wanted));
275.141 +
275.142 + /* to optimize for time, test if any of our usual suspects are present. */
275.143 + clientPatternFound = JLI_StrStr(env, clientPattern) != NULL;
275.144 + serverPatternFound = JLI_StrStr(env, serverPattern) != NULL;
275.145 + if (clientPatternFound == JNI_FALSE && serverPatternFound == JNI_FALSE) {
275.146 + return JNI_FALSE;
275.147 + }
275.148 +
275.149 + /*
275.150 + * we have a suspicious path component, check if it contains a libjvm.so
275.151 + */
275.152 + envpath = JLI_StringDup(env);
275.153 + for (path = JLI_StrTok(envpath, ":"); path != NULL; path = JLI_StrTok(NULL, ":")) {
275.154 + if (clientPatternFound && JLI_StrStr(path, clientPattern) != NULL) {
275.155 + if (JvmExists(path)) {
275.156 + JLI_MemFree(envpath);
275.157 + return JNI_TRUE;
275.158 + }
275.159 + }
275.160 + if (serverPatternFound && JLI_StrStr(path, serverPattern) != NULL) {
275.161 + if (JvmExists(path)) {
275.162 + JLI_MemFree(envpath);
275.163 + return JNI_TRUE;
275.164 + }
275.165 + }
275.166 + }
275.167 + JLI_MemFree(envpath);
275.168 + return JNI_FALSE;
275.169 +}
275.170 +
275.171 +/*
275.172 + * Test whether the environment variable needs to be set, see flowchart.
275.173 + */
275.174 +static jboolean
275.175 +RequiresSetenv(int wanted, const char *jvmpath) {
275.176 + char jpath[PATH_MAX + 1];
275.177 + char *llp;
275.178 + char *dmllp = NULL;
275.179 + char *p; /* a utility pointer */
275.180 +
275.181 + llp = getenv("LD_LIBRARY_PATH");
275.182 +#ifdef __solaris__
275.183 + dmllp = (CURRENT_DATA_MODEL == 32)
275.184 + ? getenv("LD_LIBRARY_PATH_32")
275.185 + : getenv("LD_LIBRARY_PATH_64");
275.186 +#endif /* __solaris__ */
275.187 + /* no environment variable is a good environment variable */
275.188 + if (llp == NULL && dmllp == NULL) {
275.189 + return JNI_FALSE;
275.190 + }
275.191 +#ifdef __linux
275.192 + /*
275.193 + * On linux, if a binary is running as sgid or suid, glibc sets
275.194 + * LD_LIBRARY_PATH to the empty string for security purposes. (In contrast,
275.195 + * on Solaris the LD_LIBRARY_PATH variable for a privileged binary does not
275.196 + * lose its settings; but the dynamic linker does apply more scrutiny to the
275.197 + * path.) The launcher uses the value of LD_LIBRARY_PATH to prevent an exec
275.198 + * loop, here and further downstream. Therefore, if we are running sgid or
275.199 + * suid, this function's setting of LD_LIBRARY_PATH will be ineffective and
275.200 + * we should case a return from the calling function. Getting the right
275.201 + * libraries will be handled by the RPATH. In reality, this check is
275.202 + * redundant, as the previous check for a non-null LD_LIBRARY_PATH will
275.203 + * return back to the calling function forthwith, it is left here to safe
275.204 + * guard against any changes, in the glibc's existing security policy.
275.205 + */
275.206 + if ((getgid() != getegid()) || (getuid() != geteuid())) {
275.207 + return JNI_FALSE;
275.208 + }
275.209 +#endif /* __linux */
275.210 +
275.211 + /*
275.212 + * Prevent recursions. Since LD_LIBRARY_PATH is the one which will be set by
275.213 + * previous versions of the JRE, thus it is the only path that matters here.
275.214 + * So we check to see if the desired JRE is set.
275.215 + */
275.216 + JLI_StrNCpy(jpath, jvmpath, PATH_MAX);
275.217 + p = JLI_StrRChr(jpath, '/');
275.218 + *p = '\0';
275.219 + if (llp != NULL && JLI_StrNCmp(llp, jpath, JLI_StrLen(jpath)) == 0) {
275.220 + return JNI_FALSE;
275.221 + }
275.222 +
275.223 + /* scrutinize all the paths further */
275.224 + if (llp != NULL && ContainsLibJVM(wanted, llp)) {
275.225 + return JNI_TRUE;
275.226 + }
275.227 + if (dmllp != NULL && ContainsLibJVM(wanted, dmllp)) {
275.228 + return JNI_TRUE;
275.229 + }
275.230 + return JNI_FALSE;
275.231 +}
275.232 +#endif /* SETENV_REQUIRED */
275.233 +
275.234 void
275.235 CreateExecutionEnvironment(int *pargc, char ***pargv,
275.236 char jrepath[], jint so_jrepath,
275.237 @@ -195,7 +370,6 @@
275.238 * informative to issue an error message based on whether or not the
275.239 * os/processor combination has dual mode capabilities.
275.240 */
275.241 -
275.242 jboolean jvmpathExists;
275.243
275.244 /* Compute/set the name of the executable */
275.245 @@ -207,13 +381,24 @@
275.246 char * jvmtype = NULL;
275.247 int argc = *pargc;
275.248 char **argv = *pargv;
275.249 -
275.250 int running = CURRENT_DATA_MODEL;
275.251
275.252 int wanted = running; /* What data mode is being
275.253 asked for? Current model is
275.254 fine unless another model
275.255 is asked for */
275.256 +#ifdef SETENV_REQUIRED
275.257 + jboolean mustsetenv = JNI_FALSE;
275.258 + char *runpath = NULL; /* existing effective LD_LIBRARY_PATH setting */
275.259 + char* new_runpath = NULL; /* desired new LD_LIBRARY_PATH string */
275.260 + char* newpath = NULL; /* path on new LD_LIBRARY_PATH */
275.261 + char* lastslash = NULL;
275.262 + char** newenvp = NULL; /* current environment */
275.263 +#ifdef __solaris__
275.264 + char* dmpath = NULL; /* data model specific LD_LIBRARY_PATH,
275.265 + Solaris only */
275.266 +#endif /* __solaris__ */
275.267 +#endif /* SETENV_REQUIRED */
275.268
275.269 char** newargv = NULL;
275.270 int newargc = 0;
275.271 @@ -300,9 +485,18 @@
275.272 }
275.273 /*
275.274 * we seem to have everything we need, so without further ado
275.275 - * we return back.
275.276 + * we return back, otherwise proceed to set the environment.
275.277 */
275.278 +#ifdef SETENV_REQUIRED
275.279 + mustsetenv = RequiresSetenv(wanted, jvmpath);
275.280 + JLI_TraceLauncher("mustsetenv: %s\n", mustsetenv ? "TRUE" : "FALSE");
275.281 +
275.282 + if (mustsetenv == JNI_FALSE) {
275.283 + return;
275.284 + }
275.285 +#else
275.286 return;
275.287 +#endif /* SETENV_REQUIRED */
275.288 } else { /* do the same speculatively or exit */
275.289 #ifdef DUAL_MODE
275.290 if (running != wanted) {
275.291 @@ -331,67 +525,240 @@
275.292
275.293 /* exec child can do error checking on the existence of the path */
275.294 jvmpathExists = GetJVMPath(jrepath, jvmtype, jvmpath, so_jvmpath, GetArchPath(wanted));
275.295 -
275.296 +#ifdef SETENV_REQUIRED
275.297 + mustsetenv = RequiresSetenv(wanted, jvmpath);
275.298 +#endif /* SETENV_REQUIRED */
275.299 }
275.300 #else
275.301 JLI_ReportErrorMessage(JRE_ERROR2, wanted);
275.302 exit(1);
275.303 #endif
275.304 - }
275.305 + }
275.306 +#ifdef SETENV_REQUIRED
275.307 + if (mustsetenv) {
275.308 + /*
275.309 + * We will set the LD_LIBRARY_PATH as follows:
275.310 + *
275.311 + * o $JVMPATH (directory portion only)
275.312 + * o $JRE/lib/$LIBARCHNAME
275.313 + * o $JRE/../lib/$LIBARCHNAME
275.314 + *
275.315 + * followed by the user's previous effective LD_LIBRARY_PATH, if
275.316 + * any.
275.317 + */
275.318
275.319 - {
275.320 - char *newexec = execname;
275.321 +#ifdef __solaris__
275.322 + /*
275.323 + * Starting in Solaris 7, ld.so.1 supports three LD_LIBRARY_PATH
275.324 + * variables:
275.325 + *
275.326 + * 1. LD_LIBRARY_PATH -- used for 32 and 64 bit searches if
275.327 + * data-model specific variables are not set.
275.328 + *
275.329 + * 2. LD_LIBRARY_PATH_64 -- overrides and replaces LD_LIBRARY_PATH
275.330 + * for 64-bit binaries.
275.331 + *
275.332 + * 3. LD_LIBRARY_PATH_32 -- overrides and replaces LD_LIBRARY_PATH
275.333 + * for 32-bit binaries.
275.334 + *
275.335 + * The vm uses LD_LIBRARY_PATH to set the java.library.path system
275.336 + * property. To shield the vm from the complication of multiple
275.337 + * LD_LIBRARY_PATH variables, if the appropriate data model
275.338 + * specific variable is set, we will act as if LD_LIBRARY_PATH had
275.339 + * the value of the data model specific variant and the data model
275.340 + * specific variant will be unset. Note that the variable for the
275.341 + * *wanted* data model must be used (if it is set), not simply the
275.342 + * current running data model.
275.343 + */
275.344 +
275.345 + switch (wanted) {
275.346 + case 0:
275.347 + if (running == 32) {
275.348 + dmpath = getenv("LD_LIBRARY_PATH_32");
275.349 + wanted = 32;
275.350 + } else {
275.351 + dmpath = getenv("LD_LIBRARY_PATH_64");
275.352 + wanted = 64;
275.353 + }
275.354 + break;
275.355 +
275.356 + case 32:
275.357 + dmpath = getenv("LD_LIBRARY_PATH_32");
275.358 + break;
275.359 +
275.360 + case 64:
275.361 + dmpath = getenv("LD_LIBRARY_PATH_64");
275.362 + break;
275.363 +
275.364 + default:
275.365 + JLI_ReportErrorMessage(JRE_ERROR3, __LINE__);
275.366 + exit(1); /* unknown value in wanted */
275.367 + break;
275.368 + }
275.369 +
275.370 + /*
275.371 + * If dmpath is NULL, the relevant data model specific variable is
275.372 + * not set and normal LD_LIBRARY_PATH should be used.
275.373 + */
275.374 + if (dmpath == NULL) {
275.375 + runpath = getenv("LD_LIBRARY_PATH");
275.376 + } else {
275.377 + runpath = dmpath;
275.378 + }
275.379 +#else
275.380 + /*
275.381 + * If not on Solaris, assume only a single LD_LIBRARY_PATH
275.382 + * variable.
275.383 + */
275.384 + runpath = getenv("LD_LIBRARY_PATH");
275.385 +#endif /* __solaris__ */
275.386 +
275.387 + /* runpath contains current effective LD_LIBRARY_PATH setting */
275.388 +
275.389 + jvmpath = JLI_StringDup(jvmpath);
275.390 + new_runpath = JLI_MemAlloc(((runpath != NULL) ? JLI_StrLen(runpath) : 0) +
275.391 + 2 * JLI_StrLen(jrepath) + 2 * JLI_StrLen(arch) +
275.392 + JLI_StrLen(jvmpath) + 52);
275.393 + newpath = new_runpath + JLI_StrLen("LD_LIBRARY_PATH=");
275.394 +
275.395 +
275.396 + /*
275.397 + * Create desired LD_LIBRARY_PATH value for target data model.
275.398 + */
275.399 + {
275.400 + /* remove the name of the .so from the JVM path */
275.401 + lastslash = JLI_StrRChr(jvmpath, '/');
275.402 + if (lastslash)
275.403 + *lastslash = '\0';
275.404 +
275.405 + sprintf(new_runpath, "LD_LIBRARY_PATH="
275.406 + "%s:"
275.407 + "%s/lib/%s:"
275.408 + "%s/../lib/%s",
275.409 + jvmpath,
275.410 #ifdef DUAL_MODE
275.411 - /*
275.412 - * If the data model is being changed, the path to the
275.413 - * executable must be updated accordingly; the executable name
275.414 - * and directory the executable resides in are separate. In the
275.415 - * case of 32 => 64, the new bits are assumed to reside in, e.g.
275.416 - * "olddir/LIBARCH64NAME/execname"; in the case of 64 => 32,
275.417 - * the bits are assumed to be in "olddir/../execname". For example,
275.418 - *
275.419 - * olddir/sparcv9/execname
275.420 - * olddir/amd64/execname
275.421 - *
275.422 - * for Solaris SPARC and Linux amd64, respectively.
275.423 - */
275.424 + jrepath, GetArchPath(wanted),
275.425 + jrepath, GetArchPath(wanted)
275.426 +#else
275.427 + jrepath, arch,
275.428 + jrepath, arch
275.429 +#endif
275.430 + );
275.431
275.432 - if (running != wanted) {
275.433 - char *oldexec = JLI_StrCpy(JLI_MemAlloc(JLI_StrLen(execname) + 1), execname);
275.434 - char *olddir = oldexec;
275.435 - char *oldbase = JLI_StrRChr(oldexec, '/');
275.436
275.437 + /*
275.438 + * Check to make sure that the prefix of the current path is the
275.439 + * desired environment variable setting, though the RequiresSetenv
275.440 + * checks if the desired runpath exists, this logic does a more
275.441 + * comprehensive check.
275.442 + */
275.443 + if (runpath != NULL &&
275.444 + JLI_StrNCmp(newpath, runpath, JLI_StrLen(newpath)) == 0 &&
275.445 + (runpath[JLI_StrLen(newpath)] == 0 || runpath[JLI_StrLen(newpath)] == ':') &&
275.446 + (running == wanted) /* data model does not have to be changed */
275.447 +#ifdef __solaris__
275.448 + && (dmpath == NULL) /* data model specific variables not set */
275.449 +#endif
275.450 + ) {
275.451
275.452 - newexec = JLI_MemAlloc(JLI_StrLen(execname) + 20);
275.453 - *oldbase++ = 0;
275.454 - sprintf(newexec, "%s/%s/%s", olddir,
275.455 - ((wanted==64) ? LIBARCH64NAME : ".."), oldbase);
275.456 - argv[0] = newexec;
275.457 + return;
275.458 +
275.459 + }
275.460 + }
275.461 +
275.462 + /*
275.463 + * Place the desired environment setting onto the prefix of
275.464 + * LD_LIBRARY_PATH. Note that this prevents any possible infinite
275.465 + * loop of execv() because we test for the prefix, above.
275.466 + */
275.467 + if (runpath != 0) {
275.468 + JLI_StrCat(new_runpath, ":");
275.469 + JLI_StrCat(new_runpath, runpath);
275.470 + }
275.471 +
275.472 + if (putenv(new_runpath) != 0) {
275.473 + exit(1); /* problem allocating memory; LD_LIBRARY_PATH not set
275.474 + properly */
275.475 + }
275.476 +
275.477 + /*
275.478 + * Unix systems document that they look at LD_LIBRARY_PATH only
275.479 + * once at startup, so we have to re-exec the current executable
275.480 + * to get the changed environment variable to have an effect.
275.481 + */
275.482 +
275.483 +#ifdef __solaris__
275.484 + /*
275.485 + * If dmpath is not NULL, remove the data model specific string
275.486 + * in the environment for the exec'ed child.
275.487 + */
275.488 + if (dmpath != NULL)
275.489 + (void)UnsetEnv((wanted == 32) ? "LD_LIBRARY_PATH_32" : "LD_LIBRARY_PATH_64");
275.490 +#endif
275.491 +
275.492 + newenvp = environ;
275.493 }
275.494 -#endif
275.495 - JLI_TraceLauncher("TRACER_MARKER:About to EXEC\n");
275.496 - (void)fflush(stdout);
275.497 - (void)fflush(stderr);
275.498 - execv(newexec, argv);
275.499 - JLI_ReportErrorMessageSys(JRE_ERROR4, newexec);
275.500 +#endif /* SETENV_REQUIRED */
275.501 + {
275.502 + char *newexec = execname;
275.503 +#ifdef DUAL_MODE
275.504 + /*
275.505 + * If the data model is being changed, the path to the
275.506 + * executable must be updated accordingly; the executable name
275.507 + * and directory the executable resides in are separate. In the
275.508 + * case of 32 => 64, the new bits are assumed to reside in, e.g.
275.509 + * "olddir/LIBARCH64NAME/execname"; in the case of 64 => 32,
275.510 + * the bits are assumed to be in "olddir/../execname". For example,
275.511 + *
275.512 + * olddir/sparcv9/execname
275.513 + * olddir/amd64/execname
275.514 + *
275.515 + * for Solaris SPARC and Linux amd64, respectively.
275.516 + */
275.517 +
275.518 + if (running != wanted) {
275.519 + char *oldexec = JLI_StrCpy(JLI_MemAlloc(JLI_StrLen(execname) + 1), execname);
275.520 + char *olddir = oldexec;
275.521 + char *oldbase = JLI_StrRChr(oldexec, '/');
275.522 +
275.523 +
275.524 + newexec = JLI_MemAlloc(JLI_StrLen(execname) + 20);
275.525 + *oldbase++ = 0;
275.526 + sprintf(newexec, "%s/%s/%s", olddir,
275.527 + ((wanted == 64) ? LIBARCH64NAME : ".."), oldbase);
275.528 + argv[0] = newexec;
275.529 + }
275.530 +#endif /* DUAL_MODE */
275.531 + JLI_TraceLauncher("TRACER_MARKER:About to EXEC\n");
275.532 + (void) fflush(stdout);
275.533 + (void) fflush(stderr);
275.534 +#ifdef SETENV_REQUIRED
275.535 + if (mustsetenv) {
275.536 + execve(newexec, argv, newenvp);
275.537 + } else {
275.538 + execv(newexec, argv);
275.539 + }
275.540 +#else
275.541 + execv(newexec, argv);
275.542 +#endif /* SETENV_REQUIRED */
275.543 + JLI_ReportErrorMessageSys(JRE_ERROR4, newexec);
275.544
275.545 #ifdef DUAL_MODE
275.546 - if (running != wanted) {
275.547 - JLI_ReportErrorMessage(JRE_ERROR5, wanted, running);
275.548 -# ifdef __solaris__
275.549 -# ifdef __sparc
275.550 - JLI_ReportErrorMessage(JRE_ERROR6);
275.551 -# else
275.552 - JLI_ReportErrorMessage(JRE_ERROR7);
275.553 -# endif
275.554 + if (running != wanted) {
275.555 + JLI_ReportErrorMessage(JRE_ERROR5, wanted, running);
275.556 +#ifdef __solaris__
275.557 +#ifdef __sparc
275.558 + JLI_ReportErrorMessage(JRE_ERROR6);
275.559 +#else
275.560 + JLI_ReportErrorMessage(JRE_ERROR7);
275.561 +#endif /* __sparc */
275.562 + }
275.563 +#endif /* __solaris__ */
275.564 +#endif /* DUAL_MODE */
275.565 +
275.566 }
275.567 -# endif
275.568 -#endif
275.569 -
275.570 - }
275.571 - exit(1);
275.572 + exit(1);
275.573 }
275.574 -
275.575 }
275.576
275.577 /*
276.1 --- a/src/solaris/native/sun/awt/awt_LoadLibrary.c Tue Apr 19 16:01:27 2011 -0700
276.2 +++ b/src/solaris/native/sun/awt/awt_LoadLibrary.c Tue Apr 26 15:48:03 2011 -0700
276.3 @@ -128,12 +128,12 @@
276.4 }
276.5 }
276.6
276.7 - /* Calculate toolkit name, kind of toolkit (XAWT, Motif) and library to load */
276.8 + /* Calculate library name to load */
276.9 if (AWTIsHeadless()) {
276.10 - strcpy(p, "/headless/libmawt");
276.11 + strncpy(p, "/headless/libmawt.so", MAXPATHLEN-len-1);
276.12 } else {
276.13 /* Default AWT Toolkit on Linux and Solaris is XAWT. */
276.14 - strcpy(p, "/xawt/libmawt");
276.15 + strncpy(p, "/xawt/libmawt.so", MAXPATHLEN-len-1);
276.16 }
276.17
276.18 if (toolkit) {
276.19 @@ -143,23 +143,12 @@
276.20 (*env)->DeleteLocalRef(env, propname);
276.21 }
276.22
276.23 - strcat(p, ".so");
276.24 -
276.25 JNU_CallStaticMethodByName(env, NULL, "java/lang/System", "load",
276.26 "(Ljava/lang/String;)V",
276.27 JNU_NewStringPlatform(env, buf));
276.28
276.29 awtHandle = dlopen(buf, RTLD_LAZY | RTLD_GLOBAL);
276.30
276.31 -/*
276.32 - if (dlsym(awtHandle, "AWTCharRBearing") == NULL) {
276.33 - printf("========= AWTCharRBearing not found\n"); fflush(stdout);
276.34 - }
276.35 - else {
276.36 - printf("========= AWTCharRBearing was found\n"); fflush(stdout);
276.37 - }
276.38 -*/
276.39 -
276.40 return JNI_VERSION_1_2;
276.41 }
276.42
277.1 --- a/src/solaris/native/sun/awt/awt_mgrsel.c Tue Apr 19 16:01:27 2011 -0700
277.2 +++ b/src/solaris/native/sun/awt/awt_mgrsel.c Tue Apr 26 15:48:03 2011 -0700
277.3 @@ -136,7 +136,7 @@
277.4 || per_scr_owners == NULL || mgrsel == NULL)
277.5 {
277.6 DTRACE_PRINTLN("MG: select: unable to allocate memory");
277.7 - if (namesbuf != NULL) free(per_scr_atoms);
277.8 + if (namesbuf != NULL) free(namesbuf);
277.9 if (names != NULL) free(names);
277.10 if (per_scr_atoms != NULL) free(per_scr_atoms);
277.11 if (per_scr_owners != NULL) free(per_scr_owners);
278.1 --- a/src/solaris/native/sun/awt/gtk2_interface.c Tue Apr 19 16:01:27 2011 -0700
278.2 +++ b/src/solaris/native/sun/awt/gtk2_interface.c Tue Apr 26 15:48:03 2011 -0700
278.3 @@ -443,6 +443,8 @@
278.4 "gtk_file_chooser_set_current_folder");
278.5 fp_gtk_file_chooser_set_filename = dl_symbol(
278.6 "gtk_file_chooser_set_filename");
278.7 + fp_gtk_file_chooser_set_current_name = dl_symbol(
278.8 + "gtk_file_chooser_set_current_name");
278.9 fp_gtk_file_filter_add_custom = dl_symbol("gtk_file_filter_add_custom");
278.10 fp_gtk_file_chooser_set_filter = dl_symbol("gtk_file_chooser_set_filter");
278.11 fp_gtk_file_chooser_get_type = dl_symbol("gtk_file_chooser_get_type");
279.1 --- a/src/solaris/native/sun/awt/gtk2_interface.h Tue Apr 19 16:01:27 2011 -0700
279.2 +++ b/src/solaris/native/sun/awt/gtk2_interface.h Tue Apr 26 15:48:03 2011 -0700
279.3 @@ -766,6 +766,8 @@
279.4 const gchar *filename);
279.5 gboolean (*fp_gtk_file_chooser_set_filename)(GtkFileChooser *chooser,
279.6 const char *filename);
279.7 +void (*fp_gtk_file_chooser_set_current_name)(GtkFileChooser *chooser,
279.8 + const gchar *name);
279.9 void (*fp_gtk_file_filter_add_custom)(GtkFileFilter *filter,
279.10 GtkFileFilterFlags needed, GtkFileFilterFunc func, gpointer data,
279.11 GDestroyNotify notify);
280.1 --- a/src/solaris/native/sun/awt/sun_awt_X11_GtkFileDialogPeer.c Tue Apr 19 16:01:27 2011 -0700
280.2 +++ b/src/solaris/native/sun/awt/sun_awt_X11_GtkFileDialogPeer.c Tue Apr 26 15:48:03 2011 -0700
280.3 @@ -4,6 +4,7 @@
280.4 #include <string.h>
280.5 #include "gtk2_interface.h"
280.6 #include "sun_awt_X11_GtkFileDialogPeer.h"
280.7 +#include "java_awt_FileDialog.h"
280.8 #include "debug_assert.h"
280.9
280.10 static JavaVM *jvm;
280.11 @@ -220,7 +221,7 @@
280.12
280.13 const char *title = jtitle == NULL? "": (*env)->GetStringUTFChars(env, jtitle, 0);
280.14
280.15 - if (mode == 1) {
280.16 + if (mode == java_awt_FileDialog_SAVE) {
280.17 /* Save action */
280.18 dialog = fp_gtk_file_chooser_dialog_new(title, NULL,
280.19 GTK_FILE_CHOOSER_ACTION_SAVE, GTK_STOCK_CANCEL,
280.20 @@ -253,7 +254,11 @@
280.21 /* Set the filename */
280.22 if (jfile != NULL) {
280.23 const char *filename = (*env)->GetStringUTFChars(env, jfile, 0);
280.24 - fp_gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), filename);
280.25 + if (mode == java_awt_FileDialog_SAVE) {
280.26 + fp_gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(dialog), filename);
280.27 + } else {
280.28 + fp_gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), filename);
280.29 + }
280.30 (*env)->ReleaseStringUTFChars(env, jfile, filename);
280.31 }
280.32
281.1 --- a/src/windows/classes/sun/awt/Win32FontManager.java Tue Apr 19 16:01:27 2011 -0700
281.2 +++ b/src/windows/classes/sun/awt/Win32FontManager.java Tue Apr 26 15:48:03 2011 -0700
281.3 @@ -62,8 +62,11 @@
281.4 String eudcFile = getEUDCFontFile();
281.5 if (eudcFile != null) {
281.6 try {
281.7 + /* Must use Java rasteriser since GDI doesn't
281.8 + * enumerate (allow direct use) of EUDC fonts.
281.9 + */
281.10 eudcFont = new TrueTypeFont(eudcFile, null, 0,
281.11 - false);
281.12 + true);
281.13 } catch (FontFormatException e) {
281.14 }
281.15 }
281.16 @@ -100,6 +103,14 @@
281.17 });
281.18 }
281.19
281.20 + /**
281.21 + * Whether registerFontFile expects absolute or relative
281.22 + * font file names.
281.23 + */
281.24 + protected boolean useAbsoluteFontFileNames() {
281.25 + return false;
281.26 + }
281.27 +
281.28 /* Unlike the shared code version, this expects a base file name -
281.29 * not a full path name.
281.30 * The font configuration file has base file names and the FontConfiguration
282.1 --- a/src/windows/classes/sun/awt/Win32GraphicsEnvironment.java Tue Apr 19 16:01:27 2011 -0700
282.2 +++ b/src/windows/classes/sun/awt/Win32GraphicsEnvironment.java Tue Apr 26 15:48:03 2011 -0700
282.3 @@ -72,12 +72,6 @@
282.4 }
282.5
282.6 /**
282.7 - * Noop function that just acts as an entry point for someone to force
282.8 - * a static initialization of this class.
282.9 - */
282.10 - public static void init() {}
282.11 -
282.12 - /**
282.13 * Initializes native components of the graphics environment. This
282.14 * includes everything from the native GraphicsDevice elements to
282.15 * the DirectX rendering layer.
282.16 @@ -208,14 +202,6 @@
282.17 * ----END DISPLAY CHANGE SUPPORT----
282.18 */
282.19
282.20 - /**
282.21 - * Whether registerFontFile expects absolute or relative
282.22 - * font file names.
282.23 - */
282.24 - protected boolean useAbsoluteFontFileNames() {
282.25 - return false;
282.26 - }
282.27 -
282.28 protected GraphicsDevice makeScreenDevice(int screennum) {
282.29 GraphicsDevice device = null;
282.30 if (WindowsFlags.isD3DEnabled()) {
283.1 --- a/src/windows/classes/sun/awt/windows/WToolkit.java Tue Apr 19 16:01:27 2011 -0700
283.2 +++ b/src/windows/classes/sun/awt/windows/WToolkit.java Tue Apr 26 15:48:03 2011 -0700
283.3 @@ -103,9 +103,6 @@
283.4
283.5 static {
283.6 loadLibraries();
283.7 - // Force Win32GE to load if it is not already loaded; this loads
283.8 - // various other classes that are required for basic awt functionality
283.9 - Win32GraphicsEnvironment.init();
283.10 initIDs();
283.11
283.12 // Print out which version of Windows is running
284.1 --- a/src/windows/classes/sun/nio/fs/WindowsFileSystem.java Tue Apr 19 16:01:27 2011 -0700
284.2 +++ b/src/windows/classes/sun/nio/fs/WindowsFileSystem.java Tue Apr 26 15:48:03 2011 -0700
284.3 @@ -56,8 +56,9 @@
284.4 // parse default directory and check it is absolute
284.5 WindowsPathParser.Result result = WindowsPathParser.parse(dir);
284.6
284.7 - if (result.type() != WindowsPathType.ABSOLUTE)
284.8 - throw new AssertionError("Default directory must be absolute/non-UNC");
284.9 + if ((result.type() != WindowsPathType.ABSOLUTE) &&
284.10 + (result.type() != WindowsPathType.UNC))
284.11 + throw new AssertionError("Default directory is not an absolute path");
284.12 this.defaultDirectory = result.path();
284.13 this.defaultRoot = result.root();
284.14
285.1 --- a/src/windows/native/sun/windows/awt_Button.cpp Tue Apr 19 16:01:27 2011 -0700
285.2 +++ b/src/windows/native/sun/windows/awt_Button.cpp Tue Apr 26 15:48:03 2011 -0700
285.3 @@ -317,7 +317,9 @@
285.4 badAlloc = 1;
285.5 } else {
285.6 c->SetText(labelStr);
285.7 - JNU_ReleaseStringPlatformChars(env, label, labelStr);
285.8 + if (label != NULL) {
285.9 + JNU_ReleaseStringPlatformChars(env, label, labelStr);
285.10 + }
285.11 }
285.12 }
285.13
286.1 --- a/src/windows/native/sun/windows/awt_Checkbox.cpp Tue Apr 19 16:01:27 2011 -0700
286.2 +++ b/src/windows/native/sun/windows/awt_Checkbox.cpp Tue Apr 26 15:48:03 2011 -0700
286.3 @@ -384,7 +384,9 @@
286.4 {
286.5 c->SetText(labelStr);
286.6 c->VerifyState();
286.7 - JNU_ReleaseStringPlatformChars(env, label, labelStr);
286.8 + if (label != NULL) {
286.9 + JNU_ReleaseStringPlatformChars(env, label, labelStr);
286.10 + }
286.11 }
286.12 }
286.13
287.1 --- a/src/windows/native/sun/windows/awt_FileDialog.cpp Tue Apr 19 16:01:27 2011 -0700
287.2 +++ b/src/windows/native/sun/windows/awt_FileDialog.cpp Tue Apr 26 15:48:03 2011 -0700
287.3 @@ -225,7 +225,6 @@
287.4 {
287.5 JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2);
287.6 jobject peer;
287.7 - WCHAR unicodeChar = L' ';
287.8 LPTSTR fileBuffer = NULL;
287.9 LPTSTR currentDirectory = NULL;
287.10 jint mode = 0;
287.11 @@ -263,7 +262,7 @@
287.12 HWND hwndOwner = awtParent ? awtParent->GetHWnd() : NULL;
287.13
287.14 if (title == NULL || env->GetStringLength(title)==0) {
287.15 - title = JNU_NewStringPlatform(env, &unicodeChar);
287.16 + title = JNU_NewStringPlatform(env, L" ");
287.17 }
287.18
287.19 JavaStringBuffer titleBuffer(env, title);
288.1 --- a/test/ProblemList.txt Tue Apr 19 16:01:27 2011 -0700
288.2 +++ b/test/ProblemList.txt Tue Apr 26 15:48:03 2011 -0700
288.3 @@ -288,12 +288,6 @@
288.4
288.5 # jdk_math
288.6
288.7 -# Problems with rounding add failures on solaris-sparcv9 and -server
288.8 -java/math/BigDecimal/AddTests.java solaris-sparcv9
288.9 -
288.10 -# Should be samevm? But seems problematic with samevm on windows
288.11 -java/math/BigInteger/ModPow65537.java generic-all
288.12 -
288.13 ############################################################################
288.14
288.15 # jdk_misc
289.1 --- a/test/com/sun/tools/attach/ApplicationSetup.sh Tue Apr 19 16:01:27 2011 -0700
289.2 +++ b/test/com/sun/tools/attach/ApplicationSetup.sh Tue Apr 26 15:48:03 2011 -0700
289.3 @@ -1,7 +1,7 @@
289.4 #!/bin/sh
289.5
289.6 #
289.7 -# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
289.8 +# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
289.9 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
289.10 #
289.11 # This code is free software; you can redistribute it and/or modify it
289.12 @@ -40,7 +40,8 @@
289.13
289.14 startApplication()
289.15 {
289.16 - ${JAVA} $1 $2 $3 -jar "${TESTCLASSES}"/Application.jar > ${OUTPUTFILE} &
289.17 + # put all output from the app into ${OUTPUTFILE}
289.18 + ${JAVA} $1 $2 $3 -jar "${TESTCLASSES}"/Application.jar > ${OUTPUTFILE} 2>&1 &
289.19 pid="$!"
289.20
289.21 # MKS creates an intermediate shell to launch ${JAVA} so
290.1 --- a/test/com/sun/tools/attach/BasicTests.java Tue Apr 19 16:01:27 2011 -0700
290.2 +++ b/test/com/sun/tools/attach/BasicTests.java Tue Apr 26 15:48:03 2011 -0700
290.3 @@ -1,5 +1,5 @@
290.4 /*
290.5 - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
290.6 + * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
290.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
290.8 *
290.9 * This code is free software; you can redistribute it and/or modify it
290.10 @@ -75,14 +75,23 @@
290.11
290.12 // Test 3 - load an "bad" agent (agentmain throws an exception)
290.13 System.out.println(" - Test: Load a bad agent");
290.14 + System.out.println("INFO: This test will cause error messages "
290.15 + + "to appear in the application log about SilverBullet.jar "
290.16 + + "not being found and an agent failing to start.");
290.17 try {
290.18 vm.loadAgent(badagent);
290.19 + throw new RuntimeException(
290.20 + "AgentInitializationException not thrown as expected!");
290.21 } catch (AgentInitializationException x) {
290.22 - System.out.println(" - AgentInitializationException throws as expected!");
290.23 + System.out.println(
290.24 + " - AgentInitializationException thrown as expected!");
290.25 }
290.26
290.27 // Test 4 - detach from the VM and attempt a load (should throw IOE)
290.28 System.out.println(" - Test: Detach from VM");
290.29 + System.out.println("INFO: This test will cause error messages "
290.30 + + "to appear in the application log about a BadAgent including "
290.31 + + "a RuntimeException and an InvocationTargetException.");
290.32 vm.detach();
290.33 try {
290.34 vm.loadAgent(agent);
291.1 --- a/test/com/sun/tools/attach/BasicTests.sh Tue Apr 19 16:01:27 2011 -0700
291.2 +++ b/test/com/sun/tools/attach/BasicTests.sh Tue Apr 26 15:48:03 2011 -0700
291.3 @@ -1,7 +1,7 @@
291.4 #!/bin/sh
291.5
291.6 #
291.7 -# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
291.8 +# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
291.9 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
291.10 #
291.11 # This code is free software; you can redistribute it and/or modify it
291.12 @@ -39,11 +39,9 @@
291.13
291.14 # Windows 2000 is a problem here, so we skip it, see 6962615
291.15 osrev=`uname -a`
291.16 -if [ "`echo ${osrev} | grep 'CYGWIN'`" != "" ] ; then
291.17 - if [ "`echo ${osrev} | grep '5.0'`" != "" ] ; then
291.18 - echo "Treating as a pass, not testing Windows 2000"
291.19 - exit 0
291.20 - fi
291.21 +if [ "`echo ${osrev} | grep 'CYGWIN[^ ]*-5\.0'`" != "" ] ; then
291.22 + echo "Treating as a pass, not testing Windows 2000"
291.23 + exit 0
291.24 fi
291.25 if [ "`echo ${osrev} | grep 'Windows'`" != "" ] ; then
291.26 if [ "`echo ${osrev} | grep '5 00'`" != "" ] ; then
291.27 @@ -58,7 +56,7 @@
291.28
291.29 startApplication -Dattach.test=true
291.30 # pid = process-id, port = shutdown port
291.31 -
291.32 +
291.33 failures=0
291.34
291.35 echo "Running tests ..."
291.36 @@ -69,6 +67,18 @@
291.37
291.38 stopApplication $port
291.39
291.40 +# Add these info messages to $OUTPUTFILE just in case someone
291.41 +# looks at it and wonders about the failures. We have to do
291.42 +# this after the application is stopped because it is writing
291.43 +# to $OUTPUTFILE.
291.44 +(
291.45 +echo ""
291.46 +echo "INFO: Test 2 will cause error messages about SilverBullet.jar" \
291.47 + "and an agent failing to start."
291.48 +echo "INFO: Test 3 will cause error messages about BadAgent" \
291.49 + "including a RuntimeException and an InvocationTargetException."
291.50 +) >> ${OUTPUTFILE}
291.51 +
291.52 if [ $failures = 0 ];
291.53 then echo "All tests passed.";
291.54 else echo "$failures test(s) failed:"; cat ${OUTPUTFILE};
292.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
292.2 +++ b/test/java/awt/Dialog/ValidateOnShow/ValidateOnShow.java Tue Apr 26 15:48:03 2011 -0700
292.3 @@ -0,0 +1,84 @@
292.4 +/*
292.5 + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
292.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
292.7 + *
292.8 + * This code is free software; you can redistribute it and/or modify it
292.9 + * under the terms of the GNU General Public License version 2 only, as
292.10 + * published by the Free Software Foundation.
292.11 + *
292.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
292.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
292.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
292.15 + * version 2 for more details (a copy is included in the LICENSE file that
292.16 + * accompanied this code).
292.17 + *
292.18 + * You should have received a copy of the GNU General Public License version
292.19 + * 2 along with this work; if not, write to the Free Software Foundation,
292.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
292.21 + *
292.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
292.23 + * or visit www.oracle.com if you need additional information or have any
292.24 + * questions.
292.25 + */
292.26 +
292.27 +/*
292.28 + @test
292.29 + @bug 7027013
292.30 + @summary Dialog.show() should validate the window unconditionally
292.31 + @author anthony.petrov@oracle.com: area=awt.toplevel
292.32 + @run main ValidateOnShow
292.33 +*/
292.34 +
292.35 +import java.awt.*;
292.36 +
292.37 +public class ValidateOnShow {
292.38 + private static Dialog dialog = new Dialog((Frame)null);
292.39 + private static Panel panel = new Panel() {
292.40 + @Override
292.41 + public boolean isValidateRoot() {
292.42 + return true;
292.43 + }
292.44 + };
292.45 + private static Button button = new Button("Test");
292.46 +
292.47 + private static void sleep() {
292.48 + try { Thread.sleep(500); } catch (Exception e) {}
292.49 + }
292.50 +
292.51 + private static void test() {
292.52 + System.out.println("Before showing: panel.isValid=" + panel.isValid() + " dialog.isValid=" + dialog.isValid());
292.53 + dialog.setVisible(true);
292.54 + sleep();
292.55 + System.out.println("After showing: panel.isValid=" + panel.isValid() + " dialog.isValid=" + dialog.isValid());
292.56 +
292.57 + if (!panel.isValid()) {
292.58 + dialog.dispose();
292.59 + throw new RuntimeException("The panel hasn't been validated upon showing the dialog");
292.60 + }
292.61 +
292.62 + dialog.setVisible(false);
292.63 + sleep();
292.64 + }
292.65 +
292.66 + public static void main(String[] args) {
292.67 + // setup
292.68 + dialog.add(panel);
292.69 + panel.add(button);
292.70 +
292.71 + dialog.setBounds(200, 200, 300, 200);
292.72 +
292.73 + // The first test should always succeed since the dialog is invalid initially
292.74 + test();
292.75 +
292.76 + // now invalidate the button and the panel
292.77 + button.setBounds(1, 1, 30, 30);
292.78 + sleep();
292.79 + // since the panel is a validate root, the dialog is still valid
292.80 +
292.81 + // w/o a fix this would fail
292.82 + test();
292.83 +
292.84 + // cleanup
292.85 + dialog.dispose();
292.86 + }
292.87 +}
293.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
293.2 +++ b/test/java/awt/FileDialog/FileNameOverrideTest/FileNameOverrideTest.html Tue Apr 26 15:48:03 2011 -0700
293.3 @@ -0,0 +1,22 @@
293.4 +<html>
293.5 +<!--
293.6 + @test
293.7 + @bug 6260659
293.8 + @summary File Name set programmatically in FileDialog is overridden during navigation, XToolkit
293.9 + @author Dmitry.Cherepanov@SUN.COM area=awt.filedialog
293.10 + @library ../../regtesthelpers
293.11 + @build Sysout
293.12 + @run applet/manual=yesno FileNameOverrideTest.html
293.13 + -->
293.14 +<head>
293.15 +<title> FileNameOverrideTest </title>
293.16 +</head>
293.17 +<body>
293.18 +
293.19 +<h1>FileNameOverrideTest<br>Bug ID: 6260659</h1>
293.20 +
293.21 +<p> See the dialog box (usually in upper left corner) for instructions</p>
293.22 +
293.23 +<APPLET CODE="FileNameOverrideTest.class" WIDTH=200 HEIGHT=200></APPLET>
293.24 +</body>
293.25 +</html>
294.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
294.2 +++ b/test/java/awt/FileDialog/FileNameOverrideTest/FileNameOverrideTest.java Tue Apr 26 15:48:03 2011 -0700
294.3 @@ -0,0 +1,73 @@
294.4 +/*
294.5 + test
294.6 + @bug 6260659
294.7 + @summary File Name set programmatically in FileDialog is overridden during navigation, XToolkit
294.8 + @author Dmitry.Cherepanov@SUN.COM area=awt.filedialog
294.9 + @library ../../regtesthelpers
294.10 + @build Sysout
294.11 + @run applet/manual=yesno FileNameOverrideTest.html
294.12 +*/
294.13 +
294.14 +import test.java.awt.regtesthelpers.Sysout;
294.15 +
294.16 +import java.applet.Applet;
294.17 +import java.awt.*;
294.18 +import java.awt.event.ActionEvent;
294.19 +import java.awt.event.ActionListener;
294.20 +import java.io.File;
294.21 +import java.io.IOException;
294.22 +
294.23 +public class FileNameOverrideTest extends Applet implements ActionListener {
294.24 + private final static String fileName = "input";
294.25 + private final static String clickDirName = "Directory for double click";
294.26 + private final static String dirPath = ".";
294.27 + private Button showBtn;
294.28 + private FileDialog fd;
294.29 +
294.30 + public void init() {
294.31 + this.setLayout(new GridLayout(1, 1));
294.32 +
294.33 + fd = new FileDialog(new Frame(), "Open");
294.34 +
294.35 + showBtn = new Button("Show File Dialog");
294.36 + showBtn.addActionListener(this);
294.37 + add(showBtn);
294.38 +
294.39 + try {
294.40 + File tmpFileUp = new File(dirPath + File.separator + fileName);
294.41 + File tmpDir = new File(dirPath + File.separator + clickDirName);
294.42 + File tmpFileIn = new File(tmpDir.getAbsolutePath() + File.separator + fileName);
294.43 + tmpDir.mkdir();
294.44 + tmpFileUp.createNewFile();
294.45 + tmpFileIn.createNewFile();
294.46 + } catch (IOException ex) {
294.47 + throw new RuntimeException("Cannot create test folder", ex);
294.48 + }
294.49 +
294.50 + String[] instructions = {
294.51 + "1) Click on 'Show File Dialog' button. A file dialog will come up.",
294.52 + "2) Double-click on '" + clickDirName + "' and click OK.",
294.53 + "3) See result of the test below"
294.54 + };
294.55 + Sysout.createDialogWithInstructions(instructions);
294.56 + }//End init()
294.57 +
294.58 + public void start() {
294.59 + setSize(200, 200);
294.60 + show();
294.61 + }// start()
294.62 +
294.63 + public void actionPerformed(ActionEvent e) {
294.64 + if (e.getSource() == showBtn) {
294.65 + fd.setFile(fileName);
294.66 + fd.setDirectory(dirPath);
294.67 + fd.setVisible(true);
294.68 + String output = fd.getFile();
294.69 + if (fileName.equals(output)) {
294.70 + Sysout.println("TEST PASSED");
294.71 + } else {
294.72 + Sysout.println("TEST FAILED (output file - " + output + ")");
294.73 + }
294.74 + }
294.75 + }
294.76 +}// class ManualYesNoTest
295.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
295.2 +++ b/test/java/awt/FileDialog/SaveFileNameOverrideTest/SaveFileNameOverrideTest.html Tue Apr 26 15:48:03 2011 -0700
295.3 @@ -0,0 +1,22 @@
295.4 +<html>
295.5 +<!--
295.6 + @test
295.7 + @bug 6998877
295.8 + @summary After double-click on the folder names, FileNameOverrideTest FAILED
295.9 + @author Sergey.Bylokhov@oracle.com area=awt.filedialog
295.10 + @library ../../regtesthelpers
295.11 + @build Sysout
295.12 + @run applet/manual=yesno SaveFileNameOverrideTest.html
295.13 + -->
295.14 +<head>
295.15 +<title> SaveFileNameOverrideTest </title>
295.16 +</head>
295.17 +<body>
295.18 +
295.19 +<h1>SaveFileNameOverrideTest<br>Bug ID: 6260659</h1>
295.20 +
295.21 +<p> See the dialog box (usually in upper left corner) for instructions</p>
295.22 +
295.23 +<APPLET CODE="SaveFileNameOverrideTest.class" WIDTH=200 HEIGHT=200></APPLET>
295.24 +</body>
295.25 +</html>
296.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
296.2 +++ b/test/java/awt/FileDialog/SaveFileNameOverrideTest/SaveFileNameOverrideTest.java Tue Apr 26 15:48:03 2011 -0700
296.3 @@ -0,0 +1,65 @@
296.4 +/*
296.5 + test
296.6 + @bug 6998877
296.7 + @summary After double-click on the folder names, FileNameOverrideTest FAILED
296.8 + @author Sergey.Bylokhov@oracle.com area=awt.filedialog
296.9 + @library ../../regtesthelpers
296.10 + @build Sysout
296.11 + @run applet/manual=yesno SaveFileNameOverrideTest.html
296.12 +*/
296.13 +
296.14 +import test.java.awt.regtesthelpers.Sysout;
296.15 +
296.16 +import java.applet.Applet;
296.17 +import java.awt.*;
296.18 +import java.awt.event.ActionEvent;
296.19 +import java.awt.event.ActionListener;
296.20 +import java.io.File;
296.21 +
296.22 +public class SaveFileNameOverrideTest extends Applet implements ActionListener {
296.23 + private final static String clickDirName = "Directory for double click";
296.24 + private final static String dirPath = ".";
296.25 + private Button showBtn;
296.26 + private FileDialog fd;
296.27 +
296.28 + public void init() {
296.29 + this.setLayout(new GridLayout(1, 1));
296.30 +
296.31 + fd = new FileDialog(new Frame(), "Save", FileDialog.SAVE);
296.32 +
296.33 + showBtn = new Button("Show File Dialog");
296.34 + showBtn.addActionListener(this);
296.35 + add(showBtn);
296.36 +
296.37 + File tmpDir = new File(dirPath + File.separator + clickDirName);
296.38 + tmpDir.mkdir();
296.39 +
296.40 + String[] instructions = {
296.41 + "1) Click on 'Show File Dialog' button. A file dialog will come up.",
296.42 + "2) Double-click on '" + clickDirName + "' and click OK.",
296.43 + "3) See result of the test below"
296.44 + };
296.45 +
296.46 + Sysout.createDialogWithInstructions(instructions);
296.47 +
296.48 + }//End init()
296.49 +
296.50 + public void start() {
296.51 + setSize(200, 200);
296.52 + show();
296.53 + }// start()
296.54 +
296.55 + public void actionPerformed(ActionEvent e) {
296.56 + if (e.getSource() == showBtn) {
296.57 + fd.setFile("input");
296.58 + fd.setDirectory(dirPath);
296.59 + fd.setVisible(true);
296.60 + String output = fd.getFile();
296.61 + if ("input".equals(output)) {
296.62 + Sysout.println("TEST PASSED");
296.63 + } else {
296.64 + Sysout.println("TEST FAILED (output file - " + output + ")");
296.65 + }
296.66 + }
296.67 + }
296.68 +}// class ManualYesNoTest
297.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
297.2 +++ b/test/java/awt/GraphicsEnvironment/LoadLock/GE_init1.java Tue Apr 26 15:48:03 2011 -0700
297.3 @@ -0,0 +1,37 @@
297.4 +/*
297.5 + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
297.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
297.7 + *
297.8 + * This code is free software; you can redistribute it and/or modify it
297.9 + * under the terms of the GNU General Public License version 2 only, as
297.10 + * published by the Free Software Foundation.
297.11 + *
297.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
297.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
297.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
297.15 + * version 2 for more details (a copy is included in the LICENSE file that
297.16 + * accompanied this code).
297.17 + *
297.18 + * You should have received a copy of the GNU General Public License version
297.19 + * 2 along with this work; if not, write to the Free Software Foundation,
297.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
297.21 + *
297.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
297.23 + * or visit www.oracle.com if you need additional information or have any
297.24 + * questions.
297.25 + */
297.26 +
297.27 +/*
297.28 + * @test
297.29 + * @bug 7002839
297.30 + * @summary Static init deadlock Win32GraphicsEnvironment and WToolkit
297.31 + * @run main GE_init1
297.32 + */
297.33 +
297.34 +import java.awt.Toolkit;
297.35 +
297.36 +public class GE_init1 {
297.37 + public static void main(String[] args) {
297.38 + Toolkit.getDefaultToolkit();
297.39 + }
297.40 +}
298.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
298.2 +++ b/test/java/awt/GraphicsEnvironment/LoadLock/GE_init2.java Tue Apr 26 15:48:03 2011 -0700
298.3 @@ -0,0 +1,38 @@
298.4 +/*
298.5 + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
298.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
298.7 + *
298.8 + * This code is free software; you can redistribute it and/or modify it
298.9 + * under the terms of the GNU General Public License version 2 only, as
298.10 + * published by the Free Software Foundation.
298.11 + *
298.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
298.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
298.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
298.15 + * version 2 for more details (a copy is included in the LICENSE file that
298.16 + * accompanied this code).
298.17 + *
298.18 + * You should have received a copy of the GNU General Public License version
298.19 + * 2 along with this work; if not, write to the Free Software Foundation,
298.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
298.21 + *
298.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
298.23 + * or visit www.oracle.com if you need additional information or have any
298.24 + * questions.
298.25 + */
298.26 +
298.27 +/*
298.28 + * @test
298.29 + * @bug 7002839
298.30 + * @summary Static init deadlock Win32GraphicsEnvironment and WToolkit
298.31 + * @run main GE_init2
298.32 + */
298.33 +
298.34 +
298.35 +import java.awt.GraphicsEnvironment;
298.36 +
298.37 +public class GE_init2 {
298.38 + public static void main(String[] args) {
298.39 + GraphicsEnvironment.getLocalGraphicsEnvironment();
298.40 + }
298.41 +}
299.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
299.2 +++ b/test/java/awt/GraphicsEnvironment/LoadLock/GE_init3.java Tue Apr 26 15:48:03 2011 -0700
299.3 @@ -0,0 +1,38 @@
299.4 +/*
299.5 + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
299.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
299.7 + *
299.8 + * This code is free software; you can redistribute it and/or modify it
299.9 + * under the terms of the GNU General Public License version 2 only, as
299.10 + * published by the Free Software Foundation.
299.11 + *
299.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
299.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
299.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
299.15 + * version 2 for more details (a copy is included in the LICENSE file that
299.16 + * accompanied this code).
299.17 + *
299.18 + * You should have received a copy of the GNU General Public License version
299.19 + * 2 along with this work; if not, write to the Free Software Foundation,
299.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
299.21 + *
299.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
299.23 + * or visit www.oracle.com if you need additional information or have any
299.24 + * questions.
299.25 + */
299.26 +
299.27 +/*
299.28 + * @test
299.29 + * @bug 7002839
299.30 + * @summary Static init deadlock Win32GraphicsEnvironment and WToolkit
299.31 + * @run main GE_init3
299.32 + */
299.33 +
299.34 +
299.35 +import java.awt.Frame;
299.36 +
299.37 +public class GE_init3 {
299.38 + public static void main(String[] args) {
299.39 + new Frame("Test3").setVisible(true);
299.40 + }
299.41 +}
300.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
300.2 +++ b/test/java/awt/GraphicsEnvironment/LoadLock/GE_init4.java Tue Apr 26 15:48:03 2011 -0700
300.3 @@ -0,0 +1,37 @@
300.4 +/*
300.5 + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
300.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
300.7 + *
300.8 + * This code is free software; you can redistribute it and/or modify it
300.9 + * under the terms of the GNU General Public License version 2 only, as
300.10 + * published by the Free Software Foundation.
300.11 + *
300.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
300.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
300.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
300.15 + * version 2 for more details (a copy is included in the LICENSE file that
300.16 + * accompanied this code).
300.17 + *
300.18 + * You should have received a copy of the GNU General Public License version
300.19 + * 2 along with this work; if not, write to the Free Software Foundation,
300.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
300.21 + *
300.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
300.23 + * or visit www.oracle.com if you need additional information or have any
300.24 + * questions.
300.25 + */
300.26 +
300.27 +/*
300.28 + * @test
300.29 + * @bug 7002839
300.30 + * @summary Static init deadlock Win32GraphicsEnvironment and WToolkit
300.31 + * @run main/othervm -Djava.awt.headless=true GE_init4
300.32 + */
300.33 +
300.34 +import java.awt.Toolkit;
300.35 +
300.36 +public class GE_init4 {
300.37 + public static void main(String[] args) {
300.38 + Toolkit.getDefaultToolkit();
300.39 + }
300.40 +}
301.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
301.2 +++ b/test/java/awt/GraphicsEnvironment/LoadLock/GE_init5.java Tue Apr 26 15:48:03 2011 -0700
301.3 @@ -0,0 +1,37 @@
301.4 +/*
301.5 + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
301.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
301.7 + *
301.8 + * This code is free software; you can redistribute it and/or modify it
301.9 + * under the terms of the GNU General Public License version 2 only, as
301.10 + * published by the Free Software Foundation.
301.11 + *
301.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
301.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
301.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
301.15 + * version 2 for more details (a copy is included in the LICENSE file that
301.16 + * accompanied this code).
301.17 + *
301.18 + * You should have received a copy of the GNU General Public License version
301.19 + * 2 along with this work; if not, write to the Free Software Foundation,
301.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
301.21 + *
301.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
301.23 + * or visit www.oracle.com if you need additional information or have any
301.24 + * questions.
301.25 + */
301.26 +
301.27 +/*
301.28 + * @test
301.29 + * @bug 7002839
301.30 + * @summary Static init deadlock Win32GraphicsEnvironment and WToolkit
301.31 + * @run main/othervm -Djava.awt.headless=true GE_init4
301.32 + */
301.33 +
301.34 +import java.awt.Toolkit;
301.35 +
301.36 +public class GE_init5 {
301.37 + public static void main(String[] args) {
301.38 + GraphicsEnvironment.getLocalGraphicsEnvironment();
301.39 + }
301.40 +}
302.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
302.2 +++ b/test/java/awt/GraphicsEnvironment/LoadLock/GE_init6.java Tue Apr 26 15:48:03 2011 -0700
302.3 @@ -0,0 +1,45 @@
302.4 +/*
302.5 + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
302.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
302.7 + *
302.8 + * This code is free software; you can redistribute it and/or modify it
302.9 + * under the terms of the GNU General Public License version 2 only, as
302.10 + * published by the Free Software Foundation.
302.11 + *
302.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
302.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
302.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
302.15 + * version 2 for more details (a copy is included in the LICENSE file that
302.16 + * accompanied this code).
302.17 + *
302.18 + * You should have received a copy of the GNU General Public License version
302.19 + * 2 along with this work; if not, write to the Free Software Foundation,
302.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
302.21 + *
302.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
302.23 + * or visit www.oracle.com if you need additional information or have any
302.24 + * questions.
302.25 + */
302.26 +
302.27 +/*
302.28 + * @test
302.29 + * @bug 7002839
302.30 + * @summary Static init deadlock Win32GraphicsEnvironment and WToolkit
302.31 + * @run main/othervm -Djava.awt.headless=true GE_init6
302.32 + */
302.33 +
302.34 +import java.awt.*;
302.35 +
302.36 +public class GE_init6 {
302.37 + private static boolean passed = false;
302.38 + public static void main(String[] args) {
302.39 + try {
302.40 + new Frame("Test3").setVisible(true);
302.41 + } catch (HeadlessException e){
302.42 + passed = true;
302.43 + }
302.44 + if (!passed){
302.45 + throw new RuntimeException("Should have thrown HE but it either didn't throw any or just passed through.");
302.46 + }
302.47 + }
302.48 +}
303.1 --- a/test/java/awt/Window/TranslucentJAppletTest/TranslucentJAppletTest.java Tue Apr 19 16:01:27 2011 -0700
303.2 +++ b/test/java/awt/Window/TranslucentJAppletTest/TranslucentJAppletTest.java Tue Apr 26 15:48:03 2011 -0700
303.3 @@ -43,6 +43,7 @@
303.4 private static void initAndShowGUI() {
303.5 frame = new JFrame();
303.6 JApplet applet = new JApplet();
303.7 + applet.setBackground(new Color(0, 0, 0, 0));
303.8 JPanel panel = new JPanel() {
303.9 protected void paintComponent(Graphics g) {
303.10 paintComponentCalled = true;
304.1 --- a/test/java/lang/Character/CheckScript.java Tue Apr 19 16:01:27 2011 -0700
304.2 +++ b/test/java/lang/Character/CheckScript.java Tue Apr 26 15:48:03 2011 -0700
304.3 @@ -1,34 +1,58 @@
304.4 +
304.5 +/*
304.6 + * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
304.7 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
304.8 + *
304.9 + * This code is free software; you can redistribute it and/or modify it
304.10 + * under the terms of the GNU General Public License version 2 only, as
304.11 + * published by the Free Software Foundation.
304.12 + *
304.13 + * This code is distributed in the hope that it will be useful, but WITHOUT
304.14 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
304.15 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
304.16 + * version 2 for more details (a copy is included in the LICENSE file that
304.17 + * accompanied this code).
304.18 + *
304.19 + * You should have received a copy of the GNU General Public License version
304.20 + * 2 along with this work; if not, write to the Free Software Foundation,
304.21 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
304.22 + *
304.23 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
304.24 + * or visit www.oracle.com if you need additional information or have any
304.25 + * questions.
304.26 + */
304.27 +
304.28 /**
304.29 * @test
304.30 - * @bug 6945564 6959267
304.31 + * @bug 6945564 6959267 7033561
304.32 * @summary Check that the j.l.Character.UnicodeScript
304.33 */
304.34
304.35 import java.io.*;
304.36 -import java.lang.reflect.*;
304.37 import java.util.*;
304.38 import java.util.regex.*;
304.39 import java.lang.Character.UnicodeScript;
304.40
304.41 public class CheckScript {
304.42
304.43 - static BufferedReader open(String[] args) throws FileNotFoundException {
304.44 + public static void main(String[] args) throws Exception {
304.45 + File fScripts;
304.46 + File fAliases;
304.47 if (args.length == 0) {
304.48 - return new BufferedReader(new FileReader(new File(System.getProperty("test.src", "."), "Scripts.txt")));
304.49 - } else if (args.length == 1) {
304.50 - return new BufferedReader(new FileReader(args[0]));
304.51 + fScripts = new File(System.getProperty("test.src", "."), "Scripts.txt");
304.52 + fAliases = new File(System.getProperty("test.src", "."), "PropertyValueAliases.txt");
304.53 + } else if (args.length == 2) {
304.54 + fScripts = new File(args[0]);
304.55 + fAliases = new File(args[1]);
304.56 } else {
304.57 - System.out.println("java CharacterScript Scripts.txt");
304.58 + System.out.println("java CharacterScript Scripts.txt PropertyValueAliases.txt");
304.59 throw new RuntimeException("Datafile name should be specified.");
304.60 }
304.61 - }
304.62 -
304.63 - public static void main(String[] args) throws Exception {
304.64
304.65 Matcher m = Pattern.compile("(\\p{XDigit}+)(?:\\.{2}(\\p{XDigit}+))?\\s+;\\s+(\\w+)\\s+#.*").matcher("");
304.66 String line = null;
304.67 HashMap<String,ArrayList<Integer>> scripts = new HashMap<>();
304.68 - try (BufferedReader sbfr = open(args)) {
304.69 + try (BufferedReader sbfr = new BufferedReader(new FileReader(fScripts))) {
304.70 while ((line = sbfr.readLine()) != null) {
304.71 if (line.length() <= 1 || line.charAt(0) == '#') {
304.72 continue;
304.73 @@ -107,5 +131,29 @@
304.74 }
304.75 }
304.76 }
304.77 + // check all aliases
304.78 + m = Pattern.compile("sc\\s*;\\s*(\\p{Alpha}{4})\\s*;\\s*([\\p{Alpha}|_]+)\\s*.*").matcher("");
304.79 + line = null;
304.80 + try (BufferedReader sbfr = new BufferedReader(new FileReader(fAliases))) {
304.81 + while ((line = sbfr.readLine()) != null) {
304.82 + if (line.length() <= 1 || line.charAt(0) == '#') {
304.83 + continue;
304.84 + }
304.85 + m.reset(line);
304.86 + if (m.matches()) {
304.87 + String alias = m.group(1);
304.88 + String name = m.group(2);
304.89 + // HRKT -> Katakana_Or_Hiragana not supported
304.90 + if ("HRKT".equals(alias.toUpperCase(Locale.ENGLISH)))
304.91 + continue;
304.92 + if (Character.UnicodeScript.forName(alias) !=
304.93 + Character.UnicodeScript.forName(name)) {
304.94 + throw new RuntimeException(
304.95 + "UnicodeScript failed: alias<" + alias +
304.96 + "> does not map to <" + name + ">");
304.97 + }
304.98 + }
304.99 + }
304.100 + }
304.101 }
304.102 }
305.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
305.2 +++ b/test/java/lang/Character/PropertyValueAliases.txt Tue Apr 26 15:48:03 2011 -0700
305.3 @@ -0,0 +1,1178 @@
305.4 +# PropertyValueAliases-6.0.0.txt
305.5 +# Date: 2010-07-17, 22:44:06 GMT [MD]
305.6 +#
305.7 +# Unicode Character Database
305.8 +# Copyright (c) 1991-2010 Unicode, Inc.
305.9 +# For terms of use, see http://www.unicode.org/terms_of_use.html
305.10 +# For documentation, see http://www.unicode.org/reports/tr44/
305.11 +#
305.12 +# This file contains aliases for property values used in the UCD.
305.13 +# These names can be used for XML formats of UCD data, for regular-expression
305.14 +# property tests, and other programmatic textual descriptions of Unicode data.
305.15 +# For information on which properties are normative, see UCD.html.
305.16 +#
305.17 +# The names may be translated in appropriate environments, and additional
305.18 +# aliases may be useful.
305.19 +#
305.20 +# FORMAT
305.21 +#
305.22 +# Each line describes a property value name.
305.23 +# This consists of three or more fields, separated by semicolons.
305.24 +#
305.25 +# First Field: The first field describes the property for which that
305.26 +# property value name is used.
305.27 +#
305.28 +# Second Field: The second field is an abbreviated name.
305.29 +# If there is no abbreviated name available, the field is marked with "n/a".
305.30 +#
305.31 +# Third Field: The third field is a long name.
305.32 +#
305.33 +# In the case of ccc, there are 4 fields. The second field is numeric, third
305.34 +# is abbreviated, and fourth is long.
305.35 +#
305.36 +# The above are the preferred aliases. Other aliases may be listed in additional fields.
305.37 +#
305.38 +# Loose matching should be applied to all property names and property values, with
305.39 +# the exception of String Property values. With loose matching of property names and
305.40 +# values, the case distinctions, whitespace, and '_' are ignored. For Numeric Property
305.41 +# values, numeric equivalencies are applied: thus "01.00" is equivalent to "1".
305.42 +#
305.43 +# NOTE: Property value names are NOT unique across properties. For example:
305.44 +#
305.45 +# AL means Arabic Letter for the Bidi_Class property, and
305.46 +# AL means Above_Left for the Combining_Class property, and
305.47 +# AL means Alphabetic for the Line_Break property.
305.48 +#
305.49 +# In addition, some property names may be the same as some property value names.
305.50 +# For example:
305.51 +#
305.52 +# sc means the Script property, and
305.53 +# Sc means the General_Category property value Currency_Symbol (Sc)
305.54 +#
305.55 +# The combination of property value and property name is, however, unique.
305.56 +#
305.57 +# For more information, see UTS #18: Unicode Regular Expressions
305.58 +# ================================================
305.59 +
305.60 +
305.61 +# ASCII_Hex_Digit (AHex)
305.62 +
305.63 +AHex; N ; No ; F ; False
305.64 +AHex; Y ; Yes ; T ; True
305.65 +
305.66 +# Age (age)
305.67 +
305.68 +age; n/a ; 1.1
305.69 +age; n/a ; 2.0
305.70 +age; n/a ; 2.1
305.71 +age; n/a ; 3.0
305.72 +age; n/a ; 3.1
305.73 +age; n/a ; 3.2
305.74 +age; n/a ; 4.0
305.75 +age; n/a ; 4.1
305.76 +age; n/a ; 5.0
305.77 +age; n/a ; 5.1
305.78 +age; n/a ; 5.2
305.79 +age; n/a ; 6.0
305.80 +age; n/a ; unassigned
305.81 +
305.82 +# Alphabetic (Alpha)
305.83 +
305.84 +Alpha; N ; No ; F ; False
305.85 +Alpha; Y ; Yes ; T ; True
305.86 +
305.87 +# Bidi_Class (bc)
305.88 +
305.89 +bc ; AL ; Arabic_Letter
305.90 +bc ; AN ; Arabic_Number
305.91 +bc ; B ; Paragraph_Separator
305.92 +bc ; BN ; Boundary_Neutral
305.93 +bc ; CS ; Common_Separator
305.94 +bc ; EN ; European_Number
305.95 +bc ; ES ; European_Separator
305.96 +bc ; ET ; European_Terminator
305.97 +bc ; L ; Left_To_Right
305.98 +bc ; LRE ; Left_To_Right_Embedding
305.99 +bc ; LRO ; Left_To_Right_Override
305.100 +bc ; NSM ; Nonspacing_Mark
305.101 +bc ; ON ; Other_Neutral
305.102 +bc ; PDF ; Pop_Directional_Format
305.103 +bc ; R ; Right_To_Left
305.104 +bc ; RLE ; Right_To_Left_Embedding
305.105 +bc ; RLO ; Right_To_Left_Override
305.106 +bc ; S ; Segment_Separator
305.107 +bc ; WS ; White_Space
305.108 +
305.109 +# Bidi_Control (Bidi_C)
305.110 +
305.111 +Bidi_C; N ; No ; F ; False
305.112 +Bidi_C; Y ; Yes ; T ; True
305.113 +
305.114 +# Bidi_Mirrored (Bidi_M)
305.115 +
305.116 +Bidi_M; N ; No ; F ; False
305.117 +Bidi_M; Y ; Yes ; T ; True
305.118 +
305.119 +# Bidi_Mirroring_Glyph (bmg)
305.120 +
305.121 +# @missing: 0000..10FFFF; Bidi_Mirroring_Glyph; <none>
305.122 +
305.123 +# Block (blk)
305.124 +
305.125 +blk; n/a ; Aegean_Numbers
305.126 +blk; n/a ; Alchemical_Symbols
305.127 +blk; n/a ; Alphabetic_Presentation_Forms
305.128 +blk; n/a ; Ancient_Greek_Musical_Notation
305.129 +blk; n/a ; Ancient_Greek_Numbers
305.130 +blk; n/a ; Ancient_Symbols
305.131 +blk; n/a ; Arabic
305.132 +blk; n/a ; Arabic_Presentation_Forms_A ; Arabic_Presentation_Forms-A
305.133 +blk; n/a ; Arabic_Presentation_Forms_B
305.134 +blk; n/a ; Arabic_Supplement
305.135 +blk; n/a ; Armenian
305.136 +blk; n/a ; Arrows
305.137 +blk; n/a ; Avestan
305.138 +blk; n/a ; Balinese
305.139 +blk; n/a ; Bamum
305.140 +blk; n/a ; Bamum_Supplement
305.141 +blk; n/a ; Basic_Latin ; ASCII
305.142 +blk; n/a ; Batak
305.143 +blk; n/a ; Bengali
305.144 +blk; n/a ; Block_Elements
305.145 +blk; n/a ; Bopomofo
305.146 +blk; n/a ; Bopomofo_Extended
305.147 +blk; n/a ; Box_Drawing
305.148 +blk; n/a ; Brahmi
305.149 +blk; n/a ; Braille_Patterns
305.150 +blk; n/a ; Buginese
305.151 +blk; n/a ; Buhid
305.152 +blk; n/a ; Byzantine_Musical_Symbols
305.153 +blk; n/a ; Carian
305.154 +blk; n/a ; Cham
305.155 +blk; n/a ; Cherokee
305.156 +blk; n/a ; CJK_Compatibility
305.157 +blk; n/a ; CJK_Compatibility_Forms
305.158 +blk; n/a ; CJK_Compatibility_Ideographs
305.159 +blk; n/a ; CJK_Compatibility_Ideographs_Supplement
305.160 +blk; n/a ; CJK_Radicals_Supplement
305.161 +blk; n/a ; CJK_Strokes
305.162 +blk; n/a ; CJK_Symbols_And_Punctuation
305.163 +blk; n/a ; CJK_Unified_Ideographs
305.164 +blk; n/a ; CJK_Unified_Ideographs_Extension_A
305.165 +blk; n/a ; CJK_Unified_Ideographs_Extension_B
305.166 +blk; n/a ; CJK_Unified_Ideographs_Extension_C
305.167 +blk; n/a ; CJK_Unified_Ideographs_Extension_D
305.168 +blk; n/a ; Combining_Diacritical_Marks
305.169 +blk; n/a ; Combining_Diacritical_Marks_For_Symbols; Combining_Marks_For_Symbols
305.170 +blk; n/a ; Combining_Diacritical_Marks_Supplement
305.171 +blk; n/a ; Combining_Half_Marks
305.172 +blk; n/a ; Common_Indic_Number_Forms
305.173 +blk; n/a ; Control_Pictures
305.174 +blk; n/a ; Coptic
305.175 +blk; n/a ; Counting_Rod_Numerals
305.176 +blk; n/a ; Cuneiform
305.177 +blk; n/a ; Cuneiform_Numbers_And_Punctuation
305.178 +blk; n/a ; Currency_Symbols
305.179 +blk; n/a ; Cypriot_Syllabary
305.180 +blk; n/a ; Cyrillic
305.181 +blk; n/a ; Cyrillic_Extended_A
305.182 +blk; n/a ; Cyrillic_Extended_B
305.183 +blk; n/a ; Cyrillic_Supplement ; Cyrillic_Supplementary
305.184 +blk; n/a ; Deseret
305.185 +blk; n/a ; Devanagari
305.186 +blk; n/a ; Devanagari_Extended
305.187 +blk; n/a ; Dingbats
305.188 +blk; n/a ; Domino_Tiles
305.189 +blk; n/a ; Egyptian_Hieroglyphs
305.190 +blk; n/a ; Emoticons
305.191 +blk; n/a ; Enclosed_Alphanumeric_Supplement
305.192 +blk; n/a ; Enclosed_Alphanumerics
305.193 +blk; n/a ; Enclosed_CJK_Letters_And_Months
305.194 +blk; n/a ; Enclosed_Ideographic_Supplement
305.195 +blk; n/a ; Ethiopic
305.196 +blk; n/a ; Ethiopic_Extended
305.197 +blk; n/a ; Ethiopic_Extended_A
305.198 +blk; n/a ; Ethiopic_Supplement
305.199 +blk; n/a ; General_Punctuation
305.200 +blk; n/a ; Geometric_Shapes
305.201 +blk; n/a ; Georgian
305.202 +blk; n/a ; Georgian_Supplement
305.203 +blk; n/a ; Glagolitic
305.204 +blk; n/a ; Gothic
305.205 +blk; n/a ; Greek_And_Coptic ; Greek
305.206 +blk; n/a ; Greek_Extended
305.207 +blk; n/a ; Gujarati
305.208 +blk; n/a ; Gurmukhi
305.209 +blk; n/a ; Halfwidth_And_Fullwidth_Forms
305.210 +blk; n/a ; Hangul_Compatibility_Jamo
305.211 +blk; n/a ; Hangul_Jamo
305.212 +blk; n/a ; Hangul_Jamo_Extended_A
305.213 +blk; n/a ; Hangul_Jamo_Extended_B
305.214 +blk; n/a ; Hangul_Syllables
305.215 +blk; n/a ; Hanunoo
305.216 +blk; n/a ; Hebrew
305.217 +blk; n/a ; High_Private_Use_Surrogates
305.218 +blk; n/a ; High_Surrogates
305.219 +blk; n/a ; Hiragana
305.220 +blk; n/a ; Ideographic_Description_Characters
305.221 +blk; n/a ; Imperial_Aramaic
305.222 +blk; n/a ; Inscriptional_Pahlavi
305.223 +blk; n/a ; Inscriptional_Parthian
305.224 +blk; n/a ; IPA_Extensions
305.225 +blk; n/a ; Javanese
305.226 +blk; n/a ; Kaithi
305.227 +blk; n/a ; Kana_Supplement
305.228 +blk; n/a ; Kanbun
305.229 +blk; n/a ; Kangxi_Radicals
305.230 +blk; n/a ; Kannada
305.231 +blk; n/a ; Katakana
305.232 +blk; n/a ; Katakana_Phonetic_Extensions
305.233 +blk; n/a ; Kayah_Li
305.234 +blk; n/a ; Kharoshthi
305.235 +blk; n/a ; Khmer
305.236 +blk; n/a ; Khmer_Symbols
305.237 +blk; n/a ; Lao
305.238 +blk; n/a ; Latin_1_Supplement ; Latin_1
305.239 +blk; n/a ; Latin_Extended_A
305.240 +blk; n/a ; Latin_Extended_Additional
305.241 +blk; n/a ; Latin_Extended_B
305.242 +blk; n/a ; Latin_Extended_C
305.243 +blk; n/a ; Latin_Extended_D
305.244 +blk; n/a ; Lepcha
305.245 +blk; n/a ; Letterlike_Symbols
305.246 +blk; n/a ; Limbu
305.247 +blk; n/a ; Linear_B_Ideograms
305.248 +blk; n/a ; Linear_B_Syllabary
305.249 +blk; n/a ; Lisu
305.250 +blk; n/a ; Low_Surrogates
305.251 +blk; n/a ; Lycian
305.252 +blk; n/a ; Lydian
305.253 +blk; n/a ; Mahjong_Tiles
305.254 +blk; n/a ; Malayalam
305.255 +blk; n/a ; Mandaic
305.256 +blk; n/a ; Mathematical_Alphanumeric_Symbols
305.257 +blk; n/a ; Mathematical_Operators
305.258 +blk; n/a ; Meetei_Mayek
305.259 +blk; n/a ; Miscellaneous_Mathematical_Symbols_A
305.260 +blk; n/a ; Miscellaneous_Mathematical_Symbols_B
305.261 +blk; n/a ; Miscellaneous_Symbols
305.262 +blk; n/a ; Miscellaneous_Symbols_And_Arrows
305.263 +blk; n/a ; Miscellaneous_Symbols_And_Pictographs
305.264 +blk; n/a ; Miscellaneous_Technical
305.265 +blk; n/a ; Modifier_Tone_Letters
305.266 +blk; n/a ; Mongolian
305.267 +blk; n/a ; Musical_Symbols
305.268 +blk; n/a ; Myanmar
305.269 +blk; n/a ; Myanmar_Extended_A
305.270 +blk; n/a ; New_Tai_Lue
305.271 +blk; n/a ; NKo
305.272 +blk; n/a ; No_Block
305.273 +blk; n/a ; Number_Forms
305.274 +blk; n/a ; Ogham
305.275 +blk; n/a ; Ol_Chiki
305.276 +blk; n/a ; Old_Italic
305.277 +blk; n/a ; Old_Persian
305.278 +blk; n/a ; Old_South_Arabian
305.279 +blk; n/a ; Old_Turkic
305.280 +blk; n/a ; Optical_Character_Recognition
305.281 +blk; n/a ; Oriya
305.282 +blk; n/a ; Osmanya
305.283 +blk; n/a ; Phags_Pa
305.284 +blk; n/a ; Phaistos_Disc
305.285 +blk; n/a ; Phoenician
305.286 +blk; n/a ; Phonetic_Extensions
305.287 +blk; n/a ; Phonetic_Extensions_Supplement
305.288 +blk; n/a ; Playing_Cards
305.289 +blk; n/a ; Private_Use_Area ; Private_Use
305.290 +blk; n/a ; Rejang
305.291 +blk; n/a ; Rumi_Numeral_Symbols
305.292 +blk; n/a ; Runic
305.293 +blk; n/a ; Samaritan
305.294 +blk; n/a ; Saurashtra
305.295 +blk; n/a ; Shavian
305.296 +blk; n/a ; Sinhala
305.297 +blk; n/a ; Small_Form_Variants
305.298 +blk; n/a ; Spacing_Modifier_Letters
305.299 +blk; n/a ; Specials
305.300 +blk; n/a ; Sundanese
305.301 +blk; n/a ; Superscripts_And_Subscripts
305.302 +blk; n/a ; Supplemental_Arrows_A
305.303 +blk; n/a ; Supplemental_Arrows_B
305.304 +blk; n/a ; Supplemental_Mathematical_Operators
305.305 +blk; n/a ; Supplemental_Punctuation
305.306 +blk; n/a ; Supplementary_Private_Use_Area_A
305.307 +blk; n/a ; Supplementary_Private_Use_Area_B
305.308 +blk; n/a ; Syloti_Nagri
305.309 +blk; n/a ; Syriac
305.310 +blk; n/a ; Tagalog
305.311 +blk; n/a ; Tagbanwa
305.312 +blk; n/a ; Tags
305.313 +blk; n/a ; Tai_Le
305.314 +blk; n/a ; Tai_Tham
305.315 +blk; n/a ; Tai_Viet
305.316 +blk; n/a ; Tai_Xuan_Jing_Symbols
305.317 +blk; n/a ; Tamil
305.318 +blk; n/a ; Telugu
305.319 +blk; n/a ; Thaana
305.320 +blk; n/a ; Thai
305.321 +blk; n/a ; Tibetan
305.322 +blk; n/a ; Tifinagh
305.323 +blk; n/a ; Transport_And_Map_Symbols
305.324 +blk; n/a ; Ugaritic
305.325 +blk; n/a ; Unified_Canadian_Aboriginal_Syllabics; Canadian_Syllabics
305.326 +blk; n/a ; Unified_Canadian_Aboriginal_Syllabics_Extended
305.327 +blk; n/a ; Vai
305.328 +blk; n/a ; Variation_Selectors
305.329 +blk; n/a ; Variation_Selectors_Supplement
305.330 +blk; n/a ; Vedic_Extensions
305.331 +blk; n/a ; Vertical_Forms
305.332 +blk; n/a ; Yi_Radicals
305.333 +blk; n/a ; Yi_Syllables
305.334 +blk; n/a ; Yijing_Hexagram_Symbols
305.335 +
305.336 +# Canonical_Combining_Class (ccc)
305.337 +
305.338 +ccc; 0; NR ; Not_Reordered
305.339 +ccc; 1; OV ; Overlay
305.340 +ccc; 7; NK ; Nukta
305.341 +ccc; 8; KV ; Kana_Voicing
305.342 +ccc; 9; VR ; Virama
305.343 +ccc; 200; ATBL ; Attached_Below_Left
305.344 +ccc; 202; ATB ; Attached_Below
305.345 +ccc; 214; ATA ; Attached_Above
305.346 +ccc; 216; ATAR ; Attached_Above_Right
305.347 +ccc; 218; BL ; Below_Left
305.348 +ccc; 220; B ; Below
305.349 +ccc; 222; BR ; Below_Right
305.350 +ccc; 224; L ; Left
305.351 +ccc; 226; R ; Right
305.352 +ccc; 228; AL ; Above_Left
305.353 +ccc; 230; A ; Above
305.354 +ccc; 232; AR ; Above_Right
305.355 +ccc; 233; DB ; Double_Below
305.356 +ccc; 234; DA ; Double_Above
305.357 +ccc; 240; IS ; Iota_Subscript
305.358 +
305.359 +# Case_Folding (cf)
305.360 +
305.361 +# @missing: 0000..10FFFF; Case_Folding; <code point>
305.362 +
305.363 +# Case_Ignorable (CI)
305.364 +
305.365 +CI ; N ; No ; F ; False
305.366 +CI ; Y ; Yes ; T ; True
305.367 +
305.368 +# Cased (Cased)
305.369 +
305.370 +Cased; N ; No ; F ; False
305.371 +Cased; Y ; Yes ; T ; True
305.372 +
305.373 +# Changes_When_Casefolded (CWCF)
305.374 +
305.375 +CWCF; N ; No ; F ; False
305.376 +CWCF; Y ; Yes ; T ; True
305.377 +
305.378 +# Changes_When_Casemapped (CWCM)
305.379 +
305.380 +CWCM; N ; No ; F ; False
305.381 +CWCM; Y ; Yes ; T ; True
305.382 +
305.383 +# Changes_When_Lowercased (CWL)
305.384 +
305.385 +CWL; N ; No ; F ; False
305.386 +CWL; Y ; Yes ; T ; True
305.387 +
305.388 +# Changes_When_NFKC_Casefolded (CWKCF)
305.389 +
305.390 +CWKCF; N ; No ; F ; False
305.391 +CWKCF; Y ; Yes ; T ; True
305.392 +
305.393 +# Changes_When_Titlecased (CWT)
305.394 +
305.395 +CWT; N ; No ; F ; False
305.396 +CWT; Y ; Yes ; T ; True
305.397 +
305.398 +# Changes_When_Uppercased (CWU)
305.399 +
305.400 +CWU; N ; No ; F ; False
305.401 +CWU; Y ; Yes ; T ; True
305.402 +
305.403 +# Composition_Exclusion (CE)
305.404 +
305.405 +CE ; N ; No ; F ; False
305.406 +CE ; Y ; Yes ; T ; True
305.407 +
305.408 +# Dash (Dash)
305.409 +
305.410 +Dash; N ; No ; F ; False
305.411 +Dash; Y ; Yes ; T ; True
305.412 +
305.413 +# Decomposition_Mapping (dm)
305.414 +
305.415 +# @missing: 0000..10FFFF; Decomposition_Mapping; <code point>
305.416 +
305.417 +# Decomposition_Type (dt)
305.418 +
305.419 +dt ; Can ; Canonical ; can
305.420 +dt ; Com ; Compat ; com
305.421 +dt ; Enc ; Circle ; enc
305.422 +dt ; Fin ; Final ; fin
305.423 +dt ; Font ; font
305.424 +dt ; Fra ; Fraction ; fra
305.425 +dt ; Init ; Initial ; init
305.426 +dt ; Iso ; Isolated ; iso
305.427 +dt ; Med ; Medial ; med
305.428 +dt ; Nar ; Narrow ; nar
305.429 +dt ; Nb ; Nobreak ; nb
305.430 +dt ; None ; none
305.431 +dt ; Sml ; Small ; sml
305.432 +dt ; Sqr ; Square ; sqr
305.433 +dt ; Sub ; sub
305.434 +dt ; Sup ; Super ; sup
305.435 +dt ; Vert ; Vertical ; vert
305.436 +dt ; Wide ; wide
305.437 +
305.438 +# Default_Ignorable_Code_Point (DI)
305.439 +
305.440 +DI ; N ; No ; F ; False
305.441 +DI ; Y ; Yes ; T ; True
305.442 +
305.443 +# Deprecated (Dep)
305.444 +
305.445 +Dep; N ; No ; F ; False
305.446 +Dep; Y ; Yes ; T ; True
305.447 +
305.448 +# Diacritic (Dia)
305.449 +
305.450 +Dia; N ; No ; F ; False
305.451 +Dia; Y ; Yes ; T ; True
305.452 +
305.453 +# East_Asian_Width (ea)
305.454 +
305.455 +ea ; A ; Ambiguous
305.456 +ea ; F ; Fullwidth
305.457 +ea ; H ; Halfwidth
305.458 +ea ; N ; Neutral
305.459 +ea ; Na ; Narrow
305.460 +ea ; W ; Wide
305.461 +
305.462 +# Expands_On_NFC (XO_NFC)
305.463 +
305.464 +XO_NFC; N ; No ; F ; False
305.465 +XO_NFC; Y ; Yes ; T ; True
305.466 +
305.467 +# Expands_On_NFD (XO_NFD)
305.468 +
305.469 +XO_NFD; N ; No ; F ; False
305.470 +XO_NFD; Y ; Yes ; T ; True
305.471 +
305.472 +# Expands_On_NFKC (XO_NFKC)
305.473 +
305.474 +XO_NFKC; N ; No ; F ; False
305.475 +XO_NFKC; Y ; Yes ; T ; True
305.476 +
305.477 +# Expands_On_NFKD (XO_NFKD)
305.478 +
305.479 +XO_NFKD; N ; No ; F ; False
305.480 +XO_NFKD; Y ; Yes ; T ; True
305.481 +
305.482 +# Extender (Ext)
305.483 +
305.484 +Ext; N ; No ; F ; False
305.485 +Ext; Y ; Yes ; T ; True
305.486 +
305.487 +# FC_NFKC_Closure (FC_NFKC)
305.488 +
305.489 +# @missing: 0000..10FFFF; FC_NFKC_Closure; <code point>
305.490 +
305.491 +# Full_Composition_Exclusion (Comp_Ex)
305.492 +
305.493 +Comp_Ex; N ; No ; F ; False
305.494 +Comp_Ex; Y ; Yes ; T ; True
305.495 +
305.496 +# General_Category (gc)
305.497 +
305.498 +gc ; C ; Other # Cc | Cf | Cn | Co | Cs
305.499 +gc ; Cc ; Control ; cntrl
305.500 +gc ; Cf ; Format
305.501 +gc ; Cn ; Unassigned
305.502 +gc ; Co ; Private_Use
305.503 +gc ; Cs ; Surrogate
305.504 +gc ; L ; Letter # Ll | Lm | Lo | Lt | Lu
305.505 +gc ; LC ; Cased_Letter # Ll | Lt | Lu
305.506 +gc ; Ll ; Lowercase_Letter
305.507 +gc ; Lm ; Modifier_Letter
305.508 +gc ; Lo ; Other_Letter
305.509 +gc ; Lt ; Titlecase_Letter
305.510 +gc ; Lu ; Uppercase_Letter
305.511 +gc ; M ; Mark # Mc | Me | Mn
305.512 +gc ; Mc ; Spacing_Mark
305.513 +gc ; Me ; Enclosing_Mark
305.514 +gc ; Mn ; Nonspacing_Mark
305.515 +gc ; N ; Number # Nd | Nl | No
305.516 +gc ; Nd ; Decimal_Number ; digit
305.517 +gc ; Nl ; Letter_Number
305.518 +gc ; No ; Other_Number
305.519 +gc ; P ; Punctuation ; punct # Pc | Pd | Pe | Pf | Pi | Po | Ps
305.520 +gc ; Pc ; Connector_Punctuation
305.521 +gc ; Pd ; Dash_Punctuation
305.522 +gc ; Pe ; Close_Punctuation
305.523 +gc ; Pf ; Final_Punctuation
305.524 +gc ; Pi ; Initial_Punctuation
305.525 +gc ; Po ; Other_Punctuation
305.526 +gc ; Ps ; Open_Punctuation
305.527 +gc ; S ; Symbol # Sc | Sk | Sm | So
305.528 +gc ; Sc ; Currency_Symbol
305.529 +gc ; Sk ; Modifier_Symbol
305.530 +gc ; Sm ; Math_Symbol
305.531 +gc ; So ; Other_Symbol
305.532 +gc ; Z ; Separator # Zl | Zp | Zs
305.533 +gc ; Zl ; Line_Separator
305.534 +gc ; Zp ; Paragraph_Separator
305.535 +gc ; Zs ; Space_Separator
305.536 +
305.537 +# Grapheme_Base (Gr_Base)
305.538 +
305.539 +Gr_Base; N ; No ; F ; False
305.540 +Gr_Base; Y ; Yes ; T ; True
305.541 +
305.542 +# Grapheme_Cluster_Break (GCB)
305.543 +
305.544 +GCB; CN ; Control
305.545 +GCB; CR ; CR
305.546 +GCB; EX ; Extend
305.547 +GCB; L ; L
305.548 +GCB; LF ; LF
305.549 +GCB; LV ; LV
305.550 +GCB; LVT ; LVT
305.551 +GCB; PP ; Prepend
305.552 +GCB; SM ; SpacingMark
305.553 +GCB; T ; T
305.554 +GCB; V ; V
305.555 +GCB; XX ; Other
305.556 +
305.557 +# Grapheme_Extend (Gr_Ext)
305.558 +
305.559 +Gr_Ext; N ; No ; F ; False
305.560 +Gr_Ext; Y ; Yes ; T ; True
305.561 +
305.562 +# Grapheme_Link (Gr_Link)
305.563 +
305.564 +Gr_Link; N ; No ; F ; False
305.565 +Gr_Link; Y ; Yes ; T ; True
305.566 +
305.567 +# Hangul_Syllable_Type (hst)
305.568 +
305.569 +hst; L ; Leading_Jamo
305.570 +hst; LV ; LV_Syllable
305.571 +hst; LVT ; LVT_Syllable
305.572 +hst; NA ; Not_Applicable
305.573 +hst; T ; Trailing_Jamo
305.574 +hst; V ; Vowel_Jamo
305.575 +
305.576 +# Hex_Digit (Hex)
305.577 +
305.578 +Hex; N ; No ; F ; False
305.579 +Hex; Y ; Yes ; T ; True
305.580 +
305.581 +# Hyphen (Hyphen)
305.582 +
305.583 +Hyphen; N ; No ; F ; False
305.584 +Hyphen; Y ; Yes ; T ; True
305.585 +
305.586 +# IDS_Binary_Operator (IDSB)
305.587 +
305.588 +IDSB; N ; No ; F ; False
305.589 +IDSB; Y ; Yes ; T ; True
305.590 +
305.591 +# IDS_Trinary_Operator (IDST)
305.592 +
305.593 +IDST; N ; No ; F ; False
305.594 +IDST; Y ; Yes ; T ; True
305.595 +
305.596 +# ID_Continue (IDC)
305.597 +
305.598 +IDC; N ; No ; F ; False
305.599 +IDC; Y ; Yes ; T ; True
305.600 +
305.601 +# ID_Start (IDS)
305.602 +
305.603 +IDS; N ; No ; F ; False
305.604 +IDS; Y ; Yes ; T ; True
305.605 +
305.606 +# ISO_Comment (isc)
305.607 +
305.608 +# @missing: 0000..10FFFF; ISO_Comment; <none>
305.609 +
305.610 +# Ideographic (Ideo)
305.611 +
305.612 +Ideo; N ; No ; F ; False
305.613 +Ideo; Y ; Yes ; T ; True
305.614 +
305.615 +# Jamo_Short_Name (JSN)
305.616 +
305.617 +# @missing: 0000..10FFFF; Jamo_Short_Name; <none>
305.618 +JSN; A ; A
305.619 +JSN; AE ; AE
305.620 +JSN; B ; B
305.621 +JSN; BB ; BB
305.622 +JSN; BS ; BS
305.623 +JSN; C ; C
305.624 +JSN; D ; D
305.625 +JSN; DD ; DD
305.626 +JSN; E ; E
305.627 +JSN; EO ; EO
305.628 +JSN; EU ; EU
305.629 +JSN; G ; G
305.630 +JSN; GG ; GG
305.631 +JSN; GS ; GS
305.632 +JSN; H ; H
305.633 +JSN; I ; I
305.634 +JSN; J ; J
305.635 +JSN; JJ ; JJ
305.636 +JSN; K ; K
305.637 +JSN; L ; L
305.638 +JSN; LB ; LB
305.639 +JSN; LG ; LG
305.640 +JSN; LH ; LH
305.641 +JSN; LM ; LM
305.642 +JSN; LP ; LP
305.643 +JSN; LS ; LS
305.644 +JSN; LT ; LT
305.645 +JSN; M ; M
305.646 +JSN; N ; N
305.647 +JSN; NG ; NG
305.648 +JSN; NH ; NH
305.649 +JSN; NJ ; NJ
305.650 +JSN; O ; O
305.651 +JSN; OE ; OE
305.652 +JSN; P ; P
305.653 +JSN; R ; R
305.654 +JSN; S ; S
305.655 +JSN; SS ; SS
305.656 +JSN; T ; T
305.657 +JSN; U ; U
305.658 +JSN; WA ; WA
305.659 +JSN; WAE ; WAE
305.660 +JSN; WE ; WE
305.661 +JSN; WEO ; WEO
305.662 +JSN; WI ; WI
305.663 +JSN; YA ; YA
305.664 +JSN; YAE ; YAE
305.665 +JSN; YE ; YE
305.666 +JSN; YEO ; YEO
305.667 +JSN; YI ; YI
305.668 +JSN; YO ; YO
305.669 +JSN; YU ; YU
305.670 +
305.671 +# Join_Control (Join_C)
305.672 +
305.673 +Join_C; N ; No ; F ; False
305.674 +Join_C; Y ; Yes ; T ; True
305.675 +
305.676 +# Joining_Group (jg)
305.677 +
305.678 +jg ; n/a ; Ain
305.679 +jg ; n/a ; Alaph
305.680 +jg ; n/a ; Alef
305.681 +jg ; n/a ; Beh
305.682 +jg ; n/a ; Beth
305.683 +jg ; n/a ; Burushaski_Yeh_Barree
305.684 +jg ; n/a ; Dal
305.685 +jg ; n/a ; Dalath_Rish
305.686 +jg ; n/a ; E
305.687 +jg ; n/a ; Farsi_Yeh
305.688 +jg ; n/a ; Fe
305.689 +jg ; n/a ; Feh
305.690 +jg ; n/a ; Final_Semkath
305.691 +jg ; n/a ; Gaf
305.692 +jg ; n/a ; Gamal
305.693 +jg ; n/a ; Hah
305.694 +jg ; n/a ; He
305.695 +jg ; n/a ; Heh
305.696 +jg ; n/a ; Heh_Goal
305.697 +jg ; n/a ; Heth
305.698 +jg ; n/a ; Kaf
305.699 +jg ; n/a ; Kaph
305.700 +jg ; n/a ; Khaph
305.701 +jg ; n/a ; Knotted_Heh
305.702 +jg ; n/a ; Lam
305.703 +jg ; n/a ; Lamadh
305.704 +jg ; n/a ; Meem
305.705 +jg ; n/a ; Mim
305.706 +jg ; n/a ; No_Joining_Group
305.707 +jg ; n/a ; Noon
305.708 +jg ; n/a ; Nun
305.709 +jg ; n/a ; Nya
305.710 +jg ; n/a ; Pe
305.711 +jg ; n/a ; Qaf
305.712 +jg ; n/a ; Qaph
305.713 +jg ; n/a ; Reh
305.714 +jg ; n/a ; Reversed_Pe
305.715 +jg ; n/a ; Sad
305.716 +jg ; n/a ; Sadhe
305.717 +jg ; n/a ; Seen
305.718 +jg ; n/a ; Semkath
305.719 +jg ; n/a ; Shin
305.720 +jg ; n/a ; Swash_Kaf
305.721 +jg ; n/a ; Syriac_Waw
305.722 +jg ; n/a ; Tah
305.723 +jg ; n/a ; Taw
305.724 +jg ; n/a ; Teh_Marbuta
305.725 +jg ; n/a ; Teh_Marbuta_Goal ; Hamza_On_Heh_Goal
305.726 +jg ; n/a ; Teth
305.727 +jg ; n/a ; Waw
305.728 +jg ; n/a ; Yeh
305.729 +jg ; n/a ; Yeh_Barree
305.730 +jg ; n/a ; Yeh_With_Tail
305.731 +jg ; n/a ; Yudh
305.732 +jg ; n/a ; Yudh_He
305.733 +jg ; n/a ; Zain
305.734 +jg ; n/a ; Zhain
305.735 +
305.736 +# Joining_Type (jt)
305.737 +
305.738 +jt ; C ; Join_Causing
305.739 +jt ; D ; Dual_Joining
305.740 +jt ; L ; Left_Joining
305.741 +jt ; R ; Right_Joining
305.742 +jt ; T ; Transparent
305.743 +jt ; U ; Non_Joining
305.744 +
305.745 +# Line_Break (lb)
305.746 +
305.747 +lb ; AI ; Ambiguous
305.748 +lb ; AL ; Alphabetic
305.749 +lb ; B2 ; Break_Both
305.750 +lb ; BA ; Break_After
305.751 +lb ; BB ; Break_Before
305.752 +lb ; BK ; Mandatory_Break
305.753 +lb ; CB ; Contingent_Break
305.754 +lb ; CL ; Close_Punctuation
305.755 +lb ; CM ; Combining_Mark
305.756 +lb ; CP ; Close_Parenthesis
305.757 +lb ; CR ; Carriage_Return
305.758 +lb ; EX ; Exclamation
305.759 +lb ; GL ; Glue
305.760 +lb ; H2 ; H2
305.761 +lb ; H3 ; H3
305.762 +lb ; HY ; Hyphen
305.763 +lb ; ID ; Ideographic
305.764 +lb ; IN ; Inseparable ; Inseperable
305.765 +lb ; IS ; Infix_Numeric
305.766 +lb ; JL ; JL
305.767 +lb ; JT ; JT
305.768 +lb ; JV ; JV
305.769 +lb ; LF ; Line_Feed
305.770 +lb ; NL ; Next_Line
305.771 +lb ; NS ; Nonstarter
305.772 +lb ; NU ; Numeric
305.773 +lb ; OP ; Open_Punctuation
305.774 +lb ; PO ; Postfix_Numeric
305.775 +lb ; PR ; Prefix_Numeric
305.776 +lb ; QU ; Quotation
305.777 +lb ; SA ; Complex_Context
305.778 +lb ; SG ; Surrogate
305.779 +lb ; SP ; Space
305.780 +lb ; SY ; Break_Symbols
305.781 +lb ; WJ ; Word_Joiner
305.782 +lb ; XX ; Unknown
305.783 +lb ; ZW ; ZWSpace
305.784 +
305.785 +# Logical_Order_Exception (LOE)
305.786 +
305.787 +LOE; N ; No ; F ; False
305.788 +LOE; Y ; Yes ; T ; True
305.789 +
305.790 +# Lowercase (Lower)
305.791 +
305.792 +Lower; N ; No ; F ; False
305.793 +Lower; Y ; Yes ; T ; True
305.794 +
305.795 +# Lowercase_Mapping (lc)
305.796 +
305.797 +# @missing: 0000..10FFFF; Lowercase_Mapping; <code point>
305.798 +
305.799 +# Math (Math)
305.800 +
305.801 +Math; N ; No ; F ; False
305.802 +Math; Y ; Yes ; T ; True
305.803 +
305.804 +# NFC_Quick_Check (NFC_QC)
305.805 +
305.806 +NFC_QC; M ; Maybe
305.807 +NFC_QC; N ; No
305.808 +NFC_QC; Y ; Yes
305.809 +
305.810 +# NFD_Quick_Check (NFD_QC)
305.811 +
305.812 +NFD_QC; N ; No
305.813 +NFD_QC; Y ; Yes
305.814 +
305.815 +# NFKC_Casefold (NFKC_CF)
305.816 +
305.817 +# @missing: 0000..10FFFF; NFKC_Casefold; <code point>
305.818 +
305.819 +# NFKC_Quick_Check (NFKC_QC)
305.820 +
305.821 +NFKC_QC; M ; Maybe
305.822 +NFKC_QC; N ; No
305.823 +NFKC_QC; Y ; Yes
305.824 +
305.825 +# NFKD_Quick_Check (NFKD_QC)
305.826 +
305.827 +NFKD_QC; N ; No
305.828 +NFKD_QC; Y ; Yes
305.829 +
305.830 +# Name (na)
305.831 +
305.832 +# @missing: 0000..10FFFF; Name; <none>
305.833 +
305.834 +# Name_Alias (Name_Alias)
305.835 +
305.836 +# @missing: 0000..10FFFF; Name_Alias; <none>
305.837 +
305.838 +# Noncharacter_Code_Point (NChar)
305.839 +
305.840 +NChar; N ; No ; F ; False
305.841 +NChar; Y ; Yes ; T ; True
305.842 +
305.843 +# Numeric_Type (nt)
305.844 +
305.845 +nt ; De ; Decimal
305.846 +nt ; Di ; Digit
305.847 +nt ; None ; None
305.848 +nt ; Nu ; Numeric
305.849 +
305.850 +# Numeric_Value (nv)
305.851 +
305.852 +# @missing: 0000..10FFFF; Numeric_Value; NaN
305.853 +
305.854 +# Other_Alphabetic (OAlpha)
305.855 +
305.856 +OAlpha; N ; No ; F ; False
305.857 +OAlpha; Y ; Yes ; T ; True
305.858 +
305.859 +# Other_Default_Ignorable_Code_Point (ODI)
305.860 +
305.861 +ODI; N ; No ; F ; False
305.862 +ODI; Y ; Yes ; T ; True
305.863 +
305.864 +# Other_Grapheme_Extend (OGr_Ext)
305.865 +
305.866 +OGr_Ext; N ; No ; F ; False
305.867 +OGr_Ext; Y ; Yes ; T ; True
305.868 +
305.869 +# Other_ID_Continue (OIDC)
305.870 +
305.871 +OIDC; N ; No ; F ; False
305.872 +OIDC; Y ; Yes ; T ; True
305.873 +
305.874 +# Other_ID_Start (OIDS)
305.875 +
305.876 +OIDS; N ; No ; F ; False
305.877 +OIDS; Y ; Yes ; T ; True
305.878 +
305.879 +# Other_Lowercase (OLower)
305.880 +
305.881 +OLower; N ; No ; F ; False
305.882 +OLower; Y ; Yes ; T ; True
305.883 +
305.884 +# Other_Math (OMath)
305.885 +
305.886 +OMath; N ; No ; F ; False
305.887 +OMath; Y ; Yes ; T ; True
305.888 +
305.889 +# Other_Uppercase (OUpper)
305.890 +
305.891 +OUpper; N ; No ; F ; False
305.892 +OUpper; Y ; Yes ; T ; True
305.893 +
305.894 +# Pattern_Syntax (Pat_Syn)
305.895 +
305.896 +Pat_Syn; N ; No ; F ; False
305.897 +Pat_Syn; Y ; Yes ; T ; True
305.898 +
305.899 +# Pattern_White_Space (Pat_WS)
305.900 +
305.901 +Pat_WS; N ; No ; F ; False
305.902 +Pat_WS; Y ; Yes ; T ; True
305.903 +
305.904 +# Quotation_Mark (QMark)
305.905 +
305.906 +QMark; N ; No ; F ; False
305.907 +QMark; Y ; Yes ; T ; True
305.908 +
305.909 +# Radical (Radical)
305.910 +
305.911 +Radical; N ; No ; F ; False
305.912 +Radical; Y ; Yes ; T ; True
305.913 +
305.914 +# STerm (STerm)
305.915 +
305.916 +STerm; N ; No ; F ; False
305.917 +STerm; Y ; Yes ; T ; True
305.918 +
305.919 +# Script (sc)
305.920 +
305.921 +sc ; Arab ; Arabic
305.922 +sc ; Armi ; Imperial_Aramaic
305.923 +sc ; Armn ; Armenian
305.924 +sc ; Avst ; Avestan
305.925 +sc ; Bali ; Balinese
305.926 +sc ; Bamu ; Bamum
305.927 +sc ; Batk ; Batak
305.928 +sc ; Beng ; Bengali
305.929 +sc ; Bopo ; Bopomofo
305.930 +sc ; Brah ; Brahmi
305.931 +sc ; Brai ; Braille
305.932 +sc ; Bugi ; Buginese
305.933 +sc ; Buhd ; Buhid
305.934 +sc ; Cans ; Canadian_Aboriginal
305.935 +sc ; Cari ; Carian
305.936 +sc ; Cham ; Cham
305.937 +sc ; Cher ; Cherokee
305.938 +sc ; Copt ; Coptic ; Qaac
305.939 +sc ; Cprt ; Cypriot
305.940 +sc ; Cyrl ; Cyrillic
305.941 +sc ; Deva ; Devanagari
305.942 +sc ; Dsrt ; Deseret
305.943 +sc ; Egyp ; Egyptian_Hieroglyphs
305.944 +sc ; Ethi ; Ethiopic
305.945 +sc ; Geor ; Georgian
305.946 +sc ; Glag ; Glagolitic
305.947 +sc ; Goth ; Gothic
305.948 +sc ; Grek ; Greek
305.949 +sc ; Gujr ; Gujarati
305.950 +sc ; Guru ; Gurmukhi
305.951 +sc ; Hang ; Hangul
305.952 +sc ; Hani ; Han
305.953 +sc ; Hano ; Hanunoo
305.954 +sc ; Hebr ; Hebrew
305.955 +sc ; Hira ; Hiragana
305.956 +sc ; Hrkt ; Katakana_Or_Hiragana
305.957 +sc ; Ital ; Old_Italic
305.958 +sc ; Java ; Javanese
305.959 +sc ; Kali ; Kayah_Li
305.960 +sc ; Kana ; Katakana
305.961 +sc ; Khar ; Kharoshthi
305.962 +sc ; Khmr ; Khmer
305.963 +sc ; Knda ; Kannada
305.964 +sc ; Kthi ; Kaithi
305.965 +sc ; Lana ; Tai_Tham
305.966 +sc ; Laoo ; Lao
305.967 +sc ; Latn ; Latin
305.968 +sc ; Lepc ; Lepcha
305.969 +sc ; Limb ; Limbu
305.970 +sc ; Linb ; Linear_B
305.971 +sc ; Lisu ; Lisu
305.972 +sc ; Lyci ; Lycian
305.973 +sc ; Lydi ; Lydian
305.974 +sc ; Mand ; Mandaic
305.975 +sc ; Mlym ; Malayalam
305.976 +sc ; Mong ; Mongolian
305.977 +sc ; Mtei ; Meetei_Mayek
305.978 +sc ; Mymr ; Myanmar
305.979 +sc ; Nkoo ; Nko
305.980 +sc ; Ogam ; Ogham
305.981 +sc ; Olck ; Ol_Chiki
305.982 +sc ; Orkh ; Old_Turkic
305.983 +sc ; Orya ; Oriya
305.984 +sc ; Osma ; Osmanya
305.985 +sc ; Phag ; Phags_Pa
305.986 +sc ; Phli ; Inscriptional_Pahlavi
305.987 +sc ; Phnx ; Phoenician
305.988 +sc ; Prti ; Inscriptional_Parthian
305.989 +sc ; Rjng ; Rejang
305.990 +sc ; Runr ; Runic
305.991 +sc ; Samr ; Samaritan
305.992 +sc ; Sarb ; Old_South_Arabian
305.993 +sc ; Saur ; Saurashtra
305.994 +sc ; Shaw ; Shavian
305.995 +sc ; Sinh ; Sinhala
305.996 +sc ; Sund ; Sundanese
305.997 +sc ; Sylo ; Syloti_Nagri
305.998 +sc ; Syrc ; Syriac
305.999 +sc ; Tagb ; Tagbanwa
305.1000 +sc ; Tale ; Tai_Le
305.1001 +sc ; Talu ; New_Tai_Lue
305.1002 +sc ; Taml ; Tamil
305.1003 +sc ; Tavt ; Tai_Viet
305.1004 +sc ; Telu ; Telugu
305.1005 +sc ; Tfng ; Tifinagh
305.1006 +sc ; Tglg ; Tagalog
305.1007 +sc ; Thaa ; Thaana
305.1008 +sc ; Thai ; Thai
305.1009 +sc ; Tibt ; Tibetan
305.1010 +sc ; Ugar ; Ugaritic
305.1011 +sc ; Vaii ; Vai
305.1012 +sc ; Xpeo ; Old_Persian
305.1013 +sc ; Xsux ; Cuneiform
305.1014 +sc ; Yiii ; Yi
305.1015 +sc ; Zinh ; Inherited ; Qaai
305.1016 +sc ; Zyyy ; Common
305.1017 +sc ; Zzzz ; Unknown
305.1018 +
305.1019 +# Sentence_Break (SB)
305.1020 +
305.1021 +SB ; AT ; ATerm
305.1022 +SB ; CL ; Close
305.1023 +SB ; CR ; CR
305.1024 +SB ; EX ; Extend
305.1025 +SB ; FO ; Format
305.1026 +SB ; LE ; OLetter
305.1027 +SB ; LF ; LF
305.1028 +SB ; LO ; Lower
305.1029 +SB ; NU ; Numeric
305.1030 +SB ; SC ; SContinue
305.1031 +SB ; SE ; Sep
305.1032 +SB ; SP ; Sp
305.1033 +SB ; ST ; STerm
305.1034 +SB ; UP ; Upper
305.1035 +SB ; XX ; Other
305.1036 +
305.1037 +# Simple_Case_Folding (scf)
305.1038 +
305.1039 +# @missing: 0000..10FFFF; Simple_Case_Folding; <code point>
305.1040 +
305.1041 +# Simple_Lowercase_Mapping (slc)
305.1042 +
305.1043 +# @missing: 0000..10FFFF; Simple_Lowercase_Mapping; <code point>
305.1044 +
305.1045 +# Simple_Titlecase_Mapping (stc)
305.1046 +
305.1047 +# @missing: 0000..10FFFF; Simple_Titlecase_Mapping; <code point>
305.1048 +
305.1049 +# Simple_Uppercase_Mapping (suc)
305.1050 +
305.1051 +# @missing: 0000..10FFFF; Simple_Uppercase_Mapping; <code point>
305.1052 +
305.1053 +# Soft_Dotted (SD)
305.1054 +
305.1055 +SD ; N ; No ; F ; False
305.1056 +SD ; Y ; Yes ; T ; True
305.1057 +
305.1058 +# Terminal_Punctuation (Term)
305.1059 +
305.1060 +Term; N ; No ; F ; False
305.1061 +Term; Y ; Yes ; T ; True
305.1062 +
305.1063 +# Titlecase_Mapping (tc)
305.1064 +
305.1065 +# @missing: 0000..10FFFF; Titlecase_Mapping; <code point>
305.1066 +
305.1067 +# Unicode_1_Name (na1)
305.1068 +
305.1069 +# @missing: 0000..10FFFF; Unicode_1_Name; <none>
305.1070 +
305.1071 +# Unified_Ideograph (UIdeo)
305.1072 +
305.1073 +UIdeo; N ; No ; F ; False
305.1074 +UIdeo; Y ; Yes ; T ; True
305.1075 +
305.1076 +# Uppercase (Upper)
305.1077 +
305.1078 +Upper; N ; No ; F ; False
305.1079 +Upper; Y ; Yes ; T ; True
305.1080 +
305.1081 +# Uppercase_Mapping (uc)
305.1082 +
305.1083 +# @missing: 0000..10FFFF; Uppercase_Mapping; <code point>
305.1084 +
305.1085 +# Variation_Selector (VS)
305.1086 +
305.1087 +VS ; N ; No ; F ; False
305.1088 +VS ; Y ; Yes ; T ; True
305.1089 +
305.1090 +# White_Space (WSpace)
305.1091 +
305.1092 +WSpace; N ; No ; F ; False
305.1093 +WSpace; Y ; Yes ; T ; True
305.1094 +
305.1095 +# Word_Break (WB)
305.1096 +
305.1097 +WB ; CR ; CR
305.1098 +WB ; EX ; ExtendNumLet
305.1099 +WB ; Extend ; Extend
305.1100 +WB ; FO ; Format
305.1101 +WB ; KA ; Katakana
305.1102 +WB ; LE ; ALetter
305.1103 +WB ; LF ; LF
305.1104 +WB ; MB ; MidNumLet
305.1105 +WB ; ML ; MidLetter
305.1106 +WB ; MN ; MidNum
305.1107 +WB ; NL ; Newline
305.1108 +WB ; NU ; Numeric
305.1109 +WB ; XX ; Other
305.1110 +
305.1111 +# XID_Continue (XIDC)
305.1112 +
305.1113 +XIDC; N ; No ; F ; False
305.1114 +XIDC; Y ; Yes ; T ; True
305.1115 +
305.1116 +# XID_Start (XIDS)
305.1117 +
305.1118 +XIDS; N ; No ; F ; False
305.1119 +XIDS; Y ; Yes ; T ; True
305.1120 +
305.1121 +# cjkAccountingNumeric (cjkAccountingNumeric)
305.1122 +
305.1123 +# @missing: 0000..10FFFF; cjkAccountingNumeric; NaN
305.1124 +
305.1125 +# cjkCompatibilityVariant (cjkCompatibilityVariant)
305.1126 +
305.1127 +# @missing: 0000..10FFFF; cjkCompatibilityVariant; <code point>
305.1128 +
305.1129 +# cjkIICore (cjkIICore)
305.1130 +
305.1131 +# @missing: 0000..10FFFF; cjkIICore; <none>
305.1132 +
305.1133 +# cjkIRG_GSource (cjkIRG_GSource)
305.1134 +
305.1135 +# @missing: 0000..10FFFF; cjkIRG_GSource; <none>
305.1136 +
305.1137 +# cjkIRG_HSource (cjkIRG_HSource)
305.1138 +
305.1139 +# @missing: 0000..10FFFF; cjkIRG_HSource; <none>
305.1140 +
305.1141 +# cjkIRG_JSource (cjkIRG_JSource)
305.1142 +
305.1143 +# @missing: 0000..10FFFF; cjkIRG_JSource; <none>
305.1144 +
305.1145 +# cjkIRG_KPSource (cjkIRG_KPSource)
305.1146 +
305.1147 +# @missing: 0000..10FFFF; cjkIRG_KPSource; <none>
305.1148 +
305.1149 +# cjkIRG_KSource (cjkIRG_KSource)
305.1150 +
305.1151 +# @missing: 0000..10FFFF; cjkIRG_KSource; <none>
305.1152 +
305.1153 +# cjkIRG_MSource (cjkIRG_MSource)
305.1154 +
305.1155 +# @missing: 0000..10FFFF; cjkIRG_MSource; <none>
305.1156 +
305.1157 +# cjkIRG_TSource (cjkIRG_TSource)
305.1158 +
305.1159 +# @missing: 0000..10FFFF; cjkIRG_TSource; <none>
305.1160 +
305.1161 +# cjkIRG_USource (cjkIRG_USource)
305.1162 +
305.1163 +# @missing: 0000..10FFFF; cjkIRG_USource; <none>
305.1164 +
305.1165 +# cjkIRG_VSource (cjkIRG_VSource)
305.1166 +
305.1167 +# @missing: 0000..10FFFF; cjkIRG_VSource; <none>
305.1168 +
305.1169 +# cjkOtherNumeric (cjkOtherNumeric)
305.1170 +
305.1171 +# @missing: 0000..10FFFF; cjkOtherNumeric; NaN
305.1172 +
305.1173 +# cjkPrimaryNumeric (cjkPrimaryNumeric)
305.1174 +
305.1175 +# @missing: 0000..10FFFF; cjkPrimaryNumeric; NaN
305.1176 +
305.1177 +# cjkRSUnicode (cjkRSUnicode)
305.1178 +
305.1179 +# @missing: 0000..10FFFF; cjkRSUnicode; <none>
305.1180 +
305.1181 +# EOF
306.1 --- a/test/java/lang/Double/ParseDouble.java Tue Apr 19 16:01:27 2011 -0700
306.2 +++ b/test/java/lang/Double/ParseDouble.java Tue Apr 26 15:48:03 2011 -0700
306.3 @@ -23,7 +23,7 @@
306.4
306.5 /*
306.6 * @test
306.7 - * @bug 4160406 4705734 4707389 4826774 4895911 4421494
306.8 + * @bug 4160406 4705734 4707389 4826774 4895911 4421494 7021568
306.9 * @summary Test for Double.parseDouble method and acceptance regex
306.10 */
306.11
306.12 @@ -581,6 +581,31 @@
306.13 }
306.14 }
306.15
306.16 +
306.17 + private static void testStrictness() {
306.18 + final double expected = 0x0.0000008000001p-1022;
306.19 + boolean failed = false;
306.20 + double conversion = 0.0;
306.21 + double sum = 0.0; // Prevent conversion from being optimized away
306.22 +
306.23 + //2^-1047 + 2^-1075
306.24 + String decimal = "6.631236871469758276785396630275967243399099947355303144249971758736286630139265439618068200788048744105960420552601852889715006376325666595539603330361800519107591783233358492337208057849499360899425128640718856616503093444922854759159988160304439909868291973931426625698663157749836252274523485312442358651207051292453083278116143932569727918709786004497872322193856150225415211997283078496319412124640111777216148110752815101775295719811974338451936095907419622417538473679495148632480391435931767981122396703443803335529756003353209830071832230689201383015598792184172909927924176339315507402234836120730914783168400715462440053817592702766213559042115986763819482654128770595766806872783349146967171293949598850675682115696218943412532098591327667236328125E-316";
306.25 +
306.26 + for(int i = 0; i <= 12_000; i++) {
306.27 + conversion = Double.parseDouble(decimal);
306.28 + sum += conversion;
306.29 + if (conversion != expected) {
306.30 + failed = true;
306.31 + System.out.printf("Iteration %d converts as %a%n",
306.32 + i, conversion);
306.33 + }
306.34 + }
306.35 +
306.36 + System.out.println("Sum = " + sum);
306.37 + if (failed)
306.38 + throw new RuntimeException("Inconsistent conversion");
306.39 + }
306.40 +
306.41 public static void main(String[] args) throws Exception {
306.42 rudimentaryTest();
306.43
306.44 @@ -595,5 +620,6 @@
306.45 testRegex(paddedBadStrings, true);
306.46
306.47 testSubnormalPowers();
306.48 + testStrictness();
306.49 }
306.50 }
307.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
307.2 +++ b/test/java/lang/Math/RoundTests.java Tue Apr 26 15:48:03 2011 -0700
307.3 @@ -0,0 +1,98 @@
307.4 +/*
307.5 + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
307.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
307.7 + *
307.8 + * This code is free software; you can redistribute it and/or modify it
307.9 + * under the terms of the GNU General Public License version 2 only, as
307.10 + * published by the Free Software Foundation.
307.11 + *
307.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
307.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
307.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
307.15 + * version 2 for more details (a copy is included in the LICENSE file that
307.16 + * accompanied this code).
307.17 + *
307.18 + * You should have received a copy of the GNU General Public License version
307.19 + * 2 along with this work; if not, write to the Free Software Foundation,
307.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
307.21 + *
307.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
307.23 + * or visit www.oracle.com if you need additional information or have any
307.24 + * questions.
307.25 + */
307.26 +
307.27 +/*
307.28 + * @test
307.29 + * @bug 6430675
307.30 + * @summary Check for correct implementation of {Math, StrictMath}.round
307.31 + */
307.32 +public class RoundTests {
307.33 + public static void main(String... args) {
307.34 + int failures = 0;
307.35 +
307.36 + failures += testNearFloatHalfCases();
307.37 + failures += testNearDoubleHalfCases();
307.38 +
307.39 + if (failures > 0) {
307.40 + System.err.println("Testing {Math, StrictMath}.round incurred "
307.41 + + failures + " failures.");
307.42 + throw new RuntimeException();
307.43 + }
307.44 + }
307.45 +
307.46 + private static int testNearDoubleHalfCases() {
307.47 + int failures = 0;
307.48 + double [][] testCases = {
307.49 + {+0x1.fffffffffffffp-2, 0.0},
307.50 + {+0x1.0p-1, 1.0}, // +0.5
307.51 + {+0x1.0000000000001p-1, 1.0},
307.52 +
307.53 + {-0x1.fffffffffffffp-2, 0.0},
307.54 + {-0x1.0p-1, 0.0}, // -0.5
307.55 + {-0x1.0000000000001p-1, -1.0},
307.56 + };
307.57 +
307.58 + for(double[] testCase : testCases) {
307.59 + failures += testNearHalfCases(testCase[0], (long)testCase[1]);
307.60 + }
307.61 +
307.62 + return failures;
307.63 + }
307.64 +
307.65 + private static int testNearHalfCases(double input, double expected) {
307.66 + int failures = 0;
307.67 +
307.68 + failures += Tests.test("Math.round", input, Math.round(input), expected);
307.69 + failures += Tests.test("StrictMath.round", input, StrictMath.round(input), expected);
307.70 +
307.71 + return failures;
307.72 + }
307.73 +
307.74 + private static int testNearFloatHalfCases() {
307.75 + int failures = 0;
307.76 + float [][] testCases = {
307.77 + {+0x1.fffffep-2f, 0.0f},
307.78 + {+0x1.0p-1f, 1.0f}, // +0.5
307.79 + {+0x1.000002p-1f, 1.0f},
307.80 +
307.81 + {-0x1.fffffep-2f, 0.0f},
307.82 + {-0x1.0p-1f, 0.0f}, // -0.5
307.83 + {-0x1.000002p-1f, -1.0f},
307.84 + };
307.85 +
307.86 + for(float[] testCase : testCases) {
307.87 + failures += testNearHalfCases(testCase[0], (int)testCase[1]);
307.88 + }
307.89 +
307.90 + return failures;
307.91 + }
307.92 +
307.93 + private static int testNearHalfCases(float input, float expected) {
307.94 + int failures = 0;
307.95 +
307.96 + failures += Tests.test("Math.round", input, Math.round(input), expected);
307.97 + failures += Tests.test("StrictMath.round", input, StrictMath.round(input), expected);
307.98 +
307.99 + return failures;
307.100 + }
307.101 +}
308.1 --- a/test/java/lang/invoke/ClassValueTest.java Tue Apr 19 16:01:27 2011 -0700
308.2 +++ b/test/java/lang/invoke/ClassValueTest.java Tue Apr 26 15:48:03 2011 -0700
308.3 @@ -52,9 +52,9 @@
308.4 static String nameForCV1(Class<?> type) {
308.5 return "CV1:" + type.getName();
308.6 }
308.7 - static int countForCV1;
308.8 - static final ClassValue<String> CV1 = new CV1();
308.9 - private static class CV1 extends ClassValue<String> {
308.10 + int countForCV1;
308.11 + final ClassValue<String> CV1 = new CV1();
308.12 + private class CV1 extends ClassValue<String> {
308.13 protected String computeValue(Class<?> type) {
308.14 countForCV1++;
308.15 return nameForCV1(type);
308.16 @@ -103,8 +103,8 @@
308.17 static String nameForCVN(Class<?> type, int n) {
308.18 return "CV[" + n + "]" + type.getName();
308.19 }
308.20 - static int countForCVN;
308.21 - static class CVN extends ClassValue<String> {
308.22 + int countForCVN;
308.23 + class CVN extends ClassValue<String> {
308.24 final int n;
308.25 CVN(int n) { this.n = n; }
308.26 protected String computeValue(Class<?> type) {
309.1 --- a/test/java/lang/reflect/Generics/Probe.java Tue Apr 19 16:01:27 2011 -0700
309.2 +++ b/test/java/lang/reflect/Generics/Probe.java Tue Apr 26 15:48:03 2011 -0700
309.3 @@ -38,12 +38,12 @@
309.4 "java.util.concurrent.ConcurrentHashMap$KeyIterator",
309.5 "java.util.concurrent.ConcurrentHashMap$ValueIterator",
309.6 "java.util.AbstractList$ListItr",
309.7 - "java.util.EnumMap$EntryIterator",
309.8 - "java.util.EnumMap$KeyIterator",
309.9 - "java.util.EnumMap$ValueIterator",
309.10 - "java.util.IdentityHashMap$EntryIterator",
309.11 - "java.util.IdentityHashMap$KeyIterator",
309.12 - "java.util.IdentityHashMap$ValueIterator",
309.13 +// "java.util.EnumMap$EntryIterator",
309.14 +// "java.util.EnumMap$KeyIterator",
309.15 +// "java.util.EnumMap$ValueIterator",
309.16 +// "java.util.IdentityHashMap$EntryIterator",
309.17 +// "java.util.IdentityHashMap$KeyIterator",
309.18 +// "java.util.IdentityHashMap$ValueIterator",
309.19 "java.util.WeakHashMap$EntryIterator",
309.20 "java.util.WeakHashMap$KeyIterator",
309.21 "java.util.WeakHashMap$ValueIterator",
310.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
310.2 +++ b/test/java/math/BigDecimal/DivideMcTests.java Tue Apr 26 15:48:03 2011 -0700
310.3 @@ -0,0 +1,5797 @@
310.4 +/*
310.5 + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
310.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
310.7 + *
310.8 + * This code is free software; you can redistribute it and/or modify it
310.9 + * under the terms of the GNU General Public License version 2 only, as
310.10 + * published by the Free Software Foundation.
310.11 + *
310.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
310.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
310.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
310.15 + * version 2 for more details (a copy is included in the LICENSE file that
310.16 + * accompanied this code).
310.17 + *
310.18 + * You should have received a copy of the GNU General Public License version
310.19 + * 2 along with this work; if not, write to the Free Software Foundation,
310.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
310.21 + *
310.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
310.23 + * or visit www.oracle.com if you need additional information or have any
310.24 + * questions.
310.25 + */
310.26 +
310.27 +/*
310.28 + * @test
310.29 + * @bug 7036582
310.30 + * @summary Some tests for the divide(..,MathContext) method.
310.31 + * @run main DivideMcTests
310.32 + * @run main/othervm -XX:+AggressiveOpts DivideMcTests
310.33 + * @author Sergey V. Kuksenko
310.34 + */
310.35 +
310.36 +import java.math.BigDecimal;
310.37 +import java.math.MathContext;
310.38 +import java.math.RoundingMode;
310.39 +
310.40 +
310.41 +public class DivideMcTests {
310.42 +
310.43 + static String[] value = new String[75];
310.44 + static String[][] results = new String[75][75];
310.45 + static {
310.46 + value[0]="11061";
310.47 + value[1]="5030285645";
310.48 + value[2]="224198292018431";
310.49 + value[3]="19226185404220649458";
310.50 + value[4]="2754593222460641763294400";
310.51 + value[5]="88290e4";
310.52 + value[6]="14207e-4";
310.53 + value[7]="9206524943e4";
310.54 + value[8]="9637167289e-4";
310.55 + value[9]="987673128759528e4";
310.56 + value[10]="270627774630281e-4";
310.57 + value[11]="81503625886547904651e4";
310.58 + value[12]="60700032235397315737e-4";
310.59 + value[13]="6477954854329556663533122e4";
310.60 + value[14]="8056417378028557868905113e-4";
310.61 + value[15]="74996e8";
310.62 + value[16]="65282e-8";
310.63 + value[17]="6336626690e8";
310.64 + value[18]="8318166778e-8";
310.65 + value[19]="983114227763768e8";
310.66 + value[20]="245802997834566e-8";
310.67 + value[21]="52727924122290902686e8";
310.68 + value[22]="42785567085625398961e-8";
310.69 + value[23]="4810906998143118279742863e8";
310.70 + value[24]="8077506080975981172874361e-8";
310.71 + value[25]="80689e12";
310.72 + value[26]="30125e-12";
310.73 + value[27]="6921467144e12";
310.74 + value[28]="1953347181e-12";
310.75 + value[29]="405471649883944e12";
310.76 + value[30]="866720590936024e-12";
310.77 + value[31]="33231666378140173438e12";
310.78 + value[32]="42631490906110209257e-12";
310.79 + value[33]="7723154992826793726050991e12";
310.80 + value[34]="1611437259018380210686834e-12";
310.81 + value[35]="65645e16";
310.82 + value[36]="31153e-16";
310.83 + value[37]="7758733150e16";
310.84 + value[38]="6365465077e-16";
310.85 + value[39]="727973863299662e16";
310.86 + value[40]="351084160935215e-16";
310.87 + value[41]="45470432070181568402e16";
310.88 + value[42]="97216256670931719037e-16";
310.89 + value[43]="2520581904836081418366563e16";
310.90 + value[44]="3700768934485477578987416e-16";
310.91 + value[45]="28736e20";
310.92 + value[46]="52779e-20";
310.93 + value[47]="7904805864e20";
310.94 + value[48]="6373815349e-20";
310.95 + value[49]="186651310031326e20";
310.96 + value[50]="189125880591366e-20";
310.97 + value[51]="74987916068454915171e20";
310.98 + value[52]="10554589082317914511e-20";
310.99 + value[53]="3599986721169840668392202e20";
310.100 + value[54]="2588106172836128849130551e-20";
310.101 + value[55]="71080e24";
310.102 + value[56]="61576e-24";
310.103 + value[57]="7086656363e24";
310.104 + value[58]="7703864845e-24";
310.105 + value[59]="361167296280301e24";
310.106 + value[60]="149150690375117e-24";
310.107 + value[61]="78129219923655854302e24";
310.108 + value[62]="20861932490694515212e-24";
310.109 + value[63]="9185868654811652011998047e24";
310.110 + value[64]="1996563690880014012200226e-24";
310.111 + value[65]="84665e28";
310.112 + value[66]="94968e-28";
310.113 + value[67]="2622821029e28";
310.114 + value[68]="4451579486e-28";
310.115 + value[69]="590522407411869e28";
310.116 + value[70]="606293232614518e-28";
310.117 + value[71]="96628087822208148505e28";
310.118 + value[72]="24875240094942654314e-28";
310.119 + value[73]="5099400093819597146233149e28";
310.120 + value[74]="8906650752845770170008864e-28";
310.121 + //--------------------------------------------
310.122 + initResults1();
310.123 + initResults2();
310.124 + }
310.125 +
310.126 + private static void initResults1() {
310.127 + results[0][0]="1";
310.128 + results[0][1]="0.000002198881093560642";
310.129 + results[0][2]="4.933579065397471E-11";
310.130 + results[0][3]="5.753091300977375E-16";
310.131 + results[0][4]="4.015474920147867E-21";
310.132 + results[0][5]="0.00001252803261977574";
310.133 + results[0][6]="7785.598648553530";
310.134 + results[0][7]="1.201430514605841E-10";
310.135 + results[0][8]="0.01147743903192921";
310.136 + results[0][9]="1.119904923797219E-15";
310.137 + results[0][10]="4.087163638363069E-7";
310.138 + results[0][11]="1.357117536758031E-20";
310.139 + results[0][12]="1.822239559462666E-12";
310.140 + results[0][13]="1.707483341383177E-25";
310.141 + results[0][14]="1.372942771084022E-17";
310.142 + results[0][15]="1.474878660195210E-9";
310.143 + results[0][16]="16943414.72381361";
310.144 + results[0][17]="1.745565983468090E-14";
310.145 + results[0][18]="132.9740109233477";
310.146 + results[0][19]="1.125098151123273E-19";
310.147 + results[0][20]="0.004499945117611804";
310.148 + results[0][21]="2.097749946374985E-24";
310.149 + results[0][22]="2.585217575324869E-8";
310.150 + results[0][23]="2.299150660004288E-29";
310.151 + results[0][24]="1.369358300583728E-13";
310.152 + results[0][25]="1.370818822887878E-13";
310.153 + results[0][26]="367170124481.3278";
310.154 + results[0][27]="1.598071589430057E-18";
310.155 + results[0][28]="5662587.842852089";
310.156 + results[0][29]="2.727934247231818E-23";
310.157 + results[0][30]="12.76189825841631";
310.158 + results[0][31]="3.328451806821200E-28";
310.159 + results[0][32]="0.0002594560913752765";
310.160 + results[0][33]="1.432186717769276E-33";
310.161 + results[0][34]="6.864058738928437E-9";
310.162 + results[0][35]="1.684972198948892E-17";
310.163 + results[0][36]="3550540878888069";
310.164 + results[0][37]="1.425619335806130E-22";
310.165 + results[0][38]="17376577934.52694";
310.166 + results[0][39]="1.519422682273810E-27";
310.167 + results[0][40]="315052.6634564146";
310.168 + results[0][41]="2.432569803367569E-32";
310.169 + results[0][42]="1.137772670824026";
310.170 + results[0][43]="4.388272398043467E-37";
310.171 + results[0][44]="0.00002988838318687904";
310.172 + results[0][45]="3.849178730512249E-21";
310.173 + results[0][46]="2.095719888592054E+19";
310.174 + results[0][47]="1.399275351008165E-26";
310.175 + results[0][48]="173538130528606.9";
310.176 + results[0][49]="5.926023234524105E-31";
310.177 + results[0][50]="5848485656.967753";
310.178 + results[0][51]="1.475037656720937E-36";
310.179 + results[0][52]="104798.0164242535";
310.180 + results[0][53]="3.072511333154488E-41";
310.181 + results[0][54]="0.4273781391232109";
310.182 + results[0][55]="1.556133933595948E-25";
310.183 + results[0][56]="1.796316746784461E+23";
310.184 + results[0][57]="1.560820707738894E-30";
310.185 + results[0][58]="1.435772852009322E+18";
310.186 + results[0][59]="3.062569649555309E-35";
310.187 + results[0][60]="74159898101586.80";
310.188 + results[0][61]="1.415731529229177E-40";
310.189 + results[0][62]="530200162.6615257";
310.190 + results[0][63]="1.204132174718842E-45";
310.191 + results[0][64]="5540.018608234184";
310.192 + results[0][65]="1.306443040217327E-29";
310.193 + results[0][66]="1.164708112206217E+27";
310.194 + results[0][67]="4.217214929154817E-34";
310.195 + results[0][68]="2.484736043641657E+22";
310.196 + results[0][69]="1.873087263272185E-39";
310.197 + results[0][70]="1.824364747121068E+17";
310.198 + results[0][71]="1.144698218633054E-44";
310.199 + results[0][72]="4446590247082.196";
310.200 + results[0][73]="2.169078675235893E-49";
310.201 + results[0][74]="12418809.61422664";
310.202 + results[1][0]="454776.7511979025";
310.203 + results[1][1]="1";
310.204 + results[1][2]="0.00002243677059139446";
310.205 + results[1][3]="2.616372171203405E-10";
310.206 + results[1][4]="1.826144638701504E-15";
310.207 + results[1][5]="5.697457973722958";
310.208 + results[1][6]="3540709259.519955";
310.209 + results[1][7]="0.00005463826662224685";
310.210 + results[1][8]="5219.672435012765";
310.211 + results[1][9]="5.093067228950338E-10";
310.212 + results[1][10]="0.1858747001068956";
310.213 + results[1][11]="6.171855043605175E-15";
310.214 + results[1][12]="8.287121867567282E-7";
310.215 + results[1][13]="7.765237267187802E-20";
310.216 + results[1][14]="6.243824530142372E-12";
310.217 + results[1][15]="0.0006707405254946931";
310.218 + results[1][16]="7705471102294.660";
310.219 + results[1][17]="7.938428269631898E-9";
310.220 + results[1][18]="60473488.68147447";
310.221 + results[1][19]="5.116684819466090E-14";
310.222 + results[1][20]="2046.470421156359";
310.223 + results[1][21]="9.540079054379898E-19";
310.224 + results[1][22]="0.01175696850045963";
310.225 + results[1][23]="1.045600267671264E-23";
310.226 + results[1][24]="6.227523191653488E-8";
310.227 + results[1][25]="6.234165307538822E-8";
310.228 + results[1][26]="1.669804363485477E+17";
310.229 + results[1][27]="7.267658056226699E-13";
310.230 + results[1][28]="2575213302545.012";
310.231 + results[1][29]="1.240601074437582E-17";
310.232 + results[1][30]="5803814.629080740";
310.233 + results[1][31]="1.513702499224934E-22";
310.234 + results[1][32]="117.9945983141544";
310.235 + results[1][33]="6.513252226158986E-28";
310.236 + results[1][34]="0.003121614333321446";
310.237 + results[1][35]="7.662861824967629E-12";
310.238 + results[1][36]="1.614703445896061E+21";
310.239 + results[1][37]="6.483385299828233E-17";
310.240 + results[1][38]="7902463660001319";
310.241 + results[1][39]="6.909981111408860E-22";
310.242 + results[1][40]="143278626742.9544";
310.243 + results[1][41]="1.106276192237624E-26";
310.244 + results[1][42]="517432.5588391111";
310.245 + results[1][43]="1.995684264553637E-31";
310.246 + results[1][44]="13.59254180428686";
310.247 + results[1][45]="1.750516997842428E-15";
310.248 + results[1][46]="9.530846823547244E+24";
310.249 + results[1][47]="6.363578981627979E-21";
310.250 + results[1][48]="7.892110721075739E+19";
310.251 + results[1][49]="2.695017594120158E-25";
310.252 + results[1][50]="2659755306503325";
310.253 + results[1][51]="6.708128334181145E-31";
310.254 + results[1][52]="47659701441.40646";
310.255 + results[1][53]="1.397306722110734E-35";
310.256 + results[1][54]="194361.6416434591";
310.257 + results[1][55]="7.076935347495779E-20";
310.258 + results[1][56]="8.169230942250227E+28";
310.259 + results[1][57]="7.098249706679054E-25";
310.260 + results[1][58]="6.529561130949462E+23";
310.261 + results[1][59]="1.392785475542062E-29";
310.262 + results[1][60]="3.372619752780715E+19";
310.263 + results[1][61]="6.438417854312836E-35";
310.264 + results[1][62]="241122707459808.1";
310.265 + results[1][63]="5.476113184315002E-40";
310.266 + results[1][64]="2519471664.228668";
310.267 + results[1][65]="5.941399214551468E-24";
310.268 + results[1][66]="5.296821713629854E+32";
310.269 + results[1][67]="1.917891304584321E-28";
310.270 + results[1][68]="1.130000185511682E+28";
310.271 + results[1][69]="8.518365403010947E-34";
310.272 + results[1][70]="8.296786726957023E+22";
310.273 + results[1][71]="5.205821369719668E-39";
310.274 + results[1][72]="2.022205866476320E+18";
310.275 + results[1][73]="9.864465530164297E-44";
310.276 + results[1][74]="5647785890103.269";
310.277 + results[2][0]="20269260647.17756";
310.278 + results[2][1]="44569.69401753148";
310.279 + results[2][2]="1";
310.280 + results[2][3]="0.00001166109071065203";
310.281 + results[2][4]="8.139070777868161E-11";
310.282 + results[2][5]="253933.9585665772";
310.283 + results[2][6]="157808328301844.9";
310.284 + results[2][7]="2.435210825001846";
310.285 + results[2][8]="232639203.3002624";
310.286 + results[2][9]="0.00002269964480050335";
310.287 + results[2][10]="8284.378509364762";
310.288 + results[2][11]="2.750776908140411E-10";
310.289 + results[2][12]="0.03693544859234678";
310.290 + results[2][13]="3.460942489720927E-15";
310.291 + results[2][14]="2.782853488076028E-7";
310.292 + results[2][15]="29.89469998645674";
310.293 + results[2][16]="3.434304892902040E+17";
310.294 + results[2][17]="0.0003538133189576156";
310.295 + results[2][18]="2695284886705.971";
310.296 + results[2][19]="2.280490767877520E-9";
310.297 + results[2][20]="91210560.48686773";
310.298 + results[2][21]="4.251984043567731E-14";
310.299 + results[2][22]="524.0044886392415";
310.300 + results[2][23]="4.660208399475724E-19";
310.301 + results[2][24]="0.002775588031390770";
310.302 + results[2][25]="0.002778548402117154";
310.303 + results[2][26]="7.442266954968664E+21";
310.304 + results[2][27]="3.239172957900716E-8";
310.305 + results[2][28]="1.147764689243079E+17";
310.306 + results[2][29]="5.529321028550383E-13";
310.307 + results[2][30]="258674242152.6016";
310.308 + results[2][31]="6.746525722402801E-18";
310.309 + results[2][32]="5258983.142583397";
310.310 + results[2][33]="2.902936587789118E-23";
310.311 + results[2][34]="139.1293956768774";
310.312 + results[2][35]="3.415314068374301E-7";
310.313 + results[2][36]="7.196683851264116E+25";
310.314 + results[2][37]="2.889624990111060E-12";
310.315 + results[2][38]="3.522103873109208E+20";
310.316 + results[2][39]="3.079757438024150E-17";
310.317 + results[2][40]="6385884553185581";
310.318 + results[2][41]="4.930639138691073E-22";
310.319 + results[2][42]="23061810822.16754";
310.320 + results[2][43]="8.894703702675794E-27";
310.321 + results[2][44]="605815.4291375707";
310.322 + results[2][45]="7.802000696632482E-11";
310.323 + results[2][46]="4.247869266534626E+29";
310.324 + results[2][47]="2.836227680675536E-16";
310.325 + results[2][48]="3.517489599908254E+24";
310.326 + results[2][49]="1.201161095417993E-20";
310.327 + results[2][50]="1.185444801723589E+20";
310.328 + results[2][51]="2.989792272847868E-26";
310.329 + results[2][52]="2124178310210390";
310.330 + results[2][53]="6.227753305311532E-31";
310.331 + results[2][54]="8662638896.794075";
310.332 + results[2][55]="3.154168430197397E-15";
310.333 + results[2][56]="3.641001234546430E+33";
310.334 + results[2][57]="3.163668174867180E-20";
310.335 + results[2][58]="2.910205416751843E+28";
310.336 + results[2][59]="6.207602247697180E-25";
310.337 + results[2][60]="1.503166304189191E+24";
310.338 + results[2][61]="2.869583137237347E-30";
310.339 + results[2][62]="1.074676529216240E+19";
310.340 + results[2][63]="2.440686890302896E-35";
310.341 + results[2][64]="112292081160512.5";
310.342 + results[2][65]="2.648063450285608E-19";
310.343 + results[2][66]="2.360777230418994E+37";
310.344 + results[2][67]="8.547982860420744E-24";
310.345 + results[2][68]="5.036376250800950E+32";
310.346 + results[2][69]="3.796609395417242E-29";
310.347 + results[2][70]="3.697852457491911E+27";
310.348 + results[2][71]="2.320218655583322E-34";
310.349 + results[2][72]="9.012909670930670E+22";
310.350 + results[2][73]="4.396562103259092E-39";
310.351 + results[2][74]="2.517200889984344E+17";
310.352 + results[3][0]="1738195950114877";
310.353 + results[3][1]="3822086211.611279";
310.354 + results[3][2]="85755.27151045421";
310.355 + results[3][3]="1";
310.356 + results[3][4]="0.000006979682243988879";
310.357 + results[3][5]="21776175562.60126";
310.358 + results[3][6]="1.353289604013560E+19";
310.359 + results[3][7]="208832.1654832305";
310.360 + results[3][8]="19950038042989.76";
310.361 + results[3][9]="1.946614203058035";
310.362 + results[3][10]="710429128.3659471";
310.363 + results[3][11]="0.00002358936206222687";
310.364 + results[3][12]="3167.409422397122";
310.365 + results[3][13]="2.967940628880855E-10";
310.366 + results[3][14]="0.02386443564437743";
310.367 + results[3][15]="2563628.114062170";
310.368 + results[3][16]="2.945097485404958E+22";
310.369 + results[3][17]="30.34135723122526";
310.370 + results[3][18]="2.311348872574943E+17";
310.371 + results[3][19]="0.0001955641049764209";
310.372 + results[3][20]="7821786379172.049";
310.373 + results[3][21]="3.646300461142698E-9";
310.374 + results[3][22]="44936147.19595487";
310.375 + results[3][23]="3.996374365923399E-14";
310.376 + results[3][24]="238.0213052330826";
310.377 + results[3][25]="238.2751726284952";
310.378 + results[3][26]="6.382136233766191E+26";
310.379 + results[3][27]="0.002777761564740970";
310.380 + results[3][28]="9.842687255615237E+21";
310.381 + results[3][29]="4.741684260718020E-8";
310.382 + results[3][30]="2.218267986855733E+16";
310.383 + results[3][31]="5.785501450769154E-13";
310.384 + results[3][32]="450985527261.1410";
310.385 + results[3][33]="2.489421152634873E-18";
310.386 + results[3][34]="11931079.10135604";
310.387 + results[3][35]="0.02928811852269122";
310.388 + results[3][36]="6.171535776400555E+30";
310.389 + results[3][37]="2.478005755903675E-7";
310.390 + results[3][38]="3.020389739265025E+25";
310.391 + results[3][39]="2.641054352841019E-12";
310.392 + results[3][40]="5.476232636928451E+20";
310.393 + results[3][41]="4.228282980585251E-17";
310.394 + results[3][42]="1977671848577708";
310.395 + results[3][43]="7.627677310280051E-22";
310.396 + results[3][44]="51951866610.91471";
310.397 + results[3][45]="0.000006690626880644714";
310.398 + results[3][46]="3.642771822925908E+34";
310.399 + results[3][47]="2.432214748217965E-11";
310.400 + results[3][48]="3.016432756753313E+29";
310.401 + results[3][49]="1.030058958653646E-15";
310.402 + results[3][50]="1.016581408324629E+25";
310.403 + results[3][51]="2.563904481179269E-21";
310.404 + results[3][52]="1.821594877287098E+20";
310.405 + results[3][53]="5.340626755971191E-26";
310.406 + results[3][54]="742866950591597.5";
310.407 + results[3][55]="2.704865701212809E-10";
310.408 + results[3][56]="3.122350494384281E+38";
310.409 + results[3][57]="2.713012233047182E-15";
310.410 + results[3][58]="2.495654556647489E+33";
310.411 + results[3][59]="5.323346161801775E-20";
310.412 + results[3][60]="1.289044345411101E+29";
310.413 + results[3][61]="2.460818810556097E-25";
310.414 + results[3][62]="9.215917754885128E+23";
310.415 + results[3][63]="2.093017669499310E-30";
310.416 + results[3][64]="9.629637908393713E+18";
310.417 + results[3][65]="2.270854001561525E-14";
310.418 + results[3][66]="2.024490923702789E+42";
310.419 + results[3][67]="7.330345910620899E-19";
310.420 + results[3][68]="4.318958128162389E+37";
310.421 + results[3][69]="3.255792695231470E-24";
310.422 + results[3][70]="3.171103414978191E+32";
310.423 + results[3][71]="1.989709807731689E-29";
310.424 + results[3][72]="7.729045159298581E+27";
310.425 + results[3][73]="3.770283768775571E-34";
310.426 + results[3][74]="2.158632457669644E+22";
310.427 + results[4][0]="2.490365448386802E+20";
310.428 + results[4][1]="547601750051441.0";
310.429 + results[4][2]="12286414841.35031";
310.430 + results[4][3]="143272.9979736873";
310.431 + results[4][4]="1";
310.432 + results[4][5]="3119937957255229";
310.433 + results[4][6]="1.938898586936469E+24";
310.434 + results[4][7]="29920010422.11961";
310.435 + results[4][8]="2.858301760108257E+18";
310.436 + results[4][9]="278897.2527702849";
310.437 + results[4][10]="101785311068822.8";
310.438 + results[4][11]="3.379718622942007";
310.439 + results[4][12]="453804243.7569410";
310.440 + results[4][13]="0.00004252257517076709";
310.441 + results[4][14]="3419.129239720079";
310.442 + results[4][15]="367298685591.3171";
310.443 + results[4][16]="4.219529460587362E+27";
310.444 + results[4][17]="4347097.213108260";
310.445 + results[4][18]="3.311538823369143E+22";
310.446 + results[4][19]="28.01905561601273";
310.447 + results[4][20]="1.120650784053732E+18";
310.448 + results[4][21]="0.0005224163985807529";
310.449 + results[4][22]="6438136526151.358";
310.450 + results[4][23]="5.725725364310391E-9";
310.451 + results[4][24]="34102025.98235386";
310.452 + results[4][25]="34138398.32518239";
310.453 + results[4][26]="9.143877916881798E+31";
310.454 + results[4][27]="397.9782270365194";
310.455 + results[4][28]="1.410191311229400E+27";
310.456 + results[4][29]="0.006793553194777180";
310.457 + results[4][30]="3.178179047858768E+21";
310.458 + results[4][31]="8.289061376328140E-8";
310.459 + results[4][32]="6.461404853344776E+16";
310.460 + results[4][33]="3.566668317571105E-13";
310.461 + results[4][34]="1709401471912.486";
310.462 + results[4][35]="4196.196545754653";
310.463 + results[4][36]="8.842144327867755E+35";
310.464 + results[4][37]="0.03550313136443727";
310.465 + results[4][38]="4.327402929934638E+30";
310.466 + results[4][39]="3.783917749429893E-7";
310.467 + results[4][40]="7.845962674940902E+25";
310.468 + results[4][41]="6.057987789095672E-12";
310.469 + results[4][42]="2.833469747538924E+20";
310.470 + results[4][43]="1.092840195819694E-16";
310.471 + results[4][44]="7443299679674857";
310.472 + results[4][45]="0.9585861715133080";
310.473 + results[4][46]="5.219108400046689E+39";
310.474 + results[4][47]="0.000003484706986930048";
310.475 + results[4][48]="4.321733642460815E+34";
310.476 + results[4][49]="1.475796350959623E-10";
310.477 + results[4][50]="1.456486660549828E+30";
310.478 + results[4][51]="3.673382815367253E-16";
310.479 + results[4][52]="2.609853591624336E+25";
310.480 + results[4][53]="7.651676063864807E-21";
310.481 + results[4][54]="1.064327751068292E+20";
310.482 + results[4][55]="0.00003875342181289592";
310.483 + results[4][56]="4.473485160550607E+43";
310.484 + results[4][57]="3.887013961679578E-10";
310.485 + results[4][58]="3.575599102375792E+38";
310.486 + results[4][59]="7.626917638530619E-15";
310.487 + results[4][60]="1.846852478880778E+34";
310.488 + results[4][61]="3.525688884584153E-20";
310.489 + results[4][62]="1.320392165821326E+29";
310.490 + results[4][63]="2.998729163210665E-25";
310.491 + results[4][64]="1.379667092536635E+24";
310.492 + results[4][65]="3.253520607642641E-9";
310.493 + results[4][66]="2.900548840094181E+47";
310.494 + results[4][67]="1.050240634798815E-13";
310.495 + results[4][68]="6.187900791446503E+42";
310.496 + results[4][69]="4.664671802266443E-19";
310.497 + results[4][70]="4.543334931485233E+37";
310.498 + results[4][71]="2.850716892513680E-24";
310.499 + results[4][72]="1.107363471446723E+33";
310.500 + results[4][73]="5.401798587640085E-29";
310.501 + results[4][74]="3.092737437336386E+27";
310.502 + results[5][0]="79820.99267697315";
310.503 + results[5][1]="0.1755168716666387";
310.504 + results[5][2]="0.000003938031784503595";
310.505 + results[5][3]="4.592174586052730E-11";
310.506 + results[5][4]="3.205191941956922E-16";
310.507 + results[5][5]="1";
310.508 + results[5][6]="621454212.7120434";
310.509 + results[5][7]="0.000009589937630824491";
310.510 + results[5][8]="916.1405769180272";
310.511 + results[5][9]="8.939192272132398E-11";
310.512 + results[5][10]="0.03262414588473695";
310.513 + results[5][11]="1.083264689633546E-15";
310.514 + results[5][12]="1.454529705315602E-7";
310.515 + results[5][13]="1.362930152886002E-20";
310.516 + results[5][14]="1.095896548766010E-12";
310.517 + results[5][15]="0.0001177262787348659";
310.518 + results[5][16]="1352440182592.445";
310.519 + results[5][17]="1.393328095835799E-9";
310.520 + results[5][18]="10614117.55214028";
310.521 + results[5][19]="8.980645128168683E-15";
310.522 + results[5][20]="359.1900862796728";
310.523 + results[5][21]="1.674444831077185E-19";
310.524 + results[5][22]="0.002063546331483886";
310.525 + results[5][23]="1.835204879954603E-24";
310.526 + results[5][24]="1.093035388830462E-8";
310.527 + results[5][25]="1.094201192231903E-8";
310.528 + results[5][26]="2.930788381742739E+16";
310.529 + results[5][27]="1.275596606371755E-13";
310.530 + results[5][28]="451993382737.0138";
310.531 + results[5][29]="2.177464195715552E-18";
310.532 + results[5][30]="1018667.387429325";
310.533 + results[5][31]="2.656803272979331E-23";
310.534 + results[5][32]="20.71004276966202";
310.535 + results[5][33]="1.143185655111196E-28";
310.536 + results[5][34]="0.0005478959823343203";
310.537 + results[5][35]="1.344961535532028E-12";
310.538 + results[5][36]="2.834076974930183E+20";
310.539 + results[5][37]="1.137943505635324E-17";
310.540 + results[5][38]="1387015700062728";
310.541 + results[5][39]="1.212818267950047E-22";
310.542 + results[5][40]="25147816342.61536";
310.543 + results[5][41]="1.941701364608288E-27";
310.544 + results[5][42]="90818.14402590475";
310.545 + results[5][43]="3.502762589487909E-32";
310.546 + results[5][44]="2.385720415486439";
310.547 + results[5][45]="3.072452672605791E-16";
310.548 + results[5][46]="1.672824418802933E+24";
310.549 + results[5][47]="1.116915475458918E-21";
310.550 + results[5][48]="1.385198584609954E+19";
310.551 + results[5][49]="4.730210572065213E-26";
310.552 + results[5][50]="466831930796205.5";
310.553 + results[5][51]="1.177389699953815E-31";
310.554 + results[5][52]="8365081701.561654";
310.555 + results[5][53]="2.452509046236414E-36";
310.556 + results[5][54]="34113.74731325223";
310.557 + results[5][55]="1.242121553179516E-20";
310.558 + results[5][56]="1.433837858906067E+28";
310.559 + results[5][57]="1.245862582824943E-25";
310.560 + results[5][58]="1.146048143060329E+23";
310.561 + results[5][59]="2.444573495698746E-30";
310.562 + results[5][60]="5.919516683291835E+18";
310.563 + results[5][61]="1.130050960271621E-35";
310.564 + results[5][62]="42321103301135.62";
310.565 + results[5][63]="9.611502550034045E-41";
310.566 + results[5][64]="442209784.7581557";
310.567 + results[5][65]="1.042815803460698E-24";
310.568 + results[5][66]="9.296815769522365E+31";
310.569 + results[5][67]="3.366222819772885E-29";
310.570 + results[5][68]="1.983340975437319E+27";
310.571 + results[5][69]="1.495116847249808E-34";
310.572 + results[5][70]="1.456226051200787E+22";
310.573 + results[5][71]="9.137094812685324E-40";
310.574 + results[5][72]="3.549312475498482E+17";
310.575 + results[5][73]="1.731380130517828E-44";
310.576 + results[5][74]="991281711273.9084";
310.577 + results[6][0]="0.0001284422746587108";
310.578 + results[6][1]="2.824292893609623E-10";
310.579 + results[6][2]="6.336801173682476E-15";
310.580 + results[6][3]="7.389401330167758E-20";
310.581 + results[6][4]="5.157567325787970E-25";
310.582 + results[6][5]="1.609129006682524E-9";
310.583 + results[6][6]="1";
310.584 + results[6][7]="1.543144681403597E-14";
310.585 + results[6][8]="0.000001474188376517659";
310.586 + results[6][9]="1.438431358140050E-19";
310.587 + results[6][10]="5.249645946137250E-11";
310.588 + results[6][11]="1.743112634004281E-24";
310.589 + results[6][12]="2.340525939904718E-16";
310.590 + results[6][13]="2.193130443091112E-29";
310.591 + results[6][14]="1.763438924942655E-21";
310.592 + results[6][15]="1.894367699610646E-13";
310.593 + results[6][16]="2176.250727612512";
310.594 + results[6][17]="2.242044654835111E-18";
310.595 + results[6][18]="0.01707948443348703";
310.596 + results[6][19]="1.445101657445832E-23";
310.597 + results[6][20]="5.779831867454199E-7";
310.598 + results[6][21]="2.694397747775916E-28";
310.599 + results[6][22]="3.320512258624031E-12";
310.600 + results[6][23]="2.953081405540270E-33";
310.601 + results[6][24]="1.758834949497607E-17";
310.602 + results[6][25]="1.760710877566955E-17";
310.603 + results[6][26]="47160165.97510373";
310.604 + results[6][27]="2.052599500138579E-22";
310.605 + results[6][28]="727.3156629906847";
310.606 + results[6][29]="3.503820798338526E-27";
310.607 + results[6][30]="0.001639167241274031";
310.608 + results[6][31]="4.275139211600108E-32";
310.609 + results[6][32]="3.332513055029883E-8";
310.610 + results[6][33]="1.839533197662788E-37";
310.611 + results[6][34]="8.816353178189703E-13";
310.612 + results[6][35]="2.164216619696854E-21";
310.613 + results[6][36]="456039546753.1217";
310.614 + results[6][37]="1.831097902883797E-26";
310.615 + results[6][38]="2231887.195695002";
310.616 + results[6][39]="1.951581054792877E-31";
310.617 + results[6][40]="40.46608073162718";
310.618 + results[6][41]="3.124447988106234E-36";
310.619 + results[6][42]="0.0001461381098851545";
310.620 + results[6][43]="5.636396886267384E-41";
310.621 + results[6][44]="3.838931922393911E-9";
310.622 + results[6][45]="4.943972717149220E-25";
310.623 + results[6][46]="2691790295382633";
310.624 + results[6][47]="1.797261089573547E-30";
310.625 + results[6][48]="22289632225.11453";
310.626 + results[6][49]="7.611519039226468E-35";
310.627 + results[6][50]="751192.8010897827";
310.628 + results[6][51]="1.894571918364917E-40";
310.629 + results[6][52]="13.46049560925206";
310.630 + results[6][53]="3.946403445450303E-45";
310.631 + results[6][54]="0.00005489342032839216";
310.632 + results[6][55]="1.998733821046708E-29";
310.633 + results[6][56]="2.307230089645316E+19";
310.634 + results[6][57]="2.004753620364024E-34";
310.635 + results[6][58]="184413931005301.8";
310.636 + results[6][59]="3.933634120896147E-39";
310.637 + results[6][60]="9525266000.626017";
310.638 + results[6][61]="1.818397779202506E-44";
310.639 + results[6][62]="68100.11491666482";
310.640 + results[6][63]="1.546614755106283E-49";
310.641 + results[6][64]="0.7115725916931837";
310.642 + results[6][65]="1.678025157975551E-33";
310.643 + results[6][66]="1.495977592452194E+23";
310.644 + results[6][67]="5.416686782253186E-38";
310.645 + results[6][68]="3.191451493718201E+18";
310.646 + results[6][69]="2.405835887289389E-43";
310.647 + results[6][70]="23432555792739.37";
310.648 + results[6][71]="1.470276429990037E-48";
310.649 + results[6][72]="571130165.8104760";
310.650 + results[6][73]="2.786013989610011E-53";
310.651 + results[6][74]="1595.100155404736";
310.652 + results[7][0]="8323411032.456378";
310.653 + results[7][1]="18302.19115320239";
310.654 + results[7][2]="0.4106420642242513";
310.655 + results[7][3]="0.000004788534360528390";
310.656 + results[7][4]="3.342244825091065E-11";
310.657 + results[7][5]="104275.9649224148";
310.658 + results[7][6]="64802737685647.92";
310.659 + results[7][7]="1";
310.660 + results[7][8]="95531442.66270503";
310.661 + results[7][9]="0.000009321428998035992";
310.662 + results[7][10]="3401.914291900572";
310.663 + results[7][11]="1.129584707779182E-10";
310.664 + results[7][12]="0.01516724885301000";
310.665 + results[7][13]="1.421208568140421E-15";
310.666 + results[7][14]="1.142756700777198E-7";
310.667 + results[7][15]="12.27602131180330";
310.668 + results[7][16]="1.410270050396740E+17";
310.669 + results[7][17]="0.0001452906316467887";
310.670 + results[7][18]="1106797349549.367";
310.671 + results[7][19]="9.364654363655727E-10";
310.672 + results[7][20]="37454892.83737830";
310.673 + results[7][21]="1.746043504699232E-14";
310.674 + results[7][22]="215.1782848775914";
310.675 + results[7][23]="1.913677596875906E-19";
310.676 + results[7][24]="0.001139773198646432";
310.677 + results[7][25]="0.001140988851392383";
310.678 + results[7][26]="3.056107864896266E+21";
310.679 + results[7][27]="1.330140669811724E-8";
310.680 + results[7][28]="4.713204612344845E+16";
310.681 + results[7][29]="2.270571800922490E-13";
310.682 + results[7][30]="106222524759.1882";
310.683 + results[7][31]="2.770407248989495E-18";
310.684 + results[7][32]="2159559.693390987";
310.685 + results[7][33]="1.192067872721828E-23";
310.686 + results[7][34]="57.13238223502557";
310.687 + results[7][35]="1.402471619011349E-7";
310.688 + results[7][36]="2.955261112252432E+25";
310.689 + results[7][37]="1.186601570773187E-12";
310.690 + results[7][38]="1.446324004865796E+20";
310.691 + results[7][39]="1.264677951660229E-17";
310.692 + results[7][40]="2622312814817888";
310.693 + results[7][41]="2.024727833856987E-22";
310.694 + results[7][42]="9470149600.764056";
310.695 + results[7][43]="3.652539489129880E-27";
310.696 + results[7][44]="248773.2983599527";
310.697 + results[7][45]="3.203829671144209E-11";
310.698 + results[7][46]="1.744353804164535E+29";
310.699 + results[7][47]="1.164674389402563E-16";
310.700 + results[7][48]="1.444429190193662E+24";
310.701 + results[7][49]="4.932472716883077E-21";
310.702 + results[7][50]="4.867935004036829E+19";
310.703 + results[7][51]="1.227734470523965E-26";
310.704 + results[7][52]="872276966085176.7";
310.705 + results[7][53]="2.557377472772532E-31";
310.706 + results[7][54]="3557243918.208811";
310.707 + results[7][55]="1.295234235087226E-15";
310.708 + results[7][56]="1.495148262797194E+33";
310.709 + results[7][57]="1.299135229848029E-20";
310.710 + results[7][58]="1.195052759651575E+28";
310.711 + results[7][59]="2.549102600877473E-25";
310.712 + results[7][60]="6.172633140245884E+23";
310.713 + results[7][61]="1.178371542938247E-30";
310.714 + results[7][62]="4.413073883307109E+18";
310.715 + results[7][63]="1.002248702759050E-35";
310.716 + results[7][64]="46111852003790.03";
310.717 + results[7][65]="1.087406241422075E-19";
310.718 + results[7][66]="9.694344350728666E+36";
310.719 + results[7][67]="3.510161326756695E-24";
310.720 + results[7][68]="2.068147939838898E+32";
310.721 + results[7][69]="1.559047519187323E-29";
310.722 + results[7][70]="1.518493766341199E+27";
310.723 + results[7][71]="9.527793781803528E-35";
310.724 + results[7][72]="3.701079831937688E+22";
310.725 + results[7][73]="1.805413337572430E-39";
310.726 + results[7][74]="1.033668569530294E+17";
310.727 + results[8][0]="87.12745040231444";
310.728 + results[8][1]="0.0001915829034197918";
310.729 + results[8][2]="4.298501653263149E-9";
310.730 + results[8][3]="5.012521769858929E-14";
310.731 + results[8][4]="3.498580919469208E-19";
310.732 + results[8][5]="0.001091535540718088";
310.733 + results[8][6]="678339.3601041740";
310.734 + results[8][7]="1.046775775731475E-8";
310.735 + results[8][8]="1";
310.736 + results[8][9]="9.757446070344992E-14";
310.737 + results[8][10]="0.00003561041471876213";
310.738 + results[8][11]="1.182421908739965E-18";
310.739 + results[8][12]="1.587670868382187E-10";
310.740 + results[8][13]="1.487686701391408E-23";
310.741 + results[8][14]="1.196210031928393E-15";
310.742 + results[8][15]="1.285024173155902E-7";
310.743 + results[8][16]="1476236525.994914";
310.744 + results[8][17]="1.520867136485833E-12";
310.745 + results[8][18]="11585.68654152080";
310.746 + results[8][19]="9.802693335972867E-18";
310.747 + results[8][20]="0.3920687450478594";
310.748 + results[8][21]="1.827716044092442E-22";
310.749 + results[8][22]="0.000002252434160733091";
310.750 + results[8][23]="2.003191350969721E-27";
310.751 + results[8][24]="1.193086974171064E-11";
310.752 + results[8][25]="1.194359490017227E-11";
310.753 + results[8][26]="31990596809958.51";
310.754 + results[8][27]="1.392359031474151E-16";
310.755 + results[8][28]="493366841.4268441";
310.756 + results[8][29]="2.376779558264652E-21";
310.757 + results[8][30]="1111.911657549550";
310.758 + results[8][31]="2.899995197153080E-26";
310.759 + results[8][32]="0.02260574773287777";
310.760 + results[8][33]="1.247827772192961E-31";
310.761 + results[8][34]="5.980479373345604E-7";
310.762 + results[8][35]="1.468073316931983E-15";
310.763 + results[8][36]="3.093495743267101E+17";
310.764 + results[8][37]="1.242105779730290E-20";
310.765 + results[8][38]="1513976932152.447";
310.766 + results[8][39]="1.323834243899629E-25";
310.767 + results[8][40]="27449735.30941583";
310.768 + results[8][41]="2.119436048930757E-30";
310.769 + results[8][42]="99.13123194632914";
310.770 + results[8][43]="3.823389857123776E-35";
310.771 + results[8][44]="0.002604098623720172";
310.772 + results[8][45]="3.353691289323497E-19";
310.773 + results[8][46]="1.825947306504481E+21";
310.774 + results[8][47]="1.219152937441450E-24";
310.775 + results[8][48]="1.511993486054156E+16";
310.776 + results[8][49]="5.163192954489619E-29";
310.777 + results[8][50]="509563644006.1053";
310.778 + results[8][51]="1.285162702774995E-34";
310.779 + results[8][52]="9130783.978265085";
310.780 + results[8][53]="2.677000787899666E-39";
310.781 + results[8][54]="37.23636761949100";
310.782 + results[8][55]="1.355819821187394E-23";
310.783 + results[8][56]="1.565084982623100E+25";
310.784 + results[8][57]="1.359903288004258E-28";
310.785 + results[8][58]="1.250952279524317E+20";
310.786 + results[8][59]="2.668338852452637E-33";
310.787 + results[8][60]="6461362843686697";
310.788 + results[8][61]="1.233490785959079E-38";
310.789 + results[8][62]="46194988375.59113";
310.790 + results[8][63]="1.049129663306469E-43";
310.791 + results[8][64]="482687.6965168229";
310.792 + results[8][65]="1.138270511899841E-27";
310.793 + results[8][66]="1.014780482794204E+29";
310.794 + results[8][67]="3.674351845758363E-32";
310.795 + results[8][68]="2.164887164052315E+24";
310.796 + results[8][69]="1.631973176299542E-37";
310.797 + results[8][70]="1.589522490205218E+19";
310.798 + results[8][71]="9.973463726956913E-43";
310.799 + results[8][72]="387420071212069.1";
310.800 + results[8][73]="1.889862946953332E-47";
310.801 + results[8][74]="1082019218.719317";
310.802 + results[9][0]="892932943458573.4";
310.803 + results[9][1]="1963453367.188511";
310.804 + results[9][2]="44053.55276650961";
310.805 + results[9][3]="0.5137124749367641";
310.806 + results[9][4]="0.000003585549839831714";
310.807 + results[9][5]="11186693042.92137";
310.808 + results[9][6]="6.952017517839994E+18";
310.809 + results[9][7]="107279.6885767942";
310.810 + results[9][8]="10248583418146.87";
310.811 + results[9][9]="1";
310.812 + results[9][10]="364956305.8000387";
310.813 + results[9][11]="0.00001211814956716597";
310.814 + results[9][12]="1627.137733517652";
310.815 + results[9][13]="1.524668125927760E-10";
310.816 + results[9][14]="0.01225945829784226";
310.817 + results[9][15]="1316967.743292346";
310.818 + results[9][16]="1.512933318157422E+22";
310.819 + results[9][17]="15.58673371619321";
310.820 + results[9][18]="1.187368749772774E+17";
310.821 + results[9][19]="0.0001004637203762303";
310.822 + results[9][20]="4018149239271.144";
310.823 + results[9][21]="1.873150034256679E-9";
310.824 + results[9][22]="23084259.39015671";
310.825 + results[9][23]="2.052987366292351E-14";
310.826 + results[9][24]="122.2745137989658";
310.827 + results[9][25]="122.4049286469690";
310.828 + results[9][26]="3.278583000031628E+26";
310.829 + results[9][27]="0.001426970768207302";
310.830 + results[9][28]="5.056311230110650E+21";
310.831 + results[9][29]="2.435862356942155E-8";
310.832 + results[9][30]="1.139551937600652E+16";
310.833 + results[9][31]="2.972084269024861E-13";
310.834 + results[9][32]="231676891369.9822";
310.835 + results[9][33]="1.278846701479992E-18";
310.836 + results[9][34]="6129144.173823912";
310.837 + results[9][35]="0.01504567185253299";
310.838 + results[9][36]="3.170394917855513E+30";
310.839 + results[9][37]="1.272982469772824E-7";
310.840 + results[9][38]="1.551611888231443E+25";
310.841 + results[9][39]="1.356742568040473E-12";
310.842 + results[9][40]="2.813209021245996E+20";
310.843 + results[9][41]="2.172121714689447E-17";
310.844 + results[9][42]="1015954699945620";
310.845 + results[9][43]="3.918432989082965E-22";
310.846 + results[9][44]="26688321974.27763";
310.847 + results[9][45]="0.000003437058493734438";
310.848 + results[9][46]="1.871337328785176E+34";
310.849 + results[9][47]="1.249459057884749E-11";
310.850 + results[9][48]="1.549579136952070E+29";
310.851 + results[9][49]="5.291541369807505E-16";
310.852 + results[9][50]="5.222305512451464E+24";
310.853 + results[9][51]="1.317109716528063E-21";
310.854 + results[9][52]="9.357760127432864E+19";
310.855 + results[9][53]="2.743546588523462E-26";
310.856 + results[9][54]="381620019737136.4";
310.857 + results[9][55]="1.389523253741598E-10";
310.858 + results[9][56]="1.603990400090178E+38";
310.859 + results[9][57]="1.393708228772385E-15";
310.860 + results[9][58]="1.282048878882594E+33";
310.861 + results[9][59]="2.734669331724314E-20";
310.862 + results[9][60]="6.621981609843777E+28";
310.863 + results[9][61]="1.264153321541716E-25";
310.864 + results[9][62]="4.734331918675705E+23";
310.865 + results[9][63]="1.075209287084869E-30";
310.866 + results[9][64]="4.946865122665819E+18";
310.867 + results[9][65]="1.166566029362225E-14";
310.868 + results[9][66]="1.040006242902376E+42";
310.869 + results[9][67]="3.765690139887650E-19";
310.870 + results[9][68]="2.218702669166555E+37";
310.871 + results[9][69]="1.672541323348396E-24";
310.872 + results[9][70]="1.629035383588871E+32";
310.873 + results[9][71]="1.022138749735799E-29";
310.874 + results[9][72]="3.970506917681290E+27";
310.875 + results[9][73]="1.936841806071609E-34";
310.876 + results[9][74]="1.108916422308302E+22";
310.877 + results[10][0]="2446684.518852554";
310.878 + results[10][1]="5.379968330412397";
310.879 + results[10][2]="0.0001207091152184304";
310.880 + results[10][3]="1.407599942164664E-9";
310.881 + results[10][4]="9.824600322966481E-15";
310.882 + results[10][5]="30.65214346248511";
310.883 + results[10][6]="19048903683.41529";
310.884 + results[10][7]="0.0002939521440563168";
310.885 + results[10][8]="28081.67239549524";
310.886 + results[10][9]="2.740054039641405E-9";
310.887 + results[10][10]="1";
310.888 + results[10][11]="3.320438467449187E-14";
310.889 + results[10][12]="0.000004458445319778002";
310.890 + results[10][13]="4.177673057560849E-19";
310.891 + results[10][14]="3.359157823281803E-11";
310.892 + results[10][15]="0.003608562785085618";
310.893 + results[10][16]="41455190501253.18";
310.894 + results[10][17]="4.270849268387010E-8";
310.895 + results[10][18]="325345453.9358852";
310.896 + results[10][19]="2.752760228542944E-13";
310.897 + results[10][20]="11009.94605494694";
310.898 + results[10][21]="5.132532318219450E-18";
310.899 + results[10][22]="0.06325211819412893";
310.900 + results[10][23]="5.625296326342124E-23";
310.901 + results[10][24]="3.350387754800450E-7";
310.902 + results[10][25]="3.353961192111453E-7";
310.903 + results[10][26]="8.983494593536299E+17";
310.904 + results[10][27]="3.909977017876616E-12";
310.905 + results[10][28]="13854566011748.89";
310.906 + results[10][29]="6.674394491149785E-17";
310.907 + results[10][30]="31224338.90003856";
310.908 + results[10][31]="8.143671507496243E-22";
310.909 + results[10][32]="634.8072020898827";
310.910 + results[10][33]="3.504109070472339E-27";
310.911 + results[10][34]="0.01679418625303079";
310.912 + results[10][35]="4.122595393865199E-11";
310.913 + results[10][36]="8.687053401928578E+21";
310.914 + results[10][37]="3.488040758693718E-16";
310.915 + results[10][38]="4.251500422304194E+16";
310.916 + results[10][39]="3.717547954312753E-21";
310.917 + results[10][40]="770834474302.0734";
310.918 + results[10][41]="5.951730878927634E-26";
310.919 + results[10][42]="2783770.779678667";
310.920 + results[10][43]="1.073671814080092E-30";
310.921 + results[10][44]="73.12744443686990";
310.922 + results[10][45]="9.417726010240848E-15";
310.923 + results[10][46]="5.127565407269577E+25";
310.924 + results[10][47]="3.423585338923651E-20";
310.925 + results[10][48]="4.245930573949562E+20";
310.926 + results[10][49]="1.449910930627067E-24";
310.927 + results[10][50]="1.430939931563421E+16";
310.928 + results[10][51]="3.608951799423663E-30";
310.929 + results[10][52]="256407684391.6768";
310.930 + results[10][53]="7.517465912828107E-35";
310.931 + results[10][54]="1045659.476688773";
310.932 + results[10][55]="3.807368804590335E-19";
310.933 + results[10][56]="4.395020375313125E+29";
310.934 + results[10][57]="3.818835862329240E-24";
310.935 + results[10][58]="3.512883209599986E+24";
310.936 + results[10][59]="7.493141749474667E-29";
310.937 + results[10][60]="1.814458746048353E+20";
310.938 + results[10][61]="3.463848415416480E-34";
310.939 + results[10][62]="1297232529877061";
310.940 + results[10][63]="2.946131550536850E-39";
310.941 + results[10][64]="13554677762.92165";
310.942 + results[10][65]="3.196453961262399E-23";
310.943 + results[10][66]="2.849673307116934E+33";
310.944 + results[10][67]="1.031819447983696E-27";
310.945 + results[10][68]="6.079365211412986E+28";
310.946 + results[10][69]="4.582853609507953E-33";
310.947 + results[10][70]="4.463644983521472E+23";
310.948 + results[10][71]="2.800715410287590E-38";
310.949 + results[10][72]="1.087940351921676E+19";
310.950 + results[10][73]="5.307051214872866E-43";
310.951 + results[10][74]="30384909225705.58";
310.952 + results[11][0]="7.368558528753992E+19";
310.953 + results[11][1]="162025840356721.7";
310.954 + results[11][2]="3635336609.961668";
310.955 + results[11][3]="42391.98997251724";
310.956 + results[11][4]="0.2958826196985332";
310.957 + results[11][5]="923135416089567.4";
310.958 + results[11][6]="5.736863932325467E+23";
310.959 + results[11][7]="8852811065.104166";
310.960 + results[11][8]="8.457218126697593E+17";
310.961 + results[11][9]="82520.84977639587";
310.962 + results[11][10]="30116504485873.39";
310.963 + results[11][11]="1";
310.964 + results[11][12]="134272788.4731154";
310.965 + results[11][13]="0.00001258169093785437";
310.966 + results[11][14]="1011.660916536231";
310.967 + results[11][15]="108677297304.5868";
310.968 + results[11][16]="1.248485430693727E+27";
310.969 + results[11][17]="1286230.511498665";
310.970 + results[11][18]="9.798267822918602E+21";
310.971 + results[11][19]="8.290351577144743";
310.972 + results[11][20]="3.315810897530334E+17";
310.973 + results[11][21]="0.0001545739325855462";
310.974 + results[11][22]="1904932701334.478";
310.975 + results[11][23]="1.694142620466497E-9";
310.976 + results[11][24]="10090196.78468630";
310.977 + results[11][25]="10100958.72876698";
310.978 + results[11][26]="2.705514552250553E+31";
310.979 + results[11][27]="117.7548403985430";
310.980 + results[11][28]="4.172510994426643E+26";
310.981 + results[11][29]="0.002010094316332011";
310.982 + results[11][30]="9.403679425514422E+20";
310.983 + results[11][31]="2.452589194869899E-8";
310.984 + results[11][32]="1.911817394940469E+16";
310.985 + results[11][33]="1.055315165398698E-13";
310.986 + results[11][34]="505782185625.9951";
310.987 + results[11][35]="1241.581626727822";
310.988 + results[11][36]="2.616236827482037E+35";
310.989 + results[11][37]="0.01050475951561086";
310.990 + results[11][38]="1.280403315400169E+30";
310.991 + results[11][39]="1.119595496425095E-7";
310.992 + results[11][40]="2.321483990318425E+25";
310.993 + results[11][41]="1.792453297139352E-12";
310.994 + results[11][42]="8.383744517383584E+19";
310.995 + results[11][43]="3.233524200509892E-17";
310.996 + results[11][44]="2202343008423450";
310.997 + results[11][45]="0.2836289876341450";
310.998 + results[11][46]="1.544243465896434E+39";
310.999 + results[11][47]="0.000001031064232174645";
310.1000 + results[11][48]="1.278725871770590E+34";
310.1001 + results[11][49]="4.366624904634691E-11";
310.1002 + results[11][50]="4.309490886794513E+29";
310.1003 + results[11][51]="1.086890130566436E-16";
310.1004 + results[11][52]="7.722103177194344E+24";
310.1005 + results[11][53]="2.263997958860880E-21";
310.1006 + results[11][54]="3.149160832039346E+19";
310.1007 + results[11][55]="0.00001146646396828192";
310.1008 + results[11][56]="1.323626508486227E+43";
310.1009 + results[11][57]="1.150099873786527E-10";
310.1010 + results[11][58]="1.057957629402673E+38";
310.1011 + results[11][59]="2.256672371113390E-15";
310.1012 + results[11][60]="5.464515496479744E+33";
310.1013 + results[11][61]="1.043190063412758E-20";
310.1014 + results[11][62]="3.906810930526339E+28";
310.1015 + results[11][63]="8.872718405771617E-26";
310.1016 + results[11][64]="4.082195136515981E+23";
310.1017 + results[11][65]="9.626602006324680E-10";
310.1018 + results[11][66]="8.582219893706080E+46";
310.1019 + results[11][67]="3.107479503381239E-14";
310.1020 + results[11][68]="1.830892296607818E+42";
310.1021 + results[11][69]="1.380195312888473E-19";
310.1022 + results[11][70]="1.344293841695707E+37";
310.1023 + results[11][71]="8.434775821758094E-25";
310.1024 + results[11][72]="3.276496048901183E+32";
310.1025 + results[11][73]="1.598298317194785E-29";
310.1026 + results[11][74]="9.150872549988179E+26";
310.1027 + results[12][0]="548775266570.8102";
310.1028 + results[12][1]="1206691.558276256";
310.1029 + results[12][2]="27.07426166761666";
310.1030 + results[12][3]="0.0003157154212300068";
310.1031 + results[12][4]="2.203593319712548E-9";
310.1032 + results[12][5]="6875074.440525237";
310.1033 + results[12][6]="4272543973773303";
310.1034 + results[12][7]="65.93153509191260";
310.1035 + results[12][8]="6298534664.297173";
310.1036 + results[12][9]="0.0006145761230907817";
310.1037 + results[12][10]="224293.4315161216";
310.1038 + results[12][11]="7.447525380023099E-9";
310.1039 + results[12][12]="1";
310.1040 + results[12][13]="9.370246258327704E-14";
310.1041 + results[12][14]="0.000007534370351881011";
310.1042 + results[12][15]="809.3769299082260";
310.1043 + results[12][16]="9.298126931680603E+18";
310.1044 + results[12][17]="0.009579234378946397";
310.1045 + results[12][18]="72972848291449.96";
310.1046 + results[12][19]="6.174260378010000E-8";
310.1047 + results[12][20]="2469458581.471433";
310.1048 + results[12][21]="1.151193286020835E-12";
310.1049 + results[12][22]="14187.03464042448";
310.1050 + results[12][23]="1.261717016330308E-17";
310.1051 + results[12][24]="0.07514699664337871";
310.1052 + results[12][25]="0.07522714649505796";
310.1053 + results[12][26]="2.014938829390782E+23";
310.1054 + results[12][27]="8.769821624887181E-7";
310.1055 + results[12][28]="3.107488152941784E+18";
310.1056 + results[12][29]="1.497022843712283E-11";
310.1057 + results[12][30]="7003414118711.969";
310.1058 + results[12][31]="1.826572027556399E-16";
310.1059 + results[12][32]="142383085.7078879";
310.1060 + results[12][33]="7.859486478230080E-22";
310.1061 + results[12][34]="3766.825664213152";
310.1062 + results[12][35]="0.000009246710676425823";
310.1063 + results[12][36]="1.948449017282359E+27";
310.1064 + results[12][37]="7.823446310355102E-11";
310.1065 + results[12][38]="9.535836188108477E+21";
310.1066 + results[12][39]="8.338215874985453E-16";
310.1067 + results[12][40]="1.728931093721377E+17";
310.1068 + results[12][41]="1.334934142295141E-20";
310.1069 + results[12][42]="624381500728.4375";
310.1070 + results[12][43]="2.408175355021632E-25";
310.1071 + results[12][44]="16402005.45075007";
310.1072 + results[12][45]="2.112334083915552E-9";
310.1073 + results[12][46]="1.150079240519853E+31";
310.1074 + results[12][47]="7.678877037554697E-15";
310.1075 + results[12][48]="9.523343384103629E+25";
310.1076 + results[12][49]="3.252054980230781E-19";
310.1077 + results[12][50]="3.209504275438039E+21";
310.1078 + results[12][51]="8.094641832690152E-25";
310.1079 + results[12][52]="5.751055939931189E+16";
310.1080 + results[12][53]="1.686118225893689E-29";
310.1081 + results[12][54]="234534552223.8769";
310.1082 + results[12][55]="8.539678142289999E-14";
310.1083 + results[12][56]="9.857742015622534E+34";
310.1084 + results[12][57]="8.565397999586525E-19";
310.1085 + results[12][58]="7.879166295965479E+29";
310.1086 + results[12][59]="1.680662475826388E-23";
310.1087 + results[12][60]="4.069711784956242E+25";
310.1088 + results[12][61]="7.769184473454425E-29";
310.1089 + results[12][62]="2.909607356004657E+20";
310.1090 + results[12][63]="6.607979551678220E-34";
310.1091 + results[12][64]="3040225188540963";
310.1092 + results[12][65]="7.169436276548434E-18";
310.1093 + results[12][66]="6.391630047531518E+38";
310.1094 + results[12][67]="2.314303246933335E-22";
310.1095 + results[12][68]="1.363561684707550E+34";
310.1096 + results[12][69]="1.027903962212583E-27";
310.1097 + results[12][70]="1.001166250423753E+29";
310.1098 + results[12][71]="6.281820700734860E-33";
310.1099 + results[12][72]="2.440178748173697E+24";
310.1100 + results[12][73]="1.190336728215637E-37";
310.1101 + results[12][74]="6.815135556539365E+18";
310.1102 + results[13][0]="5.856572510920854E+24";
310.1103 + results[13][1]="1.287790656733084E+19";
310.1104 + results[13][2]="288938635348614.2";
310.1105 + results[13][3]="3369339636.612199";
310.1106 + results[13][4]="23516.92003563011";
310.1107 + results[13][5]="7.337133145689837E+19";
310.1108 + results[13][6]="4.559692302618115E+28";
310.1109 + results[13][7]="703626492562206.3";
310.1110 + results[13][8]="6.721845393016666E+22";
310.1111 + results[13][9]="6558804391.555706";
310.1112 + results[13][10]="2.393677021207241E+18";
310.1113 + results[13][11]="79480.57259865707";
310.1114 + results[13][12]="10672078112261.57";
310.1115 + results[13][13]="1";
310.1116 + results[13][14]="80407388.92198187";
310.1117 + results[13][15]="8637733818243049";
310.1118 + results[13][16]="9.923033691261843E+31";
310.1119 + results[13][17]="102230337547.7774";
310.1120 + results[13][18]="7.787719370405676E+26";
310.1121 + results[13][19]="658921.8903956439";
310.1122 + results[13][20]="2.635425487645780E+22";
310.1123 + results[13][21]="12.28562467072543";
310.1124 + results[13][22]="1.514051418639709E+17";
310.1125 + results[13][23]="0.0001346514255384665";
310.1126 + results[13][24]="801974618079.9959";
310.1127 + results[13][25]="802829983557.8030";
310.1128 + results[13][26]="2.150358457868733E+36";
310.1129 + results[13][27]="9359222.141139671";
310.1130 + results[13][28]="3.316335630112216E+31";
310.1131 + results[13][29]="159.7634472393744";
310.1132 + results[13][30]="7.474098252740968E+25";
310.1133 + results[13][31]="0.001949331935575389";
310.1134 + results[13][32]="1.519523412539414E+21";
310.1135 + results[13][33]="8.387705361793504E-9";
310.1136 + results[13][34]="4.019985772375435E+16";
310.1137 + results[13][35]="98681618.62029944";
310.1138 + results[13][36]="2.079400011019663E+40";
310.1139 + results[13][37]="834.9243013119425";
310.1140 + results[13][38]="1.017671886652243E+35";
310.1141 + results[13][39]="0.008898609113474424";
310.1142 + results[13][40]="1.845128768291237E+30";
310.1143 + results[13][41]="1.424652144129865E-7";
310.1144 + results[13][42]="6.663448147624991E+24";
310.1145 + results[13][43]="2.570023549681410E-12";
310.1146 + results[13][44]="1.750434833681448E+20";
310.1147 + results[13][45]="22542.99434273927";
310.1148 + results[13][46]="1.227373549011834E+44";
310.1149 + results[13][47]="0.08194957555923548";
310.1150 + results[13][48]="1.016338644850434E+39";
310.1151 + results[13][49]="0.000003470618477439216";
310.1152 + results[13][50]="3.425208032911223E+34";
310.1153 + results[13][51]="8.638664992924948E-12";
310.1154 + results[13][52]="6.137571821893155E+29";
310.1155 + results[13][53]="1.799438541324536E-16";
310.1156 + results[13][54]="2.502971061357505E+24";
310.1157 + results[13][55]="0.9113611218809168";
310.1158 + results[13][56]="1.052025928012465E+48";
310.1159 + results[13][57]="0.000009141059651419642";
310.1160 + results[13][58]="8.408707817004228E+42";
310.1161 + results[13][59]="1.793616122236614E-10";
310.1162 + results[13][60]="4.343228206344449E+38";
310.1163 + results[13][61]="8.291334356927543E-16";
310.1164 + results[13][62]="3.105155697929257E+33";
310.1165 + results[13][63]="7.052087393973718E-21";
310.1166 + results[13][64]="3.244552069097433E+28";
310.1167 + results[13][65]="0.00007651278396420666";
310.1168 + results[13][66]="6.821197513193451E+51";
310.1169 + results[13][67]="2.469842502673314E-9";
310.1170 + results[13][68]="1.455203681008597E+47";
310.1171 + results[13][69]="1.096987137663585E-14";
310.1172 + results[13][70]="1.068452442788232E+42";
310.1173 + results[13][71]="6.704008120546416E-20";
310.1174 + results[13][72]="2.604177820839036E+37";
310.1175 + results[13][73]="1.270336654341115E-24";
310.1176 + results[13][74]="7.273165900503936E+31";
310.1177 + results[14][0]="7.283624788019671E+16";
310.1178 + results[14][1]="160158248389.6609";
310.1179 + results[14][2]="3593433.877438394";
310.1180 + results[14][3]="41.90335840753915";
310.1181 + results[14][4]="0.0002924721266406031";
310.1182 + results[14][5]="912494889345.1759";
310.1183 + results[14][6]="5.670737930617694E+20";
310.1184 + results[14][7]="8750769.077266332";
310.1185 + results[14][8]="835973594359440.8";
310.1186 + results[14][9]="81.56967263194704";
310.1187 + results[14][10]="29769366389.07392";
310.1188 + results[14][11]="0.0009884734930986993";
310.1189 + results[14][12]="132725.0922501232";
310.1190 + results[14][13]="1.243666799042916E-8";
310.1191 + results[14][14]="1";
310.1192 + results[14][15]="107424627.6871908";
310.1193 + results[14][16]="1.234094754760663E+24";
310.1194 + results[14][17]="1271.404766631212";
310.1195 + results[14][18]="9.685328021236938E+18";
310.1196 + results[14][19]="0.008194792782476575";
310.1197 + results[14][20]="327759118033654.3";
310.1198 + results[14][21]="1.527922350848377E-7";
310.1199 + results[14][22]="1882975481.406032";
310.1200 + results[14][23]="1.674615073859902E-12";
310.1201 + results[14][24]="9973.892061812134";
310.1202 + results[14][25]="9984.529958270096";
310.1203 + results[14][26]="2.674329420092467E+28";
310.1204 + results[14][27]="0.1163975384180276";
310.1205 + results[14][28]="4.124416517653632E+23";
310.1206 + results[14][29]="0.000001986924950322545";
310.1207 + results[14][30]="9.295287849718610E+17";
310.1208 + results[14][31]="2.424319408589176E-11";
310.1209 + results[14][32]="18897808185436.61";
310.1210 + results[14][33]="1.043151067861683E-16";
310.1211 + results[14][34]="499952283.7728221";
310.1212 + results[14][35]="1.227270527538816";
310.1213 + results[14][36]="2.586080755634628E+32";
310.1214 + results[14][37]="0.00001038367633255766";
310.1215 + results[14][38]="1.265644737748760E+27";
310.1216 + results[14][39]="1.106690471208886E-10";
310.1217 + results[14][40]="2.294725389082761E+22";
310.1218 + results[14][41]="1.771792571839617E-15";
310.1219 + results[14][42]="8.287109228345220E+16";
310.1220 + results[14][43]="3.196252961497192E-20";
310.1221 + results[14][44]="2176957686537.825";
310.1222 + results[14][45]="0.0002803597361507711";
310.1223 + results[14][46]="1.526443732929490E+36";
310.1224 + results[14][47]="1.019179663186800E-9";
310.1225 + results[14][48]="1.263986629184754E+31";
310.1226 + results[14][49]="4.316292972536028E-14";
310.1227 + results[14][50]="4.259817510346784E+26";
310.1228 + results[14][51]="1.074362083975506E-19";
310.1229 + results[14][52]="7.633094301629857E+21";
310.1230 + results[14][53]="2.237901970763539E-24";
310.1231 + results[14][54]="3.112862007975538E+16";
310.1232 + results[14][55]="1.133429569221800E-8";
310.1233 + results[14][56]="1.308369718401416E+40";
310.1234 + results[14][57]="1.136843239654142E-13";
310.1235 + results[14][58]="1.045763073486079E+35";
310.1236 + results[14][59]="2.230660821453777E-18";
310.1237 + results[14][60]="5.401528720897306E+30";
310.1238 + results[14][61]="1.031165725947463E-23";
310.1239 + results[14][62]="3.861779047373550E+25";
310.1240 + results[14][63]="8.770446955834192E-29";
310.1241 + results[14][64]="4.035141686102474E+20";
310.1242 + results[14][65]="9.515640911862703E-13";
310.1243 + results[14][66]="8.483296876872797E+43";
310.1244 + results[14][67]="3.071661119439865E-17";
310.1245 + results[14][68]="1.809788503915430E+39";
310.1246 + results[14][69]="1.364286482089321E-22";
310.1247 + results[14][70]="1.328798829452025E+34";
310.1248 + results[14][71]="8.337552320037675E-28";
310.1249 + results[14][72]="3.238729494581439E+29";
310.1250 + results[14][73]="1.579875520611302E-32";
310.1251 + results[14][74]="9.045394954387817E+23";
310.1252 + results[15][0]="678021878.6728144";
310.1253 + results[15][1]="1490.889490034119";
310.1254 + results[15][2]="0.03345074546501661";
310.1255 + results[15][3]="3.900721772064906E-7";
310.1256 + results[15][4]="2.722579849122226E-12";
310.1257 + results[15][5]="8494.280212934647";
310.1258 + results[15][6]="5278806222284.789";
310.1259 + results[15][7]="0.08145961746078984";
310.1260 + results[15][8]="7781954.774781330";
310.1261 + results[15][9]="7.593200403679254E-7";
310.1262 + results[15][10]="277.1186368526144";
310.1263 + results[15][11]="9.201553818525026E-12";
310.1264 + results[15][12]="0.001235518289498798";
310.1265 + results[15][13]="1.157711062927156E-16";
310.1266 + results[15][14]="9.308852369606484E-9";
310.1267 + results[15][15]="1";
310.1268 + results[15][16]="1.148800588217273E+16";
310.1269 + results[15][17]="0.00001183531927458393";
310.1270 + results[15][18]="90159288700.90755";
310.1271 + results[15][19]="7.628411621159118E-11";
310.1272 + results[15][20]="3051061.242567714";
310.1273 + results[15][21]="1.422320359626963E-15";
310.1274 + results[15][22]="17.52834077199745";
310.1275 + results[15][23]="1.558874449847949E-20";
310.1276 + results[15][24]="0.00009284548875379919";
310.1277 + results[15][25]="0.00009294451536144952";
310.1278 + results[15][26]="2.489493775933610E+20";
310.1279 + results[15][27]="1.083527501319018E-9";
310.1280 + results[15][28]="3839358447360413";
310.1281 + results[15][29]="1.849599103204027E-14";
310.1282 + results[15][30]="8652846232.602745";
310.1283 + results[15][31]="2.256763147132834E-19";
310.1284 + results[15][32]="175916.9065073704";
310.1285 + results[15][33]="9.710539289921761E-25";
310.1286 + results[15][34]="4.653982001488808";
310.1287 + results[15][35]="1.142448015842791E-8";
310.1288 + results[15][36]="2.407344397008314E+24";
310.1289 + results[15][37]="9.666011003355619E-14";
310.1290 + results[15][38]="1.178170001607253E+19";
310.1291 + results[15][39]="1.030201821533375E-18";
310.1292 + results[15][40]="213612598757592.2";
310.1293 + results[15][41]="1.649335548082038E-23";
310.1294 + results[15][42]="771434763.7746916";
310.1295 + results[15][43]="2.975344695449488E-28";
310.1296 + results[15][44]="20264.97771886068";
310.1297 + results[15][45]="2.609827394209354E-12";
310.1298 + results[15][46]="1.420943936035166E+28";
310.1299 + results[15][47]="9.487393022711177E-18";
310.1300 + results[15][48]="1.176626492823741E+23";
310.1301 + results[15][49]="4.017973406530782E-22";
310.1302 + results[15][50]="3.965401232528285E+18";
310.1303 + results[15][51]="1.000107803123075E-27";
310.1304 + results[15][52]="71055347977156.85";
310.1305 + results[15][53]="2.083229906348919E-32";
310.1306 + results[15][54]="289771728.7920109";
310.1307 + results[15][55]="1.055092853123241E-16";
310.1308 + results[15][56]="1.217942055346239E+32";
310.1309 + results[15][57]="1.058270588532557E-21";
310.1310 + results[15][58]="9.734854064667849E+26";
310.1311 + results[15][59]="2.076489227357834E-26";
310.1312 + results[15][60]="5.028203343302236E+22";
310.1313 + results[15][61]="9.598969511443032E-32";
310.1314 + results[15][62]="3.594873103603994E+17";
310.1315 + results[15][63]="8.164279592732510E-37";
310.1316 + results[15][64]="3756253824637.292";
310.1317 + results[15][65]="8.857969645071753E-21";
310.1318 + results[15][66]="7.896975823435262E+35";
310.1319 + results[15][67]="2.859363989032589E-25";
310.1320 + results[15][68]="1.684705400315972E+31";
310.1321 + results[15][69]="1.269994145161927E-30";
310.1322 + results[15][70]="1.236959213227480E+26";
310.1323 + results[15][71]="7.761304367110075E-36";
310.1324 + results[15][72]="3.014885473014884E+21";
310.1325 + results[15][73]="1.470682798372580E-40";
310.1326 + results[15][74]="8420224625517956";
310.1327 + results[16][0]="5.901998011029744E-8";
310.1328 + results[16][1]="1.297779184068582E-13";
310.1329 + results[16][2]="2.911797383123386E-18";
310.1330 + results[16][3]="3.395473341564099E-23";
310.1331 + results[16][4]="2.369932499205253E-28";
310.1332 + results[16][5]="7.394042360403217E-13";
310.1333 + results[16][6]="0.0004595058773843880";
310.1334 + results[16][7]="7.090840507594115E-18";
310.1335 + results[16][8]="6.773982233816134E-10";
310.1336 + results[16][9]="6.609676632793603E-23";
310.1337 + results[16][10]="2.412243166437193E-14";
310.1338 + results[16][11]="8.009705002679486E-28";
310.1339 + results[16][12]="1.075485425556837E-19";
310.1340 + results[16][13]="1.007756328470993E-32";
310.1341 + results[16][14]="8.103105504195564E-25";
310.1342 + results[16][15]="8.704730918982346E-17";
310.1343 + results[16][16]="1";
310.1344 + results[16][17]="1.030232696254985E-21";
310.1345 + results[16][18]="0.000007848123479882456";
310.1346 + results[16][19]="6.640327050142802E-27";
310.1347 + results[16][20]="2.655866713388787E-10";
310.1348 + results[16][21]="1.238091601114291E-31";
310.1349 + results[16][22]="1.525794898764651E-15";
310.1350 + results[16][23]="1.356958262240303E-36";
310.1351 + results[16][24]="8.081949966432234E-21";
310.1352 + results[16][25]="8.090569966166392E-21";
310.1353 + results[16][26]="21670.37344398340";
310.1354 + results[16][27]="9.431815342299341E-26";
310.1355 + results[16][28]="0.3342058218579424";
310.1356 + results[16][29]="1.610026250138211E-30";
310.1357 + results[16][30]="7.532069813813702E-7";
310.1358 + results[16][31]="1.964451594366708E-35";
310.1359 + results[16][32]="1.531309335246434E-11";
310.1360 + results[16][33]="8.452763159697483E-41";
310.1361 + results[16][34]="4.051166102474697E-16";
310.1362 + results[16][35]="9.944702566836774E-25";
310.1363 + results[16][36]="209552852.0527718";
310.1364 + results[16][37]="8.414002484413322E-30";
310.1365 + results[16][38]="1025.565284080813";
310.1366 + results[16][39]="8.967629648693503E-35";
310.1367 + results[16][40]="0.01859440193089382";
310.1368 + results[16][41]="1.435702214116641E-39";
310.1369 + results[16][42]="6.715132040207400E-8";
310.1370 + results[16][43]="2.589957496510927E-44";
310.1371 + results[16][44]="1.764011781218549E-12";
310.1372 + results[16][45]="2.271784521158129E-28";
310.1373 + results[16][46]="1236893461414.578";
310.1374 + results[16][47]="8.258520338533136E-34";
310.1375 + results[16][48]="10242217.01217658";
310.1376 + results[16][49]="3.497537734347732E-38";
310.1377 + results[16][50]="345.1775071495967";
310.1378 + results[16][51]="8.705669316160942E-44";
310.1379 + results[16][52]="0.006185176844958069";
310.1380 + results[16][53]="1.813395577714413E-48";
310.1381 + results[16][54]="2.522384927062784E-8";
310.1382 + results[16][55]="9.184299380979178E-33";
310.1383 + results[16][56]="1.060185786670131E+16";
310.1384 + results[16][57]="9.211960712648993E-38";
310.1385 + results[16][58]="84739285168.49519";
310.1386 + results[16][59]="1.807527998031550E-42";
310.1387 + results[16][60]="4376915.710937338";
310.1388 + results[16][61]="8.355644669662702E-48";
310.1389 + results[16][62]="31.29240305475972";
310.1390 + results[16][63]="7.106785700207527E-53";
310.1391 + results[16][64]="0.0003269717880686592";
310.1392 + results[16][65]="7.710624224886317E-37";
310.1393 + results[16][66]="6.874104961671300E+19";
310.1394 + results[16][67]="2.488999412395668E-41";
310.1395 + results[16][68]="1466490718750697";
310.1396 + results[16][69]="1.105495730231758E-46";
310.1397 + results[16][70]="10767397108.90133";
310.1398 + results[16][71]="6.756006609601578E-52";
310.1399 + results[16][72]="262437.6679414338";
310.1400 + results[16][73]="1.280189802700927E-56";
310.1401 + results[16][74]="0.7329578964252270";
310.1402 + results[17][0]="57288009131181.63";
310.1403 + results[17][1]="125969520.1662847";
310.1404 + results[17][2]="2826.349225478968";
310.1405 + results[17][3]="0.03295831469829135";
310.1406 + results[17][4]="2.300385638914618E-7";
310.1407 + results[17][5]="717706047.1174538";
310.1408 + results[17][6]="4.460214464700500E+17";
310.1409 + results[17][7]="6882.756229121966";
310.1410 + results[17][8]="657519632063.7410";
310.1411 + results[17][9]="0.06415712350055034";
310.1412 + results[17][10]="23414546.78351770";
310.1413 + results[17][11]="7.774656183788081E-7";
310.1414 + results[17][12]="104.3924765216976";
310.1415 + results[17][13]="9.781832125249994E-12";
310.1416 + results[17][14]="0.0007865315800645127";
310.1417 + results[17][15]="84492.86215264814";
310.1418 + results[17][16]="9.706544974112313E+20";
310.1419 + results[17][17]="1";
310.1420 + results[17][18]="7617816351986589";
310.1421 + results[17][19]="0.000006445463315502565";
310.1422 + results[17][20]="257792896987.5612";
310.1423 + results[17][21]="1.201759180828659E-10";
310.1424 + results[17][22]="1481019.680613023";
310.1425 + results[17][23]="1.317137640042879E-15";
310.1426 + results[17][24]="7.844781082769998";
310.1427 + results[17][25]="7.853148124279642";
310.1428 + results[17][26]="2.103444544398340E+25";
310.1429 + results[17][27]="0.00009155033980755107";
310.1430 + results[17][28]="3.243983840474286E+20";
310.1431 + results[17][29]="1.562779220646795E-9";
310.1432 + results[17][30]="731103743959364.5";
310.1433 + results[17][31]="1.906803775018709E-14";
310.1434 + results[17][32]="14863722931.84754";
310.1435 + results[17][33]="8.204712576512332E-20";
310.1436 + results[17][34]="393228.2597126994";
310.1437 + results[17][35]="0.0009652870271917130";
310.1438 + results[17][36]="2.034034182903733E+29";
310.1439 + results[17][37]="8.167089352725064E-9";
310.1440 + results[17][38]="9.954695553818683E+23";
310.1441 + results[17][39]="8.704470049622648E-14";
310.1442 + results[17][40]="1.804873986089417E+19";
310.1443 + results[17][41]="1.393570811075580E-18";
310.1444 + results[17][42]="65180731155375.70";
310.1445 + results[17][43]="2.513953892092264E-23";
310.1446 + results[17][44]="1712245968.926182";
310.1447 + results[17][45]="2.205117862611359E-7";
310.1448 + results[17][46]="1.200596201140605E+33";
310.1449 + results[17][47]="8.016169908559313E-13";
310.1450 + results[17][48]="9.941654006331020E+27";
310.1451 + results[17][49]="3.394900731710114E-17";
310.1452 + results[17][50]="3.350480997199534E+23";
310.1453 + results[17][51]="8.450197074706576E-23";
310.1454 + results[17][52]="6.003669721842360E+18";
310.1455 + results[17][53]="1.760180573094133E-27";
310.1456 + results[17][54]="24483642736557.92";
310.1457 + results[17][55]="8.914781499718627E-12";
310.1458 + results[17][56]="1.029074101922827E+37";
310.1459 + results[17][57]="8.941631095708316E-17";
310.1460 + results[17][58]="8.225256825621270E+31";
310.1461 + results[17][59]="1.754485180486043E-21";
310.1462 + results[17][60]="4.248472919611204E+27";
310.1463 + results[17][61]="8.110444077378283E-27";
310.1464 + results[17][62]="3.037411175990747E+22";
310.1465 + results[17][63]="6.898233502044262E-32";
310.1466 + results[17][64]="3.173766366154361E+17";
310.1467 + results[17][65]="7.484352081733892E-16";
310.1468 + results[17][66]="6.672380896723107E+40";
310.1469 + results[17][67]="2.415958473695767E-20";
310.1470 + results[17][68]="1.423455811567193E+36";
310.1471 + results[17][69]="1.073054402418369E-25";
310.1472 + results[17][70]="1.045142242916776E+31";
310.1473 + results[17][71]="6.557748200149776E-31";
310.1474 + results[17][72]="2.547363026774680E+26";
310.1475 + results[17][73]="1.242621989531652E-35";
310.1476 + results[17][74]="7.114488785782220E+20";
310.1477 + results[18][0]="0.007520266502124582";
310.1478 + results[18][1]="1.653617183005917E-8";
310.1479 + results[18][2]="3.710182938109170E-13";
310.1480 + results[18][3]="4.326477979440449E-18";
310.1481 + results[18][4]="3.019744153210938E-23";
310.1482 + results[18][5]="9.421414404802356E-8";
310.1483 + results[18][6]="58.54977671570353";
310.1484 + results[18][7]="9.035077653620603E-13";
310.1485 + results[18][8]="0.00008631340028199442";
310.1486 + results[18][9]="8.421983483996608E-18";
310.1487 + results[18][10]="3.073655979828342E-9";
310.1488 + results[18][11]="1.020588555112725E-22";
310.1489 + results[18][12]="1.370372711787334E-14";
310.1490 + results[18][13]="1.284072977513965E-27";
310.1491 + results[18][14]="1.032489553071727E-19";
310.1492 + results[18][15]="1.109148058296442E-11";
310.1493 + results[18][16]="127418.9941790999";
310.1494 + results[18][17]="1.312712139272323E-16";
310.1495 + results[18][18]="1";
310.1496 + results[18][19]="8.461037937494653E-22";
310.1497 + results[18][20]="0.00003384078652937511";
310.1498 + results[18][21]="1.577563865155743E-26";
310.1499 + results[18][22]="1.944152513241934E-10";
310.1500 + results[18][23]="1.729022569176787E-31";
310.1501 + results[18][24]="1.029793935728606E-15";
310.1502 + results[18][25]="1.030892287424556E-15";
310.1503 + results[18][26]="2761217187.717842";
310.1504 + results[18][27]="1.201792424198785E-20";
310.1505 + results[18][28]="42584.16966993846";
310.1506 + results[18][29]="2.051479253945588E-25";
310.1507 + results[18][30]="0.09597287597629022";
310.1508 + results[18][31]="2.503084462677351E-30";
310.1509 + results[18][32]="0.000001951178952741667";
310.1510 + results[18][33]="1.077042579842804E-35";
310.1511 + results[18][34]="5.161955100297903E-11";
310.1512 + results[18][35]="1.267143998476655E-19";
310.1513 + results[18][36]="26701013635925.91";
310.1514 + results[18][37]="1.072103733584393E-24";
310.1515 + results[18][38]="130676496.9625801";
310.1516 + results[18][39]="1.142646350007201E-29";
310.1517 + results[18][40]="2369.279991396404";
310.1518 + results[18][41]="1.829357320634491E-34";
310.1519 + results[18][42]="0.008556353703430740";
310.1520 + results[18][43]="3.300097791720419E-39";
310.1521 + results[18][44]="2.247686068829500E-7";
310.1522 + results[18][45]="2.894684986776169E-23";
310.1523 + results[18][46]="1.576037207601508E+17";
310.1524 + results[18][47]="1.052292354943532E-28";
310.1525 + results[18][48]="1305052989855.606";
310.1526 + results[18][49]="4.456527402140359E-33";
310.1527 + results[18][50]="43982170.77425067";
310.1528 + results[18][51]="1.109267627921080E-38";
310.1529 + results[18][52]="788.1090124044157";
310.1530 + results[18][53]="2.310610405611983E-43";
310.1531 + results[18][54]="0.003213997503388622";
310.1532 + results[18][55]="1.170254189364097E-27";
310.1533 + results[18][56]="1.350878065804859E+21";
310.1534 + results[18][57]="1.173778768423119E-32";
310.1535 + results[18][58]="1.079739448362558E+16";
310.1536 + results[18][59]="2.303133994597421E-37";
310.1537 + results[18][60]="557702197494.3356";
310.1538 + results[18][61]="1.064667839526379E-42";
310.1539 + results[18][62]="3987246.522684476";
310.1540 + results[18][63]="9.055394857668533E-48";
310.1541 + results[18][64]="41.66241636065038";
310.1542 + results[18][65]="9.824799832280163E-32";
310.1543 + results[18][66]="8.758915400977171E+24";
310.1544 + results[18][67]="3.171458016398266E-36";
310.1545 + results[18][68]="1.868587723561991E+20";
310.1546 + results[18][69]="1.408611540154202E-41";
310.1547 + results[18][70]="1371970909543155";
310.1548 + results[18][71]="8.608435668627840E-47";
310.1549 + results[18][72]="33439543683.80610";
310.1550 + results[18][73]="1.631204970184925E-51";
310.1551 + results[18][74]="93392.75793813131";
310.1552 + results[19][0]="8.888113441495055E+18";
310.1553 + results[19][1]="19543904603925.69";
310.1554 + results[19][2]="438502104.0583787";
310.1555 + results[19][3]="5113.412812236528";
310.1556 + results[19][4]="0.03568999661175253";
310.1557 + results[19][5]="111350575123317.2";
310.1558 + results[19][6]="6.919928399829436E+22";
310.1559 + results[19][7]="1067845070.589050";
310.1560 + results[19][8]="1.020127801336300E+17";
310.1561 + results[19][9]="9953.842006398556";
310.1562 + results[19][10]="3632717407172.463";
310.1563 + results[19][11]="0.1206221462014772";
310.1564 + results[19][12]="16196271.92208414";
310.1565 + results[19][13]="0.000001517630563767670";
310.1566 + results[19][14]="122.0287109807536";
310.1567 + results[19][15]="13108888844.25527";
310.1568 + results[19][16]="1.505949921515530E+26";
310.1569 + results[19][17]="155147.8848067927";
310.1570 + results[19][18]="1.181888093857317E+21";
310.1571 + results[19][19]="1";
310.1572 + results[19][20]="3.999602268583552E+16";
310.1573 + results[19][21]="0.00001864503949527103";
310.1574 + results[19][22]="229777070804.3422";
310.1575 + results[19][23]="2.043511188520634E-10";
310.1576 + results[19][24]="1217101.191764106";
310.1577 + results[19][25]="1218399.320556418";
310.1578 + results[19][26]="3.263449718717902E+30";
310.1579 + results[19][27]="14.20384157448466";
310.1580 + results[19][28]="5.032972311970014E+25";
310.1581 + results[19][29]="0.0002424618905033581";
310.1582 + results[19][30]="1.134291994496223E+20";
310.1583 + results[19][31]="2.958365724357601E-9";
310.1584 + results[19][32]="2306075173230364";
310.1585 + results[19][33]="1.272943801693578E-14";
310.1586 + results[19][34]="61008532740.68144";
310.1587 + results[19][35]="149.7622405002312";
310.1588 + results[19][36]="3.155761011022271E+34";
310.1589 + results[19][37]="0.001267106638103371";
310.1590 + results[19][38]="1.544449959070552E+29";
310.1591 + results[19][39]="1.350480116563032E-8";
310.1592 + results[19][40]="2.800223812845777E+24";
310.1593 + results[19][41]="2.162095636668628E-13";
310.1594 + results[19][42]="1.011265256891675E+19";
310.1595 + results[19][43]="3.900346288599187E-18";
310.1596 + results[19][44]="265651340347854.4";
310.1597 + results[19][45]="0.03421193721338280";
310.1598 + results[19][46]="1.862699611140355E+38";
310.1599 + results[19][47]="1.243691805564838E-7";
310.1600 + results[19][48]="1.542426590563234E+33";
310.1601 + results[19][49]="5.267116676538570E-12";
310.1602 + results[19][50]="5.198200398008612E+28";
310.1603 + results[19][51]="1.311030202341272E-17";
310.1604 + results[19][52]="9.314566584224275E+23";
310.1605 + results[19][53]="2.730882927935629E-22";
310.1606 + results[19][54]="3.798585382942154E+18";
310.1607 + results[19][55]="0.000001383109493196072";
310.1608 + results[19][56]="1.596586702227764E+42";
310.1609 + results[19][57]="1.387275151221789E-11";
310.1610 + results[19][58]="1.276131198487774E+37";
310.1611 + results[19][59]="2.722046646772734E-16";
310.1612 + results[19][60]="6.591415871366172E+32";
310.1613 + results[19][61]="1.258318243449020E-21";
310.1614 + results[19][62]="4.712479192434771E+27";
310.1615 + results[19][63]="1.070246336745521E-26";
310.1616 + results[19][64]="4.924031385797897E+22";
310.1617 + results[19][65]="1.161181394630329E-10";
310.1618 + results[19][66]="1.035205782751841E+46";
310.1619 + results[19][67]="3.748308469749455E-15";
310.1620 + results[19][68]="2.208461582805865E+41";
310.1621 + results[19][69]="1.664821208178269E-20";
310.1622 + results[19][70]="1.621516083107649E+36";
310.1623 + results[19][71]="1.017420762348790E-25";
310.1624 + results[19][72]="3.952179854391208E+31";
310.1625 + results[19][73]="1.927901732902443E-30";
310.1626 + results[19][74]="1.103797886595758E+26";
310.1627 + results[20][0]="222.2249324966694";
310.1628 + results[20][1]="0.0004886462025847162";
310.1629 + results[20][2]="1.096364274774934E-8";
310.1630 + results[20][3]="1.278480326006873E-13";
310.1631 + results[20][4]="8.923386430719285E-19";
310.1632 + results[20][5]="0.002784041203245736";
310.1633 + results[20][6]="1730154.134120969";
310.1634 + results[20][7]="2.669878150077217E-8";
310.1635 + results[20][8]="2.550573114105107";
310.1636 + results[20][9]="2.488707960935246E-13";
310.1637 + results[20][10]="0.00009082696636380747";
310.1638 + results[20][11]="3.015853529960997E-18";
310.1639 + results[20][12]="4.049470630943514E-10";
310.1640 + results[20][13]="3.794453702780639E-23";
310.1641 + results[20][14]="3.051021146259370E-15";
310.1642 + results[20][15]="3.277548107026588E-7";
310.1643 + results[20][16]="3765249193.262553";
310.1644 + results[20][17]="3.879082828446787E-12";
310.1645 + results[20][18]="29550.14060125232";
310.1646 + results[20][19]="2.500248606854969E-17";
310.1647 + results[20][20]="1";
310.1648 + results[20][21]="4.661723402280728E-22";
310.1649 + results[20][22]="0.000005744998011657722";
310.1650 + results[20][23]="5.109286002191258E-27";
310.1651 + results[20][24]="3.043055559109729E-11";
310.1652 + results[20][25]="3.046301203814225E-11";
310.1653 + results[20][26]="81594356127656.76";
310.1654 + results[20][27]="3.551313510859396E-16";
310.1655 + results[20][28]="1258368201.134266";
310.1656 + results[20][29]="6.062150039464433E-21";
310.1657 + results[20][30]="2836.011979005927";
310.1658 + results[20][31]="7.396649780892585E-26";
310.1659 + results[20][32]="0.05765761239172050";
310.1660 + results[20][33]="3.182675966789038E-31";
310.1661 + results[20][34]="0.000001525364989911545";
310.1662 + results[20][35]="3.744428331701820E-15";
310.1663 + results[20][36]="7.890187071375662E+17";
310.1664 + results[20][37]="3.168081606654638E-20";
310.1665 + results[20][38]="3861508858523.363";
310.1666 + results[20][39]="3.376536030022057E-25";
310.1667 + results[20][40]="70012556.86949763";
310.1668 + results[20][41]="5.405776603467944E-30";
310.1669 + results[20][42]="252.8414549704244";
310.1670 + results[20][43]="9.751835374322068E-35";
310.1671 + results[20][44]="0.006641943936138782";
310.1672 + results[20][45]="8.553834835557002E-19";
310.1673 + results[20][46]="4.657212107742966E+21";
310.1674 + results[20][47]="3.109538704220428E-24";
310.1675 + results[20][48]="3.856449934231786E+16";
310.1676 + results[20][49]="1.316910113265814E-28";
310.1677 + results[20][50]="1299679330327.398";
310.1678 + results[20][51]="3.277901436948555E-34";
310.1679 + results[20][52]="23288732.12566459";
310.1680 + results[20][53]="6.827886236055077E-39";
310.1681 + results[20][54]="94.97407811720772";
310.1682 + results[20][55]="3.458117583491362E-23";
310.1683 + results[20][56]="3.991863677968137E+25";
310.1684 + results[20][57]="3.468532764166796E-28";
310.1685 + results[20][58]="3.190645251183220E+20";
310.1686 + results[20][59]="6.805793336387770E-33";
310.1687 + results[20][60]="1.648017834958501E+16";
310.1688 + results[20][61]="3.146108435163604E-38";
310.1689 + results[20][62]="117823695357.1807";
310.1690 + results[20][63]="2.675881912439624E-43";
310.1691 + results[20][64]="1231130.261245134";
310.1692 + results[20][65]="2.903242164230390E-27";
310.1693 + results[20][66]="2.588271816133498E+29";
310.1694 + results[20][67]="9.371703029553756E-32";
310.1695 + results[20][68]="5.521702995703085E+24";
310.1696 + results[20][69]="4.162466906410325E-37";
310.1697 + results[20][70]="4.054193327782826E+19";
310.1698 + results[20][71]="2.543804843647882E-42";
310.1699 + results[20][72]="988143217498189.4";
310.1700 + results[20][73]="4.820233621842614E-47";
310.1701 + results[20][74]="2759769128.210504";
310.1702 + results[21][0]="4.767012396916274E+23";
310.1703 + results[21][1]="1.048209343234839E+18";
310.1704 + results[21][2]="23518432565916.35";
310.1705 + results[21][3]="274250575.5235032";
310.1706 + results[21][4]="1914.181872385126";
310.1707 + results[21][5]="5.972128680744241E+18";
310.1708 + results[21][6]="3.711404527506926E+27";
310.1709 + results[21][7]="57272341571595.42";
310.1710 + results[21][8]="5.471309415005725E+21";
310.1711 + results[21][9]="533860065.5108917";
310.1712 + results[21][10]="1.948355973230217E+17";
310.1713 + results[21][11]="6469.396121798011";
310.1714 + results[21][12]="868663857010.9776";
310.1715 + results[21][13]="0.08139594255901624";
310.1716 + results[21][14]="6544835.210014115";
310.1717 + results[21][15]="703076485709783.2";
310.1718 + results[21][16]="8.076946803451319E+30";
310.1719 + results[21][17]="8321134682.827734";
310.1720 + results[21][18]="6.338887585392785E+25";
310.1721 + results[21][19]="53633.56834152223";
310.1722 + results[21][20]="2.145129416109833E+21";
310.1723 + results[21][21]="1";
310.1724 + results[21][22]="1.232376423029948E+16";
310.1725 + results[21][23]="0.00001096007969861868";
310.1726 + results[21][24]="65277479947.02833";
310.1727 + results[21][25]="65347103226.32689";
310.1728 + results[21][26]="1.750304535179781E+35";
310.1729 + results[21][27]="761802.7077972777";
310.1730 + results[21][28]="2.699362644550329E+30";
310.1731 + results[21][29]="13.00409637452654";
310.1732 + results[21][30]="6.083612720605475E+24";
310.1733 + results[21][31]="0.0001586677102565503";
310.1734 + results[21][32]="1.236830404041385E+20";
310.1735 + results[21][33]="6.827251838304966E-10";
310.1736 + results[21][34]="3272105310163334";
310.1737 + results[21][35]="8032283.360848641";
310.1738 + results[21][36]="1.692547238541742E+39";
310.1739 + results[21][37]="67.95945047071364";
310.1740 + results[21][38]="8.283436242987168E+33";
310.1741 + results[21][39]="0.0007243106762555027";
310.1742 + results[21][40]="1.501859952378219E+29";
310.1743 + results[21][41]="1.159609040901739E-8";
310.1744 + results[21][42]="5.423776426690670E+23";
310.1745 + results[21][43]="2.091894892251871E-13";
310.1746 + results[21][44]="1.424782931756363E+19";
310.1747 + results[21][45]="1834.908272629834";
310.1748 + results[21][46]="9.990322689382312E+42";
310.1749 + results[21][47]="0.006670362944955292";
310.1750 + results[21][48]="8.272584195675434E+37";
310.1751 + results[21][49]="2.824942622339028E-7";
310.1752 + results[21][50]="2.787980362995230E+33";
310.1753 + results[21][51]="7.031522795507035E-13";
310.1754 + results[21][52]="4.995734434666519E+28";
310.1755 + results[21][53]="1.464669961481319E-17";
310.1756 + results[21][54]="2.037316887371354E+23";
310.1757 + results[21][55]="0.07418109752713971";
310.1758 + results[21][56]="8.563064200709839E+46";
310.1759 + results[21][57]="7.440451663154942E-7";
310.1760 + results[21][58]="6.844346984684270E+41";
310.1761 + results[21][59]="1.459930748584969E-11";
310.1762 + results[21][60]="3.535211536043119E+37";
310.1763 + results[21][61]="6.748809750540721E-17";
310.1764 + results[21][62]="2.527470748254518E+32";
310.1765 + results[21][63]="5.740113004410473E-22";
310.1766 + results[21][64]="2.640933738459919E+27";
310.1767 + results[21][65]="0.000006227830168580984";
310.1768 + results[21][66]="5.552178009675986E+50";
310.1769 + results[21][67]="2.010351584774140E-10";
310.1770 + results[21][68]="1.184476752310447E+46";
310.1771 + results[21][69]="8.929030204524482E-16";
310.1772 + results[21][70]="8.696769366023154E+40";
310.1773 + results[21][71]="5.456790598951745E-21";
310.1774 + results[21][72]="2.119695083184782E+36";
310.1775 + results[21][73]="1.034002493473623E-25";
310.1776 + results[21][74]="5.920061938596140E+30";
310.1777 + results[22][0]="38681463.77870482";
310.1778 + results[22][1]="85.05593937424482";
310.1779 + results[22][2]="0.001908380599175486";
310.1780 + results[22][3]="2.225379927743381E-8";
310.1781 + results[22][4]="1.553244476779973E-13";
310.1782 + results[22][5]="484.6026400002877";
310.1783 + results[22][6]="301158352119.5565";
310.1784 + results[22][7]="0.004647309093335652";
310.1785 + results[22][8]="443964.1421858626";
310.1786 + results[22][9]="4.331956174545530E-8";
310.1787 + results[22][10]="15.80974722349805";
310.1788 + results[22][11]="5.249529284155089E-13";
310.1789 + results[22][12]="0.00007048689351547812";
310.1790 + results[22][13]="6.604795502245522E-18";
310.1791 + results[22][14]="5.310743606992122E-10";
310.1792 + results[22][15]="0.05705046547232572";
310.1793 + results[22][16]="655396082926770.0";
310.1794 + results[22][17]="6.752104736286019E-7";
310.1795 + results[22][18]="5143629387.040573";
310.1796 + results[22][19]="4.352044338016266E-12";
310.1797 + results[22][20]="174064.4640730606";
310.1798 + results[22][21]="8.114403856748394E-17";
310.1799 + results[22][22]="1";
310.1800 + results[22][23]="8.893451297674116E-22";
310.1801 + results[22][24]="0.000005296878350409827";
310.1802 + results[22][25]="0.000005302527864470423";
310.1803 + results[22][26]="1.420267787074702E+19";
310.1804 + results[22][27]="6.181574830231600E-11";
310.1805 + results[22][28]="219037186537017.3";
310.1806 + results[22][29]="1.055204897749860E-15";
310.1807 + results[22][30]="493648905.2304466";
310.1808 + results[22][31]="1.287493880047189E-20";
310.1809 + results[22][32]="10036.14140069709";
310.1810 + results[22][33]="5.539907864773438E-26";
310.1811 + results[22][34]="0.2655118394847626";
310.1812 + results[22][35]="6.517719108176616E-10";
310.1813 + results[22][36]="1.373401184015196E+23";
310.1814 + results[22][37]="5.514504270020602E-15";
310.1815 + results[22][38]="6.721514699722450E+17";
310.1816 + results[22][39]="5.877349344891688E-20";
310.1817 + results[22][40]="12186698189873.78";
310.1818 + results[22][41]="9.409536073813374E-25";
310.1819 + results[22][42]="44010712.35487979";
310.1820 + results[22][43]="1.697447998160085E-29";
310.1821 + results[22][44]="1156.126411647312";
310.1822 + results[22][45]="1.488918676420706E-13";
310.1823 + results[22][46]="8.106551296088482E+26";
310.1824 + results[22][47]="5.412601880645680E-19";
310.1825 + results[22][48]="6.712708910266456E+21";
310.1826 + results[22][49]="2.292272530980073E-23";
310.1827 + results[22][50]="2.262279861002728E+17";
310.1828 + results[22][51]="5.705661569067654E-29";
310.1829 + results[22][52]="4053740676394.876";
310.1830 + results[22][53]="1.188492358430754E-33";
310.1831 + results[22][54]="16531612.00830475";
310.1832 + results[22][55]="6.019353838720512E-18";
310.1833 + results[22][56]="6.948416117582402E+30";
310.1834 + results[22][57]="6.037482967145447E-23";
310.1835 + results[22][58]="5.553779556944628E+25";
310.1836 + results[22][59]="1.184646769690344E-27";
310.1837 + results[22][60]="2.868613412248970E+21";
310.1838 + results[22][61]="5.476256786824880E-33";
310.1839 + results[22][62]="2.050891838745521E+16";
310.1840 + results[22][63]="4.657759510115996E-38";
310.1841 + results[22][64]="214296029127.7612";
310.1842 + results[22][65]="5.053512913910754E-22";
310.1843 + results[22][66]="4.505261465506844E+34";
310.1844 + results[22][67]="1.631280465291153E-26";
310.1845 + results[22][68]="9.611322727176706E+29";
310.1846 + results[22][69]="7.245375712861636E-32";
310.1847 + results[22][70]="7.056909888490957E+24";
310.1848 + results[22][71]="4.427860268160242E-37";
310.1849 + results[22][72]="1.720006195812521E+20";
310.1850 + results[22][73]="8.390313820929822E-42";
310.1851 + results[22][74]="480377734267339.0";
310.1852 + results[23][0]="4.349432237720928E+28";
310.1853 + results[23][1]="9.563884315247705E+22";
310.1854 + results[23][2]="2.145826783438484E+18";
310.1855 + results[23][3]="25022680771022.83";
310.1856 + results[23][4]="174650360.6745100";
310.1857 + results[23][5]="5.448982895167197E+23";
310.1858 + results[23][6]="3.386293375197521E+32";
310.1859 + results[23][7]="5.225540611608288E+18";
310.1860 + results[23][8]="4.992034333194938E+26";
310.1861 + results[23][9]="48709505787460.23";
310.1862 + results[23][10]="1.777684128953709E+22";
310.1863 + results[23][11]="590269076.4751797";
310.1864 + results[23][12]="7.925707484777299E+16";
310.1865 + results[23][13]="7426.583090383436";
310.1866 + results[23][14]="597152154909.8750";
310.1867 + results[23][15]="6.414884791379698E+19";
310.1868 + results[23][16]="7.369423421683034E+35";
310.1869 + results[23][17]="759222096156514.8";
310.1870 + results[23][18]="5.783614498890633E+30";
310.1871 + results[23][19]="4893538169.095777";
310.1872 + results[23][20]="1.957220636251567E+26";
310.1873 + results[23][21]="91240.21243440706";
310.1874 + results[23][22]="1.124422866364071E+21";
310.1875 + results[23][23]="1";
310.1876 + results[23][24]="5955931137549612";
310.1877 + results[23][25]="5962283580343192";
310.1878 + results[23][26]="1.596981576147093E+40";
310.1879 + results[23][27]="69507040892.53014";
310.1880 + results[23][28]="2.462904211262749E+35";
310.1881 + results[23][29]="1186496.515729304";
310.1882 + results[23][30]="5.550701169967046E+29";
310.1883 + results[23][31]="14.47687559028860";
310.1884 + results[23][32]="1.128486688100694E+25";
310.1885 + results[23][33]="0.00006229199080701412";
310.1886 + results[23][34]="2.985475836070540E+20";
310.1887 + results[23][35]="732867240177.1831";
310.1888 + results[23][36]="1.544283695998176E+44";
310.1889 + results[23][37]="6200634.697873477";
310.1890 + results[23][38]="7.557824824970159E+38";
310.1891 + results[23][39]="66.08625997006110";
310.1892 + results[23][40]="1.370300211017172E+34";
310.1893 + results[23][41]="0.001058029752327336";
310.1894 + results[23][42]="4.948665133679859E+28";
310.1895 + results[23][43]="1.908649343595118E-8";
310.1896 + results[23][44]="1.299974973663679E+24";
310.1897 + results[23][45]="167417420.5923969";
310.1898 + results[23][46]="9.115191644675190E+47";
310.1899 + results[23][47]="608.6053321123179";
310.1900 + results[23][48]="7.547923393949451E+42";
310.1901 + results[23][49]="0.02577483649772239";
310.1902 + results[23][50]="2.543759205826400E+38";
310.1903 + results[23][51]="6.415576335994377E-8";
310.1904 + results[23][52]="4.558118710848557E+33";
310.1905 + results[23][53]="1.336367984318503E-12";
310.1906 + results[23][54]="1.858852255999673E+28";
310.1907 + results[23][55]="6768.299096993695";
310.1908 + results[23][56]="7.812957967622318E+51";
310.1909 + results[23][57]="0.06788683903541942";
310.1910 + results[23][58]="6.244796728573862E+46";
310.1911 + results[23][59]="0.000001332043916404155";
310.1912 + results[23][60]="3.225534515491407E+42";
310.1913 + results[23][61]="6.157628353187331E-12";
310.1914 + results[23][62]="2.306069679924920E+37";
310.1915 + results[23][63]="5.237291299199141E-17";
310.1916 + results[23][64]="2.409593553222759E+32";
310.1917 + results[23][65]="0.5682285475867381";
310.1918 + results[23][66]="5.065819010764803E+55";
310.1919 + results[23][67]="0.00001834249056626394";
310.1920 + results[23][68]="1.080719105044218E+51";
310.1921 + results[23][69]="8.146866126940509E-11";
310.1922 + results[23][70]="7.934950844489962E+45";
310.1923 + results[23][71]="4.978787334584325E-16";
310.1924 + results[23][72]="1.934014296859477E+41";
310.1925 + results[23][73]="9.434260716223996E-21";
310.1926 + results[23][74]="5.401477089023595E+35";
310.1927 + results[24][0]="7302690607518.291";
310.1928 + results[24][1]="16057748.30899485";
310.1929 + results[24][2]="360.2840150232697";
310.1930 + results[24][3]="0.004201304580784266";
310.1931 + results[24][4]="2.932377098408908E-8";
310.1932 + results[24][5]="91488346.14311905";
310.1933 + results[24][6]="5.685581812469896E+16";
310.1934 + results[24][7]="877.3675334597941";
310.1935 + results[24][8]="83816186216.83326";
310.1936 + results[24][9]="0.008178319168327438";
310.1937 + results[24][10]="2984729.151326427";
310.1938 + results[24][11]="9.910609488981233E-8";
310.1939 + results[24][12]="13.30725171553627";
310.1940 + results[24][13]="1.246922255961287E-12";
310.1941 + results[24][14]="0.0001002617627905542";
310.1942 + results[24][15]="10770.58253903672";
310.1943 + results[24][16]="1.237325155628808E+20";
310.1944 + results[24][17]="0.1274732831227585";
310.1945 + results[24][18]="971068060613965.9";
310.1946 + results[24][19]="8.216243700744122E-7";
310.1947 + results[24][20]="32861706944.73151";
310.1948 + results[24][21]="1.531921883031460E-11";
310.1949 + results[24][22]="188790.4410571613";
310.1950 + results[24][23]="1.678998593008280E-16";
310.1951 + results[24][24]="1";
310.1952 + results[24][25]="1.001066574251259";
310.1953 + results[24][26]="2.681329819411114E+24";
310.1954 + results[24][27]="0.00001167022238627271";
310.1955 + results[24][28]="4.135212705424321E+19";
310.1956 + results[24][29]="1.992125980518727E-10";
310.1957 + results[24][30]="93196194545840.82";
310.1958 + results[24][31]="2.430665374725046E-15";
310.1959 + results[24][32]="1894727561.549639";
310.1960 + results[24][33]="1.045881649206614E-20";
310.1961 + results[24][34]="50126.09728222654";
310.1962 + results[24][35]="0.0001230483065119351";
310.1963 + results[24][36]="2.592850152786563E+28";
310.1964 + results[24][37]="1.041085693348789E-9";
310.1965 + results[24][38]="1.268957724732794E+23";
310.1966 + results[24][39]="1.109587375069120E-14";
310.1967 + results[24][40]="2.300732126296780E+18";
310.1968 + results[24][41]="1.776430465518496E-19";
310.1969 + results[24][42]="8308801796717.613";
310.1970 + results[24][43]="3.204619562442379E-24";
310.1971 + results[24][44]="218265615.1727291";
310.1972 + results[24][45]="2.810936136197098E-8";
310.1973 + results[24][46]="1.530439394641047E+32";
310.1974 + results[24][47]="1.021847496313918E-13";
310.1975 + results[24][48]="1.267295275857541E+27";
310.1976 + results[24][49]="4.327591421469434E-18";
310.1977 + results[24][50]="4.270968127534385E+22";
310.1978 + results[24][51]="1.077174364147177E-23";
310.1979 + results[24][52]="7.653074902279439E+17";
310.1980 + results[24][53]="2.243759965412078E-28";
310.1981 + results[24][54]="3121010322433.718";
310.1982 + results[24][55]="1.136396466091162E-12";
310.1983 + results[24][56]="1.311794543487070E+36";
310.1984 + results[24][57]="1.139819072242488E-17";
310.1985 + results[24][58]="1.048500492089822E+31";
310.1986 + results[24][59]="2.236499861467814E-22";
310.1987 + results[24][60]="5.415667913209714E+26";
310.1988 + results[24][61]="1.033864934126942E-27";
310.1989 + results[24][62]="3.871887747972994E+21";
310.1990 + results[24][63]="8.793404722529862E-33";
310.1991 + results[24][64]="4.045704185582832E+16";
310.1992 + results[24][65]="9.540549319052715E-17";
310.1993 + results[24][66]="8.505502991508699E+39";
310.1994 + results[24][67]="3.079701585302480E-21";
310.1995 + results[24][68]="1.814525856806408E+35";
310.1996 + results[24][69]="1.367857676455993E-26";
310.1997 + results[24][70]="1.332277130348850E+30";
310.1998 + results[24][71]="8.359376929654525E-32";
310.1999 + results[24][72]="3.247207283284959E+25";
310.2000 + results[24][73]="1.584011046861337E-36";
310.2001 + results[24][74]="9.069072432637074E+19";
310.2002 + results[25][0]="7294910044299.792";
310.2003 + results[25][1]="16040639.77563644";
310.2004 + results[25][2]="359.9001547851519";
310.2005 + results[25][3]="0.004196828351727361";
310.2006 + results[25][4]="2.929252832762058E-8";
310.2007 + results[25][5]="91390870.99331748";
310.2008 + results[25][6]="5.679524178222003E+16";
310.2009 + results[25][7]="876.4327528526417";
310.2010 + results[25][8]="83726885276.85887";
310.2011 + results[25][9]="0.008169605677269126";
310.2012 + results[25][10]="2981549.107819164";
310.2013 + results[25][11]="9.900050350191554E-8";
310.2014 + results[25][12]="13.29307366544463";
310.2015 + results[25][13]="1.245593737753071E-12";
310.2016 + results[25][14]="0.0001001549401102962";
310.2017 + results[25][15]="10759.10715238146";
310.2018 + results[25][16]="1.236006862534849E+20";
310.2019 + results[25][17]="0.1273374682578942";
310.2020 + results[25][18]="970033447915559.5";
310.2021 + results[25][19]="8.207489803452292E-7";
310.2022 + results[25][20]="32826694837.26416";
310.2023 + results[25][21]="1.530289715424023E-11";
310.2024 + results[25][22]="188589.2965693774";
310.2025 + results[25][23]="1.677209724302378E-16";
310.2026 + results[25][24]="0.9989345621173533";
310.2027 + results[25][25]="1";
310.2028 + results[25][26]="2.678473029045643E+24";
310.2029 + results[25][27]="0.00001165778848924346";
310.2030 + results[25][28]="4.130806893155160E+19";
310.2031 + results[25][29]="1.990003494032078E-10";
310.2032 + results[25][30]="93096899789653.17";
310.2033 + results[25][31]="2.428075651754777E-15";
310.2034 + results[25][32]="1892708847.028269";
310.2035 + results[25][33]="1.044767327276784E-20";
310.2036 + results[25][34]="50072.69103927282";
310.2037 + results[25][35]="0.0001229172061847818";
310.2038 + results[25][36]="2.590087632009758E+28";
310.2039 + results[25][37]="1.039976481212013E-9";
310.2040 + results[25][38]="1.267605729101387E+23";
310.2041 + results[25][39]="1.108405178645614E-14";
310.2042 + results[25][40]="2.298280839131601E+18";
310.2043 + results[25][41]="1.774537789204645E-19";
310.2044 + results[25][42]="8299949284523.987";
310.2045 + results[25][43]="3.201205239361082E-24";
310.2046 + results[25][44]="218033066.7178449";
310.2047 + results[25][45]="2.807941258351893E-8";
310.2048 + results[25][46]="1.528808806532901E+32";
310.2049 + results[25][47]="1.020758781281058E-13";
310.2050 + results[25][48]="1.265945051462143E+27";
310.2051 + results[25][49]="4.322980641628383E-18";
310.2052 + results[25][50]="4.266417676295733E+22";
310.2053 + results[25][51]="1.076026701773399E-23";
310.2054 + results[25][52]="7.644921026359818E+17";
310.2055 + results[25][53]="2.241369378545362E-28";
310.2056 + results[25][54]="3117685079804.065";
310.2057 + results[25][55]="1.135185706246483E-12";
310.2058 + results[25][56]="1.310396907886189E+36";
310.2059 + results[25][57]="1.138604665823557E-17";
310.2060 + results[25][58]="1.047383379945576E+31";
310.2061 + results[25][59]="2.234117009790872E-22";
310.2062 + results[25][60]="5.409897855455146E+26";
310.2063 + results[25][61]="1.032763415260583E-27";
310.2064 + results[25][62]="3.867762492088947E+21";
310.2065 + results[25][63]="8.784035896021034E-33";
310.2066 + results[25][64]="4.041393739081530E+16";
310.2067 + results[25][65]="9.530384456386937E-17";
310.2068 + results[25][66]="8.496440906410580E+39";
310.2069 + results[25][67]="3.076420354566251E-21";
310.2070 + results[25][68]="1.812592592219525E+35";
310.2071 + results[25][69]="1.366400309069427E-26";
310.2072 + results[25][70]="1.330857671823993E+30";
310.2073 + results[25][71]="8.350470532798348E-32";
310.2074 + results[25][72]="3.243747585632540E+25";
310.2075 + results[25][73]="1.582323381485480E-36";
310.2076 + results[25][74]="9.059409899306875E+19";
310.2077 + results[26][0]="2.723533134436308E-12";
310.2078 + results[26][1]="5.988725516997952E-18";
310.2079 + results[26][2]="1.343676605597132E-22";
310.2080 + results[26][3]="1.566873478364917E-27";
310.2081 + results[26][4]="1.093627899552070E-32";
310.2082 + results[26][5]="3.412051194925813E-17";
310.2083 + results[26][6]="2.120433589075808E-8";
310.2084 + results[26][7]="3.272135815251872E-22";
310.2085 + results[26][8]="3.125918550193178E-14";
310.2086 + results[26][9]="3.050098167380094E-27";
310.2087 + results[26][10]="1.113152559494507E-18";
310.2088 + results[26][11]="3.696154578685082E-32";
310.2089 + results[26][12]="4.962929819077190E-24";
310.2090 + results[26][13]="4.650387456755103E-37";
310.2091 + results[26][14]="3.739255128732137E-29";
310.2092 + results[26][15]="4.016880900314683E-21";
310.2093 + results[26][16]="0.00004614595141080237";
310.2094 + results[26][17]="4.754106794320244E-26";
310.2095 + results[26][18]="3.621591247686330E-10";
310.2096 + results[26][19]="3.064242094077263E-31";
310.2097 + results[26][20]="1.225574963096063E-14";
310.2098 + results[26][21]="5.713291486714258E-36";
310.2099 + results[26][22]="7.040925726124371E-20";
310.2100 + results[26][23]="6.261813003582785E-41";
310.2101 + results[26][24]="3.729492704555177E-25";
310.2102 + results[26][25]="3.733470485444113E-25";
310.2103 + results[26][26]="1";
310.2104 + results[26][27]="4.352400925014057E-30";
310.2105 + results[26][28]="0.00001542224561666388";
310.2106 + results[26][29]="7.429619310899423E-35";
310.2107 + results[26][30]="3.475745276510183E-11";
310.2108 + results[26][31]="9.065148782251936E-40";
310.2109 + results[26][32]="7.066372617918999E-16";
310.2110 + results[26][33]="3.900607980544203E-45";
310.2111 + results[26][34]="1.869449141218870E-20";
310.2112 + results[26][35]="4.589077614441313E-29";
310.2113 + results[26][36]="9670.015728822264";
310.2114 + results[26][37]="3.882721498161075E-34";
310.2115 + results[26][38]="0.04732568576779893";
310.2116 + results[26][39]="4.138198020386811E-39";
310.2117 + results[26][40]="8.580563680159561E-7";
310.2118 + results[26][41]="6.625184461300789E-44";
310.2119 + results[26][42]="3.098761568445328E-12";
310.2120 + results[26][43]="1.195160527900366E-48";
310.2121 + results[26][44]="8.140200194419411E-17";
310.2122 + results[26][45]="1.048336581291759E-32";
310.2123 + results[26][46]="57077625.57077626";
310.2124 + results[26][47]="3.810972782670732E-38";
310.2125 + results[26][48]="472.6368485827938";
310.2126 + results[26][49]="1.613972063466582E-42";
310.2127 + results[26][50]="0.01592854447302717";
310.2128 + results[26][51]="4.017313932620759E-48";
310.2129 + results[26][52]="2.854208701546549E-7";
310.2130 + results[26][53]="8.368086421777320E-53";
310.2131 + results[26][54]="1.163978522835795E-12";
310.2132 + results[26][55]="4.238182329769274E-37";
310.2133 + results[26][56]="489232817981.0316";
310.2134 + results[26][57]="4.250946914441208E-42";
310.2135 + results[26][58]="3910374.935971505";
310.2136 + results[26][59]="8.341009917082876E-47";
310.2137 + results[26][60]="201.9769397260919";
310.2138 + results[26][61]="3.855791729321848E-52";
310.2139 + results[26][62]="0.001444017710892185";
310.2140 + results[26][63]="3.279493876087616E-57";
310.2141 + results[26][64]="1.508842424491952E-8";
310.2142 + results[26][65]="3.558140908285596E-41";
310.2143 + results[26][66]="3172121135540393";
310.2144 + results[26][67]="1.148572459459261E-45";
310.2145 + results[26][68]="67672609451.86232";
310.2146 + results[26][69]="5.101415225212420E-51";
310.2147 + results[26][70]="496871.7838081744";
310.2148 + results[26][71]="3.117623527377340E-56";
310.2149 + results[26][72]="12.11043587318969";
310.2150 + results[26][73]="5.907557643204166E-61";
310.2151 + results[26][74]="0.00003382303947460244";
310.2152 + results[27][0]="6.257541943766386E+17";
310.2153 + results[27][1]="1375959067231.062";
310.2154 + results[27][2]="30872077.93461244";
310.2155 + results[27][3]="360.0021012218345";
310.2156 + results[27][4]="0.002512700273696726";
310.2157 + results[27][5]="7839468959112.017";
310.2158 + results[27][6]="4.871871010065461E+21";
310.2159 + results[27][7]="75180018.37666884";
310.2160 + results[27][8]="7182055614931850";
310.2161 + results[27][9]="700.7852033691596";
310.2162 + results[27][10]="255755978980.9374";
310.2163 + results[27][11]="0.008492219908884301";
310.2164 + results[27][12]="1140274.047492801";
310.2165 + results[27][13]="1.068464862698761E-7";
310.2166 + results[27][14]="8.591246976449121";
310.2167 + results[27][15]="922911507.8137501";
310.2168 + results[27][16]="1.060241283048926E+25";
310.2169 + results[27][17]="10922.95235716340";
310.2170 + results[27][18]="8.320904507836979E+19";
310.2171 + results[27][19]="0.07040348871507895";
310.2172 + results[27][20]="2815859531810263";
310.2173 + results[27][21]="0.000001312675827697515";
310.2174 + results[27][22]="16177107411.35740";
310.2175 + results[27][23]="1.438703169001500E-11";
310.2176 + results[27][24]="85688.17001947338";
310.2177 + results[27][25]="85779.56281525363";
310.2178 + results[27][26]="2.297582454439834E+29";
310.2179 + results[27][27]="1";
310.2180 + results[27][28]="3.543388093690857E+24";
310.2181 + results[27][29]="0.00001707016297188988";
310.2182 + results[27][30]="7.985811363411926E+18";
310.2183 + results[27][31]="2.082792678898868E-10";
310.2184 + results[27][32]="162355737434647.7";
310.2185 + results[27][33]="8.961968457746355E-16";
310.2186 + results[27][34]="4295213546.332090";
310.2187 + results[27][35]="10.54378420900297";
310.2188 + results[27][36]="2.221765847269926E+33";
310.2189 + results[27][37]="0.00008920872789651233";
310.2190 + results[27][38]="1.087346652644278E+28";
310.2191 + results[27][39]="9.507851164638391E-10";
310.2192 + results[27][40]="1.971455256073830E+23";
310.2193 + results[27][41]="1.522190757571212E-14";
310.2194 + results[27][42]="7.119660210152448E+17";
310.2195 + results[27][43]="2.745979859142930E-19";
310.2196 + results[27][44]="18702781142325.76";
310.2197 + results[27][45]="0.002408639735523385";
310.2198 + results[27][46]="1.311405510525019E+37";
310.2199 + results[27][47]="8.756024199812025E-9";
310.2200 + results[27][48]="1.085922130625564E+32";
310.2201 + results[27][49]="3.708233894976874E-13";
310.2202 + results[27][50]="3.659714430599182E+27";
310.2203 + results[27][51]="9.230110005566145E-19";
310.2204 + results[27][52]="6.557779833982852E+22";
310.2205 + results[27][53]="1.922636853991178E-23";
310.2206 + results[27][54]="2.674336631412318E+17";
310.2207 + results[27][55]="9.737573359594823E-8";
310.2208 + results[27][56]="1.124052738729375E+41";
310.2209 + results[27][57]="9.766901045375269E-13";
310.2210 + results[27][58]="8.984408843169418E+35";
310.2211 + results[27][59]="1.916415803779827E-17";
310.2212 + results[27][60]="4.640586729161206E+31";
310.2213 + results[27][61]="8.858999425264104E-23";
310.2214 + results[27][62]="3.317749756446258E+26";
310.2215 + results[27][63]="7.534907589141790E-28";
310.2216 + results[27][64]="3.466689881027168E+21";
310.2217 + results[27][65]="8.175122121301600E-12";
310.2218 + results[27][66]="7.288209864375369E+44";
310.2219 + results[27][67]="2.638939930506406E-16";
310.2220 + results[27][68]="1.554834001227581E+40";
310.2221 + results[27][69]="1.172092211426029E-21";
310.2222 + results[27][70]="1.141603892583884E+35";
310.2223 + results[27][71]="7.162997116051003E-27";
310.2224 + results[27][72]="2.782472497785938E+30";
310.2225 + results[27][73]="1.357310078961783E-31";
310.2226 + results[27][74]="7.771122205267246E+24";
310.2227 + results[28][0]="1.765977019256848E-7";
310.2228 + results[28][1]="3.883173479306462E-13";
310.2229 + results[28][2]="8.712587252178613E-18";
310.2230 + results[28][3]="1.015982702721253E-22";
310.2231 + results[28][4]="7.091236430383361E-28";
310.2232 + results[28][5]="2.212421770302413E-12";
310.2233 + results[28][6]="0.001374918829450271";
310.2234 + results[28][7]="2.121698679027844E-17";
310.2235 + results[28][8]="2.026889357030855E-9";
310.2236 + results[28][9]="1.977726359178481E-22";
310.2237 + results[28][10]="7.217837059291388E-14";
310.2238 + results[28][11]="2.396638382345144E-27";
310.2239 + results[28][12]="3.218033185591791E-19";
310.2240 + results[28][13]="3.015376341646586E-32";
310.2241 + results[28][14]="2.424585382489199E-24";
310.2242 + results[28][15]="2.604601820097072E-16";
310.2243 + results[28][16]="2.992168102999295";
310.2244 + results[28][17]="3.082629412401127E-21";
310.2245 + results[28][18]="0.00002348290474490412";
310.2246 + results[28][19]="1.986897479292069E-26";
310.2247 + results[28][20]="7.946799665619501E-10";
310.2248 + results[28][21]="3.704578197445509E-31";
310.2249 + results[28][22]="4.565434827802628E-15";
310.2250 + results[28][23]="4.060247229376789E-36";
310.2251 + results[28][24]="2.418255289959476E-20";
310.2252 + results[28][25]="2.420834538784717E-20";
310.2253 + results[28][26]="64841.40019917012";
310.2254 + results[28][27]="2.822157702060747E-25";
310.2255 + results[28][28]="1";
310.2256 + results[28][29]="4.817469190655120E-30";
310.2257 + results[28][30]="0.000002253721904645720";
310.2258 + results[28][31]="5.877969400550175E-35";
310.2259 + results[28][32]="4.581934948749433E-11";
310.2260 + results[28][33]="2.529208830865435E-40";
310.2261 + results[28][34]="1.212176999177676E-15";
310.2262 + results[28][35]="2.975622181430421E-24";
310.2263 + results[28][36]="627017359.8048342";
310.2264 + results[28][37]="2.517610985241837E-29";
310.2265 + results[28][38]="3068.663730570020";
310.2266 + results[28][39]="2.683265539433148E-34";
310.2267 + results[28][40]="0.05563757635196901";
310.2268 + results[28][41]="4.295862370485278E-39";
310.2269 + results[28][42]="2.009280389813716E-7";
310.2270 + results[28][43]="7.749588209183903E-44";
310.2271 + results[28][44]="5.278219785077115E-12";
310.2272 + results[28][45]="6.797561181096882E-28";
310.2273 + results[28][46]="3700993162053.089";
310.2274 + results[28][47]="2.471088113492979E-33";
310.2275 + results[28][48]="30646435.04783151";
310.2276 + results[28][49]="1.046522084775171E-37";
310.2277 + results[28][50]="1032.829126765834";
310.2278 + results[28][51]="2.604882604307646E-43";
310.2279 + results[28][52]="0.01850708886689335";
310.2280 + results[28][53]="5.425984405757048E-48";
310.2281 + results[28][54]="7.547399722243467E-8";
310.2282 + results[28][55]="2.748096765616207E-32";
310.2283 + results[28][56]="3.172254094127582E+16";
310.2284 + results[28][57]="2.756373501047097E-37";
310.2285 + results[28][58]="253554186152.1326";
310.2286 + results[28][59]="5.408427620988176E-42";
310.2287 + results[28][60]="13096467.57978319";
310.2288 + results[28][61]="2.500149346056082E-47";
310.2289 + results[28][62]="93.63213028664973";
310.2290 + results[28][63]="2.126469748701247E-52";
310.2291 + results[28][64]="0.0009783545548396877";
310.2292 + results[28][65]="2.307148385991850E-36";
310.2293 + results[28][66]="2.056847760298206E+20";
310.2294 + results[28][67]="7.447504650154305E-41";
310.2295 + results[28][68]="4387986751990347";
310.2296 + results[28][69]="3.307829062001381E-46";
310.2297 + results[28][70]="32217862181.58138";
310.2298 + results[28][71]="2.021510748090225E-51";
310.2299 + results[28][72]="785257.6190398789";
310.2300 + results[28][73]="3.830543093426676E-56";
310.2301 + results[28][74]="2.193133238525025";
310.2302 + results[29][0]="3.665777505505325E+22";
310.2303 + results[29][1]="8.060608850055552E+16";
310.2304 + results[29][2]="1808540315956.603";
310.2305 + results[29][3]="21089552.67824123";
310.2306 + results[29][4]="147.1983763619884";
310.2307 + results[29][5]="4.592498016581085E+17";
310.2308 + results[29][6]="2.854027239276019E+26";
310.2309 + results[29][7]="4404176954869.778";
310.2310 + results[29][8]="4.207373782405491E+20";
310.2311 + results[29][9]="41053222.77960500";
310.2312 + results[29][10]="1.498263252683064E+16";
310.2313 + results[29][11]="497.4890938574387";
310.2314 + results[29][12]="66799247867.20172";
310.2315 + results[29][13]="0.006259254023867518";
310.2316 + results[29][14]="503290.2726585955";
310.2317 + results[29][15]="54065770158934.34";
310.2318 + results[29][16]="6.211078856100365E+29";
310.2319 + results[29][17]="639885651.6572606";
310.2320 + results[29][18]="4.874531380596274E+24";
310.2321 + results[29][19]="4124.359493873326";
310.2322 + results[29][20]="1.649579758814986E+20";
310.2323 + results[29][21]="0.07689884565596421";
310.2324 + results[29][22]="947683243446292.2";
310.2325 + results[29][23]="8.428174771211442E-7";
310.2326 + results[29][24]="5019762855.256830";
310.2327 + results[29][25]="5025116805.065672";
310.2328 + results[29][26]="1.345963983017241E+34";
310.2329 + results[29][27]="58581.74884719846";
310.2330 + results[29][28]="2.075778713727511E+29";
310.2331 + results[29][29]="1";
310.2332 + results[29][30]="4.678227956325009E+23";
310.2333 + results[29][31]="0.00001220136376160371";
310.2334 + results[29][32]="9.511083034298228E+18";
310.2335 + results[29][33]="5.250077853682115E-11";
310.2336 + results[29][34]="251621121216311.1";
310.2337 + results[29][35]="617673.3184308691";
310.2338 + results[29][36]="1.301549288620499E+38";
310.2339 + results[29][37]="5.226003292611552";
310.2340 + results[29][38]="6.369866851504902E+32";
310.2341 + results[29][39]="0.00005569865490033896";
310.2342 + results[29][40]="1.154912966748064E+28";
310.2343 + results[29][41]="8.917259665756348E-10";
310.2344 + results[29][42]="4.170821463085429E+22";
310.2345 + results[29][43]="1.608643024477765E-14";
310.2346 + results[29][44]="1.095641627623847E+18";
310.2347 + results[29][45]="141.1023280498135";
310.2348 + results[29][46]="7.682442825440876E+41";
310.2349 + results[29][47]="0.0005129432105733799";
310.2350 + results[29][48]="6.361521752392140E+36";
310.2351 + results[29][49]="2.172348267022037E-8";
310.2352 + results[29][50]="2.143924716258292E+32";
310.2353 + results[29][51]="5.407159861780895E-14";
310.2354 + results[29][52]="3.841662112296063E+27";
310.2355 + results[29][53]="1.126314293048790E-18";
310.2356 + results[29][54]="1.566673168742592E+22";
310.2357 + results[29][55]="0.005704440769329544";
310.2358 + results[29][56]="6.584897523124984E+45";
310.2359 + results[29][57]="5.721621440556141E-8";
310.2360 + results[29][58]="5.263223823910997E+40";
310.2361 + results[29][59]="1.122669893038318E-12";
310.2362 + results[29][60]="2.718536862713640E+36";
310.2363 + results[29][61]="5.189756793682972E-18";
310.2364 + results[29][62]="1.943595829699885E+31";
310.2365 + results[29][63]="4.414080639739539E-23";
310.2366 + results[29][64]="2.030847559414579E+26";
310.2367 + results[29][65]="4.789129509052666E-7";
310.2368 + results[29][66]="4.269560798205122E+49";
310.2369 + results[29][67]="1.545937162317696E-11";
310.2370 + results[29][68]="9.108489495899883E+44";
310.2371 + results[29][69]="6.866321155551707E-17";
310.2372 + results[29][70]="6.687715251833322E+39";
310.2373 + results[29][71]="4.196208980457067E-22";
310.2374 + results[29][72]="1.630021050395328E+35";
310.2375 + results[29][73]="7.951359815351027E-27";
310.2376 + results[29][74]="4.552459292898528E+29";
310.2377 + results[30][0]="0.07835824888672127";
310.2378 + results[30][1]="1.723004720015306E-7";
310.2379 + results[30][2]="3.865866163087327E-12";
310.2380 + results[30][3]="4.508021600300163E-17";
310.2381 + results[30][4]="3.146455831913338E-22";
310.2382 + results[30][5]="9.816746980813501E-7";
310.2383 + results[30][6]="610.0658766354783";
310.2384 + results[30][7]="9.414199128358610E-12";
310.2385 + results[30][8]="0.0008993520242460782";
310.2386 + results[30][9]="8.775378874836710E-17";
310.2387 + results[30][10]="3.202629856156106E-8";
310.2388 + results[30][11]="1.063413537138199E-21";
310.2389 + results[30][12]="1.427875009316049E-13";
310.2390 + results[30][13]="1.337954046340334E-26";
310.2391 + results[30][14]="1.075813913638266E-18";
310.2392 + results[30][15]="1.155689091332903E-10";
310.2393 + results[30][16]="1327656.307919525";
310.2394 + results[30][17]="1.367794937807870E-15";
310.2395 + results[30][18]="10.41961064339727";
310.2396 + results[30][19]="8.816072094770739E-21";
310.2397 + results[30][20]="0.0003526078195024119";
310.2398 + results[30][21]="1.643760124001572E-25";
310.2399 + results[30][22]="2.025731221936322E-9";
310.2400 + results[30][23]="1.801574196446855E-30";
310.2401 + results[30][24]="1.073005185322375E-14";
310.2402 + results[30][25]="1.074149625024506E-14";
310.2403 + results[30][26]="28770807997.87632";
310.2404 + results[30][27]="1.252220913433587E-19";
310.2405 + results[30][28]="443710.4675331262";
310.2406 + results[30][29]="2.137561506912014E-24";
310.2407 + results[30][30]="1";
310.2408 + results[30][31]="2.608116550863527E-29";
310.2409 + results[30][32]="0.00002033052498315981";
310.2410 + results[30][33]="1.122236432832213E-34";
310.2411 + results[30][34]="5.378556230380286E-10";
310.2412 + results[30][35]="1.320314709324433E-18";
310.2413 + results[30][36]="278214165870389.4";
310.2414 + results[30][37]="1.117090347328190E-23";
310.2415 + results[30][38]="1361598218.593171";
310.2416 + results[30][39]="1.190593007017408E-28";
310.2417 + results[30][40]="24686.97501554217";
310.2418 + results[30][41]="1.906119100865986E-33";
310.2419 + results[30][42]="0.08915387411693861";
310.2420 + results[30][43]="3.438573407486192E-38";
310.2421 + results[30][44]="0.000002342001368579163";
310.2422 + results[30][45]="3.016149049749527E-22";
310.2423 + results[30][46]="1.642169406271479E+18";
310.2424 + results[30][47]="1.096447662153521E-27";
310.2425 + results[30][48]="13598144023296.90";
310.2426 + results[30][49]="4.643528035193328E-32";
310.2427 + results[30][50]="458277094.7190988";
310.2428 + results[30][51]="1.155813678226253E-37";
310.2429 + results[30][52]="8211.789053806363";
310.2430 + results[30][53]="2.407566077505911E-42";
310.2431 + results[30][54]="0.03348860259416035";
310.2432 + results[30][55]="1.219359300697839E-26";
310.2433 + results[30][56]="1.407562347239223E+22";
310.2434 + results[30][57]="1.223031774845527E-31";
310.2435 + results[30][58]="1.125046464825440E+17";
310.2436 + results[30][59]="2.399775948327737E-36";
310.2437 + results[30][60]="5811039752858.027";
310.2438 + results[30][61]="1.109342435241184E-41";
310.2439 + results[30][62]="41545556.30561193";
310.2440 + results[30][63]="9.435368863912798E-47";
310.2441 + results[30][64]="434.1061569410814";
310.2442 + results[30][65]="1.023705889016741E-30";
310.2443 + results[30][66]="9.126448813663803E+25";
310.2444 + results[30][67]="3.304535770275098E-35";
310.2445 + results[30][68]="1.946995653254801E+21";
310.2446 + results[30][69]="1.467718379620295E-40";
310.2447 + results[30][70]="1.429540269150730E+16";
310.2448 + results[30][71]="8.969654791583536E-46";
310.2449 + results[30][72]="348427025278.1341";
310.2450 + results[30][73]="1.699652066890138E-50";
310.2451 + results[30][74]="973116.1746283781";
310.2452 + results[31][0]="3.004399817208225E+27";
310.2453 + results[31][1]="6.606317955556214E+21";
310.2454 + results[31][2]="1.482244404226248E+17";
310.2455 + results[31][3]="1728458645303.865";
310.2456 + results[31][4]="12064092.11609646";
310.2457 + results[31][5]="3.763921891283291E+22";
310.2458 + results[31][6]="2.339105115657083E+31";
310.2459 + results[31][7]="3.609577618470172E+17";
310.2460 + results[31][8]="3.448281572954666E+25";
310.2461 + results[31][9]="3364642148346.955";
310.2462 + results[31][10]="1.227947368799811E+21";
310.2463 + results[31][11]="40773236.79365905";
310.2464 + results[31][12]="5474736199359228";
310.2465 + results[31][13]="512.9962638737704";
310.2466 + results[31][14]="41248690104.82190";
310.2467 + results[31][15]="4.431125177094802E+18";
310.2468 + results[31][16]="5.090479209910875E+34";
310.2469 + results[31][17]="52443781216564.26";
310.2470 + results[31][18]="3.995070941115503E+29";
310.2471 + results[31][19]="338024467.9576074";
310.2472 + results[31][20]="1.351963428879995E+25";
310.2473 + results[31][21]="6302.479555437567";
310.2474 + results[31][22]="7.767027210749525E+19";
310.2475 + results[31][23]="0.06907567822651053";
310.2476 + results[31][24]="411409982796631.8";
310.2477 + results[31][25]="411848782090993.5";
310.2478 + results[31][26]="1.103125854876022E+39";
310.2479 + results[31][27]="4801245991.169322";
310.2480 + results[31][28]="1.701267787999033E+34";
310.2481 + results[31][29]="81958.05153739330";
310.2482 + results[31][30]="3.834184479481592E+28";
310.2483 + results[31][31]="1";
310.2484 + results[31][32]="7.795098335014412E+23";
310.2485 + results[31][33]="0.000004302861513074059";
310.2486 + results[31][34]="2.062237682054311E+19";
310.2487 + results[31][35]="50623301665.22991";
310.2488 + results[31][36]="1.066724436752164E+43";
310.2489 + results[31][37]="428313.0471904447";
310.2490 + results[31][38]="5.220618757019720E+37";
310.2491 + results[31][39]="4.564953228885464";
310.2492 + results[31][40]="9.465441644994164E+32";
310.2493 + results[31][41]="0.00007308412272583773";
310.2494 + results[31][42]="3.418324004248217E+27";
310.2495 + results[31][43]="1.318412479054169E-9";
310.2496 + results[31][44]="8.979665298330876E+22";
310.2497 + results[31][45]="11564471.87435279";
310.2498 + results[31][46]="6.296380450205607E+46";
310.2499 + results[31][47]="42.03982608792905";
310.2500 + results[31][48]="5.213779276388035E+41";
310.2501 + results[31][49]="0.001780414312257591";
310.2502 + results[31][50]="1.757118923873884E+37";
310.2503 + results[31][51]="4.431602866227630E-9";
310.2504 + results[31][52]="3.148551413888119E+32";
310.2505 + results[31][53]="9.231052487699542E-14";
310.2506 + results[31][54]="1.284014803060566E+27";
310.2507 + results[31][55]="467.5248505647183";
310.2508 + results[31][56]="5.396853705687309E+50";
310.2509 + results[31][57]="0.004689329449025547";
310.2510 + results[31][58]="4.313635694129337E+45";
310.2511 + results[31][59]="9.201183695311428E-8";
310.2512 + results[31][60]="2.228059843005880E+41";
310.2513 + results[31][61]="4.253423547632060E-13";
310.2514 + results[31][62]="1.592933271784059E+36";
310.2515 + results[31][63]="3.617694485619832E-18";
310.2516 + results[31][64]="1.664443089390894E+31";
310.2517 + results[31][65]="0.03925077231221895";
310.2518 + results[31][66]="3.499248839413294E+54";
310.2519 + results[31][67]="0.000001267019976228053";
310.2520 + results[31][68]="7.465140515327681E+49";
310.2521 + results[31][69]="5.627503031390007E-12";
310.2522 + results[31][70]="5.481121112771666E+44";
310.2523 + results[31][71]="3.439131118819729E-17";
310.2524 + results[31][72]="1.335933492553362E+40";
310.2525 + results[31][73]="6.516779575388975E-22";
310.2526 + results[31][74]="3.731106933492626E+34";
310.2527 + results[32][0]="3854.216698861785";
310.2528 + results[32][1]="0.008474964229612891";
310.2529 + results[32][2]="1.901508281900985E-7";
310.2530 + results[32][3]="2.217366056230347E-12";
310.2531 + results[32][4]="1.547651049109460E-17";
310.2532 + results[32][5]="0.04828575252702482";
310.2533 + results[32][6]="30007384.32189076";
310.2534 + results[32][7]="4.630573551915940E-7";
310.2535 + results[32][8]="44.23653717702960";
310.2536 + results[32][9]="4.316356258436777E-12";
310.2537 + results[32][10]="0.001575281434595963";
310.2538 + results[32][11]="5.230625072490977E-17";
310.2539 + results[32][12]="7.023306139407549E-9";
310.2540 + results[32][13]="6.581010807387358E-22";
310.2541 + results[32][14]="5.291618954893612E-14";
310.2542 + results[32][15]="0.000005684501960919277";
310.2543 + results[32][16]="65303591964.26306";
310.2544 + results[32][17]="6.727789562447809E-11";
310.2545 + results[32][18]="512510.6534153962";
310.2546 + results[32][19]="4.336372081917841E-16";
310.2547 + results[32][20]="17.34376361626097";
310.2548 + results[32][21]="8.085182873354881E-21";
310.2549 + results[32][22]="0.00009963988749008084";
310.2550 + results[32][23]="8.861424866987624E-26";
310.2551 + results[32][24]="5.277803628834801E-10";
310.2552 + results[32][25]="5.283432798288516E-10";
310.2553 + results[32][26]="1415153225099094";
310.2554 + results[32][27]="6.159314205957922E-15";
310.2555 + results[32][28]="21824840622.69226";
310.2556 + results[32][29]="1.051404972907783E-19";
310.2557 + results[32][30]="49187.12137676328";
310.2558 + results[32][31]="1.282857453520695E-24";
310.2559 + results[32][32]="1";
310.2560 + results[32][33]="5.519957963514394E-30";
310.2561 + results[32][34]="0.00002645556981354615";
310.2562 + results[32][35]="6.494247986306681E-14";
310.2563 + results[32][36]="1.368455394540179E+19";
310.2564 + results[32][37]="5.494645850284232E-19";
310.2565 + results[32][38]="66973096844326.95";
310.2566 + results[32][39]="5.856184274649082E-24";
310.2567 + results[32][40]="1214281236.514595";
310.2568 + results[32][41]="9.375651157286216E-29";
310.2569 + results[32][42]="4385.222427398534";
310.2570 + results[32][43]="1.691335275569338E-33";
310.2571 + results[32][44]="0.1151963055808490";
310.2572 + results[32][45]="1.483556894004392E-17";
310.2573 + results[32][46]="8.077358590748254E+22";
310.2574 + results[32][47]="5.393110424161355E-23";
310.2575 + results[32][48]="6.688535605726128E+17";
310.2576 + results[32][49]="2.284017770834574E-27";
310.2577 + results[32][50]="22541331082138.75";
310.2578 + results[32][51]="5.685114767983791E-33";
310.2579 + results[32][52]="403914264.9099497";
310.2580 + results[32][53]="1.184212448768611E-37";
310.2581 + results[32][54]="1647.207960537155";
310.2582 + results[32][55]="5.997677392530980E-22";
310.2583 + results[32][56]="6.923394001901749E+26";
310.2584 + results[32][57]="6.015741235696518E-27";
310.2585 + results[32][58]="5.533779701986738E+21";
310.2586 + results[32][59]="1.180380708474336E-31";
310.2587 + results[32][60]="2.858283176490243E+17";
310.2588 + results[32][61]="5.456536101060227E-37";
310.2589 + results[32][62]="2043506320669.287";
310.2590 + results[32][63]="4.640986335438119E-42";
310.2591 + results[32][64]="21352432.23186122";
310.2592 + results[32][65]="5.035314581717381E-26";
310.2593 + results[32][66]="4.489037455364987E+30";
310.2594 + results[32][67]="1.625406020263772E-30";
310.2595 + results[32][68]="9.576711151667440E+25";
310.2596 + results[32][69]="7.219284208528977E-36";
310.2597 + results[32][70]="7.031497073168779E+20";
310.2598 + results[32][71]="4.411914989412857E-41";
310.2599 + results[32][72]="1.713812238330015E+16";
310.2600 + results[32][73]="8.360099251239178E-46";
310.2601 + results[32][74]="47864783395.13761";
310.2602 + results[33][0]="6.982329800946383E+32";
310.2603 + results[33][1]="1.535331298830604E+27";
310.2604 + results[33][2]="3.444787613364996E+22";
310.2605 + results[33][3]="4.016998083837972E+17";
310.2606 + results[33][4]="2803737019990.124";
310.2607 + results[33][5]="8.747485550828852E+27";
310.2608 + results[33][6]="5.436161746200319E+36";
310.2609 + results[33][7]="8.388784085898711E+22";
310.2610 + results[33][8]="8.013926459118452E+30";
310.2611 + results[33][9]="7.819545523655909E+17";
310.2612 + results[33][10]="2.853792447348690E+26";
310.2613 + results[33][11]="9475842220292.549";
310.2614 + results[33][12]="1.272347758049958E+21";
310.2615 + results[33][13]="119222118.1915926";
310.2616 + results[33][14]="9586339225533875";
310.2617 + results[33][15]="1.029808922186089E+24";
310.2618 + results[33][16]="1.183045095558775E+40";
310.2619 + results[33][17]="1.218811738588753E+19";
310.2620 + results[33][18]="9.284683992214605E+34";
310.2621 + results[33][19]="78558063495777.08";
310.2622 + results[33][20]="3.142010089732407E+30";
310.2623 + results[33][21]="1464718196.550773";
310.2624 + results[33][22]="1.805084171812118E+25";
310.2625 + results[33][23]="16053.42817021349";
310.2626 + results[33][24]="9.561311270339060E+19";
310.2627 + results[33][25]="9.571509118748273E+19";
310.2628 + results[33][26]="2.563702902183168E+44";
310.2629 + results[33][27]="1115826288292324";
310.2630 + results[33][28]="3.953805584562284E+39";
310.2631 + results[33][29]="19047336589.46896";
310.2632 + results[33][30]="8.910778252638594E+33";
310.2633 + results[33][31]="232403.4824178150";
310.2634 + results[33][32]="1.811607998846661E+29";
310.2635 + results[33][33]="1";
310.2636 + results[33][34]="4.792712188826647E+24";
310.2637 + results[33][35]="1.176503159848700E+16";
310.2638 + results[33][36]="2.479104738813852E+48";
310.2639 + results[33][37]="99541443732.04527";
310.2640 + results[33][38]="1.213289979507148E+43";
310.2641 + results[33][39]="1060911.027467431";
310.2642 + results[33][40]="2.199801600919255E+38";
310.2643 + results[33][41]="16.98500463093566";
310.2644 + results[33][42]="7.944304026196954E+32";
310.2645 + results[33][43]="0.0003064036513952934";
310.2646 + results[33][44]="2.086905486278503E+28";
310.2647 + results[33][45]="2687623535922.464";
310.2648 + results[33][46]="1.463300743255233E+52";
310.2649 + results[33][47]="9770201.983074019";
310.2650 + results[33][48]="1.211700460390415E+47";
310.2651 + results[33][49]="413.7744863151833";
310.2652 + results[33][50]="4.083605569305342E+42";
310.2653 + results[33][51]="0.001029919938804072";
310.2654 + results[33][52]="7.317343131591340E+37";
310.2655 + results[33][53]="2.145328744523008E-8";
310.2656 + results[33][54]="2.984095117073005E+32";
310.2657 + results[33][55]="108654403.3881091";
310.2658 + results[33][56]="1.254247595301220E+56";
310.2659 + results[33][57]="1089.816494157951";
310.2660 + results[33][58]="1.002503957197447E+51";
310.2661 + results[33][59]="0.02138387133156396";
310.2662 + results[33][60]="5.178088665498566E+46";
310.2663 + results[33][61]="9.885104446676278E-8";
310.2664 + results[33][62]="3.702032396218190E+41";
310.2665 + results[33][63]="8.407647967817748E-13";
310.2666 + results[33][64]="3.868223702607104E+36";
310.2667 + results[33][65]="9122.016172948436";
310.2668 + results[33][66]="8.132376161261471E+59";
310.2669 + results[33][67]="0.2944598547683367";
310.2670 + results[33][68]="1.734924652500475E+55";
310.2671 + results[33][69]="0.000001307851301811848";
310.2672 + results[33][70]="1.273831634161944E+50";
310.2673 + results[33][71]="7.992660485051813E-12";
310.2674 + results[33][72]="3.104755959479955E+45";
310.2675 + results[33][73]="1.514522267469688E-16";
310.2676 + results[33][74]="8.671222446169412E+39";
310.2677 + results[34][0]="145686398.9710135";
310.2678 + results[34][1]="320.3470682862941";
310.2679 + results[34][2]="0.007187553680765358";
310.2680 + results[34][3]="8.381471545908569E-8";
310.2681 + results[34][4]="5.850000812747606E-13";
310.2682 + results[34][5]="1825.163958566520";
310.2683 + results[34][6]="1134255830941.353";
310.2684 + results[34][7]="0.01750320852868166";
310.2685 + results[34][8]="1672106.761971122";
310.2686 + results[34][9]="1.631549155379241E-7";
310.2687 + results[34][10]="59.54441524783812";
310.2688 + results[34][11]="1.977135669106896E-12";
310.2689 + results[34][12]="0.0002654755194806417";
310.2690 + results[34][13]="2.487570993091087E-17";
310.2691 + results[34][14]="2.000190883125157E-9";
310.2692 + results[34][15]="0.2148697609230333";
310.2693 + results[34][16]="2468425077384854";
310.2694 + results[34][17]="0.000002543052222977617";
310.2695 + results[34][18]="19372504808.15474";
310.2696 + results[34][19]="1.639114981260948E-11";
310.2697 + results[34][20]="655580.7997520574";
310.2698 + results[34][21]="3.056136356290082E-16";
310.2699 + results[34][22]="3.766310391056549";
310.2700 + results[34][23]="3.349549803478537E-21";
310.2701 + results[34][24]="0.00001994968797131100";
310.2702 + results[34][25]="0.00001997096579482185";
310.2703 + results[34][26]="5.349169324542341E+19";
310.2704 + results[34][27]="2.328172951619490E-10";
310.2705 + results[34][28]="824962031682160.1";
310.2706 + results[34][29]="3.974229171089060E-15";
310.2707 + results[34][30]="1859235001.303121";
310.2708 + results[34][31]="4.849101578843441E-20";
310.2709 + results[34][32]="37799.22364355827";
310.2710 + results[34][33]="2.086501255659210E-25";
310.2711 + results[34][34]="1";
310.2712 + results[34][35]="2.454775320311342E-9";
310.2713 + results[34][36]="5.172655150445800E+23";
310.2714 + results[34][37]="2.076933473370431E-14";
310.2715 + results[34][38]="2.531531065720401E+18";
310.2716 + results[34][39]="2.213592190953497E-19";
310.2717 + results[34][40]="45898888025191.66";
310.2718 + results[34][41]="3.543923348982476E-24";
310.2719 + results[34][42]="165758003.2599846";
310.2720 + results[34][43]="6.393116033748466E-29";
310.2721 + results[34][44]="4354.330917562191";
310.2722 + results[34][45]="5.607729882441468E-13";
310.2723 + results[34][46]="3.053178838209099E+27";
310.2724 + results[34][47]="2.038553870572805E-18";
310.2725 + results[34][48]="2.528214532087444E+22";
310.2726 + results[34][49]="8.633409852563746E-23";
310.2727 + results[34][50]="8.520448147972540E+17";
310.2728 + results[34][51]="2.148929245543152E-28";
310.2729 + results[34][52]="15267645632154.63";
310.2730 + results[34][53]="4.476231119249052E-33";
310.2731 + results[34][54]="62263182.08779341";
310.2732 + results[34][55]="2.267075491021919E-17";
310.2733 + results[34][56]="2.616989182503541E+31";
310.2734 + results[34][57]="2.273903483498682E-22";
310.2735 + results[34][58]="2.091725765495799E+26";
310.2736 + results[34][59]="4.461747438416318E-27";
310.2737 + results[34][60]="1.080408850247748E+22";
310.2738 + results[34][61]="2.062528284031250E-32";
310.2739 + results[34][62]="7.724295243200328E+16";
310.2740 + results[34][63]="1.754256804199234E-37";
310.2741 + results[34][64]="807105361266.0442";
310.2742 + results[34][65]="1.903309819900053E-21";
310.2743 + results[34][66]="1.696821307196509E+35";
310.2744 + results[34][67]="6.143908567153631E-26";
310.2745 + results[34][68]="3.619922465916360E+30";
310.2746 + results[34][69]="2.728833383445953E-31";
310.2747 + results[34][70]="2.657851304177320E+25";
310.2748 + results[34][71]="1.667669613811836E-36";
310.2749 + results[34][72]="6.478077207970342E+20";
310.2750 + results[34][73]="3.160052612799337E-41";
310.2751 + results[34][74]="1809251652203281";
310.2752 + results[35][0]="5.934816020251334E+16";
310.2753 + results[35][1]="130499547406.9147";
310.2754 + results[35][2]="2927988.407449751";
310.2755 + results[35][3]="34.14353841900911";
310.2756 + results[35][4]="0.0002383110488501100";
310.2757 + results[35][5]="743515686940.7634";
310.2758 + results[35][6]="4.620609558668262E+20";
310.2759 + results[35][7]="7130269.065301548";
310.2760 + results[35][8]="681164890381514.3";
310.2761 + results[35][9]="66.46429682910084";
310.2762 + results[35][10]="24256564238.34587";
310.2763 + results[35][11]="0.0008054242898515592";
310.2764 + results[35][12]="108146.5653023476";
310.2765 + results[35][13]="1.013359948875315E-8";
310.2766 + results[35][14]="0.8148162752717714";
310.2767 + results[35][15]="87531335.00453358";
310.2768 + results[35][16]="1.005560491406513E+24";
310.2769 + results[35][17]="1035.961296309220";
310.2770 + results[35][18]="7.891762903049598E+18";
310.2771 + results[35][19]="0.006677250531641558";
310.2772 + results[35][20]="267063463742543.0";
310.2773 + results[35][21]="1.244975998822763E-7";
310.2774 + results[35][22]="1534279068.187334";
310.2775 + results[35][23]="1.364503616996488E-12";
310.2776 + results[35][24]="8126.889579768451";
310.2777 + results[35][25]="8135.557510937055";
310.2778 + results[35][26]="2.179087136929461E+28";
310.2779 + results[35][27]="0.09484260870458016";
310.2780 + results[35][28]="3.360641704583902E+23";
310.2781 + results[35][29]="0.000001618978787266365";
310.2782 + results[35][30]="7.573951823286671E+17";
310.2783 + results[35][31]="1.975374910575696E-11";
310.2784 + results[35][32]="15398241676457.85";
310.2785 + results[35][33]="8.499764676608273E-17";
310.2786 + results[35][34]="407369257.6773865";
310.2787 + results[35][35]="1";
310.2788 + results[35][36]="2.107180688858216E+32";
310.2789 + results[35][37]="0.000008460788472922284";
310.2790 + results[35][38]="1.031267931029763E+27";
310.2791 + results[35][39]="9.017494076291857E-11";
310.2792 + results[35][40]="1.869779594303981E+22";
310.2793 + results[35][41]="1.443685423940549E-15";
310.2794 + results[35][42]="6.752471474210576E+16";
310.2795 + results[35][43]="2.604358932913510E-20";
310.2796 + results[35][44]="1773820553569.003";
310.2797 + results[35][45]="0.0002284416759465479";
310.2798 + results[35][46]="1.243771196877546E+36";
310.2799 + results[35][47]="8.304441769906065E-10";
310.2800 + results[35][48]="1.029916877185643E+31";
310.2801 + results[35][49]="3.516985762863528E-14";
310.2802 + results[35][50]="3.470968637118237E+26";
310.2803 + results[35][51]="8.754077115581401E-20";
310.2804 + results[35][52]="6.219569467652223E+21";
310.2805 + results[35][53]="1.823478948240904E-24";
310.2806 + results[35][54]="2.536410626773635E+16";
310.2807 + results[35][55]="9.235368598761958E-9";
310.2808 + results[35][56]="1.066080940626218E+40";
310.2809 + results[35][57]="9.263183741028816E-14";
310.2810 + results[35][58]="8.521047723546869E+34";
310.2811 + results[35][59]="1.817578741931636E-18";
310.2812 + results[35][60]="4.401253513135038E+30";
310.2813 + results[35][61]="8.402106160044240E-24";
310.2814 + results[35][62]="3.146640419303486E+25";
310.2815 + results[35][63]="7.146302921021462E-29";
310.2816 + results[35][64]="3.287899118863873E+20";
310.2817 + results[35][65]="7.753499084627650E-13";
310.2818 + results[35][66]="6.912328363238143E+43";
310.2819 + results[35][67]="2.502839472239110E-17";
310.2820 + results[35][68]="1.474645127790042E+39";
310.2821 + results[35][69]="1.111642829739649E-22";
310.2822 + results[35][70]="1.082726912799589E+34";
310.2823 + results[35][71]="6.793573326296614E-28";
310.2824 + results[35][72]="2.638969503387675E+29";
310.2825 + results[35][73]="1.287308287097552E-32";
310.2826 + results[35][74]="7.370335025096355E+23";
310.2827 + results[36][0]="2.816472290028026E-16";
310.2828 + results[36][1]="6.193087669080073E-22";
310.2829 + results[36][2]="1.389528872835434E-26";
310.2830 + results[36][3]="1.620342223120407E-31";
310.2831 + results[36][4]="1.130947384389897E-36";
310.2832 + results[36][5]="3.528485672216559E-21";
310.2833 + results[36][6]="2.192792285493067E-12";
310.2834 + results[36][7]="3.383795752781463E-26";
310.2835 + results[36][8]="3.232588899391471E-18";
310.2836 + results[36][9]="3.154181185340816E-31";
310.2837 + results[36][10]="1.151138313225971E-22";
310.2838 + results[36][11]="3.822283936590086E-36";
310.2839 + results[36][12]="5.132287225019476E-28";
310.2840 + results[36][13]="4.809079516690182E-41";
310.2841 + results[36][14]="3.866855270552440E-33";
310.2842 + results[36][15]="4.153954877593472E-25";
310.2843 + results[36][16]="4.772065806807389E-9";
310.2844 + results[36][17]="4.916338222853396E-30";
310.2845 + results[36][18]="3.745176170594929E-14";
310.2846 + results[36][19]="3.168807766200464E-35";
310.2847 + results[36][20]="1.267397073040055E-18";
310.2848 + results[36][21]="5.908254595372923E-40";
310.2849 + results[36][22]="7.281193664595935E-24";
310.2850 + results[36][23]="6.475494124501726E-45";
310.2851 + results[36][24]="3.856759708713939E-29";
310.2852 + results[36][25]="3.860873229312546E-29";
310.2853 + results[36][26]="0.0001034124481327801";
310.2854 + results[36][27]="4.500924349110802E-34";
310.2855 + results[36][28]="1.594852174924249E-9";
310.2856 + results[36][29]="7.683151216346878E-39";
310.2857 + results[36][30]="3.594353281298647E-15";
310.2858 + results[36][31]="9.374492282605629E-44";
310.2859 + results[36][32]="7.307508918374459E-20";
310.2860 + results[36][33]="4.033714204743355E-49";
310.2861 + results[36][34]="1.933243123531666E-24";
310.2862 + results[36][35]="4.745677507807144E-33";
310.2863 + results[36][36]="1";
310.2864 + results[36][37]="4.015217355426124E-38";
310.2865 + results[36][38]="0.000004894065024810755";
310.2866 + results[36][39]="4.279411881464243E-43";
310.2867 + results[36][40]="8.873370965245172E-11";
310.2868 + results[36][41]="6.851265444743684E-48";
310.2869 + results[36][42]="3.204505199727048E-16";
310.2870 + results[36][43]="1.235944761018426E-52";
310.2871 + results[36][44]="8.417980303958437E-21";
310.2872 + results[36][45]="1.084110523385301E-36";
310.2873 + results[36][46]="5902.536993880142";
310.2874 + results[36][47]="3.941020252233737E-42";
310.2875 + results[36][48]="0.04887653358970880";
310.2876 + results[36][49]="1.669048023009940E-46";
310.2877 + results[36][50]="0.000001647209779147603";
310.2878 + results[36][51]="4.154402686902390E-52";
310.2879 + results[36][52]="2.951607093088121E-11";
310.2880 + results[36][53]="8.653643030626684E-57";
310.2881 + results[36][54]="1.203698686204266E-16";
310.2882 + results[36][55]="4.382808103545301E-41";
310.2883 + results[36][56]="50592763.41431727";
310.2884 + results[36][57]="4.396008273048529E-46";
310.2885 + results[36][58]="404.3814452458765";
310.2886 + results[36][59]="8.625642554253372E-51";
310.2887 + results[36][60]="0.02088692980344213";
310.2888 + results[36][61]="3.987368622192980E-56";
310.2889 + results[36][62]="1.493294066304539E-7";
310.2890 + results[36][63]="3.391404903626805E-61";
310.2891 + results[36][64]="1.560330889633121E-12";
310.2892 + results[36][65]="3.679560621272072E-45";
310.2893 + results[36][66]="328036812399.9663";
310.2894 + results[36][67]="1.187766898905705E-49";
310.2895 + results[36][68]="6998190.214950595";
310.2896 + results[36][69]="5.275498373810540E-55";
310.2897 + results[36][70]="51.38272757170476";
310.2898 + results[36][71]="3.224010813224441E-60";
310.2899 + results[36][72]="0.001252369821601588";
310.2900 + results[36][73]="6.109149983692593E-65";
310.2901 + results[36][74]="3.497723315360298E-9";
310.2902 + results[37][0]="7.014495208389838E+21";
310.2903 + results[37][1]="1.542404089460013E+16";
310.2904 + results[37][2]="346065667144.4297";
310.2905 + results[37][3]="4035503.136413506";
310.2906 + results[37][4]="28.16652958678678";
310.2907 + results[37][5]="8.787782478196851E+16";
310.2908 + results[37][6]="5.461204441472514E+25";
310.2909 + results[37][7]="842742858791.6008";
310.2910 + results[37][8]="8.050844109405394E+19";
310.2911 + results[37][9]="7855567.721827779";
310.2912 + results[37][10]="2866938975720293";
310.2913 + results[37][11]="95.19494458811030";
310.2914 + results[37][12]="12782090658.38928";
310.2915 + results[37][13]="0.001197713371653776";
310.2916 + results[37][14]="96305.00489162340";
310.2917 + results[37][15]="10345529294895.73";
310.2918 + results[37][16]="1.188495013939524E+29";
310.2919 + results[37][17]="122442642.2696522";
310.2920 + results[37][18]="9.327455624622005E+23";
310.2921 + results[37][19]="789.1995590022467";
310.2922 + results[37][20]="3.156484346550524E+19";
310.2923 + results[37][21]="0.01471465694724737";
310.2924 + results[37][22]="181339962947614.9";
310.2925 + results[37][23]="1.612738128796641E-7";
310.2926 + results[37][24]="960535723.8013413";
310.2927 + results[37][25]="961560206.4717620";
310.2928 + results[37][26]="2.575513078838174E+33";
310.2929 + results[37][27]="11209.66550672107";
310.2930 + results[37][28]="3.972019529077253E+28";
310.2931 + results[37][29]="0.1913508170601013";
310.2932 + results[37][30]="8.951827418361983E+22";
310.2933 + results[37][31]="0.000002334740925030381";
310.2934 + results[37][32]="1.819953509739433E+18";
310.2935 + results[37][33]="1.004606686931215E-11";
310.2936 + results[37][34]="48147907134319.92";
310.2937 + results[37][35]="118192.2941579709";
310.2938 + results[37][36]="2.490525198215260E+37";
310.2939 + results[37][37]="1";
310.2940 + results[37][38]="1.218879226599518E+32";
310.2941 + results[37][39]="0.00001065798312432847";
310.2942 + results[37][40]="2.209935398205477E+27";
310.2943 + results[37][41]="1.706324922979563E-10";
310.2944 + results[37][42]="7.980900947732038E+21";
310.2945 + results[37][43]="3.078151570918528E-15";
310.2946 + results[37][44]="2.096519206508824E+17";
310.2947 + results[37][45]="27.00004576141425";
310.2948 + results[37][46]="1.470041711665625E+41";
310.2949 + results[37][47]="0.00009815210244864781";
310.2950 + results[37][48]="1.217282385065843E+36";
310.2951 + results[37][49]="4.156806158337618E-9";
310.2952 + results[37][50]="4.102417461713700E+31";
310.2953 + results[37][51]="1.034664457526358E-14";
310.2954 + results[37][52]="7.351051840566861E+26";
310.2955 + results[37][53]="2.155211602413563E-19";
310.2956 + results[37][54]="2.997841909050329E+21";
310.2957 + results[37][55]="0.001091549402082161";
310.2958 + results[37][56]="1.260025521307003E+45";
310.2959 + results[37][57]="1.094836937559011E-8";
310.2960 + results[37][58]="1.007122179075560E+40";
310.2961 + results[37][59]="2.148238013216586E-13";
310.2962 + results[37][60]="5.201942498882593E+35";
310.2963 + results[37][61]="9.930642028144481E-19";
310.2964 + results[37][62]="3.719086500476785E+30";
310.2965 + results[37][63]="8.446379369833354E-24";
310.2966 + results[37][64]="3.886043398184922E+25";
310.2967 + results[37][65]="9.164038445638694E-8";
310.2968 + results[37][66]="8.169839472243282E+48";
310.2969 + results[37][67]="2.958163391330656E-12";
310.2970 + results[37][68]="1.742916907223793E+44";
310.2971 + results[37][69]="1.313876163311878E-17";
310.2972 + results[37][70]="1.279699777703607E+39";
310.2973 + results[37][71]="8.029480169653943E-23";
310.2974 + results[37][72]="3.119058598183105E+34";
310.2975 + results[37][73]="1.521499197406275E-27";
310.2976 + results[37][74]="8.711168053289843E+28";
310.2977 + }
310.2978 +
310.2979 + private static void initResults2() {
310.2980 + results[38][0]="5.754873046740801E-11";
310.2981 + results[38][1]="1.265428153832008E-16";
310.2982 + results[38][2]="2.839212118742058E-21";
310.2983 + results[38][3]="3.310831006343367E-26";
310.2984 + results[38][4]="2.310854838782263E-31";
310.2985 + results[38][5]="7.209723725223695E-16";
310.2986 + results[38][6]="4.480513181530232E-7";
310.2987 + results[38][7]="6.914080086037084E-21";
310.2988 + results[38][8]="6.605120453046024E-13";
310.2989 + results[38][9]="6.444910660872926E-26";
310.2990 + results[38][10]="2.352110786003469E-17";
310.2991 + results[38][11]="7.810039133548062E-31";
310.2992 + results[38][12]="1.048675732545652E-22";
310.2993 + results[38][13]="9.826349859084964E-36";
310.2994 + results[38][14]="7.901111348029064E-28";
310.2995 + results[38][15]="8.487739448770601E-20";
310.2996 + results[38][16]="0.0009750720071382617";
310.2997 + results[38][17]="1.004551062956811E-24";
310.2998 + results[38][18]="7.652485513797906E-9";
310.2999 + results[38][19]="6.474797024837234E-30";
310.3000 + results[38][20]="2.589661286915703E-13";
310.3001 + results[38][21]="1.207228462519536E-34";
310.3002 + results[38][22]="1.487759894419769E-18";
310.3003 + results[38][23]="1.323132016365500E-39";
310.3004 + results[38][24]="7.880483175360085E-24";
310.3005 + results[38][25]="7.888888295802402E-24";
310.3006 + results[38][26]="21.13017452946058";
310.3007 + results[38][27]="9.196699116773269E-29";
310.3008 + results[38][28]="0.0003258747415163162";
310.3009 + results[38][29]="1.569891527267555E-33";
310.3010 + results[38][30]="7.344310431260839E-10";
310.3011 + results[38][31]="1.915481759045105E-38";
310.3012 + results[38][32]="1.493136867068297E-14";
310.3013 + results[38][33]="8.242052739990580E-44";
310.3014 + results[38][34]="3.950178662790491E-19";
310.3015 + results[38][35]="9.696801092238556E-28";
310.3016 + results[38][36]="204329.1200526434";
310.3017 + results[38][37]="8.204258290543218E-33";
310.3018 + results[38][38]="1";
310.3019 + results[38][39]="8.744084640824158E-38";
310.3020 + results[38][40]="0.00001813088081229221";
310.3021 + results[38][41]="1.399913039571560E-42";
310.3022 + results[38][42]="6.547737276643480E-11";
310.3023 + results[38][43]="2.525395054525697E-47";
310.3024 + results[38][44]="1.720038508128311E-15";
310.3025 + results[38][45]="2.215153492831292E-31";
310.3026 + results[38][46]="1206060190.037704";
310.3027 + results[38][47]="8.052652002485662E-37";
310.3028 + results[38][48]="9986.899099608667";
310.3029 + results[38][49]="3.410351138672251E-41";
310.3030 + results[38][50]="0.3365729247153389";
310.3031 + results[38][51]="8.488654453591028E-47";
310.3032 + results[38][52]="0.000006030992800718365";
310.3033 + results[38][53]="1.768191265697641E-51";
310.3034 + results[38][54]="2.459506933606407E-11";
310.3035 + results[38][55]="8.955353231570062E-36";
310.3036 + results[38][56]="10337574829479.02";
310.3037 + results[38][57]="8.982325021761465E-41";
310.3038 + results[38][58]="82626904.87270614";
310.3039 + results[38][59]="1.762469952999227E-45";
310.3040 + results[38][60]="4267.807987338662";
310.3041 + results[38][61]="8.147355218982128E-51";
310.3042 + results[38][62]="0.03051234625478403";
310.3043 + results[38][63]="6.929627797002850E-56";
310.3044 + results[38][64]="3.188210376696939E-7";
310.3045 + results[38][65]="7.518413839248804E-40";
310.3046 + results[38][66]="6.702747322255918E+16";
310.3047 + results[38][67]="2.426953652810597E-44";
310.3048 + results[38][68]="1429934048581.875";
310.3049 + results[38][69]="1.077937940559859E-49";
310.3050 + results[38][70]="10498987.51063113";
310.3051 + results[38][71]="6.587592925063573E-55";
310.3052 + results[38][72]="255.8956236283385";
310.3053 + results[38][73]="1.248277240437528E-59";
310.3054 + results[38][74]="0.0007146867272151842";
310.3055 + results[39][0]="6.581447096100371E+26";
310.3056 + results[39][1]="1.447181958788470E+21";
310.3057 + results[39][2]="3.247008961334176E+16";
310.3058 + results[39][3]="378636660364.1785";
310.3059 + results[39][4]="2642763.575267104";
310.3060 + results[39][5]="8.245258390527376E+21";
310.3061 + results[39][6]="5.124050561692560E+30";
310.3062 + results[39][7]="7.907151371518986E+16";
310.3063 + results[39][8]="7.553815778735954E+24";
310.3064 + results[39][9]="737059500863.3713";
310.3065 + results[39][10]="2.689945125899165E+20";
310.3066 + results[39][11]="8931797.271363033";
310.3067 + results[39][12]="1199297325702478";
310.3068 + results[39][13]="112.3771127878607";
310.3069 + results[39][14]="9035950213.862933";
310.3070 + results[39][15]="9.706835875242173E+17";
310.3071 + results[39][16]="1.115121876320673E+34";
310.3072 + results[39][17]="11488350172947.65";
310.3073 + results[39][18]="8.751614180482857E+28";
310.3074 + results[39][19]="74047739.59538163";
310.3075 + results[39][20]="2.961615072691725E+24";
310.3076 + results[39][21]="1380.623029291435";
310.3077 + results[39][22]="1.701447270390950E+19";
310.3078 + results[39][23]="0.01513173843478247";
310.3079 + results[39][24]="90123592108977.16";
310.3080 + results[39][25]="90219715611751.54";
310.3081 + results[39][26]="2.416510749542446E+38";
310.3082 + results[39][27]="1051762362.161496";
310.3083 + results[39][28]="3.726802231475215E+33";
310.3084 + results[39][29]="17953.75492979660";
310.3085 + results[39][30]="8.399175823358240E+27";
310.3086 + results[39][31]="0.2190602947851342";
310.3087 + results[39][32]="1.707596539147366E+23";
310.3088 + results[39][33]="9.425861114736121E-7";
310.3089 + results[39][34]="4.517543945478293E+18";
310.3090 + results[39][35]="11089555385.78204";
310.3091 + results[39][36]="2.336769695694354E+42";
310.3092 + results[39][37]="93826.38237785791";
310.3093 + results[39][38]="1.143630283873541E+37";
310.3094 + results[39][39]="1";
310.3095 + results[39][40]="2.073502437023907E+32";
310.3096 + results[39][41]="0.00001600982946843494";
310.3097 + results[39][42]="7.488190640417148E+26";
310.3098 + results[39][43]="2.888118263100058E-10";
310.3099 + results[39][44]="1.967088127324202E+22";
310.3100 + results[39][45]="2533316.617830116";
310.3101 + results[39][46]="1.379286957501396E+46";
310.3102 + results[39][47]="9.209256695537514";
310.3103 + results[39][48]="1.142132025230187E+41";
310.3104 + results[39][49]="0.0003900180840828200";
310.3105 + results[39][50]="3.849149894363509E+36";
310.3106 + results[39][51]="9.707882302464703E-10";
310.3107 + results[39][52]="6.897226008724825E+31";
310.3108 + results[39][53]="2.022157079132508E-14";
310.3109 + results[39][54]="2.812766612669237E+26";
310.3110 + results[39][55]="102.4161315840830";
310.3111 + results[39][56]="1.182236363680106E+50";
310.3112 + results[39][57]="0.001027245891448147";
310.3113 + results[39][58]="9.449463067516497E+44";
310.3114 + results[39][59]="2.015614012667092E-8";
310.3115 + results[39][60]="4.880794460077878E+40";
310.3116 + results[39][61]="9.317562161903105E-14";
310.3117 + results[39][62]="3.489484320900643E+35";
310.3118 + results[39][63]="7.924932204624348E-19";
310.3119 + results[39][64]="3.646133938150488E+30";
310.3120 + results[39][65]="0.008598285753258867";
310.3121 + results[39][66]="7.665464822884150E+53";
310.3122 + results[39][67]="2.775537694911710E-7";
310.3123 + results[39][68]="1.635315881900131E+49";
310.3124 + results[39][69]="1.232762472960531E-12";
310.3125 + results[39][70]="1.200696006716784E+44";
310.3126 + results[39][71]="7.533770766933783E-18";
310.3127 + results[39][72]="2.926499846920735E+39";
310.3128 + results[39][73]="1.427567654834451E-22";
310.3129 + results[39][74]="8.173373847257529E+33";
310.3130 + results[40][0]="0.000003174072515461667";
310.3131 + results[40][1]="6.979408043839129E-12";
310.3132 + results[40][2]="1.565953771433517E-16";
310.3133 + results[40][3]="1.826072897737389E-21";
310.3134 + results[40][4]="1.274540858056698E-26";
310.3135 + results[40][5]="3.976488401123740E-11";
310.3136 + results[40][6]="0.02471205468678926";
310.3137 + results[40][7]="3.813427575647367E-16";
310.3138 + results[40][8]="3.643022377913347E-8";
310.3139 + results[40][9]="3.554659438554945E-21";
310.3140 + results[40][10]="1.297295377072253E-12";
310.3141 + results[40][11]="4.307589473674706E-26";
310.3142 + results[40][12]="5.783920502277423E-18";
310.3143 + results[40][13]="5.419675944492992E-31";
310.3144 + results[40][14]="4.357819914999574E-23";
310.3145 + results[40][15]="4.681371818966545E-15";
310.3146 + results[40][16]="53.77962699292531";
310.3147 + results[40][17]="5.540553012050880E-20";
310.3148 + results[40][18]="0.0004220691533424975";
310.3149 + results[40][19]="3.571143118677119E-25";
310.3150 + results[40][20]="1.428315211889754E-8";
310.3151 + results[40][21]="6.658410449100025E-30";
310.3152 + results[40][22]="8.205668052327118E-14";
310.3153 + results[40][23]="7.297670918825164E-35";
310.3154 + results[40][24]="4.346442545702108E-19";
310.3155 + results[40][25]="4.351078349405929E-19";
310.3156 + results[40][26]="1165424.600614822";
310.3157 + results[40][27]="5.072395109750087E-24";
310.3158 + results[40][28]="17.97346443838419";
310.3159 + results[40][29]="8.658661118125126E-29";
310.3160 + results[40][30]="0.00004050719050715733";
310.3161 + results[40][31]="1.056474739906990E-33";
310.3162 + results[40][32]="8.235324486033761E-10";
310.3163 + results[40][33]="4.545864497880714E-39";
310.3164 + results[40][34]="2.178702018774722E-14";
310.3165 + results[40][35]="5.348223946000686E-23";
310.3166 + results[40][36]="11269674218.70173";
310.3167 + results[40][37]="4.525019151292953E-28";
310.3168 + results[40][38]="55154.51843475961";
310.3169 + results[40][39]="4.822757775174344E-33";
310.3170 + results[40][40]="1";
310.3171 + results[40][41]="7.721152954810994E-38";
310.3172 + results[40][42]="0.000003611372963305955";
310.3173 + results[40][43]="1.392869480898883E-42";
310.3174 + results[40][44]="9.486789560505935E-11";
310.3175 + results[40][45]="1.221757241561856E-26";
310.3176 + results[40][46]="66519668984864.25";
310.3177 + results[40][47]="4.441401433197993E-32";
310.3178 + results[40][48]="550822610.4954504";
310.3179 + results[40][49]="1.880962747469021E-36";
310.3180 + results[40][50]="18563.51758085312";
310.3181 + results[40][51]="4.681876485468906E-42";
310.3182 + results[40][52]="0.3326365036071236";
310.3183 + results[40][53]="9.752373776010145E-47";
310.3184 + results[40][54]="0.000001356529205100136";
310.3185 + results[40][55]="4.939281949004150E-31";
310.3186 + results[40][56]="5.701639615032074E+17";
310.3187 + results[40][57]="4.954158109997452E-36";
310.3188 + results[40][58]="4557247148008.799";
310.3189 + results[40][59]="9.720818151340577E-41";
310.3190 + results[40][60]="235388894.3136845";
310.3191 + results[40][61]="4.493634536198847E-46";
310.3192 + results[40][62]="1682.893763997254";
310.3193 + results[40][63]="3.822002840758163E-51";
310.3194 + results[40][64]="0.01758442079954232";
310.3195 + results[40][65]="4.146744946969999E-35";
310.3196 + results[40][66]="3.696868007488996E+21";
310.3197 + results[40][67]="1.338574599842493E-39";
310.3198 + results[40][68]="7.886732384299944E+16";
310.3199 + results[40][69]="5.945314801413554E-45";
310.3200 + results[40][70]="579066600201.4157";
310.3201 + results[40][71]="3.633355154261108E-50";
310.3202 + results[40][72]="14113799.89078350";
310.3203 + results[40][73]="6.884813006940251E-55";
310.3204 + results[40][74]="39.41820227126789";
310.3205 + results[41][0]="4.110878950382567E+31";
310.3206 + results[41][1]="9.039334001912643E+25";
310.3207 + results[41][2]="2.028134632999056E+21";
310.3208 + results[41][3]="2.365026192881695E+16";
310.3209 + results[41][4]="165071313250.2498";
310.3210 + results[41][5]="5.150122558634225E+26";
310.3211 + results[41][6]="3.200565360046566E+35";
310.3212 + results[41][7]="4.938935412840446E+21";
310.3213 + results[41][8]="4.718236252065705E+29";
310.3214 + results[41][9]="4.603793577667779E+16";
310.3215 + results[41][10]="1.680183496771577E+25";
310.3216 + results[41][11]="557894591505.3629";
310.3217 + results[41][12]="7.491006247549473E+19";
310.3218 + results[41][13]="7019257.326220990";
310.3219 + results[41][14]="564400153772921.7";
310.3220 + results[41][15]="6.063047638564933E+22";
310.3221 + results[41][16]="6.965232693572741E+38";
310.3222 + results[41][17]="7.175810457942816E+17";
310.3223 + results[41][18]="5.466400624527316E+33";
310.3224 + results[41][19]="4625142306567.008";
310.3225 + results[41][20]="1.849872966186717E+29";
310.3226 + results[41][21]="86235960.97719082";
310.3227 + results[41][22]="1.062751651256206E+24";
310.3228 + results[41][23]="945.1530051969814";
310.3229 + results[41][24]="5.629266213401292E+18";
310.3230 + results[41][25]="5.635270243797986E+18";
310.3231 + results[41][26]="1.509391935939637E+43";
310.3232 + results[41][27]="65694788581924.34";
310.3233 + results[41][28]="2.327821316787288E+38";
310.3234 + results[41][29]="1121420747.497299";
310.3235 + results[41][30]="5.246261891744755E+32";
310.3236 + results[41][31]="13682.86247002409";
310.3237 + results[41][32]="1.066592584583160E+28";
310.3238 + results[41][33]="0.05887546231095213";
310.3239 + results[41][34]="2.821731458405042E+23";
310.3240 + results[41][35]="692671674463882.5";
310.3241 + results[41][36]="1.459584376149378E+47";
310.3242 + results[41][37]="5860548518.823794";
310.3243 + results[41][38]="7.143300846072895E+41";
310.3244 + results[41][39]="62461.62721293222";
310.3245 + results[41][40]="1.295143362464938E+37";
310.3246 + results[41][41]="1";
310.3247 + results[41][42]="4.677245722811041E+31";
310.3248 + results[41][43]="0.00001803965662966171";
310.3249 + results[41][44]="1.228675253039092E+27";
310.3250 + results[41][45]="158235078195.2310";
310.3251 + results[41][46]="8.615250775911171E+50";
310.3252 + results[41][47]="575225.1586248642";
310.3253 + results[41][48]="7.133942478787923E+45";
310.3254 + results[41][49]="24.36116417428315";
310.3255 + results[41][50]="2.404241657884309E+41";
310.3256 + results[41][51]="0.00006063701254035724";
310.3257 + results[41][52]="4.308119597603104E+36";
310.3258 + results[41][53]="1.263072216427666E-9";
310.3259 + results[41][54]="1.756899795975280E+31";
310.3260 + results[41][55]="6397078.231595606";
310.3261 + results[41][56]="7.384440702575934E+54";
310.3262 + results[41][57]="64.16344992765041";
310.3263 + results[41][58]="5.902288394855864E+49";
310.3264 + results[41][59]="0.001258985310643743";
310.3265 + results[41][60]="3.048623640683292E+45";
310.3266 + results[41][61]="5.819900942901146E-9";
310.3267 + results[41][62]="2.179588688174679E+40";
310.3268 + results[41][63]="4.950041610530071E-14";
310.3269 + results[41][64]="2.277434588131763E+35";
310.3270 + results[41][65]="537.0629193903215";
310.3271 + results[41][66]="4.787974061808353E+58";
310.3272 + results[41][67]="0.01733646008150164";
310.3273 + results[41][68]="1.021444909906334E+54";
310.3274 + results[41][69]="7.700035002815314E-8";
310.3275 + results[41][70]="7.499742636760013E+48";
310.3276 + results[41][71]="4.705715811519044E-13";
310.3277 + results[41][72]="1.827939424770661E+44";
310.3278 + results[41][73]="8.916819867750936E-18";
310.3279 + results[41][74]="5.105222303193294E+38";
310.3280 + results[42][0]="0.8789101950179163";
310.3281 + results[42][1]="0.000001932619010762593";
310.3282 + results[42][2]="4.336172938504800E-11";
310.3283 + results[42][3]="5.056450597297903E-16";
310.3284 + results[42][4]="3.529241845156713E-21";
310.3285 + results[42][5]="0.00001101101559303791";
310.3286 + results[42][6]="6842.842026531408";
310.3287 + results[42][7]="1.055949527892695E-10";
310.3288 + results[42][8]="0.01008763817785915";
310.3289 + results[42][9]="9.842958549761383E-16";
310.3290 + results[42][10]="3.592249790463821E-7";
310.3291 + results[42][11]="1.192784438894235E-20";
310.3292 + results[42][12]="1.601584926576693E-12";
310.3293 + results[42][13]="1.500724516564931E-25";
310.3294 + results[42][14]="1.206693398681896E-17";
310.3295 + results[42][15]="1.296285890859935E-9";
310.3296 + results[42][16]="14891739.93917645";
310.3297 + results[42][17]="1.534195738946580E-14";
310.3298 + results[42][18]="116.8722138729541";
310.3299 + results[42][19]="9.888602354180532E-20";
310.3300 + results[42][20]="0.003955047640890110";
310.3301 + results[42][21]="1.843733814467261E-24";
310.3302 + results[42][22]="2.272174083292525E-8";
310.3303 + results[42][23]="2.020746954959940E-29";
310.3304 + results[42][24]="1.203542971015447E-13";
310.3305 + results[42][25]="1.204826638958615E-13";
310.3306 + results[42][26]="322709565712.6364";
310.3307 + results[42][27]="1.404561412318563E-18";
310.3308 + results[42][28]="4976906.185267212";
310.3309 + results[42][29]="2.397609221230570E-23";
310.3310 + results[42][30]="11.21656248710349";
310.3311 + results[42][31]="2.925410226640957E-28";
310.3312 + results[42][32]="0.0002280386038692306";
310.3313 + results[42][33]="1.258763507416664E-33";
310.3314 + results[42][34]="6.032891204846025E-9";
310.3315 + results[42][35]="1.480939243977938E-17";
310.3316 + results[42][36]="3120606576282596";
310.3317 + results[42][37]="1.252991368454678E-22";
310.3318 + results[42][38]="15272451501.17909";
310.3319 + results[42][39]="1.335436085991919E-27";
310.3320 + results[42][40]="276902.9978793913";
310.3321 + results[42][41]="2.138010400272485E-32";
310.3322 + results[42][42]="1";
310.3323 + results[42][43]="3.856897349156122E-37";
310.3324 + results[42][44]="0.00002626920469555007";
310.3325 + results[42][45]="3.383082428693337E-21";
310.3326 + results[42][46]="1.841949575985368E+19";
310.3327 + results[42][47]="1.229837371638349E-26";
310.3328 + results[42][48]="152524432145942.5";
310.3329 + results[42][49]="5.208442236736284E-31";
310.3330 + results[42][50]="5140293669.325014";
310.3331 + results[42][51]="1.296425634527369E-36";
310.3332 + results[42][52]="92108.04505293148";
310.3333 + results[42][53]="2.700461535017569E-41";
310.3334 + results[42][54]="0.3756270036031754";
310.3335 + results[42][55]="1.367701979050812E-25";
310.3336 + results[42][56]="1.578801102230280E+23";
310.3337 + results[42][57]="1.371821232626794E-30";
310.3338 + results[42][58]="1.261915397360943E+18";
310.3339 + results[42][59]="2.691723687946608E-35";
310.3340 + results[42][60]="65179890502974.45";
310.3341 + results[42][61]="1.244300874447829E-40";
310.3342 + results[42][62]="465998328.3633725";
310.3343 + results[42][63]="1.058324044509485E-45";
310.3344 + results[42][64]="4869.178835365991";
310.3345 + results[42][65]="1.148246107257210E-29";
310.3346 + results[42][66]="1.023673834038115E+27";
310.3347 + results[42][67]="3.706553195815928E-34";
310.3348 + results[42][68]="2.183859840685134E+22";
310.3349 + results[42][69]="1.646275491848131E-39";
310.3350 + results[42][70]="1.603452775675989E+17";
310.3351 + results[42][71]="1.006086934575439E-44";
310.3352 + results[42][72]="3908153501227.777";
310.3353 + results[42][73]="1.906425361460782E-49";
310.3354 + results[42][74]="10915018.37993031";
310.3355 + results[43][0]="2.278801107346606E+36";
310.3356 + results[43][1]="5.010812670929508E+30";
310.3357 + results[43][2]="1.124264543740979E+26";
310.3358 + results[43][3]="1.311015082733337E+21";
310.3359 + results[43][4]="9150468694555485";
310.3360 + results[43][5]="2.854889460681936E+31";
310.3361 + results[43][6]="1.774183082168003E+40";
310.3362 + results[43][7]="2.737821187083793E+26";
310.3363 + results[43][8]="2.615480077546344E+34";
310.3364 + results[43][9]="2.552040580472019E+21";
310.3365 + results[43][10]="9.313833025008547E+29";
310.3366 + results[43][11]="3.092600945563700E+16";
310.3367 + results[43][12]="4.152521525954315E+24";
310.3368 + results[43][13]="389101492911.9866";
310.3369 + results[43][14]="3.128663507069788E+19";
310.3370 + results[43][15]="3.360955124054725E+27";
310.3371 + results[43][16]="3.861067223485925E+43";
310.3372 + results[43][17]="3.977797696073652E+22";
310.3373 + results[43][18]="3.030213233404445E+38";
310.3374 + results[43][19]="2.563874912653335E+17";
310.3375 + results[43][20]="1.025447991701273E+34";
310.3376 + results[43][21]="4780354900735.599";
310.3377 + results[43][22]="5.891196673382220E+28";
310.3378 + results[43][23]="52393070.69974453";
310.3379 + results[43][24]="3.120495211724467E+23";
310.3380 + results[43][25]="3.123823451568468E+23";
310.3381 + results[43][26]="8.367076862526411E+47";
310.3382 + results[43][27]="3.641687307612366E+18";
310.3383 + results[43][28]="1.290391144673877E+43";
310.3384 + results[43][29]="62164195833605.98";
310.3385 + results[43][30]="2.908182788312382E+37";
310.3386 + results[43][31]="758487966.3133965";
310.3387 + results[43][32]="5.912488283338024E+32";
310.3388 + results[43][33]="3263.668678379727";
310.3389 + results[43][34]="1.564182465516227E+28";
310.3390 + results[43][35]="3.839716512812981E+19";
310.3391 + results[43][36]="8.090976486489524E+51";
310.3392 + results[43][37]="324870292108974.2";
310.3393 + results[43][38]="3.959776503909459E+46";
310.3394 + results[43][39]="3462462090.893108";
310.3395 + results[43][40]="7.179423583569754E+41";
310.3396 + results[43][41]="55433.42761611934";
310.3397 + results[43][42]="2.592757622182496E+36";
310.3398 + results[43][43]="1";
310.3399 + results[43][44]="6.810968070305965E+31";
310.3400 + results[43][45]="8771512753466319";
310.3401 + results[43][46]="4.775728802811879E+55";
310.3402 + results[43][47]="31886702193.60218";
310.3403 + results[43][48]="3.954588840154493E+50";
310.3404 + results[43][49]="1350422.830899525";
310.3405 + results[43][50]="1.332753559139886E+46";
310.3406 + results[43][51]="3.361317445513614";
310.3407 + results[43][52]="2.388138358753168E+41";
310.3408 + results[43][53]="0.00007001642228327445";
310.3409 + results[43][54]="9.739097766897050E+35";
310.3410 + results[43][55]="354611973105.8077";
310.3411 + results[43][56]="4.093448591717685E+59";
310.3412 + results[43][57]="3556799.957164907";
310.3413 + results[43][58]="3.271840765057037E+54";
310.3414 + results[43][59]="69.78987108732747";
310.3415 + results[43][60]="1.689956579146075E+50";
310.3416 + results[43][61]="0.0003226170576512954";
310.3417 + results[43][62]="1.208220717788436E+45";
310.3418 + results[43][63]="2.743977733140975E-9";
310.3419 + results[43][64]="1.262460053916486E+40";
310.3420 + results[43][65]="29771238.46732512";
310.3421 + results[43][66]="2.654138135831102E+63";
310.3422 + results[43][67]="961.0194050476638";
310.3423 + results[43][68]="5.662219247714633E+58";
310.3424 + results[43][69]="0.004268393329701480";
310.3425 + results[43][70]="4.157364405943601E+53";
310.3426 + results[43][71]="2.608539568198692E-8";
310.3427 + results[43][72]="1.013289477896753E+49";
310.3428 + results[43][73]="4.942898887049463E-13";
310.3429 + results[43][74]="2.829999710082635E+43";
310.3430 + results[44][0]="33457.81515672613";
310.3431 + results[44][1]="0.07356975717997179";
310.3432 + results[44][2]="0.000001650667764311622";
310.3433 + results[44][3]="1.924858653278701E-11";
310.3434 + results[44][4]="1.343490176447769E-16";
310.3435 + results[44][5]="0.4191605996698921";
310.3436 + results[44][6]="260489120.4677608";
310.3437 + results[44][7]="0.000004019724008133258";
310.3438 + results[44][8]="384.0100336028812";
310.3439 + results[44][9]="3.746957193351482E-11";
310.3440 + results[44][10]="0.01367475655276438";
310.3441 + results[44][11]="4.540618769080169E-16";
310.3442 + results[44][12]="6.096815435177592E-8";
310.3443 + results[44][13]="5.712866201918743E-21";
310.3444 + results[44][14]="4.593566545569257E-13";
310.3445 + results[44][15]="0.00004934621759141124";
310.3446 + results[44][16]="566889637953.1077";
310.3447 + results[44][17]="5.840282401874423E-10";
310.3448 + results[44][18]="4449019.878121849";
310.3449 + results[44][19]="3.764332597345680E-15";
310.3450 + results[44][20]="150.5583319604680";
310.3451 + results[44][21]="7.018612995084639E-20";
310.3452 + results[44][22]="0.0008649573177513917";
310.3453 + results[44][23]="7.692455779988837E-25";
310.3454 + results[44][24]="4.581573690425900E-9";
310.3455 + results[44][25]="4.586460278954353E-9";
310.3456 + results[44][26]="1.228471015596839E+16";
310.3457 + results[44][27]="5.346798384636640E-14";
310.3458 + results[44][28]="189457817354.8698";
310.3459 + results[44][29]="9.127071980358501E-19";
310.3460 + results[44][30]="426985.2329790381";
310.3461 + results[44][31]="1.113627253106948E-23";
310.3462 + results[44][32]="8.680833946520647";
310.3463 + results[44][33]="4.791783847304273E-29";
310.3464 + results[44][34]="0.0002296564085119783";
310.3465 + results[44][35]="5.637548837665439E-13";
310.3466 + results[44][36]="1.187933404322369E+20";
310.3467 + results[44][37]="4.769810822125617E-18";
310.3468 + results[44][38]="581382332589848.2";
310.3469 + results[44][39]="5.083656324845414E-23";
310.3470 + results[44][40]="10540973778.55897";
310.3471 + results[44][41]="8.138847083690577E-28";
310.3472 + results[44][42]="38067.38771080486";
310.3473 + results[44][43]="1.468220067511016E-32";
310.3474 + results[44][44]="1";
310.3475 + results[44][45]="1.287851104706806E-16";
310.3476 + results[44][46]="7.011820865278762E+23";
310.3477 + results[44][47]="4.681669604739426E-22";
310.3478 + results[44][48]="5.806206693869941E+18";
310.3479 + results[44][49]="1.982717899951718E-26";
310.3480 + results[44][50]="195677552057591.1";
310.3481 + results[44][51]="4.935153726777955E-32";
310.3482 + results[44][52]="3506312662.314225";
310.3483 + results[44][53]="1.027995162516290E-36";
310.3484 + results[44][54]="14299.13878080998";
310.3485 + results[44][55]="5.206484150936237E-21";
310.3486 + results[44][56]="6.010083367684613E+27";
310.3487 + results[44][57]="5.222165073231839E-26";
310.3488 + results[44][58]="4.803782268957339E+22";
310.3489 + results[44][59]="1.024668892394211E-30";
310.3490 + results[44][60]="2.481228162724536E+18";
310.3491 + results[44][61]="4.736728381649903E-36";
310.3492 + results[44][62]="17739339038395.46";
310.3493 + results[44][63]="4.028763172600968E-41";
310.3494 + results[44][64]="185356918.5591225";
310.3495 + results[44][65]="4.371072975238266E-25";
310.3496 + results[44][66]="3.896858872973504E+31";
310.3497 + results[44][67]="1.410987975758478E-29";
310.3498 + results[44][68]="8.313383926141755E+26";
310.3499 + results[44][69]="6.266940742697879E-35";
310.3500 + results[44][70]="6.103925848762411E+21";
310.3501 + results[44][71]="3.829910140925841E-40";
310.3502 + results[44][72]="1.487731945645773E+17";
310.3503 + results[44][73]="7.257263337643890E-45";
310.3504 + results[44][74]="415506236539.3683";
310.3505 + results[45][0]="2.597956785100805E+20";
310.3506 + results[45][1]="571259805664574.7";
310.3507 + results[45][2]="12817225207.78065";
310.3508 + results[45][3]="149462.8258067859";
310.3509 + results[45][4]="1.043203031420026";
310.3510 + results[45][5]="3254728734851059";
310.3511 + results[45][6]="2.022664883508130E+24";
310.3512 + results[45][7]="31212645572.47396";
310.3513 + results[45][8]="2.981789060858130E+18";
310.3514 + results[45][9]="290946.4595446784";
310.3515 + results[45][10]="106182745061026.3";
310.3516 + results[45][11]="3.525732712799818";
310.3517 + results[45][12]="473409962.7585133";
310.3518 + results[45][13]="0.00004435967932193017";
310.3519 + results[45][14]="3566.845987692836";
310.3520 + results[45][15]="383167102245.4531";
310.3521 + results[45][16]="4.401825924450844E+27";
310.3522 + results[45][17]="4534904.990592084";
310.3523 + results[45][18]="3.454607339203797E+22";
310.3524 + results[45][19]="29.22956375615078";
310.3525 + results[45][20]="1.169066295088082E+18";
310.3526 + results[45][21]="0.0005449863706629740";
310.3527 + results[45][22]="6716283540777.093";
310.3528 + results[45][23]="5.973094057127134E-9";
310.3529 + results[45][24]="35575336.88235604";
310.3530 + results[45][25]="35613280.62065461";
310.3531 + results[45][26]="9.538921161825726E+31";
310.3532 + results[45][27]="415.1720928836645";
310.3533 + results[45][28]="1.471115850756691E+27";
310.3534 + results[45][29]="0.007087055286904757";
310.3535 + results[45][30]="3.315486017121880E+21";
310.3536 + results[45][31]="8.647173955412170E-8";
310.3537 + results[45][32]="6.740557130241340E+16";
310.3538 + results[45][33]="3.720759200959941E-13";
310.3539 + results[45][34]="1783252797412.961";
310.3540 + results[45][35]="4377.484956965496";
310.3541 + results[45][36]="9.224151767085032E+35";
310.3542 + results[45][37]="0.03703697426428437";
310.3543 + results[45][38]="4.514359854683718E+30";
310.3544 + results[45][39]="3.947394466849308E-7";
310.3545 + results[45][40]="8.184932046906727E+25";
310.3546 + results[45][41]="6.319711225890107E-12";
310.3547 + results[45][42]="2.955884230069542E+20";
310.3548 + results[45][43]="1.140054205136760E-16";
310.3549 + results[45][44]="7764872789604521";
310.3550 + results[45][45]="1";
310.3551 + results[45][46]="5.444589704238428E+39";
310.3552 + results[45][47]="0.000003635256892375972";
310.3553 + results[45][48]="4.508445636805033E+34";
310.3554 + results[45][49]="1.539555227079692E-10";
310.3555 + results[45][50]="1.519411299508411E+30";
310.3556 + results[45][51]="3.832084088557348E-16";
310.3557 + results[45][52]="2.722607178344951E+25";
310.3558 + results[45][53]="7.982251665267820E-21";
310.3559 + results[45][54]="1.110309936338901E+20";
310.3560 + results[45][55]="0.00004042768711311199";
310.3561 + results[45][56]="4.666753280498896E+43";
310.3562 + results[45][57]="4.054944747996101E-10";
310.3563 + results[45][58]="3.730075822741150E+38";
310.3564 + results[45][59]="7.956423600906009E-15";
310.3565 + results[45][60]="1.926642104554017E+34";
310.3566 + results[45][61]="3.678009332242079E-20";
310.3567 + results[45][62]="1.377437110048061E+29";
310.3568 + results[45][63]="3.128283353469004E-25";
310.3569 + results[45][64]="1.439272893284671E+24";
310.3570 + results[45][65]="3.394082560680328E-9";
310.3571 + results[45][66]="3.025861342768090E+47";
310.3572 + results[45][67]="1.095614213942617E-13";
310.3573 + results[45][68]="6.455236863763371E+42";
310.3574 + results[45][69]="4.866199764703870E-19";
310.3575 + results[45][70]="4.739620773281892E+37";
310.3576 + results[45][71]="2.973876503990548E-24";
310.3577 + results[45][72]="1.155204930297025E+33";
310.3578 + results[45][73]="5.635172661746553E-29";
310.3579 + results[45][74]="3.226353070015521E+27";
310.3580 + results[46][0]="4.771630051532411E-20";
310.3581 + results[46][1]="1.049224710578041E-25";
310.3582 + results[46][2]="2.354121413006176E-30";
310.3583 + results[46][3]="2.745162334095334E-35";
310.3584 + results[46][4]="1.916036080015227E-40";
310.3585 + results[46][5]="5.977913693510024E-25";
310.3586 + results[46][6]="3.714999648060815E-16";
310.3587 + results[46][7]="5.732781948321280E-30";
310.3588 + results[46][8]="5.476609299938448E-22";
310.3589 + results[46][9]="5.343771989249925E-35";
310.3590 + results[46][10]="1.950243284234377E-26";
310.3591 + results[46][11]="6.475662821856263E-40";
310.3592 + results[46][12]="8.695053043023237E-32";
310.3593 + results[46][13]="8.147478824234940E-45";
310.3594 + results[46][14]="6.551174985538704E-37";
310.3595 + results[46][15]="7.037575337351325E-29";
310.3596 + results[46][16]="8.084770687172574E-13";
310.3597 + results[46][17]="8.329195103649068E-34";
310.3598 + results[46][18]="6.345027865946450E-18";
310.3599 + results[46][19]="5.368552148823365E-39";
310.3600 + results[46][20]="2.147207335344303E-22";
310.3601 + results[46][21]="1.000968668472338E-43";
310.3602 + results[46][22]="1.233570187216990E-27";
310.3603 + results[46][23]="1.097069638227704E-48";
310.3604 + results[46][24]="6.534071218380670E-33";
310.3605 + results[46][25]="6.541040290498085E-33";
310.3606 + results[46][26]="1.752E-8";
310.3607 + results[46][27]="7.625406420624627E-38";
310.3608 + results[46][28]="2.701977432039512E-13";
310.3609 + results[46][29]="1.301669303269579E-42";
310.3610 + results[46][30]="6.089505724445841E-19";
310.3611 + results[46][31]="1.588214066650539E-47";
310.3612 + results[46][32]="1.238028482659409E-23";
310.3613 + results[46][33]="6.833865181913444E-53";
310.3614 + results[46][34]="3.275274895415460E-28";
310.3615 + results[46][35]="8.040063980501181E-37";
310.3616 + results[46][36]="0.0001694186755689661";
310.3617 + results[46][37]="6.802528064778204E-42";
310.3618 + results[46][38]="8.291460146518372E-10";
310.3619 + results[46][39]="7.250122931717692E-47";
310.3620 + results[46][40]="1.503314756763955E-14";
310.3621 + results[46][41]="1.160732317619898E-51";
310.3622 + results[46][42]="5.429030267916215E-20";
310.3623 + results[46][43]="2.093921244881440E-56";
310.3624 + results[46][44]="1.426163074062281E-24";
310.3625 + results[46][45]="1.836685690423163E-40";
310.3626 + results[46][46]="1";
310.3627 + results[46][47]="6.676824315239122E-46";
310.3628 + results[46][48]="0.000008280597587170547";
310.3629 + results[46][49]="2.827679055193452E-50";
310.3630 + results[46][50]="2.790680991674361E-10";
310.3631 + results[46][51]="7.038334009951569E-56";
310.3632 + results[46][52]="5.000573645109554E-15";
310.3633 + results[46][53]="1.466088741095387E-60";
310.3634 + results[46][54]="2.039290372008313E-20";
310.3635 + results[46][55]="7.425295441755768E-45";
310.3636 + results[46][56]="8571.358971027673";
310.3637 + results[46][57]="7.447658994100996E-50";
310.3638 + results[46][58]="0.06850976887822076";
310.3639 + results[46][59]="1.461344937472920E-54";
310.3640 + results[46][60]="0.000003538635984001130";
310.3641 + results[46][61]="6.755347109771878E-60";
310.3642 + results[46][62]="2.529919029483109E-11";
310.3643 + results[46][63]="5.745673270905503E-65";
310.3644 + results[46][64]="2.643491927709899E-16";
310.3645 + results[46][65]="6.233862871316364E-49";
310.3646 + results[46][66]="55575562.29466768";
310.3647 + results[46][67]="2.012298948972625E-53";
310.3648 + results[46][68]="1185.624117596628";
310.3649 + results[46][69]="8.937679474572159E-59";
310.3650 + results[46][70]="0.008705193652319216";
310.3651 + results[46][71]="5.462076419965100E-64";
310.3652 + results[46][72]="2.121748364982833E-7";
310.3653 + results[46][73]="1.035004099089370E-68";
310.3654 + results[46][74]="5.925796515950347E-13";
310.3655 + results[47][0]="7.146556246270681E+25";
310.3656 + results[47][1]="1.571442741399231E+20";
310.3657 + results[47][2]="3525810028628656";
310.3658 + results[47][3]="41114790572.36538";
310.3659 + results[47][4]="286968.1737232600";
310.3660 + results[47][5]="8.953228977234115E+20";
310.3661 + results[47][6]="5.564021865277680E+29";
310.3662 + results[47][7]="8586090748616571";
310.3663 + results[47][8]="8.202416360482460E+23";
310.3664 + results[47][9]="80034635283.92306";
310.3665 + results[47][10]="2.920914482927399E+19";
310.3666 + results[47][11]="969871.6809241588";
310.3667 + results[47][12]="130227375058794.5";
310.3668 + results[47][13]="12.20262573876507";
310.3669 + results[47][14]="981181273.6462696";
310.3670 + results[47][15]="1.054030330150941E+17";
310.3671 + results[47][16]="1.210870663276248E+33";
310.3672 + results[47][17]="1247478548243.150";
310.3673 + results[47][18]="9.503062483559163E+27";
310.3674 + results[47][19]="8040577.219577623";
310.3675 + results[47][20]="3.215911088814389E+23";
310.3676 + results[47][21]="149.9168798238013";
310.3677 + results[47][22]="1.847540281090668E+18";
310.3678 + results[47][23]="0.001643100951037101";
310.3679 + results[47][24]="9786196116419.247";
310.3680 + results[47][25]="9796633821214.788";
310.3681 + results[47][26]="2.624001946556017E+37";
310.3682 + results[47][27]="114207084.9942909";
310.3683 + results[47][28]="4.046800251839102E+32";
310.3684 + results[47][29]="1949.533553397026";
310.3685 + results[47][30]="9.120362371295601E+26";
310.3686 + results[47][31]="0.02378696805044898";
310.3687 + results[47][32]="1.854217550450959E+22";
310.3688 + results[47][33]="1.023520293369992E-7";
310.3689 + results[47][34]="4.905438185545787E+17";
310.3690 + results[47][35]="1204174859.319065";
310.3691 + results[47][36]="2.537414009565692E+41";
310.3692 + results[47][37]="10188.26876910955";
310.3693 + results[47][38]="1.241826915768028E+36";
310.3694 + results[47][39]="0.1085863966072925";
310.3695 + results[47][40]="2.251541579928655E+31";
310.3696 + results[47][41]="0.000001738449692274594";
310.3697 + results[47][42]="8.131156387513517E+25";
310.3698 + results[47][43]="3.136103551657476E-11";
310.3699 + results[47][44]="2.135990115551220E+21";
310.3700 + results[47][45]="275083.7229955457";
310.3701 + results[47][46]="1.497718006025124E+45";
310.3702 + results[47][47]="1";
310.3703 + results[47][48]="1.240200010695352E+40";
310.3704 + results[47][49]="0.00004235065836223342";
310.3705 + results[47][50]="4.179653170302738E+35";
310.3706 + results[47][51]="1.054143957912348E-10";
310.3707 + results[47][52]="7.489449188735266E+30";
310.3708 + results[47][53]="2.195787505969266E-15";
310.3709 + results[47][54]="3.054281909670523E+25";
310.3710 + results[47][55]="11.12099868317389";
310.3711 + results[47][56]="1.283747866701312E+49";
310.3712 + results[47][57]="0.0001115449297820002";
310.3713 + results[47][58]="1.026083144375309E+44";
310.3714 + results[47][59]="2.188682625866851E-9";
310.3715 + results[47][60]="5.299878830006924E+39";
310.3716 + results[47][61]="1.011760500325512E-14";
310.3717 + results[47][62]="3.789105284242457E+34";
310.3718 + results[47][63]="8.605398314572440E-20";
310.3719 + results[47][64]="3.959205458913181E+29";
310.3720 + results[47][65]="0.0009336568669461997";
310.3721 + results[47][66]="8.323652034369472E+52";
310.3722 + results[47][67]="3.013856369381733E-8";
310.3723 + results[47][68]="1.775730589302118E+48";
310.3724 + results[47][69]="1.338612348114789E-13";
310.3725 + results[47][70]="1.303792527901410E+43";
310.3726 + results[47][71]="8.180650204466976E-19";
310.3727 + results[47][72]="3.177780730489156E+38";
310.3728 + results[47][73]="1.550144275515960E-23";
310.3729 + results[47][74]="8.875172141979778E+32";
310.3730 + results[48][0]="5.762422338848205E-15";
310.3731 + results[48][1]="1.267088153400481E-20";
310.3732 + results[48][2]="2.842936621692024E-25";
310.3733 + results[48][3]="3.315174183018531E-30";
310.3734 + results[48][4]="2.313886238094478E-35";
310.3735 + results[48][5]="7.219181503001472E-20";
310.3736 + results[48][6]="4.486390757373126E-11";
310.3737 + results[48][7]="6.923150035938593E-25";
310.3738 + results[48][8]="6.613785107035720E-17";
310.3739 + results[48][9]="6.453365150275192E-30";
310.3740 + results[48][10]="2.355196305223146E-21";
310.3741 + results[48][11]="7.820284410257130E-35";
310.3742 + results[48][12]="1.050051394418058E-26";
310.3743 + results[48][13]="9.839240149597593E-40";
310.3744 + results[48][14]="7.911476094054727E-32";
310.3745 + results[48][15]="8.498873738599392E-24";
310.3746 + results[48][16]="9.763511150087314E-8";
310.3747 + results[48][17]="1.005868841707006E-28";
310.3748 + results[48][18]="7.662524110309441E-13";
310.3749 + results[48][19]="6.483290719429564E-34";
310.3750 + results[48][20]="2.593058426931717E-17";
310.3751 + results[48][21]="1.208812115230884E-38";
310.3752 + results[48][22]="1.489711550683502E-22";
310.3753 + results[48][23]="1.324867712358631E-43";
310.3754 + results[48][24]="7.890820861170891E-28";
310.3755 + results[48][25]="7.899237007522711E-28";
310.3756 + results[48][26]="0.002115789327468880";
310.3757 + results[48][27]="9.208763426010420E-33";
310.3758 + results[48][28]="3.263022268134115E-8";
310.3759 + results[48][29]="1.571950924515769E-37";
310.3760 + results[48][30]="7.353944761040615E-14";
310.3761 + results[48][31]="1.917994504540616E-42";
310.3762 + results[48][32]="1.495095576891135E-18";
310.3763 + results[48][33]="8.252864735875365E-48";
310.3764 + results[48][34]="3.955360541236747E-23";
310.3765 + results[48][35]="9.709521439561277E-32";
310.3766 + results[48][36]="20.45971607549835";
310.3767 + results[48][37]="8.215020707343183E-37";
310.3768 + results[48][38]="0.0001001311808626548";
310.3769 + results[48][39]="8.755555206487259E-42";
310.3770 + results[48][40]="1.815466505814869E-9";
310.3771 + results[48][41]="1.401749457573287E-46";
310.3772 + results[48][42]="6.556326654887352E-15";
310.3773 + results[48][43]="2.528707889543666E-51";
310.3774 + results[48][44]="1.722294869481269E-19";
310.3775 + results[48][45]="2.218059350292316E-35";
310.3776 + results[48][46]="120764.2310199132";
310.3777 + results[48][47]="8.063215540849113E-41";
310.3778 + results[48][48]="1";
310.3779 + results[48][49]="3.414824866715520E-45";
310.3780 + results[48][50]="0.00003370144439814430";
310.3781 + results[48][51]="8.499789943731035E-51";
310.3782 + results[48][52]="6.038904309100998E-10";
310.3783 + results[48][53]="1.770510794253370E-55";
310.3784 + results[48][54]="2.462733336018967E-15";
310.3785 + results[48][55]="8.967100941193022E-40";
310.3786 + results[48][56]="1035113574.931792";
310.3787 + results[48][57]="8.994108113211472E-45";
310.3788 + results[48][58]="8273.529555930313";
310.3789 + results[48][59]="1.764781976287603E-49";
310.3790 + results[48][60]="0.4273406534672904";
310.3791 + results[48][61]="8.158042989841942E-55";
310.3792 + results[48][62]="0.000003055237261381728";
310.3793 + results[48][63]="6.938718142525727E-60";
310.3794 + results[48][64]="3.192392698572340E-11";
310.3795 + results[48][65]="7.528276559381090E-44";
310.3796 + results[48][66]="6711540044014.826";
310.3797 + results[48][67]="2.430137351548587E-48";
310.3798 + results[48][68]="143180984.8402199";
310.3799 + results[48][69]="1.079351988849169E-53";
310.3800 + results[48][70]="1051.276017301760";
310.3801 + results[48][71]="6.596234586290859E-59";
310.3802 + results[48][72]="0.02562313097149101";
310.3803 + results[48][73]="1.249914741289858E-63";
310.3804 + results[48][74]="7.156242594292246E-8";
310.3805 + results[49][0]="1.687472290311238E+30";
310.3806 + results[49][1]="3.710550915072856E+24";
310.3807 + results[49][2]="8.325277964917845E+19";
310.3808 + results[49][3]="970818215402995.0";
310.3809 + results[49][4]="6776002660.189255";
310.3810 + results[49][5]="2.114070789798686E+25";
310.3811 + results[49][6]="1.313798198291870E+34";
310.3812 + results[49][7]="2.027380702131727E+20";
310.3813 + results[49][8]="1.936786033011718E+28";
310.3814 + results[49][9]="1889808526690925";
310.3815 + results[49][10]="6.896975385705340E+23";
310.3816 + results[49][11]="22900982379.74620";
310.3817 + results[49][12]="3.074978762902205E+18";
310.3818 + results[49][13]="288133.0824752154";
310.3819 + results[49][14]="23168028823874.12";
310.3820 + results[49][15]="2.488816870650781E+21";
310.3821 + results[49][16]="2.859154284968690E+37";
310.3822 + results[49][17]="2.945594228012286E+16";
310.3823 + results[49][18]="2.243899587646931E+32";
310.3824 + results[49][19]="189857195390.0929";
310.3825 + results[49][20]="7.593532693891262E+27";
310.3826 + results[49][21]="3539894.906509671";
310.3827 + results[49][22]="4.362483022786321E+22";
310.3828 + results[49][23]="38.79753030008030";
310.3829 + results[49][24]="2.310754187742728E+17";
310.3830 + results[49][25]="2.313218778660363E+17";
310.3831 + results[49][26]="6.195894108923685E+41";
310.3832 + results[49][27]="2696701525096.859";
310.3833 + results[49][28]="9.555460076266186E+36";
310.3834 + results[49][29]="46033134.51994738";
310.3835 + results[49][30]="2.153534968284877E+31";
310.3836 + results[49][31]="561.6670193647148";
310.3837 + results[49][32]="4.378249647482396E+26";
310.3838 + results[49][33]="0.002416775400787454";
310.3839 + results[49][34]="1.158290892101044E+22";
310.3840 + results[49][35]="28433438956710.49";
310.3841 + results[49][36]="5.991439348740924E+45";
310.3842 + results[49][37]="240569312.5704755";
310.3843 + results[49][38]="2.932249376494788E+40";
310.3844 + results[49][39]="2563.983673607429";
310.3845 + results[49][40]="5.316426395714516E+35";
310.3846 + results[49][41]="0.04104894137430629";
310.3847 + results[49][42]="1.919959854688953E+30";
310.3848 + results[49][43]="7.405088074035996E-7";
310.3849 + results[49][44]="5.043581843006266E+25";
310.3850 + results[49][45]="6495382448.194808";
310.3851 + results[49][46]="3.536469240253245E+49";
310.3852 + results[49][47]="23612.38381341809";
310.3853 + results[49][48]="2.928407865794388E+44";
310.3854 + results[49][49]="1";
310.3855 + results[49][50]="9.869157486415798E+39";
310.3856 + results[49][51]="0.000002489085172882200";
310.3857 + results[49][52]="1.768437487955098E+35";
310.3858 + results[49][53]="5.184777736365438E-11";
310.3859 + results[49][54]="7.211887672551995E+29";
310.3860 + results[49][55]="262593.2892956190";
310.3861 + results[49][56]="3.031234734820807E+53";
310.3862 + results[49][57]="2.633841694453359";
310.3863 + results[49][58]="2.422826902946868E+48";
310.3864 + results[49][59]="0.00005168001420772782";
310.3865 + results[49][60]="1.251427730987327E+44";
310.3866 + results[49][61]="2.389007726094191E-10";
310.3867 + results[49][62]="8.946980828098355E+38";
310.3868 + results[49][63]="2.031939678710256E-15";
310.3869 + results[49][64]="9.348627889203813E+33";
310.3870 + results[49][65]="22.04586429236709";
310.3871 + results[49][66]="1.965412665648703E+57";
310.3872 + results[49][67]="0.0007116433335235624";
310.3873 + results[49][68]="4.192923222382870E+52";
310.3874 + results[49][69]="3.160782854106722E-9";
310.3875 + results[49][70]="3.078564958187471E+47";
310.3876 + results[49][71]="1.931646524711914E-14";
310.3877 + results[49][72]="7.503497828319405E+42";
310.3878 + results[49][73]="3.660260159965578E-19";
310.3879 + results[49][74]="2.095639710265825E+37";
310.3880 + results[50][0]="1.709844323220016E-10";
310.3881 + results[50][1]="3.759744355260485E-16";
310.3882 + results[50][2]="8.435652158126978E-21";
310.3883 + results[50][3]="9.836890501942623E-26";
310.3884 + results[50][4]="6.865836997247178E-31";
310.3885 + results[50][5]="2.142098545603874E-15";
310.3886 + results[50][6]="0.000001331216165209868";
310.3887 + results[50][7]="2.054259145142100E-20";
310.3888 + results[50][8]="1.962463397384800E-12";
310.3889 + results[50][9]="1.914863076500820E-25";
310.3890 + results[50][10]="6.988413545126361E-17";
310.3891 + results[50][11]="2.320459716168051E-30";
310.3892 + results[50][12]="3.115745966294182E-22";
310.3893 + results[50][13]="2.919530698256769E-35";
310.3894 + results[50][14]="2.347518403243974E-27";
310.3895 + results[50][15]="2.521812904573124E-19";
310.3896 + results[50][16]="0.002897060148147514";
310.3897 + results[50][17]="2.984646087638879E-24";
310.3898 + results[50][18]="2.273648577130825E-8";
310.3899 + results[50][19]="1.923742686763465E-29";
310.3900 + results[50][20]="7.694205614150171E-13";
310.3901 + results[50][21]="3.586825837344361E-34";
310.3902 + results[50][22]="4.420319595457841E-18";
310.3903 + results[50][23]="3.931189704235886E-39";
310.3904 + results[50][24]="2.341389516707296E-23";
310.3905 + results[50][25]="2.343886782477983E-23";
310.3906 + results[50][26]="62.78037530003851";
310.3907 + results[50][27]="2.732453635286172E-28";
310.3908 + results[50][28]="0.0009682143677835323";
310.3909 + results[50][29]="4.664342886746792E-33";
310.3910 + results[50][30]="2.182085929066454E-9";
310.3911 + results[50][31]="5.691134427004636E-38";
310.3912 + results[50][32]="4.436295249628704E-14";
310.3913 + results[50][33]="2.448816329168904E-43";
310.3914 + results[50][34]="1.173647186900553E-18";
310.3915 + results[50][35]="2.881040149156310E-27";
310.3916 + results[50][36]="607087.2166127371";
310.3917 + results[50][37]="2.437587128400801E-32";
310.3918 + results[50][38]="2.971124313834108";
310.3919 + results[50][39]="2.597976247857604E-37";
310.3920 + results[50][40]="0.00005386910081262968";
310.3921 + results[50][41]="4.159315669124470E-42";
310.3922 + results[50][42]="1.945414142323337E-10";
310.3923 + results[50][43]="7.503262648537709E-47";
310.3924 + results[50][44]="5.110448232230970E-15";
310.3925 + results[50][45]="6.581496401425599E-31";
310.3926 + results[50][46]="3583354754.568408";
310.3927 + results[50][47]="2.392543015543006E-36";
310.3928 + results[50][48]="29672.31873465527";
310.3929 + results[50][49]="1.013257718682096E-40";
310.3930 + results[50][50]="1";
310.3931 + results[50][51]="2.522084763880048E-46";
310.3932 + results[50][52]="0.00001791882934677280";
310.3933 + results[50][53]="5.253516061023365E-51";
310.3934 + results[50][54]="7.307500850481565E-11";
310.3935 + results[50][55]="2.660746772529066E-35";
310.3936 + results[50][56]="30714219921944.59";
310.3937 + results[50][57]="2.668760426691597E-40";
310.3938 + results[50][58]="245494806.0441551";
310.3939 + results[50][59]="5.236517329758060E-45";
310.3940 + results[50][60]="12680.18807795731";
310.3941 + results[50][61]="2.420680518456101E-50";
310.3942 + results[50][62]="0.09065597382971390";
310.3943 + results[50][63]="2.058878563349585E-55";
310.3944 + results[50][64]="9.472569367822474E-7";
310.3945 + results[50][65]="2.233814215925896E-39";
310.3946 + results[50][66]="1.991469553864102E+17";
310.3947 + results[50][67]="7.210781006414067E-44";
310.3948 + results[50][68]="4248511818920.849";
310.3949 + results[50][69]="3.202687624001662E-49";
310.3950 + results[50][70]="31193797.06347679";
310.3951 + results[50][71]="1.957255750929793E-54";
310.3952 + results[50][72]="760.2977091658982";
310.3953 + results[50][73]="3.708786859469685E-59";
310.3954 + results[50][74]="0.002123423112003558";
310.3955 + results[51][0]="6.779487936755711E+35";
310.3956 + results[51][1]="1.490728784815458E+30";
310.3957 + results[51][2]="3.344713975889266E+25";
310.3958 + results[51][3]="3.900301307403033E+20";
310.3959 + results[51][4]="2722286378148756";
310.3960 + results[51][5]="8.493364601705167E+30";
310.3961 + results[51][6]="5.278237211829022E+39";
310.3962 + results[51][7]="8.145083680620504E+25";
310.3963 + results[51][8]="7.781115946181321E+33";
310.3964 + results[51][9]="7.592381921196569E+20";
310.3965 + results[51][10]="2.770887658182901E+29";
310.3966 + results[51][11]="9200561969210697";
310.3967 + results[51][12]="1.235385111125618E+24";
310.3968 + results[51][13]="115758627151.1858";
310.3969 + results[51][14]="9.307848954420085E+18";
310.3970 + results[51][15]="9.998922084971854E+26";
310.3971 + results[51][16]="1.148676757275435E+43";
310.3972 + results[51][17]="1.183404352773304E+22";
310.3973 + results[51][18]="9.014957029568579E+37";
310.3974 + results[51][19]="7.627589343206385E+16";
310.3975 + results[51][20]="3.050732364091198E+33";
310.3976 + results[51][21]="1422167045577.915";
310.3977 + results[51][22]="1.752645136580379E+28";
310.3978 + results[51][23]="15587064.16428300";
310.3979 + results[51][24]="9.283548079903686E+22";
310.3980 + results[51][25]="9.293449673246033E+22";
310.3981 + results[51][26]="2.489225429658254E+47";
310.3982 + results[51][27]="1.083410706261310E+18";
310.3983 + results[51][28]="3.838944597143528E+42";
310.3984 + results[51][29]="18493997321370.88";
310.3985 + results[51][30]="8.651913529303709E+36";
310.3986 + results[51][31]="225651988.7241708";
310.3987 + results[51][32]="1.758979441596474E+32";
310.3988 + results[51][33]="970.9492576298560";
310.3989 + results[51][34]="4.653480341774795E+27";
310.3990 + results[51][35]="1.142324869654275E+19";
310.3991 + results[51][36]="2.407084905737968E+51";
310.3992 + results[51][37]="96649690895033.44";
310.3993 + results[51][38]="1.178043004892208E+46";
310.3994 + results[51][39]="1030090774.530830";
310.3995 + results[51][40]="2.135895731345520E+41";
310.3996 + results[51][41]="16491.57763724665";
310.3997 + results[51][42]="7.713516096621809E+35";
310.3998 + results[51][43]="0.2975023978573374";
310.3999 + results[51][44]="2.026279332645786E+31";
310.4000 + results[51][45]="2609546076992446";
310.4001 + results[51][46]="1.420790770352885E+55";
310.4002 + results[51][47]="9486370362.359466";
310.4003 + results[51][48]="1.176499662485828E+50";
310.4004 + results[51][49]="401754.0303139023";
310.4005 + results[51][50]="3.964973795970168E+45";
310.4006 + results[51][51]="1";
310.4007 + results[51][52]="7.104768881441538E+40";
310.4008 + results[51][53]="0.00002083005351866606";
310.4009 + results[51][54]="2.897404938618912E+35";
310.4010 + results[51][55]="105497912307.8994";
310.4011 + results[51][56]="1.217810771541752E+59";
310.4012 + results[51][57]="1058156.515955435";
310.4013 + results[51][58]="9.733804730118538E+53";
310.4014 + results[51][59]="20.76265399463438";
310.4015 + results[51][60]="5.027661345707404E+49";
310.4016 + results[51][61]="0.00009597934824093921";
310.4017 + results[51][62]="3.594485606829729E+44";
310.4018 + results[51][63]="8.163399552765810E-10";
310.4019 + results[51][64]="3.755848932392581E+39";
310.4020 + results[51][65]="8857014.831211825";
310.4021 + results[51][66]="7.896124596543564E+62";
310.4022 + results[51][67]="285.9055773891117";
310.4023 + results[51][68]="1.684523803389072E+58";
310.4024 + results[51][69]="0.001269857250584455";
310.4025 + results[51][70]="1.236825879534966E+53";
310.4026 + results[51][71]="7.760467764448543E-9";
310.4027 + results[51][72]="3.014560493978934E+48";
310.4028 + results[51][73]="1.470524271263579E-13";
310.4029 + results[51][74]="8.419316996851535E+42";
310.4030 + results[52][0]="0.000009542165339768479";
310.4031 + results[52][1]="2.098208695724657E-11";
310.4032 + results[52][2]="4.707702715884311E-16";
310.4033 + results[52][3]="5.489694840870986E-21";
310.4034 + results[52][4]="3.831632560574457E-26";
310.4035 + results[52][5]="1.195445586399130E-10";
310.4036 + results[52][6]="0.07429146957357580";
310.4037 + results[52][7]="1.146424861461206E-15";
310.4038 + results[52][8]="1.095196209197808E-7";
310.4039 + results[52][9]="1.068631794769388E-20";
310.4040 + results[52][10]="3.900039120795011E-12";
310.4041 + results[52][11]="1.294983992124446E-25";
310.4042 + results[52][12]="1.738811116505963E-17";
310.4043 + results[52][13]="1.629308835837862E-30";
310.4044 + results[52][14]="1.310084692372364E-22";
310.4045 + results[52][15]="1.407353603167891E-14";
310.4046 + results[52][16]="161.6768647148971";
310.4047 + results[52][17]="1.665647922572809E-19";
310.4048 + results[52][18]="0.001268859998122764";
310.4049 + results[52][19]="1.073587258148610E-24";
310.4050 + results[52][20]="4.293922033213574E-8";
310.4051 + results[52][21]="2.001707682980056E-29";
310.4052 + results[52][22]="2.466857354302527E-13";
310.4053 + results[52][23]="2.193887573879874E-34";
310.4054 + results[52][24]="1.306664331355432E-18";
310.4055 + results[52][25]="1.308057985886294E-18";
310.4056 + results[52][26]="3503598.035624204";
310.4057 + results[52][27]="1.524906333112822E-23";
310.4058 + results[52][28]="54.03334944745757";
310.4059 + results[52][29]="2.603039962310287E-28";
310.4060 + results[52][30]="0.0001217761432311118";
310.4061 + results[52][31]="3.176063746613903E-33";
310.4062 + results[52][32]="2.475772922312967E-9";
310.4063 + results[52][33]="1.366616245837476E-38";
310.4064 + results[52][34]="6.549798338873787E-14";
310.4065 + results[52][35]="1.607828331528359E-22";
310.4066 + results[52][36]="33879848111.95684";
310.4067 + results[52][37]="1.360349541383301E-27";
310.4068 + results[52][38]="165810.1796906287";
310.4069 + results[52][39]="1.449858245525120E-32";
310.4070 + results[52][40]="3.006284605435543";
310.4071 + results[52][41]="2.321198326426144E-37";
310.4072 + results[52][42]="0.00001085681494407283";
310.4073 + results[52][43]="4.187362077807307E-42";
310.4074 + results[52][44]="2.851998941075561E-10";
310.4075 + results[52][45]="3.672949986886802E-26";
310.4076 + results[52][46]="199977056827865.5";
310.4077 + results[52][47]="1.335211675518248E-31";
310.4078 + results[52][48]="1655929534.258291";
310.4079 + results[52][49]="5.654709351113861E-36";
310.4080 + results[52][50]="55807.21712605078";
310.4081 + results[52][51]="1.407505320281584E-41";
310.4082 + results[52][52]="1";
310.4083 + results[52][53]="2.931841114927259E-46";
310.4084 + results[52][54]="0.000004078112866116254";
310.4085 + results[52][55]="1.484888728519684E-30";
310.4086 + results[52][56]="1.714075140041236E+18";
310.4087 + results[52][57]="1.489360925897899E-35";
310.4088 + results[52][58]="13700381944223.89";
310.4089 + results[52][59]="2.922354596061357E-40";
310.4090 + results[52][60]="707646009.2657238";
310.4091 + results[52][61]="1.350914432862808E-45";
310.4092 + results[52][62]="5059.257615288420";
310.4093 + results[52][63]="1.149002830210218E-50";
310.4094 + results[52][64]="0.05286377354516463";
310.4095 + results[52][65]="1.246629549674354E-34";
310.4096 + results[52][66]="1.111383737924134E+22";
310.4097 + results[52][67]="4.024136212733528E-39";
310.4098 + results[52][68]="2.370976215411088E+17";
310.4099 + results[52][69]="1.787330836195764E-44";
310.4100 + results[52][70]="1740839005707.414";
310.4101 + results[52][71]="1.092289966633505E-49";
310.4102 + results[52][72]="42430099.33586029";
310.4103 + results[52][73]="2.069770735406687E-54";
310.4104 + results[52][74]="118.5023346620570";
310.4105 + results[53][0]="3.254666595398102E+40";
310.4106 + results[53][1]="7.156624842464271E+34";
310.4107 + results[53][2]="1.605715497990454E+30";
310.4108 + results[53][3]="1.872439407756647E+25";
310.4109 + results[53][4]="1.306903208726412E+20";
310.4110 + results[53][5]="4.077456927364187E+35";
310.4111 + results[53][6]="2.533952784662378E+44";
310.4112 + results[53][7]="3.910255762579582E+30";
310.4113 + results[53][8]="3.735523741793833E+38";
310.4114 + results[53][9]="3.644917145504665E+25";
310.4115 + results[53][10]="1.330235496370605E+34";
310.4116 + results[53][11]="4.416965112915320E+20";
310.4117 + results[53][12]="5.930782222996091E+28";
310.4118 + results[53][13]="5557288993398558";
310.4119 + results[53][14]="4.468470974440470E+23";
310.4120 + results[53][15]="4.800238307602860E+31";
310.4121 + results[53][16]="5.514516591357251E+47";
310.4122 + results[53][17]="5.681235296456829E+26";
310.4123 + results[53][18]="4.327860714083221E+42";
310.4124 + results[53][19]="3.661819369005083E+21";
310.4125 + results[53][20]="1.464582105541592E+38";
310.4126 + results[53][21]="6.827476675964822E+16";
310.4127 + results[53][22]="8.414021284245927E+32";
310.4128 + results[53][23]="748296885090.3456";
310.4129 + results[53][24]="4.456804718040974E+27";
310.4130 + results[53][25]="4.461558231196124E+27";
310.4131 + results[53][26]="1.195016338977540E+52";
310.4132 + results[53][27]="5.201190219172758E+22";
310.4133 + results[53][28]="1.842983549563809E+47";
310.4134 + results[53][29]="8.878516468907865E+17";
310.4135 + results[53][30]="4.153572395553678E+41";
310.4136 + results[53][31]="10833000910053.42";
310.4137 + results[53][32]="8.444430735716701E+36";
310.4138 + results[53][33]="46612902.68696511";
310.4139 + results[53][34]="2.234022268644081E+32";
310.4140 + results[53][35]="5.484022730093443E+23";
310.4141 + results[53][36]="1.155582679411242E+56";
310.4142 + results[53][37]="4.639915630001839E+18";
310.4143 + results[53][38]="5.655496774583657E+50";
310.4144 + results[53][39]="49452142482867.52";
310.4145 + results[53][40]="1.025391379542793E+46";
310.4146 + results[53][41]="791720367.9994558";
310.4147 + results[53][42]="3.703070704887838E+40";
310.4148 + results[53][43]="14282.36358541959";
310.4149 + results[53][44]="9.727672234879347E+35";
310.4150 + results[53][45]="1.252779343391509E+20";
310.4151 + results[53][46]="6.820869514711989E+59";
310.4152 + results[53][47]="455417474269022.8";
310.4153 + results[53][48]="5.648087564592924E+54";
310.4154 + results[53][49]="19287229864.95862";
310.4155 + results[53][50]="1.903487090139787E+50";
310.4156 + results[53][51]="48007.55788283925";
310.4157 + results[53][52]="3.410826033199997E+45";
310.4158 + results[53][53]="1";
310.4159 + results[53][54]="1.390973353007717E+40";
310.4160 + results[53][55]="5064697131640181";
310.4161 + results[53][56]="5.846412110513578E+63";
310.4162 + results[53][57]="50799510188.83404";
310.4163 + results[53][58]="4.672961940014202E+58";
310.4164 + results[53][59]="996764.3134487737";
310.4165 + results[53][60]="2.413657430693617E+54";
310.4166 + results[53][61]="4.607734116234075";
310.4167 + results[53][62]="1.725624758289108E+49";
310.4168 + results[53][63]="0.00003919048765501487";
310.4169 + results[53][64]="1.803091350210368E+44";
310.4170 + results[53][65]="425203652178.5674";
310.4171 + results[53][66]="3.790736586186758E+67";
310.4172 + results[53][67]="13725628.55553436";
310.4173 + results[53][68]="8.086987399622141E+62";
310.4174 + results[53][69]="60.96274546037631";
310.4175 + results[53][70]="5.937699000276846E+57";
310.4176 + results[53][71]="0.0003725611053996715";
310.4177 + results[53][72]="1.447216874060142E+53";
310.4178 + results[53][73]="7.059627907080629E-9";
310.4179 + results[53][74]="4.041908480603224E+47";
310.4180 + results[54][0]="2.339848271255880";
310.4181 + results[54][1]="0.000005145048125465107";
310.4182 + results[54][2]="1.154382644727447E-10";
310.4183 + results[54][3]="1.346136073496915E-15";
310.4184 + results[54][4]="9.395602050179328E-21";
310.4185 + results[54][5]="0.00002931369546761954";
310.4186 + results[54][6]="18217.11953851009";
310.4187 + results[54][7]="2.811165112634539E-10";
310.4188 + results[54][8]="0.02685546587730432";
310.4189 + results[54][9]="2.620407599917871E-15";
310.4190 + results[54][10]="9.563342773563720E-7";
310.4191 + results[54][11]="3.175449122274317E-20";
310.4192 + results[54][12]="4.263764083022794E-12";
310.4193 + results[54][13]="3.995251944533639E-25";
310.4194 + results[54][14]="3.212477769454207E-17";
310.4195 + results[54][15]="3.450992283369952E-9";
310.4196 + results[54][16]="39645019.65068670";
310.4197 + results[54][17]="4.084359548780881E-14";
310.4198 + results[54][18]="311.1390095809556";
310.4199 + results[54][19]="2.632558963898978E-19";
310.4200 + results[54][20]="0.01052918880419032";
310.4201 + results[54][21]="4.908416585552623E-24";
310.4202 + results[54][22]="6.049016874444212E-8";
310.4203 + results[54][23]="5.379663697167850E-29";
310.4204 + results[54][24]="3.204090652350726E-13";
310.4205 + results[54][25]="3.207508052939222E-13";
310.4206 + results[54][26]="859122381024.4411";
310.4207 + results[54][27]="3.739245045871056E-18";
310.4208 + results[54][28]="13249596.37493202";
310.4209 + results[54][29]="6.382952232485079E-23";
310.4210 + results[54][30]="29.86090557789883";
310.4211 + results[54][31]="7.788072206149096E-28";
310.4212 + results[54][32]="0.0006070878868712484";
310.4213 + results[54][33]="3.351099615688073E-33";
310.4214 + results[54][34]="1.606085597408052E-8";
310.4215 + results[54][35]="3.942579286824783E-17";
310.4216 + results[54][36]="8307726937489580";
310.4217 + results[54][37]="3.335732938354928E-22";
310.4218 + results[54][38]="40658555840.44592";
310.4219 + results[54][39]="3.555218536425345E-27";
310.4220 + results[54][40]="737175.4299430523";
310.4221 + results[54][41]="5.691844249118863E-32";
310.4222 + results[54][42]="2.662215416909782";
310.4223 + results[54][43]="1.026789158436190E-36";
310.4224 + results[54][44]="0.00006993428173045223";
310.4225 + results[54][45]="9.006494198343990E-21";
310.4226 + results[54][46]="4.903666558358682E+19";
310.4227 + results[54][47]="3.274092011067419E-26";
310.4228 + results[54][48]="406052894714338.1";
310.4229 + results[54][49]="1.386599522072340E-30";
310.4230 + results[54][50]="13684569053.92081";
310.4231 + results[54][51]="3.451364311115807E-36";
310.4232 + results[54][52]="245211.4575613350";
310.4233 + results[54][53]="7.189210331295627E-41";
310.4234 + results[54][54]="1";
310.4235 + results[54][55]="3.641117294367092E-25";
310.4236 + results[54][56]="4.203108634591608E+23";
310.4237 + results[54][57]="3.652083634743231E-30";
310.4238 + results[54][58]="3.359490625690135E+18";
310.4239 + results[54][59]="7.165948300112717E-35";
310.4240 + results[54][60]="173522909369510.1";
310.4241 + results[54][61]="3.312596971229334E-40";
310.4242 + results[54][62]="1240587934.023157";
310.4243 + results[54][63]="2.817486587379466E-45";
310.4244 + results[54][64]="12962.80296320216";
310.4245 + results[54][65]="3.056878489146789E-29";
310.4246 + results[54][66]="2.725240262863416E+27";
310.4247 + results[54][67]="9.867643061497388E-34";
310.4248 + results[54][68]="5.813905336242105E+22";
310.4249 + results[54][69]="4.382739994878830E-39";
310.4250 + results[54][70]="4.268736699691402E+17";
310.4251 + results[54][71]="2.678420147978238E-44";
310.4252 + results[54][72]="10404346502618.53";
310.4253 + results[54][73]="5.075314988468698E-49";
310.4254 + results[54][74]="29058130.20690411";
310.4255 + results[55][0]="6.426182081186150E+24";
310.4256 + results[55][1]="1.413041028209840E+19";
310.4257 + results[55][2]="317040773861723.4";
310.4258 + results[55][3]="3697041222.976872";
310.4259 + results[55][4]="25804.17297930660";
310.4260 + results[55][5]="8.050741873371843E+19";
310.4261 + results[55][6]="5.003167452664180E+28";
310.4262 + results[55][7]="772061124475030.9";
310.4263 + results[55][8]="7.375611304488999E+22";
310.4264 + results[55][9]="7196712953.937829";
310.4265 + results[55][10]="2.626485773572434E+18";
310.4266 + results[55][11]="87210.84396777946";
310.4267 + results[55][12]="11710043204647.52";
310.4268 + results[55][13]="1.097259885232042";
310.4269 + results[55][14]="88227802.34034201";
310.4270 + results[55][15]="9477838818070297";
310.4271 + results[55][16]="1.088814680922766E+32";
310.4272 + results[55][17]="112173248444.9072";
310.4273 + results[55][18]="8.545152062590683E+26";
310.4274 + results[55][19]="723008.5578324046";
310.4275 + results[55][20]="2.891746668111807E+22";
310.4276 + results[55][21]="13.48052311620413";
310.4277 + results[55][22]="1.661307885852018E+17";
310.4278 + results[55][23]="0.0001477476077326687";
310.4279 + results[55][24]="879974577393.4671";
310.4280 + results[55][25]="880913135619.4773";
310.4281 + results[55][26]="2.359502074688797E+36";
310.4282 + results[55][27]="10269499.01244810";
310.4283 + results[55][28]="3.638882052887863E+31";
310.4284 + results[55][29]="175.3020217821514";
310.4285 + results[55][30]="8.201028191015562E+25";
310.4286 + results[55][31]="0.002138923735908606";
310.4287 + results[55][32]="1.667312085250398E+21";
310.4288 + results[55][33]="9.203492622641725E-9";
310.4289 + results[55][34]="4.410969127231112E+16";
310.4290 + results[55][35]="108279381.5218219";
310.4291 + results[55][36]="2.281642217442943E+40";
310.4292 + results[55][37]="916.1289430349850";
310.4293 + results[55][38]="1.116650537551916E+35";
310.4294 + results[55][39]="0.009764086814575751";
310.4295 + results[55][40]="2.024585780533582E+30";
310.4296 + results[55][41]="1.563213648163519E-7";
310.4297 + results[55][42]="7.311534349712662E+24";
310.4298 + results[55][43]="2.819983745167070E-12";
310.4299 + results[55][44]="1.920681924711475E+20";
310.4300 + results[55][45]="24735.52338530067";
310.4301 + results[55][46]="1.346747759525569E+44";
310.4302 + results[55][47]="0.08991998187294129";
310.4303 + results[55][48]="1.115187624805477E+39";
310.4304 + results[55][49]="0.000003808170432239159";
310.4305 + results[55][50]="3.758343373088038E+34";
310.4306 + results[55][51]="9.478860558694889E-12";
310.4307 + results[55][52]="6.734511352893900E+29";
310.4308 + results[55][53]="1.974451727335874E-16";
310.4309 + results[55][54]="2.746409739524259E+24";
310.4310 + results[55][55]="1";
310.4311 + results[55][56]="1.154345849032090E+48";
310.4312 + results[55][57]="0.00001003011806401597";
310.4313 + results[55][58]="9.226537774235836E+42";
310.4314 + results[55][59]="1.968063020435687E-10";
310.4315 + results[55][60]="4.765650083230079E+38";
310.4316 + results[55][61]="9.097748584902804E-16";
310.4317 + results[55][62]="3.407162784737478E+33";
310.4318 + results[55][63]="7.737972604557934E-21";
310.4319 + results[55][64]="3.560116830967234E+28";
310.4320 + results[55][65]="0.00008395440855134944";
310.4321 + results[55][66]="7.484626400471738E+51";
310.4322 + results[55][67]="2.710059101024540E-9";
310.4323 + results[55][68]="1.596736624012738E+47";
310.4324 + results[55][69]="1.203679980773772E-14";
310.4325 + results[55][70]="1.172370004749711E+42";
310.4326 + results[55][71]="7.356039180945439E-20";
310.4327 + results[55][72]="2.857459856817670E+37";
310.4328 + results[55][73]="1.393889451548389E-24";
310.4329 + results[55][74]="7.980553181260552E+31";
310.4330 + results[56][0]="5.566946930657264E-24";
310.4331 + results[56][1]="1.224105435467771E-29";
310.4332 + results[56][2]="2.746497283526938E-34";
310.4333 + results[56][3]="3.202715395976701E-39";
310.4334 + results[56][4]="2.235393578184839E-44";
310.4335 + results[56][5]="6.974289273983464E-29";
310.4336 + results[56][6]="4.334201449989442E-20";
310.4337 + results[56][7]="6.688299915682963E-34";
310.4338 + results[56][8]="6.389429399060419E-26";
310.4339 + results[56][9]="6.234451278160885E-39";
310.4340 + results[56][10]="2.275302307167926E-30";
310.4341 + results[56][11]="7.555001305796269E-44";
310.4342 + results[56][12]="1.014431092247293E-35";
310.4343 + results[56][13]="9.505469146461484E-49";
310.4344 + results[56][14]="7.643099545454276E-41";
310.4345 + results[56][15]="8.210571230465625E-33";
310.4346 + results[56][16]="9.432309059158727E-17";
310.4347 + results[56][17]="9.717473193927414E-38";
310.4348 + results[56][18]="7.402592619669160E-22";
310.4349 + results[56][19]="6.263361699083869E-43";
310.4350 + results[56][20]="2.505095566061517E-26";
310.4351 + results[56][21]="1.167806262525866E-47";
310.4352 + results[56][22]="1.439176904603599E-31";
310.4353 + results[56][23]="1.279924970982950E-52";
310.4354 + results[56][24]="7.623144988404633E-37";
310.4355 + results[56][25]="7.631275638562877E-37";
310.4356 + results[56][26]="2.044016597510373E-12";
310.4357 + results[56][27]="8.896379729748234E-42";
310.4358 + results[56][28]="3.152332601134258E-17";
310.4359 + results[56][29]="1.518626518466200E-46";
310.4360 + results[56][30]="7.104481033905097E-23";
310.4361 + results[56][31]="1.852931456982391E-51";
310.4362 + results[56][32]="1.444378291521926E-27";
310.4363 + results[56][33]="7.972907452613771E-57";
310.4364 + results[56][34]="3.821185072852883E-32";
310.4365 + results[56][35]="9.380150811181354E-41";
310.4366 + results[56][36]="1.976567264789908E-8";
310.4367 + results[56][37]="7.936347185751581E-46";
310.4368 + results[56][38]="9.673448719794147E-14";
310.4369 + results[56][39]="8.458545437455212E-51";
310.4370 + results[56][40]="1.753881457824083E-18";
310.4371 + results[56][41]="1.354198700046664E-55";
310.4372 + results[56][42]="6.333920077629528E-24";
310.4373 + results[56][43]="2.442927955717607E-60";
310.4374 + results[56][44]="1.663870430445044E-28";
310.4375 + results[56][45]="2.142817371937639E-44";
310.4376 + results[56][46]="0.0001166676140131492";
310.4377 + results[56][47]="7.789691620439270E-50";
310.4378 + results[56][48]="9.660775630982277E-10";
310.4379 + results[56][49]="3.298985685643760E-54";
310.4380 + results[56][50]="3.255820927704967E-14";
310.4381 + results[56][51]="8.211456355686501E-60";
310.4382 + results[56][52]="5.834049958719679E-19";
310.4383 + results[56][53]="1.710450753551403E-64";
310.4384 + results[56][54]="2.379191419821972E-24";
310.4385 + results[56][55]="8.662915025323579E-49";
310.4386 + results[56][56]="1";
310.4387 + results[56][57]="8.689006048253338E-54";
310.4388 + results[56][58]="0.000007992871271614319";
310.4389 + results[56][59]="1.704916271051602E-58";
310.4390 + results[56][60]="4.128442171144841E-10";
310.4391 + results[56][61]="7.881302291277083E-64";
310.4392 + results[56][62]="2.951596168162563E-15";
310.4393 + results[56][63]="6.703339914156715E-69";
310.4394 + results[56][64]="3.084098958689342E-20";
310.4395 + results[56][65]="7.272899072816394E-53";
310.4396 + results[56][66]="6483.868250358015";
310.4397 + results[56][67]="2.347701170578040E-57";
310.4398 + results[56][68]="0.1383239369164440";
310.4399 + results[56][69]="1.042737739112631E-62";
310.4400 + results[56][70]="0.000001015614172938495";
310.4401 + results[56][71]="6.372474234748120E-68";
310.4402 + results[56][72]="2.475393192788476E-11";
310.4403 + results[56][73]="1.207514587345858E-72";
310.4404 + results[56][74]="6.913485406433592E-17";
310.4405 + results[57][0]="6.406885781574903E+29";
310.4406 + results[57][1]="1.408798001370755E+24";
310.4407 + results[57][2]="3.160887756637065E+19";
310.4408 + results[57][3]="368593988563342.1";
310.4409 + results[57][4]="2572668917.216598";
310.4410 + results[57][5]="8.026567406274776E+24";
310.4411 + results[57][6]="4.988144128246639E+33";
310.4412 + results[57][7]="7.697428081578381E+19";
310.4413 + results[57][8]="7.353464094256007E+27";
310.4414 + results[57][9]="717510293299212.7";
310.4415 + results[57][10]="2.618599060159830E+23";
310.4416 + results[57][11]="8694897050.180986";
310.4417 + results[57][12]="1.167488072414467E+18";
310.4418 + results[57][13]="109396.5074218388";
310.4419 + results[57][14]="8796287518974.268";
310.4420 + results[57][15]="9.449379117552936E+20";
310.4421 + results[57][16]="1.085545228853283E+37";
310.4422 + results[57][17]="1.118364188028252E+16";
310.4423 + results[57][18]="8.519492999037822E+31";
310.4424 + results[57][19]="72083753473.07911";
310.4425 + results[57][20]="2.883063439189447E+27";
310.4426 + results[57][21]="1344004.430472940";
310.4427 + results[57][22]="1.656319372562645E+22";
310.4428 + results[57][23]="14.73039567328003";
310.4429 + results[57][24]="8.773322225891460E+16";
310.4430 + results[57][25]="8.782679625475591E+16";
310.4431 + results[57][26]="2.352417049958506E+41";
310.4432 + results[57][27]="1023866214425.824";
310.4433 + results[57][28]="3.627955353728795E+36";
310.4434 + results[57][29]="17477563.14166077";
310.4435 + results[57][30]="8.176402449775297E+30";
310.4436 + results[57][31]="213.2501055578004";
310.4437 + results[57][32]="1.662305542775258E+26";
310.4438 + results[57][33]="0.0009175856718636401";
310.4439 + results[57][34]="4.397724033833556E+21";
310.4440 + results[57][35]="10795424423794.65";
310.4441 + results[57][36]="2.274790987384843E+45";
310.4442 + results[57][37]="91337802.52514549";
310.4443 + results[57][38]="1.113297501011488E+40";
310.4444 + results[57][39]="973.4767579262472";
310.4445 + results[57][40]="2.018506429946206E+35";
310.4446 + results[57][41]="0.01558519688588414";
310.4447 + results[57][42]="7.289579547366953E+29";
310.4448 + results[57][43]="2.811516003270229E-7";
310.4449 + results[57][44]="1.914914572742777E+25";
310.4450 + results[57][45]="2466124847.925947";
310.4451 + results[57][46]="1.342703795638417E+49";
310.4452 + results[57][47]="8964.997350882443";
310.4453 + results[57][48]="1.111838981044821E+44";
310.4454 + results[57][49]="0.3796735400255500";
310.4455 + results[57][50]="3.747057959937145E+39";
310.4456 + results[57][51]="9.450397790132930E-7";
310.4457 + results[57][52]="6.714289213658032E+34";
310.4458 + results[57][53]="1.968522917411524E-11";
310.4459 + results[57][54]="2.738162922904441E+29";
310.4460 + results[57][55]="99699.72373382105";
310.4461 + results[57][56]="1.150879622417825E+53";
310.4462 + results[57][57]="1";
310.4463 + results[57][58]="9.198832671109769E+47";
310.4464 + results[57][59]="0.00001962153394281874";
310.4465 + results[57][60]="4.751339967101001E+43";
310.4466 + results[57][61]="9.070430205145709E-11";
310.4467 + results[57][62]="3.396931883544830E+38";
310.4468 + results[57][63]="7.714737309343017E-16";
310.4469 + results[57][64]="3.549426645075597E+33";
310.4470 + results[57][65]="8.370231338805882";
310.4471 + results[57][66]="7.462151843778957E+56";
310.4472 + results[57][67]="0.0002701921436744741";
310.4473 + results[57][68]="1.591942002897441E+52";
310.4474 + results[57][69]="1.200065615470761E-9";
310.4475 + results[57][70]="1.168849655873646E+47";
310.4476 + results[57][71]="7.333950741154235E-15";
310.4477 + results[57][72]="2.848879583052055E+42";
310.4478 + results[57][73]="1.389703932348617E-19";
310.4479 + results[57][74]="7.956589474147437E+36";
310.4480 + results[58][0]="6.964890014465238E-19";
310.4481 + results[58][1]="1.531496497153692E-24";
310.4482 + results[58][2]="3.436183556816159E-29";
310.4483 + results[58][3]="4.006964815448415E-34";
310.4484 + results[58][4]="2.796734117467348E-39";
310.4485 + results[58][5]="8.725636929437082E-24";
310.4486 + results[58][6]="5.422583828394453E-15";
310.4487 + results[58][7]="8.367831394252054E-29";
310.4488 + results[58][8]="7.993910050511732E-21";
310.4489 + results[58][9]="7.800014620905704E-34";
310.4490 + results[58][10]="2.846664521232035E-25";
310.4491 + results[58][11]="9.452174380221672E-39";
310.4492 + results[58][12]="1.269169811166505E-30";
310.4493 + results[58][13]="1.189243367426543E-43";
310.4494 + results[58][14]="9.562395396755339E-36";
310.4495 + results[58][15]="1.027236765294149E-27";
310.4496 + results[58][16]="1.180090200208327E-11";
310.4497 + results[58][17]="1.215767508784710E-32";
310.4498 + results[58][18]="9.261493608634160E-17";
310.4499 + results[58][19]="7.836184878051788E-38";
310.4500 + results[58][20]="3.134162281529605E-21";
310.4501 + results[58][21]="1.461059765435212E-42";
310.4502 + results[58][22]="1.800575607560021E-26";
310.4503 + results[58][23]="1.601333147361503E-47";
310.4504 + results[58][24]="9.537429953960697E-32";
310.4505 + results[58][25]="9.547602331172774E-32";
310.4506 + results[58][26]="2.557299533609959E-7";
310.4507 + results[58][27]="1.113039285562200E-36";
310.4508 + results[58][28]="3.943930152271277E-12";
310.4509 + results[58][29]="1.899976199866263E-41";
310.4510 + results[58][30]="8.888521774566507E-18";
310.4511 + results[58][31]="2.318230075295776E-46";
310.4512 + results[58][32]="1.807083140011844E-22";
310.4513 + results[58][33]="9.975022969440973E-52";
310.4514 + results[58][34]="4.780741416946553E-27";
310.4515 + results[58][35]="1.173564604311067E-35";
310.4516 + results[58][36]="0.002472912671331814";
310.4517 + results[58][37]="9.929281876384678E-41";
310.4518 + results[58][38]="1.210259541417636E-8";
310.4519 + results[58][39]="1.058261186752084E-45";
310.4520 + results[58][40]="2.194307149738259E-13";
310.4521 + results[58][41]="1.694258113296445E-50";
310.4522 + results[58][42]="7.924461513753702E-19";
310.4523 + results[58][43]="3.056383460588637E-55";
310.4524 + results[58][44]="2.081693016068045E-23";
310.4525 + results[58][45]="2.680910650403675E-39";
310.4526 + results[58][46]="14.59645852517100";
310.4527 + results[58][47]="9.745798919724109E-45";
310.4528 + results[58][48]="0.0001208673992447659";
310.4529 + results[58][49]="4.127410005162593E-49";
310.4530 + results[58][50]="4.073405935195787E-9";
310.4531 + results[58][51]="1.027347504625585E-54";
310.4532 + results[58][52]="7.299066581290476E-14";
310.4533 + results[58][53]="2.139970350361897E-59";
310.4534 + results[58][54]="2.976641733579987E-19";
310.4535 + results[58][55]="1.083830169527293E-43";
310.4536 + results[58][56]="125111.4857249578";
310.4537 + results[58][57]="1.087094456170119E-48";
310.4538 + results[58][58]="1";
310.4539 + results[58][59]="2.133046077079208E-53";
310.4540 + results[58][60]="0.00005165155337615015";
310.4541 + results[58][61]="9.860414391091898E-59";
310.4542 + results[58][62]="3.692785818589105E-10";
310.4543 + results[58][63]="8.386648159795576E-64";
310.4544 + results[58][64]="3.858562028444187E-15";
310.4545 + results[58][65]="9.099232085277269E-48";
310.4546 + results[58][66]="811206390.0471738";
310.4547 + results[58][67]="2.937243814892411E-52";
310.4548 + results[58][68]="17305.91325894164";
310.4549 + results[58][69]="1.304584677618646E-57";
310.4550 + results[58][70]="0.1270649980996593";
310.4551 + results[58][71]="7.972697192533506E-63";
310.4552 + results[58][72]="0.000003097001201032130";
310.4553 + results[58][73]="1.510739440573996E-67";
310.4554 + results[58][74]="8.649564307367203E-12";
310.4555 + results[59][0]="3.265231862221327E+34";
310.4556 + results[59][1]="7.179856607930284E+28";
310.4557 + results[59][2]="1.610927955912394E+24";
310.4558 + results[59][3]="1.878517702221967E+19";
310.4559 + results[59][4]="131114566512174.5";
310.4560 + results[59][5]="4.090693128103987E+29";
310.4561 + results[59][6]="2.542178477372429E+38";
310.4562 + results[59][7]="3.922949196535957E+24";
310.4563 + results[59][8]="3.747649962375796E+32";
310.4564 + results[59][9]="3.656749239841227E+19";
310.4565 + results[59][10]="1.334553693809554E+28";
310.4566 + results[59][11]="443130342180164.7";
310.4567 + results[59][12]="5.950034670157650E+22";
310.4568 + results[59][13]="5575329010.496484";
310.4569 + results[59][14]="4.482976481149991E+17";
310.4570 + results[59][15]="4.815820794179703E+25";
310.4571 + results[59][16]="5.532417761102616E+41";
310.4572 + results[59][17]="5.699677666829715E+20";
310.4573 + results[59][18]="4.341909773142817E+36";
310.4574 + results[59][19]="3673706331174018";
310.4575 + results[59][20]="1.469336417627336E+32";
310.4576 + results[59][21]="68496399638.76680";
310.4577 + results[59][22]="8.441334797725325E+26";
310.4578 + results[59][23]="750725.9991093196";
310.4579 + results[59][24]="4.471272353863239E+21";
310.4580 + results[59][25]="4.476041297826234E+21";
310.4581 + results[59][26]="1.198895589312202E+46";
310.4582 + results[59][27]="5.218074271917703E+16";
310.4583 + results[59][28]="1.848966224710778E+41";
310.4584 + results[59][29]="890733782210.6083";
310.4585 + results[59][30]="4.167055681580780E+35";
310.4586 + results[59][31]="10868166.89150073";
310.4587 + results[59][32]="8.471842964059609E+30";
310.4588 + results[59][33]="46.76421703510423";
310.4589 + results[59][34]="2.241274329850788E+26";
310.4590 + results[59][35]="5.501824910965054E+17";
310.4591 + results[59][36]="1.159333920586464E+50";
310.4592 + results[59][37]="4654977678672.980";
310.4593 + results[59][38]="5.673855592818941E+44";
310.4594 + results[59][39]="49612673.54342235";
310.4595 + results[59][40]="1.028719994995578E+40";
310.4596 + results[59][41]="794.2904429033256";
310.4597 + results[59][42]="3.715091576739267E+34";
310.4598 + results[59][43]="0.01432872685419792";
310.4599 + results[59][44]="9.759250109207765E+29";
310.4600 + results[59][45]="125684610342532.4";
310.4601 + results[59][46]="6.843011354521704E+53";
310.4602 + results[59][47]="456895846.0132791";
310.4603 + results[59][48]="5.666422331123308E+48";
310.4604 + results[59][49]="19349.83988163200";
310.4605 + results[59][50]="1.909666171287554E+44";
310.4606 + results[59][51]="0.04816339954701486";
310.4607 + results[59][52]="3.421898223260666E+39";
310.4608 + results[59][53]="0.000001003246190205216";
310.4609 + results[59][54]="1.395488717081967E+34";
310.4610 + results[59][55]="5081138101.861297";
310.4611 + results[59][56]="5.865390676242383E+57";
310.4612 + results[59][57]="50964.41506123880";
310.4613 + results[59][58]="4.688131263293223E+52";
310.4614 + results[59][59]="1";
310.4615 + results[59][60]="2.421492621803881E+48";
310.4616 + results[59][61]="0.000004622691697590433";
310.4617 + results[59][62]="1.731226464477344E+43";
310.4618 + results[59][63]="3.931770743217822E-11";
310.4619 + results[59][64]="1.808944527690531E+38";
310.4620 + results[59][65]="426583.9441094915";
310.4621 + results[59][66]="3.803042038163392E+61";
310.4622 + results[59][67]="13.77018455651177";
310.4623 + results[59][68]="8.113239298908500E+56";
310.4624 + results[59][69]="0.00006116064212757286";
310.4625 + results[59][70]="5.956973900613066E+51";
310.4626 + results[59][71]="3.737705096108644E-10";
310.4627 + results[59][72]="1.451914815301539E+47";
310.4628 + results[59][73]="7.082544802045064E-15";
310.4629 + results[59][74]="4.055029284323338E+41";
310.4630 + results[60][0]="1.348437667255375E-14";
310.4631 + results[60][1]="2.965054092372860E-20";
310.4632 + results[60][2]="6.652623846164517E-25";
310.4633 + results[60][3]="7.757685013397121E-30";
310.4634 + results[60][4]="5.414617634246651E-35";
310.4635 + results[60][5]="1.689327108110964E-19";
310.4636 + results[60][6]="1.049839447984212E-10";
310.4637 + results[60][7]="1.620054160484525E-24";
310.4638 + results[60][8]="1.547661111428041E-16";
310.4639 + results[60][9]="1.510121982992930E-29";
310.4640 + results[60][10]="5.511285402205287E-21";
310.4641 + results[60][11]="1.829988405457360E-34";
310.4642 + results[60][12]="2.457176460742298E-26";
310.4643 + results[60][13]="2.302434853732143E-39";
310.4644 + results[60][14]="1.851327747515669E-31";
310.4645 + results[60][15]="1.988781940038362E-23";
310.4646 + results[60][16]="2.284713862551959E-7";
310.4647 + results[60][17]="2.353786922788046E-28";
310.4648 + results[60][18]="1.793071650950697E-12";
310.4649 + results[60][19]="1.517124726334002E-33";
310.4650 + results[60][20]="6.067895497169673E-17";
310.4651 + results[60][21]="2.828685044174972E-38";
310.4652 + results[60][22]="3.486004756618662E-22";
310.4653 + results[60][23]="3.100261352644838E-43";
310.4654 + results[60][24]="1.846494312475907E-27";
310.4655 + results[60][25]="1.848463735764689E-27";
310.4656 + results[60][26]="0.004951060261414672";
310.4657 + results[60][27]="2.154899926158156E-32";
310.4658 + results[60][28]="7.635646741444116E-8";
310.4659 + results[60][29]="3.678449292763319E-37";
310.4660 + results[60][30]="1.720862431732932E-13";
310.4661 + results[60][31]="4.488209789961917E-42";
310.4662 + results[60][32]="3.498603666092752E-18";
310.4663 + results[60][33]="1.931214516782934E-47";
310.4664 + results[60][34]="9.255755353824531E-23";
310.4665 + results[60][35]="2.272079981340803E-31";
310.4666 + results[60][36]="47.87683060222675";
310.4667 + results[60][37]="1.922358811568574E-36";
310.4668 + results[60][38]="0.0002343123221491472";
310.4669 + results[60][39]="2.048846777260200E-41";
310.4670 + results[60][40]="4.248288785737604E-9";
310.4671 + results[60][41]="3.280168751088831E-46";
310.4672 + results[60][42]="1.534215526112867E-14";
310.4673 + results[60][43]="5.917311795698881E-51";
310.4674 + results[60][44]="4.030262170254993E-19";
310.4675 + results[60][45]="5.190377588220942E-35";
310.4676 + results[60][46]="282594.7637793763";
310.4677 + results[60][47]="1.886835590161396E-40";
310.4678 + results[60][48]="2.340053519098534";
310.4679 + results[60][49]="7.990872946462834E-45";
310.4680 + results[60][50]="0.00007886318356258115";
310.4681 + results[60][51]="1.988996336942614E-50";
310.4682 + results[60][52]="1.413135928001109E-9";
310.4683 + results[60][53]="4.143090014694539E-55";
310.4684 + results[60][54]="5.762927809552455E-15";
310.4685 + results[60][55]="2.098349611355051E-39";
310.4686 + results[60][56]="2422221163.685803";
310.4687 + results[60][57]="2.104669434147318E-44";
310.4688 + results[60][58]="19360.50195272046";
310.4689 + results[60][59]="4.129684274053472E-49";
310.4690 + results[60][60]="1";
310.4691 + results[60][61]="1.909025720733676E-54";
310.4692 + results[60][62]="0.000007149418705177280";
310.4693 + results[60][63]="1.623697180745017E-59";
310.4694 + results[60][64]="7.470369768638670E-11";
310.4695 + results[60][65]="1.761657005552672E-43";
310.4696 + results[60][66]="15705362898567.62";
310.4697 + results[60][67]="5.686651461384062E-48";
310.4698 + results[60][68]="335051167.4433505";
310.4699 + results[60][69]="2.525741419852499E-53";
310.4700 + results[60][70]="2460.042143830875";
310.4701 + results[60][71]="1.543554195644939E-58";
310.4702 + results[60][72]="0.05995949780016016";
310.4703 + results[60][73]="2.924867388928466E-63";
310.4704 + results[60][74]="1.674599066629639E-7";
310.4705 + results[61][0]="7.063486115509977E+39";
310.4706 + results[61][1]="1.553176607402299E+34";
310.4707 + results[61][2]="3.484826722820572E+29";
310.4708 + results[61][3]="4.063688052571492E+24";
310.4709 + results[61][4]="2.836325134564299E+19";
310.4710 + results[61][5]="8.849158446444201E+34";
310.4711 + results[61][6]="5.499346795499110E+43";
310.4712 + results[61][7]="8.486287758668364E+29";
310.4713 + results[61][8]="8.107073124364424E+37";
310.4714 + results[61][9]="7.910432879932915E+24";
310.4715 + results[61][10]="2.886962361139478E+33";
310.4716 + results[61][11]="9.585980878005454E+19";
310.4717 + results[61][12]="1.287136382739755E+28";
310.4718 + results[61][13]="1206078487432465";
310.4719 + results[61][14]="9.697762200941783E+22";
310.4720 + results[61][15]="1.041778493835083E+31";
310.4721 + results[61][16]="1.196795746509847E+47";
310.4722 + results[61][17]="1.232978108793337E+26";
310.4723 + results[61][18]="9.392600798807385E+41";
310.4724 + results[61][19]="7.947115169045187E+20";
310.4725 + results[61][20]="3.178529985880788E+37";
310.4726 + results[61][21]="1.481742762003150E+16";
310.4727 + results[61][22]="1.826064844887958E+32";
310.4728 + results[61][23]="162400187644.0589";
310.4729 + results[61][24]="9.672443343331502E+26";
310.4730 + results[61][25]="9.682759722348257E+26";
310.4731 + results[61][26]="2.593501076303929E+51";
310.4732 + results[61][27]="1.128795648353017E+22";
310.4733 + results[61][28]="3.999761060584132E+46";
310.4734 + results[61][29]="1.926872567934611E+17";
310.4735 + results[61][30]="9.014349115587456E+40";
310.4736 + results[61][31]="2351047312362.565";
310.4737 + results[61][32]="1.832664499013753E+36";
310.4738 + results[61][33]="10116230.99578109";
310.4739 + results[61][34]="4.848418359846594E+31";
310.4740 + results[61][35]="1.190177773229581E+23";
310.4741 + results[61][36]="2.507919620057646E+55";
310.4742 + results[61][37]="1.006984238446915E+18";
310.4743 + results[61][38]="1.227392169756080E+50";
310.4744 + results[61][39]="10732421019831.98";
310.4745 + results[61][40]="2.225370113978822E+45";
310.4746 + results[61][41]="171824230.3109566";
310.4747 + results[61][42]="8.036641462972210E+39";
310.4748 + results[61][43]="3099.650115465570";
310.4749 + results[61][44]="2.111161796555619E+35";
310.4750 + results[61][45]="2.718862051908959E+19";
310.4751 + results[61][46]="1.480308833506809E+59";
310.4752 + results[61][47]="98837620136215.22";
310.4753 + results[61][48]="1.225784175500373E+54";
310.4754 + results[61][49]="4185838283.725054";
310.4755 + results[61][50]="4.131069723475097E+49";
310.4756 + results[61][51]="10418.90800810271";
310.4757 + results[61][52]="7.402393339457015E+44";
310.4758 + results[61][53]="0.2170264114148377";
310.4759 + results[61][54]="3.018779551769291E+39";
310.4760 + results[61][55]="1099173043382890";
310.4761 + results[61][56]="1.268825839997009E+63";
310.4762 + results[61][57]="11024835397.91414";
310.4763 + results[61][58]="1.014156160519400E+58";
310.4764 + results[61][59]="216324.1819741618";
310.4765 + results[61][60]="5.238274105681931E+53";
310.4766 + results[61][61]="1";
310.4767 + results[61][62]="3.745061487400818E+48";
310.4768 + results[61][63]="0.000008505370897365375";
310.4769 + results[61][64]="3.913184451892906E+43";
310.4770 + results[61][65]="92280422752.79732";
310.4771 + results[61][66]="8.226899579190449E+66";
310.4772 + results[61][67]="2978823.909820644";
310.4773 + results[61][68]="1.755089854497003E+62";
310.4774 + results[61][69]="13.23052587726166";
310.4775 + results[61][70]="1.288637506091553E+57";
310.4776 + results[61][71]="0.00008085559973763583";
310.4777 + results[61][72]="3.140842847162717E+52";
310.4778 + results[61][73]="1.532125710597750E-9";
310.4779 + results[61][74]="8.772008928125169E+46";
310.4780 + results[62][0]="1.886080145619249E-9";
310.4781 + results[62][1]="4.147265973142270E-15";
310.4782 + results[62][2]="9.305125522088941E-20";
310.4783 + results[62][3]="1.085079127870824E-24";
310.4784 + results[62][4]="7.573507522122931E-30";
310.4785 + results[62][5]="2.362887358782933E-14";
310.4786 + results[62][6]="0.00001468426303279687";
310.4787 + results[62][7]="2.265994239939194E-19";
310.4788 + results[62][8]="2.164736988067710E-11";
310.4789 + results[62][9]="2.112230441755173E-24";
310.4790 + results[62][10]="7.708718190213518E-16";
310.4791 + results[62][11]="2.559632441351024E-29";
310.4792 + results[62][12]="3.436889853664501E-21";
310.4793 + results[62][13]="3.220450429158424E-34";
310.4794 + results[62][14]="2.589480101613048E-26";
310.4795 + results[62][15]="2.781739358191706E-18";
310.4796 + results[62][16]="0.03195663810957770";
310.4797 + results[62][17]="3.292277344287504E-23";
310.4798 + results[62][18]="2.507996418858833E-7";
310.4799 + results[62][19]="2.122025284706531E-28";
310.4800 + results[62][20]="8.487257142703900E-12";
310.4801 + results[62][21]="3.956524524331703E-33";
310.4802 + results[62][22]="4.875927540926171E-17";
310.4803 + results[62][23]="4.336382411621481E-38";
310.4804 + results[62][24]="2.582719502969886E-22";
310.4805 + results[62][25]="2.585474165089977E-22";
310.4806 + results[62][26]="692.5122818487806";
310.4807 + results[62][27]="3.014091096102228E-27";
310.4808 + results[62][28]="0.01068009450322826";
310.4809 + results[62][29]="5.145102622258724E-32";
310.4810 + results[62][30]="2.406996292561188E-8";
310.4811 + results[62][31]="6.277726868495983E-37";
310.4812 + results[62][32]="4.893549826028827E-13";
310.4813 + results[62][33]="2.701218933204230E-42";
310.4814 + results[62][34]="1.294616490585723E-17";
310.4815 + results[62][35]="3.177992610357912E-26";
310.4816 + results[62][36]="6696604.657880305";
310.4817 + results[62][37]="2.688832324474842E-31";
310.4818 + results[62][38]="32.77361864111679";
310.4819 + results[62][39]="2.865752953840177E-36";
310.4820 + results[62][40]="0.0005942145733696068";
310.4821 + results[62][41]="4.588021608964494E-41";
310.4822 + results[62][42]="2.145930444669381E-9";
310.4823 + results[62][43]="8.276633443518753E-46";
310.4824 + results[62][44]="5.637188611343273E-14";
310.4825 + results[62][45]="7.259859580559060E-30";
310.4826 + results[62][46]="39526956726.52857";
310.4827 + results[62][47]="2.639145457790906E-35";
310.4828 + results[62][48]="327306.8224978871";
310.4829 + results[62][49]="1.117695476511428E-39";
310.4830 + results[62][50]="11.03071267954583";
310.4831 + results[62][51]="2.782039238382100E-45";
310.4832 + results[62][52]="0.0001976574580780646";
310.4833 + results[62][53]="5.795002622652810E-50";
310.4834 + results[62][54]="8.060694228719894E-10";
310.4835 + results[62][55]="2.934993316079701E-34";
310.4836 + results[62][56]="338799735135353.3";
310.4837 + results[62][57]="2.943832947737714E-39";
310.4838 + results[62][58]="2707982669.793906";
310.4839 + results[62][59]="5.776251810602371E-44";
310.4840 + results[62][60]="139871.5114105495";
310.4841 + results[62][61]="2.670183128806329E-49";
310.4842 + results[62][62]="1";
310.4843 + results[62][63]="2.271089787438537E-54";
310.4844 + results[62][64]="0.00001044891910335168";
310.4845 + results[62][65]="2.464056279536351E-38";
310.4846 + results[62][66]="2.196732845873822E+18";
310.4847 + results[62][67]="7.954005347687989E-43";
310.4848 + results[62][68]="46864113190170.53";
310.4849 + results[62][69]="3.532792698269964E-48";
310.4850 + results[62][70]="344089812.7912729";
310.4851 + results[62][71]="2.158992582889526E-53";
310.4852 + results[62][72]="8386.625580725921";
310.4853 + results[62][73]="4.091056223648521E-58";
310.4854 + results[62][74]="0.02342287024561831";
310.4855 + results[63][0]="8.304736149364119E+44";
310.4856 + results[63][1]="1.826112730584637E+39";
310.4857 + results[63][2]="4.097207241015242E+34";
310.4858 + results[63][3]="4.777790529781906E+29";
310.4859 + results[63][4]="3.334745972621699E+24";
310.4860 + results[63][5]="1.040420053778644E+40";
310.4861 + results[63][6]="6.465734254108293E+48";
310.4862 + results[63][7]="9.977563425596263E+34";
310.4863 + results[63][8]="9.531710283058522E+42";
310.4864 + results[63][9]="9.300514904509633E+29";
310.4865 + results[63][10]="3.394281561588036E+38";
310.4866 + results[63][11]="1.127050306645041E+25";
310.4867 + results[63][12]="1.513321874227095E+33";
310.4868 + results[63][13]="1.418019862962190E+20";
310.4869 + results[63][14]="1.140192746202962E+28";
310.4870 + results[63][15]="1.224847812524888E+36";
310.4871 + results[63][16]="1.407105887505231E+52";
310.4872 + results[63][17]="1.449646492400778E+31";
310.4873 + results[63][18]="1.104314075441065E+47";
310.4874 + results[63][19]="9.343643287216183E+25";
310.4875 + results[63][20]="3.737085688838532E+42";
310.4876 + results[63][21]="1.742125981198698E+21";
310.4877 + results[63][22]="2.146954985177189E+37";
310.4878 + results[63][23]="1.909383959897199E+16";
310.4879 + results[63][24]="1.137215938028950E+32";
310.4880 + results[63][25]="1.138428863266573E+32";
310.4881 + results[63][26]="3.049251005746606E+56";
310.4882 + results[63][27]="1.327156289801157E+27";
310.4883 + results[63][28]="4.702629795748353E+51";
310.4884 + results[63][29]="2.265477415607447E+22";
310.4885 + results[63][30]="1.059841978011769E+46";
310.4886 + results[63][31]="2.764191404152434E+17";
310.4887 + results[63][32]="2.154714381216979E+41";
310.4888 + results[63][33]="1189393280769.765";
310.4889 + results[63][34]="5.700419674053768E+36";
310.4890 + results[63][35]="1.399324953128441E+28";
310.4891 + results[63][36]="2.948630518669679E+60";
310.4892 + results[63][37]="1.183939243330163E+23";
310.4893 + results[63][38]="1.443078949251087E+55";
310.4894 + results[63][39]="1.261840447564310E+18";
310.4895 + results[63][40]="2.616429243159934E+50";
310.4896 + results[63][41]="20201850381878.22";
310.4897 + results[63][42]="9.448901829150850E+44";
310.4898 + results[63][43]="364434444.1728835";
310.4899 + results[63][44]="2.482151362981211E+40";
310.4900 + results[63][45]="3.196641374864857E+24";
310.4901 + results[63][46]="1.740440071773177E+64";
310.4902 + results[63][47]="1.162061259043167E+19";
310.4903 + results[63][48]="1.441188385893991E+59";
310.4904 + results[63][49]="492140593777240.2";
310.4905 + results[63][50]="4.857013025445766E+54";
310.4906 + results[63][51]="1224979854.944370";
310.4907 + results[63][52]="8.703198753801531E+49";
310.4908 + results[63][53]="25516.39593777902";
310.4909 + results[63][54]="3.549262681424497E+44";
310.4910 + results[63][55]="1.292328173158645E+20";
310.4911 + results[63][56]="1.491793662272907E+68";
310.4912 + results[63][57]="1296220415423529";
310.4913 + results[63][58]="1.192371470635743E+63";
310.4914 + results[63][59]="25433832878.60738";
310.4915 + results[63][60]="6.158783865974074E+58";
310.4916 + results[63][61]="117572.7680858409";
310.4917 + results[63][62]="4.403172457253908E+53";
310.4918 + results[63][63]="1";
310.4919 + results[63][64]="4.600839280395232E+48";
310.4920 + results[63][65]="1.084966474317800E+16";
310.4921 + results[63][66]="9.672593562896609E+71";
310.4922 + results[63][67]="350228572717.9005";
310.4923 + results[63][68]="2.063507724325885E+67";
310.4924 + results[63][69]="1555549.550621002";
310.4925 + results[63][70]="1.515086786504186E+62";
310.4926 + results[63][71]="9.506416676394638";
310.4927 + results[63][72]="3.692775876635344E+57";
310.4928 + results[63][73]="0.0001801362608504635";
310.4929 + results[63][74]="1.031349371353387E+52";
310.4930 + results[64][0]="0.0001805048088671923";
310.4931 + results[64][1]="3.969086115148465E-10";
310.4932 + results[64][2]="8.905347462307516E-15";
310.4933 + results[64][3]="1.038460645678428E-19";
310.4934 + results[64][4]="7.248125329722949E-25";
310.4935 + results[64][5]="2.261370133514570E-9";
310.4936 + results[64][6]="1.405337995973826";
310.4937 + results[64][7]="2.168639854061398E-14";
310.4938 + results[64][8]="0.000002071732938743234";
310.4939 + results[64][9]="2.021482242194446E-19";
310.4940 + results[64][10]="7.377526913516641E-11";
310.4941 + results[64][11]="2.449662415828232E-24";
310.4942 + results[64][12]="3.289230033910451E-16";
310.4943 + results[64][13]="3.082089541802851E-29";
310.4944 + results[64][14]="2.478227724801148E-21";
310.4945 + results[64][15]="2.662226906608371E-13";
310.4946 + results[64][16]="3058.367836279547";
310.4947 + results[64][17]="3.150830542109802E-18";
310.4948 + results[64][18]="0.02400244842602282";
310.4949 + results[64][19]="2.030856267253379E-23";
310.4950 + results[64][20]="8.122617333673738E-7";
310.4951 + results[64][21]="3.786539531215795E-28";
310.4952 + results[64][22]="4.666442043141217E-12";
310.4953 + results[64][23]="4.150077504409531E-33";
310.4954 + results[64][24]="2.471757583175691E-17";
310.4955 + results[64][25]="2.474393896169260E-17";
310.4956 + results[64][26]="66275973.14124528";
310.4957 + results[64][27]="2.884596068061627E-22";
310.4958 + results[64][28]="1022.124336267703";
310.4959 + results[64][29]="4.924052498988474E-27";
310.4960 + results[64][30]="0.002303584005917990";
310.4961 + results[64][31]="6.008015572139217E-32";
310.4962 + results[64][32]="4.683307218312307E-8";
310.4963 + results[64][33]="2.585165897530746E-37";
310.4964 + results[64][34]="1.238995610723459E-12";
310.4965 + results[64][35]="3.041455847178024E-21";
310.4966 + results[64][36]="640889702718.8438";
310.4967 + results[64][37]="2.573311457270591E-26";
310.4968 + results[64][38]="3136555.878837656";
310.4969 + results[64][39]="2.742631008523106E-31";
310.4970 + results[64][40]="56.86852080029998";
310.4971 + results[64][41]="4.390905474129667E-36";
310.4972 + results[64][42]="0.0002053734384814057";
310.4973 + results[64][43]="7.921042704660115E-41";
310.4974 + results[64][44]="5.394996894497005E-9";
310.4975 + results[64][45]="6.947952710467755E-25";
310.4976 + results[64][46]="3782875179294822";
310.4977 + results[64][47]="2.525759297863022E-30";
310.4978 + results[64][48]="31324467082.23605";
310.4979 + results[64][49]="1.069675691290314E-34";
310.4980 + results[64][50]="1055679.785673480";
310.4981 + results[64][51]="2.662513902983238E-40";
310.4982 + results[64][52]="18.91654592432077";
310.4983 + results[64][53]="5.546030709333330E-45";
310.4984 + results[64][54]="0.00007714380931645150";
310.4985 + results[64][55]="2.808896582554887E-29";
310.4986 + results[64][56]="3.242438110432659E+19";
310.4987 + results[64][57]="2.817356435263650E-34";
310.4988 + results[64][58]="259163904228646.2";
310.4989 + results[64][59]="5.528085492354452E-39";
310.4990 + results[64][60]="13386218232.43738";
310.4991 + results[64][61]="2.555463490907705E-44";
310.4992 + results[64][62]="95703.67902257296";
310.4993 + results[64][63]="2.173516480484612E-49";
310.4994 + results[64][64]="1";
310.4995 + results[64][65]="2.358192512703023E-33";
310.4996 + results[64][66]="2.102354151798515E+23";
310.4997 + results[64][67]="7.612275747389602E-38";
310.4998 + results[64][68]="4.485068046429608E+18";
310.4999 + results[64][69]="3.381012584485181E-43";
310.5000 + results[64][70]="32930660998313.20";
310.5001 + results[64][71]="2.066235331649750E-48";
310.5002 + results[64][72]="802630922.6602931";
310.5003 + results[64][73]="3.915291316913575E-53";
310.5004 + results[64][74]="2241.654855774030";
310.5005 + results[65][0]="7.654371214175933E+28";
310.5006 + results[65][1]="1.683105214594628E+23";
310.5007 + results[65][2]="3.776344558103940E+18";
310.5008 + results[65][3]="44036296446727.19";
310.5009 + results[65][4]="307359356.4002524";
310.5010 + results[65][5]="9.589421225506852E+23";
310.5011 + results[65][6]="5.959386218061519E+32";
310.5012 + results[65][7]="9.196195146831527E+18";
310.5013 + results[65][8]="8.785257893845823E+26";
310.5014 + results[65][9]="85721680113273.25";
310.5015 + results[65][10]="3.128466770111285E+22";
310.5016 + results[65][11]="1038788140.761402";
310.5017 + results[65][12]="1.394809802928366E+17";
310.5018 + results[65][13]="13069.71133696832";
310.5019 + results[65][14]="1050901362569.648";
310.5020 + results[65][15]="1.128926876100059E+20";
310.5021 + results[65][16]="1.296911859318036E+36";
310.5022 + results[65][17]="1336121001630285";
310.5023 + results[65][18]="1.017832441445189E+31";
310.5024 + results[65][19]="8611918901.080548";
310.5025 + results[65][20]="3.444425037361932E+26";
310.5026 + results[65][21]="160569.5680407179";
310.5027 + results[65][22]="1.978821499094838E+21";
310.5028 + results[65][23]="1.759855262899042";
310.5029 + results[65][24]="1.048157675788096E+16";
310.5030 + results[65][25]="1.049275613776351E+16";
310.5031 + results[65][26]="2.810456431535270E+40";
310.5032 + results[65][27]="122322331723.2581";
310.5033 + results[65][28]="4.334354938206963E+35";
310.5034 + results[65][29]="2088062.137617592";
310.5035 + results[65][30]="9.768430666746378E+29";
310.5036 + results[65][31]="25.47720569790407";
310.5037 + results[65][32]="1.985973237165517E+25";
310.5038 + results[65][33]="0.0001096248878581826";
310.5039 + results[65][34]="5.254005362366659E+20";
310.5040 + results[65][35]="1289740269632.112";
310.5041 + results[65][36]="2.717715789811575E+44";
310.5042 + results[65][37]="10912219.60636705";
310.5043 + results[65][38]="1.330067779429277E+39";
310.5044 + results[65][39]="116.3022524136263";
310.5045 + results[65][40]="2.411530038110238E+34";
310.5046 + results[65][41]="0.001861979227937033";
310.5047 + results[65][42]="8.708934379831493E+28";
310.5048 + results[65][43]="3.358946592354670E-8";
310.5049 + results[65][44]="2.287767799039069E+24";
310.5050 + results[65][45]="294630428.7305122";
310.5051 + results[65][46]="1.604141798821501E+48";
310.5052 + results[65][47]="1071.057296746282";
310.5053 + results[65][48]="1.328325270880074E+43";
310.5054 + results[65][49]="0.04535998166087906";
310.5055 + results[65][50]="4.476648025921479E+38";
310.5056 + results[65][51]="1.129048577943026E-7";
310.5057 + results[65][52]="8.021629202205431E+33";
310.5058 + results[65][53]="2.351814230372703E-12";
310.5059 + results[65][54]="3.271310925672783E+28";
310.5060 + results[65][55]="11911.22678671919";
310.5061 + results[65][56]="1.374967519812914E+52";
310.5062 + results[65][57]="0.1194710109580630";
310.5063 + results[65][58]="1.098993838851543E+47";
310.5064 + results[65][59]="0.000002344204496696504";
310.5065 + results[65][60]="5.676473892750065E+42";
310.5066 + results[65][61]="1.083653466433309E-11";
310.5067 + results[65][62]="4.058348862827780E+37";
310.5068 + results[65][63]="9.216874656230971E-17";
310.5069 + results[65][64]="4.240535896086675E+32";
310.5070 + results[65][65]="1";
310.5071 + results[65][66]="8.915108246988459E+55";
310.5072 + results[65][67]="0.00003228012855771563";
310.5073 + results[65][68]="1.901909204727609E+51";
310.5074 + results[65][69]="1.433730522963019E-10";
310.5075 + results[65][70]="1.396436500452086E+46";
310.5076 + results[65][71]="8.761945093623320E-16";
310.5077 + results[65][72]="3.403585238850141E+41";
310.5078 + results[65][73]="1.660293337300849E-20";
310.5079 + results[65][74]="9.505817882546773E+35";
310.5080 + results[66][0]="8.585842148087876E-28";
310.5081 + results[66][1]="1.887924597172652E-33";
310.5082 + results[66][2]="4.235893108061360E-38";
310.5083 + results[66][3]="4.939513377372926E-43";
310.5084 + results[66][4]="3.447623381399535E-48";
310.5085 + results[66][5]="1.075637104994903E-32";
310.5086 + results[66][6]="6.684592102484691E-24";
310.5087 + results[66][7]="1.031529275030174E-37";
310.5088 + results[66][8]="9.854347979244672E-30";
310.5089 + results[66][9]="9.615326896589304E-43";
310.5090 + results[66][10]="3.509174183238983E-34";
310.5091 + results[66][11]="1.165199694700630E-47";
310.5092 + results[66][12]="1.564546121354764E-39";
310.5093 + results[66][13]="1.466018243960560E-52";
310.5094 + results[66][14]="1.178786991088576E-44";
310.5095 + results[66][15]="1.266307536401941E-36";
310.5096 + results[66][16]="1.454734842682516E-20";
310.5097 + results[66][17]="1.498715399312880E-41";
310.5098 + results[66][18]="1.141693867585976E-25";
310.5099 + results[66][19]="9.659915126649943E-47";
310.5100 + results[66][20]="3.863581845487368E-30";
310.5101 + results[66][21]="1.801094990573543E-51";
310.5102 + results[66][22]="2.219627002020180E-35";
310.5103 + results[66][23]="1.974014464146888E-56";
310.5104 + results[66][24]="1.175709421298576E-40";
310.5105 + results[66][25]="1.176963402694295E-40";
310.5106 + results[66][26]="3.152464730290456E-16";
310.5107 + results[66][27]="1.372079040819037E-45";
310.5108 + results[66][28]="4.861808536840948E-21";
310.5109 + results[66][29]="2.342161283709532E-50";
310.5110 + results[66][30]="1.095716439567200E-26";
310.5111 + results[66][31]="2.857756181088471E-55";
310.5112 + results[66][32]="2.227649044907988E-31";
310.5113 + results[66][33]="1.229652908535508E-60";
310.5114 + results[66][34]="5.893372482764269E-36";
310.5115 + results[66][35]="1.446690532409171E-44";
310.5116 + results[66][36]="3.048438352646615E-12";
310.5117 + results[66][37]="1.224014258049331E-49";
310.5118 + results[66][38]="1.491925552197951E-17";
310.5119 + results[66][39]="1.304552330622721E-54";
310.5120 + results[66][40]="2.704992436771430E-22";
310.5121 + results[66][41]="2.088566034591912E-59";
310.5122 + results[66][42]="9.768736552103434E-28";
310.5123 + results[66][43]="3.767701411241225E-64";
310.5124 + results[66][44]="2.566169401041071E-32";
310.5125 + results[66][45]="3.304844097995546E-48";
310.5126 + results[66][46]="1.799352015005968E-8";
310.5127 + results[66][47]="1.201395728546636E-53";
310.5128 + results[66][48]="1.489970995392888E-13";
310.5129 + results[66][49]="5.087990005752511E-58";
310.5130 + results[66][50]="5.021417465608115E-18";
310.5131 + results[66][51]="1.266444048309139E-63";
310.5132 + results[66][52]="8.997792264513616E-23";
310.5133 + results[66][53]="2.638009730467547E-68";
310.5134 + results[66][54]="3.669401240055428E-28";
310.5135 + results[66][55]="1.336072031513787E-52";
310.5136 + results[66][56]="0.0001542289203585813";
310.5137 + results[66][57]="1.340096021811295E-57";
310.5138 + results[66][58]="1.232731906786197E-9";
310.5139 + results[66][59]="2.629473957860669E-62";
310.5140 + results[66][60]="6.367251788185060E-14";
310.5141 + results[66][61]="1.215524743403277E-67";
310.5142 + results[66][62]="4.552214903502375E-19";
310.5143 + results[66][63]="1.033848877756975E-72";
310.5144 + results[66][64]="4.756572526776819E-24";
310.5145 + results[66][65]="1.121691371877399E-56";
310.5146 + results[66][66]="1";
310.5147 + results[66][67]="3.620834168628286E-61";
310.5148 + results[66][68]="0.00002133355145037165";
310.5149 + results[66][69]="1.608203157204890E-66";
310.5150 + results[66][70]="1.566370773931775E-10";
310.5151 + results[66][71]="9.828198212380789E-72";
310.5152 + results[66][72]="3.817772195867480E-15";
310.5153 + results[66][73]="1.862336711235894E-76";
310.5154 + results[66][74]="1.066259390149060E-20";
310.5155 + results[67][0]="2.371233187776874E+33";
310.5156 + results[67][1]="5.214059825026099E+27";
310.5157 + results[67][2]="1.169866641439169E+23";
310.5158 + results[67][3]="1.364192102518798E+18";
310.5159 + results[67][4]="9521627395340.313";
310.5160 + results[67][5]="2.970688672556348E+28";
310.5161 + results[67][6]="1.846146990216091E+37";
310.5162 + results[67][7]="2.848871909041218E+23";
310.5163 + results[67][8]="2.721568434319621E+31";
310.5164 + results[67][9]="2.655555722462696E+18";
310.5165 + results[67][10]="9.691618063161386E+26";
310.5166 + results[67][11]="32180421428746.45";
310.5167 + results[67][12]="4.320954919477782E+21";
310.5168 + results[67][13]="404884116.6663938";
310.5169 + results[67][14]="3.255567463712780E+16";
310.5170 + results[67][15]="3.497281226998773E+24";
310.5171 + results[67][16]="4.017678730737416E+40";
310.5172 + results[67][17]="4.139143991453913E+19";
310.5173 + results[67][18]="3.153123878132466E+35";
310.5174 + results[67][19]="266787007544990.6";
310.5175 + results[67][20]="1.067041920605562E+31";
310.5176 + results[67][21]="4974254292.501521";
310.5177 + results[67][22]="6.130153712234388E+25";
310.5178 + results[67][23]="54518.22348701272";
310.5179 + results[67][24]="3.247067848301876E+20";
310.5180 + results[67][25]="3.250531087260965E+20";
310.5181 + results[67][26]="8.706459847302905E+44";
310.5182 + results[67][27]="3789400389299890";
310.5183 + results[67][28]="1.342731622167273E+40";
310.5184 + results[67][29]="64685682211.09210";
310.5185 + results[67][30]="3.026143668938864E+34";
310.5186 + results[67][31]="789253.5388250330";
310.5187 + results[67][32]="6.152308946399247E+29";
310.5188 + results[67][33]="3.396048676267737";
310.5189 + results[67][34]="1.627628388459699E+25";
310.5190 + results[67][35]="3.995461998628989E+16";
310.5191 + results[67][36]="8.419160366577858E+48";
310.5192 + results[67][37]="338047588219.9918";
310.5193 + results[67][38]="4.120391828834159E+43";
310.5194 + results[67][39]="3602905.490468613";
310.5195 + results[67][40]="7.470633314853486E+38";
310.5196 + results[67][41]="57.68190249329044";
310.5197 + results[67][42]="2.697924317203462E+33";
310.5198 + results[67][43]="0.001040561714724588";
310.5199 + results[67][44]="7.087232614171990E+28";
310.5200 + results[67][45]="9127300351475.501";
310.5201 + results[67][46]="4.969440552113530E+52";
310.5202 + results[67][47]="33180081.51148695";
310.5203 + results[67][48]="4.114993744541877E+47";
310.5204 + results[67][49]="1405.198296524041";
310.5205 + results[67][50]="1.386812328803897E+43";
310.5206 + results[67][51]="0.003497658244837316";
310.5207 + results[67][52]="2.485005345583759E+38";
310.5208 + results[67][53]="7.285640842996488E-8";
310.5209 + results[67][54]="1.013413227219280E+33";
310.5210 + results[67][55]="368995642.7968486";
310.5211 + results[67][56]="4.259485885734702E+56";
310.5212 + results[67][57]="3701.069862359855";
310.5213 + results[67][58]="3.404552236793557E+51";
310.5214 + results[67][59]="0.07262066792903739";
310.5215 + results[67][60]="1.758504115806338E+47";
310.5216 + results[67][61]="3.357029587090330E-7";
310.5217 + results[67][62]="1.257228221867707E+42";
310.5218 + results[67][63]="2.855278175163260E-12";
310.5219 + results[67][64]="1.313667598474634E+37";
310.5220 + results[67][65]="30978.81094903443";
310.5221 + results[67][66]="2.761794529736332E+60";
310.5222 + results[67][67]="1";
310.5223 + results[67][68]="5.891888569548503E+55";
310.5224 + results[67][69]="0.000004441526682273164";
310.5225 + results[67][70]="4.325994234983640E+50";
310.5226 + results[67][71]="2.714346406011766E-11";
310.5227 + results[67][72]="1.054390236632627E+46";
310.5228 + results[67][73]="5.143391341618445E-16";
310.5229 + results[67][74]="2.944789350993672E+40";
310.5230 + results[68][0]="4.024572358737908E-23";
310.5231 + results[68][1]="8.849556069295544E-29";
310.5232 + results[68][2]="1.985554593624666E-33";
310.5233 + results[68][3]="2.315373222720905E-38";
310.5234 + results[68][4]="1.616056937083241E-43";
310.5235 + results[68][5]="5.041997379091630E-28";
310.5236 + results[68][6]="3.133370511719575E-19";
310.5237 + results[68][7]="4.835244040026928E-33";
310.5238 + results[68][8]="4.619178387700187E-25";
310.5239 + results[68][9]="4.507138400728770E-38";
310.5240 + results[68][10]="1.644908580459467E-29";
310.5241 + results[68][11]="5.461817725994849E-43";
310.5242 + results[68][12]="7.333734962012186E-35";
310.5243 + results[68][13]="6.871890258736175E-48";
310.5244 + results[68][14]="5.525507526633783E-40";
310.5245 + results[68][15]="5.935755888314043E-32";
310.5246 + results[68][16]="6.818999856009313E-16";
310.5247 + results[68][17]="7.025156607418828E-37";
310.5248 + results[68][18]="5.351635287926178E-21";
310.5249 + results[68][19]="4.528038919877851E-42";
310.5250 + results[68][20]="1.811035473617807E-25";
310.5251 + results[68][21]="8.442546449724692E-47";
310.5252 + results[68][22]="1.040439519497590E-30";
310.5253 + results[68][23]="9.253098194827277E-52";
310.5254 + results[68][24]="5.511081565737588E-36";
310.5255 + results[68][25]="5.516959543432190E-36";
310.5256 + results[68][26]="1.477702733941909E-11";
310.5257 + results[68][27]="6.431554746104564E-41";
310.5258 + results[68][28]="2.278949451126784E-16";
310.5259 + results[68][29]="1.097876876786368E-45";
310.5260 + results[68][30]="5.136118297584773E-22";
310.5261 + results[68][31]="1.339559513912385E-50";
310.5262 + results[68][32]="1.044199813655115E-26";
310.5263 + results[68][33]="5.763939076885797E-56";
310.5264 + results[68][34]="2.762490106944477E-31";
310.5265 + results[68][35]="6.781292537131541E-40";
310.5266 + results[68][36]="1.428940867974192E-7";
310.5267 + results[68][37]="5.737508172967645E-45";
310.5268 + results[68][38]="6.993329524475215E-13";
310.5269 + results[68][39]="6.115026528318585E-50";
310.5270 + results[68][40]="1.267952240893443E-17";
310.5271 + results[68][41]="9.790053191333628E-55";
310.5272 + results[68][42]="4.579048441525779E-23";
310.5273 + results[68][43]="1.766091979577825E-59";
310.5274 + results[68][44]="1.202879608212802E-27";
310.5275 + results[68][45]="1.549129832266147E-43";
310.5276 + results[68][46]="0.0008434376335284867";
310.5277 + results[68][47]="5.631484899930744E-49";
310.5278 + results[68][48]="6.984167633124823E-9";
310.5279 + results[68][49]="2.384970930690432E-53";
310.5280 + results[68][50]="2.353765371550753E-13";
310.5281 + results[68][51]="5.936395781336616E-59";
310.5282 + results[68][52]="4.217672001516121E-18";
310.5283 + results[68][53]="1.236554418332251E-63";
310.5284 + results[68][54]="1.720014245444119E-23";
310.5285 + results[68][55]="6.262773615644344E-48";
310.5286 + results[68][56]="7.229406726646745";
310.5287 + results[68][57]="6.281635877311693E-53";
310.5288 + results[68][58]="0.00005778371733623009";
310.5289 + results[68][59]="1.232553315830994E-57";
310.5290 + results[68][60]="2.984618760264661E-9";
310.5291 + results[68][61]="5.697713979929495E-63";
310.5292 + results[68][62]="2.133828919245919E-14";
310.5293 + results[68][63]="4.846117066640417E-68";
310.5294 + results[68][64]="2.229620575759295E-19";
310.5295 + results[68][65]="5.257874547924172E-52";
310.5296 + results[68][66]="46874.52074382950";
310.5297 + results[68][67]="1.697248663473332E-56";
310.5298 + results[68][68]="1";
310.5299 + results[68][69]="7.538375225269271E-62";
310.5300 + results[68][70]="0.000007342287933519324";
310.5301 + results[68][71]="4.606920809807113E-67";
310.5302 + results[68][72]="1.789562419904057E-10";
310.5303 + results[68][73]="8.729614080282214E-72";
310.5304 + results[68][74]="4.998039790184512E-16";
310.5305 + results[69][0]="5.338779562533849E+38";
310.5306 + results[69][1]="1.173934144274364E+33";
310.5307 + results[69][2]="2.633929108448886E+28";
310.5308 + results[69][3]="3.071448625904928E+23";
310.5309 + results[69][4]="2.143773543755267E+18";
310.5310 + results[69][5]="6.688440450921611E+33";
310.5311 + results[69][6]="4.156559494698874E+42";
310.5312 + results[69][7]="6.414172677182188E+28";
310.5313 + results[69][8]="6.127551693389194E+36";
310.5314 + results[69][9]="5.978925519149620E+23";
310.5315 + results[69][10]="2.182046570122424E+32";
310.5316 + results[69][11]="7.245351369200056E+18";
310.5317 + results[69][12]="9.728535318099962E+26";
310.5318 + results[69][13]="91158771663435.09";
310.5319 + results[69][14]="7.329838806791966E+21";
310.5320 + results[69][15]="7.874052048267494E+29";
310.5321 + results[69][16]="9.045715624703119E+45";
310.5322 + results[69][17]="9.319191997593739E+24";
310.5323 + results[69][18]="7.099189318657215E+40";
310.5324 + results[69][19]="6.006651015061551E+19";
310.5325 + results[69][20]="2.402421502642987E+36";
310.5326 + results[69][21]="1119942454101324";
310.5327 + results[69][22]="1.380190675584772E+31";
310.5328 + results[69][23]="12274658554.81710";
310.5329 + results[69][24]="7.310702108942491E+25";
310.5330 + results[69][25]="7.318499515570511E+25";
310.5331 + results[69][26]="1.960240356553922E+50";
310.5332 + results[69][27]="8.531751941115174E+20";
310.5333 + results[69][28]="3.023130824647137E+45";
310.5334 + results[69][29]="1.456383960705739E+16";
310.5335 + results[69][30]="6.813296160116931E+39";
310.5336 + results[69][31]="177698704811.3589";
310.5337 + results[69][32]="1.385178878009241E+35";
310.5338 + results[69][33]="764612.9178559042";
310.5339 + results[69][34]="3.664569651142300E+30";
310.5340 + results[69][35]="8.995695139186061E+21";
310.5341 + results[69][36]="1.895555508014859E+54";
310.5342 + results[69][37]="7.611067373954845E+16";
310.5343 + results[69][38]="9.276971914362904E+48";
310.5344 + results[69][39]="811186276297.3776";
310.5345 + results[69][40]="1.681996720782961E+44";
310.5346 + results[69][41]="12986953.95065576";
310.5347 + results[69][42]="6.074317481804861E+38";
310.5348 + results[69][43]="234.2801899350586";
310.5349 + results[69][44]="1.595674893152901E+34";
310.5350 + results[69][45]="2.054991673899878E+18";
310.5351 + results[69][46]="1.118858651001097E+58";
310.5352 + results[69][47]="7470422646319.768";
310.5353 + results[69][48]="9.264818245864578E+52";
310.5354 + results[69][49]="316377317.3157802";
310.5355 + results[69][50]="3.122377569719179E+48";
310.5356 + results[69][51]="787.4900895669555";
310.5357 + results[69][52]="5.594935082798914E+43";
310.5358 + results[69][53]="0.01640346071109881";
310.5359 + results[69][54]="2.281677674624746E+38";
310.5360 + results[69][55]="83078560412474.54";
310.5361 + results[69][56]="9.590139135570173E+61";
310.5362 + results[69][57]="833287769.5256027";
310.5363 + results[69][58]="7.665274758748302E+56";
310.5364 + results[69][59]="16350.38425388234";
310.5365 + results[69][60]="3.959233483443444E+52";
310.5366 + results[69][61]="0.07558278554283523";
310.5367 + results[69][62]="2.830621792469476E+47";
310.5368 + results[69][63]="6.428596244978392E-7";
310.5369 + results[69][64]="2.957693812169788E+42";
310.5370 + results[69][65]="6974811402.726853";
310.5371 + results[69][66]="6.218119865763931E+65";
310.5372 + results[69][67]="225147.8087458437";
310.5373 + results[69][68]="1.326545800808529E+61";
310.5374 + results[69][69]="1";
310.5375 + results[69][70]="9.739881226537191E+55";
310.5376 + results[69][71]="0.000006111291454907054";
310.5377 + results[69][72]="2.373936513408476E+51";
310.5378 + results[69][73]="1.158023290087738E-10";
310.5379 + results[69][74]="6.630128695943206E+45";
310.5380 + results[70][0]="5.481360027253576E-18";
310.5381 + results[70][1]="1.205285893092693E-23";
310.5382 + results[70][2]="2.704272308036475E-28";
310.5383 + results[70][3]="3.153476469031765E-33";
310.5384 + results[70][4]="2.201026371773776E-38";
310.5385 + results[70][5]="6.867065722216763E-23";
310.5386 + results[70][6]="4.267566922042078E-14";
310.5387 + results[70][7]="6.585473198283149E-28";
310.5388 + results[70][8]="6.291197552485674E-20";
310.5389 + results[70][9]="6.138602083626537E-33";
310.5390 + results[70][10]="2.240321539216762E-24";
310.5391 + results[70][11]="7.438849818270307E-38";
310.5392 + results[70][12]="9.988351081318820E-30";
310.5393 + results[70][13]="9.359330934659115E-43";
310.5394 + results[70][14]="7.525593625126715E-35";
310.5395 + results[70][15]="8.084340933043336E-27";
310.5396 + results[70][16]="9.287295619229160E-11";
310.5397 + results[70][17]="9.568075606715566E-32";
310.5398 + results[70][18]="7.288784281388184E-16";
310.5399 + results[70][19]="6.167068032304013E-37";
310.5400 + results[70][20]="2.466581929251223E-20";
310.5401 + results[70][21]="1.149852270323317E-41";
310.5402 + results[70][22]="1.417050827913914E-25";
310.5403 + results[70][23]="1.260247252438118E-46";
310.5404 + results[70][24]="7.505945851807534E-31";
310.5405 + results[70][25]="7.513951500384414E-31";
310.5406 + results[70][26]="0.000002012591643533670";
310.5407 + results[70][27]="8.759605730991504E-36";
310.5408 + results[70][28]="3.103868265262150E-11";
310.5409 + results[70][29]="1.495278973975256E-40";
310.5410 + results[70][30]="6.995255898556019E-17";
310.5411 + results[70][31]="1.824444268654967E-45";
310.5412 + results[70][32]="1.422172248091892E-21";
310.5413 + results[70][33]="7.850331026344006E-51";
310.5414 + results[70][34]="3.762437719628292E-26";
310.5415 + results[70][35]="9.235939258352015E-35";
310.5416 + results[70][36]="0.01946179284866684";
310.5417 + results[70][37]="7.814332841367511E-40";
310.5418 + results[70][38]="9.524727970077244E-8";
310.5419 + results[70][39]="8.328502755118070E-45";
310.5420 + results[70][40]="1.726917075949764E-12";
310.5421 + results[70][41]="1.333379088368309E-49";
310.5422 + results[70][42]="6.236541637956356E-18";
310.5423 + results[70][43]="2.405370091133565E-54";
310.5424 + results[70][44]="1.638289888797966E-22";
310.5425 + results[70][45]="2.109873443118451E-38";
310.5426 + results[70][46]="114.8739522564880";
310.5427 + results[70][47]="7.669931976137371E-44";
310.5428 + results[70][48]="0.0009512249718838192";
310.5429 + results[70][49]="3.248266687829637E-48";
310.5430 + results[70][50]="3.205765550006891E-8";
310.5431 + results[70][51]="8.085212450243923E-54";
310.5432 + results[70][52]="5.744356581633671E-13";
310.5433 + results[70][53]="1.684154080483660E-58";
310.5434 + results[70][54]="2.342613448311986E-18";
310.5435 + results[70][55]="8.529730340665701E-43";
310.5436 + results[70][56]="984625.8812110530";
310.5437 + results[70][57]="8.555420237109612E-48";
310.5438 + results[70][58]="7.869987919219759";
310.5439 + results[70][59]="1.678704685775246E-52";
310.5440 + results[70][60]="0.0004064971010792362";
310.5441 + results[70][61]="7.760134213639389E-58";
310.5442 + results[70][62]="2.906217978056231E-9";
310.5443 + results[70][63]="6.600281970033780E-63";
310.5444 + results[70][64]="3.036683654941584E-14";
310.5445 + results[70][65]="7.161084658530892E-47";
310.5446 + results[70][66]="6384184489.665129";
310.5447 + results[70][67]="2.311607333900624E-51";
310.5448 + results[70][68]="136197.3282789357";
310.5449 + results[70][69]="1.026706565245795E-56";
310.5450 + results[70][70]="1";
310.5451 + results[70][71]="6.274503058883598E-62";
310.5452 + results[70][72]="0.00002437336203793195";
310.5453 + results[70][73]="1.188950114640616E-66";
310.5454 + results[70][74]="6.807196660549431E-11";
310.5455 + results[71][0]="8.735926934473208E+43";
310.5456 + results[71][1]="1.920926457094031E+38";
310.5457 + results[71][2]="4.309938624075892E+33";
310.5458 + results[71][3]="5.025858525269176E+28";
310.5459 + results[71][4]="3.507889550962140E+23";
310.5460 + results[71][5]="1.094439775990578E+39";
310.5461 + results[71][6]="6.801442093489699E+47";
310.5462 + results[71][7]="1.049560919244317E+34";
310.5463 + results[71][8]="1.002660687778045E+42";
310.5464 + results[71][9]="9.783407587849290E+28";
310.5465 + results[71][10]="3.570516291397545E+37";
310.5466 + results[71][11]="1.185567964261042E+24";
310.5467 + results[71][12]="1.591895164857249E+32";
310.5468 + results[71][13]="1.491644971215360E+19";
310.5469 + results[71][14]="1.199392773340319E+27";
310.5470 + results[71][15]="1.288443221267910E+35";
310.5471 + results[71][16]="1.480164330477132E+51";
310.5472 + results[71][17]="1.524913689087910E+30";
310.5473 + results[71][18]="1.161651243610208E+46";
310.5474 + results[71][19]="9.828775242323811E+24";
310.5475 + results[71][20]="3.931119175659616E+41";
310.5476 + results[71][21]="1.832579025832696E+20";
310.5477 + results[71][22]="2.258427184775404E+36";
310.5478 + results[71][23]="2008521217714331";
310.5479 + results[71][24]="1.196261406101385E+31";
310.5480 + results[71][25]="1.197537307714907E+31";
310.5481 + results[71][26]="3.207571379990312E+55";
310.5482 + results[71][27]="1.396063664131845E+26";
310.5483 + results[71][28]="4.946795365519211E+50";
310.5484 + results[71][29]="2.383103426586433E+21";
310.5485 + results[71][30]="1.114870107307058E+45";
310.5486 + results[71][31]="2.907711178930534E+16";
310.5487 + results[71][32]="2.266589456958420E+40";
310.5488 + results[71][33]="125114785229.5539";
310.5489 + results[71][34]="5.996391561721113E+35";
310.5490 + results[71][35]="1.471979401663617E+27";
310.5491 + results[71][36]="3.101726569582645E+59";
310.5492 + results[71][37]="1.245410635397457E+22";
310.5493 + results[71][38]="1.518005152072067E+54";
310.5494 + results[71][39]="1.327356553492530E+17";
310.5495 + results[71][40]="2.752277048466415E+49";
310.5496 + results[71][41]="2125075206522.494";
310.5497 + results[71][42]="9.939498920359126E+43";
310.5498 + results[71][43]="38335627.03787325";
310.5499 + results[71][44]="2.611027317101128E+39";
310.5500 + results[71][45]="3.362614414748335E+23";
310.5501 + results[71][46]="1.830805582186251E+63";
310.5502 + results[71][47]="1.222396722761668E+18";
310.5503 + results[71][48]="1.516016428642984E+58";
310.5504 + results[71][49]="51769305988793.17";
310.5505 + results[71][50]="5.109194337658483E+53";
310.5506 + results[71][51]="128858211.9471067";
310.5507 + results[71][52]="9.155078143600022E+48";
310.5508 + results[71][53]="2684.123451177847";
310.5509 + results[71][54]="3.733544196771496E+43";
310.5510 + results[71][55]="1.359427234414859E+19";
310.5511 + results[71][56]="1.569249185107967E+67";
310.5512 + results[71][57]="136352156606197.4";
310.5513 + results[71][58]="1.254280672965365E+62";
310.5514 + results[71][59]="2675438469.025040";
310.5515 + results[71][60]="6.478554512834406E+57";
310.5516 + results[71][61]="12367.72719817611";
310.5517 + results[71][62]="4.631789881656898E+52";
310.5518 + results[71][63]="0.1051921069779213";
310.5519 + results[71][64]="4.839719777715578E+47";
310.5520 + results[71][65]="1141299094338961";
310.5521 + results[71][66]="1.017480496822173E+71";
310.5522 + results[71][67]="36841281488.06609";
310.5523 + results[71][68]="2.170647252870554E+66";
310.5524 + results[71][69]="163631.5347383819";
310.5525 + results[71][70]="1.593751713267834E+61";
310.5526 + results[71][71]="1";
310.5527 + results[71][72]="3.884508750605123E+56";
310.5528 + results[71][73]="0.00001894891282198470";
310.5529 + results[71][74]="1.084898134030173E+51";
310.5530 + results[72][0]="2.248914211639332E-13";
310.5531 + results[72][1]="4.945094941013564E-19";
310.5532 + results[72][2]="1.109519607441867E-23";
310.5533 + results[72][3]="1.293820878762663E-28";
310.5534 + results[72][4]="9.030458614401850E-34";
310.5535 + results[72][5]="2.817447060249479E-18";
310.5536 + results[72][6]="1.750914344685201E-9";
310.5537 + results[72][7]="2.701914158594232E-23";
310.5538 + results[72][8]="2.581177575212958E-15";
310.5539 + results[72][9]="2.518570098812429E-28";
310.5540 + results[72][10]="9.191680391610227E-20";
310.5541 + results[72][11]="3.052040915280100E-33";
310.5542 + results[72][12]="4.098060442286985E-25";
310.5543 + results[72][13]="3.839983552574039E-38";
310.5544 + results[72][14]="3.087630509658344E-30";
310.5545 + results[72][15]="3.316875579356586E-22";
310.5546 + results[72][16]="0.000003810428616608354";
310.5547 + results[72][17]="3.925628147575576E-27";
310.5548 + results[72][18]="2.990471429442005E-11";
310.5549 + results[72][19]="2.530249221550267E-32";
310.5550 + results[72][20]="1.011999052659421E-15";
310.5551 + results[72][21]="4.717659666868350E-37";
310.5552 + results[72][22]="5.813932545327873E-21";
310.5553 + results[72][23]="5.170592593983595E-42";
310.5554 + results[72][24]="3.079569343009031E-26";
310.5555 + results[72][25]="3.082853932375250E-26";
310.5556 + results[72][26]="0.08257341110354408";
310.5557 + results[72][27]="3.593925908686312E-31";
310.5558 + results[72][28]="0.000001273467427444617";
310.5559 + results[72][29]="6.134890097017279E-36";
310.5560 + results[72][30]="2.870041436084768E-12";
310.5561 + results[72][31]="7.485402571116811E-41";
310.5562 + results[72][32]="5.834944911902525E-17";
310.5563 + results[72][33]="3.220865063312414E-46";
310.5564 + results[72][34]="1.543667924750332E-21";
310.5565 + results[72][35]="3.789357924433339E-30";
310.5566 + results[72][36]="798.4861841537783";
310.5567 + results[72][37]="3.206095584682231E-35";
310.5568 + results[72][38]="0.003907843306661606";
310.5569 + results[72][39]="3.417051263652724E-40";
310.5570 + results[72][40]="7.085264122619546E-8";
310.5571 + results[72][41]="5.470640801598023E-45";
310.5572 + results[72][42]="2.558753129030992E-13";
310.5573 + results[72][43]="9.868848160504565E-50";
310.5574 + results[72][44]="6.721640971189435E-18";
310.5575 + results[72][45]="8.656472750188841E-34";
310.5576 + results[72][46]="4713094.241069868";
310.5577 + results[72][47]="3.146850222878877E-39";
310.5578 + results[72][48]="39.02723680071055";
310.5579 + results[72][49]="1.332711787062614E-43";
310.5580 + results[72][50]="0.001315274251052358";
310.5581 + results[72][51]="3.317233148902893E-49";
310.5582 + results[72][52]="2.356817484881160E-8";
310.5583 + results[72][53]="6.909814402554038E-54";
310.5584 + results[72][54]="9.611367708181607E-14";
310.5585 + results[72][55]="3.499611718478145E-38";
310.5586 + results[72][56]="40397622604.49307";
310.5587 + results[72][57]="3.510151871454961E-43";
310.5588 + results[72][58]="322892.9971569699";
310.5589 + results[72][59]="6.887456409020225E-48";
310.5590 + results[72][60]="16.67792487743833";
310.5591 + results[72][61]="3.183858755949381E-53";
310.5592 + results[72][62]="0.0001192374680822991";
310.5593 + results[72][63]="2.707989960417380E-58";
310.5594 + results[72][64]="1.245902658080421E-9";
310.5595 + results[72][65]="2.938078319842043E-42";
310.5596 + results[72][66]="261932862595217.9";
310.5597 + results[72][67]="9.484154587713828E-47";
310.5598 + results[72][68]="5587958200.718210";
310.5599 + results[72][69]="4.212412566013441E-52";
310.5600 + results[72][70]="41028.39807014366";
310.5601 + results[72][71]="2.574328091922103E-57";
310.5602 + results[72][72]="1";
310.5603 + results[72][73]="4.878071858901815E-62";
310.5604 + results[72][74]="0.000002792883743307747";
310.5605 + results[73][0]="4.610252322411714E+48";
310.5606 + results[73][1]="1.013739666829516E+43";
310.5607 + results[73][2]="2.274504434405050E+38";
310.5608 + results[73][3]="2.652320253137757E+33";
310.5609 + results[73][4]="1.851235257619769E+28";
310.5610 + results[73][5]="5.775739148057081E+43";
310.5611 + results[73][6]="3.589357425085942E+52";
310.5612 + results[73][7]="5.538897820177879E+38";
310.5613 + results[73][8]="5.291388995229049E+46";
310.5614 + results[73][9]="5.163044275816442E+33";
310.5615 + results[73][10]="1.884285565584005E+42";
310.5616 + results[73][11]="6.256654275624378E+28";
310.5617 + results[73][12]="8.400984161003253E+36";
310.5618 + results[73][13]="7.871929040091104E+23";
310.5619 + results[73][14]="6.329612598928488E+31";
310.5620 + results[73][15]="6.799562768440446E+39";
310.5621 + results[73][16]="7.811341708004652E+55";
310.5622 + results[73][17]="8.047499629206652E+34";
310.5623 + results[73][18]="6.130437426797644E+50";
310.5624 + results[73][19]="5.186986364157197E+29";
310.5625 + results[73][20]="2.074588242919507E+46";
310.5626 + results[73][21]="9.671156562114322E+24";
310.5627 + results[73][22]="1.191850533058106E+41";
310.5628 + results[73][23]="1.059966466985920E+20";
310.5629 + results[73][24]="6.313087285479891E+35";
310.5630 + results[73][25]="6.319820661824533E+35";
310.5631 + results[73][26]="1.692746919110240E+60";
310.5632 + results[73][27]="7.367513256550102E+30";
310.5633 + results[73][28]="2.610595875336918E+55";
310.5634 + results[73][29]="1.257646519868694E+26";
310.5635 + results[73][30]="5.883557108424581E+49";
310.5636 + results[73][31]="1.534500267243291E+21";
310.5637 + results[73][32]="1.196158047826734E+45";
310.5638 + results[73][33]="6602742141723014";
310.5639 + results[73][34]="3.164504274231525E+40";
310.5640 + results[73][35]="7.768146993403301E+31";
310.5641 + results[73][36]="1.636888933271145E+64";
310.5642 + results[73][37]="6.572464853775255E+26";
310.5643 + results[73][38]="8.011040877822095E+58";
310.5644 + results[73][39]="7.004921949677867E+21";
310.5645 + results[73][40]="1.452472273381932E+54";
310.5646 + results[73][41]="1.121476058540394E+17";
310.5647 + results[73][42]="5.245419098043044E+48";
310.5648 + results[73][43]="2023104301445.511";
310.5649 + results[73][44]="1.377929880004403E+44";
310.5650 + results[73][45]="1.774568518172187E+28";
310.5651 + results[73][46]="9.661797483505934E+67";
310.5652 + results[73][47]="6.451012436678859E+22";
310.5653 + results[73][48]="8.000545692964971E+62";
310.5654 + results[73][49]="2.732046237963053E+18";
310.5655 + results[73][50]="2.696299458262718E+58";
310.5656 + results[73][51]="6800295782542.430";
310.5657 + results[73][52]="4.831452986040559E+53";
310.5658 + results[73][53]="141650525.0931179";
310.5659 + results[73][54]="1.970321058440780E+48";
310.5660 + results[73][55]="7.174170081344397E+23";
310.5661 + results[73][56]="8.281473453650119E+71";
310.5662 + results[73][57]="7.195777292721534E+18";
310.5663 + results[73][58]="6.619275125431665E+66";
310.5664 + results[73][59]="141192188394099.9";
310.5665 + results[73][60]="3.418958424526566E+62";
310.5666 + results[73][61]="652687957.0540302";
310.5667 + results[73][62]="2.444356531253368E+57";
310.5668 + results[73][63]="5551.353154988210";
310.5669 + results[73][64]="2.554088365481576E+52";
310.5670 + results[73][65]="6.023032060260553E+19";
310.5671 + results[73][66]="5.369598279230475E+75";
310.5672 + results[73][67]="1944242492124535";
310.5673 + results[73][68]="1.145526011577904E+71";
310.5674 + results[73][69]="8635404905.580393";
310.5675 + results[73][70]="8.410781812340964E+65";
310.5676 + results[73][71]="52773.47620913591";
310.5677 + results[73][72]="2.049990301342397E+61";
310.5678 + results[73][73]="1";
310.5679 + results[73][74]="5.725384586557730E+55";
310.5680 + results[74][0]="8.052301557585906E-8";
310.5681 + results[74][1]="1.770605365462456E-13";
310.5682 + results[74][2]="3.972666639277327E-18";
310.5683 + results[74][3]="4.632562604379404E-23";
310.5684 + results[74][4]="3.233381495395381E-28";
310.5685 + results[74][5]="1.008794965777072E-12";
310.5686 + results[74][6]="0.0006269198812448631";
310.5687 + results[74][7]="9.674280804091849E-18";
310.5688 + results[74][8]="9.241980019390084E-10";
310.5689 + results[74][9]="9.017812162240471E-23";
310.5690 + results[74][10]="3.291107413129942E-14";
310.5691 + results[74][11]="1.092791965506384E-27";
310.5692 + results[74][12]="1.467322244295588E-19";
310.5693 + results[74][13]="1.374917076937174E-32";
310.5694 + results[74][14]="1.105534921407618E-24";
310.5695 + results[74][15]="1.187616773274011E-16";
310.5696 + results[74][16]="1.364334847713883";
310.5697 + results[74][17]="1.405582368754908E-21";
310.5698 + results[74][18]="0.00001070746835276518";
310.5699 + results[74][19]="9.059629594726956E-27";
310.5700 + results[74][20]="3.623491507959662E-10";
310.5701 + results[74][21]="1.689171516062104E-31";
310.5702 + results[74][22]="2.081695150848690E-15";
310.5703 + results[74][23]="1.851345444067719E-36";
310.5704 + results[74][24]="1.102648597668354E-20";
310.5705 + results[74][25]="1.103824654270814E-20";
310.5706 + results[74][26]="29565.64565260007";
310.5707 + results[74][27]="1.286815434870144E-25";
310.5708 + results[74][28]="0.4559686490696489";
310.5709 + results[74][29]="2.196614918797670E-30";
310.5710 + results[74][30]="0.000001027626532239985";
310.5711 + results[74][31]="2.680169766841597E-35";
310.5712 + results[74][32]="2.089218688706290E-11";
310.5713 + results[74][33]="1.153239933824738E-40";
310.5714 + results[74][34]="5.527147087483460E-16";
310.5715 + results[74][35]="1.356790426208511E-24";
310.5716 + results[74][36]="285900258.4934282";
310.5717 + results[74][37]="1.147951679823628E-29";
310.5718 + results[74][38]="1399.214455677041";
310.5719 + results[74][39]="1.223484963110475E-34";
310.5720 + results[74][40]="0.02536899052671676";
310.5721 + results[74][41]="1.958778561659312E-39";
310.5722 + results[74][42]="9.161688649454979E-8";
310.5723 + results[74][43]="3.533569266587664E-44";
310.5724 + results[74][44]="2.406702744894305E-12";
310.5725 + results[74][45]="3.099474788713032E-28";
310.5726 + results[74][46]="1687536852317.355";
310.5727 + results[74][47]="1.126738708841461E-33";
310.5728 + results[74][48]="13973813.58756047";
310.5729 + results[74][49]="4.771812612164872E-38";
310.5730 + results[74][50]="470.9377016512027";
310.5731 + results[74][51]="1.187744802071186E-43";
310.5732 + results[74][52]="0.008438652308849302";
310.5733 + results[74][53]="2.474078779366023E-48";
310.5734 + results[74][54]="3.441377655339997E-8";
310.5735 + results[74][55]="1.253045969730694E-32";
310.5736 + results[74][56]="1.446448413805017E+16";
310.5737 + results[74][57]="1.256819901603824E-37";
310.5738 + results[74][58]="115612759725.7422";
310.5739 + results[74][59]="2.466073435932954E-42";
310.5740 + results[74][60]="5971578.629938194";
310.5741 + results[74][61]="1.139989719793558E-47";
310.5742 + results[74][62]="42.69331595631704";
310.5743 + results[74][63]="9.696035386027837E-53";
310.5744 + results[74][64]="0.0004460990046813902";
310.5745 + results[74][65]="1.051987332763925E-36";
310.5746 + results[74][66]="9.378580946051059E+19";
310.5747 + results[74][67]="3.395828634270787E-41";
310.5748 + results[74][68]="2000784391440555";
310.5749 + results[74][69]="1.508266348754094E-46";
310.5750 + results[74][70]="14690335094.84779";
310.5751 + results[74][71]="9.217455248864755E-52";
310.5752 + results[74][72]="358052.8557252626";
310.5753 + results[74][73]="1.746607559512835E-56";
310.5754 + results[74][74]="1";
310.5755 + }
310.5756 +
310.5757 + public static int mcDivideTests() {
310.5758 + int failures = 0;
310.5759 + for(int i=0; i<value.length; i++) {
310.5760 + for(int j=0; j<value.length; j++) {
310.5761 + BigDecimal v1 = new BigDecimal(value[i]);
310.5762 + BigDecimal v2 = new BigDecimal(value[j]);
310.5763 + BigDecimal res1 = v1.divide(v2, MathContext.DECIMAL64);
310.5764 + if(!res1.toString().equals(results[i][j])) {
310.5765 + failures++;
310.5766 + System.err.println("Unexpected result from " + v1 + " / " + v2 +
310.5767 + "; expected " + results[i][j] + " got " + res1);
310.5768 +
310.5769 + }
310.5770 + }
310.5771 + }
310.5772 + for (int mpc = 1; mpc < 23; mpc++) {
310.5773 + for (int i = 0; i < value.length; i++) {
310.5774 + for (int j = 0; j < value.length; j++) {
310.5775 + BigDecimal v1 = new BigDecimal(value[i]);
310.5776 + BigDecimal v2 = new BigDecimal(value[j]);
310.5777 + BigDecimal res1 = v1.divide(v2, new MathContext(mpc, RoundingMode.HALF_EVEN));
310.5778 + BigDecimal res2 = v1.divide(v2, new MathContext(128, RoundingMode.HALF_EVEN)).round(new MathContext(mpc, RoundingMode.HALF_EVEN));
310.5779 + if (!res1.equals(res2)) {
310.5780 + failures++;
310.5781 + System.err.println("Unexpected result from " + v1 + " / " + v2 +
310.5782 + "; expected " + res2 + " got " + res1);
310.5783 +
310.5784 + }
310.5785 + }
310.5786 + }
310.5787 + }
310.5788 + return failures;
310.5789 + }
310.5790 +
310.5791 + public static void main(String argv[]) {
310.5792 + int failures = 0;
310.5793 + failures += mcDivideTests();
310.5794 + if (failures > 0) {
310.5795 + throw new RuntimeException("Incurred " + failures +
310.5796 + " failures while testing DECIMAL64 divide.");
310.5797 + }
310.5798 + }
310.5799 +
310.5800 +}
311.1 --- a/test/java/math/BigDecimal/FloatDoubleValueTests.java Tue Apr 19 16:01:27 2011 -0700
311.2 +++ b/test/java/math/BigDecimal/FloatDoubleValueTests.java Tue Apr 26 15:48:03 2011 -0700
311.3 @@ -25,6 +25,8 @@
311.4 * @test
311.5 * @bug 6274390
311.6 * @summary Verify {float, double}Value methods work with condensed representation
311.7 + * @run main FloatDoubleValueTests
311.8 + * @run main/othervm -XX:+AggressiveOpts FloatDoubleValueTests
311.9 */
311.10 import java.math.*;
311.11
311.12 @@ -64,6 +66,7 @@
311.13
311.14 static void checkDouble(BigDecimal bd, double d) {
311.15 double dbd = bd.doubleValue();
311.16 +
311.17 if (d != dbd ) {
311.18 String message = String.format("Bad conversion:"+
311.19 "got %g (%a)\texpected %g (%a)",
311.20 @@ -156,9 +159,29 @@
311.21 }
311.22 }
311.23
311.24 + static void testFloatValue1() {
311.25 + checkFloat(new BigDecimal("85070591730234615847396907784232501249"), 8.507059e+37f);
311.26 + checkFloat(new BigDecimal("7784232501249e12"), 7.7842326e24f);
311.27 + checkFloat(new BigDecimal("907784232501249e-12"),907.78424f);
311.28 + checkFloat(new BigDecimal("7784e8"),7.7839997e11f);
311.29 + checkFloat(new BigDecimal("9077e-8"),9.077e-5f);
311.30 +
311.31 + }
311.32 +
311.33 + static void testDoubleValue1() {
311.34 + checkDouble(new BigDecimal("85070591730234615847396907784232501249"), 8.507059173023462e37);
311.35 + checkDouble(new BigDecimal("7784232501249e12"), 7.784232501249e24);
311.36 + checkDouble(new BigDecimal("907784232501249e-12"), 907.784232501249);
311.37 + checkDouble(new BigDecimal("7784e8"), 7.784e11);
311.38 + checkDouble(new BigDecimal("9077e-8"), 9.077e-5);
311.39 +
311.40 + }
311.41 +
311.42 public static void main(String[] args) throws Exception {
311.43 testFloatDoubleValue();
311.44 testDoubleValue();
311.45 testFloatValue();
311.46 + testFloatValue1();
311.47 + testDoubleValue1();
311.48 }
311.49 }
312.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
312.2 +++ b/test/java/math/BigDecimal/RangeTests.java Tue Apr 26 15:48:03 2011 -0700
312.3 @@ -0,0 +1,245 @@
312.4 +/*
312.5 + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
312.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
312.7 + *
312.8 + * This code is free software; you can redistribute it and/or modify it
312.9 + * under the terms of the GNU General Public License version 2 only, as
312.10 + * published by the Free Software Foundation.
312.11 + *
312.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
312.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
312.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
312.15 + * version 2 for more details (a copy is included in the LICENSE file that
312.16 + * accompanied this code).
312.17 + *
312.18 + * You should have received a copy of the GNU General Public License version
312.19 + * 2 along with this work; if not, write to the Free Software Foundation,
312.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
312.21 + *
312.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
312.23 + * or visit www.oracle.com if you need additional information or have any
312.24 + * questions.
312.25 + */
312.26 +
312.27 +/*
312.28 + * @test
312.29 + * @bug 7036582
312.30 + * @summary Some new tests for the add method and constructor with MathContext.
312.31 + * @run main RangeTests
312.32 + * @run main/othervm -XX:+AggressiveOpts RangeTests
312.33 + * @author Sergey V. Kuksenko
312.34 + */
312.35 +
312.36 +import java.math.BigDecimal;
312.37 +import java.math.BigInteger;
312.38 +import java.math.MathContext;
312.39 +
312.40 +public class RangeTests {
312.41 +
312.42 +
312.43 + private static int addTest(BigDecimal arg1, BigDecimal arg2, BigDecimal expectedResult) {
312.44 + int failures = 0;
312.45 + BigDecimal result = arg1.add(arg2);
312.46 + if (!result.equals(expectedResult)) {
312.47 + System.out.println("Sum:" +
312.48 + arg1 + " + " +
312.49 + arg2 + " == " +
312.50 + result + "; expected " +
312.51 + expectedResult
312.52 + );
312.53 + failures++;
312.54 + }
312.55 + result = arg2.add(arg1);
312.56 + if (!result.equals(expectedResult)) {
312.57 + System.out.println("Sum:" +
312.58 + arg2 + " + " +
312.59 + arg1 + " == " +
312.60 + result + "; expected " +
312.61 + expectedResult
312.62 + );
312.63 + failures++;
312.64 + }
312.65 + return failures;
312.66 + }
312.67 +
312.68 + /*
312.69 + * Test BigDecimal.add(BigDecimal) when values are withing different ranges:
312.70 + * 1. within 32 bits
312.71 + * 2. within 64 bits
312.72 + * 3. outside 64 bits.
312.73 + */
312.74 + private static int addBoundaryTest() {
312.75 + int failures = 0;
312.76 + failures += addTest(
312.77 + new BigDecimal("85070591730234615847396907784232501249"),
312.78 + BigDecimal.valueOf(0),
312.79 + new BigDecimal("85070591730234615847396907784232501249") );
312.80 + failures += addTest(
312.81 + new BigDecimal("-85070591730234615847396907784232501249"),
312.82 + BigDecimal.valueOf(0),
312.83 + new BigDecimal("-85070591730234615847396907784232501249") );
312.84 + failures += addTest(
312.85 + new BigDecimal("85070591730234615847396907784232501249"),
312.86 + BigDecimal.valueOf(1),
312.87 + new BigDecimal("85070591730234615847396907784232501250") );
312.88 + failures += addTest(
312.89 + new BigDecimal("85070591730234615847396907784232501249"),
312.90 + BigDecimal.valueOf(-1),
312.91 + new BigDecimal("85070591730234615847396907784232501248") );
312.92 + failures += addTest(
312.93 + new BigDecimal("-85070591730234615847396907784232501250"),
312.94 + BigDecimal.valueOf(-1),
312.95 + new BigDecimal("-85070591730234615847396907784232501251") );
312.96 + failures += addTest(
312.97 + new BigDecimal("-85070591730234615847396907784232501249"),
312.98 + BigDecimal.valueOf(1),
312.99 + new BigDecimal("-85070591730234615847396907784232501248") );
312.100 + failures += addTest(
312.101 + new BigDecimal("147573952589676412927"),
312.102 + BigDecimal.valueOf(Integer.MAX_VALUE),
312.103 + new BigDecimal("147573952591823896574") );
312.104 + failures += addTest(
312.105 + new BigDecimal("-147573952589676412927"),
312.106 + BigDecimal.valueOf(Integer.MAX_VALUE),
312.107 + new BigDecimal("-147573952587528929280") );
312.108 + failures += addTest(
312.109 + new BigDecimal("79228162514264337593543950335"),
312.110 + BigDecimal.valueOf(999),
312.111 + new BigDecimal("79228162514264337593543951334") );
312.112 + failures += addTest(
312.113 + new BigDecimal("79228162514264337593543950335"),
312.114 + BigDecimal.valueOf(Integer.MAX_VALUE/2),
312.115 + new BigDecimal("79228162514264337594617692158") );
312.116 + failures += addTest(
312.117 + new BigDecimal("79228162514264337593543950335"),
312.118 + BigDecimal.valueOf(Integer.MIN_VALUE/2),
312.119 + new BigDecimal("79228162514264337592470208511") );
312.120 + failures += addTest(
312.121 + new BigDecimal("-79228162514264337593543950335"),
312.122 + BigDecimal.valueOf(Integer.MAX_VALUE/2),
312.123 + new BigDecimal("-79228162514264337592470208512") );
312.124 + failures += addTest(
312.125 + new BigDecimal("79228162514264337593543950335"),
312.126 + BigDecimal.valueOf(-(Integer.MIN_VALUE/2)),
312.127 + new BigDecimal("79228162514264337594617692159") );
312.128 + failures += addTest(
312.129 + new BigDecimal("79228162514264337593543950335"),
312.130 + BigDecimal.valueOf(Long.MAX_VALUE/2),
312.131 + new BigDecimal("79228162518876023611971338238") );
312.132 + failures += addTest(
312.133 + new BigDecimal("79228162514264337593543950335"),
312.134 + BigDecimal.valueOf(Long.MIN_VALUE/2),
312.135 + new BigDecimal("79228162509652651575116562431") );
312.136 + failures += addTest(
312.137 + new BigDecimal("-79228162514264337593543950335"),
312.138 + BigDecimal.valueOf(Long.MAX_VALUE/2),
312.139 + new BigDecimal("-79228162509652651575116562432") );
312.140 + failures += addTest(
312.141 + new BigDecimal("79228162514264337593543950335"),
312.142 + BigDecimal.valueOf(-(Long.MIN_VALUE/2)),
312.143 + new BigDecimal("79228162518876023611971338239") );
312.144 + failures += addTest(
312.145 + new BigDecimal("-9223372036854775808"),
312.146 + BigDecimal.valueOf(1),
312.147 + new BigDecimal("-9223372036854775807") );
312.148 + failures += addTest(
312.149 + new BigDecimal("-9223372036854775808"),
312.150 + BigDecimal.valueOf(Long.MAX_VALUE/2),
312.151 + new BigDecimal("-4611686018427387905") );
312.152 + failures += addTest(
312.153 + new BigDecimal("9223372036854775808"),
312.154 + BigDecimal.valueOf(-1),
312.155 + new BigDecimal("9223372036854775807") );
312.156 + failures += addTest(
312.157 + new BigDecimal("9223372036854775808"),
312.158 + BigDecimal.valueOf(-Long.MAX_VALUE/2),
312.159 + new BigDecimal("4611686018427387905") );
312.160 +
312.161 + return failures;
312.162 + }
312.163 +
312.164 + private static int testRoundingFromBigInteger(BigInteger bi, int scale, MathContext mc) {
312.165 + int failures = 0;
312.166 + BigDecimal bd1 = new BigDecimal(bi,scale, mc);
312.167 + BigDecimal bd2 = (new BigDecimal(bi,scale)).round(mc);
312.168 + if (!bd1.equals(bd2)) {
312.169 + System.out.println("new BigDecimal(BigInteger,int,MathContext):" +
312.170 + "BigInteger == " +
312.171 + bi + "; scale == " + scale + "; result == " +
312.172 + bd1 + "; expected == " +
312.173 + bd2
312.174 + );
312.175 + failures++;
312.176 + }
312.177 + return failures;
312.178 + }
312.179 +
312.180 + private static int roundingConstructorTest() {
312.181 + int failures = 0;
312.182 + failures += testRoundingFromBigInteger(
312.183 + new BigInteger("85070591730234615847396907784232501249"),
312.184 + 7, MathContext.DECIMAL64);
312.185 + failures += testRoundingFromBigInteger(
312.186 + new BigInteger("85070591730234615847396907784232501249"),
312.187 + 0, MathContext.DECIMAL64);
312.188 + failures += testRoundingFromBigInteger(
312.189 + new BigInteger("85070591730234615847396907784232501249"),
312.190 + -7, MathContext.DECIMAL64);
312.191 + failures += testRoundingFromBigInteger(
312.192 + new BigInteger("85070591730234615847396907784232501249"),
312.193 + 7, MathContext.DECIMAL128);
312.194 + failures += testRoundingFromBigInteger(
312.195 + new BigInteger("85070591730234615847396907784232501249"),
312.196 + 177, MathContext.DECIMAL128);
312.197 + failures += testRoundingFromBigInteger(
312.198 + new BigInteger("85070591730234615847396907784232501249"),
312.199 + 177, MathContext.DECIMAL32);
312.200 + failures += testRoundingFromBigInteger(
312.201 + new BigInteger("85070591730234615847396907784232501249"),
312.202 + 177, MathContext.UNLIMITED);
312.203 + failures += testRoundingFromBigInteger(
312.204 + new BigInteger("85070591730234615847396907784232501249"),
312.205 + 0, MathContext.UNLIMITED);
312.206 + return failures;
312.207 + }
312.208 +
312.209 + private static int minLongConstructorTest(MathContext mc) {
312.210 + int failures = 0;
312.211 + BigDecimal bd1 = new BigDecimal(Long.MIN_VALUE,mc);
312.212 + BigDecimal bd2 = new BigDecimal(Long.MIN_VALUE).round(mc);
312.213 + if (!bd1.equals(bd2)) {
312.214 + System.out.println("new BigDecimal(long,MathContext):" +
312.215 + "long == " +
312.216 + Long.MIN_VALUE + "; result == " +
312.217 + bd1 + "; expected == " +
312.218 + bd2
312.219 + );
312.220 + failures++;
312.221 + }
312.222 + return failures;
312.223 + }
312.224 +
312.225 + private static int minLongConstructorTest() {
312.226 + int failures = 0;
312.227 + failures+=minLongConstructorTest(MathContext.UNLIMITED);
312.228 + failures+=minLongConstructorTest(MathContext.DECIMAL32);
312.229 + failures+=minLongConstructorTest(MathContext.DECIMAL64);
312.230 + failures+=minLongConstructorTest(MathContext.DECIMAL128);
312.231 + return failures;
312.232 + }
312.233 +
312.234 + public static void main(String argv[]) {
312.235 + int failures = 0;
312.236 +
312.237 + failures += addBoundaryTest();
312.238 + failures += roundingConstructorTest();
312.239 + failures += minLongConstructorTest();
312.240 + if (failures > 0) {
312.241 + throw new RuntimeException("Incurred " + failures +
312.242 + " failures while testing.");
312.243 + }
312.244 + }
312.245 +
312.246 +
312.247 +
312.248 +}
313.1 --- a/test/java/math/BigDecimal/StrippingZerosTest.java Tue Apr 19 16:01:27 2011 -0700
313.2 +++ b/test/java/math/BigDecimal/StrippingZerosTest.java Tue Apr 26 15:48:03 2011 -0700
313.3 @@ -25,6 +25,8 @@
313.4 * @test
313.5 * @bug 4108852
313.6 * @summary A few tests of stripTrailingZeros
313.7 + * @run main StrippingZerosTest
313.8 + * @run main/othervm -XX:+AggressiveOpts StrippingZerosTest
313.9 * @author Joseph D. Darcy
313.10 */
313.11
313.12 @@ -53,6 +55,11 @@
313.13 {new BigDecimal("10000000e2"), new BigDecimal("1e9")},
313.14 {new BigDecimal("1000000e3"), new BigDecimal("1e9")},
313.15 {new BigDecimal("100000e4"), new BigDecimal("1e9")},
313.16 + // BD value which larger than Long.MaxValue
313.17 + {new BigDecimal("1.0000000000000000000000000000"), new BigDecimal("1")},
313.18 + {new BigDecimal("-1.0000000000000000000000000000"), new BigDecimal("-1")},
313.19 + {new BigDecimal("1.00000000000000000000000000001"), new BigDecimal("1.00000000000000000000000000001")},
313.20 + {new BigDecimal("1000000000000000000000000000000e4"), new BigDecimal("1e34")},
313.21 };
313.22
313.23 for(int i = 0; i < testCases.length; i++) {
314.1 --- a/test/java/math/BigDecimal/ToPlainStringTests.java Tue Apr 19 16:01:27 2011 -0700
314.2 +++ b/test/java/math/BigDecimal/ToPlainStringTests.java Tue Apr 26 15:48:03 2011 -0700
314.3 @@ -25,6 +25,8 @@
314.4 * @test
314.5 * @bug 4984872
314.6 * @summary Basic tests of toPlainString method
314.7 + * @run main ToPlainStringTests
314.8 + * @run main/othervm -XX:+AggressiveOpts ToPlainStringTests
314.9 * @author Joseph D. Darcy
314.10 */
314.11
314.12 @@ -60,6 +62,11 @@
314.13 {"8e-8", "0.00000008"},
314.14 {"9e-9", "0.000000009"},
314.15 {"9000e-12", "0.000000009000"},
314.16 +
314.17 + {"9000e-22", "0.0000000000000000009000"},
314.18 + {"12345678901234567890", "12345678901234567890"},
314.19 + {"12345678901234567890e22", "123456789012345678900000000000000000000000"},
314.20 + {"12345678901234567890e-22", "0.0012345678901234567890"},
314.21 };
314.22
314.23 int errors = 0;
314.24 @@ -73,8 +80,8 @@
314.25 s + "'' from BigDecimal " +
314.26 bd);
314.27 }
314.28 -
314.29 - if (!(s=("-"+bd.toPlainString())).equals("-"+testCase[1])) {
314.30 + bd = new BigDecimal("-"+testCase[0]);
314.31 + if (bd.signum()!=0 && !(s=(bd.toPlainString())).equals("-"+testCase[1])) {
314.32 errors++;
314.33 System.err.println("Unexpected plain result ``" +
314.34 s + "'' from BigDecimal " +
315.1 --- a/test/java/net/URL/Equals.java Tue Apr 19 16:01:27 2011 -0700
315.2 +++ b/test/java/net/URL/Equals.java Tue Apr 26 15:48:03 2011 -0700
315.3 @@ -1,5 +1,5 @@
315.4 /*
315.5 - * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
315.6 + * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
315.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
315.8 *
315.9 * This code is free software; you can redistribute it and/or modify it
315.10 @@ -23,16 +23,19 @@
315.11
315.12 /*
315.13 * @test
315.14 - * @bug 4052976
315.15 - * @summary Test URL.equals involving anchors
315.16 - *
315.17 + * @bug 4052976 7030649
315.18 + * @summary Test URL.equals with anchors, and jar URLs
315.19 */
315.20
315.21 import java.net.*;
315.22
315.23 public class Equals {
315.24 + public static void main(String[] args) throws Exception {
315.25 + anchors();
315.26 + jarURLs();
315.27 + }
315.28
315.29 - public static void main(String[] args) throws Exception {
315.30 + static void anchors() throws Exception {
315.31 URL url1, url2;
315.32
315.33 url1 = new URL(null, "http://JavaSoft/Test#bar");
315.34 @@ -45,4 +48,74 @@
315.35 if (url1.equals(null))
315.36 throw new RuntimeException("URL.equals fails given null");
315.37 }
315.38 +
315.39 + static final String HTTP_URL1A = "http://localhost/xyz";
315.40 + static final String HTTP_URL1B = "http://LOCALHOST/xyz";
315.41 + static final String FILE_URL1A = "file:///c:/foo/xyz";
315.42 + static final String FILE_URL1B = "file:/c:/foo/xyz";
315.43 +
315.44 + static void jarURLs() throws Exception {
315.45 + int failed = 0;
315.46 + failed = compareJarURLS(HTTP_URL1A, HTTP_URL1A, "!/abc", "!/abc", true);
315.47 + failed = compareJarURLS(HTTP_URL1A, HTTP_URL1B, "!/abc", "!/abc", true);
315.48 + failed = compareJarURLS(HTTP_URL1B, HTTP_URL1A, "!/", "!/", true);
315.49 + failed = compareJarURLS(HTTP_URL1A, HTTP_URL1B, "!/abc", "!/", false);
315.50 + failed = compareJarURLS(HTTP_URL1A, HTTP_URL1B, "!/abc", "!/xy", false);
315.51 + failed = compareJarURLS(FILE_URL1A, FILE_URL1A, "!/abc", "!/abc", true);
315.52 + failed = compareJarURLS(FILE_URL1A, FILE_URL1B, "!/abc", "!/abc", true);
315.53 + failed = compareJarURLS(FILE_URL1A, FILE_URL1B, "!/", "!/", true);
315.54 + failed = compareJarURLS(FILE_URL1A, FILE_URL1B, "!/abc", "!/", false);
315.55 + failed = compareJarURLS(FILE_URL1A, FILE_URL1B, "!/abc", "!/xy", false);
315.56 +
315.57 + failed = (new URL("jar:file://xzy!/abc")).equals(
315.58 + new URL("file://xzy!/abc")) ? 1 : 0;
315.59 +
315.60 + if (failed > 0)
315.61 + throw new RuntimeException("Some jar URL tests failed. Check output");
315.62 + }
315.63 +
315.64 + static int compareJarURLS(String urlStr1, String urlStr2,
315.65 + String entry1, String entry2,
315.66 + boolean expectEqual) throws Exception {
315.67 + int failed = 0;
315.68 +
315.69 + URL url1 = new URL(urlStr1);
315.70 + URL url2 = new URL(urlStr2);
315.71 +
315.72 + if (!url1.equals(url2)) {
315.73 + System.out.println("Urls are not equal, so the test cannot run.");
315.74 + System.out.println("url1: " + url1 + ", url2:" + url2);
315.75 + return 1;
315.76 + }
315.77 +
315.78 + URL jarUrl1 = new URL("jar:" + urlStr1 + entry1);
315.79 + URL jarUrl2 = new URL("jar:" + urlStr2 + entry2);
315.80 + jarUrl2.openConnection();
315.81 +
315.82 + boolean equal = jarUrl1.equals(jarUrl2);
315.83 + if (expectEqual && !equal) {
315.84 + System.out.println("URLs should be equal, but are not. " +
315.85 + jarUrl1 + ", " + jarUrl2);
315.86 + failed++;
315.87 + } else if (!expectEqual && equal) {
315.88 + System.out.println("URLs should NOT be equal, but are. " +
315.89 + jarUrl1 + ", " + jarUrl2);
315.90 + failed++;
315.91 + }
315.92 +
315.93 + if (expectEqual) {
315.94 + // hashCode MUST produce the same integer result for equal urls
315.95 + int hash1 = jarUrl1.hashCode();
315.96 + int hash2 = jarUrl2.hashCode();
315.97 + if (hash1 != hash2) {
315.98 + System.out.println("jarUrl1.hashCode = " + hash1);
315.99 + System.out.println("jarUrl2.hashCode = " + hash2);
315.100 + System.out.println("Equal urls should have same hashCode. " +
315.101 + jarUrl1 + ", " + jarUrl2);
315.102 + failed++;
315.103 + }
315.104 + }
315.105 +
315.106 + return failed;
315.107 + }
315.108 }
316.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
316.2 +++ b/test/java/rmi/server/UnicastRemoteObject/exportObject/GcDuringExport.java Tue Apr 26 15:48:03 2011 -0700
316.3 @@ -0,0 +1,65 @@
316.4 +/*
316.5 + * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved.
316.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
316.7 + *
316.8 + * This code is free software; you can redistribute it and/or modify it
316.9 + * under the terms of the GNU General Public License version 2 only, as
316.10 + * published by the Free Software Foundation.
316.11 + *
316.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
316.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
316.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
316.15 + * version 2 for more details (a copy is included in the LICENSE file that
316.16 + * accompanied this code).
316.17 + *
316.18 + * You should have received a copy of the GNU General Public License version
316.19 + * 2 along with this work; if not, write to the Free Software Foundation,
316.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
316.21 + *
316.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
316.23 + * or visit www.oracle.com if you need additional information or have any
316.24 + * questions.
316.25 + */
316.26 +
316.27 +/*
316.28 + * Portions Copyright (c) 2011 IBM Corporation
316.29 + */
316.30 +
316.31 +/*
316.32 + * @test
316.33 + * @bug 6597112
316.34 + * @summary GC'ing objects whilst being exported to RMI should not cause exceptions
316.35 + * @author Neil Richards <neil.richards@ngmr.net>, <neil_richards@uk.ibm.com>
316.36 + */
316.37 +
316.38 +import java.rmi.Remote;
316.39 +import java.rmi.server.UnicastRemoteObject;
316.40 +
316.41 +public class GcDuringExport {
316.42 + private static final long MAX_EXPORT_ITERATIONS = 50000;
316.43 +
316.44 + public static void main(String[] args) throws Exception {
316.45 + Thread gcInducingThread = new Thread() {
316.46 + public void run() {
316.47 + while (true) {
316.48 + System.gc();
316.49 + try { Thread.sleep(1); } catch (InterruptedException e) { }
316.50 + }
316.51 + }
316.52 + };
316.53 + gcInducingThread.setDaemon(true);
316.54 + gcInducingThread.start();
316.55 +
316.56 + long i = 0;
316.57 + try {
316.58 + while (i < MAX_EXPORT_ITERATIONS) {
316.59 + i++;
316.60 + UnicastRemoteObject.exportObject(new Remote() { }, 0);
316.61 + }
316.62 + } catch (Throwable e) {
316.63 + throw new RuntimeException("Test FAILED on iteration " + i + ".", e);
316.64 + }
316.65 +
316.66 + System.out.println("Test successfully exported " + i + " objects.");
316.67 + }
316.68 +}
317.1 --- a/test/java/text/Bidi/Bug6665028.java Tue Apr 19 16:01:27 2011 -0700
317.2 +++ b/test/java/text/Bidi/Bug6665028.java Tue Apr 26 15:48:03 2011 -0700
317.3 @@ -1,5 +1,5 @@
317.4 /*
317.5 - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
317.6 + * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
317.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
317.8 *
317.9 * This code is free software; you can redistribute it and/or modify it
317.10 @@ -28,7 +28,7 @@
317.11 * that this test case fails without the fix in some different ways,
317.12 * including timeout, due to the memory corruption.
317.13 * @build Bug6665028
317.14 - * @run main/othervm/timeout=60 -Xmx16m Bug6665028
317.15 + * @run main/othervm -Xmx16m Bug6665028 10
317.16 */
317.17
317.18 import java.awt.font.TextAttribute;
317.19 @@ -36,6 +36,7 @@
317.20 import java.text.Bidi;
317.21
317.22 // test1() and test2() were derived from BidiEmbeddingTest.
317.23 +// Usage: java Bug6665028 [duration]
317.24 public class Bug6665028 {
317.25
317.26 private static boolean runrun = true;
317.27 @@ -50,6 +51,11 @@
317.28 }
317.29
317.30 public static void main(String[] args) {
317.31 + int duration = 45;
317.32 + if (args.length == 1) {
317.33 + duration = Math.max(1, Math.min(Integer.parseInt(args[0]), 45));
317.34 + }
317.35 +
317.36 Test[] tests = new Test[4];
317.37 for (int i = 0; i < tests.length; i++) {
317.38 Test t = new Test();
317.39 @@ -58,7 +64,7 @@
317.40 }
317.41
317.42 try {
317.43 - Thread.sleep(45000);
317.44 + Thread.sleep(duration * 1000);
317.45 } catch (InterruptedException e) {
317.46 }
317.47
318.1 --- a/test/java/util/Currency/CurrencyTest.java Tue Apr 19 16:01:27 2011 -0700
318.2 +++ b/test/java/util/Currency/CurrencyTest.java Tue Apr 26 15:48:03 2011 -0700
318.3 @@ -23,7 +23,7 @@
318.4 /*
318.5 * @test
318.6 * @bug 4290801 4692419 4693631 5101540 5104960 6296410 6336600 6371531
318.7 - * 6488442
318.8 + * 6488442 7036905
318.9 * @summary Basic tests for Currency class.
318.10 */
318.11
318.12 @@ -249,7 +249,7 @@
318.13 testDisplayName("ITL", new Locale("it"), "Lira Italiana");
318.14 testDisplayName("JPY", Locale.JAPANESE, "\u65e5\u672c\u5186");
318.15 testDisplayName("KRW", Locale.KOREAN, "\ub300\ud55c\ubbfc\uad6d \uc6d0");
318.16 - testDisplayName("SEK", new Locale("sv"), "Svensk krona");
318.17 + testDisplayName("SEK", new Locale("sv"), "svensk krona");
318.18 testDisplayName("CNY", Locale.SIMPLIFIED_CHINESE, "\u4eba\u6c11\u5e01");
318.19 testDisplayName("TWD", Locale.TRADITIONAL_CHINESE, "\u65b0\u81fa\u5e63");
318.20 }
319.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
319.2 +++ b/test/java/util/EnumMap/DistinctEntrySetElements.java Tue Apr 26 15:48:03 2011 -0700
319.3 @@ -0,0 +1,60 @@
319.4 +/*
319.5 + * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved.
319.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
319.7 + *
319.8 + * This code is free software; you can redistribute it and/or modify it
319.9 + * under the terms of the GNU General Public License version 2 only, as
319.10 + * published by the Free Software Foundation.
319.11 + *
319.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
319.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
319.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
319.15 + * version 2 for more details (a copy is included in the LICENSE file that
319.16 + * accompanied this code).
319.17 + *
319.18 + * You should have received a copy of the GNU General Public License version
319.19 + * 2 along with this work; if not, write to the Free Software Foundation,
319.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
319.21 + *
319.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
319.23 + * or visit www.oracle.com if you need additional information or have any
319.24 + * questions.
319.25 + */
319.26 +
319.27 +/*
319.28 + * Portions Copyright (c) 2011 IBM Corporation
319.29 + */
319.30 +
319.31 +/*
319.32 + * @test
319.33 + * @bug 6312706
319.34 + * @summary Sets from Map.entrySet() return distinct objects for each Entry
319.35 + * @author Neil Richards <neil.richards@ngmr.net>, <neil_richards@uk.ibm.com>
319.36 + */
319.37 +
319.38 +import java.util.EnumMap;
319.39 +import java.util.HashSet;
319.40 +import java.util.Map;
319.41 +import java.util.Set;
319.42 +
319.43 +public class DistinctEntrySetElements {
319.44 + static enum TestEnum { e00, e01, e02 }
319.45 +
319.46 + public static void main(String[] args) throws Exception {
319.47 + final EnumMap<TestEnum, String> enumMap = new EnumMap<>(TestEnum.class);
319.48 +
319.49 + for (TestEnum e : TestEnum.values()) {
319.50 + enumMap.put(e, e.name());
319.51 + }
319.52 +
319.53 + Set<Map.Entry<TestEnum, String>> entrySet = enumMap.entrySet();
319.54 + HashSet<Map.Entry<TestEnum, String>> hashSet = new HashSet<>(entrySet);
319.55 +
319.56 + if (false == hashSet.equals(entrySet)) {
319.57 + throw new RuntimeException("Test FAILED: Sets are not equal.");
319.58 + }
319.59 + if (hashSet.hashCode() != entrySet.hashCode()) {
319.60 + throw new RuntimeException("Test FAILED: Set's hashcodes are not equal.");
319.61 + }
319.62 + }
319.63 +}
320.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
320.2 +++ b/test/java/util/EnumMap/EntrySetIteratorRemoveInvalidatesEntry.java Tue Apr 26 15:48:03 2011 -0700
320.3 @@ -0,0 +1,60 @@
320.4 +/*
320.5 + * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved.
320.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
320.7 + *
320.8 + * This code is free software; you can redistribute it and/or modify it
320.9 + * under the terms of the GNU General Public License version 2 only, as
320.10 + * published by the Free Software Foundation.
320.11 + *
320.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
320.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
320.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
320.15 + * version 2 for more details (a copy is included in the LICENSE file that
320.16 + * accompanied this code).
320.17 + *
320.18 + * You should have received a copy of the GNU General Public License version
320.19 + * 2 along with this work; if not, write to the Free Software Foundation,
320.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
320.21 + *
320.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
320.23 + * or visit www.oracle.com if you need additional information or have any
320.24 + * questions.
320.25 + */
320.26 +
320.27 +/*
320.28 + * Portions Copyright (c) 2011 IBM Corporation
320.29 + */
320.30 +
320.31 +/*
320.32 + * @test
320.33 + * @bug 6312706
320.34 + * @summary Iterator.remove() from Map.entrySet().iterator() invalidates returned Entry.
320.35 + * @author Neil Richards <neil.richards@ngmr.net>, <neil_richards@uk.ibm.com>
320.36 + */
320.37 +
320.38 +import java.util.EnumMap;
320.39 +import java.util.Iterator;
320.40 +import java.util.Map;
320.41 +
320.42 +public class EntrySetIteratorRemoveInvalidatesEntry {
320.43 + static enum TestEnum { e00, e01, e02 }
320.44 +
320.45 + public static void main(String[] args) throws Exception {
320.46 + final EnumMap<TestEnum, String> enumMap = new EnumMap<>(TestEnum.class);
320.47 +
320.48 + for (TestEnum e : TestEnum.values()) {
320.49 + enumMap.put(e, e.name());
320.50 + }
320.51 +
320.52 + Iterator<Map.Entry<TestEnum, String>> entrySetIterator =
320.53 + enumMap.entrySet().iterator();
320.54 + Map.Entry<TestEnum, String> entry = entrySetIterator.next();
320.55 +
320.56 + entrySetIterator.remove();
320.57 +
320.58 + try {
320.59 + entry.getKey();
320.60 + throw new RuntimeException("Test FAILED: Entry not invalidated by removal.");
320.61 + } catch (Exception e) { }
320.62 + }
320.63 +}
321.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
321.2 +++ b/test/java/util/EnumMap/SimpleSerialization.java Tue Apr 26 15:48:03 2011 -0700
321.3 @@ -0,0 +1,89 @@
321.4 +/*
321.5 + * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved.
321.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
321.7 + *
321.8 + * This code is free software; you can redistribute it and/or modify it
321.9 + * under the terms of the GNU General Public License version 2 only, as
321.10 + * published by the Free Software Foundation.
321.11 + *
321.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
321.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
321.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
321.15 + * version 2 for more details (a copy is included in the LICENSE file that
321.16 + * accompanied this code).
321.17 + *
321.18 + * You should have received a copy of the GNU General Public License version
321.19 + * 2 along with this work; if not, write to the Free Software Foundation,
321.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
321.21 + *
321.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
321.23 + * or visit www.oracle.com if you need additional information or have any
321.24 + * questions.
321.25 + */
321.26 +
321.27 +/*
321.28 + * Portions Copyright (c) 2011 IBM Corporation
321.29 + */
321.30 +
321.31 +/*
321.32 + * @test
321.33 + * @bug 6312706
321.34 + * @summary A serialized EnumMap can be successfully de-serialized.
321.35 + * @author Neil Richards <neil.richards@ngmr.net>, <neil_richards@uk.ibm.com>
321.36 + */
321.37 +
321.38 +import java.io.ByteArrayInputStream;
321.39 +import java.io.ByteArrayOutputStream;
321.40 +import java.io.IOException;
321.41 +import java.io.ObjectInputStream;
321.42 +import java.io.ObjectOutputStream;
321.43 +import java.io.PrintWriter;
321.44 +import java.io.StringWriter;
321.45 +import java.util.EnumMap;
321.46 +
321.47 +public class SimpleSerialization {
321.48 + private enum TestEnum { e00, e01, e02, e03, e04, e05, e06, e07 }
321.49 + public static void main(final String[] args) throws Exception {
321.50 + final EnumMap<TestEnum, String> enumMap = new EnumMap<>(TestEnum.class);
321.51 +
321.52 + enumMap.put(TestEnum.e01, TestEnum.e01.name());
321.53 + enumMap.put(TestEnum.e04, TestEnum.e04.name());
321.54 + enumMap.put(TestEnum.e05, TestEnum.e05.name());
321.55 +
321.56 + final ByteArrayOutputStream baos = new ByteArrayOutputStream();
321.57 + final ObjectOutputStream oos = new ObjectOutputStream(baos);
321.58 +
321.59 + oos.writeObject(enumMap);
321.60 + oos.close();
321.61 +
321.62 + final byte[] data = baos.toByteArray();
321.63 + final ByteArrayInputStream bais = new ByteArrayInputStream(data);
321.64 + final ObjectInputStream ois = new ObjectInputStream(bais);
321.65 +
321.66 + final Object deserializedObject = ois.readObject();
321.67 + ois.close();
321.68 +
321.69 + if (false == enumMap.equals(deserializedObject)) {
321.70 + throw new RuntimeException(getFailureText(enumMap, deserializedObject));
321.71 + }
321.72 + }
321.73 +
321.74 + private static String getFailureText(final Object orig, final Object copy) {
321.75 + final StringWriter sw = new StringWriter();
321.76 + final PrintWriter pw = new PrintWriter(sw);
321.77 +
321.78 + pw.println("Test FAILED: Deserialized object is not equal to the original object");
321.79 + pw.print("\tOriginal: ");
321.80 + printObject(pw, orig).println();
321.81 + pw.print("\tCopy: ");
321.82 + printObject(pw, copy).println();
321.83 +
321.84 + pw.close();
321.85 + return sw.toString();
321.86 + }
321.87 +
321.88 + private static PrintWriter printObject(final PrintWriter pw, final Object o) {
321.89 + pw.printf("%s@%08x", o.getClass().getName(), System.identityHashCode(o));
321.90 + return pw;
321.91 + }
321.92 +}
322.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
322.2 +++ b/test/java/util/IdentityHashMap/DistinctEntrySetElements.java Tue Apr 26 15:48:03 2011 -0700
322.3 @@ -0,0 +1,61 @@
322.4 +/*
322.5 + * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved.
322.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
322.7 + *
322.8 + * This code is free software; you can redistribute it and/or modify it
322.9 + * under the terms of the GNU General Public License version 2 only, as
322.10 + * published by the Free Software Foundation.
322.11 + *
322.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
322.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
322.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
322.15 + * version 2 for more details (a copy is included in the LICENSE file that
322.16 + * accompanied this code).
322.17 + *
322.18 + * You should have received a copy of the GNU General Public License version
322.19 + * 2 along with this work; if not, write to the Free Software Foundation,
322.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
322.21 + *
322.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
322.23 + * or visit www.oracle.com if you need additional information or have any
322.24 + * questions.
322.25 + */
322.26 +
322.27 +/*
322.28 + * Portions Copyright (c) 2011 IBM Corporation
322.29 + */
322.30 +
322.31 +/*
322.32 + * @test
322.33 + * @bug 6312706
322.34 + * @summary Sets from Map.entrySet() return distinct objects for each Entry
322.35 + * @author Neil Richards <neil.richards@ngmr.net>, <neil_richards@uk.ibm.com>
322.36 + */
322.37 +
322.38 +import java.util.IdentityHashMap;
322.39 +import java.util.HashSet;
322.40 +import java.util.Map;
322.41 +import java.util.Set;
322.42 +
322.43 +public class DistinctEntrySetElements {
322.44 + public static void main(String[] args) throws Exception {
322.45 + final IdentityHashMap<String, String> identityHashMap =
322.46 + new IdentityHashMap<>();
322.47 +
322.48 + identityHashMap.put("One", "Un");
322.49 + identityHashMap.put("Two", "Deux");
322.50 + identityHashMap.put("Three", "Trois");
322.51 +
322.52 + Set<Map.Entry<String, String>> entrySet = identityHashMap.entrySet();
322.53 + HashSet<Map.Entry<String, String>> hashSet = new HashSet<>(entrySet);
322.54 +
322.55 + // NB: These comparisons are valid in this case because none of the
322.56 + // keys put into 'identityHashMap' above are equal to any other.
322.57 + if (false == hashSet.equals(entrySet)) {
322.58 + throw new RuntimeException("Test FAILED: Sets are not equal.");
322.59 + }
322.60 + if (hashSet.hashCode() != entrySet.hashCode()) {
322.61 + throw new RuntimeException("Test FAILED: Set's hashcodes are not equal.");
322.62 + }
322.63 + }
322.64 +}
323.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
323.2 +++ b/test/java/util/IdentityHashMap/EntrySetIteratorRemoveInvalidatesEntry.java Tue Apr 26 15:48:03 2011 -0700
323.3 @@ -0,0 +1,59 @@
323.4 +/*
323.5 + * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved.
323.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
323.7 + *
323.8 + * This code is free software; you can redistribute it and/or modify it
323.9 + * under the terms of the GNU General Public License version 2 only, as
323.10 + * published by the Free Software Foundation.
323.11 + *
323.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
323.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
323.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
323.15 + * version 2 for more details (a copy is included in the LICENSE file that
323.16 + * accompanied this code).
323.17 + *
323.18 + * You should have received a copy of the GNU General Public License version
323.19 + * 2 along with this work; if not, write to the Free Software Foundation,
323.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
323.21 + *
323.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
323.23 + * or visit www.oracle.com if you need additional information or have any
323.24 + * questions.
323.25 + */
323.26 +
323.27 +/*
323.28 + * Portions Copyright (c) 2011 IBM Corporation
323.29 + */
323.30 +
323.31 +/*
323.32 + * @test
323.33 + * @bug 6312706
323.34 + * @summary Iterator.remove() from Map.entrySet().iterator() invalidates returned Entry.
323.35 + * @author Neil Richards <neil.richards@ngmr.net>, <neil_richards@uk.ibm.com>
323.36 + */
323.37 +
323.38 +import java.util.IdentityHashMap;
323.39 +import java.util.Iterator;
323.40 +import java.util.Map;
323.41 +
323.42 +public class EntrySetIteratorRemoveInvalidatesEntry {
323.43 + public static void main(String[] args) throws Exception {
323.44 + final IdentityHashMap<String, String> identityHashMap =
323.45 + new IdentityHashMap<>();
323.46 +
323.47 + identityHashMap.put("One", "Un");
323.48 + identityHashMap.put("Two", "Deux");
323.49 + identityHashMap.put("Three", "Trois");
323.50 +
323.51 + Iterator<Map.Entry<String, String>> entrySetIterator =
323.52 + identityHashMap.entrySet().iterator();
323.53 + Map.Entry<String, String> entry = entrySetIterator.next();
323.54 +
323.55 + entrySetIterator.remove();
323.56 +
323.57 + try {
323.58 + entry.getKey();
323.59 + throw new RuntimeException("Test FAILED: Entry not invalidated by removal.");
323.60 + } catch (Exception e) { }
323.61 + }
323.62 +}
324.1 --- a/test/java/util/Locale/Bug4518797.java Tue Apr 19 16:01:27 2011 -0700
324.2 +++ b/test/java/util/Locale/Bug4518797.java Tue Apr 26 15:48:03 2011 -0700
324.3 @@ -1,5 +1,5 @@
324.4 /*
324.5 - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
324.6 + * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
324.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
324.8 *
324.9 * This code is free software; you can redistribute it and/or modify it
324.10 @@ -24,17 +24,22 @@
324.11 * @test
324.12 * @bug 4518797
324.13 * @summary Make sure that hashCode() and read/writeObject() are thread-safe.
324.14 - * @run main/timeout=200 Bug4518797
324.15 + * @run main Bug4518797 10
324.16 */
324.17
324.18 import java.util.*;
324.19 import java.io.*;
324.20
324.21 +// Usage: java Bug4518797 [duration]
324.22 public class Bug4518797 {
324.23 static volatile boolean runrun = true;
324.24 static volatile String message = null;
324.25
324.26 public static void main(String[] args) {
324.27 + int duration = 180;
324.28 + if (args.length == 1) {
324.29 + duration = Math.max(5, Integer.parseInt(args[0]));
324.30 + }
324.31 final Locale loc = new Locale("ja", "US");
324.32 final int hashcode = loc.hashCode();
324.33
324.34 @@ -84,7 +89,7 @@
324.35 t1.start();
324.36 t2.start();
324.37 try {
324.38 - for (int i = 0; runrun && i < 180; i++) {
324.39 + for (int i = 0; runrun && i < duration; i++) {
324.40 Thread.sleep(1000);
324.41 }
324.42 runrun = false;
325.1 --- a/test/java/util/Locale/LocaleEnhanceTest.java Tue Apr 19 16:01:27 2011 -0700
325.2 +++ b/test/java/util/Locale/LocaleEnhanceTest.java Tue Apr 26 15:48:03 2011 -0700
325.3 @@ -33,8 +33,10 @@
325.4 import java.io.ObjectOutputStream;
325.5 import java.net.URISyntaxException;
325.6 import java.net.URL;
325.7 +import java.text.DecimalFormatSymbols;
325.8 import java.util.ArrayList;
325.9 import java.util.Arrays;
325.10 +import java.util.Calendar;
325.11 import java.util.IllformedLocaleException;
325.12 import java.util.List;
325.13 import java.util.Locale;
325.14 @@ -43,8 +45,10 @@
325.15
325.16 /**
325.17 * @test
325.18 - * @bug 6875847 6992272 7002320 7015500 7023613
325.19 + * @bug 6875847 6992272 7002320 7015500 7023613 7032820 7033504
325.20 * @summary test API changes to Locale
325.21 + * @compile LocaleEnhanceTest.java
325.22 + * @run main/othervm -esa LocaleEnhanceTest
325.23 */
325.24 public class LocaleEnhanceTest extends LocaleTestFmwk {
325.25
325.26 @@ -593,6 +597,9 @@
325.27 assertEquals("extension", "aa-00-bb-01", locale.getExtension('d'));
325.28 assertEquals("extension c", "1234", locale.getExtension('c'));
325.29
325.30 + locale = Locale.forLanguageTag("und-U-ca-gregory-u-ca-japanese");
325.31 + assertEquals("Unicode extension", "ca-gregory", locale.getExtension(Locale.UNICODE_LOCALE_EXTENSION));
325.32 +
325.33 // redundant Unicode locale keys in an extension are ignored
325.34 locale = Locale.forLanguageTag("und-u-aa-000-bb-001-bB-002-cc-003-c-1234");
325.35 assertEquals("Unicode keywords", "aa-000-bb-001-cc-003", locale.getExtension(Locale.UNICODE_LOCALE_EXTENSION));
325.36 @@ -1275,6 +1282,35 @@
325.37 }
325.38 }
325.39
325.40 + /*
325.41 + * 7033504: (lc) incompatible behavior change for ja_JP_JP and th_TH_TH locales
325.42 + */
325.43 + public void testBug7033504() {
325.44 + checkCalendar(new Locale("ja", "JP", "jp"), "java.util.GregorianCalendar");
325.45 + checkCalendar(new Locale("ja", "jp", "jp"), "java.util.GregorianCalendar");
325.46 + checkCalendar(new Locale("ja", "JP", "JP"), "java.util.JapaneseImperialCalendar");
325.47 + checkCalendar(new Locale("ja", "jp", "JP"), "java.util.JapaneseImperialCalendar");
325.48 + checkCalendar(Locale.forLanguageTag("en-u-ca-japanese"),
325.49 + "java.util.JapaneseImperialCalendar");
325.50 +
325.51 + checkDigit(new Locale("th", "TH", "th"), '0');
325.52 + checkDigit(new Locale("th", "th", "th"), '0');
325.53 + checkDigit(new Locale("th", "TH", "TH"), '\u0e50');
325.54 + checkDigit(new Locale("th", "TH", "TH"), '\u0e50');
325.55 + checkDigit(Locale.forLanguageTag("en-u-nu-thai"), '\u0e50');
325.56 + }
325.57 +
325.58 + private void checkCalendar(Locale loc, String expected) {
325.59 + Calendar cal = Calendar.getInstance(loc);
325.60 + assertEquals("Wrong calendar", expected, cal.getClass().getName());
325.61 + }
325.62 +
325.63 + private void checkDigit(Locale loc, Character expected) {
325.64 + DecimalFormatSymbols dfs = DecimalFormatSymbols.getInstance(loc);
325.65 + Character zero = dfs.getZeroDigit();
325.66 + assertEquals("Wrong digit zero char", expected, zero);
325.67 + }
325.68 +
325.69 ///
325.70 /// utility asserts
325.71 ///
326.1 --- a/test/java/util/PriorityQueue/NoNulls.java Tue Apr 19 16:01:27 2011 -0700
326.2 +++ b/test/java/util/PriorityQueue/NoNulls.java Tue Apr 26 15:48:03 2011 -0700
326.3 @@ -28,7 +28,7 @@
326.4 *
326.5 * Written by Martin Buchholz with assistance from members of JCP JSR-166
326.6 * Expert Group and released to the public domain, as explained at
326.7 - * http://creativecommons.org/licenses/publicdomain
326.8 + * http://creativecommons.org/publicdomain/zero/1.0/
326.9 */
326.10
326.11 /*
327.1 --- a/test/java/util/PriorityQueue/PriorityQueueSort.java Tue Apr 19 16:01:27 2011 -0700
327.2 +++ b/test/java/util/PriorityQueue/PriorityQueueSort.java Tue Apr 26 15:48:03 2011 -0700
327.3 @@ -28,7 +28,7 @@
327.4 *
327.5 * Written by Doug Lea with assistance from members of JCP JSR-166
327.6 * Expert Group and released to the public domain, as explained at
327.7 - * http://creativecommons.org/licenses/publicdomain
327.8 + * http://creativecommons.org/publicdomain/zero/1.0/
327.9 */
327.10
327.11 /*
328.1 --- a/test/java/util/Random/DistinctSeeds.java Tue Apr 19 16:01:27 2011 -0700
328.2 +++ b/test/java/util/Random/DistinctSeeds.java Tue Apr 26 15:48:03 2011 -0700
328.3 @@ -28,7 +28,7 @@
328.4 *
328.5 * Written by Doug Lea with assistance from members of JCP JSR-166
328.6 * Expert Group and released to the public domain, as explained at
328.7 - * http://creativecommons.org/licenses/publicdomain
328.8 + * http://creativecommons.org/publicdomain/zero/1.0/
328.9 */
328.10
328.11 /*
329.1 --- a/test/java/util/ResourceBundle/Bug4168625Test.java Tue Apr 19 16:01:27 2011 -0700
329.2 +++ b/test/java/util/ResourceBundle/Bug4168625Test.java Tue Apr 26 15:48:03 2011 -0700
329.3 @@ -282,7 +282,7 @@
329.4 thread1.start(); //start thread 1
329.5 loader.waitForNotify(1); //wait for thread1 to do getBundle & block in loader
329.6 thread2.start(); //start second thread
329.7 - thread2.join(1000); //wait until thread2 blocks somewhere in getBundle
329.8 + thread2.join(); //wait until thread2 terminates.
329.9
329.10 //Thread1 should be blocked inside getBundle at the class loader
329.11 //Thread2 should have completed its getBundle call and terminated
329.12 @@ -292,7 +292,6 @@
329.13
329.14 thread1.ping(); //continue thread1
329.15 thread1.join();
329.16 - thread2.join();
329.17 }
329.18
329.19 /**
329.20 @@ -318,8 +317,7 @@
329.21 loader.waitForNotify(3); //wait for thread1 to do getBundle(en) & block in loader
329.22 causeResourceBundleCacheFlush(); //cause a cache flush
329.23 thread1.ping(); //kick thread 1
329.24 - thread1.ping(); //kick thread 1
329.25 - thread1.join(1000); //wait until thread2 blocks somewhere in getBundle
329.26 + thread1.join(); //wait until thread1 terminates
329.27
329.28 ResourceBundle bundle = (ResourceBundle)thread1.bundle;
329.29 String s1 = bundle.getString("Bug4168625Resource3_en_US");
330.1 --- a/test/java/util/ResourceBundle/Control/StressTest.java Tue Apr 19 16:01:27 2011 -0700
330.2 +++ b/test/java/util/ResourceBundle/Control/StressTest.java Tue Apr 26 15:48:03 2011 -0700
330.3 @@ -1,5 +1,5 @@
330.4 /*
330.5 - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
330.6 + * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
330.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
330.8 *
330.9 * This code is free software; you can redistribute it and/or modify it
330.10 @@ -24,12 +24,13 @@
330.11 * @test
330.12 * @bug 5102289
330.13 * @summary Stress test for ResourceBundle.getBundle with ResourceBundle.Control.
330.14 - * @run main/timeout=300/othervm -esa StressTest
330.15 + * @run main/othervm -esa StressTest 2 15
330.16 */
330.17
330.18 import java.util.*;
330.19 import java.util.concurrent.atomic.*;
330.20
330.21 +// Usage: java StressTest [threadsFactor [duration]]
330.22 public class StressTest {
330.23 static final Locale ROOT_LOCALE = new Locale("");
330.24 static final Random rand = new Random();
330.25 @@ -60,16 +61,16 @@
330.26 static volatile boolean runrun = true;
330.27
330.28 public static void main(String[] args) {
330.29 - int nThreads = 2;
330.30 + int threadsFactor = 2;
330.31 if (args.length > 0) {
330.32 - nThreads = Math.max(Integer.parseInt(args[0]), 2);
330.33 + threadsFactor = Math.max(2, Integer.parseInt(args[0]));
330.34 }
330.35 - int nSeconds = 180;
330.36 + int duration = 180;
330.37 if (args.length > 1) {
330.38 - nSeconds = Integer.parseInt(args[1]);
330.39 + duration = Math.max(5, Integer.parseInt(args[1]));
330.40 }
330.41 Locale.setDefault(Locale.US);
330.42 - Thread[] tasks = new Thread[locales.length * nThreads];
330.43 + Thread[] tasks = new Thread[locales.length * threadsFactor];
330.44 counters = new AtomicIntegerArray(tasks.length);
330.45
330.46 for (int i = 0; i < tasks.length; i++) {
330.47 @@ -84,8 +85,8 @@
330.48 System.out.printf("%d processors, intervalForCounterCheck = %d [sec]%n",
330.49 nProcessors, intervalForCounterCheck);
330.50 try {
330.51 - for (int i = 0; runrun && i < nSeconds; i++) {
330.52 - Thread.sleep(1000); // 1 seconds
330.53 + for (int i = 0; runrun && i < duration; i++) {
330.54 + Thread.sleep(1000); // 1 second
330.55 if ((i % intervalForCounterCheck) == 0) {
330.56 checkCounters();
330.57 }
331.1 --- a/test/java/util/concurrent/BlockingQueue/CancelledProducerConsumerLoops.java Tue Apr 19 16:01:27 2011 -0700
331.2 +++ b/test/java/util/concurrent/BlockingQueue/CancelledProducerConsumerLoops.java Tue Apr 26 15:48:03 2011 -0700
331.3 @@ -28,7 +28,7 @@
331.4 *
331.5 * Written by Doug Lea with assistance from members of JCP JSR-166
331.6 * Expert Group and released to the public domain, as explained at
331.7 - * http://creativecommons.org/licenses/publicdomain
331.8 + * http://creativecommons.org/publicdomain/zero/1.0/
331.9 */
331.10
331.11 /*
332.1 --- a/test/java/util/concurrent/BlockingQueue/LoopHelpers.java Tue Apr 19 16:01:27 2011 -0700
332.2 +++ b/test/java/util/concurrent/BlockingQueue/LoopHelpers.java Tue Apr 26 15:48:03 2011 -0700
332.3 @@ -28,7 +28,7 @@
332.4 *
332.5 * Written by Doug Lea with assistance from members of JCP JSR-166
332.6 * Expert Group and released to the public domain, as explained at
332.7 - * http://creativecommons.org/licenses/publicdomain
332.8 + * http://creativecommons.org/publicdomain/zero/1.0/
332.9 */
332.10
332.11 /**
333.1 --- a/test/java/util/concurrent/BlockingQueue/MultipleProducersSingleConsumerLoops.java Tue Apr 19 16:01:27 2011 -0700
333.2 +++ b/test/java/util/concurrent/BlockingQueue/MultipleProducersSingleConsumerLoops.java Tue Apr 26 15:48:03 2011 -0700
333.3 @@ -28,7 +28,7 @@
333.4 *
333.5 * Written by Doug Lea with assistance from members of JCP JSR-166
333.6 * Expert Group and released to the public domain, as explained at
333.7 - * http://creativecommons.org/licenses/publicdomain
333.8 + * http://creativecommons.org/publicdomain/zero/1.0/
333.9 */
333.10
333.11 /*
334.1 --- a/test/java/util/concurrent/BlockingQueue/OfferDrainToLoops.java Tue Apr 19 16:01:27 2011 -0700
334.2 +++ b/test/java/util/concurrent/BlockingQueue/OfferDrainToLoops.java Tue Apr 26 15:48:03 2011 -0700
334.3 @@ -28,7 +28,7 @@
334.4 *
334.5 * Written by Doug Lea with assistance from members of JCP JSR-166
334.6 * Expert Group and released to the public domain, as explained at
334.7 - * http://creativecommons.org/licenses/publicdomain
334.8 + * http://creativecommons.org/publicdomain/zero/1.0/
334.9 */
334.10
334.11 /*
335.1 --- a/test/java/util/concurrent/BlockingQueue/PollMemoryLeak.java Tue Apr 19 16:01:27 2011 -0700
335.2 +++ b/test/java/util/concurrent/BlockingQueue/PollMemoryLeak.java Tue Apr 26 15:48:03 2011 -0700
335.3 @@ -28,7 +28,7 @@
335.4 *
335.5 * Written by Doug Lea with assistance from members of JCP JSR-166
335.6 * Expert Group and released to the public domain, as explained at
335.7 - * http://creativecommons.org/licenses/publicdomain
335.8 + * http://creativecommons.org/publicdomain/zero/1.0/
335.9 */
335.10
335.11 /*
336.1 --- a/test/java/util/concurrent/BlockingQueue/ProducerConsumerLoops.java Tue Apr 19 16:01:27 2011 -0700
336.2 +++ b/test/java/util/concurrent/BlockingQueue/ProducerConsumerLoops.java Tue Apr 26 15:48:03 2011 -0700
336.3 @@ -28,7 +28,7 @@
336.4 *
336.5 * Written by Doug Lea with assistance from members of JCP JSR-166
336.6 * Expert Group and released to the public domain, as explained at
336.7 - * http://creativecommons.org/licenses/publicdomain
336.8 + * http://creativecommons.org/publicdomain/zero/1.0/
336.9 */
336.10
336.11 /*
337.1 --- a/test/java/util/concurrent/BlockingQueue/SingleProducerMultipleConsumerLoops.java Tue Apr 19 16:01:27 2011 -0700
337.2 +++ b/test/java/util/concurrent/BlockingQueue/SingleProducerMultipleConsumerLoops.java Tue Apr 26 15:48:03 2011 -0700
337.3 @@ -28,7 +28,7 @@
337.4 *
337.5 * Written by Doug Lea with assistance from members of JCP JSR-166
337.6 * Expert Group and released to the public domain, as explained at
337.7 - * http://creativecommons.org/licenses/publicdomain
337.8 + * http://creativecommons.org/publicdomain/zero/1.0/
337.9 */
337.10
337.11 /*
338.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
338.2 +++ b/test/java/util/concurrent/ConcurrentHashMap/DistinctEntrySetElements.java Tue Apr 26 15:48:03 2011 -0700
338.3 @@ -0,0 +1,59 @@
338.4 +/*
338.5 + * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved.
338.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
338.7 + *
338.8 + * This code is free software; you can redistribute it and/or modify it
338.9 + * under the terms of the GNU General Public License version 2 only, as
338.10 + * published by the Free Software Foundation.
338.11 + *
338.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
338.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
338.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
338.15 + * version 2 for more details (a copy is included in the LICENSE file that
338.16 + * accompanied this code).
338.17 + *
338.18 + * You should have received a copy of the GNU General Public License version
338.19 + * 2 along with this work; if not, write to the Free Software Foundation,
338.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
338.21 + *
338.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
338.23 + * or visit www.oracle.com if you need additional information or have any
338.24 + * questions.
338.25 + */
338.26 +
338.27 +/*
338.28 + * Portions Copyright (c) 2011 IBM Corporation
338.29 + */
338.30 +
338.31 +/*
338.32 + * @test
338.33 + * @bug 6312706
338.34 + * @summary Sets from Map.entrySet() return distinct objects for each Entry
338.35 + * @author Neil Richards <neil.richards@ngmr.net>, <neil_richards@uk.ibm.com>
338.36 + */
338.37 +
338.38 +import java.util.concurrent.ConcurrentHashMap;
338.39 +import java.util.HashSet;
338.40 +import java.util.Map;
338.41 +import java.util.Set;
338.42 +
338.43 +public class DistinctEntrySetElements {
338.44 + public static void main(String[] args) throws Exception {
338.45 + final ConcurrentHashMap<String, String> concurrentHashMap =
338.46 + new ConcurrentHashMap<>();
338.47 +
338.48 + concurrentHashMap.put("One", "Un");
338.49 + concurrentHashMap.put("Two", "Deux");
338.50 + concurrentHashMap.put("Three", "Trois");
338.51 +
338.52 + Set<Map.Entry<String, String>> entrySet = concurrentHashMap.entrySet();
338.53 + HashSet<Map.Entry<String, String>> hashSet = new HashSet<>(entrySet);
338.54 +
338.55 + if (false == hashSet.equals(entrySet)) {
338.56 + throw new RuntimeException("Test FAILED: Sets are not equal.");
338.57 + }
338.58 + if (hashSet.hashCode() != entrySet.hashCode()) {
338.59 + throw new RuntimeException("Test FAILED: Set's hashcodes are not equal.");
338.60 + }
338.61 + }
338.62 +}
339.1 --- a/test/java/util/concurrent/ConcurrentHashMap/LoopHelpers.java Tue Apr 19 16:01:27 2011 -0700
339.2 +++ b/test/java/util/concurrent/ConcurrentHashMap/LoopHelpers.java Tue Apr 26 15:48:03 2011 -0700
339.3 @@ -28,7 +28,7 @@
339.4 *
339.5 * Written by Doug Lea with assistance from members of JCP JSR-166
339.6 * Expert Group and released to the public domain, as explained at
339.7 - * http://creativecommons.org/licenses/publicdomain
339.8 + * http://creativecommons.org/publicdomain/zero/1.0/
339.9 */
339.10
339.11 /**
340.1 --- a/test/java/util/concurrent/ConcurrentHashMap/MapCheck.java Tue Apr 19 16:01:27 2011 -0700
340.2 +++ b/test/java/util/concurrent/ConcurrentHashMap/MapCheck.java Tue Apr 26 15:48:03 2011 -0700
340.3 @@ -28,7 +28,7 @@
340.4 *
340.5 * Written by Doug Lea with assistance from members of JCP JSR-166
340.6 * Expert Group and released to the public domain, as explained at
340.7 - * http://creativecommons.org/licenses/publicdomain
340.8 + * http://creativecommons.org/publicdomain/zero/1.0/
340.9 */
340.10
340.11 /*
341.1 --- a/test/java/util/concurrent/ConcurrentHashMap/MapLoops.java Tue Apr 19 16:01:27 2011 -0700
341.2 +++ b/test/java/util/concurrent/ConcurrentHashMap/MapLoops.java Tue Apr 26 15:48:03 2011 -0700
341.3 @@ -28,7 +28,7 @@
341.4 *
341.5 * Written by Doug Lea with assistance from members of JCP JSR-166
341.6 * Expert Group and released to the public domain, as explained at
341.7 - * http://creativecommons.org/licenses/publicdomain
341.8 + * http://creativecommons.org/publicdomain/zero/1.0/
341.9 */
341.10
341.11 /*
342.1 --- a/test/java/util/concurrent/ConcurrentQueues/ConcurrentQueueLoops.java Tue Apr 19 16:01:27 2011 -0700
342.2 +++ b/test/java/util/concurrent/ConcurrentQueues/ConcurrentQueueLoops.java Tue Apr 26 15:48:03 2011 -0700
342.3 @@ -28,7 +28,7 @@
342.4 *
342.5 * Written by Doug Lea with assistance from members of JCP JSR-166
342.6 * Expert Group and released to the public domain, as explained at
342.7 - * http://creativecommons.org/licenses/publicdomain
342.8 + * http://creativecommons.org/publicdomain/zero/1.0/
342.9 */
342.10
342.11 /*
343.1 --- a/test/java/util/concurrent/ConcurrentQueues/GCRetention.java Tue Apr 19 16:01:27 2011 -0700
343.2 +++ b/test/java/util/concurrent/ConcurrentQueues/GCRetention.java Tue Apr 26 15:48:03 2011 -0700
343.3 @@ -28,7 +28,7 @@
343.4 *
343.5 * Written by Doug Lea with assistance from members of JCP JSR-166
343.6 * Expert Group and released to the public domain, as explained at
343.7 - * http://creativecommons.org/licenses/publicdomain
343.8 + * http://creativecommons.org/publicdomain/zero/1.0/
343.9 */
343.10 /*
343.11 * @test
344.1 --- a/test/java/util/concurrent/ConcurrentQueues/IteratorWeakConsistency.java Tue Apr 19 16:01:27 2011 -0700
344.2 +++ b/test/java/util/concurrent/ConcurrentQueues/IteratorWeakConsistency.java Tue Apr 26 15:48:03 2011 -0700
344.3 @@ -28,7 +28,7 @@
344.4 *
344.5 * Written by Doug Lea with assistance from members of JCP JSR-166
344.6 * Expert Group and released to the public domain, as explained at
344.7 - * http://creativecommons.org/licenses/publicdomain
344.8 + * http://creativecommons.org/publicdomain/zero/1.0/
344.9 */
344.10
344.11 import java.util.*;
345.1 --- a/test/java/util/concurrent/ConcurrentQueues/LoopHelpers.java Tue Apr 19 16:01:27 2011 -0700
345.2 +++ b/test/java/util/concurrent/ConcurrentQueues/LoopHelpers.java Tue Apr 26 15:48:03 2011 -0700
345.3 @@ -28,7 +28,7 @@
345.4 *
345.5 * Written by Doug Lea with assistance from members of JCP JSR-166
345.6 * Expert Group and released to the public domain, as explained at
345.7 - * http://creativecommons.org/licenses/publicdomain
345.8 + * http://creativecommons.org/publicdomain/zero/1.0/
345.9 */
345.10
345.11 /**
346.1 --- a/test/java/util/concurrent/ConcurrentQueues/RemovePollRace.java Tue Apr 19 16:01:27 2011 -0700
346.2 +++ b/test/java/util/concurrent/ConcurrentQueues/RemovePollRace.java Tue Apr 26 15:48:03 2011 -0700
346.3 @@ -28,7 +28,7 @@
346.4 *
346.5 * Written by Doug Lea with assistance from members of JCP JSR-166
346.6 * Expert Group and released to the public domain, as explained at
346.7 - * http://creativecommons.org/licenses/publicdomain
346.8 + * http://creativecommons.org/publicdomain/zero/1.0/
346.9 */
346.10
346.11 /*
347.1 --- a/test/java/util/concurrent/Exchanger/ExchangeLoops.java Tue Apr 19 16:01:27 2011 -0700
347.2 +++ b/test/java/util/concurrent/Exchanger/ExchangeLoops.java Tue Apr 26 15:48:03 2011 -0700
347.3 @@ -28,7 +28,7 @@
347.4 *
347.5 * Written by Doug Lea with assistance from members of JCP JSR-166
347.6 * Expert Group and released to the public domain, as explained at
347.7 - * http://creativecommons.org/licenses/publicdomain
347.8 + * http://creativecommons.org/publicdomain/zero/1.0/
347.9 */
347.10
347.11 /*
348.1 --- a/test/java/util/concurrent/Exchanger/LoopHelpers.java Tue Apr 19 16:01:27 2011 -0700
348.2 +++ b/test/java/util/concurrent/Exchanger/LoopHelpers.java Tue Apr 26 15:48:03 2011 -0700
348.3 @@ -28,7 +28,7 @@
348.4 *
348.5 * Written by Doug Lea with assistance from members of JCP JSR-166
348.6 * Expert Group and released to the public domain, as explained at
348.7 - * http://creativecommons.org/licenses/publicdomain
348.8 + * http://creativecommons.org/publicdomain/zero/1.0/
348.9 */
348.10 /**
348.11 * Misc utilities in JSR166 performance tests
349.1 --- a/test/java/util/concurrent/ExecutorCompletionService/ExecutorCompletionServiceLoops.java Tue Apr 19 16:01:27 2011 -0700
349.2 +++ b/test/java/util/concurrent/ExecutorCompletionService/ExecutorCompletionServiceLoops.java Tue Apr 26 15:48:03 2011 -0700
349.3 @@ -28,7 +28,7 @@
349.4 *
349.5 * Written by Doug Lea with assistance from members of JCP JSR-166
349.6 * Expert Group and released to the public domain, as explained at
349.7 - * http://creativecommons.org/licenses/publicdomain
349.8 + * http://creativecommons.org/publicdomain/zero/1.0/
349.9 */
349.10
349.11 /*
350.1 --- a/test/java/util/concurrent/ExecutorCompletionService/LoopHelpers.java Tue Apr 19 16:01:27 2011 -0700
350.2 +++ b/test/java/util/concurrent/ExecutorCompletionService/LoopHelpers.java Tue Apr 26 15:48:03 2011 -0700
350.3 @@ -28,7 +28,7 @@
350.4 *
350.5 * Written by Doug Lea with assistance from members of JCP JSR-166
350.6 * Expert Group and released to the public domain, as explained at
350.7 - * http://creativecommons.org/licenses/publicdomain
350.8 + * http://creativecommons.org/publicdomain/zero/1.0/
350.9 */
350.10 /**
350.11 * Misc utilities in JSR166 performance tests
351.1 --- a/test/java/util/concurrent/FutureTask/CancelledFutureLoops.java Tue Apr 19 16:01:27 2011 -0700
351.2 +++ b/test/java/util/concurrent/FutureTask/CancelledFutureLoops.java Tue Apr 26 15:48:03 2011 -0700
351.3 @@ -28,7 +28,7 @@
351.4 *
351.5 * Written by Doug Lea with assistance from members of JCP JSR-166
351.6 * Expert Group and released to the public domain, as explained at
351.7 - * http://creativecommons.org/licenses/publicdomain
351.8 + * http://creativecommons.org/publicdomain/zero/1.0/
351.9 */
351.10
351.11 /*
352.1 --- a/test/java/util/concurrent/FutureTask/LoopHelpers.java Tue Apr 19 16:01:27 2011 -0700
352.2 +++ b/test/java/util/concurrent/FutureTask/LoopHelpers.java Tue Apr 26 15:48:03 2011 -0700
352.3 @@ -28,7 +28,7 @@
352.4 *
352.5 * Written by Doug Lea with assistance from members of JCP JSR-166
352.6 * Expert Group and released to the public domain, as explained at
352.7 - * http://creativecommons.org/licenses/publicdomain
352.8 + * http://creativecommons.org/publicdomain/zero/1.0/
352.9 */
352.10 /**
352.11 * Misc utilities in JSR166 performance tests
353.1 --- a/test/java/util/concurrent/Phaser/Arrive.java Tue Apr 19 16:01:27 2011 -0700
353.2 +++ b/test/java/util/concurrent/Phaser/Arrive.java Tue Apr 26 15:48:03 2011 -0700
353.3 @@ -28,7 +28,7 @@
353.4 *
353.5 * Written by Doug Lea with assistance from members of JCP JSR-166
353.6 * Expert Group and released to the public domain, as explained at
353.7 - * http://creativecommons.org/licenses/publicdomain
353.8 + * http://creativecommons.org/publicdomain/zero/1.0/
353.9 */
353.10
353.11 /*
354.1 --- a/test/java/util/concurrent/Phaser/Basic.java Tue Apr 19 16:01:27 2011 -0700
354.2 +++ b/test/java/util/concurrent/Phaser/Basic.java Tue Apr 26 15:48:03 2011 -0700
354.3 @@ -28,7 +28,7 @@
354.4 *
354.5 * Written by Doug Lea with assistance from members of JCP JSR-166
354.6 * Expert Group and released to the public domain, as explained at
354.7 - * http://creativecommons.org/licenses/publicdomain
354.8 + * http://creativecommons.org/publicdomain/zero/1.0/
354.9 */
354.10
354.11 /*
355.1 --- a/test/java/util/concurrent/Phaser/FickleRegister.java Tue Apr 19 16:01:27 2011 -0700
355.2 +++ b/test/java/util/concurrent/Phaser/FickleRegister.java Tue Apr 26 15:48:03 2011 -0700
355.3 @@ -28,7 +28,7 @@
355.4 *
355.5 * Written by Doug Lea with assistance from members of JCP JSR-166
355.6 * Expert Group and released to the public domain, as explained at
355.7 - * http://creativecommons.org/licenses/publicdomain
355.8 + * http://creativecommons.org/publicdomain/zero/1.0/
355.9 */
355.10
355.11 /*
356.1 --- a/test/java/util/concurrent/Phaser/PhaseOverflow.java Tue Apr 19 16:01:27 2011 -0700
356.2 +++ b/test/java/util/concurrent/Phaser/PhaseOverflow.java Tue Apr 26 15:48:03 2011 -0700
356.3 @@ -29,7 +29,7 @@
356.4 * Written by Martin Buchholz and Doug Lea with assistance from
356.5 * members of JCP JSR-166 Expert Group and released to the public
356.6 * domain, as explained at
356.7 - * http://creativecommons.org/licenses/publicdomain
356.8 + * http://creativecommons.org/publicdomain/zero/1.0/
356.9 */
356.10
356.11 /*
357.1 --- a/test/java/util/concurrent/Phaser/TieredArriveLoops.java Tue Apr 19 16:01:27 2011 -0700
357.2 +++ b/test/java/util/concurrent/Phaser/TieredArriveLoops.java Tue Apr 26 15:48:03 2011 -0700
357.3 @@ -28,7 +28,7 @@
357.4 *
357.5 * Written by Doug Lea with assistance from members of JCP JSR-166
357.6 * Expert Group and released to the public domain, as explained at
357.7 - * http://creativecommons.org/licenses/publicdomain
357.8 + * http://creativecommons.org/publicdomain/zero/1.0/
357.9 */
357.10
357.11 /*
358.1 --- a/test/java/util/concurrent/ScheduledThreadPoolExecutor/DelayOverflow.java Tue Apr 19 16:01:27 2011 -0700
358.2 +++ b/test/java/util/concurrent/ScheduledThreadPoolExecutor/DelayOverflow.java Tue Apr 26 15:48:03 2011 -0700
358.3 @@ -28,7 +28,7 @@
358.4 *
358.5 * Written by Doug Lea with assistance from members of JCP JSR-166
358.6 * Expert Group and released to the public domain, as explained at
358.7 - * http://creativecommons.org/licenses/publicdomain
358.8 + * http://creativecommons.org/publicdomain/zero/1.0/
358.9 */
358.10
358.11 /*
359.1 --- a/test/java/util/concurrent/Semaphore/PermitOverflow.java Tue Apr 19 16:01:27 2011 -0700
359.2 +++ b/test/java/util/concurrent/Semaphore/PermitOverflow.java Tue Apr 26 15:48:03 2011 -0700
359.3 @@ -28,7 +28,7 @@
359.4 *
359.5 * Written by Doug Lea with assistance from members of JCP JSR-166
359.6 * Expert Group and released to the public domain, as explained at
359.7 - * http://creativecommons.org/licenses/publicdomain
359.8 + * http://creativecommons.org/publicdomain/zero/1.0/
359.9 */
359.10
359.11 /*
360.1 --- a/test/java/util/concurrent/Semaphore/RacingReleases.java Tue Apr 19 16:01:27 2011 -0700
360.2 +++ b/test/java/util/concurrent/Semaphore/RacingReleases.java Tue Apr 26 15:48:03 2011 -0700
360.3 @@ -28,7 +28,7 @@
360.4 *
360.5 * Written by Doug Lea with assistance from members of JCP JSR-166
360.6 * Expert Group and released to the public domain, as explained at
360.7 - * http://creativecommons.org/licenses/publicdomain
360.8 + * http://creativecommons.org/publicdomain/zero/1.0/
360.9 */
360.10
360.11 /*
361.1 --- a/test/java/util/concurrent/forkjoin/Integrate.java Tue Apr 19 16:01:27 2011 -0700
361.2 +++ b/test/java/util/concurrent/forkjoin/Integrate.java Tue Apr 26 15:48:03 2011 -0700
361.3 @@ -28,7 +28,7 @@
361.4 *
361.5 * Written by Doug Lea with assistance from members of JCP JSR-166
361.6 * Expert Group and released to the public domain, as explained at
361.7 - * http://creativecommons.org/licenses/publicdomain
361.8 + * http://creativecommons.org/publicdomain/zero/1.0/
361.9 */
361.10
361.11 /*
362.1 --- a/test/java/util/concurrent/forkjoin/NQueensCS.java Tue Apr 19 16:01:27 2011 -0700
362.2 +++ b/test/java/util/concurrent/forkjoin/NQueensCS.java Tue Apr 26 15:48:03 2011 -0700
362.3 @@ -28,7 +28,7 @@
362.4 *
362.5 * Written by Doug Lea with assistance from members of JCP JSR-166
362.6 * Expert Group and released to the public domain, as explained at
362.7 - * http://creativecommons.org/licenses/publicdomain
362.8 + * http://creativecommons.org/publicdomain/zero/1.0/
362.9 */
362.10
362.11 /*
363.1 --- a/test/java/util/concurrent/locks/ReentrantLock/CancelledLockLoops.java Tue Apr 19 16:01:27 2011 -0700
363.2 +++ b/test/java/util/concurrent/locks/ReentrantLock/CancelledLockLoops.java Tue Apr 26 15:48:03 2011 -0700
363.3 @@ -28,7 +28,7 @@
363.4 *
363.5 * Written by Doug Lea with assistance from members of JCP JSR-166
363.6 * Expert Group and released to the public domain, as explained at
363.7 - * http://creativecommons.org/licenses/publicdomain
363.8 + * http://creativecommons.org/publicdomain/zero/1.0/
363.9 */
363.10
363.11 /*
364.1 --- a/test/java/util/concurrent/locks/ReentrantLock/LockOncePerThreadLoops.java Tue Apr 19 16:01:27 2011 -0700
364.2 +++ b/test/java/util/concurrent/locks/ReentrantLock/LockOncePerThreadLoops.java Tue Apr 26 15:48:03 2011 -0700
364.3 @@ -28,7 +28,7 @@
364.4 *
364.5 * Written by Doug Lea with assistance from members of JCP JSR-166
364.6 * Expert Group and released to the public domain, as explained at
364.7 - * http://creativecommons.org/licenses/publicdomain
364.8 + * http://creativecommons.org/publicdomain/zero/1.0/
364.9 */
364.10
364.11 /*
365.1 --- a/test/java/util/concurrent/locks/ReentrantLock/LoopHelpers.java Tue Apr 19 16:01:27 2011 -0700
365.2 +++ b/test/java/util/concurrent/locks/ReentrantLock/LoopHelpers.java Tue Apr 26 15:48:03 2011 -0700
365.3 @@ -28,7 +28,7 @@
365.4 *
365.5 * Written by Doug Lea with assistance from members of JCP JSR-166
365.6 * Expert Group and released to the public domain, as explained at
365.7 - * http://creativecommons.org/licenses/publicdomain
365.8 + * http://creativecommons.org/publicdomain/zero/1.0/
365.9 */
365.10 /**
365.11 * Misc utilities in JSR166 performance tests
366.1 --- a/test/java/util/concurrent/locks/ReentrantLock/SimpleReentrantLockLoops.java Tue Apr 19 16:01:27 2011 -0700
366.2 +++ b/test/java/util/concurrent/locks/ReentrantLock/SimpleReentrantLockLoops.java Tue Apr 26 15:48:03 2011 -0700
366.3 @@ -28,7 +28,7 @@
366.4 *
366.5 * Written by Doug Lea with assistance from members of JCP JSR-166
366.6 * Expert Group and released to the public domain, as explained at
366.7 - * http://creativecommons.org/licenses/publicdomain
366.8 + * http://creativecommons.org/publicdomain/zero/1.0/
366.9 */
366.10
366.11 /*
367.1 --- a/test/java/util/concurrent/locks/ReentrantLock/TimeoutLockLoops.java Tue Apr 19 16:01:27 2011 -0700
367.2 +++ b/test/java/util/concurrent/locks/ReentrantLock/TimeoutLockLoops.java Tue Apr 26 15:48:03 2011 -0700
367.3 @@ -28,7 +28,7 @@
367.4 *
367.5 * Written by Doug Lea with assistance from members of JCP JSR-166
367.6 * Expert Group and released to the public domain, as explained at
367.7 - * http://creativecommons.org/licenses/publicdomain
367.8 + * http://creativecommons.org/publicdomain/zero/1.0/
367.9 */
367.10
367.11 /*
368.1 --- a/test/java/util/concurrent/locks/ReentrantReadWriteLock/LoopHelpers.java Tue Apr 19 16:01:27 2011 -0700
368.2 +++ b/test/java/util/concurrent/locks/ReentrantReadWriteLock/LoopHelpers.java Tue Apr 26 15:48:03 2011 -0700
368.3 @@ -28,7 +28,7 @@
368.4 *
368.5 * Written by Doug Lea with assistance from members of JCP JSR-166
368.6 * Expert Group and released to the public domain, as explained at
368.7 - * http://creativecommons.org/licenses/publicdomain
368.8 + * http://creativecommons.org/publicdomain/zero/1.0/
368.9 */
368.10 /**
368.11 * Misc utilities in JSR166 performance tests
369.1 --- a/test/java/util/concurrent/locks/ReentrantReadWriteLock/MapLoops.java Tue Apr 19 16:01:27 2011 -0700
369.2 +++ b/test/java/util/concurrent/locks/ReentrantReadWriteLock/MapLoops.java Tue Apr 26 15:48:03 2011 -0700
369.3 @@ -28,7 +28,7 @@
369.4 *
369.5 * Written by Doug Lea with assistance from members of JCP JSR-166
369.6 * Expert Group and released to the public domain, as explained at
369.7 - * http://creativecommons.org/licenses/publicdomain
369.8 + * http://creativecommons.org/publicdomain/zero/1.0/
369.9 */
369.10
369.11 /*
370.1 --- a/test/java/util/concurrent/locks/ReentrantReadWriteLock/RWMap.java Tue Apr 19 16:01:27 2011 -0700
370.2 +++ b/test/java/util/concurrent/locks/ReentrantReadWriteLock/RWMap.java Tue Apr 26 15:48:03 2011 -0700
370.3 @@ -28,7 +28,7 @@
370.4 *
370.5 * Written by Doug Lea with assistance from members of JCP JSR-166
370.6 * Expert Group and released to the public domain, as explained at
370.7 - * http://creativecommons.org/licenses/publicdomain
370.8 + * http://creativecommons.org/publicdomain/zero/1.0/
370.9 */
370.10
370.11 import java.util.*;
371.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
371.2 +++ b/test/java/util/zip/ZipFile/ClearStaleZipFileInputStreams.java Tue Apr 26 15:48:03 2011 -0700
371.3 @@ -0,0 +1,148 @@
371.4 +/*
371.5 + * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved.
371.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
371.7 + *
371.8 + * This code is free software; you can redistribute it and/or modify it
371.9 + * under the terms of the GNU General Public License version 2 only, as
371.10 + * published by the Free Software Foundation.
371.11 + *
371.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
371.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
371.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
371.15 + * version 2 for more details (a copy is included in the LICENSE file that
371.16 + * accompanied this code).
371.17 + *
371.18 + * You should have received a copy of the GNU General Public License version
371.19 + * 2 along with this work; if not, write to the Free Software Foundation,
371.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
371.21 + *
371.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
371.23 + * or visit www.oracle.com if you need additional information or have any
371.24 + * questions.
371.25 + */
371.26 +
371.27 +/*
371.28 + * Portions Copyright (c) 2011 IBM Corporation
371.29 + */
371.30 +
371.31 +/*
371.32 + * @test
371.33 + * @bug 7031076
371.34 + * @summary Allow stale InputStreams from ZipFiles to be GC'd
371.35 + * @author Neil Richards <neil.richards@ngmr.net>, <neil_richards@uk.ibm.com>
371.36 + */
371.37 +import java.lang.ref.ReferenceQueue;
371.38 +import java.lang.ref.WeakReference;
371.39 +import java.io.File;
371.40 +import java.io.FileOutputStream;
371.41 +import java.io.InputStream;
371.42 +import java.util.Enumeration;
371.43 +import java.util.HashSet;
371.44 +import java.util.Random;
371.45 +import java.util.Set;
371.46 +import java.util.zip.ZipEntry;
371.47 +import java.util.zip.ZipFile;
371.48 +import java.util.zip.ZipOutputStream;
371.49 +
371.50 +public class ClearStaleZipFileInputStreams {
371.51 + private static final int ZIP_ENTRY_NUM = 5;
371.52 +
371.53 + private static final byte[][] data;
371.54 +
371.55 + static {
371.56 + data = new byte[ZIP_ENTRY_NUM][];
371.57 + Random r = new Random();
371.58 + for (int i = 0; i < ZIP_ENTRY_NUM; i++) {
371.59 + data[i] = new byte[1000];
371.60 + r.nextBytes(data[i]);
371.61 + }
371.62 + }
371.63 +
371.64 + private static File createTestFile(int compression) throws Exception {
371.65 + File tempZipFile =
371.66 + File.createTempFile("test-data" + compression, ".zip");
371.67 + tempZipFile.deleteOnExit();
371.68 +
371.69 + ZipOutputStream zos =
371.70 + new ZipOutputStream(new FileOutputStream(tempZipFile));
371.71 + zos.setLevel(compression);
371.72 +
371.73 + try {
371.74 + for (int i = 0; i < ZIP_ENTRY_NUM; i++) {
371.75 + String text = "Entry" + i;
371.76 + ZipEntry entry = new ZipEntry(text);
371.77 + zos.putNextEntry(entry);
371.78 + try {
371.79 + zos.write(data[i], 0, data[i].length);
371.80 + } finally {
371.81 + zos.closeEntry();
371.82 + }
371.83 + }
371.84 + } finally {
371.85 + zos.close();
371.86 + }
371.87 +
371.88 + return tempZipFile;
371.89 + }
371.90 +
371.91 + private static void startGcInducingThread(final int sleepMillis) {
371.92 + final Thread gcInducingThread = new Thread() {
371.93 + public void run() {
371.94 + while (true) {
371.95 + System.gc();
371.96 + try {
371.97 + Thread.sleep(sleepMillis);
371.98 + } catch (InterruptedException e) { }
371.99 + }
371.100 + }
371.101 + };
371.102 +
371.103 + gcInducingThread.setDaemon(true);
371.104 + gcInducingThread.start();
371.105 + }
371.106 +
371.107 + public static void main(String[] args) throws Exception {
371.108 + startGcInducingThread(500);
371.109 + runTest(ZipOutputStream.DEFLATED);
371.110 + runTest(ZipOutputStream.STORED);
371.111 + }
371.112 +
371.113 + private static void runTest(int compression) throws Exception {
371.114 + ReferenceQueue<InputStream> rq = new ReferenceQueue<>();
371.115 +
371.116 + System.out.println("Testing with a zip file with compression level = "
371.117 + + compression);
371.118 + File f = createTestFile(compression);
371.119 + try {
371.120 + ZipFile zf = new ZipFile(f);
371.121 + try {
371.122 + Set<Object> refSet = createTransientInputStreams(zf, rq);
371.123 +
371.124 + System.out.println("Waiting for 'stale' input streams from ZipFile to be GC'd ...");
371.125 + System.out.println("(The test will hang on failure)");
371.126 + while (false == refSet.isEmpty()) {
371.127 + refSet.remove(rq.remove());
371.128 + }
371.129 + System.out.println("Test PASSED.");
371.130 + System.out.println();
371.131 + } finally {
371.132 + zf.close();
371.133 + }
371.134 + } finally {
371.135 + f.delete();
371.136 + }
371.137 + }
371.138 +
371.139 + private static Set<Object> createTransientInputStreams(ZipFile zf,
371.140 + ReferenceQueue<InputStream> rq) throws Exception {
371.141 + Enumeration<? extends ZipEntry> zfe = zf.entries();
371.142 + Set<Object> refSet = new HashSet<>();
371.143 +
371.144 + while (zfe.hasMoreElements()) {
371.145 + InputStream is = zf.getInputStream(zfe.nextElement());
371.146 + refSet.add(new WeakReference<InputStream>(is, rq));
371.147 + }
371.148 +
371.149 + return refSet;
371.150 + }
371.151 +}
372.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
372.2 +++ b/test/javax/crypto/Cipher/GCMAPI.java Tue Apr 26 15:48:03 2011 -0700
372.3 @@ -0,0 +1,138 @@
372.4 +/*
372.5 + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
372.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
372.7 + *
372.8 + * This code is free software; you can redistribute it and/or modify it
372.9 + * under the terms of the GNU General Public License version 2 only, as
372.10 + * published by the Free Software Foundation.
372.11 + *
372.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
372.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
372.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
372.15 + * version 2 for more details (a copy is included in the LICENSE file that
372.16 + * accompanied this code).
372.17 + *
372.18 + * You should have received a copy of the GNU General Public License version
372.19 + * 2 along with this work; if not, write to the Free Software Foundation,
372.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
372.21 + *
372.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
372.23 + * or visit www.oracle.com if you need additional information or have any
372.24 + * questions.
372.25 + */
372.26 +
372.27 +/**
372.28 + * @test
372.29 + * @bug 7031343
372.30 + * @summary Provide API changes to support GCM AEAD ciphers
372.31 + * @author Brad Wetmore
372.32 + */
372.33 +
372.34 +import javax.crypto.*;
372.35 +import javax.crypto.spec.*;
372.36 +import java.nio.ByteBuffer;
372.37 +
372.38 +/*
372.39 + * At this point in time, we can't really do any testing since only the API
372.40 + * is available, the underlying implementation doesn't exist yet. Test
372.41 + * what we can...
372.42 + */
372.43 +public class GCMAPI {
372.44 +
372.45 + // 16 elements
372.46 + private static byte[] bytes = new byte[] {
372.47 + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
372.48 + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f };
372.49 +
372.50 + private static int failed = 0;
372.51 + private static Cipher c;
372.52 +
372.53 + public static void main(String[] args) throws Exception {
372.54 + c = Cipher.getInstance("AES");
372.55 + c.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(new byte[16], "AES"));
372.56 +
372.57 + updateAADFail((byte[]) null);
372.58 + updateAADPass(bytes);
372.59 +
372.60 + updateAADFail(null, 2, 4);
372.61 + updateAADFail(bytes, -2, 4);
372.62 + updateAADFail(bytes, 2, -4);
372.63 + updateAADFail(bytes, 2, 15); // one too many
372.64 +
372.65 + updateAADPass(bytes, 2, 14); // ok.
372.66 + updateAADPass(bytes, 4, 4);
372.67 + updateAADPass(bytes, 0, 0);
372.68 +
372.69 + ByteBuffer bb = ByteBuffer.wrap(bytes);
372.70 +
372.71 + updateAADFail((ByteBuffer) null);
372.72 + updateAADPass(bb);
372.73 +
372.74 + if (failed != 0) {
372.75 + throw new Exception("Test(s) failed");
372.76 + }
372.77 + }
372.78 +
372.79 + private static void updateAADPass(byte[] src) {
372.80 + try {
372.81 + c.updateAAD(src);
372.82 + } catch (UnsupportedOperationException e) {
372.83 + // swallow
372.84 + }catch (Exception e) {
372.85 + e.printStackTrace();
372.86 + failed++;
372.87 + }
372.88 + }
372.89 +
372.90 + private static void updateAADFail(byte[] src) {
372.91 + try {
372.92 + c.updateAAD(src);
372.93 + new Exception("Didn't Fail as Expected").printStackTrace();
372.94 + failed++;
372.95 + } catch (IllegalArgumentException e) {
372.96 + // swallow
372.97 + }
372.98 + }
372.99 +
372.100 + private static void updateAADPass(byte[] src, int offset, int len) {
372.101 + try {
372.102 + c.updateAAD(src, offset, len);
372.103 + } catch (UnsupportedOperationException e) {
372.104 + // swallow
372.105 + } catch (Exception e) {
372.106 + e.printStackTrace();
372.107 + failed++;
372.108 + }
372.109 + }
372.110 +
372.111 + private static void updateAADFail(byte[] src, int offset, int len) {
372.112 + try {
372.113 + c.updateAAD(src, offset, len);
372.114 + new Exception("Didn't Fail as Expected").printStackTrace();
372.115 + failed++;
372.116 + } catch (IllegalArgumentException e) {
372.117 + // swallow
372.118 + }
372.119 + }
372.120 +
372.121 + private static void updateAADPass(ByteBuffer src) {
372.122 + try {
372.123 + c.updateAAD(src);
372.124 + } catch (UnsupportedOperationException e) {
372.125 + // swallow
372.126 + }catch (Exception e) {
372.127 + e.printStackTrace();
372.128 + failed++;
372.129 + }
372.130 + }
372.131 +
372.132 + private static void updateAADFail(ByteBuffer src) {
372.133 + try {
372.134 + c.updateAAD(src);
372.135 + new Exception("Didn't Fail as Expected").printStackTrace();
372.136 + failed++;
372.137 + } catch (IllegalArgumentException e) {
372.138 + // swallow
372.139 + }
372.140 + }
372.141 +}
373.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
373.2 +++ b/test/javax/crypto/spec/GCMParameterSpec/GCMParameterSpecTest.java Tue Apr 26 15:48:03 2011 -0700
373.3 @@ -0,0 +1,130 @@
373.4 +/*
373.5 + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
373.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
373.7 + *
373.8 + * This code is free software; you can redistribute it and/or modify it
373.9 + * under the terms of the GNU General Public License version 2 only, as
373.10 + * published by the Free Software Foundation.
373.11 + *
373.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
373.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
373.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
373.15 + * version 2 for more details (a copy is included in the LICENSE file that
373.16 + * accompanied this code).
373.17 + *
373.18 + * You should have received a copy of the GNU General Public License version
373.19 + * 2 along with this work; if not, write to the Free Software Foundation,
373.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
373.21 + *
373.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
373.23 + * or visit www.oracle.com if you need additional information or have any
373.24 + * questions.
373.25 + */
373.26 +
373.27 +/**
373.28 + * @test
373.29 + * @bug 7031343
373.30 + * @summary Provide API changes to support GCM AEAD ciphers
373.31 + * @author Brad Wetmore
373.32 + */
373.33 +
373.34 +import javax.crypto.AEADBadTagException;
373.35 +import javax.crypto.spec.GCMParameterSpec;
373.36 +import java.util.Arrays;
373.37 +
373.38 +public class GCMParameterSpecTest {
373.39 +
373.40 + // 16 elements
373.41 + private static byte[] bytes = new byte[] {
373.42 + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
373.43 + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f };
373.44 +
373.45 + private static int failed = 0;
373.46 +
373.47 + public static void main(String[] args) throws Exception {
373.48 + newGCMParameterSpecFail(-1, bytes);
373.49 + newGCMParameterSpecFail(128, null);
373.50 + newGCMParameterSpecPass(128, bytes);
373.51 +
373.52 + newGCMParameterSpecFail(-1, bytes, 2, 4);
373.53 + newGCMParameterSpecFail(128, null, 2, 4);
373.54 + newGCMParameterSpecFail(128, bytes, -2, 4);
373.55 + newGCMParameterSpecFail(128, bytes, 2, -4);
373.56 + newGCMParameterSpecFail(128, bytes, 2, 15); // one too many
373.57 +
373.58 + newGCMParameterSpecPass(128, bytes, 2, 14); // ok.
373.59 + newGCMParameterSpecPass(96, bytes, 4, 4);
373.60 + newGCMParameterSpecPass(96, bytes, 0, 0);
373.61 +
373.62 + // Might as well check the Exception constructors.
373.63 + try {
373.64 + new AEADBadTagException();
373.65 + new AEADBadTagException("Bad Tag Seen");
373.66 + } catch (Exception e) {
373.67 + e.printStackTrace();
373.68 + failed++;
373.69 + }
373.70 +
373.71 + if (failed != 0) {
373.72 + throw new Exception("Test(s) failed");
373.73 + }
373.74 + }
373.75 +
373.76 + private static void newGCMParameterSpecPass(
373.77 + int tLen, byte[] src) {
373.78 + try {
373.79 + GCMParameterSpec gcmps = new GCMParameterSpec(tLen, src);
373.80 + if (gcmps.getTLen() != tLen) {
373.81 + throw new Exception("tLen's not equal");
373.82 + }
373.83 + if (!Arrays.equals(gcmps.getIV(), src)) {
373.84 + throw new Exception("IV's not equal");
373.85 + }
373.86 + } catch (Exception e) {
373.87 + e.printStackTrace();
373.88 + failed++;
373.89 + }
373.90 + }
373.91 +
373.92 + private static void newGCMParameterSpecFail(
373.93 + int tLen, byte[] src) {
373.94 + try {
373.95 + new GCMParameterSpec(tLen, src);
373.96 + new Exception("Didn't Fail as Expected").printStackTrace();
373.97 + failed++;
373.98 + } catch (IllegalArgumentException e) {
373.99 + // swallow
373.100 + }
373.101 + }
373.102 +
373.103 + private static void newGCMParameterSpecPass(
373.104 + int tLen, byte[] src, int offset, int len) {
373.105 + try {
373.106 + GCMParameterSpec gcmps =
373.107 + new GCMParameterSpec(tLen, src, offset, len);
373.108 + if (gcmps.getTLen() != tLen) {
373.109 + throw new Exception("tLen's not equal");
373.110 + }
373.111 + if (!Arrays.equals(gcmps.getIV(),
373.112 + Arrays.copyOfRange(src, offset, offset + len))) {
373.113 + System.out.println(offset + " " + len);
373.114 + System.out.println(Arrays.copyOfRange(src, offset, len)[0]);
373.115 + throw new Exception("IV's not equal");
373.116 + }
373.117 + } catch (Exception e) {
373.118 + e.printStackTrace();
373.119 + failed++;
373.120 + }
373.121 + }
373.122 +
373.123 + private static void newGCMParameterSpecFail(
373.124 + int tLen, byte[] src, int offset, int len) {
373.125 + try {
373.126 + new GCMParameterSpec(tLen, src, offset, len);
373.127 + new Exception("Didn't Fail as Expected").printStackTrace();
373.128 + failed++;
373.129 + } catch (IllegalArgumentException e) {
373.130 + // swallow
373.131 + }
373.132 + }
373.133 +}
374.1 --- a/test/javax/imageio/metadata/DOML3Node.java Tue Apr 19 16:01:27 2011 -0700
374.2 +++ b/test/javax/imageio/metadata/DOML3Node.java Tue Apr 26 15:48:03 2011 -0700
374.3 @@ -1,5 +1,5 @@
374.4 /*
374.5 - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
374.6 + * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
374.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
374.8 *
374.9 * This code is free software; you can redistribute it and/or modify it
374.10 @@ -25,7 +25,7 @@
374.11
374.12 /*
374.13 * @test
374.14 - * @bug 6559064
374.15 + * @bug 6559064 6942504
374.16 *
374.17 * @summary Verify DOM L3 Node APIs behave as per Image I/O spec.
374.18 *
374.19 @@ -34,6 +34,7 @@
374.20
374.21 import javax.imageio.metadata.IIOMetadataNode;
374.22 import org.w3c.dom.Attr;
374.23 +import org.w3c.dom.Node;
374.24 import org.w3c.dom.DOMException;
374.25 import org.w3c.dom.UserDataHandler;
374.26
374.27 @@ -74,7 +75,7 @@
374.28 }
374.29
374.30 try {
374.31 - node.setUserData("key");
374.32 + node.getUserData("key");
374.33 throw new RuntimeException("No expected DOM exception");
374.34 } catch (DOMException e) {
374.35 }
374.36 @@ -116,12 +117,6 @@
374.37 }
374.38
374.39 try {
374.40 - node.lookupPrefix("namespaceURI");
374.41 - throw new RuntimeException("No expected DOM exception");
374.42 - } catch (DOMException e) {
374.43 - }
374.44 -
374.45 - try {
374.46 node.getTextContent();
374.47 throw new RuntimeException("No expected DOM exception");
374.48 } catch (DOMException e) {
375.1 --- a/test/javax/swing/JComponent/6989617/bug6989617.java Tue Apr 19 16:01:27 2011 -0700
375.2 +++ b/test/javax/swing/JComponent/6989617/bug6989617.java Tue Apr 26 15:48:03 2011 -0700
375.3 @@ -59,9 +59,7 @@
375.4 toolkit.realSync();
375.5 SwingUtilities.invokeAndWait(new Runnable() {
375.6 public void run() {
375.7 - if (panel.getPaintRectangle() != null) {
375.8 - throw new RuntimeException("paint rectangle is not null");
375.9 - }
375.10 + panel.resetPaintRectangle();
375.11 button.repaint();
375.12 }
375.13 });
376.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
376.2 +++ b/test/javax/swing/JLabel/6596966/bug6596966.java Tue Apr 26 15:48:03 2011 -0700
376.3 @@ -0,0 +1,95 @@
376.4 +/*
376.5 + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
376.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
376.7 + *
376.8 + * This code is free software; you can redistribute it and/or modify it
376.9 + * under the terms of the GNU General Public License version 2 only, as
376.10 + * published by the Free Software Foundation.
376.11 + *
376.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
376.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
376.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
376.15 + * version 2 for more details (a copy is included in the LICENSE file that
376.16 + * accompanied this code).
376.17 + *
376.18 + * You should have received a copy of the GNU General Public License version
376.19 + * 2 along with this work; if not, write to the Free Software Foundation,
376.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
376.21 + *
376.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
376.23 + * or visit www.oracle.com if you need additional information or have any
376.24 + * questions.
376.25 + */
376.26 +
376.27 +/* @test
376.28 + @bug 6596966
376.29 + @summary Some JFileChooser mnemonics do not work with sticky keys
376.30 + * @library ../../regtesthelpers
376.31 + * @build Util
376.32 + @run main bug6596966
376.33 + @author Pavel Porvatov
376.34 +*/
376.35 +
376.36 +
376.37 +import javax.swing.*;
376.38 +import java.awt.*;
376.39 +import java.awt.event.KeyEvent;
376.40 +
376.41 +public class bug6596966 {
376.42 + private static JFrame frame;
376.43 +
376.44 + private static JLabel label;
376.45 + private static JButton button;
376.46 + private static JComboBox comboBox;
376.47 +
376.48 + public static void main(String[] args) throws Exception {
376.49 + Robot robot = new Robot();
376.50 +
376.51 + SwingUtilities.invokeAndWait(new Runnable() {
376.52 + public void run() {
376.53 + button = new JButton("Button");
376.54 + comboBox = new JComboBox();
376.55 +
376.56 + label = new JLabel("Label");
376.57 + label.setDisplayedMnemonic('L');
376.58 + label.setLabelFor(comboBox);
376.59 +
376.60 + JPanel pnContent = new JPanel();
376.61 +
376.62 + pnContent.add(button);
376.63 + pnContent.add(label);
376.64 + pnContent.add(comboBox);
376.65 +
376.66 + frame = new JFrame();
376.67 +
376.68 + frame.add(pnContent);
376.69 + frame.pack();
376.70 + frame.setVisible(true);
376.71 + }
376.72 + });
376.73 +
376.74 + Util.blockTillDisplayed(frame);
376.75 +
376.76 + robot.keyPress(KeyEvent.VK_ALT);
376.77 + robot.keyPress(KeyEvent.VK_L);
376.78 +
376.79 + robot.waitForIdle();
376.80 +
376.81 + Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(new KeyEvent(label, KeyEvent.KEY_RELEASED,
376.82 + EventQueue.getMostRecentEventTime(), 0, KeyEvent.VK_L, 'L'));
376.83 +
376.84 + robot.waitForIdle();
376.85 +
376.86 + try {
376.87 + SwingUtilities.invokeAndWait(new Runnable() {
376.88 + public void run() {
376.89 + if (!comboBox.isFocusOwner()) {
376.90 + throw new RuntimeException("comboBox isn't focus owner");
376.91 + }
376.92 + }
376.93 + });
376.94 + } finally {
376.95 + robot.keyRelease(KeyEvent.VK_ALT);
376.96 + }
376.97 + }
376.98 +}
377.1 --- a/test/javax/swing/JLabel/7004134/bug7004134.java Tue Apr 19 16:01:27 2011 -0700
377.2 +++ b/test/javax/swing/JLabel/7004134/bug7004134.java Tue Apr 26 15:48:03 2011 -0700
377.3 @@ -52,7 +52,13 @@
377.4 frame.add(label);
377.5 frame.pack();
377.6 frame.setVisible(true);
377.7 + }
377.8 + });
377.9
377.10 + ((SunToolkit) SunToolkit.getDefaultToolkit()).realSync();
377.11 +
377.12 + SwingUtilities.invokeAndWait(new Runnable() {
377.13 + public void run() {
377.14 ToolTipManager toolTipManager = ToolTipManager.sharedInstance();
377.15
377.16 toolTipManager.setInitialDelay(0);
377.17 @@ -83,7 +89,13 @@
377.18 frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
377.19 frame.pack();
377.20 frame.setVisible(true);
377.21 + }
377.22 + });
377.23
377.24 + ((SunToolkit) SunToolkit.getDefaultToolkit()).realSync();
377.25 +
377.26 + SwingUtilities.invokeAndWait(new Runnable() {
377.27 + public void run() {
377.28 ToolTipManager toolTipManager = ToolTipManager.sharedInstance();
377.29
377.30 toolTipManager.setInitialDelay(0);
378.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
378.2 +++ b/test/javax/swing/JMenuItem/7036148/bug7036148.java Tue Apr 26 15:48:03 2011 -0700
378.3 @@ -0,0 +1,53 @@
378.4 +/*
378.5 + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
378.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
378.7 + *
378.8 + * This code is free software; you can redistribute it and/or modify it
378.9 + * under the terms of the GNU General Public License version 2 only, as
378.10 + * published by the Free Software Foundation.
378.11 + *
378.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
378.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
378.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
378.15 + * version 2 for more details (a copy is included in the LICENSE file that
378.16 + * accompanied this code).
378.17 + *
378.18 + * You should have received a copy of the GNU General Public License version
378.19 + * 2 along with this work; if not, write to the Free Software Foundation,
378.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
378.21 + *
378.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
378.23 + * or visit www.oracle.com if you need additional information or have any
378.24 + * questions.
378.25 + */
378.26 +
378.27 + /*
378.28 + * @test
378.29 + * @bug 7036148
378.30 + * @summary NullPointerException with null JMenu name
378.31 + * @author Alexander Potochkin
378.32 + * @run main bug7036148
378.33 + */
378.34 +
378.35 +
378.36 +import javax.swing.*;
378.37 +import java.awt.event.ActionEvent;
378.38 +
378.39 +public class bug7036148 extends JFrame {
378.40 + public bug7036148() {
378.41 + JMenuBar bar = new JMenuBar();
378.42 + Action menuAction = new AbstractAction(null, null){
378.43 + public void actionPerformed(ActionEvent e) {
378.44 + }
378.45 + };
378.46 + JMenu menu = new JMenu(menuAction);
378.47 + menu.add(new JMenuItem("test"));
378.48 + bar.add(menu);
378.49 + setJMenuBar(bar);
378.50 + pack();
378.51 + }
378.52 +
378.53 + public static void main(String[] args) {
378.54 + new bug7036148();
378.55 + }
378.56 +}
379.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
379.2 +++ b/test/javax/swing/border/Test7034614.java Tue Apr 26 15:48:03 2011 -0700
379.3 @@ -0,0 +1,77 @@
379.4 +/*
379.5 + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
379.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
379.7 + *
379.8 + * This code is free software; you can redistribute it and/or modify it
379.9 + * under the terms of the GNU General Public License version 2 only, as
379.10 + * published by the Free Software Foundation.
379.11 + *
379.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
379.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
379.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
379.15 + * version 2 for more details (a copy is included in the LICENSE file that
379.16 + * accompanied this code).
379.17 + *
379.18 + * You should have received a copy of the GNU General Public License version
379.19 + * 2 along with this work; if not, write to the Free Software Foundation,
379.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
379.21 + *
379.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
379.23 + * or visit www.oracle.com if you need additional information or have any
379.24 + * questions.
379.25 + */
379.26 +
379.27 +/*
379.28 + * @test
379.29 + * @bug 7034614
379.30 + * @summary Tests that TitledBorder does not modify Insets
379.31 + * @author Sergey Malenkov
379.32 + */
379.33 +
379.34 +import java.awt.Component;
379.35 +import java.awt.Graphics;
379.36 +import java.awt.Insets;
379.37 +import java.awt.image.BufferedImage;
379.38 +import javax.swing.border.Border;
379.39 +import javax.swing.border.TitledBorder;
379.40 +
379.41 +public class Test7034614 {
379.42 +
379.43 + public static void main(String[] args) {
379.44 + Graphics g = new BufferedImage(9, 9, 9).getGraphics();
379.45 +
379.46 + BrokenBorder broken = new BrokenBorder();
379.47 + TitledBorder titled = new TitledBorder(broken, broken.getClass().getName());
379.48 +
379.49 + Insets insets = (Insets) broken.getBorderInsets(broken).clone();
379.50 + titled.getBorderInsets(broken);
379.51 + broken.validate(insets);
379.52 + for (int i = 0; i < 10; i++) {
379.53 + titled.paintBorder(broken, g, 0, 0, i, i);
379.54 + broken.validate(insets);
379.55 + titled.getBaseline(broken, i, i);
379.56 + broken.validate(insets);
379.57 + }
379.58 + }
379.59 +
379.60 + private static class BrokenBorder extends Component implements Border {
379.61 + private Insets insets = new Insets(1, 2, 3, 4);
379.62 +
379.63 + private void validate(Insets insets) {
379.64 + if (!this.insets.equals(insets)) {
379.65 + throw new Error("unexpected change");
379.66 + }
379.67 + }
379.68 +
379.69 + public Insets getBorderInsets(Component c) {
379.70 + return this.insets;
379.71 + }
379.72 +
379.73 + public boolean isBorderOpaque() {
379.74 + return false;
379.75 + }
379.76 +
379.77 + public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) {
379.78 + }
379.79 + }
379.80 +}
380.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
380.2 +++ b/test/javax/swing/plaf/synth/7032791/bug7032791.java Tue Apr 26 15:48:03 2011 -0700
380.3 @@ -0,0 +1,48 @@
380.4 +/*
380.5 + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
380.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
380.7 + *
380.8 + * This code is free software; you can redistribute it and/or modify it
380.9 + * under the terms of the GNU General Public License version 2 only, as
380.10 + * published by the Free Software Foundation.
380.11 + *
380.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
380.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
380.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
380.15 + * version 2 for more details (a copy is included in the LICENSE file that
380.16 + * accompanied this code).
380.17 + *
380.18 + * You should have received a copy of the GNU General Public License version
380.19 + * 2 along with this work; if not, write to the Free Software Foundation,
380.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
380.21 + *
380.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
380.23 + * or visit www.oracle.com if you need additional information or have any
380.24 + * questions.
380.25 + */
380.26 +
380.27 +/**
380.28 + * @test
380.29 + * @bug 7032791
380.30 + * @author Alexander Potochkin
380.31 + * @summary TableCellRenderer.getTableCellRendererComponent() doesn't accept null JTable with GTK+ L&F
380.32 + */
380.33 +
380.34 +import javax.swing.*;
380.35 +import javax.swing.plaf.synth.SynthLookAndFeel;
380.36 +import javax.swing.table.TableCellRenderer;
380.37 +
380.38 +public class bug7032791 {
380.39 +
380.40 + public static void main(String[] args) throws Exception {
380.41 +
380.42 + UIManager.setLookAndFeel(new SynthLookAndFeel());
380.43 +
380.44 + Object value = "Test value";
380.45 + JTable table = new JTable(1, 1);
380.46 + TableCellRenderer renderer = table.getDefaultRenderer(Object.class);
380.47 + renderer.getTableCellRendererComponent(null, value, true, true, 0, 0);
380.48 + System.out.println("OK");
380.49 + }
380.50 +}
380.51 +
381.1 --- a/test/javax/swing/text/CSSBorder/6796710/bug6796710.java Tue Apr 19 16:01:27 2011 -0700
381.2 +++ b/test/javax/swing/text/CSSBorder/6796710/bug6796710.java Tue Apr 26 15:48:03 2011 -0700
381.3 @@ -31,6 +31,8 @@
381.4 @run main bug6796710
381.5 */
381.6
381.7 +import sun.awt.SunToolkit;
381.8 +
381.9 import javax.swing.*;
381.10 import java.awt.*;
381.11 import java.awt.image.BufferedImage;
381.12 @@ -91,7 +93,7 @@
381.13 }
381.14 });
381.15
381.16 - robot.waitForIdle();
381.17 + ((SunToolkit) SunToolkit.getDefaultToolkit()).realSync();
381.18
381.19 BufferedImage bufferedImage = getPnBottomImage();
381.20
381.21 @@ -101,7 +103,10 @@
381.22 }
381.23 });
381.24
381.25 - robot.waitForIdle();
381.26 + ((SunToolkit) SunToolkit.getDefaultToolkit()).realSync();
381.27 +
381.28 + // On Linux platforms realSync doesn't guaranties setSize completion
381.29 + Thread.sleep(1000);
381.30
381.31 if (!Util.compareBufferedImages(bufferedImage, getPnBottomImage())) {
381.32 throw new RuntimeException("The test failed");
382.1 --- a/test/javax/swing/text/GlyphView/6539700/bug6539700.java Tue Apr 19 16:01:27 2011 -0700
382.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
382.3 @@ -1,114 +0,0 @@
382.4 -/*
382.5 - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
382.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
382.7 - *
382.8 - * This code is free software; you can redistribute it and/or modify it
382.9 - * under the terms of the GNU General Public License version 2 only, as
382.10 - * published by the Free Software Foundation.
382.11 - *
382.12 - * This code is distributed in the hope that it will be useful, but WITHOUT
382.13 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
382.14 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
382.15 - * version 2 for more details (a copy is included in the LICENSE file that
382.16 - * accompanied this code).
382.17 - *
382.18 - * You should have received a copy of the GNU General Public License version
382.19 - * 2 along with this work; if not, write to the Free Software Foundation,
382.20 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
382.21 - *
382.22 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
382.23 - * or visit www.oracle.com if you need additional information or have any
382.24 - * questions.
382.25 - */
382.26 -
382.27 -/*
382.28 - * @test
382.29 - * @bug 6539700
382.30 - * @summary test that the long space-less lines are correctly soft-wrapped
382.31 - * @author Sergey Groznyh
382.32 - * @run main bug6539700
382.33 - */
382.34 -
382.35 -import javax.swing.JEditorPane;
382.36 -import javax.swing.JFrame;
382.37 -import javax.swing.SwingUtilities;
382.38 -import javax.swing.text.ParagraphView;
382.39 -import javax.swing.text.View;
382.40 -
382.41 -public class bug6539700 {
382.42 - static JFrame f;
382.43 - static JEditorPane ep;
382.44 - static String text = "AAAAAAAA<b>AAAAAA</b>AAAAAAAA<b>AAAAAAAAA</b>" +
382.45 - "AA<b>AAA</b>AAAAAAAAA";
382.46 - static int size = 100;
382.47 - static Class rowClass = null;
382.48 -
382.49 - static void createContentPane() {
382.50 - ep = new JEditorPane();
382.51 - ep.setContentType("text/html");
382.52 - ep.setEditable(false);
382.53 - ep.setText(text);
382.54 - f = new JFrame();
382.55 - f.setSize(size, 2 * size);
382.56 - f.add(ep);
382.57 - f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
382.58 - f.setVisible(true);
382.59 - }
382.60 -
382.61 - static void checkRows(View v, boolean last) {
382.62 - int width = (int) v.getPreferredSpan(View.X_AXIS);
382.63 -
382.64 - if (v.getClass() == rowClass) {
382.65 - // Row width shouldn't exceed the container width
382.66 - if (width > size) {
382.67 - throw new RuntimeException("too long row: " + width);
382.68 - }
382.69 -
382.70 - // Row shouldn't be too short (except for the last one)
382.71 - if (!last) {
382.72 - if (width < size * 2 / 3) {
382.73 - throw new RuntimeException("too short row: " + width);
382.74 - }
382.75 - }
382.76 - }
382.77 -
382.78 - int n = v.getViewCount();
382.79 - if (n > 0) {
382.80 - for (int i = 0; i < n; i++) {
382.81 - View c = v.getView(i);
382.82 - checkRows(c, i == n - 1);
382.83 - }
382.84 - }
382.85 - }
382.86 -
382.87 - public static void main(String[] argv) {
382.88 - try {
382.89 - SwingUtilities.invokeAndWait(new Runnable() {
382.90 - public void run() {
382.91 - createContentPane();
382.92 - }
382.93 - });
382.94 - } catch (Exception ex) {
382.95 - throw new RuntimeException(ex);
382.96 - }
382.97 -
382.98 - Class[] pvchildren = ParagraphView.class.getDeclaredClasses();
382.99 - for (Class c : pvchildren) {
382.100 - if (c.getName().equals("javax.swing.text.ParagraphView$Row")) {
382.101 - rowClass = c;
382.102 - break;
382.103 - }
382.104 - }
382.105 - if (rowClass == null) {
382.106 - throw new RuntimeException("can't find ParagraphView.Row class");
382.107 - }
382.108 -
382.109 - SwingUtilities.invokeLater(new Runnable() {
382.110 - public void run() {
382.111 - checkRows(ep.getUI().getRootView(ep), true);
382.112 - }
382.113 - });
382.114 -
382.115 - System.out.println("OK");
382.116 - }
382.117 -}
383.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
383.2 +++ b/test/javax/swing/text/html/parser/Parser/7003777/bug7003777.java Tue Apr 26 15:48:03 2011 -0700
383.3 @@ -0,0 +1,73 @@
383.4 +/*
383.5 + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
383.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
383.7 + *
383.8 + * This code is free software; you can redistribute it and/or modify it
383.9 + * under the terms of the GNU General Public License version 2 only, as
383.10 + * published by the Free Software Foundation.
383.11 + *
383.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
383.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
383.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
383.15 + * version 2 for more details (a copy is included in the LICENSE file that
383.16 + * accompanied this code).
383.17 + *
383.18 + * You should have received a copy of the GNU General Public License version
383.19 + * 2 along with this work; if not, write to the Free Software Foundation,
383.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
383.21 + *
383.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
383.23 + * or visit www.oracle.com if you need additional information or have any
383.24 + * questions.
383.25 + */
383.26 +
383.27 +/* @test
383.28 + @bug 7003777
383.29 + @summary Nonexistent html entities not parsed properly.
383.30 + @author Pavel Porvatov
383.31 +*/
383.32 +
383.33 +import javax.swing.*;
383.34 +import javax.swing.text.BadLocationException;
383.35 +
383.36 +public class bug7003777 {
383.37 + private static final String[] TEST_STRINGS = {
383.38 + "&a",
383.39 + "&aa",
383.40 + "&a;",
383.41 + "&aa;",
383.42 + };
383.43 +
383.44 + public static void main(String[] args) throws Exception {
383.45 + SwingUtilities.invokeAndWait(new Runnable() {
383.46 + public void run() {
383.47 + JTextPane pane = new JTextPane();
383.48 +
383.49 + pane.setContentType("text/html");
383.50 +
383.51 + for (String testString : TEST_STRINGS) {
383.52 + pane.setText(testString);
383.53 +
383.54 + String parsedText;
383.55 +
383.56 + try {
383.57 + parsedText = pane.getDocument().getText(0, pane.getDocument().getLength());
383.58 + } catch (BadLocationException e) {
383.59 + throw new RuntimeException("The test failed.", e);
383.60 + }
383.61 +
383.62 + if (parsedText.charAt(0) != '\n') {
383.63 + throw new RuntimeException("The first char should be \\n");
383.64 + }
383.65 +
383.66 + parsedText = parsedText.substring(1);
383.67 +
383.68 + if (!testString.equals(parsedText)) {
383.69 + throw new RuntimeException("The '" + testString +
383.70 + "' string wasn't parsed correctly. Parsed value is '" + parsedText + "'");
383.71 + }
383.72 + }
383.73 + }
383.74 + });
383.75 + }
383.76 +}
384.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
384.2 +++ b/test/sample/chatserver/ChatTest.java Tue Apr 26 15:48:03 2011 -0700
384.3 @@ -0,0 +1,399 @@
384.4 +/*
384.5 + * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved.
384.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
384.7 + *
384.8 + * This code is free software; you can redistribute it and/or modify it
384.9 + * under the terms of the GNU General Public License version 2 only, as
384.10 + * published by the Free Software Foundation.
384.11 + *
384.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
384.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
384.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
384.15 + * version 2 for more details (a copy is included in the LICENSE file that
384.16 + * accompanied this code).
384.17 + *
384.18 + * You should have received a copy of the GNU General Public License version
384.19 + * 2 along with this work; if not, write to the Free Software Foundation,
384.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
384.21 + *
384.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
384.23 + * or visit www.oracle.com if you need additional information or have any
384.24 + * questions.
384.25 + */
384.26 +
384.27 +
384.28 +/* @test
384.29 + * @summary Test chat server chatserver test
384.30 + *
384.31 + * @library ../../../src/share/sample/nio/chatserver
384.32 + * @build ChatTest ChatServer Client ClientReader DataReader MessageReader NameReader
384.33 + * @run main ChatTest
384.34 + */
384.35 +
384.36 +import java.io.*;
384.37 +import java.net.InetSocketAddress;
384.38 +import java.net.Socket;
384.39 +import java.util.ArrayList;
384.40 +import java.util.Collections;
384.41 +import java.util.List;
384.42 +import java.util.concurrent.CyclicBarrier;
384.43 +
384.44 +public class ChatTest {
384.45 + public static int listeningPort = 0;
384.46 +
384.47 + public static void main(String[] args) throws Throwable {
384.48 + testStartStop();
384.49 + testPortOpen();
384.50 + testAsksForName();
384.51 + testUseName();
384.52 + testConnectDisconnectConnect();
384.53 + testUsernameAndMessage();
384.54 + testDontReceiveMessageInNameState();
384.55 + }
384.56 +
384.57 + private static ChatServer startServer() throws IOException {
384.58 + ChatServer server = new ChatServer(0);
384.59 + InetSocketAddress address = (InetSocketAddress) server.getSocketAddress();
384.60 + listeningPort = address.getPort();
384.61 + server.run();
384.62 + return server;
384.63 + }
384.64 +
384.65 + public static void testStartStop() throws Exception {
384.66 + ChatServer server = startServer();
384.67 + server.shutdown();
384.68 + }
384.69 +
384.70 + public static void testPortOpen() throws Exception {
384.71 + ChatServer server = startServer();
384.72 + try {
384.73 + Socket socket = new Socket("localhost", listeningPort);
384.74 + if (!socket.isConnected()) {
384.75 + throw new RuntimeException("Failed to connect to server: port not open");
384.76 + }
384.77 + } finally {
384.78 + server.shutdown();
384.79 + }
384.80 + }
384.81 +
384.82 + public static void testAsksForName() throws Exception {
384.83 + ChatServer server = startServer();
384.84 + try {
384.85 + Socket socket = new Socket("localhost", listeningPort);
384.86 +
384.87 + Reader reader = new BufferedReader(new InputStreamReader(socket.getInputStream()));
384.88 + String string = readAvailableString(reader);
384.89 + if (!string.equals("Name: ")) {
384.90 + throw new RuntimeException("Server doesn't send Name: ");
384.91 + }
384.92 + } finally {
384.93 + server.shutdown();
384.94 + }
384.95 + }
384.96 +
384.97 + public static void testUseName() throws Throwable {
384.98 + ChatServer server = startServer();
384.99 + try {
384.100 + performTestUseName();
384.101 + } finally {
384.102 + server.shutdown();
384.103 + }
384.104 + }
384.105 +
384.106 + public static void testConnectDisconnectConnect() throws Exception {
384.107 + ChatServer server = startServer();
384.108 + try {
384.109 + performTestConnectDisconnectConnect();
384.110 + } finally {
384.111 + server.shutdown();
384.112 + }
384.113 + }
384.114 +
384.115 + public static void testUsernameAndMessage() throws Exception {
384.116 + ChatServer server = startServer();
384.117 + try {
384.118 + performTestUsernameAndMessage();
384.119 + } finally {
384.120 + server.shutdown();
384.121 + }
384.122 + }
384.123 +
384.124 + public static void testDontReceiveMessageInNameState() throws Exception {
384.125 + ChatServer server = startServer();
384.126 + try {
384.127 + performDontReceiveMessageInNameState();
384.128 + } finally {
384.129 + server.shutdown();
384.130 + }
384.131 + }
384.132 +
384.133 + private static void assertEqual(List<Exception> exception, Object value, Object expected) {
384.134 + if (expected == value) {
384.135 + return;
384.136 + }
384.137 + if (expected == null) {
384.138 + exception.add(new RuntimeException("Expected null, but was: " + value));
384.139 + return;
384.140 + }
384.141 + if (!expected.equals(value)) {
384.142 + exception.add(new RuntimeException("Expected: " + expected + " but was: " + value));
384.143 + return;
384.144 + }
384.145 + }
384.146 +
384.147 + private static void performDontReceiveMessageInNameState() throws Exception {
384.148 + final CyclicBarrier barrier1 = new CyclicBarrier(2);
384.149 + final CyclicBarrier barrier2 = new CyclicBarrier(2);
384.150 + final CyclicBarrier barrier3 = new CyclicBarrier(2);
384.151 + final List<Exception> exceptions = Collections.synchronizedList(new ArrayList<Exception>());
384.152 +
384.153 + ChatConnection chatConnection = new ChatConnection() {
384.154 + @Override
384.155 + public void run(Socket socket, BufferedReader reader, Writer writer) throws Exception {
384.156 + String string = readAvailableString(reader);
384.157 + assertEqual(exceptions, string, "Name: ");
384.158 + writer.write("testClient1\n");
384.159 + waitForJoin(reader, "testClient1");
384.160 + barrier1.await();
384.161 + writer.write("Ignore this!\n");
384.162 + barrier2.await();
384.163 + barrier3.await();
384.164 + }
384.165 + };
384.166 +
384.167 + Thread client2 = new Thread(new ChatConnection() {
384.168 + @Override
384.169 + public void run(Socket socket, BufferedReader reader, Writer writer) throws Exception {
384.170 + barrier1.await();
384.171 + barrier2.await();
384.172 + String string = readAvailableString(reader);
384.173 + assertEqual(exceptions, string, "Name: ");
384.174 + string = readAvailableString(reader, true);
384.175 + assertEqual(exceptions, string, null);
384.176 + writer.write("testClient2\n");
384.177 + barrier3.await();
384.178 + }
384.179 + });
384.180 +
384.181 + client2.start();
384.182 + chatConnection.run();
384.183 + if (!exceptions.isEmpty()) {
384.184 + throw exceptions.get(0);
384.185 + }
384.186 +
384.187 + }
384.188 +
384.189 + private static void waitForJoin(BufferedReader reader, String s) throws IOException {
384.190 + String joined;
384.191 + do {
384.192 + joined = readAvailableString(reader);
384.193 + } while (!(joined != null && joined.contains("Welcome " + s)));
384.194 + }
384.195 +
384.196 + private static void performTestUsernameAndMessage() throws Exception {
384.197 + final CyclicBarrier barrier1 = new CyclicBarrier(2);
384.198 + final CyclicBarrier barrier2 = new CyclicBarrier(2);
384.199 + final CyclicBarrier barrier3 = new CyclicBarrier(2);
384.200 + final List<Exception> exceptions = Collections.synchronizedList(new ArrayList<Exception>());
384.201 +
384.202 + ChatConnection chatConnection = new ChatConnection() {
384.203 + @Override
384.204 + public void run(Socket socket, BufferedReader reader, Writer writer) throws Exception {
384.205 + String string = readAvailableString(reader);
384.206 + assertEqual(exceptions, string, "Name: ");
384.207 + writer.write("testClient1\n");
384.208 + waitForJoin(reader, "testClient1");
384.209 + barrier1.await();
384.210 + barrier2.await();
384.211 + string = readAvailableString(reader);
384.212 + assertEqual(exceptions, string, "testClient2: Hello world!\n");
384.213 + barrier3.await();
384.214 + }
384.215 + };
384.216 +
384.217 + Thread client2 = new Thread(new ChatConnection() {
384.218 + @Override
384.219 + public void run(Socket socket, BufferedReader reader, Writer writer) throws Exception {
384.220 + String string = readAvailableString(reader);
384.221 + assertEqual(exceptions, string, "Name: ");
384.222 + barrier1.await();
384.223 + writer.write("testClient2\nHello world!\n");
384.224 + barrier2.await();
384.225 + barrier3.await();
384.226 + }
384.227 + });
384.228 +
384.229 + client2.start();
384.230 + chatConnection.run();
384.231 + if (!exceptions.isEmpty()) {
384.232 + throw exceptions.get(0);
384.233 + }
384.234 + }
384.235 +
384.236 + private static void performTestConnectDisconnectConnect() throws Exception {
384.237 + final CyclicBarrier barrier1 = new CyclicBarrier(2);
384.238 + final CyclicBarrier barrier2 = new CyclicBarrier(2);
384.239 + final CyclicBarrier barrier3 = new CyclicBarrier(2);
384.240 + final List<Exception> exceptions = new ArrayList<Exception>();
384.241 +
384.242 + ChatConnection chatConnection = new ChatConnection() {
384.243 + @Override
384.244 + public void run(Socket socket, BufferedReader reader, Writer writer) throws Exception {
384.245 + String string = readAvailableString(reader);
384.246 + assertEqual(exceptions, string, "Name: ");
384.247 + writer.write("testClient1\n");
384.248 + }
384.249 + };
384.250 +
384.251 + ChatConnection chatConnection2 = new ChatConnection() {
384.252 + @Override
384.253 + public void run(Socket socket, BufferedReader reader, Writer writer) throws Exception {
384.254 + readAvailableString(reader);
384.255 + writer.write("testClient1\n");
384.256 + waitForJoin(reader, "testClient1");
384.257 + barrier1.await();
384.258 + writer.write("Good morning!\n");
384.259 + barrier2.await();
384.260 + String string = readAvailableString(reader);
384.261 + assertEqual(exceptions, string, "testClient2: Hello world!\n");
384.262 + barrier3.await();
384.263 + }
384.264 + };
384.265 +
384.266 + Thread client2 = new Thread(new ChatConnection() {
384.267 + @Override
384.268 + public void run(Socket socket, BufferedReader reader, Writer writer) throws Exception {
384.269 + readAvailableString(reader);
384.270 + writer.write("testClient2\n");
384.271 + waitForJoin(reader, "testClient2");
384.272 + barrier1.await();
384.273 + writer.write("Hello world!\n");
384.274 + barrier2.await();
384.275 + String string = readAvailableString(reader);
384.276 + assertEqual(exceptions, string, "testClient1: Good morning!\n");
384.277 + barrier3.await();
384.278 + }
384.279 + });
384.280 +
384.281 + client2.start();
384.282 + chatConnection.run();
384.283 + chatConnection2.run();
384.284 + if (!exceptions.isEmpty()) {
384.285 + throw exceptions.get(0);
384.286 + }
384.287 + }
384.288 +
384.289 + private static void performTestUseName() throws Exception {
384.290 + final CyclicBarrier barrier1 = new CyclicBarrier(2);
384.291 + final CyclicBarrier barrier2 = new CyclicBarrier(2);
384.292 + final CyclicBarrier barrier3 = new CyclicBarrier(2);
384.293 + final List<Exception> exceptions = new ArrayList<Exception>();
384.294 +
384.295 + ChatConnection chatConnection = new ChatConnection() {
384.296 + @Override
384.297 + public void run(Socket socket, BufferedReader reader, Writer writer) throws Exception {
384.298 + String string = readAvailableString(reader);
384.299 + if (!"Name: ".equals(string)) {
384.300 + exceptions.add(new RuntimeException("Expected Name: "));
384.301 + }
384.302 + writer.write("testClient1\n");
384.303 + waitForJoin(reader, "testClient1");
384.304 + barrier1.await();
384.305 + barrier2.await();
384.306 + string = readAvailableString(reader);
384.307 + if (!"testClient2: Hello world!\n".equals(string)) {
384.308 + exceptions.add(new RuntimeException("testClient2: Hello world!\n"));
384.309 + }
384.310 + barrier3.await();
384.311 + }
384.312 + };
384.313 +
384.314 + Thread client2 = new Thread(new ChatConnection() {
384.315 + @Override
384.316 + public void run(Socket socket, BufferedReader reader, Writer writer) throws Exception {
384.317 + String string = readAvailableString(reader);
384.318 + if (!"Name: ".equals(string)) {
384.319 + exceptions.add(new RuntimeException("Expected Name: "));
384.320 + }
384.321 + writer.write("testClient2\n");
384.322 + waitForJoin(reader, "testClient2");
384.323 + barrier1.await();
384.324 + writer.write("Hello world!\n");
384.325 + barrier2.await();
384.326 + barrier3.await();
384.327 + }
384.328 + });
384.329 +
384.330 + client2.start();
384.331 + chatConnection.run();
384.332 + if (!exceptions.isEmpty()) {
384.333 + throw exceptions.get(0);
384.334 + }
384.335 + }
384.336 +
384.337 + private static String readAvailableString(Reader reader) throws IOException {
384.338 + return readAvailableString(reader, false);
384.339 + }
384.340 +
384.341 + private static String readAvailableString(Reader reader, boolean now) throws IOException {
384.342 + StringBuilder builder = new StringBuilder();
384.343 + int bytes;
384.344 + if (now && !reader.ready()) {
384.345 + return null;
384.346 + }
384.347 + do {
384.348 + char[] buf = new char[256];
384.349 + bytes = reader.read(buf);
384.350 + builder.append(buf, 0, bytes);
384.351 + } while (bytes == 256);
384.352 + return builder.toString();
384.353 + }
384.354 +
384.355 + private abstract static class ChatConnection implements Runnable {
384.356 + public Exception exception;
384.357 +
384.358 + @Override
384.359 + public void run() {
384.360 + try (Socket socket = new Socket("localhost", listeningPort);
384.361 + BufferedReader reader = new BufferedReader(new InputStreamReader(socket.getInputStream()));
384.362 + Writer writer = new FlushingWriter(new OutputStreamWriter(socket.getOutputStream()))) {
384.363 + socket.setTcpNoDelay(true);
384.364 +
384.365 + run(socket, reader, writer);
384.366 + } catch (Exception e) {
384.367 + exception = e;
384.368 + }
384.369 + }
384.370 +
384.371 + public abstract void run(Socket socket, BufferedReader reader, Writer writer) throws Exception;
384.372 + }
384.373 +
384.374 + private static class FlushingWriter extends Writer {
384.375 + public final Writer delegate;
384.376 +
384.377 + private FlushingWriter(Writer delegate) {
384.378 + this.delegate = delegate;
384.379 + }
384.380 +
384.381 + @Override
384.382 + public void write(char[] cbuf, int off, int len) throws IOException {
384.383 + delegate.write(cbuf, off, len);
384.384 + }
384.385 +
384.386 + @Override
384.387 + public void flush() throws IOException {
384.388 + delegate.flush();
384.389 + }
384.390 +
384.391 + @Override
384.392 + public void close() throws IOException {
384.393 + delegate.close();
384.394 + }
384.395 +
384.396 + @Override
384.397 + public void write(String str) throws IOException {
384.398 + super.write(str);
384.399 + flush();
384.400 + }
384.401 + }
384.402 +}
385.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
385.2 +++ b/test/sample/mergesort/MergeSortTest.java Tue Apr 26 15:48:03 2011 -0700
385.3 @@ -0,0 +1,102 @@
385.4 +/*
385.5 + * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved.
385.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
385.7 + *
385.8 + * This code is free software; you can redistribute it and/or modify it
385.9 + * under the terms of the GNU General Public License version 2 only, as
385.10 + * published by the Free Software Foundation.
385.11 + *
385.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
385.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
385.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
385.15 + * version 2 for more details (a copy is included in the LICENSE file that
385.16 + * accompanied this code).
385.17 + *
385.18 + * You should have received a copy of the GNU General Public License version
385.19 + * 2 along with this work; if not, write to the Free Software Foundation,
385.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
385.21 + *
385.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
385.23 + * or visit www.oracle.com if you need additional information or have any
385.24 + * questions.
385.25 + */
385.26 +
385.27 +
385.28 +/* @test
385.29 + * @summary Test MergeSort
385.30 + *
385.31 + * @library ../../../src/share/sample/forkjoin/mergesort
385.32 + * @build MergeSortTest MergeDemo MergeSort
385.33 + * @run main MergeSortTest
385.34 + */
385.35 +
385.36 +import java.util.Arrays;
385.37 +import java.util.Random;
385.38 +
385.39 +public class MergeSortTest {
385.40 + private Random random;
385.41 + private MergeSort target;
385.42 +
385.43 + public MergeSortTest(Random random, MergeSort target) {
385.44 + this.random = random;
385.45 + this.target = target;
385.46 + }
385.47 +
385.48 + public static void main(String[] args) {
385.49 + MergeSortTest test = new MergeSortTest(new Random(), new MergeSort(Runtime.getRuntime().availableProcessors() * 4));
385.50 + test.run();
385.51 + }
385.52 +
385.53 + private int[] generateArray(int elements) {
385.54 + int[] array = new int[elements];
385.55 + for (int i = 0; i < array.length; ++i) {
385.56 + array[i] = random.nextInt(10);
385.57 + }
385.58 + return array;
385.59 + }
385.60 +
385.61 + private void run() {
385.62 + testSort();
385.63 + testSortSingle();
385.64 + testSortEmpty();
385.65 + testLong();
385.66 + }
385.67 +
385.68 + public void testLong() {
385.69 + for (int i = 0; i < 1000; ++i) {
385.70 + int elements = 1 + i * 100;
385.71 +
385.72 + int[] array = generateArray(elements);
385.73 + int[] copy = Arrays.copyOf(array, array.length);
385.74 + Arrays.sort(copy);
385.75 + target.sort(array);
385.76 + assertEqual(copy, array);
385.77 + }
385.78 + }
385.79 +
385.80 + private void testSortEmpty() {
385.81 + int[] array = { };
385.82 + target.sort(array);
385.83 + assertEqual(new int[] { }, array);
385.84 + }
385.85 +
385.86 + private void testSortSingle() {
385.87 + int[] array = { 1 };
385.88 + target.sort(array);
385.89 + assertEqual(new int[] { 1 }, array);
385.90 + }
385.91 +
385.92 + private void testSort() {
385.93 + int[] array = { 7, 3, 9, 0, -6, 12, 54, 3, -6, 88, 1412};
385.94 + target.sort(array);
385.95 + assertEqual(new int[] { -6, -6, 0, 3, 3, 7, 9, 12, 54, 88, 1412 }, array);
385.96 + }
385.97 +
385.98 + private void assertEqual(int[] expected, int[] array) {
385.99 + if (!Arrays.equals(expected, array)) {
385.100 + throw new RuntimeException("Invalid sorted array!");
385.101 + }
385.102 + }
385.103 +
385.104 +
385.105 +}
386.1 --- a/test/sun/java2d/cmm/ColorConvertOp/ColConvCCMTest.java Tue Apr 19 16:01:27 2011 -0700
386.2 +++ b/test/sun/java2d/cmm/ColorConvertOp/ColConvCCMTest.java Tue Apr 26 15:48:03 2011 -0700
386.3 @@ -23,7 +23,7 @@
386.4
386.5 /**
386.6 * @test
386.7 - * @bug 6476665
386.8 + * @bug 6476665 7033534
386.9 * @summary Verifies color conversion of Component Color Model based images
386.10 * @run main ColConvCCMTest
386.11 */
387.1 --- a/test/sun/java2d/cmm/ColorConvertOp/MTColConvTest.java Tue Apr 19 16:01:27 2011 -0700
387.2 +++ b/test/sun/java2d/cmm/ColorConvertOp/MTColConvTest.java Tue Apr 26 15:48:03 2011 -0700
387.3 @@ -23,7 +23,7 @@
387.4
387.5 /**
387.6 * @test
387.7 - * @bug 6476665
387.8 + * @bug 6476665 7033534
387.9 * @summary Verifies MT safety of color conversion of Component and Direct Color Model based images
387.10 * @run main MTColConvTest
387.11 */
388.1 --- a/test/sun/net/InetAddress/nameservice/dns/cname.sh Tue Apr 19 16:01:27 2011 -0700
388.2 +++ b/test/sun/net/InetAddress/nameservice/dns/cname.sh Tue Apr 26 15:48:03 2011 -0700
388.3 @@ -1,7 +1,7 @@
388.4 #!/bin/sh
388.5
388.6 #
388.7 -# Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
388.8 +# Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
388.9 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
388.10 #
388.11 # This code is free software; you can redistribute it and/or modify it
388.12 @@ -26,16 +26,16 @@
388.13
388.14 # @test
388.15 # @bug 4763315
388.16 -# @build CanonicalName Lookup
388.17 +# @build CanonicalName Lookup
388.18 # @run shell/timeout=120 cname.sh
388.19 # @summary Test DNS provider's handling of CNAME records
388.20
388.21
388.22 # The host that we try to resolve
388.23
388.24 -HOST=webcache.sfbay.sun.com
388.25 +HOST=www-proxy.us.oracle.com
388.26
388.27 -# fail gracefully if DNS is not configured or there
388.28 +# fail gracefully if DNS is not configured or there
388.29 # isn't a CNAME record.
388.30
388.31 CLASSPATH=${TESTCLASSES}
388.32 @@ -43,7 +43,7 @@
388.33 JAVA="${TESTJAVA}/bin/java"
388.34
388.35 sh -xc "$JAVA CanonicalName $HOST" 2>&1
388.36 -if [ $? != 0 ]; then
388.37 +if [ $? != 0 ]; then
388.38 echo "DNS not configured or host doesn't resolve to CNAME record"
388.39 exit 0
388.40 fi
388.41 @@ -70,7 +70,7 @@
388.42 go "$np $sm" "$HOST"
388.43
388.44
388.45 -#
388.46 +#
388.47 # Results
388.48 #
388.49 echo ''
389.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
389.2 +++ b/test/sun/security/krb5/KrbCredSubKey.java Tue Apr 26 15:48:03 2011 -0700
389.3 @@ -0,0 +1,352 @@
389.4 +/*
389.5 + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
389.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
389.7 + *
389.8 + * This code is free software; you can redistribute it and/or modify it
389.9 + * under the terms of the GNU General Public License version 2 only, as
389.10 + * published by the Free Software Foundation.
389.11 + *
389.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
389.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
389.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
389.15 + * version 2 for more details (a copy is included in the LICENSE file that
389.16 + * accompanied this code).
389.17 + *
389.18 + * You should have received a copy of the GNU General Public License version
389.19 + * 2 along with this work; if not, write to the Free Software Foundation,
389.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
389.21 + *
389.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
389.23 + * or visit www.oracle.com if you need additional information or have any
389.24 + * questions.
389.25 + */
389.26 +
389.27 +/**
389.28 + * @test
389.29 + * @bug 7030180
389.30 + * @run main/othervm KrbCredSubKey
389.31 + * @summary AES 128/256 decrypt exception
389.32 + */
389.33 +
389.34 +import java.io.FileOutputStream;
389.35 +import java.security.PrivilegedExceptionAction;
389.36 +import javax.security.auth.Subject;
389.37 +import javax.security.auth.kerberos.KerberosKey;
389.38 +import javax.security.auth.kerberos.KerberosPrincipal;
389.39 +import org.ietf.jgss.GSSContext;
389.40 +import org.ietf.jgss.GSSCredential;
389.41 +import org.ietf.jgss.GSSManager;
389.42 +import sun.security.jgss.GSSUtil;
389.43 +import sun.security.krb5.Config;
389.44 +import sun.security.krb5.EncryptedData;
389.45 +
389.46 +public class KrbCredSubKey {
389.47 +
389.48 + public static void main(String[] args) throws Exception {
389.49 +
389.50 + // We don't care about clock difference
389.51 + new FileOutputStream("krb5.conf").write(
389.52 + "[libdefaults]\nclockskew=999999999".getBytes());
389.53 + System.setProperty("java.security.krb5.conf", "krb5.conf");
389.54 + Config.refresh();
389.55 +
389.56 + Subject subj = new Subject();
389.57 + KerberosPrincipal kp = new KerberosPrincipal(princ);
389.58 + KerberosKey kk = new KerberosKey(
389.59 + kp, key, EncryptedData.ETYPE_AES128_CTS_HMAC_SHA1_96, 0);
389.60 + subj.getPrincipals().add(kp);
389.61 + subj.getPrivateCredentials().add(kk);
389.62 +
389.63 + Subject.doAs(subj, new PrivilegedExceptionAction() {
389.64 + public Object run() throws Exception {
389.65 + GSSManager man = GSSManager.getInstance();
389.66 + GSSContext ctxt = man.createContext(man.createCredential(
389.67 + null, GSSCredential.INDEFINITE_LIFETIME,
389.68 + GSSUtil.GSS_KRB5_MECH_OID, GSSCredential.ACCEPT_ONLY));
389.69 + return ctxt.acceptSecContext(token, 0, token.length);
389.70 + }
389.71 + });
389.72 + }
389.73 +
389.74 + // All following data generated by myself on a test machine
389.75 +
389.76 + private static String princ = "server/host.rabbit.hole@RABBIT.HOLE";
389.77 +
389.78 + // A aes-128 key for princ
389.79 + private static byte[] key = {
389.80 + (byte)0x83, (byte)0xA1, (byte)0xD6, (byte)0xE2,
389.81 + (byte)0xC7, (byte)0x76, (byte)0xD5, (byte)0x24,
389.82 + (byte)0x63, (byte)0x9F, (byte)0xF9, (byte)0xFF,
389.83 + (byte)0x76, (byte)0x6D, (byte)0x26, (byte)0x30,
389.84 + };
389.85 +
389.86 + // A JGSS token generated by the first call of an initiator's
389.87 + // initSecContext, targetting princ, using the authenticator
389.88 + // subkey to encrypt the KRB_CRED inside AP_REQ
389.89 + private static byte[] token = {
389.90 + (byte)0x60, (byte)0x82, (byte)0x04, (byte)0x1C,
389.91 + (byte)0x06, (byte)0x09, (byte)0x2A, (byte)0x86,
389.92 + (byte)0x48, (byte)0x86, (byte)0xF7, (byte)0x12,
389.93 + (byte)0x01, (byte)0x02, (byte)0x02, (byte)0x01,
389.94 + (byte)0x00, (byte)0x6E, (byte)0x82, (byte)0x04,
389.95 + (byte)0x0B, (byte)0x30, (byte)0x82, (byte)0x04,
389.96 + (byte)0x07, (byte)0xA0, (byte)0x03, (byte)0x02,
389.97 + (byte)0x01, (byte)0x05, (byte)0xA1, (byte)0x03,
389.98 + (byte)0x02, (byte)0x01, (byte)0x0E, (byte)0xA2,
389.99 + (byte)0x07, (byte)0x03, (byte)0x05, (byte)0x00,
389.100 + (byte)0x20, (byte)0x00, (byte)0x00, (byte)0x00,
389.101 + (byte)0xA3, (byte)0x82, (byte)0x01, (byte)0x04,
389.102 + (byte)0x61, (byte)0x82, (byte)0x01, (byte)0x00,
389.103 + (byte)0x30, (byte)0x81, (byte)0xFD, (byte)0xA0,
389.104 + (byte)0x03, (byte)0x02, (byte)0x01, (byte)0x05,
389.105 + (byte)0xA1, (byte)0x0D, (byte)0x1B, (byte)0x0B,
389.106 + (byte)0x52, (byte)0x41, (byte)0x42, (byte)0x42,
389.107 + (byte)0x49, (byte)0x54, (byte)0x2E, (byte)0x48,
389.108 + (byte)0x4F, (byte)0x4C, (byte)0x45, (byte)0xA2,
389.109 + (byte)0x25, (byte)0x30, (byte)0x23, (byte)0xA0,
389.110 + (byte)0x03, (byte)0x02, (byte)0x01, (byte)0x00,
389.111 + (byte)0xA1, (byte)0x1C, (byte)0x30, (byte)0x1A,
389.112 + (byte)0x1B, (byte)0x06, (byte)0x73, (byte)0x65,
389.113 + (byte)0x72, (byte)0x76, (byte)0x65, (byte)0x72,
389.114 + (byte)0x1B, (byte)0x10, (byte)0x68, (byte)0x6F,
389.115 + (byte)0x73, (byte)0x74, (byte)0x2E, (byte)0x72,
389.116 + (byte)0x61, (byte)0x62, (byte)0x62, (byte)0x69,
389.117 + (byte)0x74, (byte)0x2E, (byte)0x68, (byte)0x6F,
389.118 + (byte)0x6C, (byte)0x65, (byte)0xA3, (byte)0x81,
389.119 + (byte)0xBF, (byte)0x30, (byte)0x81, (byte)0xBC,
389.120 + (byte)0xA0, (byte)0x03, (byte)0x02, (byte)0x01,
389.121 + (byte)0x11, (byte)0xA2, (byte)0x81, (byte)0xB4,
389.122 + (byte)0x04, (byte)0x81, (byte)0xB1, (byte)0xA7,
389.123 + (byte)0xE8, (byte)0x58, (byte)0xBA, (byte)0x98,
389.124 + (byte)0x69, (byte)0x45, (byte)0xB3, (byte)0x68,
389.125 + (byte)0xBF, (byte)0xFD, (byte)0x25, (byte)0x74,
389.126 + (byte)0xC4, (byte)0x2E, (byte)0x09, (byte)0x7B,
389.127 + (byte)0x3C, (byte)0x7F, (byte)0xA5, (byte)0x6C,
389.128 + (byte)0xC3, (byte)0x86, (byte)0xC9, (byte)0xEE,
389.129 + (byte)0x58, (byte)0xD3, (byte)0x7C, (byte)0xD6,
389.130 + (byte)0x19, (byte)0xA1, (byte)0x3B, (byte)0xF7,
389.131 + (byte)0x17, (byte)0xD6, (byte)0x18, (byte)0xA9,
389.132 + (byte)0x58, (byte)0x43, (byte)0x55, (byte)0xD6,
389.133 + (byte)0xBA, (byte)0x85, (byte)0xF7, (byte)0x6B,
389.134 + (byte)0x20, (byte)0x01, (byte)0xEF, (byte)0xB4,
389.135 + (byte)0x74, (byte)0x0B, (byte)0x31, (byte)0x07,
389.136 + (byte)0x55, (byte)0xD8, (byte)0x8C, (byte)0x85,
389.137 + (byte)0x25, (byte)0x12, (byte)0x66, (byte)0x85,
389.138 + (byte)0xA8, (byte)0x5A, (byte)0x84, (byte)0xB2,
389.139 + (byte)0x6C, (byte)0xDE, (byte)0xEE, (byte)0xF9,
389.140 + (byte)0x15, (byte)0xF2, (byte)0xBC, (byte)0xB0,
389.141 + (byte)0x43, (byte)0xA5, (byte)0x21, (byte)0x31,
389.142 + (byte)0xFA, (byte)0x2F, (byte)0x2C, (byte)0x37,
389.143 + (byte)0x39, (byte)0xD8, (byte)0xAA, (byte)0xE0,
389.144 + (byte)0x78, (byte)0x08, (byte)0x18, (byte)0xFB,
389.145 + (byte)0x03, (byte)0x43, (byte)0x22, (byte)0xE6,
389.146 + (byte)0x2C, (byte)0xF2, (byte)0x98, (byte)0xDC,
389.147 + (byte)0x2A, (byte)0xDE, (byte)0x8C, (byte)0x95,
389.148 + (byte)0x0B, (byte)0xB6, (byte)0xE6, (byte)0x0F,
389.149 + (byte)0xB5, (byte)0x4E, (byte)0xAD, (byte)0xAC,
389.150 + (byte)0xD1, (byte)0x4C, (byte)0xE8, (byte)0x22,
389.151 + (byte)0x93, (byte)0x38, (byte)0xA2, (byte)0x44,
389.152 + (byte)0x0E, (byte)0x83, (byte)0x9E, (byte)0x4D,
389.153 + (byte)0xC0, (byte)0x1A, (byte)0x02, (byte)0xB2,
389.154 + (byte)0xB8, (byte)0xCE, (byte)0xDF, (byte)0xB5,
389.155 + (byte)0xFB, (byte)0xF2, (byte)0x75, (byte)0x5E,
389.156 + (byte)0x74, (byte)0xC1, (byte)0x90, (byte)0x82,
389.157 + (byte)0x60, (byte)0x00, (byte)0xA5, (byte)0xC3,
389.158 + (byte)0xBF, (byte)0x66, (byte)0x97, (byte)0x0E,
389.159 + (byte)0xF3, (byte)0x9F, (byte)0xB3, (byte)0xD9,
389.160 + (byte)0x51, (byte)0x51, (byte)0x38, (byte)0xBC,
389.161 + (byte)0xD9, (byte)0xC1, (byte)0xD0, (byte)0x1E,
389.162 + (byte)0x90, (byte)0x9B, (byte)0x43, (byte)0xEE,
389.163 + (byte)0xD9, (byte)0xD6, (byte)0x3E, (byte)0x31,
389.164 + (byte)0xEA, (byte)0x8E, (byte)0xB1, (byte)0xDC,
389.165 + (byte)0xDE, (byte)0xFD, (byte)0xA4, (byte)0x77,
389.166 + (byte)0x6C, (byte)0x4A, (byte)0x81, (byte)0x1F,
389.167 + (byte)0xA4, (byte)0x82, (byte)0x02, (byte)0xE8,
389.168 + (byte)0x30, (byte)0x82, (byte)0x02, (byte)0xE4,
389.169 + (byte)0xA0, (byte)0x03, (byte)0x02, (byte)0x01,
389.170 + (byte)0x11, (byte)0xA2, (byte)0x82, (byte)0x02,
389.171 + (byte)0xDB, (byte)0x04, (byte)0x82, (byte)0x02,
389.172 + (byte)0xD7, (byte)0x81, (byte)0x78, (byte)0x25,
389.173 + (byte)0x75, (byte)0x92, (byte)0x7A, (byte)0xEC,
389.174 + (byte)0xBE, (byte)0x31, (byte)0xF1, (byte)0x50,
389.175 + (byte)0xE7, (byte)0xC1, (byte)0x32, (byte)0xA5,
389.176 + (byte)0xCB, (byte)0x34, (byte)0x46, (byte)0x95,
389.177 + (byte)0x2B, (byte)0x84, (byte)0xB7, (byte)0x06,
389.178 + (byte)0x0E, (byte)0x15, (byte)0x02, (byte)0x74,
389.179 + (byte)0xCA, (byte)0x18, (byte)0x5D, (byte)0xE8,
389.180 + (byte)0x0E, (byte)0x1B, (byte)0xB7, (byte)0x77,
389.181 + (byte)0x5A, (byte)0x6C, (byte)0xFB, (byte)0x94,
389.182 + (byte)0x82, (byte)0x2B, (byte)0xE6, (byte)0x14,
389.183 + (byte)0x0C, (byte)0xDA, (byte)0x22, (byte)0xA2,
389.184 + (byte)0x42, (byte)0xD7, (byte)0xB0, (byte)0xFC,
389.185 + (byte)0xCA, (byte)0x4A, (byte)0xEA, (byte)0xB8,
389.186 + (byte)0x92, (byte)0xB5, (byte)0x8C, (byte)0x71,
389.187 + (byte)0xED, (byte)0x2B, (byte)0x46, (byte)0xC5,
389.188 + (byte)0xE5, (byte)0x47, (byte)0x76, (byte)0x29,
389.189 + (byte)0x27, (byte)0x0F, (byte)0xFF, (byte)0x03,
389.190 + (byte)0x72, (byte)0x13, (byte)0xAA, (byte)0xDB,
389.191 + (byte)0x4E, (byte)0xFF, (byte)0x48, (byte)0x36,
389.192 + (byte)0xAB, (byte)0x73, (byte)0xD7, (byte)0xDA,
389.193 + (byte)0xF1, (byte)0x80, (byte)0x1B, (byte)0x5B,
389.194 + (byte)0x9A, (byte)0x88, (byte)0x07, (byte)0x47,
389.195 + (byte)0x43, (byte)0x27, (byte)0xD5, (byte)0x00,
389.196 + (byte)0x04, (byte)0xEE, (byte)0xAF, (byte)0x53,
389.197 + (byte)0x5C, (byte)0xCC, (byte)0x2C, (byte)0xC7,
389.198 + (byte)0x2F, (byte)0x94, (byte)0x12, (byte)0x86,
389.199 + (byte)0xEF, (byte)0xAC, (byte)0xB1, (byte)0x6C,
389.200 + (byte)0xB0, (byte)0xB5, (byte)0x3D, (byte)0x92,
389.201 + (byte)0xBD, (byte)0xBE, (byte)0x7B, (byte)0x1A,
389.202 + (byte)0x39, (byte)0x4A, (byte)0x1E, (byte)0x91,
389.203 + (byte)0xA4, (byte)0xDF, (byte)0x82, (byte)0x12,
389.204 + (byte)0x2E, (byte)0x67, (byte)0x17, (byte)0x92,
389.205 + (byte)0xB3, (byte)0x93, (byte)0x38, (byte)0x32,
389.206 + (byte)0x94, (byte)0xF5, (byte)0xF7, (byte)0x09,
389.207 + (byte)0x07, (byte)0x5E, (byte)0x21, (byte)0x12,
389.208 + (byte)0x70, (byte)0x37, (byte)0xAF, (byte)0x5A,
389.209 + (byte)0x2D, (byte)0xAC, (byte)0xFF, (byte)0x22,
389.210 + (byte)0x46, (byte)0xA0, (byte)0x12, (byte)0x74,
389.211 + (byte)0x1C, (byte)0xA1, (byte)0x68, (byte)0xC3,
389.212 + (byte)0x64, (byte)0xDB, (byte)0xC3, (byte)0x9F,
389.213 + (byte)0xAB, (byte)0x0E, (byte)0x19, (byte)0xFE,
389.214 + (byte)0xD9, (byte)0xA4, (byte)0xAA, (byte)0x7B,
389.215 + (byte)0x73, (byte)0xAD, (byte)0xC8, (byte)0xA8,
389.216 + (byte)0xD5, (byte)0x29, (byte)0xAD, (byte)0x1F,
389.217 + (byte)0xEF, (byte)0x54, (byte)0xAE, (byte)0x72,
389.218 + (byte)0x02, (byte)0xD9, (byte)0x06, (byte)0x0D,
389.219 + (byte)0x1A, (byte)0x94, (byte)0x7B, (byte)0xBC,
389.220 + (byte)0x32, (byte)0x9A, (byte)0xBC, (byte)0x4B,
389.221 + (byte)0x33, (byte)0xC2, (byte)0x02, (byte)0xA3,
389.222 + (byte)0xF4, (byte)0xB1, (byte)0xED, (byte)0x76,
389.223 + (byte)0x0D, (byte)0x59, (byte)0xCD, (byte)0x56,
389.224 + (byte)0xCB, (byte)0xDC, (byte)0xCE, (byte)0xED,
389.225 + (byte)0xFF, (byte)0x25, (byte)0x84, (byte)0x5E,
389.226 + (byte)0x41, (byte)0xF9, (byte)0x42, (byte)0xBE,
389.227 + (byte)0x73, (byte)0xAC, (byte)0xA2, (byte)0x20,
389.228 + (byte)0x97, (byte)0xB7, (byte)0x88, (byte)0x77,
389.229 + (byte)0x65, (byte)0x43, (byte)0x9F, (byte)0xEE,
389.230 + (byte)0xF4, (byte)0x3A, (byte)0x7E, (byte)0x9B,
389.231 + (byte)0x5B, (byte)0x54, (byte)0xD3, (byte)0x0D,
389.232 + (byte)0x50, (byte)0x6D, (byte)0xF6, (byte)0x14,
389.233 + (byte)0xB7, (byte)0x5A, (byte)0x34, (byte)0x0F,
389.234 + (byte)0x1F, (byte)0xC7, (byte)0x39, (byte)0x99,
389.235 + (byte)0x9B, (byte)0x96, (byte)0xE3, (byte)0xAD,
389.236 + (byte)0x86, (byte)0xE3, (byte)0x6A, (byte)0x71,
389.237 + (byte)0x63, (byte)0x04, (byte)0xAD, (byte)0x9C,
389.238 + (byte)0x17, (byte)0x68, (byte)0x44, (byte)0xFE,
389.239 + (byte)0x21, (byte)0x62, (byte)0xD5, (byte)0x99,
389.240 + (byte)0x4A, (byte)0xDF, (byte)0x48, (byte)0xDE,
389.241 + (byte)0x9A, (byte)0xD4, (byte)0xBB, (byte)0xA1,
389.242 + (byte)0x9B, (byte)0xE7, (byte)0x2A, (byte)0x08,
389.243 + (byte)0x80, (byte)0x3A, (byte)0x08, (byte)0xA4,
389.244 + (byte)0xBA, (byte)0xBE, (byte)0x1E, (byte)0x81,
389.245 + (byte)0x63, (byte)0x20, (byte)0xAC, (byte)0x9C,
389.246 + (byte)0x42, (byte)0x2F, (byte)0xCA, (byte)0x06,
389.247 + (byte)0x95, (byte)0x92, (byte)0x97, (byte)0x09,
389.248 + (byte)0x3C, (byte)0x0C, (byte)0x5A, (byte)0x99,
389.249 + (byte)0xFB, (byte)0xAB, (byte)0xEB, (byte)0xDE,
389.250 + (byte)0xC4, (byte)0x09, (byte)0xD3, (byte)0xA3,
389.251 + (byte)0xF0, (byte)0x65, (byte)0xDC, (byte)0x5F,
389.252 + (byte)0xAA, (byte)0xBB, (byte)0x28, (byte)0xC0,
389.253 + (byte)0x3E, (byte)0xBF, (byte)0x77, (byte)0xAE,
389.254 + (byte)0xCC, (byte)0x3A, (byte)0xD3, (byte)0x31,
389.255 + (byte)0x0D, (byte)0x9B, (byte)0x96, (byte)0xEF,
389.256 + (byte)0x2C, (byte)0xED, (byte)0x60, (byte)0x63,
389.257 + (byte)0xC5, (byte)0x8F, (byte)0xCA, (byte)0xB0,
389.258 + (byte)0xA2, (byte)0x0B, (byte)0x49, (byte)0x5A,
389.259 + (byte)0xB2, (byte)0x8F, (byte)0xEF, (byte)0xE4,
389.260 + (byte)0x19, (byte)0xC0, (byte)0xC6, (byte)0x2D,
389.261 + (byte)0xD3, (byte)0x4F, (byte)0xB2, (byte)0xED,
389.262 + (byte)0xA3, (byte)0xA4, (byte)0x6F, (byte)0xAE,
389.263 + (byte)0xD4, (byte)0xE9, (byte)0xA2, (byte)0x5A,
389.264 + (byte)0xFB, (byte)0xB0, (byte)0x14, (byte)0xBD,
389.265 + (byte)0x06, (byte)0x12, (byte)0xD7, (byte)0x91,
389.266 + (byte)0x15, (byte)0x46, (byte)0x78, (byte)0xE4,
389.267 + (byte)0xD1, (byte)0x73, (byte)0xCA, (byte)0xA5,
389.268 + (byte)0xA5, (byte)0x64, (byte)0xC8, (byte)0x6F,
389.269 + (byte)0xD1, (byte)0xBD, (byte)0xEA, (byte)0x74,
389.270 + (byte)0xE4, (byte)0xCA, (byte)0x40, (byte)0x16,
389.271 + (byte)0x9E, (byte)0x46, (byte)0x7C, (byte)0x25,
389.272 + (byte)0x6C, (byte)0x32, (byte)0xB4, (byte)0x14,
389.273 + (byte)0xF9, (byte)0x26, (byte)0x8A, (byte)0x3A,
389.274 + (byte)0xDD, (byte)0x51, (byte)0x26, (byte)0x79,
389.275 + (byte)0x43, (byte)0x27, (byte)0x2E, (byte)0xED,
389.276 + (byte)0xC7, (byte)0x82, (byte)0x7C, (byte)0xCE,
389.277 + (byte)0x43, (byte)0x03, (byte)0x60, (byte)0x2A,
389.278 + (byte)0x9C, (byte)0xB2, (byte)0x71, (byte)0x41,
389.279 + (byte)0xAB, (byte)0x3D, (byte)0xA6, (byte)0xB5,
389.280 + (byte)0x51, (byte)0xBC, (byte)0x80, (byte)0x1F,
389.281 + (byte)0x96, (byte)0x73, (byte)0x23, (byte)0x11,
389.282 + (byte)0xED, (byte)0xC0, (byte)0x1D, (byte)0x0B,
389.283 + (byte)0xA0, (byte)0x13, (byte)0xB3, (byte)0x2F,
389.284 + (byte)0x16, (byte)0x59, (byte)0x64, (byte)0x45,
389.285 + (byte)0xE8, (byte)0x68, (byte)0xFB, (byte)0xF9,
389.286 + (byte)0x6F, (byte)0xB0, (byte)0x2B, (byte)0xFB,
389.287 + (byte)0x39, (byte)0xBB, (byte)0x53, (byte)0x8F,
389.288 + (byte)0xD2, (byte)0xAF, (byte)0x38, (byte)0x5E,
389.289 + (byte)0xEF, (byte)0x5B, (byte)0xE2, (byte)0x98,
389.290 + (byte)0xE8, (byte)0x46, (byte)0x3C, (byte)0x03,
389.291 + (byte)0x71, (byte)0x46, (byte)0x8D, (byte)0x41,
389.292 + (byte)0x92, (byte)0x32, (byte)0x85, (byte)0x8D,
389.293 + (byte)0xBA, (byte)0x33, (byte)0x05, (byte)0xB1,
389.294 + (byte)0xE4, (byte)0x56, (byte)0x3E, (byte)0xF5,
389.295 + (byte)0x20, (byte)0x35, (byte)0xA6, (byte)0x74,
389.296 + (byte)0xA2, (byte)0xBE, (byte)0x54, (byte)0x08,
389.297 + (byte)0xB4, (byte)0xFC, (byte)0x1D, (byte)0x13,
389.298 + (byte)0x84, (byte)0xBE, (byte)0x1C, (byte)0xC5,
389.299 + (byte)0x3E, (byte)0x43, (byte)0x14, (byte)0x6F,
389.300 + (byte)0xC0, (byte)0x3D, (byte)0xF4, (byte)0xDC,
389.301 + (byte)0x66, (byte)0x4E, (byte)0xF0, (byte)0x3E,
389.302 + (byte)0xD4, (byte)0xC6, (byte)0xE9, (byte)0x8D,
389.303 + (byte)0x7D, (byte)0xB9, (byte)0xDC, (byte)0x9F,
389.304 + (byte)0xBE, (byte)0x54, (byte)0x63, (byte)0x93,
389.305 + (byte)0x49, (byte)0x2F, (byte)0x6A, (byte)0xC3,
389.306 + (byte)0x34, (byte)0xC5, (byte)0xF7, (byte)0x76,
389.307 + (byte)0xE8, (byte)0xD5, (byte)0x5B, (byte)0xD9,
389.308 + (byte)0x41, (byte)0xCA, (byte)0x74, (byte)0x25,
389.309 + (byte)0x25, (byte)0x09, (byte)0xF4, (byte)0xD3,
389.310 + (byte)0x00, (byte)0x9F, (byte)0x7D, (byte)0xFB,
389.311 + (byte)0x3D, (byte)0xAB, (byte)0x87, (byte)0xF7,
389.312 + (byte)0xCE, (byte)0x42, (byte)0x0F, (byte)0x60,
389.313 + (byte)0xEB, (byte)0x03, (byte)0x47, (byte)0x98,
389.314 + (byte)0x0F, (byte)0xEB, (byte)0xA4, (byte)0x05,
389.315 + (byte)0xE2, (byte)0x58, (byte)0x8F, (byte)0x44,
389.316 + (byte)0x09, (byte)0xD3, (byte)0x66, (byte)0x1E,
389.317 + (byte)0x69, (byte)0x89, (byte)0xB7, (byte)0xEE,
389.318 + (byte)0x8B, (byte)0xA4, (byte)0x8E, (byte)0x05,
389.319 + (byte)0x2D, (byte)0x2E, (byte)0xB3, (byte)0x5A,
389.320 + (byte)0xAE, (byte)0xAB, (byte)0x80, (byte)0xD6,
389.321 + (byte)0x5C, (byte)0x93, (byte)0x40, (byte)0x91,
389.322 + (byte)0x53, (byte)0xE6, (byte)0x13, (byte)0xD5,
389.323 + (byte)0x2F, (byte)0x64, (byte)0xF0, (byte)0x68,
389.324 + (byte)0xD2, (byte)0x85, (byte)0x94, (byte)0xE5,
389.325 + (byte)0x2D, (byte)0x73, (byte)0x10, (byte)0x59,
389.326 + (byte)0x18, (byte)0xCD, (byte)0xED, (byte)0xBC,
389.327 + (byte)0x05, (byte)0x97, (byte)0xFD, (byte)0xE7,
389.328 + (byte)0x6F, (byte)0x5D, (byte)0x7C, (byte)0x46,
389.329 + (byte)0x28, (byte)0x5F, (byte)0xC2, (byte)0xB4,
389.330 + (byte)0x31, (byte)0xA5, (byte)0x2B, (byte)0x82,
389.331 + (byte)0xAB, (byte)0x32, (byte)0x49, (byte)0xA5,
389.332 + (byte)0xCD, (byte)0x91, (byte)0x37, (byte)0x97,
389.333 + (byte)0xA1, (byte)0x85, (byte)0x8F, (byte)0xBB,
389.334 + (byte)0x6E, (byte)0x1E, (byte)0x9F, (byte)0xFC,
389.335 + (byte)0x10, (byte)0x3B, (byte)0x8A, (byte)0xF6,
389.336 + (byte)0x9A, (byte)0x66, (byte)0xBD, (byte)0x75,
389.337 + (byte)0x4F, (byte)0x1D, (byte)0xBA, (byte)0x64,
389.338 + (byte)0x15, (byte)0xDD, (byte)0x9F, (byte)0x00,
389.339 + (byte)0x6C, (byte)0x2F, (byte)0x87, (byte)0x20,
389.340 + (byte)0x25, (byte)0xA2, (byte)0x09, (byte)0x9F,
389.341 + (byte)0x5D, (byte)0x64, (byte)0xC9, (byte)0xA8,
389.342 + (byte)0x32, (byte)0x59, (byte)0x90, (byte)0x1D,
389.343 + (byte)0x78, (byte)0xFE, (byte)0x5A, (byte)0xA2,
389.344 + (byte)0x1F, (byte)0x9B, (byte)0x22, (byte)0xBE,
389.345 + (byte)0x8F, (byte)0xEA, (byte)0x59, (byte)0x5B,
389.346 + (byte)0x96, (byte)0xE3, (byte)0x4A, (byte)0xB2,
389.347 + (byte)0x71, (byte)0x65, (byte)0xB7, (byte)0x3C,
389.348 + (byte)0xC6, (byte)0x1B, (byte)0xD6, (byte)0x80,
389.349 + (byte)0x90, (byte)0xD2, (byte)0xF2, (byte)0x6F,
389.350 + (byte)0xA2, (byte)0x68, (byte)0x53, (byte)0xC0,
389.351 + (byte)0x44, (byte)0xAF, (byte)0xD4, (byte)0x68,
389.352 + (byte)0x12, (byte)0xFF, (byte)0xB4, (byte)0x36,
389.353 + (byte)0x34, (byte)0x43, (byte)0xAC, (byte)0x1C,
389.354 + };
389.355 +}
390.1 --- a/test/sun/security/krb5/auto/KDC.java Tue Apr 19 16:01:27 2011 -0700
390.2 +++ b/test/sun/security/krb5/auto/KDC.java Tue Apr 26 15:48:03 2011 -0700
390.3 @@ -691,7 +691,10 @@
390.4 new KerberosTime(new Date()),
390.5 body.from,
390.6 till, body.rtime,
390.7 - body.addresses,
390.8 + body.addresses != null // always set caddr
390.9 + ? body.addresses
390.10 + : new HostAddresses(
390.11 + new InetAddress[]{InetAddress.getLocalHost()}),
390.12 null);
390.13 EncryptionKey skey = keyForUser(body.sname, e3, true);
390.14 if (skey == null) {
390.15 @@ -716,7 +719,10 @@
390.16 till, body.rtime,
390.17 body.crealm,
390.18 body.sname,
390.19 - body.addresses
390.20 + body.addresses != null // always set caddr
390.21 + ? body.addresses
390.22 + : new HostAddresses(
390.23 + new InetAddress[]{InetAddress.getLocalHost()})
390.24 );
390.25 EncryptedData edata = new EncryptedData(ckey, enc_part.asn1Encode(), KeyUsage.KU_ENC_TGS_REP_PART_SESSKEY);
390.26 TGSRep tgsRep = new TGSRep(null,
391.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
391.2 +++ b/test/sun/security/krb5/auto/NoAddresses.java Tue Apr 26 15:48:03 2011 -0700
391.3 @@ -0,0 +1,81 @@
391.4 +/*
391.5 + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
391.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
391.7 + *
391.8 + * This code is free software; you can redistribute it and/or modify it
391.9 + * under the terms of the GNU General Public License version 2 only, as
391.10 + * published by the Free Software Foundation.
391.11 + *
391.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
391.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
391.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
391.15 + * version 2 for more details (a copy is included in the LICENSE file that
391.16 + * accompanied this code).
391.17 + *
391.18 + * You should have received a copy of the GNU General Public License version
391.19 + * 2 along with this work; if not, write to the Free Software Foundation,
391.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
391.21 + *
391.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
391.23 + * or visit www.oracle.com if you need additional information or have any
391.24 + * questions.
391.25 + */
391.26 +
391.27 +/*
391.28 + * @test
391.29 + * @bug 7032354
391.30 + * @run main/othervm NoAddresses 1
391.31 + * @run main/othervm NoAddresses 2
391.32 + * @run main/othervm/fail NoAddresses 3
391.33 + * @summary no-addresses should not be used on acceptor side
391.34 + */
391.35 +
391.36 +import java.net.InetAddress;
391.37 +import org.ietf.jgss.ChannelBinding;
391.38 +import sun.security.jgss.GSSUtil;
391.39 +import sun.security.krb5.Config;
391.40 +
391.41 +public class NoAddresses {
391.42 +
391.43 + public static void main(String[] args)
391.44 + throws Exception {
391.45 +
391.46 + OneKDC kdc = new OneKDC(null);
391.47 + kdc.writeJAASConf();
391.48 + KDC.saveConfig(OneKDC.KRB5_CONF, kdc,
391.49 + "noaddresses = false",
391.50 + "default_keytab_name = " + OneKDC.KTAB);
391.51 + Config.refresh();
391.52 +
391.53 + Context c = Context.fromJAAS("client");
391.54 + Context s = Context.fromJAAS("server");
391.55 +
391.56 + c.startAsClient(OneKDC.SERVER, GSSUtil.GSS_KRB5_MECH_OID);
391.57 + s.startAsServer(GSSUtil.GSS_KRB5_MECH_OID);
391.58 +
391.59 + InetAddress initiator = InetAddress.getLocalHost();
391.60 + InetAddress acceptor = InetAddress.getLocalHost();
391.61 + switch (args[0]) {
391.62 + case "1":
391.63 + // no initiator host address available, should be OK
391.64 + break;
391.65 + case "2":
391.66 + // correct initiator host address, still fine
391.67 + c.x().setChannelBinding(
391.68 + new ChannelBinding(initiator, acceptor, null));
391.69 + s.x().setChannelBinding(
391.70 + new ChannelBinding(initiator, acceptor, null));
391.71 + break;
391.72 + case "3":
391.73 + // incorrect initiator host address, fail
391.74 + initiator = InetAddress.getByAddress(new byte[]{1,1,1,1});
391.75 + c.x().setChannelBinding(
391.76 + new ChannelBinding(initiator, acceptor, null));
391.77 + s.x().setChannelBinding(
391.78 + new ChannelBinding(initiator, acceptor, null));
391.79 + break;
391.80 + }
391.81 +
391.82 + Context.handshake(c, s);
391.83 + }
391.84 +}
392.1 --- a/test/sun/security/pkcs11/Provider/ConfigShortPath.java Tue Apr 19 16:01:27 2011 -0700
392.2 +++ b/test/sun/security/pkcs11/Provider/ConfigShortPath.java Tue Apr 26 15:48:03 2011 -0700
392.3 @@ -1,5 +1,5 @@
392.4 /*
392.5 - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
392.6 + * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
392.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
392.8 *
392.9 * This code is free software; you can redistribute it and/or modify it
392.10 @@ -22,27 +22,44 @@
392.11 */
392.12 /**
392.13 * @test
392.14 - * @bug 6581254
392.15 - * @summary Allow "~" in config to support windows short path
392.16 + * @bug 6581254 6986789
392.17 + * @summary Allow '~' and '+' in config file
392.18 * @author Valerie Peng
392.19 */
392.20
392.21 import java.security.*;
392.22 import java.io.*;
392.23 +import java.lang.reflect.*;
392.24
392.25 public class ConfigShortPath {
392.26
392.27 - public static void main(String[] args) {
392.28 + private static final String[] configNames = { "csp.cfg", "cspPlus.cfg" };
392.29 +
392.30 + public static void main(String[] args) throws Exception {
392.31 + Constructor cons = null;
392.32 + try {
392.33 + Class clazz = Class.forName("sun.security.pkcs11.SunPKCS11");
392.34 + cons = clazz.getConstructor(String.class);
392.35 + } catch (Exception ex) {
392.36 + System.out.println("Skipping test - no PKCS11 provider available");
392.37 + return;
392.38 + }
392.39 String testSrc = System.getProperty("test.src", ".");
392.40 - String configFile = testSrc + File.separator + "csp.cfg";
392.41 - System.out.println("Testing against " + configFile);
392.42 - try {
392.43 - Provider p = new sun.security.pkcs11.SunPKCS11(configFile);
392.44 - } catch (ProviderException pe) {
392.45 - String cause = pe.getCause().getMessage();
392.46 - if (cause.indexOf("Unexpected token") != -1) {
392.47 - // re-throw to indicate test failure
392.48 - throw pe;
392.49 + for (int i = 0; i < configNames.length; i++) {
392.50 + String configFile = testSrc + File.separator + configNames[i];
392.51 +
392.52 + System.out.println("Testing against " + configFile);
392.53 + try {
392.54 + Object obj = cons.newInstance(configFile);
392.55 + } catch (InvocationTargetException ite) {
392.56 + Throwable cause = ite.getCause();
392.57 + if (cause instanceof ProviderException) {
392.58 + String causeMsg = cause.getCause().getMessage();
392.59 + // Indicate failure if due to parsing config
392.60 + if (causeMsg.indexOf("Unexpected token") != -1) {
392.61 + throw (ProviderException) cause;
392.62 + }
392.63 + }
392.64 }
392.65 }
392.66 }
393.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
393.2 +++ b/test/sun/security/pkcs11/Provider/cspPlus.cfg Tue Apr 26 15:48:03 2011 -0700
393.3 @@ -0,0 +1,4 @@
393.4 +showInfo = false
393.5 +name = NSS
393.6 +nssSecmodDirectory = /export/local/38289.JDK7.PIT.JSN-TL+7-b112_pit_security_oel5.5-x64-32/results/ResultDir/KeytoolNSS/db
393.7 +nssLibraryDirectory = /export/local/common/testbase/7/security/tools/lib/nss/Linux2.6
394.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
394.2 +++ b/test/sun/security/ssl/javax/net/ssl/SSLContextVersion.java Tue Apr 26 15:48:03 2011 -0700
394.3 @@ -0,0 +1,112 @@
394.4 +/*
394.5 + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
394.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
394.7 + *
394.8 + * This code is free software; you can redistribute it and/or modify it
394.9 + * under the terms of the GNU General Public License version 2 only, as
394.10 + * published by the Free Software Foundation.
394.11 + *
394.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
394.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
394.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
394.15 + * version 2 for more details (a copy is included in the LICENSE file that
394.16 + * accompanied this code).
394.17 + *
394.18 + * You should have received a copy of the GNU General Public License version
394.19 + * 2 along with this work; if not, write to the Free Software Foundation,
394.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
394.21 + *
394.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
394.23 + * or visit www.oracle.com if you need additional information or have any
394.24 + * questions.
394.25 + */
394.26 +
394.27 +/*
394.28 + * @test
394.29 + * @bug 6976117
394.30 + * @summary SSLContext.getInstance("TLSv1.1") returns SSLEngines/SSLSockets
394.31 + * without TLSv1.1 enabled
394.32 + */
394.33 +
394.34 +import javax.net.ssl.*;
394.35 +
394.36 +public class SSLContextVersion {
394.37 + static enum ContextVersion {
394.38 + TLS_CV_01("SSL", "TLSv1", "TLSv1.2"),
394.39 + TLS_CV_02("TLS", "TLSv1", "TLSv1.2"),
394.40 + TLS_CV_03("SSLv3", "TLSv1", "TLSv1.2"),
394.41 + TLS_CV_04("TLSv1", "TLSv1", "TLSv1.2"),
394.42 + TLS_CV_05("TLSv1.1", "TLSv1.1", "TLSv1.2"),
394.43 + TLS_CV_06("TLSv1.2", "TLSv1.2", "TLSv1.2"),
394.44 + TLS_CV_07("Default", "TLSv1", "TLSv1.2");
394.45 +
394.46 + final String contextVersion;
394.47 + final String defaultProtocolVersion;
394.48 + final String supportedProtocolVersion;
394.49 +
394.50 + ContextVersion(String contextVersion, String defaultProtocolVersion,
394.51 + String supportedProtocolVersion) {
394.52 + this.contextVersion = contextVersion;
394.53 + this.defaultProtocolVersion = defaultProtocolVersion;
394.54 + this.supportedProtocolVersion = supportedProtocolVersion;
394.55 + }
394.56 + }
394.57 +
394.58 + public static void main(String[] args) throws Exception {
394.59 + for (ContextVersion cv : ContextVersion.values()) {
394.60 + System.out.println("Checking SSLContext of " + cv.contextVersion);
394.61 + SSLContext context = SSLContext.getInstance(cv.contextVersion);
394.62 +
394.63 + // Default SSLContext is initialized automatically.
394.64 + if (!cv.contextVersion.equals("Default")) {
394.65 + // Use default TK, KM and random.
394.66 + context.init((KeyManager[])null, (TrustManager[])null, null);
394.67 + }
394.68 +
394.69 + SSLParameters parameters = context.getDefaultSSLParameters();
394.70 +
394.71 + String[] protocols = parameters.getProtocols();
394.72 + String[] ciphers = parameters.getCipherSuites();
394.73 +
394.74 + if (protocols.length == 0 || ciphers.length == 0) {
394.75 + throw new Exception("No default protocols or cipher suites");
394.76 + }
394.77 +
394.78 + boolean isMatch = false;
394.79 + for (String protocol : protocols) {
394.80 + System.out.println("\tdefault protocol version " + protocol);
394.81 + if (protocol.equals(cv.defaultProtocolVersion)) {
394.82 + isMatch = true;
394.83 + break;
394.84 + }
394.85 + }
394.86 +
394.87 + if (!isMatch) {
394.88 + throw new Exception("No matched default protocol");
394.89 + }
394.90 +
394.91 + parameters = context.getSupportedSSLParameters();
394.92 +
394.93 + protocols = parameters.getProtocols();
394.94 + ciphers = parameters.getCipherSuites();
394.95 +
394.96 + if (protocols.length == 0 || ciphers.length == 0) {
394.97 + throw new Exception("No default protocols or cipher suites");
394.98 + }
394.99 +
394.100 + isMatch = false;
394.101 + for (String protocol : protocols) {
394.102 + System.out.println("\tsupported protocol version " + protocol);
394.103 + if (protocol.equals(cv.supportedProtocolVersion)) {
394.104 + isMatch = true;
394.105 + break;
394.106 + }
394.107 + }
394.108 +
394.109 + if (!isMatch) {
394.110 + throw new Exception("No matched default protocol");
394.111 + }
394.112 + System.out.println("\t... Success");
394.113 + }
394.114 + }
394.115 +}
395.1 --- a/test/sun/text/resources/LocaleData Tue Apr 19 16:01:27 2011 -0700
395.2 +++ b/test/sun/text/resources/LocaleData Tue Apr 26 15:48:03 2011 -0700
395.3 @@ -6942,3 +6942,14 @@
395.4 CurrencyNames/zh_TW/xts=XTS
395.5 CurrencyNames/zh_TW/xxx=XXX
395.6 CurrencyNames/zh_TW/yer=\u8449\u9580\u91cc\u96c5
395.7 +
395.8 +# bug 7036905
395.9 +CurrencyNames/de/afa=Afghani (1927-2002)
395.10 +CurrencyNames/de/afn=Afghani
395.11 +CurrencyNames/de/bob=Boliviano
395.12 +CurrencyNames/de/dem=Deutsche Mark
395.13 +CurrencyNames/de/mwk=Malawi Kwacha
395.14 +CurrencyNames/de/mxv=Mexican Unidad de Inversion (UDI)
395.15 +CurrencyNames/de/svc=El Salvador Colon
395.16 +
395.17 +CurrencyNames/it/bob=Boliviano
396.1 --- a/test/sun/text/resources/LocaleDataTest.java Tue Apr 19 16:01:27 2011 -0700
396.2 +++ b/test/sun/text/resources/LocaleDataTest.java Tue Apr 26 15:48:03 2011 -0700
396.3 @@ -33,7 +33,7 @@
396.4 * 6379214 6485516 6486607 4225362 4494727 6533691 6531591 6531593 6570259
396.5 * 6509039 6609737 6610748 6645271 6507067 6873931 6450945 6645268 6646611
396.6 * 6645405 6650730 6910489 6573250 6870908 6585666 6716626 6914413 6916787
396.7 - * 6919624 6998391 7019267 7020960 7025837 7020583
396.8 + * 6919624 6998391 7019267 7020960 7025837 7020583 7036905
396.9 * @summary Verify locale data
396.10 *
396.11 */
397.1 --- a/test/tools/launcher/ExecutionEnvironment.java Tue Apr 19 16:01:27 2011 -0700
397.2 +++ b/test/tools/launcher/ExecutionEnvironment.java Tue Apr 26 15:48:03 2011 -0700
397.3 @@ -1,5 +1,5 @@
397.4 /*
397.5 - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
397.6 + * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
397.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
397.8 *
397.9 * This code is free software; you can redistribute it and/or modify it
397.10 @@ -30,7 +30,7 @@
397.11 */
397.12
397.13 /*
397.14 - * This test tests for various things as follows:
397.15 + * This tests for various things as follows:
397.16 * Ensures that:
397.17 * 1. uneccessary execs do not occur
397.18 * 2. the environment is pristine, users environment variable wrt.
397.19 @@ -84,7 +84,9 @@
397.20 static int errors = 0;
397.21 static int passes = 0;
397.22
397.23 - private static void createTestJar() {
397.24 + static final String LIBJVM = TestHelper.isWindows ? "jvm.dll" : "libjvm.so";
397.25 +
397.26 + static void createTestJar() {
397.27 try {
397.28 List<String> codeList = new ArrayList<String>();
397.29 codeList.add("static void printValue(String name, boolean property) {\n");
397.30 @@ -127,6 +129,7 @@
397.31 testJarFile.getAbsolutePath());
397.32
397.33 if (!tr.isNotZeroOutput()) {
397.34 + System.out.println(tr);
397.35 throw new RuntimeException("Error: No output at all. Did the test execute ?");
397.36 }
397.37
397.38 @@ -177,7 +180,6 @@
397.39
397.40 Map<String, String> env = new HashMap<String, String>();
397.41
397.42 -
397.43 if (TestHelper.isLinux) {
397.44 for (String x : LD_PATH_STRINGS) {
397.45 String pairs[] = x.split("=");
397.46 @@ -209,7 +211,7 @@
397.47 verifyJavaLibraryPathOverride(tr, true);
397.48
397.49 // try changing the model from 32 to 64 bit
397.50 - if (TestHelper.java64Cmd != null && TestHelper.is32Bit) {
397.51 + if (TestHelper.dualModePresent() && TestHelper.is32Bit) {
397.52 // verify the override occurs
397.53 env.clear();
397.54 for (String x : LD_PATH_STRINGS) {
397.55 @@ -326,7 +328,7 @@
397.56 File symLink = null;
397.57 String libPathPrefix = TestHelper.isSDK ? "jre/lib" : "/lib";
397.58 symLink = new File(TestHelper.JAVAHOME, libPathPrefix +
397.59 - TestHelper.getJreArch() + "/libjvm.so");
397.60 + TestHelper.getJreArch() + "/" + LIBJVM);
397.61 if (symLink.exists()) {
397.62 System.out.println("FAIL: The symlink exists " +
397.63 symLink.getAbsolutePath());
398.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
398.2 +++ b/test/tools/launcher/Test7029048.java Tue Apr 26 15:48:03 2011 -0700
398.3 @@ -0,0 +1,313 @@
398.4 +/*
398.5 + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
398.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
398.7 + *
398.8 + * This code is free software; you can redistribute it and/or modify it
398.9 + * under the terms of the GNU General Public License version 2 only, as
398.10 + * published by the Free Software Foundation.
398.11 + *
398.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
398.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
398.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
398.15 + * version 2 for more details (a copy is included in the LICENSE file that
398.16 + * accompanied this code).
398.17 + *
398.18 + * You should have received a copy of the GNU General Public License version
398.19 + * 2 along with this work; if not, write to the Free Software Foundation,
398.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
398.21 + *
398.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
398.23 + * or visit www.oracle.com if you need additional information or have any
398.24 + * questions.
398.25 + */
398.26 +
398.27 +/*
398.28 + * @test
398.29 + * @bug 7029048
398.30 + * @summary Checks for LD_LIBRARY_PATH on *nixes
398.31 + * @compile -XDignore.symbol.file ExecutionEnvironment.java TestHelper.java Test7029048.java
398.32 + * @run main Test7029048
398.33 + */
398.34 +
398.35 +/*
398.36 + * 7029048: test for LD_LIBRARY_PATH set to different paths pointing which may
398.37 + * contain a libjvm.so and may not, but we test to ensure that the launcher
398.38 + * behaves correctly in all cases.
398.39 + */
398.40 +import java.io.File;
398.41 +import java.io.IOException;
398.42 +import java.nio.file.Files;
398.43 +import java.util.ArrayList;
398.44 +import java.util.HashMap;
398.45 +import java.util.List;
398.46 +import java.util.Map;
398.47 +
398.48 +public class Test7029048 {
398.49 +
398.50 + static int passes = 0;
398.51 + static int errors = 0;
398.52 +
398.53 + private static final String LIBJVM = ExecutionEnvironment.LIBJVM;
398.54 + private static final String LD_LIBRARY_PATH =
398.55 + ExecutionEnvironment.LD_LIBRARY_PATH;
398.56 + private static final String LD_LIBRARY_PATH_32 =
398.57 + ExecutionEnvironment.LD_LIBRARY_PATH_32;
398.58 + private static final String LD_LIBRARY_PATH_64 =
398.59 + ExecutionEnvironment.LD_LIBRARY_PATH_64;
398.60 +
398.61 + private static final File libDir =
398.62 + new File(System.getProperty("sun.boot.library.path"));
398.63 + private static final File srcServerDir = new File(libDir, "server");
398.64 + private static final File srcLibjvmSo = new File(srcServerDir, LIBJVM);
398.65 +
398.66 + private static final File dstLibDir = new File("lib");
398.67 + private static final File dstLibArchDir =
398.68 + new File(dstLibDir, TestHelper.getJreArch());
398.69 +
398.70 + private static final File dstServerDir = new File(dstLibArchDir, "server");
398.71 + private static final File dstServerLibjvm = new File(dstServerDir, LIBJVM);
398.72 +
398.73 + private static final File dstClientDir = new File(dstLibArchDir, "client");
398.74 + private static final File dstClientLibjvm = new File(dstClientDir, LIBJVM);
398.75 +
398.76 + // used primarily to test the solaris variants in dual mode
398.77 + private static final File dstOtherArchDir;
398.78 + private static final File dstOtherServerDir;
398.79 + private static final File dstOtherServerLibjvm;
398.80 +
398.81 + private static final Map<String, String> env = new HashMap<>();
398.82 +
398.83 + static {
398.84 + if (TestHelper.isDualMode) {
398.85 + dstOtherArchDir = new File(dstLibDir, TestHelper.getComplementaryJreArch());
398.86 + dstOtherServerDir = new File(dstOtherArchDir, "server");
398.87 + dstOtherServerLibjvm = new File(dstOtherServerDir, LIBJVM);
398.88 + } else {
398.89 + dstOtherArchDir = null;
398.90 + dstOtherServerDir = null;
398.91 + dstOtherServerLibjvm = null;
398.92 + }
398.93 + }
398.94 +
398.95 + static String getValue(String name, List<String> in) {
398.96 + for (String x : in) {
398.97 + String[] s = x.split("=");
398.98 + if (name.equals(s[0].trim())) {
398.99 + return s[1].trim();
398.100 + }
398.101 + }
398.102 + return null;
398.103 + }
398.104 +
398.105 + static void run(boolean want32, String dflag, Map<String, String> env,
398.106 + int nLLPComponents, String caseID) {
398.107 + final boolean want64 = want32 == false;
398.108 + env.put(ExecutionEnvironment.JLDEBUG_KEY, "true");
398.109 + List<String> cmdsList = new ArrayList<>();
398.110 +
398.111 + // only for a dual-mode system
398.112 + if (want64 && TestHelper.isDualMode) {
398.113 + cmdsList.add(TestHelper.java64Cmd);
398.114 + } else {
398.115 + cmdsList.add(TestHelper.javaCmd); // a 32-bit java command for all
398.116 + }
398.117 +
398.118 + /*
398.119 + * empty or null strings can confuse the ProcessBuilder. A null flag
398.120 + * indicates that the appropriate data model is enforced on the chosen
398.121 + * launcher variant.
398.122 + */
398.123 +
398.124 + if (dflag != null) {
398.125 + cmdsList.add(dflag);
398.126 + } else {
398.127 + cmdsList.add(want32 ? "-d32" : "-d64");
398.128 + }
398.129 + cmdsList.add("-server");
398.130 + cmdsList.add("-jar");
398.131 + cmdsList.add(ExecutionEnvironment.testJarFile.getAbsolutePath());
398.132 + String[] cmds = new String[cmdsList.size()];
398.133 + TestHelper.TestResult tr = TestHelper.doExec(env, cmdsList.toArray(cmds));
398.134 + analyze(tr, nLLPComponents, caseID);
398.135 + }
398.136 +
398.137 + // no cross launch, ie. no change to the data model.
398.138 + static void run(Map<String, String> env, int nLLPComponents, String caseID)
398.139 + throws IOException {
398.140 + boolean want32 = TestHelper.is32Bit;
398.141 + run(want32, null, env, nLLPComponents, caseID);
398.142 + }
398.143 +
398.144 + static void analyze(TestHelper.TestResult tr, int nLLPComponents, String caseID) {
398.145 + String envValue = getValue(LD_LIBRARY_PATH, tr.testOutput);
398.146 + /*
398.147 + * the envValue can never be null, since the test code should always
398.148 + * print a "null" string.
398.149 + */
398.150 + if (envValue == null) {
398.151 + System.out.println(tr);
398.152 + throw new RuntimeException("NPE, likely a program crash ??");
398.153 + }
398.154 + String values[] = envValue.split(File.pathSeparator);
398.155 + if (values.length == nLLPComponents) {
398.156 + System.out.println(caseID + " :OK");
398.157 + passes++;
398.158 + } else {
398.159 + System.out.println("FAIL: test7029048, " + caseID);
398.160 + System.out.println(" expected " + nLLPComponents
398.161 + + " but got " + values.length);
398.162 + System.out.println(envValue);
398.163 + System.out.println(tr);
398.164 + errors++;
398.165 + }
398.166 + }
398.167 +
398.168 + /*
398.169 + * A crucial piece, specifies what we should expect, given the conditions.
398.170 + * That is for a given enum type, the value indicates how many absolute
398.171 + * environment variables that can be expected. This value is used to base
398.172 + * the actual expected values by adding the set environment variable usually
398.173 + * it is 1, but it could be more if the test wishes to set more paths in
398.174 + * the future.
398.175 + */
398.176 + private static enum LLP_VAR {
398.177 + LLP_SET_NON_EXISTENT_PATH(0), // env set, but the path does not exist
398.178 + LLP_SET_EMPTY_PATH(0), // env set, with a path but no libjvm.so
398.179 + LLP_SET_WITH_JVM(3); // env set, with a libjvm.so
398.180 + private final int value;
398.181 + LLP_VAR(int i) {
398.182 + this.value = i;
398.183 + }
398.184 + }
398.185 +
398.186 + /*
398.187 + * test for 7029048
398.188 + */
398.189 + static void test7029048() throws IOException {
398.190 + String desc = null;
398.191 + for (LLP_VAR v : LLP_VAR.values()) {
398.192 + switch (v) {
398.193 + case LLP_SET_WITH_JVM:
398.194 + // copy the files into the directory structures
398.195 + TestHelper.copyFile(srcLibjvmSo, dstServerLibjvm);
398.196 + // does not matter if it is client or a server
398.197 + TestHelper.copyFile(srcLibjvmSo, dstClientLibjvm);
398.198 + // does not matter if the arch do not match either
398.199 + if (TestHelper.isDualMode) {
398.200 + TestHelper.copyFile(srcLibjvmSo, dstOtherServerLibjvm);
398.201 + }
398.202 + desc = "LD_LIBRARY_PATH should be set";
398.203 + break;
398.204 + case LLP_SET_EMPTY_PATH:
398.205 + if (!dstClientDir.exists()) {
398.206 + Files.createDirectories(dstClientDir.toPath());
398.207 + } else {
398.208 + Files.deleteIfExists(dstClientLibjvm.toPath());
398.209 + }
398.210 +
398.211 + if (!dstServerDir.exists()) {
398.212 + Files.createDirectories(dstServerDir.toPath());
398.213 + } else {
398.214 + Files.deleteIfExists(dstServerLibjvm.toPath());
398.215 + }
398.216 +
398.217 + if (TestHelper.isDualMode) {
398.218 + if (!dstOtherServerDir.exists()) {
398.219 + Files.createDirectories(dstOtherServerDir.toPath());
398.220 + } else {
398.221 + Files.deleteIfExists(dstOtherServerLibjvm.toPath());
398.222 + }
398.223 + }
398.224 +
398.225 + desc = "LD_LIBRARY_PATH should not be set";
398.226 + break;
398.227 + case LLP_SET_NON_EXISTENT_PATH:
398.228 + if (dstLibDir.exists()) {
398.229 + TestHelper.recursiveDelete(dstLibDir);
398.230 + }
398.231 + desc = "LD_LIBRARY_PATH should not be set";
398.232 + break;
398.233 + default:
398.234 + throw new RuntimeException("unknown case");
398.235 + }
398.236 +
398.237 + /*
398.238 + * Case 1: set the server path
398.239 + */
398.240 + env.clear();
398.241 + env.put(LD_LIBRARY_PATH, dstServerDir.getAbsolutePath());
398.242 + run(env, v.value + 1, "Case 1: " + desc);
398.243 +
398.244 + /*
398.245 + * Case 2: repeat with client path
398.246 + */
398.247 + env.clear();
398.248 + env.put(LD_LIBRARY_PATH, dstClientDir.getAbsolutePath());
398.249 + run(env, v.value + 1, "Case 2: " + desc);
398.250 +
398.251 + if (!TestHelper.isDualMode) {
398.252 + continue; // nothing more to do for Linux
398.253 + }
398.254 +
398.255 + // Tests applicable only to solaris.
398.256 +
398.257 + // initialize test variables for dual mode operations
398.258 + final File dst32ServerDir = TestHelper.is32Bit
398.259 + ? dstServerDir
398.260 + : dstOtherServerDir;
398.261 +
398.262 + final File dst64ServerDir = TestHelper.is64Bit
398.263 + ? dstServerDir
398.264 + : dstOtherServerDir;
398.265 +
398.266 + /*
398.267 + * Case 3: set the appropriate LLP_XX flag,
398.268 + * java32 -d32, LLP_32 is relevant, LLP_64 is ignored
398.269 + * java64 -d64, LLP_64 is relevant, LLP_32 is ignored
398.270 + */
398.271 + env.clear();
398.272 + env.put(LD_LIBRARY_PATH_32, dst32ServerDir.getAbsolutePath());
398.273 + env.put(LD_LIBRARY_PATH_64, dst64ServerDir.getAbsolutePath());
398.274 + run(TestHelper.is32Bit, null, env, v.value + 1, "Case 3: " + desc);
398.275 +
398.276 + /*
398.277 + * Case 4: we are in dual mode environment, running 64-bit then
398.278 + * we have the following scenarios:
398.279 + * java32 -d64, LLP_64 is relevant, LLP_32 is ignored
398.280 + * java64 -d32, LLP_32 is relevant, LLP_64 is ignored
398.281 + */
398.282 + if (TestHelper.dualModePresent()) {
398.283 + run(true, "-d64", env, v.value + 1, "Case 4A: " + desc);
398.284 + run(false,"-d32", env, v.value + 1, "Case 4B: " + desc);
398.285 + }
398.286 + }
398.287 + return;
398.288 + }
398.289 +
398.290 + public static void main(String... args) throws Exception {
398.291 + if (TestHelper.isWindows) {
398.292 + System.out.println("Warning: noop on windows");
398.293 + return;
398.294 + }
398.295 + // create our test jar first
398.296 + ExecutionEnvironment.createTestJar();
398.297 +
398.298 + // run the tests
398.299 + test7029048();
398.300 + if (errors > 0) {
398.301 + throw new Exception("Test7029048: FAIL: with "
398.302 + + errors + " errors and passes " + passes);
398.303 + } else if (TestHelper.dualModePresent() && passes < 15) {
398.304 + throw new Exception("Test7029048: FAIL: " +
398.305 + "all tests did not run, expected " + 15 + " got " + passes);
398.306 + } else if (TestHelper.isSolaris && passes < 9) {
398.307 + throw new Exception("Test7029048: FAIL: " +
398.308 + "all tests did not run, expected " + 9 + " got " + passes);
398.309 + } else if (TestHelper.isLinux && passes < 6) {
398.310 + throw new Exception("Test7029048: FAIL: " +
398.311 + "all tests did not run, expected " + 6 + " got " + passes);
398.312 + } else {
398.313 + System.out.println("Test7029048: PASS " + passes);
398.314 + }
398.315 + }
398.316 +}
399.1 --- a/test/tools/launcher/TestHelper.java Tue Apr 19 16:01:27 2011 -0700
399.2 +++ b/test/tools/launcher/TestHelper.java Tue Apr 26 15:48:03 2011 -0700
399.3 @@ -1,6 +1,5 @@
399.4 -
399.5 /*
399.6 - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
399.7 + * Copyright (c) 2008, 2011 Oracle and/or its affiliates. All rights reserved.
399.8 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
399.9 *
399.10 * This code is free software; you can redistribute it and/or modify it
399.11 @@ -22,20 +21,28 @@
399.12 * questions.
399.13 */
399.14
399.15 +import java.nio.file.attribute.BasicFileAttributes;
399.16 +import java.nio.file.FileVisitResult;
399.17 +import java.nio.file.SimpleFileVisitor;
399.18 import javax.tools.ToolProvider;
399.19 import java.io.BufferedReader;
399.20 import java.io.File;
399.21 import java.io.FileNotFoundException;
399.22 import java.io.FileOutputStream;
399.23 +import java.io.IOException;
399.24 import java.io.InputStreamReader;
399.25 import java.io.PrintStream;
399.26 +import java.nio.file.Files;
399.27 +import java.nio.file.Path;
399.28 import java.util.ArrayList;
399.29 import java.util.List;
399.30 import java.util.Map;
399.31 import javax.tools.JavaCompiler;
399.32
399.33 +import static java.nio.file.StandardCopyOption.*;
399.34 +
399.35 /**
399.36 - * This class provides some common utilites for the launcher tests.
399.37 + * This class provides some common utilities for the launcher tests.
399.38 */
399.39 public enum TestHelper {
399.40 INSTANCE;
399.41 @@ -101,6 +108,13 @@
399.42 }
399.43
399.44 /*
399.45 + * is a dual mode available in the test jdk
399.46 + */
399.47 + static boolean dualModePresent() {
399.48 + return isDualMode && java64Cmd != null;
399.49 + }
399.50 +
399.51 + /*
399.52 * usually the jre/lib/arch-name is the same as os.arch, except for x86.
399.53 */
399.54 static String getJreArch() {
399.55 @@ -109,6 +123,27 @@
399.56 }
399.57
399.58 /*
399.59 + * get the complementary jre arch ie. if sparc then return sparcv9 and
399.60 + * vice-versa.
399.61 + */
399.62 + static String getComplementaryJreArch() {
399.63 + String arch = System.getProperty("os.arch");
399.64 + if (arch != null) {
399.65 + switch (arch) {
399.66 + case "sparc":
399.67 + return "sparcv9";
399.68 + case "sparcv9":
399.69 + return "sparc";
399.70 + case "x86":
399.71 + return "amd64";
399.72 + case "amd64":
399.73 + return "i386";
399.74 + }
399.75 + }
399.76 + return null;
399.77 + }
399.78 +
399.79 + /*
399.80 * A convenience method to create a jar with jar file name and defs
399.81 */
399.82 static void createJar(File jarName, String... mainDefs)
399.83 @@ -168,6 +203,44 @@
399.84 }
399.85 }
399.86
399.87 + static void copyFile(File src, File dst) throws IOException {
399.88 + Path parent = dst.toPath().getParent();
399.89 + if (parent != null) {
399.90 + Files.createDirectories(parent);
399.91 + }
399.92 + Files.copy(src.toPath(), dst.toPath(), COPY_ATTRIBUTES, REPLACE_EXISTING);
399.93 + }
399.94 +
399.95 + static void recursiveDelete(File target) throws IOException {
399.96 + if (!target.exists()) {
399.97 + return;
399.98 + }
399.99 + Files.walkFileTree(target.toPath(), new SimpleFileVisitor<Path>() {
399.100 + @Override
399.101 + public FileVisitResult postVisitDirectory(Path dir, IOException exc) {
399.102 + try {
399.103 + Files.deleteIfExists(dir);
399.104 + } catch (IOException ex) {
399.105 + System.out.println("Error: could not delete: " + dir.toString());
399.106 + System.out.println(ex.getMessage());
399.107 + return FileVisitResult.TERMINATE;
399.108 + }
399.109 + return FileVisitResult.CONTINUE;
399.110 + }
399.111 + @Override
399.112 + public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) {
399.113 + try {
399.114 + Files.deleteIfExists(file);
399.115 + } catch (IOException ex) {
399.116 + System.out.println("Error: could not delete: " + file.toString());
399.117 + System.out.println(ex.getMessage());
399.118 + return FileVisitResult.TERMINATE;
399.119 + }
399.120 + return FileVisitResult.CONTINUE;
399.121 + }
399.122 + });
399.123 + }
399.124 +
399.125 static TestResult doExec(String...cmds) {
399.126 return doExec(null, cmds);
399.127 }
399.128 @@ -187,7 +260,7 @@
399.129 }
399.130 BufferedReader rdr = null;
399.131 try {
399.132 - List<String> outputList = new ArrayList<String>();
399.133 + List<String> outputList = new ArrayList<>();
399.134 pb.redirectErrorStream(true);
399.135 Process p = pb.start();
399.136 rdr = new BufferedReader(new InputStreamReader(p.getInputStream()));
399.137 @@ -198,7 +271,9 @@
399.138 }
399.139 p.waitFor();
399.140 p.destroy();
399.141 - return new TestHelper.TestResult(cmdStr, p.exitValue(), outputList);
399.142 +
399.143 + return new TestHelper.TestResult(cmdStr, p.exitValue(), outputList,
399.144 + env, new Throwable("current stack of the test"));
399.145 } catch (Exception ex) {
399.146 ex.printStackTrace();
399.147 throw new RuntimeException(ex.getMessage());
399.148 @@ -213,11 +288,16 @@
399.149 StringBuilder status;
399.150 int exitValue;
399.151 List<String> testOutput;
399.152 + Map<String, String> env;
399.153 + Throwable t;
399.154
399.155 - public TestResult(String str, int rv, List<String> oList) {
399.156 + public TestResult(String str, int rv, List<String> oList,
399.157 + Map<String, String> env, Throwable t) {
399.158 status = new StringBuilder("Executed command: " + str + "\n");
399.159 exitValue = rv;
399.160 testOutput = oList;
399.161 + this.env = env;
399.162 + this.t = t;
399.163 }
399.164
399.165 void appendStatus(String x) {
399.166 @@ -262,11 +342,21 @@
399.167
399.168 @Override
399.169 public String toString() {
399.170 - status = status.append("++++Test Output Begin++++\n");
399.171 + status.append("++++Begin Test Info++++\n");
399.172 + status.append("++++Test Environment++++\n");
399.173 + for (String x : env.keySet()) {
399.174 + status.append(x).append("=").append(env.get(x)).append("\n");
399.175 + }
399.176 + status.append("++++Test Output++++\n");
399.177 for (String x : testOutput) {
399.178 appendStatus(x);
399.179 }
399.180 - status = status.append("++++Test Output End++++\n");
399.181 + status.append("++++Test Stack Trace++++\n");
399.182 + status.append(t.toString());
399.183 + for (StackTraceElement e : t.getStackTrace()) {
399.184 + status.append(e.toString());
399.185 + }
399.186 + status.append("++++End of Test Info++++\n");
399.187 return status.toString();
399.188 }
399.189