changeset 24330:4e65b09f7101

Merge
author twisti
date Fri, 02 May 2014 19:00:04 -0700
parents 13ccf2b92d69 058d96676d00
children ddce5dcb6be1 c562519603d1
files hotspot/make/hotspot_version hotspot/src/share/vm/classfile/javaClasses.cpp hotspot/src/share/vm/oops/klass.cpp hotspot/src/share/vm/runtime/vmStructs.cpp jaxws/src/share/jaxws_classes/com/sun/xml/internal/org/jvnet/staxex/util/SaajStaxReaderEx.java jaxws/src/share/jaxws_classes/com/sun/xml/internal/org/jvnet/staxex/util/SaajStaxWriter.java jaxws/src/share/jaxws_classes/com/sun/xml/internal/org/jvnet/staxex/util/SaajStaxWriterEx.java jdk/src/macosx/lib/content-types.properties jdk/src/macosx/native/sun/awt/CClipboard.h jdk/src/share/classes/javax/swing/text/html/ResourceLoader.java jdk/src/share/classes/javax/swing/text/html/parser/ResourceLoader.java jdk/src/share/classes/sun/awt/EventListenerAggregate.java jdk/src/share/demo/nio/zipfs/Demo.java jdk/src/share/demo/nio/zipfs/README.txt jdk/src/share/demo/nio/zipfs/src/META-INF/services/java.nio.file.spi.FileSystemProvider jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/JarFileSystemProvider.java jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipCoder.java jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipConstants.java jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipDirectoryStream.java jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileAttributeView.java jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileAttributes.java jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileStore.java jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystemProvider.java jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipInfo.java jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipPath.java jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipUtils.java jdk/src/solaris/lib/content-types.properties jdk/src/windows/lib/content-types.properties jdk/test/demo/zipfs/Basic.java jdk/test/demo/zipfs/PathOps.java jdk/test/demo/zipfs/ZFSTests.java jdk/test/demo/zipfs/ZipFSTester.java jdk/test/demo/zipfs/basic.sh langtools/make/netbeans/langtools/nbproject/standard-context-menu-items.ent langtools/make/netbeans/langtools/nbproject/standard-ide-actions.ent langtools/test/tools/javac/lambda/ErroneousLambdaExpr.java langtools/test/tools/javac/lambda/ErroneousLambdaExpr.out
diffstat 1063 files changed, 55198 insertions(+), 21862 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Thu May 01 17:57:29 2014 -0700
+++ b/.hgtags	Fri May 02 19:00:04 2014 -0700
@@ -250,3 +250,7 @@
 dd311791ad6895a3989020dd6c6c46db87972ab8 jdk9-b05
 85dbdc227c5e11429b4fc4a8ba763f50107edd6e jdk9-b06
 c826d05f1fb0773f6a28caa763307dd30d90d36e jdk9-b07
+b47e021195757f8f45582124ea7cad48ccf5f872 jdk9-b08
+efe7dbc6088691757404e0c8745f894e3ca9c022 jdk9-b09
+8c0bdeecd7c0f9ce3f3762a51991f755cb3a972c jdk9-b10
+0809c9a4d36e6291f1c4384604c4bbf29e975722 jdk9-b11
--- a/.hgtags-top-repo	Thu May 01 17:57:29 2014 -0700
+++ b/.hgtags-top-repo	Fri May 02 19:00:04 2014 -0700
@@ -250,3 +250,7 @@
 8c63f0b6ada282f27e3a80125e53c3be603f9af7 jdk9-b05
 d0b525cd31b87abeb6d5b7e3516953eeb13b323c jdk9-b06
 0ea015c298b201c07fa33990f2445b6d0ef3566d jdk9-b07
+db045d8faa0924b7378102d24a1a0d850c1e3834 jdk9-b08
+4a21dc7d57d1069a01f68e7182c074cb37349dfb jdk9-b09
+fa13f2b926f8426876ec03e7903f3ee0ee150f2e jdk9-b10
+ab55a18a95e1990a588929d5d29db3eb9985fea0 jdk9-b11
--- a/README-builds.html	Thu May 01 17:57:29 2014 -0700
+++ b/README-builds.html	Fri May 02 19:00:04 2014 -0700
@@ -145,7 +145,7 @@
                 root repository:
                 <blockquote>
                     <code>
-                        hg clone http://hg.openjdk.java.net/jdk8/jdk8 
+                        hg clone http://hg.openjdk.java.net/jdk9/jdk9
                         <i>YourOpenJDK</i>
                         <br>
                         cd <i>YourOpenJDK</i>
@@ -373,18 +373,17 @@
                         particular update level.
                         <br>&nbsp;<br>
 
-                        <b><i>Building JDK 8 requires use of a version
-                        of JDK 7 that is at Update 7 or newer. JDK 8
-                        developers should not use JDK 8 as the boot
-                        JDK, to ensure that JDK 8 dependencies are
+                        <b><i>Building JDK 9 requires JDK 8. JDK 9
+                        developers should not use JDK 9 as the boot
+                        JDK, to ensure that JDK 9 dependencies are
                         not introduced into the parts of the system
-                        that are built with JDK 7.</i></b>
+                        that are built with JDK 8.</i></b>
 
                         <br>&nbsp;<br>
-                        The JDK 7 binaries can be downloaded from Oracle's 
+                        The JDK 8 binaries can be downloaded from Oracle's 
                         <a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html"
-                           target="_blank">JDK 7 download site</a>.
-                        For build performance reasons
+                           target="_blank">JDK 8 download site</a>.
+                        For build performance reasons it
                         is very important that this bootstrap JDK be made available 
                         on the local disk of the machine doing the build.
                         You should add its <code>bin</code> directory
@@ -1454,9 +1453,7 @@
                 <p>One of the top goals of the new build system is to improve the
                     build performance and decrease the time needed to build. This will
                     soon also apply to the java compilation when the Smart Javac wrapper
-                    is making its way into jdk8. It can be tried in the build-infra
-                    repository already. You are likely to find that the new build system
-                    is faster than the old one even without this feature.</p>
+                    is fully supported.</p>
 
                 <p>At the end of a successful execution of <code>configure</code>, 
                     you will get a performance summary, 
--- a/common/autoconf/boot-jdk.m4	Thu May 01 17:57:29 2014 -0700
+++ b/common/autoconf/boot-jdk.m4	Fri May 02 19:00:04 2014 -0700
@@ -82,10 +82,10 @@
             BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
 
             # Extra M4 quote needed to protect [] in grep expression.
-            [FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep  '\"1\.[789]\.'`]
+            [FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep  '\"1\.[89]\.'`]
             if test "x$FOUND_CORRECT_VERSION" = x; then
               AC_MSG_NOTICE([Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring])
-              AC_MSG_NOTICE([(Your Boot JDK must be version 7, 8 or 9)])
+              AC_MSG_NOTICE([(Your Boot JDK must be version 8 or 9)])
               BOOT_JDK_FOUND=no
             else
               # We're done! :-)
--- a/common/autoconf/build-performance.m4	Thu May 01 17:57:29 2014 -0700
+++ b/common/autoconf/build-performance.m4	Fri May 02 19:00:04 2014 -0700
@@ -89,7 +89,7 @@
   if test "x$FOUND_MEM" = xyes; then
     AC_MSG_RESULT([$MEMORY_SIZE MB])
   else
-    AC_MSG_RESULT([could not detect memory size, defaulting to 1024 MB])
+    AC_MSG_RESULT([could not detect memory size, defaulting to $MEMORY_SIZE MB])
     AC_MSG_WARN([This might seriously impact build performance!])
   fi
 ])
--- a/common/autoconf/flags.m4	Thu May 01 17:57:29 2014 -0700
+++ b/common/autoconf/flags.m4	Fri May 02 19:00:04 2014 -0700
@@ -473,7 +473,8 @@
         CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing"
         ;;
       ppc )
-        # on ppc we don't prevent gcc to omit frame pointer nor strict-aliasing
+        # on ppc we don't prevent gcc to omit frame pointer but do prevent strict aliasing
+        CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing"
         ;;
       * )
         CCXXFLAGS_JDK="$CCXXFLAGS_JDK -fno-omit-frame-pointer"
--- a/common/autoconf/generated-configure.sh	Thu May 01 17:57:29 2014 -0700
+++ b/common/autoconf/generated-configure.sh	Fri May 02 19:00:04 2014 -0700
@@ -4243,7 +4243,7 @@
 #CUSTOM_AUTOCONF_INCLUDE
 
 # Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1396624161
+DATE_WHEN_GENERATED=1398861894
 
 ###############################################################################
 #
@@ -19896,12 +19896,12 @@
             BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
 
             # Extra M4 quote needed to protect [] in grep expression.
-            FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep  '\"1\.[789]\.'`
+            FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep  '\"1\.[89]\.'`
             if test "x$FOUND_CORRECT_VERSION" = x; then
               { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
-              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7, 8 or 9)" >&5
-$as_echo "$as_me: (Your Boot JDK must be version 7, 8 or 9)" >&6;}
+              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
+$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
               BOOT_JDK_FOUND=no
             else
               # We're done! :-)
@@ -20228,12 +20228,12 @@
             BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
 
             # Extra M4 quote needed to protect [] in grep expression.
-            FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep  '\"1\.[789]\.'`
+            FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep  '\"1\.[89]\.'`
             if test "x$FOUND_CORRECT_VERSION" = x; then
               { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
-              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7, 8 or 9)" >&5
-$as_echo "$as_me: (Your Boot JDK must be version 7, 8 or 9)" >&6;}
+              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
+$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
               BOOT_JDK_FOUND=no
             else
               # We're done! :-)
@@ -20422,12 +20422,12 @@
             BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
 
             # Extra M4 quote needed to protect [] in grep expression.
-            FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep  '\"1\.[789]\.'`
+            FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep  '\"1\.[89]\.'`
             if test "x$FOUND_CORRECT_VERSION" = x; then
               { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
-              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7, 8 or 9)" >&5
-$as_echo "$as_me: (Your Boot JDK must be version 7, 8 or 9)" >&6;}
+              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
+$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
               BOOT_JDK_FOUND=no
             else
               # We're done! :-)
@@ -20609,12 +20609,12 @@
             BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
 
             # Extra M4 quote needed to protect [] in grep expression.
-            FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep  '\"1\.[789]\.'`
+            FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep  '\"1\.[89]\.'`
             if test "x$FOUND_CORRECT_VERSION" = x; then
               { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
-              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7, 8 or 9)" >&5
-$as_echo "$as_me: (Your Boot JDK must be version 7, 8 or 9)" >&6;}
+              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
+$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
               BOOT_JDK_FOUND=no
             else
               # We're done! :-)
@@ -20795,12 +20795,12 @@
             BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
 
             # Extra M4 quote needed to protect [] in grep expression.
-            FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep  '\"1\.[789]\.'`
+            FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep  '\"1\.[89]\.'`
             if test "x$FOUND_CORRECT_VERSION" = x; then
               { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
-              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7, 8 or 9)" >&5
-$as_echo "$as_me: (Your Boot JDK must be version 7, 8 or 9)" >&6;}
+              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
+$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
               BOOT_JDK_FOUND=no
             else
               # We're done! :-)
@@ -20981,12 +20981,12 @@
             BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
 
             # Extra M4 quote needed to protect [] in grep expression.
-            FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep  '\"1\.[789]\.'`
+            FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep  '\"1\.[89]\.'`
             if test "x$FOUND_CORRECT_VERSION" = x; then
               { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
-              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7, 8 or 9)" >&5
-$as_echo "$as_me: (Your Boot JDK must be version 7, 8 or 9)" >&6;}
+              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
+$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
               BOOT_JDK_FOUND=no
             else
               # We're done! :-)
@@ -21158,12 +21158,12 @@
             BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
 
             # Extra M4 quote needed to protect [] in grep expression.
-            FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep  '\"1\.[789]\.'`
+            FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep  '\"1\.[89]\.'`
             if test "x$FOUND_CORRECT_VERSION" = x; then
               { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
-              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7, 8 or 9)" >&5
-$as_echo "$as_me: (Your Boot JDK must be version 7, 8 or 9)" >&6;}
+              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
+$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
               BOOT_JDK_FOUND=no
             else
               # We're done! :-)
@@ -21476,12 +21476,12 @@
             BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
 
             # Extra M4 quote needed to protect [] in grep expression.
-            FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep  '\"1\.[789]\.'`
+            FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep  '\"1\.[89]\.'`
             if test "x$FOUND_CORRECT_VERSION" = x; then
               { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
-              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7, 8 or 9)" >&5
-$as_echo "$as_me: (Your Boot JDK must be version 7, 8 or 9)" >&6;}
+              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
+$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
               BOOT_JDK_FOUND=no
             else
               # We're done! :-)
@@ -21804,12 +21804,12 @@
             BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
 
             # Extra M4 quote needed to protect [] in grep expression.
-            FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep  '\"1\.[789]\.'`
+            FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep  '\"1\.[89]\.'`
             if test "x$FOUND_CORRECT_VERSION" = x; then
               { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
-              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7, 8 or 9)" >&5
-$as_echo "$as_me: (Your Boot JDK must be version 7, 8 or 9)" >&6;}
+              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
+$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
               BOOT_JDK_FOUND=no
             else
               # We're done! :-)
@@ -22019,12 +22019,12 @@
             BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
 
             # Extra M4 quote needed to protect [] in grep expression.
-            FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep  '\"1\.[789]\.'`
+            FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep  '\"1\.[89]\.'`
             if test "x$FOUND_CORRECT_VERSION" = x; then
               { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
-              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7, 8 or 9)" >&5
-$as_echo "$as_me: (Your Boot JDK must be version 7, 8 or 9)" >&6;}
+              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
+$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
               BOOT_JDK_FOUND=no
             else
               # We're done! :-)
@@ -22199,12 +22199,12 @@
             BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
 
             # Extra M4 quote needed to protect [] in grep expression.
-            FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep  '\"1\.[789]\.'`
+            FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep  '\"1\.[89]\.'`
             if test "x$FOUND_CORRECT_VERSION" = x; then
               { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
-              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7, 8 or 9)" >&5
-$as_echo "$as_me: (Your Boot JDK must be version 7, 8 or 9)" >&6;}
+              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
+$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
               BOOT_JDK_FOUND=no
             else
               # We're done! :-)
@@ -22407,12 +22407,12 @@
             BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
 
             # Extra M4 quote needed to protect [] in grep expression.
-            FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep  '\"1\.[789]\.'`
+            FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep  '\"1\.[89]\.'`
             if test "x$FOUND_CORRECT_VERSION" = x; then
               { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
-              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7, 8 or 9)" >&5
-$as_echo "$as_me: (Your Boot JDK must be version 7, 8 or 9)" >&6;}
+              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
+$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
               BOOT_JDK_FOUND=no
             else
               # We're done! :-)
@@ -22587,12 +22587,12 @@
             BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
 
             # Extra M4 quote needed to protect [] in grep expression.
-            FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep  '\"1\.[789]\.'`
+            FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep  '\"1\.[89]\.'`
             if test "x$FOUND_CORRECT_VERSION" = x; then
               { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
-              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7, 8 or 9)" >&5
-$as_echo "$as_me: (Your Boot JDK must be version 7, 8 or 9)" >&6;}
+              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
+$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
               BOOT_JDK_FOUND=no
             else
               # We're done! :-)
@@ -22795,12 +22795,12 @@
             BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
 
             # Extra M4 quote needed to protect [] in grep expression.
-            FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep  '\"1\.[789]\.'`
+            FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep  '\"1\.[89]\.'`
             if test "x$FOUND_CORRECT_VERSION" = x; then
               { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
-              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7, 8 or 9)" >&5
-$as_echo "$as_me: (Your Boot JDK must be version 7, 8 or 9)" >&6;}
+              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
+$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
               BOOT_JDK_FOUND=no
             else
               # We're done! :-)
@@ -22975,12 +22975,12 @@
             BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
 
             # Extra M4 quote needed to protect [] in grep expression.
-            FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep  '\"1\.[789]\.'`
+            FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep  '\"1\.[89]\.'`
             if test "x$FOUND_CORRECT_VERSION" = x; then
               { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
-              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7, 8 or 9)" >&5
-$as_echo "$as_me: (Your Boot JDK must be version 7, 8 or 9)" >&6;}
+              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
+$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
               BOOT_JDK_FOUND=no
             else
               # We're done! :-)
@@ -23183,12 +23183,12 @@
             BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
 
             # Extra M4 quote needed to protect [] in grep expression.
-            FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep  '\"1\.[789]\.'`
+            FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep  '\"1\.[89]\.'`
             if test "x$FOUND_CORRECT_VERSION" = x; then
               { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
-              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7, 8 or 9)" >&5
-$as_echo "$as_me: (Your Boot JDK must be version 7, 8 or 9)" >&6;}
+              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
+$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
               BOOT_JDK_FOUND=no
             else
               # We're done! :-)
@@ -23363,12 +23363,12 @@
             BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
 
             # Extra M4 quote needed to protect [] in grep expression.
-            FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep  '\"1\.[789]\.'`
+            FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep  '\"1\.[89]\.'`
             if test "x$FOUND_CORRECT_VERSION" = x; then
               { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
-              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7, 8 or 9)" >&5
-$as_echo "$as_me: (Your Boot JDK must be version 7, 8 or 9)" >&6;}
+              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
+$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
               BOOT_JDK_FOUND=no
             else
               # We're done! :-)
@@ -23558,12 +23558,12 @@
             BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
 
             # Extra M4 quote needed to protect [] in grep expression.
-            FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep  '\"1\.[789]\.'`
+            FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep  '\"1\.[89]\.'`
             if test "x$FOUND_CORRECT_VERSION" = x; then
               { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
-              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7, 8 or 9)" >&5
-$as_echo "$as_me: (Your Boot JDK must be version 7, 8 or 9)" >&6;}
+              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
+$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
               BOOT_JDK_FOUND=no
             else
               # We're done! :-)
@@ -23736,12 +23736,12 @@
             BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
 
             # Extra M4 quote needed to protect [] in grep expression.
-            FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep  '\"1\.[789]\.'`
+            FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep  '\"1\.[89]\.'`
             if test "x$FOUND_CORRECT_VERSION" = x; then
               { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
-              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7, 8 or 9)" >&5
-$as_echo "$as_me: (Your Boot JDK must be version 7, 8 or 9)" >&6;}
+              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
+$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
               BOOT_JDK_FOUND=no
             else
               # We're done! :-)
@@ -23932,12 +23932,12 @@
             BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
 
             # Extra M4 quote needed to protect [] in grep expression.
-            FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep  '\"1\.[789]\.'`
+            FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep  '\"1\.[89]\.'`
             if test "x$FOUND_CORRECT_VERSION" = x; then
               { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
-              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7, 8 or 9)" >&5
-$as_echo "$as_me: (Your Boot JDK must be version 7, 8 or 9)" >&6;}
+              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
+$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
               BOOT_JDK_FOUND=no
             else
               # We're done! :-)
@@ -24110,12 +24110,12 @@
             BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
 
             # Extra M4 quote needed to protect [] in grep expression.
-            FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep  '\"1\.[789]\.'`
+            FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep  '\"1\.[89]\.'`
             if test "x$FOUND_CORRECT_VERSION" = x; then
               { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
-              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7, 8 or 9)" >&5
-$as_echo "$as_me: (Your Boot JDK must be version 7, 8 or 9)" >&6;}
+              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
+$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
               BOOT_JDK_FOUND=no
             else
               # We're done! :-)
@@ -24305,12 +24305,12 @@
             BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
 
             # Extra M4 quote needed to protect [] in grep expression.
-            FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep  '\"1\.[789]\.'`
+            FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep  '\"1\.[89]\.'`
             if test "x$FOUND_CORRECT_VERSION" = x; then
               { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
-              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7, 8 or 9)" >&5
-$as_echo "$as_me: (Your Boot JDK must be version 7, 8 or 9)" >&6;}
+              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
+$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
               BOOT_JDK_FOUND=no
             else
               # We're done! :-)
@@ -24483,12 +24483,12 @@
             BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
 
             # Extra M4 quote needed to protect [] in grep expression.
-            FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep  '\"1\.[789]\.'`
+            FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep  '\"1\.[89]\.'`
             if test "x$FOUND_CORRECT_VERSION" = x; then
               { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
-              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7, 8 or 9)" >&5
-$as_echo "$as_me: (Your Boot JDK must be version 7, 8 or 9)" >&6;}
+              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
+$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
               BOOT_JDK_FOUND=no
             else
               # We're done! :-)
@@ -24679,12 +24679,12 @@
             BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
 
             # Extra M4 quote needed to protect [] in grep expression.
-            FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep  '\"1\.[789]\.'`
+            FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep  '\"1\.[89]\.'`
             if test "x$FOUND_CORRECT_VERSION" = x; then
               { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
-              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7, 8 or 9)" >&5
-$as_echo "$as_me: (Your Boot JDK must be version 7, 8 or 9)" >&6;}
+              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
+$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
               BOOT_JDK_FOUND=no
             else
               # We're done! :-)
@@ -24857,12 +24857,12 @@
             BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
 
             # Extra M4 quote needed to protect [] in grep expression.
-            FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep  '\"1\.[789]\.'`
+            FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep  '\"1\.[89]\.'`
             if test "x$FOUND_CORRECT_VERSION" = x; then
               { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
-              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7, 8 or 9)" >&5
-$as_echo "$as_me: (Your Boot JDK must be version 7, 8 or 9)" >&6;}
+              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
+$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
               BOOT_JDK_FOUND=no
             else
               # We're done! :-)
@@ -25034,12 +25034,12 @@
             BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
 
             # Extra M4 quote needed to protect [] in grep expression.
-            FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep  '\"1\.[789]\.'`
+            FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep  '\"1\.[89]\.'`
             if test "x$FOUND_CORRECT_VERSION" = x; then
               { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
-              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7, 8 or 9)" >&5
-$as_echo "$as_me: (Your Boot JDK must be version 7, 8 or 9)" >&6;}
+              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
+$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
               BOOT_JDK_FOUND=no
             else
               # We're done! :-)
@@ -41662,7 +41662,8 @@
         CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing"
         ;;
       ppc )
-        # on ppc we don't prevent gcc to omit frame pointer nor strict-aliasing
+        # on ppc we don't prevent gcc to omit frame pointer but do prevent strict aliasing
+        CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing"
         ;;
       * )
         CCXXFLAGS_JDK="$CCXXFLAGS_JDK -fno-omit-frame-pointer"
@@ -43504,9 +43505,10 @@
 $as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/freetype.lib. Ignoring location." >&6;}
           FOUND_FREETYPE=no
         fi
-      elif test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64 && test -s "$POTENTIAL_FREETYPE_LIB_PATH/amd64/$FREETYPE_LIB_NAME"; then
-        # On solaris-x86_86, default is (normally) PATH/lib/amd64. Update our guess!
-        POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH/amd64"
+      elif test "x$OPENJDK_TARGET_OS" = xsolaris \
+          && test -s "$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR/$FREETYPE_LIB_NAME"; then
+        # Found lib in isa dir, use that instead.
+        POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR"
       fi
     fi
   fi
@@ -44092,9 +44094,10 @@
 $as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/freetype.lib. Ignoring location." >&6;}
           FOUND_FREETYPE=no
         fi
-      elif test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64 && test -s "$POTENTIAL_FREETYPE_LIB_PATH/amd64/$FREETYPE_LIB_NAME"; then
-        # On solaris-x86_86, default is (normally) PATH/lib/amd64. Update our guess!
-        POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH/amd64"
+      elif test "x$OPENJDK_TARGET_OS" = xsolaris \
+          && test -s "$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR/$FREETYPE_LIB_NAME"; then
+        # Found lib in isa dir, use that instead.
+        POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR"
       fi
     fi
   fi
@@ -44394,9 +44397,10 @@
 $as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/freetype.lib. Ignoring location." >&6;}
           FOUND_FREETYPE=no
         fi
-      elif test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64 && test -s "$POTENTIAL_FREETYPE_LIB_PATH/amd64/$FREETYPE_LIB_NAME"; then
-        # On solaris-x86_86, default is (normally) PATH/lib/amd64. Update our guess!
-        POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH/amd64"
+      elif test "x$OPENJDK_TARGET_OS" = xsolaris \
+          && test -s "$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR/$FREETYPE_LIB_NAME"; then
+        # Found lib in isa dir, use that instead.
+        POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR"
       fi
     fi
   fi
@@ -44687,9 +44691,10 @@
 $as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/freetype.lib. Ignoring location." >&6;}
           FOUND_FREETYPE=no
         fi
-      elif test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64 && test -s "$POTENTIAL_FREETYPE_LIB_PATH/amd64/$FREETYPE_LIB_NAME"; then
-        # On solaris-x86_86, default is (normally) PATH/lib/amd64. Update our guess!
-        POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH/amd64"
+      elif test "x$OPENJDK_TARGET_OS" = xsolaris \
+          && test -s "$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR/$FREETYPE_LIB_NAME"; then
+        # Found lib in isa dir, use that instead.
+        POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR"
       fi
     fi
   fi
@@ -44980,9 +44985,10 @@
 $as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/freetype.lib. Ignoring location." >&6;}
           FOUND_FREETYPE=no
         fi
-      elif test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64 && test -s "$POTENTIAL_FREETYPE_LIB_PATH/amd64/$FREETYPE_LIB_NAME"; then
-        # On solaris-x86_86, default is (normally) PATH/lib/amd64. Update our guess!
-        POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH/amd64"
+      elif test "x$OPENJDK_TARGET_OS" = xsolaris \
+          && test -s "$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR/$FREETYPE_LIB_NAME"; then
+        # Found lib in isa dir, use that instead.
+        POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR"
       fi
     fi
   fi
@@ -45274,9 +45280,10 @@
 $as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/freetype.lib. Ignoring location." >&6;}
           FOUND_FREETYPE=no
         fi
-      elif test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64 && test -s "$POTENTIAL_FREETYPE_LIB_PATH/amd64/$FREETYPE_LIB_NAME"; then
-        # On solaris-x86_86, default is (normally) PATH/lib/amd64. Update our guess!
-        POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH/amd64"
+      elif test "x$OPENJDK_TARGET_OS" = xsolaris \
+          && test -s "$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR/$FREETYPE_LIB_NAME"; then
+        # Found lib in isa dir, use that instead.
+        POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR"
       fi
     fi
   fi
@@ -45569,9 +45576,10 @@
 $as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/freetype.lib. Ignoring location." >&6;}
           FOUND_FREETYPE=no
         fi
-      elif test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64 && test -s "$POTENTIAL_FREETYPE_LIB_PATH/amd64/$FREETYPE_LIB_NAME"; then
-        # On solaris-x86_86, default is (normally) PATH/lib/amd64. Update our guess!
-        POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH/amd64"
+      elif test "x$OPENJDK_TARGET_OS" = xsolaris \
+          && test -s "$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR/$FREETYPE_LIB_NAME"; then
+        # Found lib in isa dir, use that instead.
+        POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR"
       fi
     fi
   fi
@@ -45860,9 +45868,10 @@
 $as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/freetype.lib. Ignoring location." >&6;}
           FOUND_FREETYPE=no
         fi
-      elif test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64 && test -s "$POTENTIAL_FREETYPE_LIB_PATH/amd64/$FREETYPE_LIB_NAME"; then
-        # On solaris-x86_86, default is (normally) PATH/lib/amd64. Update our guess!
-        POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH/amd64"
+      elif test "x$OPENJDK_TARGET_OS" = xsolaris \
+          && test -s "$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR/$FREETYPE_LIB_NAME"; then
+        # Found lib in isa dir, use that instead.
+        POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR"
       fi
     fi
   fi
@@ -46151,9 +46160,10 @@
 $as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/freetype.lib. Ignoring location." >&6;}
           FOUND_FREETYPE=no
         fi
-      elif test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64 && test -s "$POTENTIAL_FREETYPE_LIB_PATH/amd64/$FREETYPE_LIB_NAME"; then
-        # On solaris-x86_86, default is (normally) PATH/lib/amd64. Update our guess!
-        POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH/amd64"
+      elif test "x$OPENJDK_TARGET_OS" = xsolaris \
+          && test -s "$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR/$FREETYPE_LIB_NAME"; then
+        # Found lib in isa dir, use that instead.
+        POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR"
       fi
     fi
   fi
@@ -48566,8 +48576,8 @@
     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MEMORY_SIZE MB" >&5
 $as_echo "$MEMORY_SIZE MB" >&6; }
   else
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: could not detect memory size, defaulting to 1024 MB" >&5
-$as_echo "could not detect memory size, defaulting to 1024 MB" >&6; }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: could not detect memory size, defaulting to $MEMORY_SIZE MB" >&5
+$as_echo "could not detect memory size, defaulting to $MEMORY_SIZE MB" >&6; }
     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: This might seriously impact build performance!" >&5
 $as_echo "$as_me: WARNING: This might seriously impact build performance!" >&2;}
   fi
--- a/common/autoconf/libraries.m4	Thu May 01 17:57:29 2014 -0700
+++ b/common/autoconf/libraries.m4	Fri May 02 19:00:04 2014 -0700
@@ -286,9 +286,10 @@
           AC_MSG_NOTICE([Could not find $POTENTIAL_FREETYPE_LIB_PATH/freetype.lib. Ignoring location.])
           FOUND_FREETYPE=no
         fi
-      elif test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64 && test -s "$POTENTIAL_FREETYPE_LIB_PATH/amd64/$FREETYPE_LIB_NAME"; then
-        # On solaris-x86_86, default is (normally) PATH/lib/amd64. Update our guess!
-        POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH/amd64"
+      elif test "x$OPENJDK_TARGET_OS" = xsolaris \
+          && test -s "$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR/$FREETYPE_LIB_NAME"; then
+        # Found lib in isa dir, use that instead.
+        POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR"
       fi
     fi
   fi
--- a/common/autoconf/spec.gmk.in	Thu May 01 17:57:29 2014 -0700
+++ b/common/autoconf/spec.gmk.in	Fri May 02 19:00:04 2014 -0700
@@ -261,6 +261,7 @@
 
 # Information about the build system
 NUM_CORES:=@NUM_CORES@
+MEMORY_SIZE:=@MEMORY_SIZE@
 # Enable sjavac support = use a javac server,
 # multi core javac compilation and dependency tracking.
 ENABLE_SJAVAC:=@ENABLE_SJAVAC@
--- a/common/bin/hgforest.sh	Thu May 01 17:57:29 2014 -0700
+++ b/common/bin/hgforest.sh	Fri May 02 19:00:04 2014 -0700
@@ -72,12 +72,21 @@
       exit 1
 }
 
-
 if [ "x" = "x$command" ] ; then
   echo "ERROR: No command to hg supplied!"
   usage
 fi
 
+# Check if we can use fifos for monitoring sub-process completion.
+on_windows=`uname -s | egrep -ic -e 'cygwin|msys'`
+if [ ${on_windows} = "1" ]; then
+  # cygwin has (2014-04-18) broken (single writer only) FIFOs
+  # msys has (2014-04-18) no FIFOs.
+  have_fifos="false"
+else
+  have_fifos="true"
+fi
+
 # Clean out the temporary directory that stores the pid files.
 tmp=/tmp/forest.$$
 rm -f -r ${tmp}
@@ -210,7 +219,19 @@
   ) &
 else
   # Run the supplied command on all repos in parallel.
+
+  # n is the number of subprocess started or which might still be running.
   n=0
+  if [ $have_fifos = "true" ]; then
+    # if we have fifos use them to detect command completion.
+    mkfifo ${tmp}/fifo
+    exec 3<>${tmp}/fifo
+    if [ "${sflag}" = "true" ] ; then
+      # force sequential
+      at_a_time=1
+    fi
+  fi
+
   for i in ${repos} ${repos_extra} ; do
     n=`expr ${n} '+' 1`
     repopidfile=`echo ${i} | sed -e 's@./@@' -e 's@/@_@g'`
@@ -221,10 +242,11 @@
           pull_base="${pull_extra}"
       fi
     done
+    pull_base="`echo ${pull_base} | sed -e 's@[/]*$@@'`"
     (
       (
         if [ "${command}" = "clone" -o "${command}" = "fclone" -o "${command}" = "tclone" ] ; then
-          pull_newrepo="`echo ${pull_base}/${i} | sed -e 's@\([^:]/\)//*@\1@g'`"
+          pull_newrepo="${pull_base}/${i}"
           path="`dirname ${i}`"
           if [ "${path}" != "." ] ; then
             times=0
@@ -237,7 +259,7 @@
               sleep 5
             done
           fi
-          echo "hg clone ${pull_newrepo} ${i}" > ${status_output}
+          echo "hg${global_opts} clone ${pull_newrepo} ${i}" > ${status_output}
           (PYTHONUNBUFFERED=true hg${global_opts} clone ${pull_newrepo} ${i}; echo "$?" > ${tmp}/${repopidfile}.pid.rc ) 2>&1 &
         else
           echo "cd ${i} && hg${global_opts} ${command} ${command_args}" > ${status_output}
@@ -246,21 +268,41 @@
 
         echo $! > ${tmp}/${repopidfile}.pid
       ) 2>&1 | sed -e "s@^@${reponame}:   @" > ${status_output}
+      if [ $have_fifos = "true" ]; then
+        echo "${reponame}" >&3
+      fi
     ) &
 
-    if [ `expr ${n} '%' ${at_a_time}` -eq 0 -a "${sflag}" = "false" ] ; then
-      sleep 2
-      echo "Waiting 5 secs before spawning next background command." > ${status_output}
-      sleep 3
-    fi
-
-    if [ "${sflag}" = "true" ] ; then
+    if [ $have_fifos = "true" ]; then
+      # check on count of running subprocesses and possibly wait for completion
+      if [ ${at_a_time} -lt ${n} ] ; then
+        # read will block until there are completed subprocesses
+        while read repo_done; do
+          n=`expr ${n} '-' 1`
+          if [ ${n} -lt ${at_a_time} ] ; then
+            # we should start more subprocesses
+            break;
+          fi
+        done <&3
+      fi
+    else
+      if [ "${sflag}" = "false" ] ; then
+        # Compare completions to starts
+        completed="`(ls -1 ${tmp}/*.pid.rc 2> /dev/null | wc -l) || echo 0`"
+        while [ ${at_a_time} -lt `expr ${n} '-' ${completed}` ] ; do
+          # sleep a short time to give time for something to complete
+          sleep 1
+          completed="`(ls -1 ${tmp}/*.pid.rc 2> /dev/null | wc -l) || echo 0`"
+        done
+      else
+        # complete this task before starting another.
         wait
+      fi
     fi
   done
 fi
 
-# Wait for all hg commands to complete
+# Wait for all subprocesses to complete
 wait
 
 # Terminate with exit 0 only if all subprocesses were successful
@@ -270,7 +312,7 @@
     exit_code=`cat ${rc} | tr -d ' \n\r'`
     if [ "${exit_code}" != "0" ] ; then
       repo="`echo ${rc} | sed -e s@^${tmp}@@ -e 's@/*\([^/]*\)\.pid\.rc$@\1@' -e 's@_@/@g'`"
-      echo "WARNING: ${repo} exited abnormally." > ${status_output}
+      echo "WARNING: ${repo} exited abnormally ($exit_code)" > ${status_output}
       ec=1
     fi
   done
--- a/common/src/fixpath.c	Thu May 01 17:57:29 2014 -0700
+++ b/common/src/fixpath.c	Fri May 02 19:00:04 2014 -0700
@@ -109,7 +109,7 @@
 
 void append(char **b, size_t *bl, size_t *u, char *add, size_t addlen)
 {
-  while ( (addlen+*u+1) > *bl) {
+  while ((addlen+*u+1) > *bl) {
     *bl *= 2;
     *b = (char*) realloc(*b, *bl);
   }
@@ -118,7 +118,7 @@
 }
 
 /*
- * Creates a new string from in where the first occurance of sub is
+ * Creates a new string from in where the first occurrence of sub is
  * replaced by rep.
  */
 char *replace_substring(char *in, char *sub, char *rep)
@@ -246,7 +246,7 @@
   }
 
   buffer = (char*) malloc(buflen);
-  while((blocklen = fread(block,1,sizeof(block),atin)) > 0) {
+  while ((blocklen = fread(block, 1, sizeof(block), atin)) > 0) {
     append(&buffer, &buflen, &used, block, blocklen);
   }
   buffer[used] = 0;
@@ -280,16 +280,21 @@
   char *current = quoted;
   int pass;
 
-  if(strpbrk(in_arg, " \t\n\v\r\\\"") == NULL) {
+  if (strlen(in_arg) == 0) {
+     // empty string? explicitly quote it.
+     return _strdup("\"\"");
+  }
+
+  if (strpbrk(in_arg, " \t\n\v\r\\\"") == NULL) {
      return _strdup(in_arg);
   }
 
   // process the arg twice. Once to calculate the size and then to copy it.
-  for(pass=1; pass<=2; pass++) {
+  for (pass=1; pass<=2; pass++) {
     char const *arg = in_arg;
 
     // initial "
-    if(pass == 2) {
+    if (pass == 2) {
       *current = '\"';
     }
     current++;
@@ -328,7 +333,7 @@
         *current = *arg;
       }
       current++;
-    } while( *arg++ != '\0');
+    } while (*arg++ != '\0');
 
     // allocate the buffer
     if (pass == 1) {
@@ -362,7 +367,7 @@
 
     if (getenv("DEBUG_FIXPATH") != NULL) {
       char const * cmdline = GetCommandLine();
-      fprintf(stderr, "fixpath input line >%s<\n", strstr( cmdline , argv[1]));
+      fprintf(stderr, "fixpath input line >%s<\n", strstr(cmdline, argv[1]));
     }
 
     if (argv[1][1] == 'c' && argv[1][2] == '\0') {
@@ -399,7 +404,7 @@
         }
 
         rc = SetEnvironmentVariable(var, val);
-        if(!rc) {
+        if (!rc) {
           // Could not set var for some reason.  Try to report why.
           const int msg_len = 80 + var_len + strlen(val);
           char * msg = (char *) alloca(msg_len);
@@ -422,7 +427,7 @@
     // handle command and it's args.
     while (i < argc) {
       char const *replaced = replace_cygdrive(argv[i]);
-      if(replaced[0] == '@') {
+      if (replaced[0] == '@') {
         // Found at-file! Fix it!
         replaced = fix_at_file(replaced);
       }
@@ -433,7 +438,7 @@
     // determine the length of the line
     line = NULL;
     // args
-    for(i = cmd; i < argc; i++) {
+    for (i = cmd; i < argc; i++) {
       line += (ptrdiff_t) strlen(argv[i]);
     }
     // spaces and null
@@ -443,7 +448,7 @@
 
     // copy in args.
     current = line;
-    for(i = cmd; i < argc; i++) {
+    for (i = cmd; i < argc; i++) {
       ptrdiff_t len = strlen(argv[i]);
       if (i != cmd) {
         *current++ = ' ';
@@ -457,16 +462,16 @@
       fprintf(stderr, "fixpath converted line >%s<\n", line);
     }
 
-    if(cmd == argc) {
+    if (cmd == argc) {
        if (getenv("DEBUG_FIXPATH") != NULL) {
          fprintf(stderr, "fixpath no command provided!\n");
        }
        exit(0);
     }
 
-    ZeroMemory(&si,sizeof(si));
+    ZeroMemory(&si, sizeof(si));
     si.cb=sizeof(si);
-    ZeroMemory(&pi,sizeof(pi));
+    ZeroMemory(&pi, sizeof(pi));
 
     fflush(stderr);
     fflush(stdout);
@@ -481,14 +486,14 @@
                        NULL,
                        &si,
                        &pi);
-    if(!rc) {
+    if (!rc) {
       // Could not start process for some reason.  Try to report why:
       report_error("Could not start process!");
       exit(126);
     }
 
-    WaitForSingleObject(pi.hProcess,INFINITE);
-    GetExitCodeProcess(pi.hProcess,&exitCode);
+    WaitForSingleObject(pi.hProcess, INFINITE);
+    GetExitCodeProcess(pi.hProcess, &exitCode);
 
     if (getenv("DEBUG_FIXPATH") != NULL) {
       for (i=0; i<num_files_to_delete; ++i) {
--- a/corba/.hgtags	Thu May 01 17:57:29 2014 -0700
+++ b/corba/.hgtags	Fri May 02 19:00:04 2014 -0700
@@ -250,3 +250,7 @@
 167c39eb44731a5d66770d0f00e231164653a2ff jdk9-b05
 a4bf701ac316946c2e5e83138ad8e687da6a4b30 jdk9-b06
 6c8563600a71394c949405189ddd66267a88d8cd jdk9-b07
+2da7fead826bc27f193c7d63048c2cf100a8809c jdk9-b08
+1a3a4f48515dbf1cff37279691b2fb74f228298d jdk9-b09
+3bd4039dfc632fd7fc8418a25a3dcc34d1cd4019 jdk9-b10
+77ea0a2503582a28e4e66be7239a49a0d1dd313f jdk9-b11
--- a/corba/src/share/classes/com/sun/corba/se/impl/io/ObjectStreamClass.java	Thu May 01 17:57:29 2014 -0700
+++ b/corba/src/share/classes/com/sun/corba/se/impl/io/ObjectStreamClass.java	Fri May 02 19:00:04 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -52,6 +52,7 @@
 import java.io.DataOutputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.InvalidClassException;
+import java.io.Externalizable;
 import java.io.Serializable;
 
 import java.util.Arrays;
@@ -80,15 +81,15 @@
     public static final long kDefaultUID = -1;
 
     private static Object noArgsList[] = {};
-    private static Class noTypesList[] = {};
+    private static Class<?> noTypesList[] = {};
 
     /** true if represents enum type */
     private boolean isEnum;
 
     private static final Bridge bridge =
-        (Bridge)AccessController.doPrivileged(
-            new PrivilegedAction() {
-                public Object run() {
+        AccessController.doPrivileged(
+            new PrivilegedAction<Bridge>() {
+                public Bridge run() {
                     return Bridge.get() ;
                 }
             }
@@ -98,7 +99,7 @@
      * is returned if the specified class does not implement
      * java.io.Serializable or java.io.Externalizable.
      */
-    static final ObjectStreamClass lookup(Class cl)
+    static final ObjectStreamClass lookup(Class<?> cl)
     {
         ObjectStreamClass desc = lookupInternal(cl);
         if (desc.isSerializable() || desc.isExternalizable())
@@ -110,7 +111,7 @@
      * Find the class descriptor for the specified class.
      * Package access only so it can be called from ObjectIn/OutStream.
      */
-    static ObjectStreamClass lookupInternal(Class cl)
+    static ObjectStreamClass lookupInternal(Class<?> cl)
     {
         /* Synchronize on the hashtable so no two threads will do
          * this at the same time.
@@ -121,14 +122,14 @@
             desc = findDescriptorFor(cl);
             if (desc == null) {
                 /* Check if it's serializable */
-                boolean serializable = classSerializable.isAssignableFrom(cl);
+                boolean serializable = Serializable.class.isAssignableFrom(cl);
 
                 /* If the class is only Serializable,
                  * lookup the descriptor for the superclass.
                  */
                 ObjectStreamClass superdesc = null;
                 if (serializable) {
-                    Class superclass = cl.getSuperclass();
+                    Class<?> superclass = cl.getSuperclass();
                     if (superclass != null)
                         superdesc = lookup(superclass);
                 }
@@ -141,7 +142,7 @@
                 if (serializable) {
                     externalizable =
                         ((superdesc != null) && superdesc.isExternalizable()) ||
-                        classExternalizable.isAssignableFrom(cl);
+                        Externalizable.class.isAssignableFrom(cl);
                     if (externalizable) {
                         serializable = false;
                     }
@@ -185,7 +186,7 @@
      * that have evolved from a common root class and agree to be serialized
      * and deserialized using a common format.
      */
-    public static final long getSerialVersionUID( java.lang.Class clazz) {
+    public static final long getSerialVersionUID( java.lang.Class<?> clazz) {
         ObjectStreamClass theosc = ObjectStreamClass.lookup( clazz );
         if( theosc != null )
         {
@@ -219,7 +220,7 @@
     /**
      * Return the actual (computed) serialVersionUID for this class.
      */
-    public static final long getActualSerialVersionUID( java.lang.Class clazz )
+    public static final long getActualSerialVersionUID( java.lang.Class<?> clazz )
     {
         ObjectStreamClass theosc = ObjectStreamClass.lookup( clazz );
         if( theosc != null )
@@ -249,7 +250,7 @@
      * Return the class in the local VM that this version is mapped to.
      * Null is returned if there is no corresponding local class.
      */
-    public final Class forClass() {
+    public final Class<?> forClass() {
         return ofClass;
     }
 
@@ -349,7 +350,7 @@
      * Create a new ObjectStreamClass from a loaded class.
      * Don't call this directly, call lookup instead.
      */
-    private ObjectStreamClass(java.lang.Class cl, ObjectStreamClass superdesc,
+    private ObjectStreamClass(java.lang.Class<?> cl, ObjectStreamClass superdesc,
                               boolean serial, boolean extern)
     {
         ofClass = cl;           /* created from this class */
@@ -433,7 +434,7 @@
         if (initialized)
             return;
 
-        final Class cl = ofClass;
+        final Class<?> cl = ofClass;
 
         if (!serializable ||
             externalizable ||
@@ -561,9 +562,9 @@
                      * will call it as necessary.
                      */
                     writeObjectMethod = getPrivateMethod( cl, "writeObject",
-                        new Class[] { java.io.ObjectOutputStream.class }, Void.TYPE ) ;
+                        new Class<?>[] { java.io.ObjectOutputStream.class }, Void.TYPE ) ;
                     readObjectMethod = getPrivateMethod( cl, "readObject",
-                        new Class[] { java.io.ObjectInputStream.class }, Void.TYPE ) ;
+                        new Class<?>[] { java.io.ObjectInputStream.class }, Void.TYPE ) ;
                 }
                 return null;
             }
@@ -589,9 +590,9 @@
      * class, or null if none found.  Access checks are disabled on the
      * returned method (if any).
      */
-    private static Method getPrivateMethod(Class cl, String name,
-                                           Class[] argTypes,
-                                           Class returnType)
+    private static Method getPrivateMethod(Class<?> cl, String name,
+                                           Class<?>[] argTypes,
+                                           Class<?> returnType)
     {
         try {
             Method meth = cl.getDeclaredMethod(name, argTypes);
@@ -653,7 +654,7 @@
      * Fill in the reflected Fields that will be used
      * for reading.
      */
-    final void setClass(Class cl) throws InvalidClassException {
+    final void setClass(Class<?> cl) throws InvalidClassException {
 
         if (cl == null) {
             localClassDesc = null;
@@ -920,9 +921,9 @@
      * Access checks are disabled on the returned constructor (if any), since
      * the defining class may still be non-public.
      */
-    private static Constructor getExternalizableConstructor(Class cl) {
+    private static Constructor getExternalizableConstructor(Class<?> cl) {
         try {
-            Constructor cons = cl.getDeclaredConstructor(new Class[0]);
+            Constructor cons = cl.getDeclaredConstructor(new Class<?>[0]);
             cons.setAccessible(true);
             return ((cons.getModifiers() & Modifier.PUBLIC) != 0) ?
                 cons : null;
@@ -936,15 +937,15 @@
      * superclass, or null if none found.  Access checks are disabled on the
      * returned constructor (if any).
      */
-    private static Constructor getSerializableConstructor(Class cl) {
-        Class initCl = cl;
+    private static Constructor getSerializableConstructor(Class<?> cl) {
+        Class<?> initCl = cl;
         while (Serializable.class.isAssignableFrom(initCl)) {
             if ((initCl = initCl.getSuperclass()) == null) {
                 return null;
             }
         }
         try {
-            Constructor cons = initCl.getDeclaredConstructor(new Class[0]);
+            Constructor cons = initCl.getDeclaredConstructor(new Class<?>[0]);
             int mods = cons.getModifiers();
             if ((mods & Modifier.PRIVATE) != 0 ||
                 ((mods & (Modifier.PUBLIC | Modifier.PROTECTED)) == 0 &&
@@ -1049,7 +1050,7 @@
      * items to the hash accumulating in the digest stream.
      * Fold the hash into a long.  Use the SHA secure hash function.
      */
-    private static long _computeSerialVersionUID(Class cl) {
+    private static long _computeSerialVersionUID(Class<?> cl) {
         if (DEBUG_SVUID)
             msg( "Computing SerialVersionUID for " + cl ) ;
         ByteArrayOutputStream devnull = new ByteArrayOutputStream(512);
@@ -1103,7 +1104,7 @@
                  * them from its computation.
                  */
 
-                Class interfaces[] = cl.getInterfaces();
+                Class<?> interfaces[] = cl.getInterfaces();
                 Arrays.sort(interfaces, compareClassByName);
 
                 for (int i = 0; i < interfaces.length; i++) {
@@ -1233,7 +1234,7 @@
         return h;
     }
 
-    private static long computeStructuralUID(com.sun.corba.se.impl.io.ObjectStreamClass osc, Class cl) {
+    private static long computeStructuralUID(com.sun.corba.se.impl.io.ObjectStreamClass osc, Class<?> cl) {
         ByteArrayOutputStream devnull = new ByteArrayOutputStream(512);
 
         long h = 0;
@@ -1253,7 +1254,7 @@
             DataOutputStream data = new DataOutputStream(mdo);
 
             // Get SUID of parent
-            Class parent = cl.getSuperclass();
+            Class<?> parent = cl.getSuperclass();
             if ((parent != null))
             // SerialBug 1; acc. to spec the one for
             // java.lang.object
@@ -1309,10 +1310,10 @@
     /**
      * Compute the JVM signature for the class.
      */
-    static String getSignature(Class clazz) {
+    static String getSignature(Class<?> clazz) {
         String type = null;
         if (clazz.isArray()) {
-            Class cl = clazz;
+            Class<?> cl = clazz;
             int dimensions = 0;
             while (cl.isArray()) {
                 dimensions++;
@@ -1358,7 +1359,7 @@
 
         sb.append("(");
 
-        Class[] params = meth.getParameterTypes(); // avoid clone
+        Class<?>[] params = meth.getParameterTypes(); // avoid clone
         for (int j = 0; j < params.length; j++) {
             sb.append(getSignature(params[j]));
         }
@@ -1375,7 +1376,7 @@
 
         sb.append("(");
 
-        Class[] params = cons.getParameterTypes(); // avoid clone
+        Class<?>[] params = cons.getParameterTypes(); // avoid clone
         for (int j = 0; j < params.length; j++) {
             sb.append(getSignature(params[j]));
         }
@@ -1395,7 +1396,7 @@
      * The entries are extended from java.lang.ref.SoftReference so the
      * gc will be able to free them if needed.
      */
-    private static ObjectStreamClass findDescriptorFor(Class cl) {
+    private static ObjectStreamClass findDescriptorFor(Class<?> cl) {
 
         int hash = cl.hashCode();
         int index = (hash & 0x7FFFFFFF) % descriptorFor.length;
@@ -1442,7 +1443,7 @@
         descriptorFor[index] = e;
     }
 
-    private static Field[] getDeclaredFields(final Class clz) {
+    private static Field[] getDeclaredFields(final Class<?> clz) {
         return (Field[]) AccessController.doPrivileged(new PrivilegedAction() {
             public Object run() {
                 return clz.getDeclaredFields();
@@ -1476,7 +1477,7 @@
     /*
      * Class that is a descriptor for in this virtual machine.
      */
-    private Class ofClass;
+    private Class<?> ofClass;
 
     /*
      * True if descriptor for a proxy class.
@@ -1548,30 +1549,17 @@
      * Returns true if the given class defines a static initializer method,
      * false otherwise.
      */
-    private static boolean hasStaticInitializer(Class cl) {
+    private static boolean hasStaticInitializer(Class<?> cl) {
         if (hasStaticInitializerMethod == null) {
-            Class classWithThisMethod = null;
+            Class<?> classWithThisMethod = null;
 
             try {
-                try {
-                    // When using rip-int with Merlin or when this is a Merlin
-                    // workspace, the method we want is in sun.misc.ClassReflector
-                    // and absent from java.io.ObjectStreamClass.
-                    //
-                    // When compiling rip-int with JDK 1.3.x, we have to get it
-                    // from java.io.ObjectStreamClass.
-                    classWithThisMethod = Class.forName("sun.misc.ClassReflector");
-                } catch (ClassNotFoundException cnfe) {
-                    // Do nothing.  This is either not a Merlin workspace,
-                    // or rip-int is being compiled with something other than
-                    // Merlin, probably JDK 1.3.  Fall back on java.io.ObjectStreaClass.
-                }
                 if (classWithThisMethod == null)
                     classWithThisMethod = java.io.ObjectStreamClass.class;
 
                 hasStaticInitializerMethod =
                     classWithThisMethod.getDeclaredMethod("hasStaticInitializer",
-                                                          new Class[] { Class.class });
+                                                          new Class<?>[] { Class.class });
             } catch (NoSuchMethodException ex) {
             }
 
@@ -1596,22 +1584,6 @@
     }
 
 
-    /* The Class Object for java.io.Serializable */
-    private static Class classSerializable = null;
-    private static Class classExternalizable = null;
-
-    /*
-     * Resolve java.io.Serializable at load time.
-     */
-    static {
-        try {
-            classSerializable = Class.forName("java.io.Serializable");
-            classExternalizable = Class.forName("java.io.Externalizable");
-        } catch (Throwable e) {
-            System.err.println("Could not load java.io.Serializable or java.io.Externalizable.");
-        }
-    }
-
     /** use serialVersionUID from JDK 1.1. for interoperability */
     private static final long serialVersionUID = -6120832682080437368L;
 
@@ -1649,8 +1621,8 @@
 
     private static class CompareClassByName implements Comparator {
         public int compare(Object o1, Object o2) {
-            Class c1 = (Class)o1;
-            Class c2 = (Class)o2;
+            Class<?> c1 = (Class)o1;
+            Class<?> c2 = (Class)o2;
             return (c1.getName()).compareTo(c2.getName());
         }
     }
@@ -1764,12 +1736,12 @@
      *
      * Copied from the Merlin java.io.ObjectStreamClass.
      */
-    private static Method getInheritableMethod(Class cl, String name,
-                                               Class[] argTypes,
-                                               Class returnType)
+    private static Method getInheritableMethod(Class<?> cl, String name,
+                                               Class<?>[] argTypes,
+                                               Class<?> returnType)
     {
         Method meth = null;
-        Class defCl = cl;
+        Class<?> defCl = cl;
         while (defCl != null) {
             try {
                 meth = defCl.getDeclaredMethod(name, argTypes);
@@ -1801,7 +1773,7 @@
      *
      * Copied from the Merlin java.io.ObjectStreamClass.
      */
-    private static boolean packageEquals(Class cl1, Class cl2) {
+    private static boolean packageEquals(Class<?> cl1, Class<?> cl2) {
         Package pkg1 = cl1.getPackage(), pkg2 = cl2.getPackage();
         return ((pkg1 == pkg2) || ((pkg1 != null) && (pkg1.equals(pkg2))));
     }
--- a/corba/src/share/classes/com/sun/corba/se/impl/orbutil/ObjectStreamClassUtil_1_3.java	Thu May 01 17:57:29 2014 -0700
+++ b/corba/src/share/classes/com/sun/corba/se/impl/orbutil/ObjectStreamClassUtil_1_3.java	Fri May 02 19:00:04 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -94,7 +94,7 @@
         });
     }
 
-    public static long computeStructuralUID(boolean hasWriteObject, Class cl) {
+    public static long computeStructuralUID(boolean hasWriteObject, Class<?> cl) {
         ByteArrayOutputStream devnull = new ByteArrayOutputStream(512);
 
         long h = 0;
@@ -119,7 +119,7 @@
             // Object method in there
 
             // Get SUID of parent
-            Class parent = cl.getSuperclass();
+            Class<?> parent = cl.getSuperclass();
             if ((parent != null) && (parent != java.lang.Object.class)) {
                 boolean hasWriteObjectFlag = false;
                 Class [] args = {java.io.ObjectOutputStream.class};
@@ -503,19 +503,6 @@
             Class classWithThisMethod = null;
 
             try {
-                try {
-                    // When using rip-int with Merlin or when this is a Merlin
-                    // workspace, the method we want is in sun.misc.ClassReflector
-                    // and absent from java.io.ObjectStreamClass.
-                    //
-                    // When compiling rip-int with JDK 1.3.x, we have to get it
-                    // from java.io.ObjectStreamClass.
-                    classWithThisMethod = Class.forName("sun.misc.ClassReflector");
-                } catch (ClassNotFoundException cnfe) {
-                    // Do nothing.  This is either not a Merlin workspace,
-                    // or rip-int is being compiled with something other than
-                    // Merlin, probably JDK 1.3.  Fall back on java.io.ObjectStreaClass.
-                }
                 if (classWithThisMethod == null)
                     classWithThisMethod = java.io.ObjectStreamClass.class;
 
--- a/corba/src/share/classes/com/sun/corba/se/impl/orbutil/ObjectStreamClass_1_3_1.java	Thu May 01 17:57:29 2014 -0700
+++ b/corba/src/share/classes/com/sun/corba/se/impl/orbutil/ObjectStreamClass_1_3_1.java	Fri May 02 19:00:04 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -53,6 +53,7 @@
 import java.io.ByteArrayOutputStream;
 import java.io.InvalidClassException;
 import java.io.Serializable;
+import java.io.Externalizable;
 
 import java.util.Arrays;
 import java.util.Comparator;
@@ -88,7 +89,7 @@
     public static final long kDefaultUID = -1;
 
     private static Object noArgsList[] = {};
-    private static Class noTypesList[] = {};
+    private static Class<?> noTypesList[] = {};
 
     private static Hashtable translatedFields;
 
@@ -96,7 +97,7 @@
      * is returned if the specified class does not implement
      * java.io.Serializable or java.io.Externalizable.
      */
-    static final ObjectStreamClass_1_3_1 lookup(Class cl)
+    static final ObjectStreamClass_1_3_1 lookup(Class<?> cl)
     {
         ObjectStreamClass_1_3_1 desc = lookupInternal(cl);
         if (desc.isSerializable() || desc.isExternalizable())
@@ -108,7 +109,7 @@
      * Find the class descriptor for the specified class.
      * Package access only so it can be called from ObjectIn/OutStream.
      */
-    static ObjectStreamClass_1_3_1 lookupInternal(Class cl)
+    static ObjectStreamClass_1_3_1 lookupInternal(Class<?> cl)
     {
         /* Synchronize on the hashtable so no two threads will do
          * this at the same time.
@@ -122,13 +123,13 @@
             }
 
                 /* Check if it's serializable */
-                boolean serializable = classSerializable.isAssignableFrom(cl);
+                boolean serializable = Serializable.class.isAssignableFrom(cl);
                 /* If the class is only Serializable,
                  * lookup the descriptor for the superclass.
                  */
                 ObjectStreamClass_1_3_1 superdesc = null;
                 if (serializable) {
-                    Class superclass = cl.getSuperclass();
+                    Class<?> superclass = cl.getSuperclass();
                     if (superclass != null)
                         superdesc = lookup(superclass);
                 }
@@ -141,7 +142,7 @@
                 if (serializable) {
                     externalizable =
                         ((superdesc != null) && superdesc.isExternalizable()) ||
-                        classExternalizable.isAssignableFrom(cl);
+                        Externalizable.class.isAssignableFrom(cl);
                     if (externalizable) {
                         serializable = false;
                     }
@@ -170,7 +171,7 @@
      * that have evolved from a common root class and agree to be serialized
      * and deserialized using a common format.
      */
-    public static final long getSerialVersionUID( java.lang.Class clazz) {
+    public static final long getSerialVersionUID( java.lang.Class<?> clazz) {
         ObjectStreamClass_1_3_1 theosc = ObjectStreamClass_1_3_1.lookup( clazz );
         if( theosc != null )
         {
@@ -204,7 +205,7 @@
     /**
      * Return the actual (computed) serialVersionUID for this class.
      */
-    public static final long getActualSerialVersionUID( java.lang.Class clazz )
+    public static final long getActualSerialVersionUID( java.lang.Class<?> clazz )
     {
         ObjectStreamClass_1_3_1 theosc = ObjectStreamClass_1_3_1.lookup( clazz );
         if( theosc != null )
@@ -234,7 +235,7 @@
      * Return the class in the local VM that this version is mapped to.
      * Null is returned if there is no corresponding local class.
      */
-    public final Class forClass() {
+    public final Class<?> forClass() {
         return ofClass;
     }
 
@@ -333,7 +334,7 @@
      * Create a new ObjectStreamClass_1_3_1 from a loaded class.
      * Don't call this directly, call lookup instead.
      */
-    private ObjectStreamClass_1_3_1(java.lang.Class cl, ObjectStreamClass_1_3_1 superdesc,
+    private ObjectStreamClass_1_3_1(java.lang.Class<?> cl, ObjectStreamClass_1_3_1 superdesc,
                               boolean serial, boolean extern)
     {
         ofClass = cl;           /* created from this class */
@@ -376,7 +377,7 @@
     private void init() {
       synchronized (lock) {
 
-        final Class cl = ofClass;
+        final Class<?> cl = ofClass;
 
         if (fields != null) // already initialized
                 return;
@@ -558,7 +559,7 @@
                      * will call it as necessary.
                      */
                     try {
-                      Class[] args = {java.io.ObjectOutputStream.class};
+                      Class<?>[] args = {java.io.ObjectOutputStream.class};
                       writeObjectMethod = cl.getDeclaredMethod("writeObject", args);
                       hasWriteObjectMethod = true;
                       int mods = writeObjectMethod.getModifiers();
@@ -578,7 +579,7 @@
                      * ObjectInputStream so it can all the method directly.
                      */
                     try {
-                      Class[] args = {java.io.ObjectInputStream.class};
+                      Class<?>[] args = {java.io.ObjectInputStream.class};
                       readObjectMethod = cl.getDeclaredMethod("readObject", args);
                       int mods = readObjectMethod.getModifiers();
 
@@ -629,11 +630,11 @@
             if (translation != null)
                 return translation;
             else {
-                Class osfClass = com.sun.corba.se.impl.orbutil.ObjectStreamField.class;
+                Class<?> osfClass = com.sun.corba.se.impl.orbutil.ObjectStreamField.class;
 
                 translation = (Object[])java.lang.reflect.Array.newInstance(osfClass, objs.length);
                 Object arg[] = new Object[2];
-                Class types[] = {String.class, Class.class};
+                Class<?> types[] = {String.class, Class.class};
                 Constructor constructor = osfClass.getDeclaredConstructor(types);
                 for (int i = fields.length -1; i >= 0; i--){
                     arg[0] = fields[i].getName();
@@ -804,7 +805,7 @@
         }
     }
 
-    private static long computeStructuralUID(ObjectStreamClass_1_3_1 osc, Class cl) {
+    private static long computeStructuralUID(ObjectStreamClass_1_3_1 osc, Class<?> cl) {
         ByteArrayOutputStream devnull = new ByteArrayOutputStream(512);
 
         long h = 0;
@@ -824,7 +825,7 @@
             DataOutputStream data = new DataOutputStream(mdo);
 
             // Get SUID of parent
-            Class parent = cl.getSuperclass();
+            Class<?> parent = cl.getSuperclass();
             if ((parent != null))
             // SerialBug 1; acc. to spec the one for
             // java.lang.object
@@ -910,10 +911,10 @@
     /**
      * Compute the JVM signature for the class.
      */
-    static String getSignature(Class clazz) {
+    static String getSignature(Class<?> clazz) {
         String type = null;
         if (clazz.isArray()) {
-            Class cl = clazz;
+            Class<?> cl = clazz;
             int dimensions = 0;
             while (cl.isArray()) {
                 dimensions++;
@@ -959,7 +960,7 @@
 
         sb.append("(");
 
-        Class[] params = meth.getParameterTypes(); // avoid clone
+        Class<?>[] params = meth.getParameterTypes(); // avoid clone
         for (int j = 0; j < params.length; j++) {
             sb.append(getSignature(params[j]));
         }
@@ -976,7 +977,7 @@
 
         sb.append("(");
 
-        Class[] params = cons.getParameterTypes(); // avoid clone
+        Class<?>[] params = cons.getParameterTypes(); // avoid clone
         for (int j = 0; j < params.length; j++) {
             sb.append(getSignature(params[j]));
         }
@@ -996,7 +997,7 @@
      * The entries are extended from java.lang.ref.SoftReference so the
      * gc will be able to free them if needed.
      */
-    private static ObjectStreamClass_1_3_1 findDescriptorFor(Class cl) {
+    private static ObjectStreamClass_1_3_1 findDescriptorFor(Class<?> cl) {
 
         int hash = cl.hashCode();
         int index = (hash & 0x7FFFFFFF) % descriptorFor.length;
@@ -1077,7 +1078,7 @@
     /*
      * Class that is a descriptor for in this virtual machine.
      */
-    private Class ofClass;
+    private Class<?> ofClass;
 
     /*
      * True if descriptor for a proxy class.
@@ -1130,22 +1131,6 @@
     /* Get the private static final field for serial version UID */
     // private static native long getSerialVersionUIDField(Class cl);
 
-    /* The Class Object for java.io.Serializable */
-    private static Class classSerializable = null;
-    private static Class classExternalizable = null;
-
-    /*
-     * Resolve java.io.Serializable at load time.
-     */
-    static {
-        try {
-            classSerializable = Class.forName("java.io.Serializable");
-            classExternalizable = Class.forName("java.io.Externalizable");
-        } catch (Throwable e) {
-            System.err.println("Could not load java.io.Serializable or java.io.Externalizable.");
-        }
-    }
-
     /** use serialVersionUID from JDK 1.1. for interoperability */
     private static final long serialVersionUID = -6120832682080437368L;
 
@@ -1183,8 +1168,8 @@
 
     private static class CompareClassByName implements Comparator {
         public int compare(Object o1, Object o2) {
-            Class c1 = (Class)o1;
-            Class c2 = (Class)o2;
+            Class<?> c1 = (Class)o1;
+            Class<?> c2 = (Class)o2;
             return (c1.getName()).compareTo(c2.getName());
         }
     }
--- a/corba/src/share/classes/org/omg/CORBA/ORB.java	Thu May 01 17:57:29 2014 -0700
+++ b/corba/src/share/classes/org/omg/CORBA/ORB.java	Fri May 02 19:00:04 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,6 +36,8 @@
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 
+import sun.reflect.misc.ReflectUtil;
+
 /**
  * A class providing APIs for the CORBA Object Request Broker
  * features.  The <code>ORB</code> class also provides
@@ -161,6 +163,20 @@
  * <P>
  * An application or applet can be initialized in one or more ORBs.
  * ORB initialization is a bootstrap call into the CORBA world.
+ *
+ *
+ * @implNote
+ * As described above it is possible to specify, at runtime, an alternative ORBSingleton class and
+ * an alternative ORB implementation class, via the system properties {@code org.omg.CORBA.ORBSingletonClass}
+ * and {@code org.omg.CORBA.ORBClass} respectively.
+ * The class loading strategy is organized, such that, in the case of the ORBSingleton
+ * the system class loader is used to load the alternative singleton ORB.
+ * Thus, it is necessary that an application's CLASSPATH
+ * includes the classes for this alternative ORBSingleton, when specified.
+ *
+ * In the case of specifying an alternative ORB implementation class, the loading
+ * strategy will use the thread context class loader, as appropriate.
+ *
  * @since   JDK1.2
  */
 abstract public class ORB {
@@ -289,20 +305,38 @@
                     (className.equals("com.sun.corba.se.impl.orb.ORBSingleton"))) {
                 singleton = new com.sun.corba.se.impl.orb.ORBSingleton();
             } else {
-                singleton = create_impl(className);
+                singleton = create_impl_with_systemclassloader(className);
             }
         }
         return singleton;
     }
 
+   private static ORB create_impl_with_systemclassloader(String className) {
+
+        try {
+            ReflectUtil.checkPackageAccess(className);
+            ClassLoader cl = ClassLoader.getSystemClassLoader();
+            Class<org.omg.CORBA.ORB> orbBaseClass = org.omg.CORBA.ORB.class;
+            Class<?> singletonOrbClass = Class.forName(className, true, cl).asSubclass(orbBaseClass);
+            return (ORB)singletonOrbClass.newInstance();
+        } catch (Throwable ex) {
+            SystemException systemException = new INITIALIZE(
+                "can't instantiate default ORB implementation " + className);
+            systemException.initCause(ex);
+            throw systemException;
+        }
+    }
+
     private static ORB create_impl(String className) {
-
         ClassLoader cl = Thread.currentThread().getContextClassLoader();
         if (cl == null)
             cl = ClassLoader.getSystemClassLoader();
 
         try {
-            return (ORB) Class.forName(className, true, cl).newInstance();
+            ReflectUtil.checkPackageAccess(className);
+            Class<org.omg.CORBA.ORB> orbBaseClass = org.omg.CORBA.ORB.class;
+            Class<?> orbClass = Class.forName(className, true, cl).asSubclass(orbBaseClass);
+            return (ORB)orbClass.newInstance();
         } catch (Throwable ex) {
             SystemException systemException = new INITIALIZE(
                "can't instantiate default ORB implementation " + className);
@@ -346,7 +380,6 @@
         } else {
             orb = create_impl(className);
         }
-
         orb.set_parameters(args, props);
         return orb;
     }
@@ -377,7 +410,6 @@
         } else {
             orb = create_impl(className);
         }
-
         orb.set_parameters(app, props);
         return orb;
     }
@@ -573,7 +605,7 @@
         try {
             // First try to load the OperationDef class
             String opDefClassName = "org.omg.CORBA.OperationDef";
-            Class opDefClass = null;
+            Class<?> opDefClass = null;
 
             ClassLoader cl = Thread.currentThread().getContextClassLoader();
             if ( cl == null )
@@ -583,7 +615,7 @@
 
             // OK, we loaded OperationDef. Now try to get the
             // create_operation_list(OperationDef oper) method.
-            Class[] argc = { opDefClass };
+            Class<?>[] argc = { opDefClass };
             java.lang.reflect.Method meth =
                 this.getClass().getMethod("create_operation_list", argc);
 
--- a/hotspot/.hgtags	Thu May 01 17:57:29 2014 -0700
+++ b/hotspot/.hgtags	Fri May 02 19:00:04 2014 -0700
@@ -410,3 +410,7 @@
 bdc5311e1db7598589b77015119b821bf8c828bd jdk9-b05
 52377a30a3f87b62d6135706997b8c7a47366e37 jdk9-b06
 52f7edf2589d9f9d35db3008bc5377f279de9c18 jdk9-b07
+4dedef5e51ed3a36677a8ba82949fc517ad64162 jdk9-b08
+05e8f5242c26ba45d4fa947e4f4f54c058c9b522 jdk9-b09
+ebc44d040cd149d2120d69fe183a3dae7840f4b4 jdk9-b10
+783309c3a1a629a452673399dcfa83ef7eca94d8 jdk9-b11
--- a/hotspot/make/aix/makefiles/buildtree.make	Thu May 01 17:57:29 2014 -0700
+++ b/hotspot/make/aix/makefiles/buildtree.make	Fri May 02 19:00:04 2014 -0700
@@ -37,7 +37,7 @@
 # GAMMADIR	- top of workspace
 # OS_FAMILY	- operating system
 # VARIANT	- core, compiler1, compiler2, or tiered
-# HOTSPOT_RELEASE_VERSION - <major>.<minor>-b<nn> (11.0-b07)
+# HOTSPOT_RELEASE_VERSION - <major_ver>.<minor_ver>.<micro_ver>[-<identifier>][-<debug_target>][-b<nn>]
 # HOTSPOT_BUILD_VERSION   - internal, internal-$(USER_RELEASE_SUFFIX) or empty
 # JRE_RELEASE_VERSION     - <major>.<minor>.<micro> (1.7.0)
 #
--- a/hotspot/make/aix/makefiles/mapfile-vers-debug	Thu May 01 17:57:29 2014 -0700
+++ b/hotspot/make/aix/makefiles/mapfile-vers-debug	Fri May 02 19:00:04 2014 -0700
@@ -122,7 +122,7 @@
                 JVM_GetClassModifiers;
                 JVM_GetClassName;
                 JVM_GetClassNameUTF;
-		JVM_GetClassSignature;
+                JVM_GetClassSignature;
                 JVM_GetClassSigners;
                 JVM_GetClassTypeAnnotations;
                 JVM_GetComponentType;
@@ -163,6 +163,7 @@
                 JVM_GetStackTraceElement;
                 JVM_GetSystemPackage;
                 JVM_GetSystemPackages;
+                JVM_GetTemporaryDirectory;
                 JVM_GetThreadStateNames;
                 JVM_GetThreadStateValues;
                 JVM_GetVersionInfo;
--- a/hotspot/make/aix/makefiles/mapfile-vers-product	Thu May 01 17:57:29 2014 -0700
+++ b/hotspot/make/aix/makefiles/mapfile-vers-product	Fri May 02 19:00:04 2014 -0700
@@ -161,6 +161,7 @@
                 JVM_GetStackTraceElement;
                 JVM_GetSystemPackage;
                 JVM_GetSystemPackages;
+                JVM_GetTemporaryDirectory;
                 JVM_GetThreadStateNames;
                 JVM_GetThreadStateValues;
                 JVM_GetVersionInfo;
--- a/hotspot/make/aix/makefiles/vm.make	Thu May 01 17:57:29 2014 -0700
+++ b/hotspot/make/aix/makefiles/vm.make	Fri May 02 19:00:04 2014 -0700
@@ -73,17 +73,14 @@
   endif
 endif
 
-# HOTSPOT_RELEASE_VERSION and HOTSPOT_BUILD_VERSION are defined
-# in $(GAMMADIR)/make/defs.make
-ifeq ($(HOTSPOT_BUILD_VERSION),)
-  BUILD_VERSION = -DHOTSPOT_RELEASE_VERSION="\"$(HOTSPOT_RELEASE_VERSION)\""
-else
-  BUILD_VERSION = -DHOTSPOT_RELEASE_VERSION="\"$(HOTSPOT_RELEASE_VERSION)-$(HOTSPOT_BUILD_VERSION)\""
-endif
-
 # The following variables are defined in the generated flags.make file.
-BUILD_VERSION = -DHOTSPOT_RELEASE_VERSION="\"$(HS_BUILD_VER)\""
-JRE_VERSION   = -DJRE_RELEASE_VERSION="\"$(JRE_RELEASE_VER)\""
+JDK_VER_DEFS  = -DJDK_MAJOR_VERSION="\"$(JDK_MAJOR_VERSION)\"" \
+		-DJDK_MINOR_VERSION="\"$(JDK_MINOR_VERSION)\"" \
+		-DJDK_MICRO_VERSION="\"$(JDK_MICRO_VERSION)\"" \
+		-DJDK_BUILD_NUMBER="\"$(JDK_BUILD_NUMBER)\""
+VM_VER_DEFS   = -DHOTSPOT_RELEASE_VERSION="\"$(HS_BUILD_VER)\"" \
+		-DJRE_RELEASE_VERSION="\"$(JRE_RELEASE_VER)\""  \
+		$(JDK_VER_DEFS)
 HS_LIB_ARCH   = -DHOTSPOT_LIB_ARCH=\"$(LIBARCH)\"
 BUILD_TARGET  = -DHOTSPOT_BUILD_TARGET="\"$(TARGET)\""
 BUILD_USER    = -DHOTSPOT_BUILD_USER="\"$(HOTSPOT_BUILD_USER)\""
@@ -92,7 +89,6 @@
 CXXFLAGS =           \
   ${SYSDEFS}         \
   ${INCLUDES}        \
-  ${BUILD_VERSION}   \
   ${BUILD_TARGET}    \
   ${BUILD_USER}      \
   ${HS_LIB_ARCH}     \
@@ -101,7 +97,7 @@
 # This is VERY important! The version define must only be supplied to vm_version.o
 # If not, ccache will not re-use the cache at all, since the version string might contain
 # a time and date.
-CXXFLAGS/vm_version.o += ${JRE_VERSION}
+CXXFLAGS/vm_version.o += ${VM_VER_DEFS}
 
 CXXFLAGS/BYFILE = $(CXXFLAGS/$@)
 
--- a/hotspot/make/bsd/makefiles/buildtree.make	Thu May 01 17:57:29 2014 -0700
+++ b/hotspot/make/bsd/makefiles/buildtree.make	Fri May 02 19:00:04 2014 -0700
@@ -36,7 +36,7 @@
 # GAMMADIR	- top of workspace
 # OS_FAMILY	- operating system
 # VARIANT	- core, compiler1, compiler2, or tiered
-# HOTSPOT_RELEASE_VERSION - <major>.<minor>-b<nn> (11.0-b07)
+# HOTSPOT_RELEASE_VERSION - <major_ver>.<minor_ver>.<micro_ver>[-<identifier>][-<debug_target>][-b<nn>]
 # HOTSPOT_BUILD_VERSION   - internal, internal-$(USER_RELEASE_SUFFIX) or empty
 # JRE_RELEASE_VERSION     - <major>.<minor>.<micro> (1.7.0)
 #
--- a/hotspot/make/bsd/makefiles/mapfile-vers-darwin-debug	Thu May 01 17:57:29 2014 -0700
+++ b/hotspot/make/bsd/makefiles/mapfile-vers-darwin-debug	Fri May 02 19:00:04 2014 -0700
@@ -161,6 +161,7 @@
                 _JVM_GetStackTraceElement
                 _JVM_GetSystemPackage
                 _JVM_GetSystemPackages
+                _JVM_GetTemporaryDirectory
                 _JVM_GetThreadStateNames
                 _JVM_GetThreadStateValues
                 _JVM_GetVersionInfo
--- a/hotspot/make/bsd/makefiles/mapfile-vers-darwin-product	Thu May 01 17:57:29 2014 -0700
+++ b/hotspot/make/bsd/makefiles/mapfile-vers-darwin-product	Fri May 02 19:00:04 2014 -0700
@@ -161,6 +161,7 @@
                 _JVM_GetStackTraceElement
                 _JVM_GetSystemPackage
                 _JVM_GetSystemPackages
+                _JVM_GetTemporaryDirectory
                 _JVM_GetThreadStateNames
                 _JVM_GetThreadStateValues
                 _JVM_GetVersionInfo
--- a/hotspot/make/bsd/makefiles/mapfile-vers-debug	Thu May 01 17:57:29 2014 -0700
+++ b/hotspot/make/bsd/makefiles/mapfile-vers-debug	Fri May 02 19:00:04 2014 -0700
@@ -122,7 +122,7 @@
                 JVM_GetClassModifiers;
                 JVM_GetClassName;
                 JVM_GetClassNameUTF;
-		JVM_GetClassSignature;
+                JVM_GetClassSignature;
                 JVM_GetClassSigners;
                 JVM_GetClassTypeAnnotations;
                 JVM_GetComponentType;
@@ -163,6 +163,7 @@
                 JVM_GetStackTraceElement;
                 JVM_GetSystemPackage;
                 JVM_GetSystemPackages;
+                JVM_GetTemporaryDirectory;
                 JVM_GetThreadStateNames;
                 JVM_GetThreadStateValues;
                 JVM_GetVersionInfo;
--- a/hotspot/make/bsd/makefiles/mapfile-vers-product	Thu May 01 17:57:29 2014 -0700
+++ b/hotspot/make/bsd/makefiles/mapfile-vers-product	Fri May 02 19:00:04 2014 -0700
@@ -163,6 +163,7 @@
                 JVM_GetStackTraceElement;
                 JVM_GetSystemPackage;
                 JVM_GetSystemPackages;
+                JVM_GetTemporaryDirectory;
                 JVM_GetThreadStateNames;
                 JVM_GetThreadStateValues;
                 JVM_GetVersionInfo;
--- a/hotspot/make/bsd/makefiles/vm.make	Thu May 01 17:57:29 2014 -0700
+++ b/hotspot/make/bsd/makefiles/vm.make	Fri May 02 19:00:04 2014 -0700
@@ -72,17 +72,14 @@
   endif
 endif
 
-# HOTSPOT_RELEASE_VERSION and HOTSPOT_BUILD_VERSION are defined
-# in $(GAMMADIR)/make/defs.make
-ifeq ($(HOTSPOT_BUILD_VERSION),)
-  BUILD_VERSION = -DHOTSPOT_RELEASE_VERSION="\"$(HOTSPOT_RELEASE_VERSION)\""
-else
-  BUILD_VERSION = -DHOTSPOT_RELEASE_VERSION="\"$(HOTSPOT_RELEASE_VERSION)-$(HOTSPOT_BUILD_VERSION)\""
-endif
-
 # The following variables are defined in the generated flags.make file.
-BUILD_VERSION = -DHOTSPOT_RELEASE_VERSION="\"$(HS_BUILD_VER)\""
-JRE_VERSION   = -DJRE_RELEASE_VERSION="\"$(JRE_RELEASE_VER)\""
+JDK_VER_DEFS  = -DJDK_MAJOR_VERSION="\"$(JDK_MAJOR_VERSION)\"" \
+		-DJDK_MINOR_VERSION="\"$(JDK_MINOR_VERSION)\"" \
+		-DJDK_MICRO_VERSION="\"$(JDK_MICRO_VERSION)\"" \
+		-DJDK_BUILD_NUMBER="\"$(JDK_BUILD_NUMBER)\""
+VM_VER_DEFS   = -DHOTSPOT_RELEASE_VERSION="\"$(HS_BUILD_VER)\"" \
+		-DJRE_RELEASE_VERSION="\"$(JRE_RELEASE_VER)\""  \
+		$(JDK_VER_DEFS)
 HS_LIB_ARCH   = -DHOTSPOT_LIB_ARCH=\"$(LIBARCH)\"
 BUILD_TARGET  = -DHOTSPOT_BUILD_TARGET="\"$(TARGET)\""
 BUILD_USER    = -DHOTSPOT_BUILD_USER="\"$(HOTSPOT_BUILD_USER)\""
@@ -91,7 +88,6 @@
 CXXFLAGS =           \
   ${SYSDEFS}         \
   ${INCLUDES}        \
-  ${BUILD_VERSION}   \
   ${BUILD_TARGET}    \
   ${BUILD_USER}      \
   ${HS_LIB_ARCH}     \
@@ -100,7 +96,7 @@
 # This is VERY important! The version define must only be supplied to vm_version.o
 # If not, ccache will not re-use the cache at all, since the version string might contain
 # a time and date.
-CXXFLAGS/vm_version.o += ${JRE_VERSION}
+CXXFLAGS/vm_version.o += ${VM_VER_DEFS}
 
 CXXFLAGS/BYFILE = $(CXXFLAGS/$@)
 
--- a/hotspot/make/defs.make	Thu May 01 17:57:29 2014 -0700
+++ b/hotspot/make/defs.make	Fri May 02 19:00:04 2014 -0700
@@ -114,7 +114,7 @@
 endif
 
 # hotspot version definitions
-include $(GAMMADIR)/make/hotspot_version
+include $(GAMMADIR)/make/jdk_version
 
 # Java versions needed
 ifeq ($(PREVIOUS_JDK_VERSION),)
@@ -129,6 +129,9 @@
 ifeq ($(JDK_MICRO_VERSION),)
   JDK_MICRO_VERSION=$(JDK_MICRO_VER)
 endif
+ifeq ($(JDK_BUILD_NUMBER),)
+  JDK_BUILD_NUMBER=0
+endif
 ifeq ($(JDK_MKTG_VERSION),)
   JDK_MKTG_VERSION=$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION)
 endif
@@ -146,7 +149,7 @@
 endif
 
 ifndef HOTSPOT_RELEASE_VERSION
-  HOTSPOT_RELEASE_VERSION=$(HS_MAJOR_VER).$(HS_MINOR_VER)-b$(HS_BUILD_NUMBER)
+  HOTSPOT_RELEASE_VERSION=$(FULL_VERSION)
 endif
 
 ifdef HOTSPOT_BUILD_VERSION
@@ -325,7 +328,6 @@
 MAKE_ARGS += OUTPUTDIR=$(ABS_OUTPUTDIR)
 MAKE_ARGS += GAMMADIR=$(ABS_GAMMADIR)
 MAKE_ARGS += MAKE_VERBOSE=$(MAKE_VERBOSE)
-MAKE_ARGS += HOTSPOT_RELEASE_VERSION=$(HOTSPOT_RELEASE_VERSION)
 MAKE_ARGS += JRE_RELEASE_VERSION=$(JRE_RELEASE_VERSION)
 
 # Pass HOTSPOT_BUILD_VERSION as argument to OS specific Makefile
--- a/hotspot/make/hotspot_version	Thu May 01 17:57:29 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-# 
-# Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-# 
-
-#
-# 
-
-#
-# Master Hotspot version file.  These values may be overridden by a control
-# workspace build.  This file format must remain compatible with both
-# GNU Makefile and Microsoft nmake formats.
-#
-
-# Don't put quotes (fail windows build).
-HOTSPOT_VM_COPYRIGHT=Copyright 2013
-
-HS_MAJOR_VER=25
-HS_MINOR_VER=0
-HS_BUILD_NUMBER=62
-
-JDK_MAJOR_VER=1
-JDK_MINOR_VER=8
-JDK_MICRO_VER=0
-
-# Previous (bootdir) JDK version
-JDK_PREVIOUS_VERSION=1.7.0
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/make/jdk_version	Fri May 02 19:00:04 2014 -0700
@@ -0,0 +1,36 @@
+# 
+# Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+# Master JDK version file.  These values may be overridden by a control
+# workspace build.  This file format must remain compatible with both
+# GNU Makefile and Microsoft nmake formats.
+#
+
+# Don't put quotes (fail windows build).
+HOTSPOT_VM_COPYRIGHT=Copyright 2014
+
+JDK_MAJOR_VER=1
+JDK_MINOR_VER=9
+JDK_MICRO_VER=0
+
+# Previous (bootdir) JDK version
+JDK_PREVIOUS_VERSION=1.8.0
--- a/hotspot/make/linux/makefiles/buildtree.make	Thu May 01 17:57:29 2014 -0700
+++ b/hotspot/make/linux/makefiles/buildtree.make	Fri May 02 19:00:04 2014 -0700
@@ -36,7 +36,7 @@
 # GAMMADIR	- top of workspace
 # OS_FAMILY	- operating system
 # VARIANT	- core, compiler1, compiler2, or tiered
-# HOTSPOT_RELEASE_VERSION - <major>.<minor>-b<nn> (11.0-b07)
+# HOTSPOT_RELEASE_VERSION - <major_ver>.<minor_ver>.<micro_ver>[-<identifier>][-<debug_target>][-b<nn>]
 # HOTSPOT_BUILD_VERSION   - internal, internal-$(USER_RELEASE_SUFFIX) or empty
 # JRE_RELEASE_VERSION     - <major>.<minor>.<micro> (1.7.0)
 #
--- a/hotspot/make/linux/makefiles/mapfile-vers-debug	Thu May 01 17:57:29 2014 -0700
+++ b/hotspot/make/linux/makefiles/mapfile-vers-debug	Fri May 02 19:00:04 2014 -0700
@@ -122,7 +122,7 @@
                 JVM_GetClassModifiers;
                 JVM_GetClassName;
                 JVM_GetClassNameUTF;
-		JVM_GetClassSignature;
+                JVM_GetClassSignature;
                 JVM_GetClassSigners;
                 JVM_GetClassTypeAnnotations;
                 JVM_GetComponentType;
@@ -163,6 +163,7 @@
                 JVM_GetStackTraceElement;
                 JVM_GetSystemPackage;
                 JVM_GetSystemPackages;
+                JVM_GetTemporaryDirectory;
                 JVM_GetThreadStateNames;
                 JVM_GetThreadStateValues;
                 JVM_GetVersionInfo;
--- a/hotspot/make/linux/makefiles/mapfile-vers-product	Thu May 01 17:57:29 2014 -0700
+++ b/hotspot/make/linux/makefiles/mapfile-vers-product	Fri May 02 19:00:04 2014 -0700
@@ -163,6 +163,7 @@
                 JVM_GetStackTraceElement;
                 JVM_GetSystemPackage;
                 JVM_GetSystemPackages;
+                JVM_GetTemporaryDirectory;
                 JVM_GetThreadStateNames;
                 JVM_GetThreadStateValues;
                 JVM_GetVersionInfo;
--- a/hotspot/make/linux/makefiles/vm.make	Thu May 01 17:57:29 2014 -0700
+++ b/hotspot/make/linux/makefiles/vm.make	Fri May 02 19:00:04 2014 -0700
@@ -73,17 +73,14 @@
   endif
 endif
 
-# HOTSPOT_RELEASE_VERSION and HOTSPOT_BUILD_VERSION are defined
-# in $(GAMMADIR)/make/defs.make
-ifeq ($(HOTSPOT_BUILD_VERSION),)
-  BUILD_VERSION = -DHOTSPOT_RELEASE_VERSION="\"$(HOTSPOT_RELEASE_VERSION)\""
-else
-  BUILD_VERSION = -DHOTSPOT_RELEASE_VERSION="\"$(HOTSPOT_RELEASE_VERSION)-$(HOTSPOT_BUILD_VERSION)\""
-endif
-
 # The following variables are defined in the generated flags.make file.
-BUILD_VERSION = -DHOTSPOT_RELEASE_VERSION="\"$(HS_BUILD_VER)\""
-JRE_VERSION   = -DJRE_RELEASE_VERSION="\"$(JRE_RELEASE_VER)\""
+JDK_VER_DEFS  = -DJDK_MAJOR_VERSION="\"$(JDK_MAJOR_VERSION)\"" \
+		-DJDK_MINOR_VERSION="\"$(JDK_MINOR_VERSION)\"" \
+		-DJDK_MICRO_VERSION="\"$(JDK_MICRO_VERSION)\"" \
+		-DJDK_BUILD_NUMBER="\"$(JDK_BUILD_NUMBER)\""
+VM_VER_DEFS   = -DHOTSPOT_RELEASE_VERSION="\"$(HS_BUILD_VER)\"" \
+		-DJRE_RELEASE_VERSION="\"$(JRE_RELEASE_VER)\""  \
+		$(JDK_VER_DEFS)
 HS_LIB_ARCH   = -DHOTSPOT_LIB_ARCH=\"$(LIBARCH)\"
 BUILD_TARGET  = -DHOTSPOT_BUILD_TARGET="\"$(TARGET)\""
 BUILD_USER    = -DHOTSPOT_BUILD_USER="\"$(HOTSPOT_BUILD_USER)\""
@@ -92,7 +89,6 @@
 CXXFLAGS =           \
   ${SYSDEFS}         \
   ${INCLUDES}        \
-  ${BUILD_VERSION}   \
   ${BUILD_TARGET}    \
   ${BUILD_USER}      \
   ${HS_LIB_ARCH}     \
@@ -101,7 +97,7 @@
 # This is VERY important! The version define must only be supplied to vm_version.o
 # If not, ccache will not re-use the cache at all, since the version string might contain
 # a time and date.
-CXXFLAGS/vm_version.o += ${JRE_VERSION}
+CXXFLAGS/vm_version.o += ${VM_VER_DEFS}
 
 CXXFLAGS/BYFILE = $(CXXFLAGS/$@)
 
--- a/hotspot/make/solaris/makefiles/buildtree.make	Thu May 01 17:57:29 2014 -0700
+++ b/hotspot/make/solaris/makefiles/buildtree.make	Fri May 02 19:00:04 2014 -0700
@@ -36,7 +36,7 @@
 # GAMMADIR	- top of workspace
 # OS_FAMILY	- operating system
 # VARIANT	- core, compiler1, compiler2, or tiered
-# HOTSPOT_RELEASE_VERSION - <major>.<minor>-b<nn> (11.0-b07)
+# HOTSPOT_RELEASE_VERSION - <major_ver>.<minor_ver>.<micro_ver>[-<identifier>][-<debug_target>][-b<nn>]
 # HOTSPOT_BUILD_VERSION   - internal, internal-$(USER_RELEASE_SUFFIX) or empty
 # JRE_RELEASE_VERSION     - <major>.<minor>.<micro> (1.7.0)
 #
--- a/hotspot/make/solaris/makefiles/mapfile-vers	Thu May 01 17:57:29 2014 -0700
+++ b/hotspot/make/solaris/makefiles/mapfile-vers	Fri May 02 19:00:04 2014 -0700
@@ -163,6 +163,7 @@
                 JVM_GetStackTraceElement;
                 JVM_GetSystemPackage;
                 JVM_GetSystemPackages;
+                JVM_GetTemporaryDirectory;
                 JVM_GetThreadStateNames;
                 JVM_GetThreadStateValues;
                 JVM_GetVersionInfo;
--- a/hotspot/make/solaris/makefiles/vm.make	Thu May 01 17:57:29 2014 -0700
+++ b/hotspot/make/solaris/makefiles/vm.make	Fri May 02 19:00:04 2014 -0700
@@ -69,8 +69,13 @@
 endif
 
 # The following variables are defined in the generated flags.make file.
-BUILD_VERSION = -DHOTSPOT_RELEASE_VERSION="\"$(HS_BUILD_VER)\""
-JRE_VERSION   = -DJRE_RELEASE_VERSION="\"$(JRE_RELEASE_VER)\""
+JDK_VER_DEFS  = -DJDK_MAJOR_VERSION="\"$(JDK_MAJOR_VERSION)\"" \
+		-DJDK_MINOR_VERSION="\"$(JDK_MINOR_VERSION)\"" \
+		-DJDK_MICRO_VERSION="\"$(JDK_MICRO_VERSION)\"" \
+		-DJDK_BUILD_NUMBER="\"$(JDK_BUILD_NUMBER)\""
+VM_VER_DEFS   = -DHOTSPOT_RELEASE_VERSION="\"$(HS_BUILD_VER)\"" \
+		-DJRE_RELEASE_VERSION="\"$(JRE_RELEASE_VER)\""  \
+		$(JDK_VER_DEFS)
 HS_LIB_ARCH   = -DHOTSPOT_LIB_ARCH=\"$(LIBARCH)\"
 BUILD_TARGET  = -DHOTSPOT_BUILD_TARGET="\"$(TARGET)\""
 BUILD_USER    = -DHOTSPOT_BUILD_USER="\"$(HOTSPOT_BUILD_USER)\""
@@ -79,7 +84,6 @@
 CXXFLAGS =           \
   ${SYSDEFS}         \
   ${INCLUDES}        \
-  ${BUILD_VERSION}   \
   ${BUILD_TARGET}    \
   ${BUILD_USER}      \
   ${HS_LIB_ARCH}     \
@@ -88,7 +92,7 @@
 # This is VERY important! The version define must only be supplied to vm_version.o
 # If not, ccache will not re-use the cache at all, since the version string might contain
 # a time and date.
-CXXFLAGS/vm_version.o += ${JRE_VERSION}
+CXXFLAGS/vm_version.o += ${VM_VER_DEFS}
 
 CXXFLAGS/BYFILE = $(CXXFLAGS/$@)
 
--- a/hotspot/make/windows/build.make	Thu May 01 17:57:29 2014 -0700
+++ b/hotspot/make/windows/build.make	Fri May 02 19:00:04 2014 -0700
@@ -117,7 +117,7 @@
 # These can be overridden via the nmake.exe command line.
 # They are overridden by RE during the control builds.
 #
-!include "$(WorkSpace)/make/hotspot_version"
+!include "$(WorkSpace)/make/jdk_version"
 
 # Define HOTSPOT_VM_DISTRO based on settings in make/openjdk_distro
 # or make/hotspot_distro.
@@ -163,7 +163,7 @@
 #       1.6.0-b01     will be 6.0.0.1
 #       1.6.0_01a-b02 will be 6.0.11.2
 #
-# JDK_* variables are defined in make/hotspot_version or on command line
+# JDK_* variables are defined in make/jdk_version or on command line
 #
 JDK_VER=$(JDK_MINOR_VER),$(JDK_MICRO_VER),$(JDK_UPDATE_VER),$(JDK_BUILD_NUMBER)
 JDK_DOTVER=$(JDK_MINOR_VER).$(JDK_MICRO_VER).$(JDK_UPDATE_VER).$(JDK_BUILD_NUMBER)
@@ -179,13 +179,12 @@
 # Hotspot Express VM FileVersion:
 # 10.0-b<yz> will have DLL version 10.0.0.yz (need 4 numbers).
 #
-# HS_* variables are defined in make/hotspot_version
 #
-HS_VER=$(HS_MAJOR_VER),$(HS_MINOR_VER),0,$(HS_BUILD_NUMBER)
-HS_DOTVER=$(HS_MAJOR_VER).$(HS_MINOR_VER).0.$(HS_BUILD_NUMBER)
+HS_VER=$(JDK_VER)
+HS_DOTVER=$(JDK_DOTVER)
 
 !if "$(HOTSPOT_RELEASE_VERSION)" == ""
-HOTSPOT_RELEASE_VERSION=$(HS_MAJOR_VER).$(HS_MINOR_VER)-b$(HS_BUILD_NUMBER)
+HOTSPOT_RELEASE_VERSION=$(JRE_RELEASE_VERSION)
 !endif
 
 !if "$(HOTSPOT_BUILD_VERSION)" == ""
--- a/hotspot/make/windows/makefiles/defs.make	Thu May 01 17:57:29 2014 -0700
+++ b/hotspot/make/windows/makefiles/defs.make	Fri May 02 19:00:04 2014 -0700
@@ -179,9 +179,9 @@
 
 # next parameters are defined in $(GAMMADIR)/make/defs.make.
 MAKE_ARGS += JDK_MKTG_VERSION=$(JDK_MKTG_VERSION)
-MAKE_ARGS += JDK_MAJOR_VER=$(JDK_MAJOR_VERSION)
-MAKE_ARGS += JDK_MINOR_VER=$(JDK_MINOR_VERSION)
-MAKE_ARGS += JDK_MICRO_VER=$(JDK_MICRO_VERSION)
+MAKE_ARGS += JDK_MAJOR_VERSION=$(JDK_MAJOR_VERSION)
+MAKE_ARGS += JDK_MINOR_VERSION=$(JDK_MINOR_VERSION)
+MAKE_ARGS += JDK_MICRO_VERSION=$(JDK_MICRO_VERSION)
 
 ifdef COOKED_JDK_UPDATE_VERSION
   MAKE_ARGS += JDK_UPDATE_VER=$(COOKED_JDK_UPDATE_VERSION)
--- a/hotspot/make/windows/makefiles/vm.make	Thu May 01 17:57:29 2014 -0700
+++ b/hotspot/make/windows/makefiles/vm.make	Fri May 02 19:00:04 2014 -0700
@@ -56,6 +56,10 @@
 
 # The following variables are defined in the generated local.make file.
 CXX_FLAGS=$(CXX_FLAGS) /D "HOTSPOT_RELEASE_VERSION=\"$(HS_BUILD_VER)\""
+CXX_FLAGS=$(CXX_FLAGS) /D "JDK_MAJOR_VERSION=\"$(JDK_MAJOR_VERSION)\""
+CXX_FLAGS=$(CXX_FLAGS) /D "JDK_MINOR_VERSION=\"$(JDK_MINOR_VERSION)\""
+CXX_FLAGS=$(CXX_FLAGS) /D "JDK_MICRO_VERSION=\"$(JDK_MICRO_VERSION)\""
+CXX_FLAGS=$(CXX_FLAGS) /D "JDK_BUILD_NUMBER=\"$(JDK_BUILD_NUMBER)\""
 CXX_FLAGS=$(CXX_FLAGS) /D "JRE_RELEASE_VERSION=\"$(JRE_RELEASE_VER)\""
 CXX_FLAGS=$(CXX_FLAGS) /D "HOTSPOT_LIB_ARCH=\"$(HOTSPOT_LIB_ARCH)\""
 CXX_FLAGS=$(CXX_FLAGS) /D "HOTSPOT_BUILD_TARGET=\"$(BUILD_FLAVOR)\""
--- a/hotspot/make/windows/projectfiles/common/Makefile	Thu May 01 17:57:29 2014 -0700
+++ b/hotspot/make/windows/projectfiles/common/Makefile	Fri May 02 19:00:04 2014 -0700
@@ -78,24 +78,23 @@
 
 default:: $(AdditionalTargets) $(JvmtiGeneratedFiles) $(TraceGeneratedFiles)
 
-!include $(HOTSPOTWORKSPACE)/make/hotspot_version
+!include $(HOTSPOTWORKSPACE)/make/jdk_version
 
 !if "$(USER_RELEASE_SUFFIX)" != ""
 HOTSPOT_BUILD_VERSION = internal-$(USER_RELEASE_SUFFIX)
 !else
 HOTSPOT_BUILD_VERSION = internal
 !endif
-!if "$(HOTSPOT_RELEASE_VERSION)" != ""
-HOTSPOT_RELEASE_VERSION="\\\"$(HOTSPOT_RELEASE_VERSION)\\\""
-!else
-HOTSPOT_RELEASE_VERSION="\\\"$(HS_MAJOR_VER).$(HS_MINOR_VER)-b$(HS_BUILD_NUMBER)-$(HOTSPOT_BUILD_VERSION)\\\""
-!endif
 !if "$(JRE_RELEASE_VERSION)" != ""
 JRE_RELEASE_VERSION="\\\"$(JRE_RELEASE_VERSION)\\\""
 !else
 JRE_RELEASE_VERSION="\\\"$(JDK_MAJOR_VER).$(JDK_MINOR_VER).$(JDK_MICRO_VER)\\\""
 !endif
-
+!if "$(HOTSPOT_RELEASE_VERSION)" != ""
+HOTSPOT_RELEASE_VERSION="\\\"$(HOTSPOT_RELEASE_VERSION)\\\""
+!else
+HOTSPOT_RELEASE_VERSION="\\\"$(JRE_RELEASE_VERSION)\\\""
+!endif
 # Define HOTSPOT_VM_DISTRO if HOTSPOT_VM_DISTRO is set,
 # and if it is not see if we have the src/closed directory
 !if "$(HOTSPOT_VM_DISTRO)" != ""
--- a/hotspot/src/os/bsd/vm/os_bsd.cpp	Thu May 01 17:57:29 2014 -0700
+++ b/hotspot/src/os/bsd/vm/os_bsd.cpp	Fri May 02 19:00:04 2014 -0700
@@ -127,8 +127,12 @@
 // global variables
 julong os::Bsd::_physical_memory = 0;
 
-
+#ifdef __APPLE__
+mach_timebase_info_data_t os::Bsd::_timebase_info = {0, 0};
+volatile uint64_t         os::Bsd::_max_abstime   = 0;
+#else
 int (*os::Bsd::_clock_gettime)(clockid_t, struct timespec *) = NULL;
+#endif
 pthread_t os::Bsd::_main_thread;
 int os::Bsd::_page_size = -1;
 
@@ -986,13 +990,15 @@
   return jlong(time.tv_sec) * 1000  +  jlong(time.tv_usec / 1000);
 }
 
+#ifndef __APPLE__
 #ifndef CLOCK_MONOTONIC
 #define CLOCK_MONOTONIC (1)
 #endif
+#endif
 
 #ifdef __APPLE__
 void os::Bsd::clock_init() {
-        // XXXDARWIN: Investigate replacement monotonic clock
+  mach_timebase_info(&_timebase_info);
 }
 #else
 void os::Bsd::clock_init() {
@@ -1007,10 +1013,39 @@
 #endif
 
 
+
+#ifdef __APPLE__
+
+jlong os::javaTimeNanos() {
+    const uint64_t tm = mach_absolute_time();
+    const uint64_t now = (tm * Bsd::_timebase_info.numer) / Bsd::_timebase_info.denom;
+    const uint64_t prev = Bsd::_max_abstime;
+    if (now <= prev) {
+      return prev;   // same or retrograde time;
+    }
+    const uint64_t obsv = Atomic::cmpxchg(now, (volatile jlong*)&Bsd::_max_abstime, prev);
+    assert(obsv >= prev, "invariant");   // Monotonicity
+    // If the CAS succeeded then we're done and return "now".
+    // If the CAS failed and the observed value "obsv" is >= now then
+    // we should return "obsv".  If the CAS failed and now > obsv > prv then
+    // some other thread raced this thread and installed a new value, in which case
+    // we could either (a) retry the entire operation, (b) retry trying to install now
+    // or (c) just return obsv.  We use (c).   No loop is required although in some cases
+    // we might discard a higher "now" value in deference to a slightly lower but freshly
+    // installed obsv value.   That's entirely benign -- it admits no new orderings compared
+    // to (a) or (b) -- and greatly reduces coherence traffic.
+    // We might also condition (c) on the magnitude of the delta between obsv and now.
+    // Avoiding excessive CAS operations to hot RW locations is critical.
+    // See https://blogs.oracle.com/dave/entry/cas_and_cache_trivia_invalidate
+    return (prev == obsv) ? now : obsv;
+}
+
+#else // __APPLE__
+
 jlong os::javaTimeNanos() {
   if (os::supports_monotonic_clock()) {
     struct timespec tp;
-    int status = Bsd::clock_gettime(CLOCK_MONOTONIC, &tp);
+    int status = Bsd::_clock_gettime(CLOCK_MONOTONIC, &tp);
     assert(status == 0, "gettime error");
     jlong result = jlong(tp.tv_sec) * (1000 * 1000 * 1000) + jlong(tp.tv_nsec);
     return result;
@@ -1023,6 +1058,8 @@
   }
 }
 
+#endif // __APPLE__
+
 void os::javaTimeNanos_info(jvmtiTimerInfo *info_ptr) {
   if (os::supports_monotonic_clock()) {
     info_ptr->max_value = ALL_64_BITS;
--- a/hotspot/src/os/bsd/vm/os_bsd.hpp	Thu May 01 17:57:29 2014 -0700
+++ b/hotspot/src/os/bsd/vm/os_bsd.hpp	Fri May 02 19:00:04 2014 -0700
@@ -58,7 +58,13 @@
   // For signal flags diagnostics
   static int sigflags[MAXSIGNUM];
 
+#ifdef __APPLE__
+  // mach_absolute_time
+  static mach_timebase_info_data_t _timebase_info;
+  static volatile uint64_t         _max_abstime;
+#else
   static int (*_clock_gettime)(clockid_t, struct timespec *);
+#endif
 
   static GrowableArray<int>* _cpu_to_node;
 
@@ -134,10 +140,6 @@
   // Real-time clock functions
   static void clock_init(void);
 
-  static int clock_gettime(clockid_t clock_id, struct timespec *tp) {
-    return _clock_gettime ? _clock_gettime(clock_id, tp) : -1;
-  }
-
   // Stack repair handling
 
   // none present
--- a/hotspot/src/os/bsd/vm/os_bsd.inline.hpp	Thu May 01 17:57:29 2014 -0700
+++ b/hotspot/src/os/bsd/vm/os_bsd.inline.hpp	Fri May 02 19:00:04 2014 -0700
@@ -287,7 +287,11 @@
 }
 
 inline bool os::supports_monotonic_clock() {
+#ifdef __APPLE__
+  return true;
+#else
   return Bsd::_clock_gettime != NULL;
+#endif
 }
 
 #endif // OS_BSD_VM_OS_BSD_INLINE_HPP
--- a/hotspot/src/os/solaris/vm/os_solaris.cpp	Thu May 01 17:57:29 2014 -0700
+++ b/hotspot/src/os/solaris/vm/os_solaris.cpp	Fri May 02 19:00:04 2014 -0700
@@ -347,11 +347,7 @@
 
 static hrtime_t first_hrtime = 0;
 static const hrtime_t hrtime_hz = 1000*1000*1000;
-const int LOCK_BUSY = 1;
-const int LOCK_FREE = 0;
-const int LOCK_INVALID = -1;
 static volatile hrtime_t max_hrtime = 0;
-static volatile int max_hrtime_lock = LOCK_FREE;     // Update counter with LSB as lock-in-progress
 
 
 void os::Solaris::initialize_system_info() {
@@ -1364,58 +1360,31 @@
 }
 
 
-// gethrtime can move backwards if read from one cpu and then a different cpu
-// getTimeNanos is guaranteed to not move backward on Solaris
-// local spinloop created as faster for a CAS on an int than
-// a CAS on a 64bit jlong. Also Atomic::cmpxchg for jlong is not
-// supported on sparc v8 or pre supports_cx8 intel boxes.
-// oldgetTimeNanos for systems which do not support CAS on 64bit jlong
-// i.e. sparc v8 and pre supports_cx8 (i486) intel boxes
-inline hrtime_t oldgetTimeNanos() {
-  int gotlock = LOCK_INVALID;
-  hrtime_t newtime = gethrtime();
-
-  for (;;) {
-// grab lock for max_hrtime
-    int curlock = max_hrtime_lock;
-    if (curlock & LOCK_BUSY)  continue;
-    if (gotlock = Atomic::cmpxchg(LOCK_BUSY, &max_hrtime_lock, LOCK_FREE) != LOCK_FREE) continue;
-    if (newtime > max_hrtime) {
-      max_hrtime = newtime;
-    } else {
-      newtime = max_hrtime;
-    }
-    // release lock
-    max_hrtime_lock = LOCK_FREE;
-    return newtime;
-  }
-}
-// gethrtime can move backwards if read from one cpu and then a different cpu
-// getTimeNanos is guaranteed to not move backward on Solaris
+// gethrtime() should be monotonic according to the documentation,
+// but some virtualized platforms are known to break this guarantee.
+// getTimeNanos() must be guaranteed not to move backwards, so we
+// are forced to add a check here.
 inline hrtime_t getTimeNanos() {
-  if (VM_Version::supports_cx8()) {
-    const hrtime_t now = gethrtime();
-    // Use atomic long load since 32-bit x86 uses 2 registers to keep long.
-    const hrtime_t prev = Atomic::load((volatile jlong*)&max_hrtime);
-    if (now <= prev)  return prev;   // same or retrograde time;
-    const hrtime_t obsv = Atomic::cmpxchg(now, (volatile jlong*)&max_hrtime, prev);
-    assert(obsv >= prev, "invariant");   // Monotonicity
-    // If the CAS succeeded then we're done and return "now".
-    // If the CAS failed and the observed value "obs" is >= now then
-    // we should return "obs".  If the CAS failed and now > obs > prv then
-    // some other thread raced this thread and installed a new value, in which case
-    // we could either (a) retry the entire operation, (b) retry trying to install now
-    // or (c) just return obs.  We use (c).   No loop is required although in some cases
-    // we might discard a higher "now" value in deference to a slightly lower but freshly
-    // installed obs value.   That's entirely benign -- it admits no new orderings compared
-    // to (a) or (b) -- and greatly reduces coherence traffic.
-    // We might also condition (c) on the magnitude of the delta between obs and now.
-    // Avoiding excessive CAS operations to hot RW locations is critical.
-    // See http://blogs.sun.com/dave/entry/cas_and_cache_trivia_invalidate
-    return (prev == obsv) ? now : obsv ;
-  } else {
-    return oldgetTimeNanos();
-  }
+  const hrtime_t now = gethrtime();
+  const hrtime_t prev = max_hrtime;
+  if (now <= prev) {
+    return prev;   // same or retrograde time;
+  }
+  const hrtime_t obsv = Atomic::cmpxchg(now, (volatile jlong*)&max_hrtime, prev);
+  assert(obsv >= prev, "invariant");   // Monotonicity
+  // If the CAS succeeded then we're done and return "now".
+  // If the CAS failed and the observed value "obsv" is >= now then
+  // we should return "obsv".  If the CAS failed and now > obsv > prv then
+  // some other thread raced this thread and installed a new value, in which case
+  // we could either (a) retry the entire operation, (b) retry trying to install now
+  // or (c) just return obsv.  We use (c).   No loop is required although in some cases
+  // we might discard a higher "now" value in deference to a slightly lower but freshly
+  // installed obsv value.   That's entirely benign -- it admits no new orderings compared
+  // to (a) or (b) -- and greatly reduces coherence traffic.
+  // We might also condition (c) on the magnitude of the delta between obsv and now.
+  // Avoiding excessive CAS operations to hot RW locations is critical.
+  // See https://blogs.oracle.com/dave/entry/cas_and_cache_trivia_invalidate
+  return (prev == obsv) ? now : obsv;
 }
 
 // Time since start-up in seconds to a fine granularity.
--- a/hotspot/src/os/windows/vm/os_windows.cpp	Thu May 01 17:57:29 2014 -0700
+++ b/hotspot/src/os/windows/vm/os_windows.cpp	Fri May 02 19:00:04 2014 -0700
@@ -130,6 +130,13 @@
     case DLL_PROCESS_DETACH:
       if(ForceTimeHighResolution)
         timeEndPeriod(1L);
+
+      // Workaround for issue when a custom launcher doesn't call
+      // DestroyJavaVM and NMT is trying to track memory when free is
+      // called from a static destructor
+      if (MemTracker::is_on()) {
+          MemTracker::shutdown(MemTracker::NMT_normal);
+      }
       break;
     default:
       break;
--- a/hotspot/src/share/vm/classfile/javaClasses.cpp	Thu May 01 17:57:29 2014 -0700
+++ b/hotspot/src/share/vm/classfile/javaClasses.cpp	Fri May 02 19:00:04 2014 -0700
@@ -421,6 +421,15 @@
   return UNICODE::as_utf8(position, len);
 }
 
+char* java_lang_String::as_utf8_string(oop java_string, int start, int len, char* buf, int buflen) {
+  typeArrayOop value  = java_lang_String::value(java_string);
+  int          offset = java_lang_String::offset(java_string);
+  int          length = java_lang_String::length(java_string);
+  assert(start + len <= length, "just checking");
+  jchar* position = value->char_at_addr(offset + start);
+  return UNICODE::as_utf8(position, len, buf, buflen);
+}
+
 bool java_lang_String::equals(oop java_string, jchar* chars, int len) {
   assert(java_string->klass() == SystemDictionary::String_klass(),
          "must be java_string");
--- a/hotspot/src/share/vm/classfile/javaClasses.hpp	Thu May 01 17:57:29 2014 -0700
+++ b/hotspot/src/share/vm/classfile/javaClasses.hpp	Fri May 02 19:00:04 2014 -0700
@@ -162,6 +162,7 @@
   static char*  as_utf8_string(oop java_string);
   static char*  as_utf8_string(oop java_string, char* buf, int buflen);
   static char*  as_utf8_string(oop java_string, int start, int len);
+  static char*  as_utf8_string(oop java_string, int start, int len, char* buf, int buflen);
   static char*  as_platform_dependent_str(Handle java_string, TRAPS);
   static jchar* as_unicode_string(oop java_string, int& length, TRAPS);
   // produce an ascii string with all other values quoted using \u####
--- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp	Thu May 01 17:57:29 2014 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp	Fri May 02 19:00:04 2014 -0700
@@ -1282,6 +1282,7 @@
     Universe::verify(VerifyOption_G1UsePrevMarking,
                      " VerifyDuringGC:(before)");
   }
+  g1h->check_bitmaps("Remark Start");
 
   G1CollectorPolicy* g1p = g1h->g1_policy();
   g1p->record_concurrent_mark_remark_start();
@@ -1330,6 +1331,7 @@
       Universe::verify(VerifyOption_G1UseNextMarking,
                        " VerifyDuringGC:(after)");
     }
+    g1h->check_bitmaps("Remark End");
     assert(!restart_for_overflow(), "sanity");
     // Completely reset the marking state since marking completed
     set_non_marking_state();
@@ -1979,6 +1981,7 @@
     Universe::verify(VerifyOption_G1UsePrevMarking,
                      " VerifyDuringGC:(before)");
   }
+  g1h->check_bitmaps("Cleanup Start");
 
   G1CollectorPolicy* g1p = G1CollectedHeap::heap()->g1_policy();
   g1p->record_concurrent_mark_cleanup_start();
@@ -2133,6 +2136,7 @@
     Universe::verify(VerifyOption_G1UsePrevMarking,
                      " VerifyDuringGC:(after)");
   }
+  g1h->check_bitmaps("Cleanup End");
 
   g1h->verify_region_sets_optional();
   g1h->trace_heap_after_concurrent_cycle();
@@ -3224,6 +3228,11 @@
 void ConcurrentMark::abort() {
   // Clear all marks to force marking thread to do nothing
   _nextMarkBitMap->clearAll();
+
+  // Note we cannot clear the previous marking bitmap here
+  // since VerifyDuringGC verifies the objects marked during
+  // a full GC against the previous bitmap.
+
   // Clear the liveness counting data
   clear_all_count_data();
   // Empty mark stack
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	Thu May 01 17:57:29 2014 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	Fri May 02 19:00:04 2014 -0700
@@ -768,6 +768,7 @@
   // match new_top.
   assert(hr == NULL ||
          (hr->end() == new_end && hr->top() == new_top), "sanity");
+  check_bitmaps("Humongous Region Allocation", first_hr);
 
   assert(first_hr->used() == word_size * HeapWordSize, "invariant");
   _summary_bytes_used += first_hr->used();
@@ -1326,6 +1327,7 @@
 
       verify_before_gc();
 
+      check_bitmaps("Full GC Start");
       pre_full_gc_dump(gc_timer);
 
       COMPILER2_PRESENT(DerivedPointerTable::clear());
@@ -1499,6 +1501,18 @@
 
       verify_after_gc();
 
+      // Clear the previous marking bitmap, if needed for bitmap verification.
+      // Note we cannot do this when we clear the next marking bitmap in
+      // ConcurrentMark::abort() above since VerifyDuringGC verifies the
+      // objects marked during a full GC against the previous bitmap.
+      // But we need to clear it before calling check_bitmaps below since
+      // the full GC has compacted objects and updated TAMS but not updated
+      // the prev bitmap.
+      if (G1VerifyBitmaps) {
+        ((CMBitMap*) concurrent_mark()->prevMarkBitMap())->clearAll();
+      }
+      check_bitmaps("Full GC End");
+
       // Start a new incremental collection set for the next pause
       assert(g1_policy()->collection_set() == NULL, "must be");
       g1_policy()->start_incremental_cset_building();
@@ -3978,6 +3992,7 @@
       increment_gc_time_stamp();
 
       verify_before_gc();
+      check_bitmaps("GC Start");
 
       COMPILER2_PRESENT(DerivedPointerTable::clear());
 
@@ -4223,6 +4238,7 @@
         increment_gc_time_stamp();
 
         verify_after_gc();
+        check_bitmaps("GC End");
 
         assert(!ref_processor_stw()->discovery_enabled(), "Postcondition");
         ref_processor_stw()->verify_no_references_recorded();
@@ -5945,6 +5961,11 @@
   assert(!hr->is_empty(), "the region should not be empty");
   assert(free_list != NULL, "pre-condition");
 
+  if (G1VerifyBitmaps) {
+    MemRegion mr(hr->bottom(), hr->end());
+    concurrent_mark()->clearRangePrevBitmap(mr);
+  }
+
   // Clear the card counts for this region.
   // Note: we only need to do this if the region is not young
   // (since we don't refine cards in young regions).
@@ -6079,7 +6100,87 @@
 void G1CollectedHeap::verify_dirty_young_regions() {
   verify_dirty_young_list(_young_list->first_region());
 }
-#endif
+
+bool G1CollectedHeap::verify_no_bits_over_tams(const char* bitmap_name, CMBitMapRO* bitmap,
+                                               HeapWord* tams, HeapWord* end) {
+  guarantee(tams <= end,
+            err_msg("tams: "PTR_FORMAT" end: "PTR_FORMAT, tams, end));
+  HeapWord* result = bitmap->getNextMarkedWordAddress(tams, end);
+  if (result < end) {
+    gclog_or_tty->cr();
+    gclog_or_tty->print_cr("## wrong marked address on %s bitmap: "PTR_FORMAT,
+                           bitmap_name, result);
+    gclog_or_tty->print_cr("## %s tams: "PTR_FORMAT" end: "PTR_FORMAT,
+                           bitmap_name, tams, end);
+    return false;
+  }
+  return true;
+}
+
+bool G1CollectedHeap::verify_bitmaps(const char* caller, HeapRegion* hr) {
+  CMBitMapRO* prev_bitmap = concurrent_mark()->prevMarkBitMap();
+  CMBitMapRO* next_bitmap = (CMBitMapRO*) concurrent_mark()->nextMarkBitMap();
+
+  HeapWord* bottom = hr->bottom();
+  HeapWord* ptams  = hr->prev_top_at_mark_start();
+  HeapWord* ntams  = hr->next_top_at_mark_start();
+  HeapWord* end    = hr->end();
+
+  bool res_p = verify_no_bits_over_tams("prev", prev_bitmap, ptams, end);
+
+  bool res_n = true;
+  // We reset mark_in_progress() before we reset _cmThread->in_progress() and in this window
+  // we do the clearing of the next bitmap concurrently. Thus, we can not verify the bitmap
+  // if we happen to be in that state.
+  if (mark_in_progress() || !_cmThread->in_progress()) {
+    res_n = verify_no_bits_over_tams("next", next_bitmap, ntams, end);
+  }
+  if (!res_p || !res_n) {
+    gclog_or_tty->print_cr("#### Bitmap verification failed for "HR_FORMAT,
+                           HR_FORMAT_PARAMS(hr));
+    gclog_or_tty->print_cr("#### Caller: %s", caller);
+    return false;
+  }
+  return true;
+}
+
+void G1CollectedHeap::check_bitmaps(const char* caller, HeapRegion* hr) {
+  if (!G1VerifyBitmaps) return;
+
+  guarantee(verify_bitmaps(caller, hr), "bitmap verification");
+}
+
+class G1VerifyBitmapClosure : public HeapRegionClosure {
+private:
+  const char* _caller;
+  G1CollectedHeap* _g1h;
+  bool _failures;
+
+public:
+  G1VerifyBitmapClosure(const char* caller, G1CollectedHeap* g1h) :
+    _caller(caller), _g1h(g1h), _failures(false) { }
+
+  bool failures() { return _failures; }
+
+  virtual bool doHeapRegion(HeapRegion* hr) {
+    if (hr->continuesHumongous()) return false;
+
+    bool result = _g1h->verify_bitmaps(_caller, hr);
+    if (!result) {
+      _failures = true;
+    }
+    return false;
+  }
+};
+
+void G1CollectedHeap::check_bitmaps(const char* caller) {
+  if (!G1VerifyBitmaps) return;
+
+  G1VerifyBitmapClosure cl(caller, this);
+  heap_region_iterate(&cl);
+  guarantee(!cl.failures(), "bitmap verification");
+}
+#endif // PRODUCT
 
 void G1CollectedHeap::cleanUpCardTable() {
   G1SATBCardTableModRefBS* ct_bs = g1_barrier_set();
@@ -6464,6 +6565,7 @@
     if (new_alloc_region != NULL) {
       set_region_short_lived_locked(new_alloc_region);
       _hr_printer.alloc(new_alloc_region, G1HRPrinter::Eden, young_list_full);
+      check_bitmaps("Mutator Region Allocation", new_alloc_region);
       return new_alloc_region;
     }
   }
@@ -6530,8 +6632,10 @@
       if (survivor) {
         new_alloc_region->set_survivor();
         _hr_printer.alloc(new_alloc_region, G1HRPrinter::Survivor);
+        check_bitmaps("Survivor Region Allocation", new_alloc_region);
       } else {
         _hr_printer.alloc(new_alloc_region, G1HRPrinter::Old);
+        check_bitmaps("Old Region Allocation", new_alloc_region);
       }
       bool during_im = g1_policy()->during_initial_mark_pause();
       new_alloc_region->note_start_of_copying(during_im);
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp	Thu May 01 17:57:29 2014 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp	Fri May 02 19:00:04 2014 -0700
@@ -1186,6 +1186,30 @@
   void verify_dirty_young_list(HeapRegion* head) PRODUCT_RETURN;
   void verify_dirty_young_regions() PRODUCT_RETURN;
 
+#ifndef PRODUCT
+  // Make sure that the given bitmap has no marked objects in the
+  // range [from,limit). If it does, print an error message and return
+  // false. Otherwise, just return true. bitmap_name should be "prev"
+  // or "next".
+  bool verify_no_bits_over_tams(const char* bitmap_name, CMBitMapRO* bitmap,
+                                HeapWord* from, HeapWord* limit);
+
+  // Verify that the prev / next bitmap range [tams,end) for the given
+  // region has no marks. Return true if all is well, false if errors
+  // are detected.
+  bool verify_bitmaps(const char* caller, HeapRegion* hr);
+#endif // PRODUCT
+
+  // If G1VerifyBitmaps is set, verify that the marking bitmaps for
+  // the given region do not have any spurious marks. If errors are
+  // detected, print appropriate error messages and crash.
+  void check_bitmaps(const char* caller, HeapRegion* hr) PRODUCT_RETURN;
+
+  // If G1VerifyBitmaps is set, verify that the marking bitmaps do not
+  // have any spurious marks. If errors are detected, print
+  // appropriate error messages and crash.
+  void check_bitmaps(const char* caller) PRODUCT_RETURN;
+
   // verify_region_sets() performs verification over the region
   // lists. It will be compiled in the product code to be used when
   // necessary (i.e., during heap verification).
--- a/hotspot/src/share/vm/gc_implementation/g1/g1EvacFailure.hpp	Thu May 01 17:57:29 2014 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1EvacFailure.hpp	Fri May 02 19:00:04 2014 -0700
@@ -191,6 +191,7 @@
 
         hr->note_self_forwarding_removal_start(during_initial_mark,
                                                during_conc_mark);
+        _g1h->check_bitmaps("Self-Forwarding Ptr Removal", hr);
 
         // In the common case (i.e. when there is no evacuation
         // failure) we make sure that the following is done when
--- a/hotspot/src/share/vm/gc_implementation/g1/g1_globals.hpp	Thu May 01 17:57:29 2014 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1_globals.hpp	Fri May 02 19:00:04 2014 -0700
@@ -325,11 +325,14 @@
           "evacuation pauses")                                              \
                                                                             \
   diagnostic(bool, G1VerifyRSetsDuringFullGC, false,                        \
-             "If true, perform verification of each heap region's "         \
-             "remembered set when verifying the heap during a full GC.")    \
+          "If true, perform verification of each heap region's "            \
+          "remembered set when verifying the heap during a full GC.")       \
                                                                             \
   diagnostic(bool, G1VerifyHeapRegionCodeRoots, false,                      \
-             "Verify the code root lists attached to each heap region.")
+          "Verify the code root lists attached to each heap region.")       \
+                                                                            \
+  develop(bool, G1VerifyBitmaps, false,                                     \
+          "Verifies the consistency of the marking bitmaps")
 
 G1_FLAGS(DECLARE_DEVELOPER_FLAG, DECLARE_PD_DEVELOPER_FLAG, DECLARE_PRODUCT_FLAG, DECLARE_PD_PRODUCT_FLAG, DECLARE_DIAGNOSTIC_FLAG, DECLARE_EXPERIMENTAL_FLAG, DECLARE_NOTPRODUCT_FLAG, DECLARE_MANAGEABLE_FLAG, DECLARE_PRODUCT_RW_FLAG)
 
--- a/hotspot/src/share/vm/oops/klass.cpp	Thu May 01 17:57:29 2014 -0700
+++ b/hotspot/src/share/vm/oops/klass.cpp	Fri May 02 19:00:04 2014 -0700
@@ -488,6 +488,7 @@
 }
 
 void Klass::restore_unshareable_info(TRAPS) {
+  TRACE_INIT_ID(this);
   // If an exception happened during CDS restore, some of these fields may already be
   // set.  We leave the class on the CLD list, even if incomplete so that we don't
   // modify the CLD list outside a safepoint.
--- a/hotspot/src/share/vm/prims/jni.cpp	Thu May 01 17:57:29 2014 -0700
+++ b/hotspot/src/share/vm/prims/jni.cpp	Fri May 02 19:00:04 2014 -0700
@@ -3150,11 +3150,9 @@
   } else {
     //%note jni_7
     if (len > 0) {
-      ResourceMark rm(THREAD);
-      char *utf_region = java_lang_String::as_utf8_string(s, start, len);
-      int utf_len = (int)strlen(utf_region);
-      memcpy(buf, utf_region, utf_len);
-      buf[utf_len] = 0;
+      // Assume the buffer is large enough as the JNI spec. does not require user error checking
+      java_lang_String::as_utf8_string(s, start, len, buf, INT_MAX);
+      // as_utf8_string null-terminates the result string
     } else {
       // JDK null-terminates the buffer even in len is zero
       if (buf != NULL) {
@@ -3880,6 +3878,7 @@
 void TestOldSize_test();
 void TestKlass_test();
 void TestBitMap_test();
+void TestAsUtf8();
 #if INCLUDE_ALL_GCS
 void TestOldFreeSpaceCalculation_test();
 void TestG1BiasedArray_test();
@@ -3907,6 +3906,7 @@
     run_unit_test(TestOldSize_test());
     run_unit_test(TestKlass_test());
     run_unit_test(TestBitMap_test());
+    run_unit_test(TestAsUtf8());
 #if INCLUDE_VM_STRUCTS
     run_unit_test(VMStructs::test());
 #endif
--- a/hotspot/src/share/vm/prims/jvm.cpp	Thu May 01 17:57:29 2014 -0700
+++ b/hotspot/src/share/vm/prims/jvm.cpp	Fri May 02 19:00:04 2014 -0700
@@ -386,6 +386,23 @@
 JVM_END
 
 
+/*
+ * Return the temporary directory that the VM uses for the attach
+ * and perf data files.
+ *
+ * It is important that this directory is well-known and the
+ * same for all VM instances. It cannot be affected by configuration
+ * variables such as java.io.tmpdir.
+ */
+JVM_ENTRY(jstring, JVM_GetTemporaryDirectory(JNIEnv *env))
+  JVMWrapper("JVM_GetTemporaryDirectory");
+  HandleMark hm(THREAD);
+  const char* temp_dir = os::get_temp_directory();
+  Handle h = java_lang_String::create_from_platform_dependent_str(temp_dir, CHECK_NULL);
+  return (jstring) JNIHandles::make_local(env, h());
+JVM_END
+
+
 // java.lang.Runtime /////////////////////////////////////////////////////////////////////////
 
 extern volatile jint vm_created;
--- a/hotspot/src/share/vm/prims/jvm.h	Thu May 01 17:57:29 2014 -0700
+++ b/hotspot/src/share/vm/prims/jvm.h	Fri May 02 19:00:04 2014 -0700
@@ -1485,6 +1485,9 @@
 JNIEXPORT jobject JNICALL
 JVM_InitAgentProperties(JNIEnv *env, jobject agent_props);
 
+JNIEXPORT jstring JNICALL
+JVM_GetTemporaryDirectory(JNIEnv *env);
+
 /* Generics reflection support.
  *
  * Returns information about the given class's EnclosingMethod
@@ -1553,12 +1556,10 @@
  * ==========================================================================
  */
 typedef struct {
-    /* HotSpot Express VM version string:
-     * <major>.<minor>-bxx[-<identifier>][-<debug_flavor>]
-     */
-    unsigned int jvm_version; /* Consists of major.minor.0.build */
-    unsigned int update_version : 8;         /* 0 in HotSpot Express VM */
-    unsigned int special_update_version : 8; /* 0 in HotSpot Express VM */
+    /* VM version string: follows the JDK release version naming convention    */
+    unsigned int jvm_version; /* <major_ver>.<minor_ver>.<micro_ver>[-<identifier>][-<debug_target>][-b<nn>]  */
+    unsigned int update_version : 8;
+    unsigned int special_update_version : 8;
     unsigned int reserved1 : 16;
     unsigned int reserved2;
 
@@ -1577,11 +1578,7 @@
 
 #define JVM_VERSION_MAJOR(version) ((version & 0xFF000000) >> 24)
 #define JVM_VERSION_MINOR(version) ((version & 0x00FF0000) >> 16)
-// Micro version is 0 in HotSpot Express VM (set in jvm.cpp).
 #define JVM_VERSION_MICRO(version) ((version & 0x0000FF00) >> 8)
-/* Build number is available in all HotSpot Express VM builds.
- * It is defined in make/hotspot_version file.
- */
 #define JVM_VERSION_BUILD(version) ((version & 0x000000FF))
 
 JNIEXPORT void JNICALL
--- a/hotspot/src/share/vm/runtime/os.hpp	Thu May 01 17:57:29 2014 -0700
+++ b/hotspot/src/share/vm/runtime/os.hpp	Fri May 02 19:00:04 2014 -0700
@@ -48,6 +48,9 @@
 #ifdef TARGET_OS_FAMILY_bsd
 # include "jvm_bsd.h"
 # include <setjmp.h>
+# ifdef __APPLE__
+#  include <mach/mach_time.h>
+# endif
 #endif
 
 class AgentLibrary;
--- a/hotspot/src/share/vm/runtime/vmStructs.cpp	Thu May 01 17:57:29 2014 -0700
+++ b/hotspot/src/share/vm/runtime/vmStructs.cpp	Fri May 02 19:00:04 2014 -0700
@@ -1218,6 +1218,7 @@
   static_field(Abstract_VM_Version,            _s_internal_vm_info_string,                    const char*)                           \
   static_field(Abstract_VM_Version,            _vm_major_version,                             int)                                   \
   static_field(Abstract_VM_Version,            _vm_minor_version,                             int)                                   \
+  static_field(Abstract_VM_Version,            _vm_micro_version,                             int)                                   \
   static_field(Abstract_VM_Version,            _vm_build_number,                              int)                                   \
   static_field(Abstract_VM_Version,            _reserve_for_allocation_prefetch,              int)                                   \
                                                                                                                                      \
--- a/hotspot/src/share/vm/runtime/vm_version.cpp	Thu May 01 17:57:29 2014 -0700
+++ b/hotspot/src/share/vm/runtime/vm_version.cpp	Fri May 02 19:00:04 2014 -0700
@@ -55,6 +55,20 @@
 #ifndef HOTSPOT_RELEASE_VERSION
   #error HOTSPOT_RELEASE_VERSION must be defined
 #endif
+
+#ifndef JDK_MAJOR_VERSION
+  #error JDK_MAJOR_VERSION must be defined
+#endif
+#ifndef JDK_MINOR_VERSION
+  #error JDK_MINOR_VERSION must be defined
+#endif
+#ifndef JDK_MICRO_VERSION
+  #error JDK_MICRO_VERSION must be defined
+#endif
+#ifndef JDK_BUILD_NUMBER
+  #error JDK_BUILD_NUMBER must be defined
+#endif
+
 #ifndef JRE_RELEASE_VERSION
   #error JRE_RELEASE_VERSION must be defined
 #endif
@@ -68,39 +82,44 @@
   #define VM_RELEASE HOTSPOT_RELEASE_VERSION "-" HOTSPOT_BUILD_TARGET
 #endif
 
-// HOTSPOT_RELEASE_VERSION must follow the release version naming convention
-// <major_ver>.<minor_ver>-b<nn>[-<identifier>][-<debug_target>]
+// HOTSPOT_RELEASE_VERSION follows the JDK release version naming convention
+// <major_ver>.<minor_ver>.<micro_ver>[-<identifier>][-<debug_target>][-b<nn>]
 int Abstract_VM_Version::_vm_major_version = 0;
 int Abstract_VM_Version::_vm_minor_version = 0;
+int Abstract_VM_Version::_vm_micro_version = 0;
 int Abstract_VM_Version::_vm_build_number = 0;
 bool Abstract_VM_Version::_initialized = false;
 int Abstract_VM_Version::_parallel_worker_threads = 0;
 bool Abstract_VM_Version::_parallel_worker_threads_initialized = false;
 
+#ifdef ASSERT
+static void assert_digits(const char * s, const char * message) {
+  for (int i = 0; s[i] != '\0'; i++) {
+    assert(isdigit(s[i]), message);
+  }
+}
+#endif
+
+static void set_version_field(int * version_field, const char * version_str,
+                              const char * const assert_msg) {
+  if (version_str != NULL && *version_str != '\0') {
+    DEBUG_ONLY(assert_digits(version_str, assert_msg));
+    *version_field = atoi(version_str);
+  }
+}
+
 void Abstract_VM_Version::initialize() {
   if (_initialized) {
     return;
   }
-  char* vm_version = os::strdup(HOTSPOT_RELEASE_VERSION);
 
-  // Expecting the next vm_version format:
-  // <major_ver>.<minor_ver>-b<nn>[-<identifier>]
-  char* vm_major_ver = vm_version;
-  assert(isdigit(vm_major_ver[0]),"wrong vm major version number");
-  char* vm_minor_ver = strchr(vm_major_ver, '.');
-  assert(vm_minor_ver != NULL && isdigit(vm_minor_ver[1]),"wrong vm minor version number");
-  vm_minor_ver[0] = '\0'; // terminate vm_major_ver
-  vm_minor_ver += 1;
-  char* vm_build_num = strchr(vm_minor_ver, '-');
-  assert(vm_build_num != NULL && vm_build_num[1] == 'b' && isdigit(vm_build_num[2]),"wrong vm build number");
-  vm_build_num[0] = '\0'; // terminate vm_minor_ver
-  vm_build_num += 2;
+  set_version_field(&_vm_major_version, JDK_MAJOR_VERSION, "bad major version");
+  set_version_field(&_vm_minor_version, JDK_MINOR_VERSION, "bad minor version");
+  set_version_field(&_vm_micro_version, JDK_MICRO_VERSION, "bad micro version");
+  int offset = (JDK_BUILD_NUMBER != NULL && JDK_BUILD_NUMBER[0] == 'b') ? 1 : 0;
+  set_version_field(&_vm_build_number, JDK_BUILD_NUMBER + offset,
+                    "bad build number");
 
-  _vm_major_version = atoi(vm_major_ver);
-  _vm_minor_version = atoi(vm_minor_ver);
-  _vm_build_number  = atoi(vm_build_num);
-
-  os::free(vm_version);
   _initialized = true;
 }
 
@@ -276,6 +295,7 @@
 unsigned int Abstract_VM_Version::jvm_version() {
   return ((Abstract_VM_Version::vm_major_version() & 0xFF) << 24) |
          ((Abstract_VM_Version::vm_minor_version() & 0xFF) << 16) |
+         ((Abstract_VM_Version::vm_micro_version() & 0xFF) << 8) |
          (Abstract_VM_Version::vm_build_number() & 0xFF);
 }
 
--- a/hotspot/src/share/vm/runtime/vm_version.hpp	Thu May 01 17:57:29 2014 -0700
+++ b/hotspot/src/share/vm/runtime/vm_version.hpp	Fri May 02 19:00:04 2014 -0700
@@ -44,6 +44,7 @@
   static unsigned int _logical_processors_per_package;
   static int          _vm_major_version;
   static int          _vm_minor_version;
+  static int          _vm_micro_version;
   static int          _vm_build_number;
   static bool         _initialized;
   static int          _parallel_worker_threads;
@@ -68,6 +69,7 @@
 
   static int vm_major_version()               { assert(_initialized, "not initialized"); return _vm_major_version; }
   static int vm_minor_version()               { assert(_initialized, "not initialized"); return _vm_minor_version; }
+  static int vm_micro_version()               { assert(_initialized, "not initialized"); return _vm_micro_version; }
   static int vm_build_number()                { assert(_initialized, "not initialized"); return _vm_build_number; }
 
   // Gets the jvm_version_info.jvm_version defined in jvm.h
--- a/hotspot/src/share/vm/services/memTracker.cpp	Thu May 01 17:57:29 2014 -0700
+++ b/hotspot/src/share/vm/services/memTracker.cpp	Fri May 02 19:00:04 2014 -0700
@@ -785,7 +785,7 @@
   MEMFLAGS flags, address pc) {
   assert(old_addr != NULL && new_addr != NULL, "Sanity check");
   assert(_op == Realloc || _op == NoOp, "Wrong call");
-  if (MemTracker::is_on() && NMT_CAN_TRACK(flags) && _op != NoOp) {
+  if (MemTracker::is_on() && NMT_CAN_TRACK(flags) && _op != NoOp && !MemTracker::shutdown_in_progress()) {
     assert(_seq > 0, "Need pre-reserve sequence number");
     if (_need_thread_critical_lock) {
       ThreadCritical tc;
@@ -811,7 +811,7 @@
   // OOM already?
   if (addr == NULL) return;
 
-  if (MemTracker::is_on() && NMT_CAN_TRACK(flags) && _op != NoOp) {
+  if (MemTracker::is_on() && NMT_CAN_TRACK(flags) && _op != NoOp && !MemTracker::shutdown_in_progress()) {
     bool pre_reserved_seq = (_seq != 0);
     address  pc = CALLER_CALLER_PC;
     MEMFLAGS orig_flags = flags;
--- a/hotspot/src/share/vm/utilities/utf8.cpp	Thu May 01 17:57:29 2014 -0700
+++ b/hotspot/src/share/vm/utilities/utf8.cpp	Fri May 02 19:00:04 2014 -0700
@@ -329,23 +329,19 @@
 
 char* UNICODE::as_utf8(jchar* base, int length) {
   int utf8_len = utf8_length(base, length);
-  u_char* result = NEW_RESOURCE_ARRAY(u_char, utf8_len + 1);
-  u_char* p = result;
-  for (int index = 0; index < length; index++) {
-    p = utf8_write(p, base[index]);
-  }
-  *p = '\0';
-  assert(p == &result[utf8_len], "length prediction must be correct");
-  return (char*) result;
+  u_char* buf = NEW_RESOURCE_ARRAY(u_char, utf8_len + 1);
+  char* result = as_utf8(base, length, (char*) buf, utf8_len + 1);
+  assert((int) strlen(result) == utf8_len, "length prediction must be correct");
+  return result;
 }
 
 char* UNICODE::as_utf8(jchar* base, int length, char* buf, int buflen) {
   u_char* p = (u_char*)buf;
-  u_char* end = (u_char*)buf + buflen;
   for (int index = 0; index < length; index++) {
     jchar c = base[index];
-    if (p + utf8_size(c) >= end) break;      // string is truncated
-    p = utf8_write(p, base[index]);
+    buflen -= utf8_size(c);
+    if (buflen <= 0) break; // string is truncated
+    p = utf8_write(p, c);
   }
   *p = '\0';
   return buf;
@@ -389,3 +385,29 @@
   }
   *p = '\0';
 }
+
+#ifndef PRODUCT
+void TestAsUtf8() {
+  char res[60];
+  jchar str[20];
+
+  for (int i = 0; i < 20; i++) {
+    str[i] = 0x0800; // char that is 2B in UTF-16 but 3B in UTF-8
+  }
+  str[19] = (jchar)'\0';
+
+  // The resulting string in UTF-8 is 3*19 bytes long, but should be truncated
+  UNICODE::as_utf8(str, 19, res, 10);
+  assert(strlen(res) == 9, "string should be truncated here");
+
+  UNICODE::as_utf8(str, 19, res, 18);
+  assert(strlen(res) == 15, "string should be truncated here");
+
+  UNICODE::as_utf8(str, 19, res, 20);
+  assert(strlen(res) == 18, "string should be truncated here");
+
+  // Test with an "unbounded" buffer
+  UNICODE::as_utf8(str, 19, res, INT_MAX);
+  assert(strlen(res) == 3*19, "string should end here");
+}
+#endif
--- a/jaxp/.hgtags	Thu May 01 17:57:29 2014 -0700
+++ b/jaxp/.hgtags	Fri May 02 19:00:04 2014 -0700
@@ -250,3 +250,7 @@
 b92a20e303d24c74078888cd7084b14d7626d48f jdk9-b05
 46e4951b2a267e98341613a3b796f2c7554eb831 jdk9-b06
 389f4094fd603c17e215997b0b40171179629007 jdk9-b07
+3b360a77658e6b3ac150dd7cdbff1a7abe855afc jdk9-b08
+f93a792fe37279d4d37aea86a99f3abbdc6fe79b jdk9-b09
+4ce98701efe3b28f6ce3ab23385445731e968af7 jdk9-b10
+6b4280dceb00642f54d5bc1c2cb7d34c99a04992 jdk9-b11
--- a/jaxp/make/BuildJaxp.gmk	Thu May 01 17:57:29 2014 -0700
+++ b/jaxp/make/BuildJaxp.gmk	Fri May 02 19:00:04 2014 -0700
@@ -35,15 +35,15 @@
 # The generate new bytecode uses the new compiler for to generate bytecode
 # for the new jdk that is being built. The code compiled by this setup
 # cannot necessarily be run with the boot jdk.
-$(eval $(call SetupJavaCompiler,GENERATE_NEWBYTECODE_DEBUG, \
+$(eval $(call SetupJavaCompiler,GENERATE_NEWBYTECODE, \
     JVM := $(JAVA), \
     JAVAC := $(NEW_JAVAC), \
-    FLAGS := -XDignore.symbol.file=true $(DISABLE_JAXP_WARNINGS) -g, \
+    FLAGS := -XDignore.symbol.file=true $(DISABLE_JAXP_WARNINGS), \
     SERVER_DIR := $(SJAVAC_SERVER_DIR), \
     SERVER_JVM := $(SJAVAC_SERVER_JAVA)))
 
 $(eval $(call SetupJavaCompilation,BUILD_JAXP, \
-    SETUP := GENERATE_NEWBYTECODE_DEBUG, \
+    SETUP := GENERATE_NEWBYTECODE, \
     SRC := $(JAXP_TOPDIR)/src, \
     CLEAN := .properties, \
     BIN := $(JAXP_OUTPUTDIR)/classes, \
--- a/jaxp/src/com/sun/org/apache/xalan/internal/utils/SecuritySupport.java	Thu May 01 17:57:29 2014 -0700
+++ b/jaxp/src/com/sun/org/apache/xalan/internal/utils/SecuritySupport.java	Fri May 02 19:00:04 2014 -0700
@@ -57,7 +57,7 @@
         return securitySupport;
     }
 
-    static ClassLoader getContextClassLoader() {
+    public static ClassLoader getContextClassLoader() {
         return (ClassLoader) AccessController.doPrivileged(new PrivilegedAction() {
             public Object run() {
                 ClassLoader cl = null;
--- a/jaxp/src/com/sun/org/apache/xerces/internal/xpointer/ElementSchemePointer.java	Thu May 01 17:57:29 2014 -0700
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/xpointer/ElementSchemePointer.java	Fri May 02 19:00:04 2014 -0700
@@ -3,11 +3,12 @@
  * DO NOT REMOVE OR ALTER!
  */
 /*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -19,7 +20,7 @@
  */
 package com.sun.org.apache.xerces.internal.xpointer;
 
-import java.util.Hashtable;
+import java.util.HashMap;
 
 import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter;
 import com.sun.org.apache.xerces.internal.util.SymbolTable;
@@ -38,9 +39,8 @@
  * @xerces.internal
  *
  * @version $Id: ElementSchemePointer.java,v 1.4 2009/06/11 23:51:50 joehw Exp $
- *
  */
-class ElementSchemePointer implements XPointerPart {
+final class ElementSchemePointer implements XPointerPart {
 
     // Fields
 
@@ -346,15 +346,17 @@
 
                 // Donot check for empty elements if the empty element is
                 // a child of a found parent element
-                //if (!fIsElementFound) {
-                    if (checkMatch()) {
-                        fIsElementFound = true;
+                if (checkMatch()) {
+                    if (!fIsElementFound) {
                         fWasOnlyEmptyElementFound = true;
                     } else {
-                        fIsElementFound = false;
+                        fWasOnlyEmptyElementFound = false;
                     }
-                //}
-
+                    fIsElementFound = true;
+                } else {
+                    fIsElementFound = false;
+                    fWasOnlyEmptyElementFound = false;
+                }
             }
         }
 
@@ -526,7 +528,7 @@
 
         private SymbolTable fSymbolTable;
 
-        private Hashtable fTokenNames = new Hashtable();
+        private HashMap<Integer, String> fTokenNames = new HashMap<>();
 
         /**
          * Constructor
@@ -548,16 +550,7 @@
          * @return String The token string
          */
         private String getTokenString(int token) {
-            return (String) fTokenNames.get(new Integer(token));
-        }
-
-        /**
-         * Returns the token String
-         * @param token The index of the token
-         * @return String The token string
-         */
-        private Integer getToken(int token) {
-            return (Integer) fTokenNames.get(new Integer(token));
+            return fTokenNames.get(new Integer(token));
         }
 
         /**
@@ -566,12 +559,11 @@
          * @param token The token string
          */
         private void addToken(String tokenStr) {
-            Integer tokenInt = (Integer) fTokenNames.get(tokenStr);
-            if (tokenInt == null) {
-                tokenInt = new Integer(fTokenNames.size());
+            if (!fTokenNames.containsValue(tokenStr)) {
+                Integer tokenInt = new Integer(fTokenNames.size());
                 fTokenNames.put(tokenInt, tokenStr);
+                addToken(tokenInt.intValue());
             }
-            addToken(tokenInt.intValue());
         }
 
         /**
--- a/jaxp/src/com/sun/org/apache/xerces/internal/xpointer/ShortHandPointer.java	Thu May 01 17:57:29 2014 -0700
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/xpointer/ShortHandPointer.java	Fri May 02 19:00:04 2014 -0700
@@ -3,11 +3,12 @@
  * DO NOT REMOVE OR ALTER!
  */
 /*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -17,6 +18,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package com.sun.org.apache.xerces.internal.xpointer;
 
 import com.sun.org.apache.xerces.internal.impl.Constants;
@@ -37,9 +39,8 @@
  * in document order that has a matching NCName as an identifier.
  * </p>
  *
- *
  */
-class ShortHandPointer implements XPointerPart {
+final class ShortHandPointer implements XPointerPart {
 
     // The name of the ShortHand pointer
     private String fShortHandPointer;
@@ -261,7 +262,7 @@
      * @see com.sun.org.apache.xerces.internal.xpointer.XPointerPart#isChildFragmentResolved()
      */
     public boolean isChildFragmentResolved() {
-        return fIsFragmentResolved & ( fMatchingChildCount >  0);
+        return fIsFragmentResolved && ( fMatchingChildCount >  0);
     }
 
     /**
--- a/jaxp/src/com/sun/org/apache/xerces/internal/xpointer/XPointerErrorHandler.java	Thu May 01 17:57:29 2014 -0700
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/xpointer/XPointerErrorHandler.java	Fri May 02 19:00:04 2014 -0700
@@ -3,11 +3,12 @@
  * DO NOT REMOVE OR ALTER!
  */
 /*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -17,6 +18,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package com.sun.org.apache.xerces.internal.xpointer;
 
 import java.io.PrintWriter;
@@ -31,7 +33,7 @@
  * implementation and reported as resource errors.
  *
  */
-class XPointerErrorHandler implements XMLErrorHandler {
+final class XPointerErrorHandler implements XMLErrorHandler {
 
     //
     // Data
--- a/jaxp/src/com/sun/org/apache/xerces/internal/xpointer/XPointerHandler.java	Thu May 01 17:57:29 2014 -0700
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/xpointer/XPointerHandler.java	Fri May 02 19:00:04 2014 -0700
@@ -3,11 +3,12 @@
  * DO NOT REMOVE OR ALTER!
  */
 /*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -17,10 +18,11 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package com.sun.org.apache.xerces.internal.xpointer;
 
-import java.util.Hashtable;
-import java.util.Vector;
+import java.util.ArrayList;
+import java.util.HashMap;
 
 import com.sun.org.apache.xerces.internal.impl.Constants;
 import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter;
@@ -32,6 +34,7 @@
 import com.sun.org.apache.xerces.internal.xni.Augmentations;
 import com.sun.org.apache.xerces.internal.xni.QName;
 import com.sun.org.apache.xerces.internal.xni.XMLAttributes;
+import com.sun.org.apache.xerces.internal.xni.XMLDocumentHandler;
 import com.sun.org.apache.xerces.internal.xni.XMLString;
 import com.sun.org.apache.xerces.internal.xni.XNIException;
 import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
@@ -64,8 +67,8 @@
         XPointerProcessor {
 
     // Fields
-    // A Vector of XPointerParts
-    protected Vector fXPointerParts = null;
+    // An ArrayList of XPointerParts
+    protected ArrayList<XPointerPart> fXPointerParts = null;
 
     // The current XPointerPart
     protected XPointerPart fXPointerPart = null;
@@ -102,7 +105,7 @@
     public XPointerHandler() {
         super();
 
-        fXPointerParts = new Vector();
+        fXPointerParts = new ArrayList<>();
         fSymbolTable = new SymbolTable();
     }
 
@@ -110,13 +113,17 @@
             XMLErrorHandler errorHandler, XMLErrorReporter errorReporter) {
         super();
 
-        fXPointerParts = new Vector();
+        fXPointerParts = new ArrayList<>();
         fSymbolTable = symbolTable;
         fErrorHandler = errorHandler;
         fXPointerErrorReporter = errorReporter;
         //fErrorReporter = errorReporter; // The XInclude ErrorReporter
     }
 
+    public void setDocumentHandler(XMLDocumentHandler handler) {
+        fDocumentHandler = handler;
+    }
+
     // ************************************************************************
     //  Implementation of the XPointerProcessor interface.
     // ************************************************************************
@@ -300,7 +307,7 @@
             // in the XPointer expression until a matching element is found.
             for (int i = 0; i < fXPointerParts.size(); i++) {
 
-                fXPointerPart = (XPointerPart) fXPointerParts.get(i);
+                fXPointerPart = fXPointerParts.get(i);
 
                 if (fXPointerPart.resolveXPointer(element, attributes, augs,
                         event)) {
@@ -430,11 +437,11 @@
     }
 
     /**
-     * Returns a Vector of XPointerPart objects
+     * Returns an ArrayList of XPointerPart objects
      *
-     * @return A Vector of XPointerPart objects.
+     * @return An ArrayList of XPointerPart objects.
      */
-    public Vector getPointerParts() {
+    public ArrayList<XPointerPart> getPointerParts() {
         return fXPointerParts;
     }
 
@@ -480,7 +487,7 @@
 
         private SymbolTable fSymbolTable;
 
-        private Hashtable fTokenNames = new Hashtable();
+        private HashMap<Integer, String> fTokenNames = new HashMap<>();
 
         /**
          * Constructor
@@ -508,7 +515,7 @@
          * @return String The token string
          */
         private String getTokenString(int token) {
-            return (String) fTokenNames.get(new Integer(token));
+            return fTokenNames.get(new Integer(token));
         }
 
         /**
@@ -517,12 +524,11 @@
          * @param token The token string
          */
         private void addToken(String tokenStr) {
-            Integer tokenInt = (Integer) fTokenNames.get(tokenStr);
-            if (tokenInt == null) {
-                tokenInt = new Integer(fTokenNames.size());
+            if (!fTokenNames.containsValue(tokenStr)) {
+                Integer tokenInt = new Integer(fTokenNames.size());
                 fTokenNames.put(tokenInt, tokenStr);
+                addToken(tokenInt.intValue());
             }
-            addToken(tokenInt.intValue());
         }
 
         /**
--- a/jaxp/src/com/sun/org/apache/xerces/internal/xpointer/XPointerMessageFormatter.java	Thu May 01 17:57:29 2014 -0700
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/xpointer/XPointerMessageFormatter.java	Fri May 02 19:00:04 2014 -0700
@@ -3,11 +3,12 @@
  * DO NOT REMOVE OR ALTER!
  */
 /*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -17,6 +18,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package com.sun.org.apache.xerces.internal.xpointer;
 
 import java.util.Locale;
@@ -34,7 +36,7 @@
  *
  * @version $Id: XPointerMessageFormatter.java,v 1.5 2010-11-01 04:40:26 joehw Exp $
  */
-class XPointerMessageFormatter implements MessageFormatter {
+final class XPointerMessageFormatter implements MessageFormatter {
 
     public static final String XPOINTER_DOMAIN = "http://www.w3.org/TR/XPTR";
 
--- a/jaxp/src/com/sun/org/apache/xerces/internal/xpointer/XPointerPart.java	Thu May 01 17:57:29 2014 -0700
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/xpointer/XPointerPart.java	Fri May 02 19:00:04 2014 -0700
@@ -3,11 +3,12 @@
  * DO NOT REMOVE OR ALTER!
  */
 /*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -17,6 +18,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package com.sun.org.apache.xerces.internal.xpointer;
 
 import com.sun.org.apache.xerces.internal.xni.Augmentations;
@@ -49,7 +51,7 @@
      * Provides scheme specific parsing of a XPointer expression i.e.
      * the PointerPart or ShortHandPointer.
      *
-     * @param  xpointer A String representing the PointerPart or ShortHandPointer.
+     * @param  part A String representing the PointerPart or ShortHandPointer.
      * @throws XNIException Thrown if the PointerPart string does not conform to
      *         the syntax defined by its scheme.
      *
--- a/jaxp/src/com/sun/org/apache/xerces/internal/xpointer/XPointerProcessor.java	Thu May 01 17:57:29 2014 -0700
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/xpointer/XPointerProcessor.java	Fri May 02 19:00:04 2014 -0700
@@ -3,11 +3,12 @@
  * DO NOT REMOVE OR ALTER!
  */
 /*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -34,7 +35,6 @@
  *
  * @xerces.internal
  *
- *
  */
 public interface XPointerProcessor {
 
@@ -56,7 +56,6 @@
      * @throws XNIException Thrown if the xpointer string does not conform to
      *         the XPointer Framework syntax or the syntax of the pointer part does
      *         not conform to its definition for its scheme.
-     *
      */
     public void parseXPointer(String xpointer) throws XNIException;
 
@@ -74,7 +73,6 @@
      *                2 - An empty element call
      * @return true if the element was resolved by the xpointer
      * @throws XNIException Thrown to signal an error
-     *
      */
     public boolean resolveXPointer(QName element, XMLAttributes attributes,
             Augmentations augs, int event) throws XNIException;
@@ -86,7 +84,6 @@
      * @return True if the xpointer expression matches a node/fragment in the resource
      *         else returns false.
      * @throws XNIException Thrown to signal an error
-     *
      */
     public boolean isFragmentResolved() throws XNIException;
 
@@ -97,7 +94,6 @@
      * @return True if the xpointer expression matches a fragment in the resource
      *         else returns false.
      * @throws XNIException Thrown to signal an error
-     *
      */
     public boolean isXPointerResolved() throws XNIException;
 
--- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/CharInfo.java	Thu May 01 17:57:29 2014 -0700
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/CharInfo.java	Fri May 02 19:00:04 2014 -0700
@@ -22,6 +22,11 @@
  */
 package com.sun.org.apache.xml.internal.serializer;
 
+import com.sun.org.apache.xalan.internal.utils.SecuritySupport;
+import com.sun.org.apache.xml.internal.serializer.utils.MsgKey;
+import com.sun.org.apache.xml.internal.serializer.utils.SystemIDResolver;
+import com.sun.org.apache.xml.internal.serializer.utils.Utils;
+import com.sun.org.apache.xml.internal.serializer.utils.WrappedRuntimeException;
 import java.io.BufferedReader;
 import java.io.InputStream;
 import java.io.InputStreamReader;
@@ -29,19 +34,11 @@
 import java.net.URL;
 import java.util.Enumeration;
 import java.util.HashMap;
+import java.util.Locale;
 import java.util.PropertyResourceBundle;
 import java.util.ResourceBundle;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-
 import javax.xml.transform.TransformerException;
 
-import com.sun.org.apache.xml.internal.serializer.utils.MsgKey;
-import com.sun.org.apache.xml.internal.serializer.utils.SystemIDResolver;
-import com.sun.org.apache.xml.internal.serializer.utils.Utils;
-import com.sun.org.apache.xml.internal.serializer.utils.WrappedRuntimeException;
-import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
-
 /**
  * This class provides services that tell if a character should have
  * special treatement, such as entity reference substitution or normalization
@@ -176,13 +173,19 @@
         //      file
         //   3) try treating the resource a URI
 
-        if (internal) {
-            try {
+        try {
+            if (internal) {
                 // Load entity property files by using PropertyResourceBundle,
                 // cause of security issure for applets
                 entities = PropertyResourceBundle.getBundle(entitiesResource);
-            } catch (Exception e) {}
-        }
+            } else {
+                ClassLoader cl = SecuritySupport.getContextClassLoader();
+                if (cl != null) {
+                    entities = PropertyResourceBundle.getBundle(entitiesResource,
+                            Locale.getDefault(), cl);
+                }
+            }
+        } catch (Exception e) {}
 
         if (entities != null) {
             Enumeration keys = entities.getKeys();
@@ -198,6 +201,7 @@
             set(S_CARRIAGERETURN);
         } else {
             InputStream is = null;
+            String err = null;
 
             // Load user specified resource file by using URL loading, it
             // requires a valid URI as parameter
@@ -205,18 +209,22 @@
                 if (internal) {
                     is = CharInfo.class.getResourceAsStream(entitiesResource);
                 } else {
-                    ClassLoader cl = ObjectFactory.findClassLoader();
-                    if (cl == null) {
-                        is = ClassLoader.getSystemResourceAsStream(entitiesResource);
-                    } else {
-                        is = cl.getResourceAsStream(entitiesResource);
+                    ClassLoader cl = SecuritySupport.getContextClassLoader();
+                    if (cl != null) {
+                        try {
+                            is = cl.getResourceAsStream(entitiesResource);
+                        } catch (Exception e) {
+                            err = e.getMessage();
+                        }
                     }
 
                     if (is == null) {
                         try {
                             URL url = new URL(entitiesResource);
                             is = url.openStream();
-                        } catch (Exception e) {}
+                        } catch (Exception e) {
+                            err = e.getMessage();
+                        }
                     }
                 }
 
@@ -224,7 +232,7 @@
                     throw new RuntimeException(
                         Utils.messages.createMessage(
                             MsgKey.ER_RESOURCE_COULD_NOT_FIND,
-                            new Object[] {entitiesResource, entitiesResource}));
+                            new Object[] {entitiesResource, err}));
                 }
 
                 // Fix Bugzilla#4000: force reading in UTF-8
@@ -456,64 +464,56 @@
         return isCleanTextASCII[value];
     }
 
-//  In the future one might want to use the array directly and avoid
-//  the method call, but I think the JIT alreay inlines this well enough
-//  so don't do it (for now) - bjm
-//    public final boolean[] getASCIIClean()
-//    {
-//        return isCleanTextASCII;
-//    }
 
+    /**
+     * Read an internal resource file that describes the mapping of
+     * characters to entity references; Construct a CharInfo object.
+     *
+     * @param entitiesFileName Name of entities resource file that should
+     * be loaded, which describes the mapping of characters to entity references.
+     * @param method the output method type, which should be one of "xml", "html", and "text".
+     * @return an instance of CharInfo
+     *
+     * @xsl.usage internal
+     */
+    static CharInfo getCharInfoInternal(String entitiesFileName, String method)
+    {
+        CharInfo charInfo = (CharInfo) m_getCharInfoCache.get(entitiesFileName);
+        if (charInfo != null) {
+            return charInfo;
+        }
 
-    private static CharInfo getCharInfoBasedOnPrivilege(
-        final String entitiesFileName, final String method,
-        final boolean internal){
-            return (CharInfo) AccessController.doPrivileged(
-                new PrivilegedAction() {
-                        public Object run() {
-                            return new CharInfo(entitiesFileName,
-                              method, internal);}
-            });
+        charInfo = new CharInfo(entitiesFileName, method, true);
+        m_getCharInfoCache.put(entitiesFileName, charInfo);
+        return charInfo;
     }
 
     /**
-     * Factory that reads in a resource file that describes the mapping of
-     * characters to entity references.
+     * Constructs a CharInfo object using the following process to try reading
+     * the entitiesFileName parameter:
      *
-     * Resource files must be encoded in UTF-8 and have a format like:
+     *   1) attempt to load it as a ResourceBundle
+     *   2) try using the class loader to find the specified file
+     *   3) try opening it as an URI
+     *
+     * In case of 2 and 3, the resource file must be encoded in UTF-8 and have the
+     * following format:
      * <pre>
      * # First char # is a comment
      * Entity numericValue
      * quot 34
      * amp 38
      * </pre>
-     * (Note: Why don't we just switch to .properties files? Oct-01 -sc)
      *
-     * @param entitiesResource Name of entities resource file that should
-     * be loaded, which describes that mapping of characters to entity references.
-     * @param method the output method type, which should be one of "xml", "html", "text"...
-     *
-     * @xsl.usage internal
+     * @param entitiesFileName Name of entities resource file that should
+     * be loaded, which describes the mapping of characters to entity references.
+     * @param method the output method type, which should be one of "xml", "html", and "text".
+     * @return an instance of CharInfo
      */
     static CharInfo getCharInfo(String entitiesFileName, String method)
     {
-        CharInfo charInfo = (CharInfo) m_getCharInfoCache.get(entitiesFileName);
-        if (charInfo != null) {
-            return charInfo;
-        }
-
-        // try to load it internally - cache
         try {
-            charInfo = getCharInfoBasedOnPrivilege(entitiesFileName,
-                                        method, true);
-            m_getCharInfoCache.put(entitiesFileName, charInfo);
-            return charInfo;
-        } catch (Exception e) {}
-
-        // try to load it externally - do not cache
-        try {
-            return getCharInfoBasedOnPrivilege(entitiesFileName,
-                                method, false);
+            return new CharInfo(entitiesFileName, method, false);
         } catch (Exception e) {}
 
         String absoluteEntitiesFileName;
@@ -530,8 +530,7 @@
             }
         }
 
-        return getCharInfoBasedOnPrivilege(entitiesFileName,
-                                method, false);
+        return new CharInfo(absoluteEntitiesFileName, method, false);
     }
 
     /** Table of user-specified char infos. */
--- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/ToHTMLStream.java	Thu May 01 17:57:29 2014 -0700
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/ToHTMLStream.java	Fri May 02 19:00:04 2014 -0700
@@ -60,7 +60,7 @@
      */
     private static final CharInfo m_htmlcharInfo =
 //        new CharInfo(CharInfo.HTML_ENTITIES_RESOURCE);
-        CharInfo.getCharInfo(CharInfo.HTML_ENTITIES_RESOURCE, Method.HTML);
+        CharInfo.getCharInfoInternal(CharInfo.HTML_ENTITIES_RESOURCE, Method.HTML);
 
     /** A digital search trie for fast, case insensitive lookup of ElemDesc objects. */
     static final Trie m_elementFlags = new Trie();
--- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/ToXMLStream.java	Thu May 01 17:57:29 2014 -0700
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/ToXMLStream.java	Fri May 02 19:00:04 2014 -0700
@@ -58,7 +58,7 @@
      */
     private static CharInfo m_xmlcharInfo =
 //      new CharInfo(CharInfo.XML_ENTITIES_RESOURCE);
-        CharInfo.getCharInfo(CharInfo.XML_ENTITIES_RESOURCE, Method.XML);
+        CharInfo.getCharInfoInternal(CharInfo.XML_ENTITIES_RESOURCE, Method.XML);
 
     /**
      * Default constructor.
--- a/jaxws/.hgtags	Thu May 01 17:57:29 2014 -0700
+++ b/jaxws/.hgtags	Fri May 02 19:00:04 2014 -0700
@@ -253,3 +253,7 @@
 eae966c8133fec0a8bf9e16d1274a4ede3c0fb52 jdk9-b05
 cf0a6e41670f990414cd337000ad5f3bd1908073 jdk9-b06
 856a9132f506cafe2f251c1a16a0b14e4d16048d jdk9-b07
+2d9f4166e0be68aa43c5f4fd0f8d34768e11f652 jdk9-b08
+c9e8bb8c1144a966ca7b481142c6b5e55d14a29c jdk9-b09
+9af43f4d215f6f19b1767f6ac66da931b8ee9535 jdk9-b10
+1f953ba7db2b535e19f0354abfee6d67605e0684 jdk9-b11
--- a/jaxws/make/BuildJaxws.gmk	Thu May 01 17:57:29 2014 -0700
+++ b/jaxws/make/BuildJaxws.gmk	Fri May 02 19:00:04 2014 -0700
@@ -35,21 +35,21 @@
 # The generate new bytecode uses the new compiler for to generate bytecode
 # for the new jdk that is being built. The code compiled by this setup
 # cannot necessarily be run with the boot jdk.
-$(eval $(call SetupJavaCompiler,GENERATE_NEWBYTECODE_DEBUG, \
+$(eval $(call SetupJavaCompiler,GENERATE_NEWBYTECODE, \
     JVM := $(JAVA), \
     JAVAC := $(NEW_JAVAC), \
-    FLAGS := -XDignore.symbol.file=true $(DISABLE_JAXWS_WARNINGS) -g, \
+    FLAGS := -XDignore.symbol.file=true $(DISABLE_JAXWS_WARNINGS), \
     SERVER_DIR := $(SJAVAC_SERVER_DIR), \
     SERVER_JVM := $(SJAVAC_SERVER_JAVA)))
 
 $(eval $(call SetupJavaCompilation,BUILD_JAF, \
-    SETUP := GENERATE_NEWBYTECODE_DEBUG, \
+    SETUP := GENERATE_NEWBYTECODE, \
     SRC := $(JAXWS_TOPDIR)/src/share/jaf_classes, \
     CLEAN := .properties, \
     BIN := $(JAXWS_OUTPUTDIR)/jaf_classes))
 
 $(eval $(call SetupJavaCompilation,BUILD_JAXWS, \
-    SETUP := GENERATE_NEWBYTECODE_DEBUG, \
+    SETUP := GENERATE_NEWBYTECODE, \
     SRC := $(JAXWS_TOPDIR)/src/share/jaxws_classes, \
     BIN := $(JAXWS_OUTPUTDIR)/jaxws_classes, \
     COPY := .xsd, \
--- a/jaxws/src/share/jaf_classes/javax/activation/CommandMap.java	Thu May 01 17:57:29 2014 -0700
+++ b/jaxws/src/share/jaf_classes/javax/activation/CommandMap.java	Fri May 02 19:00:04 2014 -0700
@@ -25,6 +25,9 @@
 
 package javax.activation;
 
+import java.util.Map;
+import java.util.WeakHashMap;
+
 
 /**
  * The CommandMap class provides an interface to a registry of
@@ -38,6 +41,8 @@
  */
 public abstract class CommandMap {
     private static CommandMap defaultCommandMap = null;
+    private static Map<ClassLoader,CommandMap> map =
+                                new WeakHashMap<ClassLoader,CommandMap>();
 
     /**
      * Get the default CommandMap.
@@ -56,11 +61,18 @@
      *
      * @return the CommandMap
      */
-    public static CommandMap getDefaultCommandMap() {
-        if (defaultCommandMap == null)
-            defaultCommandMap = new MailcapCommandMap();
+    public static synchronized CommandMap getDefaultCommandMap() {
+        if (defaultCommandMap != null)
+            return defaultCommandMap;
 
-        return defaultCommandMap;
+        // fetch per-thread-context-class-loader default
+        ClassLoader tccl = SecuritySupport.getContextClassLoader();
+        CommandMap def = map.get(tccl);
+        if (def == null) {
+            def = new MailcapCommandMap();
+            map.put(tccl, def);
+        }
+        return def;
     }
 
     /**
@@ -71,7 +83,7 @@
      * @exception SecurityException if the caller doesn't have permission
      *                                  to change the default
      */
-    public static void setDefaultCommandMap(CommandMap commandMap) {
+    public static synchronized void setDefaultCommandMap(CommandMap commandMap) {
         SecurityManager security = System.getSecurityManager();
         if (security != null) {
             try {
@@ -79,13 +91,16 @@
                 security.checkSetFactory();
             } catch (SecurityException ex) {
                 // otherwise, we also allow it if this code and the
-                // factory come from the same class loader (e.g.,
+                // factory come from the same (non-system) class loader (e.g.,
                 // the JAF classes were loaded with the applet classes).
-                if (CommandMap.class.getClassLoader() !=
+                if (CommandMap.class.getClassLoader() == null ||
+                    CommandMap.class.getClassLoader() !=
                             commandMap.getClass().getClassLoader())
                     throw ex;
             }
         }
+        // remove any per-thread-context-class-loader CommandMap
+        map.remove(SecuritySupport.getContextClassLoader());
         defaultCommandMap = commandMap;
     }
 
--- a/jaxws/src/share/jaf_classes/javax/activation/DataHandler.java	Thu May 01 17:57:29 2014 -0700
+++ b/jaxws/src/share/jaf_classes/javax/activation/DataHandler.java	Fri May 02 19:00:04 2014 -0700
@@ -368,7 +368,12 @@
         // if it's not set, set it...
         if (transferFlavors == emptyFlavors)
             transferFlavors = getDataContentHandler().getTransferDataFlavors();
-        return transferFlavors;
+
+        if (transferFlavors == emptyFlavors)
+            return transferFlavors;
+        else
+            return transferFlavors.clone();
+
     }
 
     /**
--- a/jaxws/src/share/jaf_classes/javax/activation/FileTypeMap.java	Thu May 01 17:57:29 2014 -0700
+++ b/jaxws/src/share/jaf_classes/javax/activation/FileTypeMap.java	Fri May 02 19:00:04 2014 -0700
@@ -26,6 +26,8 @@
 package javax.activation;
 
 import java.io.File;
+import java.util.Map;
+import java.util.WeakHashMap;
 
 /**
  * The FileTypeMap is an abstract class that provides a data typing
@@ -48,6 +50,8 @@
 public abstract class FileTypeMap {
 
     private static FileTypeMap defaultMap = null;
+    private static Map<ClassLoader,FileTypeMap> map =
+                                new WeakHashMap<ClassLoader,FileTypeMap>();
 
     /**
      * The default constructor.
@@ -78,11 +82,11 @@
      * Sets the default FileTypeMap for the system. This instance
      * will be returned to callers of getDefaultFileTypeMap.
      *
-     * @param map The FileTypeMap.
+     * @param fileTypeMap The FileTypeMap.
      * @exception SecurityException if the caller doesn't have permission
      *                                  to change the default
      */
-    public static void setDefaultFileTypeMap(FileTypeMap map) {
+    public static synchronized void setDefaultFileTypeMap(FileTypeMap fileTypeMap) {
         SecurityManager security = System.getSecurityManager();
         if (security != null) {
             try {
@@ -90,14 +94,17 @@
                 security.checkSetFactory();
             } catch (SecurityException ex) {
                 // otherwise, we also allow it if this code and the
-                // factory come from the same class loader (e.g.,
+                // factory come from the same (non-system) class loader (e.g.,
                 // the JAF classes were loaded with the applet classes).
-                if (FileTypeMap.class.getClassLoader() !=
-                        map.getClass().getClassLoader())
+                if (FileTypeMap.class.getClassLoader() == null ||
+                    FileTypeMap.class.getClassLoader() !=
+                        fileTypeMap.getClass().getClassLoader())
                     throw ex;
             }
         }
-        defaultMap = map;
+        // remove any per-thread-context-class-loader FileTypeMap
+        map.remove(SecuritySupport.getContextClassLoader());
+        defaultMap = fileTypeMap;
     }
 
     /**
@@ -109,10 +116,17 @@
      * @return The default FileTypeMap
      * @see javax.activation.FileTypeMap#setDefaultFileTypeMap
      */
-    public static FileTypeMap getDefaultFileTypeMap() {
-        // XXX - probably should be synchronized
-        if (defaultMap == null)
-            defaultMap = new MimetypesFileTypeMap();
-        return defaultMap;
+    public static synchronized FileTypeMap getDefaultFileTypeMap() {
+        if (defaultMap != null)
+            return defaultMap;
+
+        // fetch per-thread-context-class-loader default
+        ClassLoader tccl = SecuritySupport.getContextClassLoader();
+        FileTypeMap def = map.get(tccl);
+        if (def == null) {
+            def = new MimetypesFileTypeMap();
+            map.put(tccl, def);
+        }
+        return def;
     }
 }
--- a/jaxws/src/share/jaf_classes/javax/activation/MailcapCommandMap.java	Thu May 01 17:57:29 2014 -0700
+++ b/jaxws/src/share/jaf_classes/javax/activation/MailcapCommandMap.java	Fri May 02 19:00:04 2014 -0700
@@ -120,11 +120,7 @@
 public class MailcapCommandMap extends CommandMap {
     /*
      * We manage a collection of databases, searched in order.
-     * The default database is shared between all instances
-     * of this class.
-     * XXX - Can we safely share more databases between instances?
      */
-    private static MailcapFile defDB = null;
     private MailcapFile[] DB;
     private static final int PROG = 0;  // programmatically added entries
 
@@ -164,14 +160,10 @@
         loadAllResources(dbv, "META-INF/mailcap");
 
         LogSupport.log("MailcapCommandMap: load DEF");
-        synchronized (MailcapCommandMap.class) {
-            // see if another instance has created this yet.
-            if (defDB == null)
-                defDB = loadResource("/META-INF/mailcap.default");
-        }
+        mf = loadResource("/META-INF/mailcap.default");
 
-        if (defDB != null)
-            dbv.add(defDB);
+        if (mf != null)
+            dbv.add(mf);
 
         DB = new MailcapFile[dbv.size()];
         DB = (MailcapFile[])dbv.toArray(DB);
--- a/jaxws/src/share/jaf_classes/javax/activation/MimetypesFileTypeMap.java	Thu May 01 17:57:29 2014 -0700
+++ b/jaxws/src/share/jaf_classes/javax/activation/MimetypesFileTypeMap.java	Fri May 02 19:00:04 2014 -0700
@@ -69,11 +69,7 @@
 public class MimetypesFileTypeMap extends FileTypeMap {
     /*
      * We manage a collection of databases, searched in order.
-     * The default database is shared between all instances
-     * of this class.
-     * XXX - Can we safely share more databases between instances?
      */
-    private static MimeTypeFile defDB = null;
     private MimeTypeFile[] DB;
     private static final int PROG = 0;  // programmatically added entries
 
@@ -114,14 +110,10 @@
         loadAllResources(dbv, "META-INF/mime.types");
 
         LogSupport.log("MimetypesFileTypeMap: load DEF");
-        synchronized (MimetypesFileTypeMap.class) {
-            // see if another instance has created this yet.
-            if (defDB == null)
-                defDB = loadResource("/META-INF/mimetypes.default");
-        }
+        mf = loadResource("/META-INF/mimetypes.default");
 
-        if (defDB != null)
-            dbv.addElement(defDB);
+        if (mf != null)
+            dbv.addElement(mf);
 
         DB = new MimeTypeFile[dbv.size()];
         dbv.copyInto(DB);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/ContextClassloaderLocal.java	Fri May 02 19:00:04 2014 -0700
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.tools.internal.ws.wsdl.parser;
+
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.text.MessageFormat;
+import java.util.ResourceBundle;
+import java.util.WeakHashMap;
+
+/**
+ * Simple utility ensuring that the value is cached only in case it is non-internal implementation
+ */
+abstract class ContextClassloaderLocal<V> {
+
+    private static final String FAILED_TO_CREATE_NEW_INSTANCE = "FAILED_TO_CREATE_NEW_INSTANCE";
+
+    private WeakHashMap<ClassLoader, V> CACHE = new WeakHashMap<ClassLoader, V>();
+
+    public V get() throws Error {
+        ClassLoader tccl = getContextClassLoader();
+        V instance = CACHE.get(tccl);
+        if (instance == null) {
+            instance = createNewInstance();
+            CACHE.put(tccl, instance);
+        }
+        return instance;
+    }
+
+    public void set(V instance) {
+        CACHE.put(getContextClassLoader(), instance);
+    }
+
+    protected abstract V initialValue() throws Exception;
+
+    private V createNewInstance() {
+        try {
+            return initialValue();
+        } catch (Exception e) {
+            throw new Error(format(FAILED_TO_CREATE_NEW_INSTANCE, getClass().getName()), e);
+        }
+    }
+
+    private static String format(String property, Object... args) {
+        String text = ResourceBundle.getBundle(ContextClassloaderLocal.class.getName()).getString(property);
+        return MessageFormat.format(text, args);
+    }
+
+    private static ClassLoader getContextClassLoader() {
+        return (ClassLoader)
+                AccessController.doPrivileged(new PrivilegedAction() {
+                    public Object run() {
+                        ClassLoader cl = null;
+                        try {
+                            cl = Thread.currentThread().getContextClassLoader();
+                        } catch (SecurityException ex) {
+                        }
+                        return cl;
+                    }
+                });
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/ContextClassloaderLocal.properties	Fri May 02 19:00:04 2014 -0700
@@ -0,0 +1,26 @@
+#
+# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+FAILED_TO_CREATE_NEW_INSTANCE=Failed to create new instance of {0}
--- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/Internalizer.java	Thu May 01 17:57:29 2014 -0700
+++ b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/Internalizer.java	Fri May 02 19:00:04 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -60,12 +60,10 @@
  */
 public class Internalizer {
 
-    private static final XPathFactory xpf = XmlUtil.newXPathFactory(true);
-    private final XPath xpath = xpf.newXPath();
+    private final XPath xpath = xpf.get().newXPath();
     private final DOMForest forest;
     private final ErrorReceiver errorReceiver;
 
-
     public Internalizer(DOMForest forest, WsimportOptions options, ErrorReceiver errorReceiver) {
         this.forest = forest;
         this.errorReceiver = errorReceiver;
@@ -77,6 +75,12 @@
         }
     }
 
+    private static final ContextClassloaderLocal<XPathFactory> xpf = new ContextClassloaderLocal<XPathFactory>() {
+        @Override
+        protected XPathFactory initialValue() throws Exception {
+            return XPathFactory.newInstance();
+        }
+    };
     /**
      * Validates attributes of a &lt;JAXWS:bindings> element.
      */
--- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/JAXWSBindingExtensionHandler.java	Thu May 01 17:57:29 2014 -0700
+++ b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/JAXWSBindingExtensionHandler.java	Fri May 02 19:00:04 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -54,8 +54,14 @@
 public class JAXWSBindingExtensionHandler extends AbstractExtensionHandler {
 
     // xml security enabled always, xpath used for parsing "part" attribute
-    private static final XPathFactory xpf = XmlUtil.newXPathFactory(true);
-    private final XPath xpath = xpf.newXPath();
+    private static final ContextClassloaderLocal<XPathFactory> xpf = new ContextClassloaderLocal<XPathFactory>() {
+        @Override
+        protected XPathFactory initialValue() throws Exception {
+            return XPathFactory.newInstance();
+        }
+    };
+
+    private final XPath xpath = xpf.get().newXPath();
 
     public JAXWSBindingExtensionHandler(Map<String, AbstractExtensionHandler> extensionHandlerMap) {
         super(extensionHandlerMap);
--- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/internalizer/Internalizer.java	Thu May 01 17:57:29 2014 -0700
+++ b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/internalizer/Internalizer.java	Fri May 02 19:00:04 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -76,8 +76,6 @@
 
     private static final String WSDL_NS = "http://schemas.xmlsoap.org/wsdl/";
 
-    private static XPathFactory xpf = null;
-
     private final XPath xpath;
 
     /**
@@ -99,12 +97,7 @@
         this.errorHandler = forest.getErrorHandler();
         this.forest = forest;
         this.enableSCD = enableSCD;
-        synchronized (this) {
-            if (xpf == null) {
-                xpf = XmlFactory.createXPathFactory(disableSecureProcessing);
-            }
-        }
-        xpath = xpf.newXPath();
+        xpath = XmlFactory.createXPathFactory(disableSecureProcessing).newXPath();
     }
 
     /**
@@ -170,7 +163,6 @@
             if( a.getLocalName().equals("multiple") ) //
                 continue;
 
-
             // TODO: flag error for this undefined attribute
         }
     }
--- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/DatatypeConverterImpl.java	Thu May 01 17:57:29 2014 -0700
+++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/DatatypeConverterImpl.java	Fri May 02 19:00:04 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,9 +27,14 @@
 
 import java.math.BigDecimal;
 import java.math.BigInteger;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 import java.util.Calendar;
+import java.util.Collections;
 import java.util.GregorianCalendar;
+import java.util.Map;
 import java.util.TimeZone;
+import java.util.WeakHashMap;
 
 import javax.xml.bind.DatatypeConverter;
 import javax.xml.bind.DatatypeConverterInterface;
@@ -356,7 +361,7 @@
 
     public static GregorianCalendar _parseDateTime(CharSequence s) {
         String val = WhiteSpaceProcessor.trim(s).toString();
-        return datatypeFactory.newXMLGregorianCalendar(val).toGregorianCalendar();
+        return getDatatypeFactory().newXMLGregorianCalendar(val).toGregorianCalendar();
     }
 
     public static String _printDateTime(Calendar val) {
@@ -722,14 +727,30 @@
         }
         return false;
     }
-    private static final DatatypeFactory datatypeFactory;
 
-    static {
-        try {
-            datatypeFactory = DatatypeFactory.newInstance();
-        } catch (DatatypeConfigurationException e) {
-            throw new Error(e);
+    private static final Map<ClassLoader, DatatypeFactory> DF_CACHE = Collections.synchronizedMap(new WeakHashMap<ClassLoader, DatatypeFactory>());
+
+    public static DatatypeFactory getDatatypeFactory() {
+        ClassLoader tccl = AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
+            public ClassLoader run() {
+                return Thread.currentThread().getContextClassLoader();
+            }
+        });
+        DatatypeFactory df = DF_CACHE.get(tccl);
+        if (df == null) {
+            synchronized (DatatypeConverterImpl.class) {
+                df = DF_CACHE.get(tccl);
+                if (df == null) { // to prevent multiple initialization
+                    try {
+                        df = DatatypeFactory.newInstance();
+                    } catch (DatatypeConfigurationException e) {
+                        throw new Error(Messages.FAILED_TO_INITIALE_DATATYPE_FACTORY.format(),e);
+                    }
+                    DF_CACHE.put(tccl, df);
+                }
+            }
         }
+        return df;
     }
 
     private static final class CalendarFormatter {
@@ -1045,7 +1066,7 @@
 
     @Deprecated
     public Calendar parseTime(String lexicalXSDTime) {
-        return datatypeFactory.newXMLGregorianCalendar(lexicalXSDTime).toGregorianCalendar();
+        return getDatatypeFactory().newXMLGregorianCalendar(lexicalXSDTime).toGregorianCalendar();
     }
 
     @Deprecated
@@ -1055,7 +1076,7 @@
 
     @Deprecated
     public Calendar parseDate(String lexicalXSDDate) {
-        return datatypeFactory.newXMLGregorianCalendar(lexicalXSDDate).toGregorianCalendar();
+        return getDatatypeFactory().newXMLGregorianCalendar(lexicalXSDDate).toGregorianCalendar();
     }
 
     @Deprecated
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/Messages.java	Fri May 02 19:00:04 2014 -0700
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.xml.internal.bind;
+
+import java.text.MessageFormat;
+import java.util.ResourceBundle;
+
+/**
+ * Message resources
+ */
+enum Messages {
+    FAILED_TO_INITIALE_DATATYPE_FACTORY, // 0 args
+    ;
+
+    private static final ResourceBundle rb = ResourceBundle.getBundle(Messages.class.getName());
+
+    @Override
+    public String toString() {
+        return format();
+    }
+
+    public String format( Object... args ) {
+        return MessageFormat.format( rb.getString(name()), args );
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/Messages.properties	Fri May 02 19:00:04 2014 -0700
@@ -0,0 +1,27 @@
+#
+# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+FAILED_TO_INITIALE_DATATYPE_FACTORY = \
+    Failed to initialize JAXP 1.3 DatatypeFactory class.
--- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/impl/Messages.java	Thu May 01 17:57:29 2014 -0700
+++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/impl/Messages.java	Fri May 02 19:00:04 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -60,7 +60,6 @@
     PROPERTY_ORDER_CONTAINS_UNUSED_ENTRY, // 2 args
 
     INVALID_XML_ENUM_VALUE, // 2 arg
-    FAILED_TO_INITIALE_DATATYPE_FACTORY, // 0 args
     NO_IMAGE_WRITER, // 1 arg
 
     ILLEGAL_MIME_TYPE, // 2 args
--- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeBuiltinLeafInfoImpl.java	Thu May 01 17:57:29 2014 -0700
+++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeBuiltinLeafInfoImpl.java	Fri May 02 19:00:04 2014 -0700
@@ -63,9 +63,7 @@
 import javax.imageio.stream.ImageOutputStream;
 import javax.xml.bind.ValidationEvent;
 import javax.xml.bind.helpers.ValidationEventImpl;
-import javax.xml.datatype.DatatypeConfigurationException;
 import javax.xml.datatype.DatatypeConstants;
-import javax.xml.datatype.DatatypeFactory;
 import javax.xml.datatype.Duration;
 import javax.xml.datatype.XMLGregorianCalendar;
 import javax.xml.namespace.QName;
@@ -574,7 +572,8 @@
 
                 public XMLGregorianCalendar parse(CharSequence lexical) throws SAXException {
                     try {
-                        return datatypeFactory.newXMLGregorianCalendar(lexical.toString().trim()); // (.trim() - issue 396)
+                        return DatatypeConverterImpl.getDatatypeFactory()
+                                .newXMLGregorianCalendar(lexical.toString().trim()); // (.trim() - issue 396)
                     } catch (Exception e) {
                         UnmarshallingContext.getInstance().handleError(e);
                         return null;
@@ -844,7 +843,7 @@
 
                 public Duration parse(CharSequence lexical) {
                     TODO.checkSpec("JSR222 Issue #42");
-                    return datatypeFactory.newDuration(lexical.toString());
+                    return DatatypeConverterImpl.getDatatypeFactory().newDuration(lexical.toString());
                 }
             });
         primaryList.add(
@@ -885,21 +884,6 @@
         }
     }
 
-
-    /**
-     * Cached instance of {@link DatatypeFactory} to create
-     * {@link XMLGregorianCalendar} and {@link Duration}.
-     */
-    private static final DatatypeFactory datatypeFactory = init();
-
-    private static DatatypeFactory init() {
-        try {
-            return DatatypeFactory.newInstance();
-        } catch (DatatypeConfigurationException e) {
-            throw new Error(Messages.FAILED_TO_INITIALE_DATATYPE_FACTORY.format(),e);
-        }
-    }
-
         private static void checkXmlGregorianCalendarFieldRef(QName type,
                 XMLGregorianCalendar cal)throws javax.xml.bind.MarshalException{
                 StringBuilder buf = new StringBuilder();
--- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/JAXBContextImpl.java	Thu May 01 17:57:29 2014 -0700
+++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/JAXBContextImpl.java	Fri May 02 19:00:04 2014 -0700
@@ -129,14 +129,6 @@
     private final Map<TypeReference,Bridge> bridges = new LinkedHashMap<TypeReference,Bridge>();
 
     /**
-     * Shared instance of {@link TransformerFactory}.
-     * Lock before use, because a {@link TransformerFactory} is not thread-safe
-     * whereas {@link JAXBContextImpl} is.
-     * Lazily created.
-     */
-    private volatile static SAXTransformerFactory tf;
-
-    /**
      * Shared instance of {@link DocumentBuilder}.
      * Lock before use. Lazily created.
      */
@@ -705,13 +697,7 @@
      */
     static Transformer createTransformer(boolean disableSecureProcessing) {
         try {
-            if (tf==null) {
-                synchronized(JAXBContextImpl.class) {
-                    if (tf==null) {
-                        tf = (SAXTransformerFactory)XmlFactory.createTransformerFactory(disableSecureProcessing);
-                    }
-                }
-            }
+            SAXTransformerFactory tf = (SAXTransformerFactory)XmlFactory.createTransformerFactory(disableSecureProcessing);
             return tf.newTransformer();
         } catch (TransformerConfigurationException e) {
             throw new Error(e); // impossible
@@ -723,13 +709,7 @@
      */
     public static TransformerHandler createTransformerHandler(boolean disableSecureProcessing) {
         try {
-            if (tf==null) {
-                synchronized(JAXBContextImpl.class) {
-                    if (tf==null) {
-                        tf = (SAXTransformerFactory)XmlFactory.createTransformerFactory(disableSecureProcessing);
-                    }
-                }
-            }
+            SAXTransformerFactory tf = (SAXTransformerFactory)XmlFactory.createTransformerFactory(disableSecureProcessing);
             return tf.newTransformerHandler();
         } catch (TransformerConfigurationException e) {
             throw new Error(e); // impossible
--- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/Messages.java	Thu May 01 17:57:29 2014 -0700
+++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/Messages.java	Fri May 02 19:00:04 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -58,6 +58,7 @@
     FAILED_TO_GENERATE_SCHEMA, // 0 args
     ERROR_PROCESSING_SCHEMA, // 0 args
     ILLEGAL_CONTENT, // 2 args
+    FAILED_TO_INITIALE_DATATYPE_FACTORY, // 2 args
     ;
 
     private static final ResourceBundle rb = ResourceBundle.getBundle(Messages.class.getName());
--- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/output/XMLStreamWriterOutput.java	Thu May 01 17:57:29 2014 -0700
+++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/output/XMLStreamWriterOutput.java	Fri May 02 19:00:04 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -153,7 +153,6 @@
         }
     }
 
-
     /**
      * Reference to FI's XMLStreamWriter class, if FI can be loaded.
      */
@@ -162,9 +161,8 @@
 
     private static Class initFIStAXWriterClass() {
         try {
-            ClassLoader loader = getClassLoader();
-            Class llfisw = Class.forName("com.sun.xml.internal.org.jvnet.fastinfoset.stax.LowLevelFastInfosetStreamWriter", true, loader);
-            Class sds = loader.loadClass("com.sun.xml.internal.fastinfoset.stax.StAXDocumentSerializer");
+            Class<?> llfisw = Class.forName("com.sun.xml.internal.org.jvnet.fastinfoset.stax.LowLevelFastInfosetStreamWriter");
+            Class<?> sds = Class.forName("com.sun.xml.internal.fastinfoset.stax.StAXDocumentSerializer");
             // Check if StAXDocumentSerializer implements LowLevelFastInfosetStreamWriter
             if (llfisw.isAssignableFrom(sds))
                 return sds;
@@ -179,8 +177,7 @@
         try {
             if (FI_STAX_WRITER_CLASS == null)
                 return null;
-            ClassLoader loader = getClassLoader();
-            Class c = Class.forName("com.sun.xml.internal.bind.v2.runtime.output.FastInfosetStreamWriterOutput", true, loader);
+            Class c = Class.forName("com.sun.xml.internal.bind.v2.runtime.output.FastInfosetStreamWriterOutput");
             return c.getConstructor(FI_STAX_WRITER_CLASS, JAXBContextImpl.class);
         } catch (Throwable e) {
             return null;
@@ -195,8 +192,7 @@
 
     private static Class initStAXExWriterClass() {
         try {
-            ClassLoader loader = getClassLoader();
-            return Class.forName("com.sun.xml.internal.org.jvnet.staxex.XMLStreamWriterEx",true,loader);
+            return Class.forName("com.sun.xml.internal.org.jvnet.staxex.XMLStreamWriterEx");
         } catch (Throwable e) {
             return null;
         }
@@ -204,20 +200,11 @@
 
     private static Constructor<? extends XmlOutput> initStAXExOutputClass() {
         try {
-            ClassLoader loader = getClassLoader();
-            Class c = Class.forName("com.sun.xml.internal.bind.v2.runtime.output.StAXExStreamWriterOutput",true, loader);
+            Class c = Class.forName("com.sun.xml.internal.bind.v2.runtime.output.StAXExStreamWriterOutput");
             return c.getConstructor(STAXEX_WRITER_CLASS);
         } catch (Throwable e) {
             return null;
         }
     }
 
-    private static ClassLoader getClassLoader() {
-        ClassLoader cl = SecureLoader.getClassClassLoader(UnmarshallerImpl.class);
-        if (cl == null) {
-            cl = SecureLoader.getContextClassLoader();
-        }
-        return cl;
-    }
-
 }
--- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/reflect/Messages.properties	Thu May 01 17:57:29 2014 -0700
+++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/reflect/Messages.properties	Fri May 02 19:00:04 2014 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -38,3 +38,6 @@
 NO_GETTER = \
     The property has a setter "{0}" but no getter. \
     For marshaller, please define getters.
+
+INVALID_XML_ENUM_VALUE = \
+    "{0}" is not a valid value for {1}.
--- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/StAXStreamConnector.java	Thu May 01 17:57:29 2014 -0700
+++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/StAXStreamConnector.java	Fri May 02 19:00:04 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -336,9 +336,8 @@
 
     private static Class initFIStAXReaderClass() {
         try {
-            ClassLoader cl = getClassLoader();
-            Class fisr = cl.loadClass("com.sun.xml.internal.org.jvnet.fastinfoset.stax.FastInfosetStreamReader");
-            Class sdp = cl.loadClass("com.sun.xml.internal.fastinfoset.stax.StAXDocumentParser");
+            Class<?> fisr = Class.forName("com.sun.xml.internal.org.jvnet.fastinfoset.stax.FastInfosetStreamReader");
+            Class<?> sdp = Class.forName("com.sun.xml.internal.fastinfoset.stax.StAXDocumentParser");
             // Check if StAXDocumentParser implements FastInfosetStreamReader
             if (fisr.isAssignableFrom(sdp))
                 return sdp;
@@ -354,7 +353,7 @@
             if (FI_STAX_READER_CLASS == null)
                 return null;
 
-            Class c = getClassLoader().loadClass(
+            Class c = Class.forName(
                     "com.sun.xml.internal.bind.v2.runtime.unmarshaller.FastInfosetConnector");
             return c.getConstructor(FI_STAX_READER_CLASS,XmlVisitor.class);
         } catch (Throwable e) {
@@ -370,7 +369,7 @@
 
     private static Class initStAXExReader() {
         try {
-            return getClassLoader().loadClass("com.sun.xml.internal.org.jvnet.staxex.XMLStreamReaderEx");
+            return Class.forName("com.sun.xml.internal.org.jvnet.staxex.XMLStreamReaderEx");
         } catch (Throwable e) {
             return null;
         }
@@ -378,19 +377,11 @@
 
     private static Constructor<? extends StAXConnector> initStAXExConnector() {
         try {
-            Class c = getClassLoader().loadClass("com.sun.xml.internal.bind.v2.runtime.unmarshaller.StAXExConnector");
+            Class c = Class.forName("com.sun.xml.internal.bind.v2.runtime.unmarshaller.StAXExConnector");
             return c.getConstructor(STAX_EX_READER_CLASS,XmlVisitor.class);
         } catch (Throwable e) {
             return null;
         }
     }
 
-    private static ClassLoader getClassLoader() {
-        ClassLoader cl = SecureLoader.getClassClassLoader(UnmarshallerImpl.class);
-        if (cl == null) {
-            cl = SecureLoader.getContextClassLoader();
-        }
-        return cl;
-    }
-
 }
--- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/AttachmentPartImpl.java	Thu May 01 17:57:29 2014 -0700
+++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/AttachmentPartImpl.java	Fri May 02 19:00:04 2014 -0700
@@ -62,61 +62,6 @@
         Logger.getLogger(LogDomainConstants.SOAP_DOMAIN,
                          "com.sun.xml.internal.messaging.saaj.soap.LocalStrings");
 
-    static {
-        try {
-            CommandMap map = CommandMap.getDefaultCommandMap();
-            if (map instanceof MailcapCommandMap) {
-                MailcapCommandMap mailMap = (MailcapCommandMap) map;
-                String hndlrStr = ";;x-java-content-handler=";
-                mailMap.addMailcap(
-                    "text/xml"
-                        + hndlrStr
-                        + "com.sun.xml.internal.messaging.saaj.soap.XmlDataContentHandler");
-                mailMap.addMailcap(
-                    "application/xml"
-                        + hndlrStr
-                        + "com.sun.xml.internal.messaging.saaj.soap.XmlDataContentHandler");
-                mailMap.addMailcap(
-                    "application/fastinfoset"
-                        + hndlrStr
-                        + "com.sun.xml.internal.messaging.saaj.soap.FastInfosetDataContentHandler");
-                /* Image DataContentHandler handles all image types
-                mailMap.addMailcap(
-                    "image/jpeg"
-                        + hndlrStr
-                        + "com.sun.xml.internal.messaging.saaj.soap.JpegDataContentHandler");
-                mailMap.addMailcap(
-                    "image/gif"
-                        + hndlrStr
-                        + "com.sun.xml.internal.messaging.saaj.soap.GifDataContentHandler"); */
-                /*mailMap.addMailcap(
-                    "multipart/*"
-                        + hndlrStr
-                        + "com.sun.xml.internal.messaging.saaj.soap.MultipartDataContentHandler");*/
-                mailMap.addMailcap(
-                    "image/*"
-                        + hndlrStr
-                        + "com.sun.xml.internal.messaging.saaj.soap.ImageDataContentHandler");
-                mailMap.addMailcap(
-                    "text/plain"
-                        + hndlrStr
-                        + "com.sun.xml.internal.messaging.saaj.soap.StringDataContentHandler");
-            } else {
-                throw new SOAPExceptionImpl("Default CommandMap is not a MailcapCommandMap");
-            }
-        } catch (Throwable t) {
-            log.log(
-                Level.SEVERE,
-                "SAAJ0508.soap.cannot.register.handlers",
-                t);
-            if (t instanceof RuntimeException) {
-                throw (RuntimeException) t;
-            } else {
-                throw new RuntimeException(t.getLocalizedMessage());
-            }
-        }
-    };
-
     private final MimeHeaders headers;
     private MimeBodyPart rawContent = null;
     private DataHandler dataHandler = null;
@@ -126,6 +71,12 @@
 
     public AttachmentPartImpl() {
         headers = new MimeHeaders();
+
+        // initialization from here should cover most of cases;
+        // if not, it would be necessary to call
+        //   AttachmentPartImpl.initializeJavaActivationHandlers()
+        // explicitly by programmer
+        initializeJavaActivationHandlers();
     }
 
     public AttachmentPartImpl(MIMEPart part) {
@@ -619,4 +570,43 @@
         return headers;
     }
 
+    public static void initializeJavaActivationHandlers() {
+        // DataHandler.writeTo() may search for DCH. So adding some default ones.
+        try {
+            CommandMap map = CommandMap.getDefaultCommandMap();
+            if (map instanceof MailcapCommandMap) {
+                MailcapCommandMap mailMap = (MailcapCommandMap) map;
+
+                // registering our DCH since javamail's DCH doesn't handle
+                if (!cmdMapInitialized(mailMap)) {
+                    mailMap.addMailcap("text/xml;;x-java-content-handler=com.sun.xml.internal.messaging.saaj.soap.XmlDataContentHandler");
+                    mailMap.addMailcap("application/xml;;x-java-content-handler=com.sun.xml.internal.messaging.saaj.soap.XmlDataContentHandler");
+                    mailMap.addMailcap("application/fastinfoset;;x-java-content-handler=com.sun.xml.internal.messaging.saaj.soap.FastInfosetDataContentHandler");
+                    mailMap.addMailcap("multipart/*;;x-java-content-handler=com.sun.xml.internal.messaging.saaj.soap.MultipartDataContentHandler");
+                    mailMap.addMailcap("image/*;;x-java-content-handler=com.sun.xml.internal.messaging.saaj.soap.ImageDataContentHandler");
+                    mailMap.addMailcap("text/plain;;x-java-content-handler=com.sun.xml.internal.messaging.saaj.soap.StringDataContentHandler");
+                }
+            }
+        } catch (Throwable t) {
+            // ignore the exception.
+        }
+    }
+
+    private static boolean cmdMapInitialized(MailcapCommandMap mailMap) {
+
+        // checking fastinfoset handler, since this one is specific to SAAJ
+        CommandInfo[] commands = mailMap.getAllCommands("application/fastinfoset");
+        if (commands == null || commands.length == 0) {
+            return false;
+        }
+
+        String saajClassName = "com.sun.xml.internal.ws.binding.FastInfosetDataContentHandler";
+        for (CommandInfo command : commands) {
+            String commandClass = command.getCommandClass();
+            if (saajClassName.equals(commandClass)) {
+                return true;
+            }
+        }
+        return false;
+    }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/ContextClassloaderLocal.java	Fri May 02 19:00:04 2014 -0700
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.xml.internal.messaging.saaj.soap;
+
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.text.MessageFormat;
+import java.util.ResourceBundle;
+import java.util.WeakHashMap;
+
+/**
+ * Simple utility ensuring that the value is cached only in case it is non-internal implementation
+ */
+abstract class ContextClassloaderLocal<V> {
+
+    private static final String FAILED_TO_CREATE_NEW_INSTANCE = "FAILED_TO_CREATE_NEW_INSTANCE";
+
+    private WeakHashMap<ClassLoader, V> CACHE = new WeakHashMap<ClassLoader, V>();
+
+    public V get() throws Error {
+        ClassLoader tccl = getContextClassLoader();
+        V instance = CACHE.get(tccl);
+        if (instance == null) {
+            instance = createNewInstance();
+            CACHE.put(tccl, instance);
+        }
+        return instance;
+    }
+
+    public void set(V instance) {
+        CACHE.put(getContextClassLoader(), instance);
+    }
+
+    protected abstract V initialValue() throws Exception;
+
+    private V createNewInstance() {
+        try {
+            return initialValue();
+        } catch (Exception e) {
+            throw new Error(format(FAILED_TO_CREATE_NEW_INSTANCE, getClass().getName()), e);
+        }
+    }
+
+    private static String format(String property, Object... args) {
+        String text = ResourceBundle.getBundle(ContextClassloaderLocal.class.getName()).getString(property);
+        return MessageFormat.format(text, args);
+    }
+
+    private static ClassLoader getContextClassLoader() {
+        return (ClassLoader)
+                AccessController.doPrivileged(new PrivilegedAction() {
+                    public Object run() {
+                        ClassLoader cl = null;
+                        try {
+                            cl = Thread.currentThread().getContextClassLoader();
+                        } catch (SecurityException ex) {
+                        }
+                        return cl;
+                    }
+                });
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/ContextClassloaderLocal.properties	Fri May 02 19:00:04 2014 -0700
@@ -0,0 +1,26 @@
+#
+# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+FAILED_TO_CREATE_NEW_INSTANCE=Failed to create new instance of {0}
--- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/EnvelopeFactory.java	Thu May 01 17:57:29 2014 -0700
+++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/EnvelopeFactory.java	Fri May 02 19:00:04 2014 -0700
@@ -25,7 +25,14 @@
 
 package com.sun.xml.internal.messaging.saaj.soap;
 
-import java.util.logging.Logger;
+import com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl;
+import com.sun.xml.internal.messaging.saaj.util.JAXMStreamSource;
+import com.sun.xml.internal.messaging.saaj.util.LogDomainConstants;
+import com.sun.xml.internal.messaging.saaj.util.ParserPool;
+import com.sun.xml.internal.messaging.saaj.util.RejectDoctypeSaxFilter;
+import com.sun.xml.internal.messaging.saaj.util.transform.EfficientStreamingTransformer;
+import org.xml.sax.InputSource;
+import org.xml.sax.XMLReader;
 
 import javax.xml.parsers.SAXParser;
 import javax.xml.soap.SOAPException;
@@ -39,13 +46,10 @@
 import javax.xml.transform.stax.StAXSource;
 import javax.xml.transform.stream.StreamSource;
 
-import org.xml.sax.InputSource;
-import org.xml.sax.XMLReader;
+import com.sun.xml.internal.messaging.saaj.LazyEnvelopeSource;
+import com.sun.xml.internal.messaging.saaj.util.transform.EfficientStreamingTransformer;
 
-import com.sun.xml.internal.messaging.saaj.LazyEnvelopeSource;
-import com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl;
-import com.sun.xml.internal.messaging.saaj.util.*;
-import com.sun.xml.internal.messaging.saaj.util.transform.EfficientStreamingTransformer;
+import java.util.logging.Logger;
 
 /**
  * EnvelopeFactory creates SOAP Envelope objects using different
@@ -54,10 +58,16 @@
 public class EnvelopeFactory {
 
     protected static final Logger
-        log = Logger.getLogger(LogDomainConstants.SOAP_DOMAIN,
-        "com.sun.xml.internal.messaging.saaj.soap.LocalStrings");
+            log = Logger.getLogger(LogDomainConstants.SOAP_DOMAIN,
+            "com.sun.xml.internal.messaging.saaj.soap.LocalStrings");
 
-    private static ParserPool parserPool = new ParserPool(5);
+    private static ContextClassloaderLocal<ParserPool> parserPool =
+            new ContextClassloaderLocal<ParserPool>() {
+                @Override
+                protected ParserPool initialValue() throws Exception {
+                    return new ParserPool(5);
+                }
+            };
 
     public static Envelope createEnvelope(Source src, SOAPPartImpl soapPart)
         throws SOAPException
@@ -130,15 +140,15 @@
         SAXParser saxParser = null;
         if (src instanceof StreamSource) {
             try {
-                saxParser = parserPool.get();
+                saxParser = parserPool.get().get();
             } catch (Exception e) {
                 log.severe("SAAJ0601.util.newSAXParser.exception");
                 throw new SOAPExceptionImpl(
-                    "Couldn't get a SAX parser while constructing a envelope",
-                    e);
+                        "Couldn't get a SAX parser while constructing a envelope",
+                        e);
             }
             InputSource is = SAXSource.sourceToInputSource(src);
-            if (is.getEncoding()== null && soapPart.getSourceCharsetEncoding() != null) {
+            if (is.getEncoding() == null && soapPart.getSourceCharsetEncoding() != null) {
                 is.setEncoding(soapPart.getSourceCharsetEncoding());
             }
             XMLReader rejectFilter;
@@ -147,15 +157,15 @@
             } catch (Exception ex) {
                 log.severe("SAAJ0510.soap.cannot.create.envelope");
                 throw new SOAPExceptionImpl(
-                    "Unable to create envelope from given source: ",
-                    ex);
+                        "Unable to create envelope from given source: ",
+                        ex);
             }
             src = new SAXSource(rejectFilter, is);
         }
 
         try {
             Transformer transformer =
-                EfficientStreamingTransformer.newTransformer();
+                    EfficientStreamingTransformer.newTransformer();
             DOMResult result = new DOMResult(soapPart);
             transformer.transform(src, result);
 
@@ -167,11 +177,11 @@
             }
             log.severe("SAAJ0511.soap.cannot.create.envelope");
             throw new SOAPExceptionImpl(
-                "Unable to create envelope from given source: ",
-                ex);
+                    "Unable to create envelope from given source: ",
+                    ex);
         } finally {
             if (saxParser != null) {
-                parserPool.returnParser(saxParser);
+                parserPool.get().returnParser(saxParser);
             }
         }
     }
--- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/StaxBridge.java	Thu May 01 17:57:29 2014 -0700
+++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/StaxBridge.java	Fri May 02 19:00:04 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,11 +25,12 @@
 
 package com.sun.xml.internal.messaging.saaj.soap;
 
+import com.sun.xml.internal.messaging.saaj.util.stax.SaajStaxWriter;
+
 import javax.xml.namespace.QName;
 import javax.xml.soap.SOAPException;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
-import com.sun.xml.internal.org.jvnet.staxex.util.SaajStaxWriter;
 import com.sun.xml.internal.org.jvnet.staxex.util.XMLStreamReaderToXMLStreamWriter;
 
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/util/stax/SaajStaxReaderEx.java	Fri May 02 19:00:04 2014 -0700
@@ -0,0 +1,147 @@
+/*
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.xml.internal.messaging.saaj.util.stax;
+
+import com.sun.xml.internal.org.jvnet.staxex.Base64Data;
+import com.sun.xml.internal.org.jvnet.staxex.BinaryText;
+import com.sun.xml.internal.org.jvnet.staxex.XMLStreamReaderEx;
+import com.sun.xml.internal.org.jvnet.staxex.util.DOMStreamReader;
+import org.w3c.dom.Node;
+import org.w3c.dom.Text;
+
+import javax.xml.soap.SOAPElement;
+import javax.xml.stream.XMLStreamException;
+import java.util.Iterator;
+
+/**
+ * SaajStaxReaderEx
+ *
+ * @author shih-chang.chen@oracle.com
+ */
+public class SaajStaxReaderEx extends DOMStreamReader implements XMLStreamReaderEx {
+    //TODO extends com.sun.xml.internal.ws.streaming.DOMStreamReader
+    private BinaryText binaryText = null;
+    private Base64Data base64AttData = null;
+
+    public SaajStaxReaderEx(SOAPElement se) {
+        super(se);
+    }
+
+    @Override
+    public int next() throws XMLStreamException {
+        binaryText = null;
+        base64AttData = null;
+        while(true) {
+            int r = _next();
+            switch (r) {
+            case CHARACTERS:
+                if (_current instanceof BinaryText) {
+                    binaryText = (BinaryText) _current;
+                    base64AttData = new Base64Data();
+                    base64AttData.set(binaryText.getDataHandler());
+//System.out.println("--------------- debug SaajStaxReaderEx binaryText " + binaryText);
+                } else {
+                    // if we are currently at text node, make sure that this is a meaningful text node.
+                    Node prev = _current.getPreviousSibling();
+                    if(prev!=null && prev.getNodeType()==Node.TEXT_NODE)
+                        continue;   // nope. this is just a continuation of previous text that should be invisible
+
+                    Text t = (Text)_current;
+                    wholeText = t.getWholeText();
+                    if(wholeText.length()==0)
+                        continue;   // nope. this is empty text.
+                }
+                return CHARACTERS;
+            case START_ELEMENT:
+                splitAttributes();
+                return START_ELEMENT;
+            default:
+                return r;
+            }
+        }
+    }
+
+    @Override
+    public String getElementTextTrim() throws XMLStreamException {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public CharSequence getPCDATA() throws XMLStreamException {
+        return (binaryText != null) ? base64AttData : getText();
+    }
+
+    @Override
+    public com.sun.xml.internal.org.jvnet.staxex.NamespaceContextEx getNamespaceContext() {
+        return new com.sun.xml.internal.org.jvnet.staxex.NamespaceContextEx() {
+
+            @Override
+            public String getNamespaceURI(String prefix) {
+                return _current.lookupNamespaceURI(prefix);
+            }
+
+            @Override
+            public String getPrefix(String uri) {
+                return _current.lookupPrefix(uri);
+            }
+
+            @Override
+            public Iterator getPrefixes(String arg0) {
+                // TODO Auto-generated method stub
+                return null;
+            }
+
+            @Override
+            public Iterator<Binding> iterator() {
+                // TODO Auto-generated method stub
+                return null;
+            }
+
+        };
+    }
+
+
+    @Override
+    public int getTextLength() {
+        return (binaryText != null) ? base64AttData.length() : super.getTextLength();
+    }
+
+    @Override
+    public int getTextStart() {
+        return (binaryText != null) ? 0: super.getTextStart();
+    }
+
+    @Override
+    public char[] getTextCharacters() {
+        if (binaryText != null) {
+            char[] chars = new char[base64AttData.length()];
+            base64AttData.writeTo(chars, 0);
+            return chars;
+        }
+        return super.getTextCharacters();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/util/stax/SaajStaxWriter.java	Fri May 02 19:00:04 2014 -0700
@@ -0,0 +1,352 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.xml.internal.messaging.saaj.util.stax;
+
+import java.util.Arrays;
+import java.util.Iterator;
+
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.w3c.dom.Comment;
+import org.w3c.dom.Node;
+
+/**
+ * SaajStaxWriter builds a SAAJ SOAPMessage by using XMLStreamWriter interface.
+ *
+ * @author shih-chang.chen@oracle.com
+ */
+public class SaajStaxWriter implements XMLStreamWriter {
+
+    protected SOAPMessage soap;
+    protected String envURI;
+    protected SOAPElement currentElement;
+
+    static final protected String Envelope = "Envelope";
+    static final protected String Header = "Header";
+    static final protected String Body = "Body";
+    static final protected String xmlns = "xmlns";
+
+    private boolean isHeaderSeen = false;
+
+    public SaajStaxWriter(final SOAPMessage msg, String uri) throws SOAPException {
+        soap = msg;
+        this.envURI = uri;
+    }
+
+    public SOAPMessage getSOAPMessage() {
+        return soap;
+    }
+
+    protected SOAPElement getEnvelope() throws SOAPException {
+        return soap.getSOAPPart().getEnvelope();
+    }
+
+    @Override
+    public void writeStartElement(final String localName) throws XMLStreamException {
+        try {
+            currentElement = currentElement.addChildElement(localName);
+        } catch (SOAPException e) {
+            throw new XMLStreamException(e);
+        }
+    }
+
+    @Override
+    public void writeStartElement(final String ns, final String ln) throws XMLStreamException {
+        writeStartElement(null, ln, ns);
+    }
+
+    @Override
+    public void writeStartElement(final String prefix, final String ln, final String ns) throws XMLStreamException {
+        try {
+            if (envURI.equals(ns)) {
+                if (Envelope.equals(ln)) {
+                    currentElement = getEnvelope();
+                    fixPrefix(prefix);
+                    return;
+                } else if (Header.equals(ln)) {
+                    isHeaderSeen = true;
+                    currentElement = soap.getSOAPHeader();
+                    fixPrefix(prefix);
+                    return;
+                } else if (Body.equals(ln)) {
+                    currentElement = soap.getSOAPBody();
+                    fixPrefix(prefix);
+                    return;
+                }
+            }
+            currentElement = (prefix == null) ?
+                    currentElement.addChildElement(new QName(ns, ln)) :
+                    currentElement.addChildElement(ln, prefix, ns);
+        } catch (SOAPException e) {
+            throw new XMLStreamException(e);
+        }
+    }
+
+    private void fixPrefix(final String prfx) throws XMLStreamException {
+        fixPrefix(prfx, currentElement);
+    }
+
+    private void fixPrefix(final String prfx, SOAPElement element) throws XMLStreamException {
+        String oldPrfx = element.getPrefix();
+        if (prfx != null && !prfx.equals(oldPrfx)) {
+            element.setPrefix(prfx);
+        }
+    }
+
+    @Override
+    public void writeEmptyElement(final String uri, final String ln) throws XMLStreamException {
+        writeStartElement(null, ln, uri);
+    }
+
+    @Override
+    public void writeEmptyElement(final String prefix, final String ln, final String uri) throws XMLStreamException {
+        writeStartElement(prefix, ln, uri);
+    }
+
+    @Override
+    public void writeEmptyElement(final String ln) throws XMLStreamException {
+        writeStartElement(null, ln, null);
+    }
+
+    @Override
+    public void writeEndElement() throws XMLStreamException {
+        if (currentElement != null) currentElement = currentElement.getParentElement();
+    }
+
+    @Override
+    public void writeEndDocument() throws XMLStreamException {
+        try {
+            if (!isHeaderSeen) {
+                SOAPElement header = soap.getSOAPHeader();
+                if (header != null) {
+                    String prefixAtHeader = header.getPrefix();
+                    SOAPElement env = getEnvelope();
+                    header.detachNode();
+                    if (prefixAtHeader != null && !prefixAtHeader.equals(env.getPrefix())) {
+                        env.removeNamespaceDeclaration(prefixAtHeader);
+                    }
+                }
+            }
+        } catch (SOAPException e) {
+            throw new XMLStreamException(e);
+        }
+    }
+
+    @Override
+    public void close() throws XMLStreamException {
+    }
+
+    @Override
+    public void flush() throws XMLStreamException {
+    }
+
+    @Override
+    public void writeAttribute(final String ln, final String val) throws XMLStreamException {
+        writeAttribute(null, null, ln, val);
+    }
+
+    @Override
+    public void writeAttribute(final String prefix, final String ns, final String ln, final String value) throws XMLStreamException {
+        try {
+            if (ns == null) {
+                if (prefix == null && xmlns.equals(ln)) {
+                    currentElement.addNamespaceDeclaration("", value);
+                } else {
+                    currentElement.setAttributeNS("", ln, value);
+                }
+            } else {
+                QName name = (prefix == null) ? new QName(ns, ln) : new QName(ns, ln, prefix);
+                currentElement.addAttribute(name, value);
+            }
+        } catch (SOAPException e) {
+            throw new XMLStreamException(e);
+        }
+    }
+
+    @Override
+    public void writeAttribute(final String ns, final String ln, final String val) throws XMLStreamException {
+        writeAttribute(null, ns, ln, val);
+    }
+
+    @Override
+    public void writeNamespace(String prefix, final String uri) throws XMLStreamException {
+
+        // make prefix default if null or "xmlns" (according to javadoc)
+        if (prefix == null || "xmlns".equals(prefix)) {
+            prefix = "";
+        }
+
+        try {
+            currentElement.addNamespaceDeclaration(prefix, uri);
+        } catch (SOAPException e) {
+            throw new XMLStreamException(e);
+        }
+    }
+
+    @Override
+    public void writeDefaultNamespace(final String uri) throws XMLStreamException {
+        writeNamespace("", uri);
+    }
+
+    @Override
+    public void writeComment(final String data) throws XMLStreamException {
+        Comment c = soap.getSOAPPart().createComment(data);
+        currentElement.appendChild(c);
+    }
+
+    @Override
+    public void writeProcessingInstruction(final String target) throws XMLStreamException {
+        Node n = soap.getSOAPPart().createProcessingInstruction(target, "");
+        currentElement.appendChild(n);
+    }
+
+    @Override
+    public void writeProcessingInstruction(final String target, final String data) throws XMLStreamException {
+        Node n = soap.getSOAPPart().createProcessingInstruction(target, data);
+        currentElement.appendChild(n);
+    }
+
+    @Override
+    public void writeCData(final String data) throws XMLStreamException {
+        Node n = soap.getSOAPPart().createCDATASection(data);
+        currentElement.appendChild(n);
+    }
+
+    @Override
+    public void writeDTD(final String dtd) throws XMLStreamException {
+        //TODO ... Don't do anything here
+    }
+
+    @Override
+    public void writeEntityRef(final String name) throws XMLStreamException {
+        Node n = soap.getSOAPPart().createEntityReference(name);
+        currentElement.appendChild(n);
+    }
+
+    @Override
+    public void writeStartDocument() throws XMLStreamException {
+    }
+
+    @Override
+    public void writeStartDocument(final String version) throws XMLStreamException {
+        if (version != null) soap.getSOAPPart().setXmlVersion(version);
+    }
+
+    @Override
+    public void writeStartDocument(final String encoding, final String version) throws XMLStreamException {
+        if (version != null) soap.getSOAPPart().setXmlVersion(version);
+        if (encoding != null) {
+            try {
+                soap.setProperty(SOAPMessage.CHARACTER_SET_ENCODING, encoding);
+            } catch (SOAPException e) {
+                throw new XMLStreamException(e);
+            }
+        }
+    }
+
+    @Override
+    public void writeCharacters(final String text) throws XMLStreamException {
+        try {
+            currentElement.addTextNode(text);
+        } catch (SOAPException e) {
+            throw new XMLStreamException(e);
+        }
+    }
+
+    @Override
+    public void writeCharacters(final char[] text, final int start, final int len) throws XMLStreamException {
+        char[] chr = (start == 0 && len == text.length) ? text : Arrays.copyOfRange(text, start, start + len);
+        try {
+            currentElement.addTextNode(new String(chr));
+        } catch (SOAPException e) {
+            throw new XMLStreamException(e);
+        }
+    }
+
+    @Override
+    public String getPrefix(final String uri) throws XMLStreamException {
+        return currentElement.lookupPrefix(uri);
+    }
+
+    @Override
+    public void setPrefix(final String prefix, final String uri) throws XMLStreamException {
+        try {
+            this.currentElement.addNamespaceDeclaration(prefix, uri);
+        } catch (SOAPException e) {
+            throw new XMLStreamException(e);
+        }
+    }
+
+    @Override
+    public void setDefaultNamespace(final String uri) throws XMLStreamException {
+        setPrefix("", uri);
+    }
+
+    @Override
+    public void setNamespaceContext(final NamespaceContext context)throws XMLStreamException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public Object getProperty(final String name) throws IllegalArgumentException {
+        //TODO the following line is to make eclipselink happy ... they are aware of this problem -
+        if (javax.xml.stream.XMLOutputFactory.IS_REPAIRING_NAMESPACES.equals(name)) return Boolean.FALSE;
+        return null;
+    }
+
+    @Override
+    public NamespaceContext getNamespaceContext() {
+        return new NamespaceContext() {
+            public String getNamespaceURI(final String prefix) {
+                return currentElement.getNamespaceURI(prefix);
+            }
+            public String getPrefix(final String namespaceURI) {
+                return currentElement.lookupPrefix(namespaceURI);
+            }
+            public Iterator getPrefixes(final String namespaceURI) {
+                return new Iterator() {
+                    String prefix = getPrefix(namespaceURI);
+                    public boolean hasNext() {
+                        return (prefix != null);
+                    }
+                    public Object next() {
+                        if (!hasNext()) throw new java.util.NoSuchElementException();
+                        String next = prefix;
+                        prefix = null;
+                        return next;
+                    }
+                    public void remove() {}
+                };
+            }
+        };
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/util/stax/SaajStaxWriterEx.java	Fri May 02 19:00:04 2014 -0700
@@ -0,0 +1,245 @@
+/*
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.xml.internal.messaging.saaj.util.stax;
+
+import java.io.OutputStream;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.UUID;
+
+import javax.activation.DataHandler;
+import javax.xml.bind.attachment.AttachmentMarshaller;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.stream.XMLStreamException;
+
+import com.sun.xml.internal.org.jvnet.staxex.Base64Data;
+import com.sun.xml.internal.org.jvnet.staxex.BinaryText;
+import com.sun.xml.internal.org.jvnet.staxex.MtomEnabled;
+import com.sun.xml.internal.org.jvnet.staxex.NamespaceContextEx;
+import com.sun.xml.internal.org.jvnet.staxex.StreamingDataHandler;
+import com.sun.xml.internal.org.jvnet.staxex.XMLStreamWriterEx;
+import com.sun.xml.internal.org.jvnet.staxex.util.MtomStreamWriter;
+//
+//import com.sun.xml.internal.ws.api.message.saaj.SaajStaxWriter;
+//import com.sun.xml.internal.ws.developer.StreamingDataHandler;
+//import com.sun.xml.internal.ws.streaming.MtomStreamWriter;
+
+/**
+ * SaajStaxWriterEx converts XMLStreamWriterEx calls to build an orasaaj SOAPMessage with BinaryTextImpl.
+ *
+ * @author shih-chang.chen@oracle.com
+ */
+public class SaajStaxWriterEx extends SaajStaxWriter implements XMLStreamWriterEx, MtomStreamWriter {
+
+    static final protected String xopNS = "http://www.w3.org/2004/08/xop/include";
+    static final protected String Include = "Include";
+    static final protected String href = "href";
+
+    private enum State {xopInclude, others};
+    private State state = State.others;
+    private BinaryText binaryText;
+
+    public SaajStaxWriterEx(SOAPMessage msg, String uri) throws SOAPException {
+        super(msg, uri);
+    }
+
+    public void writeStartElement(String prefix, String ln, String ns) throws XMLStreamException {
+        if (xopNS.equals(ns) && Include.equals(ln)) {
+            state = State.xopInclude;
+            return;
+        } else {
+            super.writeStartElement(prefix, ln, ns);
+        }
+    }
+
+    @Override
+    public void writeEndElement() throws XMLStreamException {
+        if (state.equals(State.xopInclude)) {
+            state = State.others;
+        } else {
+            super.writeEndElement();
+        }
+    }
+
+    @Override
+    public void writeAttribute(String prefix, String ns, String ln, String value) throws XMLStreamException {
+        if (binaryText != null && href.equals(ln)) {
+            return;
+        } else {
+            super.writeAttribute(prefix, ns, ln, value);
+        }
+    }
+
+//    @Override
+//    public void writeComment(String data) throws XMLStreamException {
+//        ((ElementImpl)currentElement).addCommentNode(data);
+//    }
+//
+//    @Override
+//    public void writeCData(String data) throws XMLStreamException {
+//      CDataTextImpl cdt = new CDataTextImpl(soap.getSOAPPart(), data);
+//        currentElement.appendChild(cdt);
+//    }
+
+    @Override
+    public NamespaceContextEx getNamespaceContext() {
+        return new NamespaceContextEx() {
+            public String getNamespaceURI(String prefix) {
+                return currentElement.getNamespaceURI(prefix);
+            }
+            public String getPrefix(String namespaceURI) {
+                return currentElement.lookupPrefix(namespaceURI);
+            }
+            public Iterator getPrefixes(final String namespaceURI) {
+                return new Iterator() {
+                    String prefix = getPrefix(namespaceURI);
+                    public boolean hasNext() {
+                        return (prefix != null);
+                    }
+                    public Object next() {
+                        if (prefix == null) throw new java.util.NoSuchElementException();
+                        String next = prefix;
+                        prefix = null;
+                        return next;
+                    }
+                    public void remove() {}
+                };
+            }
+            public Iterator<Binding> iterator() {
+                return new Iterator<Binding>() {
+                    public boolean hasNext() { return false; }
+                    public Binding next() { return null; }
+                    public void remove() {}
+                };
+            }
+        };
+    }
+
+    @Override
+    public void writeBinary(DataHandler data) throws XMLStreamException {
+//      binaryText = BinaryTextImpl.createBinaryTextFromDataHandler((MessageImpl)soap, null, currentElement.getOwnerDocument(), data);
+//      currentElement.appendChild(binaryText);
+        addBinaryText(data);
+    }
+
+    @Override
+    public OutputStream writeBinary(String arg0) throws XMLStreamException {
+        return null;
+    }
+
+    @Override
+    public void writeBinary(byte[] data, int offset, int length, String contentType) throws XMLStreamException {
+//        if (mtomThreshold == -1 || mtomThreshold > length) return null;
+        byte[] bytes = (offset == 0 && length == data.length) ? data : Arrays.copyOfRange(data, offset, offset + length);
+        if (currentElement instanceof MtomEnabled) {
+            binaryText = ((MtomEnabled) currentElement).addBinaryText(bytes);
+        } else {
+            throw new IllegalStateException("The currentElement is not MtomEnabled " + currentElement);
+        }
+    }
+
+    @Override
+    public void writePCDATA(CharSequence arg0) throws XMLStreamException {
+        if (arg0 instanceof Base64Data) {
+            // The fix of StreamReaderBufferCreator preserves this dataHandler
+            addBinaryText(((Base64Data) arg0).getDataHandler());
+        } else {
+            // We should not normally get here as we expect a DataHandler,
+            // but this is the most general solution.  If we do get
+            // something other than a Data Handler, create a Text node with
+            // the data.  Another alternative would be to throw an exception,
+            // but in the most general case, we don't know whether this input
+            // is expected.
+            try {
+                currentElement.addTextNode(arg0.toString());
+            } catch (SOAPException e) {
+                throw new XMLStreamException("Cannot add Text node", e);
+            }
+        }
+    }
+
+    static private String encodeCid() {
+        String cid = "example.jaxws.sun.com";
+        String name = UUID.randomUUID() + "@";
+        return name + cid;
+    }
+
+    private String addBinaryText(DataHandler data) {
+        String hrefOrCid = null;
+        if (data instanceof StreamingDataHandler) {
+            hrefOrCid = ((StreamingDataHandler) data).getHrefCid();
+        }
+        if (hrefOrCid == null) hrefOrCid = encodeCid();
+
+        String prefixedCid = (hrefOrCid.startsWith("cid:")) ? hrefOrCid : "cid:" + hrefOrCid;
+        // Should we do the threshold processing on DataHandler ? But that would be
+        // expensive as DataHolder need to read the data again from its source
+      //binaryText = BinaryTextImpl.createBinaryTextFromDataHandler((MessageImpl) soap, prefixedCid, currentElement.getOwnerDocument(), data);
+      //currentElement.appendChild(binaryText);
+        if (currentElement instanceof MtomEnabled) {
+            binaryText = ((MtomEnabled) currentElement).addBinaryText(prefixedCid, data);
+        } else {
+            throw new IllegalStateException("The currentElement is not MtomEnabled " + currentElement);
+        }
+        return hrefOrCid;
+    }
+
+    public AttachmentMarshaller getAttachmentMarshaller() {
+        return new AttachmentMarshaller() {
+            @Override
+            public String addMtomAttachment(DataHandler data, String ns, String ln) {
+//                if (mtomThreshold == -1) return null;
+                String hrefOrCid = addBinaryText(data);
+//                return binaryText.getHref();
+                return hrefOrCid;
+            }
+
+            @Override
+            public String addMtomAttachment(byte[] data, int offset, int length, String mimeType, String ns, String ln) {
+//                if (mtomThreshold == -1 || mtomThreshold > length) return null;
+                byte[] bytes = (offset == 0 && length == data.length) ? data : Arrays.copyOfRange(data, offset, offset + length);
+//                binaryText = (BinaryTextImpl) ((ElementImpl) currentElement).addAsBase64TextNode(bytes);
+                if (currentElement instanceof MtomEnabled) {
+                    binaryText = ((MtomEnabled) currentElement).addBinaryText(bytes);
+                } else {
+                    throw new IllegalStateException("The currentElement is not MtomEnabled " + currentElement);
+                }
+                return binaryText.getHref();
+            }
+
+            @Override
+            public String addSwaRefAttachment(DataHandler data) {
+                return "cid:"+encodeCid();
+            }
+
+            @Override
+            public boolean isXOPPackage() {
+                return true;
+            }
+        };
+    }
+}
--- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/org/jvnet/staxex/BinaryText.java	Thu May 01 17:57:29 2014 -0700
+++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/org/jvnet/staxex/BinaryText.java	Fri May 02 19:00:04 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,15 +26,13 @@
 package com.sun.xml.internal.org.jvnet.staxex;
 
 import javax.activation.DataHandler;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.Text;
 
 /**
  * BinaryText represents a MTOM attachment.
  *
  * @author shih-chang.chen@oracle.com
  */
-public interface BinaryText extends Text {
+public interface BinaryText {
     public String getHref();
-    public DataHandler getDataHandler() throws SOAPException;
+    public DataHandler getDataHandler();
 }
--- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/org/jvnet/staxex/StAxSOAPBody.java	Thu May 01 17:57:29 2014 -0700
+++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/org/jvnet/staxex/StAxSOAPBody.java	Fri May 02 19:00:04 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,6 @@
 package com.sun.xml.internal.org.jvnet.staxex;
 
 import javax.xml.namespace.QName;
-import javax.xml.soap.SOAPException;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
 import javax.xml.stream.XMLStreamWriter;
@@ -46,7 +45,6 @@
         /**
          * Retrieve payload qname without materializing its contents
          * @return
-         * @throws SOAPException
          */
        public QName getPayloadQName();
 
@@ -58,7 +56,7 @@
         * Retrieve payload attribute value without materializing its contents
         * @param localName
         * @return
-        * @throws SOAPException
+        * @throws XMLStreamException
         */
        public String getPayloadAttributeValue(String localName) throws XMLStreamException;
 
@@ -66,16 +64,16 @@
         * Retrieve payload attribute value without materializing its contents
         * @param qName
         * @return
-        * @throws SOAPException
+        * @throws XMLStreamException
         */
        public String getPayloadAttributeValue(QName qName) throws XMLStreamException;
 
-       public void materialize() throws SOAPException;
+       public void materialize() throws XMLStreamException;
     }
 
-    public void setPayload(Payload src) throws SOAPException;
+    public void setPayload(Payload src) throws XMLStreamException;
 
-    public Payload getPayload()throws SOAPException;
+    public Payload getPayload()throws XMLStreamException;
 
     public boolean hasStaxPayload();
  }
--- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/org/jvnet/staxex/util/SaajStaxReaderEx.java	Thu May 01 17:57:29 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,153 +0,0 @@
-/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.