Merge
diff --git a/.hgtags-top-repo b/.hgtags-top-repo
index 00d7b5f..b0bc463 100644
--- a/.hgtags-top-repo
+++ b/.hgtags-top-repo
@@ -252,3 +252,4 @@
 0ea015c298b201c07fa33990f2445b6d0ef3566d jdk9-b07
 db045d8faa0924b7378102d24a1a0d850c1e3834 jdk9-b08
 4a21dc7d57d1069a01f68e7182c074cb37349dfb jdk9-b09
+fa13f2b926f8426876ec03e7903f3ee0ee150f2e jdk9-b10
diff --git a/README-builds.html b/README-builds.html
index 14796a2..438c990 100644
--- a/README-builds.html
+++ b/README-builds.html
@@ -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, 
diff --git a/common/autoconf/boot-jdk.m4 b/common/autoconf/boot-jdk.m4
index edd6cec..ae679a9 100644
--- a/common/autoconf/boot-jdk.m4
+++ b/common/autoconf/boot-jdk.m4
@@ -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! :-)
diff --git a/common/autoconf/build-performance.m4 b/common/autoconf/build-performance.m4
index 22a6274..7d4b8ab 100644
--- a/common/autoconf/build-performance.m4
+++ b/common/autoconf/build-performance.m4
@@ -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
 ])
diff --git a/common/autoconf/flags.m4 b/common/autoconf/flags.m4
index a3f0803..fc13f71 100644
--- a/common/autoconf/flags.m4
+++ b/common/autoconf/flags.m4
@@ -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"
diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh
index fdf1c6d..b06c7d2 100644
--- a/common/autoconf/generated-configure.sh
+++ b/common/autoconf/generated-configure.sh
@@ -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=1398196583
 
 ###############################################################################
 #
@@ -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"
@@ -48566,8 +48567,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
diff --git a/common/autoconf/spec.gmk.in b/common/autoconf/spec.gmk.in
index c793d0e..47861fc 100644
--- a/common/autoconf/spec.gmk.in
+++ b/common/autoconf/spec.gmk.in
@@ -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@
diff --git a/common/bin/hgforest.sh b/common/bin/hgforest.sh
index 3ada41e..13f4442 100644
--- a/common/bin/hgforest.sh
+++ b/common/bin/hgforest.sh
@@ -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
diff --git a/corba/.hgtags b/corba/.hgtags
index 701006c..c245b21 100644
--- a/corba/.hgtags
+++ b/corba/.hgtags
@@ -252,3 +252,4 @@
 6c8563600a71394c949405189ddd66267a88d8cd jdk9-b07
 2da7fead826bc27f193c7d63048c2cf100a8809c jdk9-b08
 1a3a4f48515dbf1cff37279691b2fb74f228298d jdk9-b09
+3bd4039dfc632fd7fc8418a25a3dcc34d1cd4019 jdk9-b10
diff --git a/hotspot/.hgtags b/hotspot/.hgtags
index 18b2dca..8999d15 100644
--- a/hotspot/.hgtags
+++ b/hotspot/.hgtags
@@ -412,3 +412,4 @@
 52f7edf2589d9f9d35db3008bc5377f279de9c18 jdk9-b07
 4dedef5e51ed3a36677a8ba82949fc517ad64162 jdk9-b08
 05e8f5242c26ba45d4fa947e4f4f54c058c9b522 jdk9-b09
+ebc44d040cd149d2120d69fe183a3dae7840f4b4 jdk9-b10
diff --git a/hotspot/make/jprt.properties b/hotspot/make/jprt.properties
index 25b1310..fc6740c 100644
--- a/hotspot/make/jprt.properties
+++ b/hotspot/make/jprt.properties
@@ -65,9 +65,6 @@
 jprt.my.linux.ppcv2.jdk9=linux_ppcv2_2.6
 jprt.my.linux.ppcv2=${jprt.my.linux.ppcv2.${jprt.tools.default.release}}
 
-jprt.my.linux.ppcsflt.jdk9=linux_ppcsflt_2.6
-jprt.my.linux.ppcsflt=${jprt.my.linux.ppcsflt.${jprt.tools.default.release}}
-
 jprt.my.linux.armvfpsflt.jdk9=linux_armvfpsflt_2.6
 jprt.my.linux.armvfpsflt=${jprt.my.linux.armvfpsflt.${jprt.tools.default.release}}
 
@@ -113,7 +110,6 @@
     ${jprt.my.linux.i586}-{productEmb|fastdebugEmb}, \
     ${jprt.my.linux.ppc}-{productEmb|fastdebugEmb}, \
     ${jprt.my.linux.ppcv2}-{productEmb|fastdebugEmb}, \
-    ${jprt.my.linux.ppcsflt}-{productEmb|fastdebugEmb}, \
     ${jprt.my.linux.armvfpsflt}-{productEmb|fastdebugEmb}, \
     ${jprt.my.linux.armvfphflt}-{productEmb|fastdebugEmb}, \
     ${jprt.my.linux.armsflt}-{productEmb|fastdebugEmb}
diff --git a/hotspot/src/cpu/ppc/vm/cppInterpreter_ppc.cpp b/hotspot/src/cpu/ppc/vm/cppInterpreter_ppc.cpp
index 5cf5a6a..8ba119a 100644
--- a/hotspot/src/cpu/ppc/vm/cppInterpreter_ppc.cpp
+++ b/hotspot/src/cpu/ppc/vm/cppInterpreter_ppc.cpp
@@ -1,6 +1,6 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2012, 2013 SAP AG. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2012, 2014 SAP AG. 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
@@ -2947,17 +2947,60 @@
   istate->_last_Java_fp = last_Java_fp;
 }
 
-int AbstractInterpreter::layout_activation(Method* method,
-                                           int temps,        // Number of slots on java expression stack in use.
-                                           int popframe_args,
-                                           int monitors,     // Number of active monitors.
-                                           int caller_actual_parameters,
-                                           int callee_params,// Number of slots for callee parameters.
-                                           int callee_locals,// Number of slots for locals.
-                                           frame* caller,
-                                           frame* interpreter_frame,
-                                           bool is_top_frame,
-                                           bool is_bottom_frame) {
+// Computes monitor_size and top_frame_size in bytes.
+static void frame_size_helper(int max_stack,
+                              int monitors,
+                              int& monitor_size,
+                              int& top_frame_size) {
+  monitor_size = frame::interpreter_frame_monitor_size_in_bytes() * monitors;
+  top_frame_size = round_to(frame::interpreter_frame_cinterpreterstate_size_in_bytes()
+                            + monitor_size
+                            + max_stack * Interpreter::stackElementSize
+                            + 2 * Interpreter::stackElementSize,
+                            frame::alignment_in_bytes)
+                   + frame::top_ijava_frame_abi_size;
+}
+
+// Returns number of stackElementWords needed for the interpreter frame with the
+// given sections.
+int AbstractInterpreter::size_activation(int max_stack,
+                                         int temps,
+                                         int extra_args,
+                                         int monitors,
+                                         int callee_params,
+                                         int callee_locals,
+                                         bool is_top_frame) {
+  int monitor_size = 0;
+  int top_frame_size = 0;
+  frame_size_helper(max_stack, monitors, monitor_size, top_frame_size);
+
+  int frame_size;
+  if (is_top_frame) {
+    frame_size = top_frame_size;
+  } else {
+    frame_size = round_to(frame::interpreter_frame_cinterpreterstate_size_in_bytes()
+                          + monitor_size
+                          + (temps - callee_params + callee_locals) * Interpreter::stackElementSize
+                          + 2 * Interpreter::stackElementSize,
+                          frame::alignment_in_bytes)
+                 + frame::parent_ijava_frame_abi_size;
+    assert(extra_args == 0, "non-zero for top_frame only");
+  }
+
+  return frame_size / Interpreter::stackElementSize;
+}
+
+void AbstractInterpreter::layout_activation(Method* method,
+                                            int temps,        // Number of slots on java expression stack in use.
+                                            int popframe_args,
+                                            int monitors,     // Number of active monitors.
+                                            int caller_actual_parameters,
+                                            int callee_params,// Number of slots for callee parameters.
+                                            int callee_locals,// Number of slots for locals.
+                                            frame* caller,
+                                            frame* interpreter_frame,
+                                            bool is_top_frame,
+                                            bool is_bottom_frame) {
 
   // NOTE this code must exactly mimic what
   // InterpreterGenerator::generate_compute_interpreter_state() does
@@ -2967,86 +3010,64 @@
   // both the abi scratch area and a place to hold a result from a
   // callee on its way to the callers stack.
 
-  int monitor_size = frame::interpreter_frame_monitor_size_in_bytes() * monitors;
-  int frame_size;
-  int top_frame_size = round_to(frame::interpreter_frame_cinterpreterstate_size_in_bytes()
-                                + monitor_size
-                                + (method->max_stack() *Interpreter::stackElementWords * BytesPerWord)
-                                + 2*BytesPerWord,
-                                frame::alignment_in_bytes)
-                      + frame::top_ijava_frame_abi_size;
-  if (is_top_frame) {
-    frame_size = top_frame_size;
-  } else {
-    frame_size = round_to(frame::interpreter_frame_cinterpreterstate_size_in_bytes()
-                          + monitor_size
-                          + ((temps - callee_params + callee_locals) *
-                             Interpreter::stackElementWords * BytesPerWord)
-                          + 2*BytesPerWord,
-                          frame::alignment_in_bytes)
-                 + frame::parent_ijava_frame_abi_size;
-    assert(popframe_args==0, "non-zero for top_frame only");
-  }
+  int monitor_size = 0;
+  int top_frame_size = 0;
+  frame_size_helper(method->max_stack(), monitors, monitor_size, top_frame_size);
 
-  // If we actually have a frame to layout we must now fill in all the pieces.
-  if (interpreter_frame != NULL) {
+  intptr_t sp = (intptr_t)interpreter_frame->sp();
+  intptr_t fp = *(intptr_t *)sp;
+  assert(fp == (intptr_t)caller->sp(), "fp must match");
+  interpreterState cur_state =
+    (interpreterState)(fp - frame::interpreter_frame_cinterpreterstate_size_in_bytes());
 
-    intptr_t sp = (intptr_t)interpreter_frame->sp();
-    intptr_t fp = *(intptr_t *)sp;
-    assert(fp == (intptr_t)caller->sp(), "fp must match");
-    interpreterState cur_state =
-      (interpreterState)(fp - frame::interpreter_frame_cinterpreterstate_size_in_bytes());
+  // Now fill in the interpreterState object.
 
-    // Now fill in the interpreterState object.
-
-    intptr_t* locals;
-    if (caller->is_interpreted_frame()) {
-      // Locals must agree with the caller because it will be used to set the
-      // caller's tos when we return.
-      interpreterState prev  = caller->get_interpreterState();
-      // Calculate start of "locals" for MH calls.  For MH calls, the
-      // current method() (= MH target) and prev->callee() (=
-      // MH.invoke*()) are different and especially have different
-      // signatures. To pop the argumentsof the caller, we must use
-      // the prev->callee()->size_of_arguments() because that's what
-      // the caller actually pushed.  Currently, for synthetic MH
-      // calls (deoptimized from inlined MH calls), detected by
-      // is_method_handle_invoke(), we use the callee's arguments
-      // because here, the caller's and callee's signature match.
-      if (true /*!caller->is_at_mh_callsite()*/) {
-        locals = prev->stack() + method->size_of_parameters();
-      } else {
-        // Normal MH call.
-        locals = prev->stack() + prev->callee()->size_of_parameters();
-      }
+  intptr_t* locals;
+  if (caller->is_interpreted_frame()) {
+    // Locals must agree with the caller because it will be used to set the
+    // caller's tos when we return.
+    interpreterState prev  = caller->get_interpreterState();
+    // Calculate start of "locals" for MH calls.  For MH calls, the
+    // current method() (= MH target) and prev->callee() (=
+    // MH.invoke*()) are different and especially have different
+    // signatures. To pop the argumentsof the caller, we must use
+    // the prev->callee()->size_of_arguments() because that's what
+    // the caller actually pushed.  Currently, for synthetic MH
+    // calls (deoptimized from inlined MH calls), detected by
+    // is_method_handle_invoke(), we use the callee's arguments
+    // because here, the caller's and callee's signature match.
+    if (true /*!caller->is_at_mh_callsite()*/) {
+      locals = prev->stack() + method->size_of_parameters();
     } else {
-      bool is_deopted;
-      locals = (intptr_t*) (fp + ((method->max_locals() - 1) * BytesPerWord) +
-                            frame::parent_ijava_frame_abi_size);
+      // Normal MH call.
+      locals = prev->stack() + prev->callee()->size_of_parameters();
     }
-
-    intptr_t* monitor_base = (intptr_t*) cur_state;
-    intptr_t* stack_base   = (intptr_t*) ((intptr_t) monitor_base - monitor_size);
-
-    // Provide pop_frame capability on PPC64, add popframe_args.
-    // +1 because stack is always prepushed.
-    intptr_t* stack = (intptr_t*) ((intptr_t) stack_base - (temps + popframe_args + 1) * BytesPerWord);
-
-    BytecodeInterpreter::layout_interpreterState(cur_state,
-                                                 caller,
-                                                 interpreter_frame,
-                                                 method,
-                                                 locals,
-                                                 stack,
-                                                 stack_base,
-                                                 monitor_base,
-                                                 (intptr_t*)(((intptr_t)fp)-top_frame_size),
-                                                 is_top_frame);
-
-    BytecodeInterpreter::pd_layout_interpreterState(cur_state, interpreter_return_address,
-                                                    interpreter_frame->fp());
+  } else {
+    bool is_deopted;
+    locals = (intptr_t*) (fp + ((method->max_locals() - 1) * BytesPerWord) +
+                          frame::parent_ijava_frame_abi_size);
   }
-  return frame_size/BytesPerWord;
+
+  intptr_t* monitor_base = (intptr_t*) cur_state;
+  intptr_t* stack_base   = (intptr_t*) ((intptr_t) monitor_base - monitor_size);
+
+  // Provide pop_frame capability on PPC64, add popframe_args.
+  // +1 because stack is always prepushed.
+  intptr_t* stack = (intptr_t*) ((intptr_t) stack_base - (temps + popframe_args + 1) * BytesPerWord);
+
+  BytecodeInterpreter::layout_interpreterState(cur_state,
+                                               caller,
+                                               interpreter_frame,
+                                               method,
+                                               locals,
+                                               stack,
+                                               stack_base,
+                                               monitor_base,
+                                               (intptr_t*)(((intptr_t)fp) - top_frame_size),
+                                               is_top_frame);
+
+  BytecodeInterpreter::pd_layout_interpreterState(cur_state, interpreter_return_address,
+                                                  interpreter_frame->fp());
 }
 
 #endif // CC_INTERP
diff --git a/hotspot/src/cpu/ppc/vm/ppc.ad b/hotspot/src/cpu/ppc/vm/ppc.ad
index 2989ca5..db87a3c 100644
--- a/hotspot/src/cpu/ppc/vm/ppc.ad
+++ b/hotspot/src/cpu/ppc/vm/ppc.ad
@@ -1,6 +1,6 @@
 //
-// Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
-// Copyright 2012, 2013 SAP AG. All rights reserved.
+// Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+// Copyright 2012, 2014 SAP AG. 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
@@ -1362,8 +1362,8 @@
   Compile* C = ra_->C;
   MacroAssembler _masm(&cbuf);
 
-  const long framesize = ((long)C->frame_slots()) << LogBytesPerInt;
-  assert(framesize%(2*wordSize) == 0, "must preserve 2*wordSize alignment");
+  const long framesize = C->frame_size_in_bytes();
+  assert(framesize % (2 * wordSize) == 0, "must preserve 2*wordSize alignment");
 
   const bool method_is_frameless      = false /* TODO: PPC port C->is_frameless_method()*/;
 
@@ -1388,19 +1388,22 @@
   // careful, because some VM calls (such as call site linkage) can
   // use several kilobytes of stack. But the stack safety zone should
   // account for that. See bugs 4446381, 4468289, 4497237.
-  if (C->need_stack_bang(framesize) && UseStackBanging) {
+
+  int bangsize = C->bang_size_in_bytes();
+  assert(bangsize >= framesize || bangsize <= 0, "stack bang size incorrect");
+  if (C->need_stack_bang(bangsize) && UseStackBanging) {
     // Unfortunately we cannot use the function provided in
     // assembler.cpp as we have to emulate the pipes. So I had to
     // insert the code of generate_stack_overflow_check(), see
     // assembler.cpp for some illuminative comments.
     const int page_size = os::vm_page_size();
-    int bang_end = StackShadowPages*page_size;
+    int bang_end = StackShadowPages * page_size;
 
     // This is how far the previous frame's stack banging extended.
     const int bang_end_safe = bang_end;
 
-    if (framesize > page_size) {
-      bang_end += framesize;
+    if (bangsize > page_size) {
+      bang_end += bangsize;
     }
 
     int bang_offset = bang_end_safe;
@@ -1446,7 +1449,7 @@
 
   unsigned int bytes = (unsigned int)framesize;
   long offset = Assembler::align_addr(bytes, frame::alignment_in_bytes);
-  ciMethod *currMethod = C -> method();
+  ciMethod *currMethod = C->method();
 
   // Optimized version for most common case.
   if (UsePower6SchedulerPPC64 &&
diff --git a/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp b/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp
index f22fbae..f1710aa 100644
--- a/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp
+++ b/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp
@@ -1334,21 +1334,42 @@
 int AbstractInterpreter::size_top_interpreter_activation(Method* method) {
   const int max_alignment_size = 2;
   const int abi_scratch = frame::abi_reg_args_size;
-  return method->max_locals() + method->max_stack() + frame::interpreter_frame_monitor_size() + max_alignment_size + abi_scratch;
+  return method->max_locals() + method->max_stack() +
+         frame::interpreter_frame_monitor_size() + max_alignment_size + abi_scratch;
 }
 
-// Fills a sceletal interpreter frame generated during deoptimizations
-// and returns the frame size in slots.
+// Returns number of stackElementWords needed for the interpreter frame with the
+// given sections.
+// This overestimates the stack by one slot in case of alignments.
+int AbstractInterpreter::size_activation(int max_stack,
+                                         int temps,
+                                         int extra_args,
+                                         int monitors,
+                                         int callee_params,
+                                         int callee_locals,
+                                         bool is_top_frame) {
+  // Note: This calculation must exactly parallel the frame setup
+  // in AbstractInterpreterGenerator::generate_method_entry.
+  assert(Interpreter::stackElementWords == 1, "sanity");
+  const int max_alignment_space = StackAlignmentInBytes / Interpreter::stackElementSize;
+  const int abi_scratch = is_top_frame ? (frame::abi_reg_args_size / Interpreter::stackElementSize) :
+                                         (frame::abi_minframe_size / Interpreter::stackElementSize);
+  const int size =
+    max_stack                                                +
+    (callee_locals - callee_params)                          +
+    monitors * frame::interpreter_frame_monitor_size()       +
+    max_alignment_space                                      +
+    abi_scratch                                              +
+    frame::ijava_state_size / Interpreter::stackElementSize;
+
+  // Fixed size of an interpreter frame, align to 16-byte.
+  return (size & -2);
+}
+
+// Fills a sceletal interpreter frame generated during deoptimizations.
 //
 // Parameters:
 //
-// interpreter_frame == NULL:
-//   Only calculate the size of an interpreter activation, no actual layout.
-//   Note: This calculation must exactly parallel the frame setup
-//   in TemplateInterpreter::generate_normal_entry. But it does not
-//   account for the SP alignment, that might further enhance the
-//   frame size, depending on FP.
-//
 // interpreter_frame != NULL:
 //   set up the method, locals, and monitors.
 //   The frame interpreter_frame, if not NULL, is guaranteed to be the
@@ -1365,59 +1386,41 @@
 //   the arguments off advance the esp by dummy popframe_extra_args slots.
 //   Popping off those will establish the stack layout as it was before the call.
 //
-int AbstractInterpreter::layout_activation(Method* method,
-                                           int tempcount,
-                                           int popframe_extra_args,
-                                           int moncount,
-                                           int caller_actual_parameters,
-                                           int callee_param_count,
-                                           int callee_locals,
-                                           frame* caller,
-                                           frame* interpreter_frame,
-                                           bool is_top_frame,
-                                           bool is_bottom_frame) {
+void AbstractInterpreter::layout_activation(Method* method,
+                                            int tempcount,
+                                            int popframe_extra_args,
+                                            int moncount,
+                                            int caller_actual_parameters,
+                                            int callee_param_count,
+                                            int callee_locals_count,
+                                            frame* caller,
+                                            frame* interpreter_frame,
+                                            bool is_top_frame,
+                                            bool is_bottom_frame) {
 
-  const int max_alignment_space = 2;
   const int abi_scratch = is_top_frame ? (frame::abi_reg_args_size / Interpreter::stackElementSize) :
-                                         (frame::abi_minframe_size / Interpreter::stackElementSize) ;
-  const int conservative_framesize_in_slots =
-    method->max_stack() + callee_locals - callee_param_count +
-    (moncount * frame::interpreter_frame_monitor_size()) + max_alignment_space +
-    abi_scratch + frame::ijava_state_size / Interpreter::stackElementSize;
+                                         (frame::abi_minframe_size / Interpreter::stackElementSize);
 
-  assert(!is_top_frame || conservative_framesize_in_slots * 8 > frame::abi_reg_args_size + frame::ijava_state_size, "frame too small");
+  intptr_t* locals_base  = (caller->is_interpreted_frame()) ?
+    caller->interpreter_frame_esp() + caller_actual_parameters :
+    caller->sp() + method->max_locals() - 1 + (frame::abi_minframe_size / Interpreter::stackElementSize) ;
 
-  if (interpreter_frame == NULL) {
-    // Since we don't know the exact alignment, we return the conservative size.
-    return (conservative_framesize_in_slots & -2);
-  } else {
-    // Now we know our caller, calc the exact frame layout and size.
-    intptr_t* locals_base  = (caller->is_interpreted_frame()) ?
-      caller->interpreter_frame_esp() + caller_actual_parameters :
-      caller->sp() + method->max_locals() - 1 + (frame::abi_minframe_size / Interpreter::stackElementSize) ;
+  intptr_t* monitor_base = caller->sp() - frame::ijava_state_size / Interpreter::stackElementSize ;
+  intptr_t* monitor      = monitor_base - (moncount * frame::interpreter_frame_monitor_size());
+  intptr_t* esp_base     = monitor - 1;
+  intptr_t* esp          = esp_base - tempcount - popframe_extra_args;
+  intptr_t* sp           = (intptr_t *) (((intptr_t) (esp_base - callee_locals_count + callee_param_count - method->max_stack()- abi_scratch)) & -StackAlignmentInBytes);
+  intptr_t* sender_sp    = caller->sp() + (frame::abi_minframe_size - frame::abi_reg_args_size) / Interpreter::stackElementSize;
+  intptr_t* top_frame_sp = is_top_frame ? sp : sp + (frame::abi_minframe_size - frame::abi_reg_args_size) / Interpreter::stackElementSize;
 
-    intptr_t* monitor_base = caller->sp() - frame::ijava_state_size / Interpreter::stackElementSize ;
-    intptr_t* monitor      = monitor_base - (moncount * frame::interpreter_frame_monitor_size());
-    intptr_t* esp_base     = monitor - 1;
-    intptr_t* esp          = esp_base - tempcount - popframe_extra_args;
-    intptr_t* sp           = (intptr_t *) (((intptr_t) (esp_base- callee_locals + callee_param_count - method->max_stack()- abi_scratch)) & -StackAlignmentInBytes);
-    intptr_t* sender_sp    = caller->sp() + (frame::abi_minframe_size - frame::abi_reg_args_size) / Interpreter::stackElementSize;
-    intptr_t* top_frame_sp = is_top_frame ? sp : sp + (frame::abi_minframe_size - frame::abi_reg_args_size) / Interpreter::stackElementSize;
-
-    interpreter_frame->interpreter_frame_set_method(method);
-    interpreter_frame->interpreter_frame_set_locals(locals_base);
-    interpreter_frame->interpreter_frame_set_cpcache(method->constants()->cache());
-    interpreter_frame->interpreter_frame_set_esp(esp);
-    interpreter_frame->interpreter_frame_set_monitor_end((BasicObjectLock *)monitor);
-    interpreter_frame->interpreter_frame_set_top_frame_sp(top_frame_sp);
-    if (!is_bottom_frame) {
-      interpreter_frame->interpreter_frame_set_sender_sp(sender_sp);
-    }
-
-    int framesize_in_slots = caller->sp() - sp;
-    assert(!is_top_frame ||framesize_in_slots >= (frame::abi_reg_args_size / Interpreter::stackElementSize) + frame::ijava_state_size / Interpreter::stackElementSize, "frame too small");
-    assert(framesize_in_slots <= conservative_framesize_in_slots, "exact frame size must be smaller than the convervative size!");
-    return framesize_in_slots;
+  interpreter_frame->interpreter_frame_set_method(method);
+  interpreter_frame->interpreter_frame_set_locals(locals_base);
+  interpreter_frame->interpreter_frame_set_cpcache(method->constants()->cache());
+  interpreter_frame->interpreter_frame_set_esp(esp);
+  interpreter_frame->interpreter_frame_set_monitor_end((BasicObjectLock *)monitor);
+  interpreter_frame->interpreter_frame_set_top_frame_sp(top_frame_sp);
+  if (!is_bottom_frame) {
+    interpreter_frame->interpreter_frame_set_sender_sp(sender_sp);
   }
 }
 
diff --git a/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp b/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp
index 11547cde..ffbc6f2 100644
--- a/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp
+++ b/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp
@@ -630,11 +630,20 @@
   }
 
  protected:
+  // Insert a nop if the previous is cbcond
+  void insert_nop_after_cbcond() {
+    if (UseCBCond && cbcond_before()) {
+      nop();
+    }
+  }
   // Delay slot helpers
   // cti is called when emitting control-transfer instruction,
   // BEFORE doing the emitting.
   // Only effective when assertion-checking is enabled.
   void cti() {
+    // A cbcond instruction immediately followed by a CTI
+    // instruction introduces pipeline stalls, we need to avoid that.
+    no_cbcond_before();
 #ifdef CHECK_DELAY
     assert_not_delayed("cti should not be in delay slot");
 #endif
@@ -658,7 +667,6 @@
   void no_cbcond_before() {
     assert(offset() == 0 || !cbcond_before(), "cbcond should not follow an other cbcond");
   }
-
 public:
 
   bool use_cbcond(Label& L) {
diff --git a/hotspot/src/cpu/sparc/vm/assembler_sparc.inline.hpp b/hotspot/src/cpu/sparc/vm/assembler_sparc.inline.hpp
index 2e5ba21..2bbf95e 100644
--- a/hotspot/src/cpu/sparc/vm/assembler_sparc.inline.hpp
+++ b/hotspot/src/cpu/sparc/vm/assembler_sparc.inline.hpp
@@ -54,33 +54,33 @@
 inline void Assembler::add(Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(add_op3) | rs1(s1) | rs2(s2) ); }
 inline void Assembler::add(Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(add_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
 
-inline void Assembler::bpr( RCondition c, bool a, Predict p, Register s1, address d, relocInfo::relocType rt ) { v9_only();  cti();  emit_data( op(branch_op) | annul(a) | cond(c) | op2(bpr_op2) | wdisp16(intptr_t(d), intptr_t(pc())) | predict(p) | rs1(s1), rt);  has_delay_slot(); }
-inline void Assembler::bpr( RCondition c, bool a, Predict p, Register s1, Label& L) { bpr( c, a, p, s1, target(L)); }
+inline void Assembler::bpr( RCondition c, bool a, Predict p, Register s1, address d, relocInfo::relocType rt ) { v9_only(); insert_nop_after_cbcond(); cti();  emit_data( op(branch_op) | annul(a) | cond(c) | op2(bpr_op2) | wdisp16(intptr_t(d), intptr_t(pc())) | predict(p) | rs1(s1), rt);  has_delay_slot(); }
+inline void Assembler::bpr( RCondition c, bool a, Predict p, Register s1, Label& L) { insert_nop_after_cbcond(); bpr( c, a, p, s1, target(L)); }
 
-inline void Assembler::fb( Condition c, bool a, address d, relocInfo::relocType rt ) { v9_dep();  cti();  emit_data( op(branch_op) | annul(a) | cond(c) | op2(fb_op2) | wdisp(intptr_t(d), intptr_t(pc()), 22), rt);  has_delay_slot(); }
-inline void Assembler::fb( Condition c, bool a, Label& L ) { fb(c, a, target(L)); }
+inline void Assembler::fb( Condition c, bool a, address d, relocInfo::relocType rt ) { v9_dep();  insert_nop_after_cbcond(); cti();  emit_data( op(branch_op) | annul(a) | cond(c) | op2(fb_op2) | wdisp(intptr_t(d), intptr_t(pc()), 22), rt);  has_delay_slot(); }
+inline void Assembler::fb( Condition c, bool a, Label& L ) { insert_nop_after_cbcond(); fb(c, a, target(L)); }
 
-inline void Assembler::fbp( Condition c, bool a, CC cc, Predict p, address d, relocInfo::relocType rt ) { v9_only();  cti();  emit_data( op(branch_op) | annul(a) | cond(c) | op2(fbp_op2) | branchcc(cc) | predict(p) | wdisp(intptr_t(d), intptr_t(pc()), 19), rt);  has_delay_slot(); }
-inline void Assembler::fbp( Condition c, bool a, CC cc, Predict p, Label& L ) { fbp(c, a, cc, p, target(L)); }
+inline void Assembler::fbp( Condition c, bool a, CC cc, Predict p, address d, relocInfo::relocType rt ) { v9_only(); insert_nop_after_cbcond(); cti();  emit_data( op(branch_op) | annul(a) | cond(c) | op2(fbp_op2) | branchcc(cc) | predict(p) | wdisp(intptr_t(d), intptr_t(pc()), 19), rt);  has_delay_slot(); }
+inline void Assembler::fbp( Condition c, bool a, CC cc, Predict p, Label& L ) { insert_nop_after_cbcond(); fbp(c, a, cc, p, target(L)); }
 
-inline void Assembler::br( Condition c, bool a, address d, relocInfo::relocType rt ) { v9_dep();  cti();   emit_data( op(branch_op) | annul(a) | cond(c) | op2(br_op2) | wdisp(intptr_t(d), intptr_t(pc()), 22), rt);  has_delay_slot(); }
-inline void Assembler::br( Condition c, bool a, Label& L ) { br(c, a, target(L)); }
+inline void Assembler::br( Condition c, bool a, address d, relocInfo::relocType rt ) { v9_dep(); insert_nop_after_cbcond(); cti();   emit_data( op(branch_op) | annul(a) | cond(c) | op2(br_op2) | wdisp(intptr_t(d), intptr_t(pc()), 22), rt);  has_delay_slot(); }
+inline void Assembler::br( Condition c, bool a, Label& L ) { insert_nop_after_cbcond(); br(c, a, target(L)); }
 
-inline void Assembler::bp( Condition c, bool a, CC cc, Predict p, address d, relocInfo::relocType rt ) { v9_only();  cti();  emit_data( op(branch_op) | annul(a) | cond(c) | op2(bp_op2) | branchcc(cc) | predict(p) | wdisp(intptr_t(d), intptr_t(pc()), 19), rt);  has_delay_slot(); }
-inline void Assembler::bp( Condition c, bool a, CC cc, Predict p, Label& L ) { bp(c, a, cc, p, target(L)); }
+inline void Assembler::bp( Condition c, bool a, CC cc, Predict p, address d, relocInfo::relocType rt ) { v9_only();  insert_nop_after_cbcond(); cti();  emit_data( op(branch_op) | annul(a) | cond(c) | op2(bp_op2) | branchcc(cc) | predict(p) | wdisp(intptr_t(d), intptr_t(pc()), 19), rt);  has_delay_slot(); }
+inline void Assembler::bp( Condition c, bool a, CC cc, Predict p, Label& L ) { insert_nop_after_cbcond(); bp(c, a, cc, p, target(L)); }
 
 // compare and branch
 inline void Assembler::cbcond(Condition c, CC cc, Register s1, Register s2, Label& L) { cti();  no_cbcond_before();  emit_data(op(branch_op) | cond_cbcond(c) | op2(bpr_op2) | branchcc(cc) | wdisp10(intptr_t(target(L)), intptr_t(pc())) | rs1(s1) | rs2(s2)); }
 inline void Assembler::cbcond(Condition c, CC cc, Register s1, int simm5, Label& L)   { cti();  no_cbcond_before();  emit_data(op(branch_op) | cond_cbcond(c) | op2(bpr_op2) | branchcc(cc) | wdisp10(intptr_t(target(L)), intptr_t(pc())) | rs1(s1) | immed(true) | simm(simm5, 5)); }
 
-inline void Assembler::call( address d,  relocInfo::relocType rt ) { cti();  emit_data( op(call_op) | wdisp(intptr_t(d), intptr_t(pc()), 30), rt);  has_delay_slot(); assert(rt != relocInfo::virtual_call_type, "must use virtual_call_Relocation::spec"); }
-inline void Assembler::call( Label& L,   relocInfo::relocType rt ) { call( target(L), rt); }
+inline void Assembler::call( address d,  relocInfo::relocType rt ) { insert_nop_after_cbcond(); cti();  emit_data( op(call_op) | wdisp(intptr_t(d), intptr_t(pc()), 30), rt);  has_delay_slot(); assert(rt != relocInfo::virtual_call_type, "must use virtual_call_Relocation::spec"); }
+inline void Assembler::call( Label& L,   relocInfo::relocType rt ) { insert_nop_after_cbcond(); call( target(L), rt); }
 
 inline void Assembler::flush( Register s1, Register s2) { emit_int32( op(arith_op) | op3(flush_op3) | rs1(s1) | rs2(s2)); }
 inline void Assembler::flush( Register s1, int simm13a) { emit_data( op(arith_op) | op3(flush_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); }
 
-inline void Assembler::jmpl( Register s1, Register s2, Register d ) { cti();  emit_int32( op(arith_op) | rd(d) | op3(jmpl_op3) | rs1(s1) | rs2(s2));  has_delay_slot(); }
-inline void Assembler::jmpl( Register s1, int simm13a, Register d, RelocationHolder const& rspec ) { cti();  emit_data( op(arith_op) | rd(d) | op3(jmpl_op3) | rs1(s1) | immed(true) | simm(simm13a, 13), rspec);  has_delay_slot(); }
+inline void Assembler::jmpl( Register s1, Register s2, Register d ) { insert_nop_after_cbcond(); cti();  emit_int32( op(arith_op) | rd(d) | op3(jmpl_op3) | rs1(s1) | rs2(s2));  has_delay_slot(); }
+inline void Assembler::jmpl( Register s1, int simm13a, Register d, RelocationHolder const& rspec ) { insert_nop_after_cbcond(); cti();  emit_data( op(arith_op) | rd(d) | op3(jmpl_op3) | rs1(s1) | immed(true) | simm(simm13a, 13), rspec);  has_delay_slot(); }
 
 inline void Assembler::ldf(FloatRegisterImpl::Width w, Register s1, Register s2, FloatRegister d) { emit_int32( op(ldst_op) | fd(d, w) | alt_op3(ldf_op3, w) | rs1(s1) | rs2(s2) ); }
 inline void Assembler::ldf(FloatRegisterImpl::Width w, Register s1, int simm13a, FloatRegister d, RelocationHolder const& rspec) { emit_data( op(ldst_op) | fd(d, w) | alt_op3(ldf_op3, w) | rs1(s1) | immed(true) | simm(simm13a, 13), rspec); }
diff --git a/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp b/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp
index b9105e9..813cbf0 100644
--- a/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp
@@ -152,7 +152,7 @@
 }
 
 
-int LIR_Assembler::initial_frame_size_in_bytes() {
+int LIR_Assembler::initial_frame_size_in_bytes() const {
   return in_bytes(frame_map()->framesize_in_bytes());
 }
 
@@ -182,7 +182,7 @@
   int number_of_locks = entry_state->locks_size();
 
   // Create a frame for the compiled activation.
-  __ build_frame(initial_frame_size_in_bytes());
+  __ build_frame(initial_frame_size_in_bytes(), bang_size_in_bytes());
 
   // OSR buffer is
   //
diff --git a/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp b/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp
index 3da6cd8..61c866b 100644
--- a/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp
@@ -55,9 +55,9 @@
 }
 
 
-void C1_MacroAssembler::build_frame(int frame_size_in_bytes) {
-
-  generate_stack_overflow_check(frame_size_in_bytes);
+void C1_MacroAssembler::build_frame(int frame_size_in_bytes, int bang_size_in_bytes) {
+  assert(bang_size_in_bytes >= frame_size_in_bytes, "stack bang size incorrect");
+  generate_stack_overflow_check(bang_size_in_bytes);
   // Create the frame.
   save_frame_c1(frame_size_in_bytes);
 }
diff --git a/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.cpp b/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.cpp
index f0bda38..e532521 100644
--- a/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.cpp
@@ -2099,7 +2099,7 @@
   int monitor_size    = method->is_synchronized() ?
                                 1*frame::interpreter_frame_monitor_size() : 0;
   return size_activation_helper(method->max_locals(), method->max_stack(),
-                                 monitor_size) + call_stub_size;
+                                monitor_size) + call_stub_size;
 }
 
 void BytecodeInterpreter::layout_interpreterState(interpreterState to_fill,
@@ -2183,31 +2183,31 @@
   istate->_last_Java_pc = (intptr_t*) last_Java_pc;
 }
 
+static int frame_size_helper(int max_stack,
+                             int moncount,
+                             int callee_param_size,
+                             int callee_locals_size,
+                             bool is_top_frame,
+                             int& monitor_size,
+                             int& full_frame_words) {
+  int extra_locals_size = callee_locals_size - callee_param_size;
+  monitor_size = (sizeof(BasicObjectLock) * moncount) / wordSize;
+  full_frame_words = size_activation_helper(extra_locals_size, max_stack, monitor_size);
+  int short_frame_words = size_activation_helper(extra_locals_size, max_stack, monitor_size);
+  int frame_words = is_top_frame ? full_frame_words : short_frame_words;
 
-int AbstractInterpreter::layout_activation(Method* method,
-                                           int tempcount, // Number of slots on java expression stack in use
-                                           int popframe_extra_args,
-                                           int moncount,  // Number of active monitors
-                                           int caller_actual_parameters,
-                                           int callee_param_size,
-                                           int callee_locals_size,
-                                           frame* caller,
-                                           frame* interpreter_frame,
-                                           bool is_top_frame,
-                                           bool is_bottom_frame) {
+  return frame_words;
+}
 
-  assert(popframe_extra_args == 0, "NEED TO FIX");
-  // NOTE this code must exactly mimic what InterpreterGenerator::generate_compute_interpreter_state()
-  // does as far as allocating an interpreter frame.
-  // If interpreter_frame!=NULL, set up the method, locals, and monitors.
-  // The frame interpreter_frame, if not NULL, is guaranteed to be the right size,
-  // as determined by a previous call to this method.
-  // It is also guaranteed to be walkable even though it is in a skeletal state
+int AbstractInterpreter::size_activation(int max_stack,
+                                         int tempcount,
+                                         int extra_args,
+                                         int moncount,
+                                         int callee_param_size,
+                                         int callee_locals_size,
+                                         bool is_top_frame) {
+  assert(extra_args == 0, "NEED TO FIX");
   // NOTE: return size is in words not bytes
-  // NOTE: tempcount is the current size of the java expression stack. For top most
-  //       frames we will allocate a full sized expression stack and not the curback
-  //       version that non-top frames have.
-
   // Calculate the amount our frame will be adjust by the callee. For top frame
   // this is zero.
 
@@ -2216,87 +2216,108 @@
   // to it. So it ignores last_frame_adjust value. Seems suspicious as far
   // as getting sender_sp correct.
 
-  int extra_locals_size = callee_locals_size - callee_param_size;
-  int monitor_size = (sizeof(BasicObjectLock) * moncount) / wordSize;
-  int full_frame_words = size_activation_helper(extra_locals_size, method->max_stack(), monitor_size);
-  int short_frame_words = size_activation_helper(extra_locals_size, method->max_stack(), monitor_size);
-  int frame_words = is_top_frame ? full_frame_words : short_frame_words;
+  int unused_monitor_size = 0;
+  int unused_full_frame_words = 0;
+  return frame_size_helper(max_stack, moncount, callee_param_size, callee_locals_size, is_top_frame,
+                           unused_monitor_size, unused_full_frame_words);
+}
+void AbstractInterpreter::layout_activation(Method* method,
+                                            int tempcount, // Number of slots on java expression stack in use
+                                            int popframe_extra_args,
+                                            int moncount,  // Number of active monitors
+                                            int caller_actual_parameters,
+                                            int callee_param_size,
+                                            int callee_locals_size,
+                                            frame* caller,
+                                            frame* interpreter_frame,
+                                            bool is_top_frame,
+                                            bool is_bottom_frame) {
+  assert(popframe_extra_args == 0, "NEED TO FIX");
+  // NOTE this code must exactly mimic what InterpreterGenerator::generate_compute_interpreter_state()
+  // does as far as allocating an interpreter frame.
+  // Set up the method, locals, and monitors.
+  // The frame interpreter_frame is guaranteed to be the right size,
+  // as determined by a previous call to the size_activation() method.
+  // It is also guaranteed to be walkable even though it is in a skeletal state
+  // NOTE: tempcount is the current size of the java expression stack. For top most
+  //       frames we will allocate a full sized expression stack and not the curback
+  //       version that non-top frames have.
 
+  int monitor_size = 0;
+  int full_frame_words = 0;
+  int frame_words = frame_size_helper(method->max_stack(), moncount, callee_param_size, callee_locals_size,
+                                      is_top_frame, monitor_size, full_frame_words);
 
   /*
-    if we actually have a frame to layout we must now fill in all the pieces. This means both
+    We must now fill in all the pieces of the frame. This means both
     the interpreterState and the registers.
   */
-  if (interpreter_frame != NULL) {
 
-    // MUCHO HACK
+  // MUCHO HACK
 
-    intptr_t* frame_bottom = interpreter_frame->sp() - (full_frame_words - frame_words);
-    // 'interpreter_frame->sp()' is unbiased while 'frame_bottom' must be a biased value in 64bit mode.
-    assert(((intptr_t)frame_bottom & 0xf) == 0, "SP biased in layout_activation");
-    frame_bottom = (intptr_t*)((intptr_t)frame_bottom - STACK_BIAS);
+  intptr_t* frame_bottom = interpreter_frame->sp() - (full_frame_words - frame_words);
+  // 'interpreter_frame->sp()' is unbiased while 'frame_bottom' must be a biased value in 64bit mode.
+  assert(((intptr_t)frame_bottom & 0xf) == 0, "SP biased in layout_activation");
+  frame_bottom = (intptr_t*)((intptr_t)frame_bottom - STACK_BIAS);
 
-    /* Now fillin the interpreterState object */
+  /* Now fillin the interpreterState object */
 
-    interpreterState cur_state = (interpreterState) ((intptr_t)interpreter_frame->fp() -  sizeof(BytecodeInterpreter));
+  interpreterState cur_state = (interpreterState) ((intptr_t)interpreter_frame->fp() -  sizeof(BytecodeInterpreter));
 
 
-    intptr_t* locals;
+  intptr_t* locals;
 
-    // Calculate the postion of locals[0]. This is painful because of
-    // stack alignment (same as ia64). The problem is that we can
-    // not compute the location of locals from fp(). fp() will account
-    // for the extra locals but it also accounts for aligning the stack
-    // and we can't determine if the locals[0] was misaligned but max_locals
-    // was enough to have the
-    // calculate postion of locals. fp already accounts for extra locals.
-    // +2 for the static long no_params() issue.
+  // Calculate the postion of locals[0]. This is painful because of
+  // stack alignment (same as ia64). The problem is that we can
+  // not compute the location of locals from fp(). fp() will account
+  // for the extra locals but it also accounts for aligning the stack
+  // and we can't determine if the locals[0] was misaligned but max_locals
+  // was enough to have the
+  // calculate postion of locals. fp already accounts for extra locals.
+  // +2 for the static long no_params() issue.
 
-    if (caller->is_interpreted_frame()) {
-      // locals must agree with the caller because it will be used to set the
-      // caller's tos when we return.
-      interpreterState prev  = caller->get_interpreterState();
-      // stack() is prepushed.
-      locals = prev->stack() + method->size_of_parameters();
+  if (caller->is_interpreted_frame()) {
+    // locals must agree with the caller because it will be used to set the
+    // caller's tos when we return.
+    interpreterState prev  = caller->get_interpreterState();
+    // stack() is prepushed.
+    locals = prev->stack() + method->size_of_parameters();
+  } else {
+    // Lay out locals block in the caller adjacent to the register window save area.
+    //
+    // Compiled frames do not allocate a varargs area which is why this if
+    // statement is needed.
+    //
+    intptr_t* fp = interpreter_frame->fp();
+    int local_words = method->max_locals() * Interpreter::stackElementWords;
+
+    if (caller->is_compiled_frame()) {
+      locals = fp + frame::register_save_words + local_words - 1;
     } else {
-      // Lay out locals block in the caller adjacent to the register window save area.
-      //
-      // Compiled frames do not allocate a varargs area which is why this if
-      // statement is needed.
-      //
-      intptr_t* fp = interpreter_frame->fp();
-      int local_words = method->max_locals() * Interpreter::stackElementWords;
-
-      if (caller->is_compiled_frame()) {
-        locals = fp + frame::register_save_words + local_words - 1;
-      } else {
-        locals = fp + frame::memory_parameter_word_sp_offset + local_words - 1;
-      }
-
+      locals = fp + frame::memory_parameter_word_sp_offset + local_words - 1;
     }
-    // END MUCHO HACK
-
-    intptr_t* monitor_base = (intptr_t*) cur_state;
-    intptr_t* stack_base =  monitor_base - monitor_size;
-    /* +1 because stack is always prepushed */
-    intptr_t* stack = stack_base - (tempcount + 1);
-
-
-    BytecodeInterpreter::layout_interpreterState(cur_state,
-                                          caller,
-                                          interpreter_frame,
-                                          method,
-                                          locals,
-                                          stack,
-                                          stack_base,
-                                          monitor_base,
-                                          frame_bottom,
-                                          is_top_frame);
-
-    BytecodeInterpreter::pd_layout_interpreterState(cur_state, interpreter_return_address, interpreter_frame->fp());
 
   }
-  return frame_words;
+  // END MUCHO HACK
+
+  intptr_t* monitor_base = (intptr_t*) cur_state;
+  intptr_t* stack_base =  monitor_base - monitor_size;
+  /* +1 because stack is always prepushed */
+  intptr_t* stack = stack_base - (tempcount + 1);
+
+
+  BytecodeInterpreter::layout_interpreterState(cur_state,
+                                               caller,
+                                               interpreter_frame,
+                                               method,
+                                               locals,
+                                               stack,
+                                               stack_base,
+                                               monitor_base,
+                                               frame_bottom,
+                                               is_top_frame);
+
+  BytecodeInterpreter::pd_layout_interpreterState(cur_state, interpreter_return_address, interpreter_frame->fp());
 }
 
 #endif // CC_INTERP
diff --git a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp
index 7d19572..d7396f6 100644
--- a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp
@@ -3531,7 +3531,7 @@
   // was post-decremented.)  Skip this address by starting at i=1, and
   // touch a few more pages below.  N.B.  It is important to touch all
   // the way down to and including i=StackShadowPages.
-  for (int i = 1; i <= StackShadowPages; i++) {
+  for (int i = 1; i < StackShadowPages; i++) {
     set((-i*offset)+STACK_BIAS, Rscratch);
     st(G0, Rtsp, Rscratch);
   }
diff --git a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.inline.hpp b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.inline.hpp
index 125f9a7..7e3804f 100644
--- a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.inline.hpp
+++ b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.inline.hpp
@@ -233,6 +233,7 @@
 }
 
 inline void MacroAssembler::br( Condition c, bool a, Predict p, Label& L ) {
+  insert_nop_after_cbcond();
   br(c, a, p, target(L));
 }
 
@@ -248,6 +249,7 @@
 }
 
 inline void MacroAssembler::brx( Condition c, bool a, Predict p, Label& L ) {
+  insert_nop_after_cbcond();
   brx(c, a, p, target(L));
 }
 
@@ -269,6 +271,7 @@
 }
 
 inline void MacroAssembler::fb( Condition c, bool a, Predict p, Label& L ) {
+  insert_nop_after_cbcond();
   fb(c, a, p, target(L));
 }
 
@@ -318,6 +321,7 @@
 }
 
 inline void MacroAssembler::call( Label& L,   relocInfo::relocType rt ) {
+  insert_nop_after_cbcond();
   MacroAssembler::call( target(L), rt);
 }
 
diff --git a/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp b/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp
index 9f802a1..b3c706d 100644
--- a/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp
@@ -3355,13 +3355,16 @@
   Register        O4array_size       = O4;
   Label           loop;
 
-  // Before we make new frames, check to see if stack is available.
-  // Do this after the caller's return address is on top of stack
+#ifdef ASSERT
+  // Compilers generate code that bang the stack by as much as the
+  // interpreter would need. So this stack banging should never
+  // trigger a fault. Verify that it does not on non product builds.
   if (UseStackBanging) {
     // Get total frame size for interpreted frames
     __ ld(O2UnrollBlock, Deoptimization::UnrollBlock::total_frame_sizes_offset_in_bytes(), O4);
     __ bang_stack_size(O4, O3, G3_scratch);
   }
+#endif
 
   __ ld(O2UnrollBlock, Deoptimization::UnrollBlock::number_of_frames_offset_in_bytes(), O4array_size);
   __ ld_ptr(O2UnrollBlock, Deoptimization::UnrollBlock::frame_pcs_offset_in_bytes(), G3pcs);
@@ -3409,9 +3412,11 @@
   ResourceMark rm;
   // setup code generation tools
   int pad = VerifyThread ? 512 : 0;// Extra slop space for more verify code
+#ifdef ASSERT
   if (UseStackBanging) {
     pad += StackShadowPages*16 + 32;
   }
+#endif
 #ifdef _LP64
   CodeBuffer buffer("deopt_blob", 2100+pad, 512);
 #else
@@ -3632,9 +3637,11 @@
   ResourceMark rm;
   // setup code generation tools
   int pad = VerifyThread ? 512 : 0;
+#ifdef ASSERT
   if (UseStackBanging) {
     pad += StackShadowPages*16 + 32;
   }
+#endif
 #ifdef _LP64
   CodeBuffer buffer("uncommon_trap_blob", 2700+pad, 512);
 #else
diff --git a/hotspot/src/cpu/sparc/vm/sparc.ad b/hotspot/src/cpu/sparc/vm/sparc.ad
index 4a3a33d..23026ea 100644
--- a/hotspot/src/cpu/sparc/vm/sparc.ad
+++ b/hotspot/src/cpu/sparc/vm/sparc.ad
@@ -1193,15 +1193,16 @@
     st->print_cr("Verify_Thread"); st->print("\t");
   }
 
-  size_t framesize = C->frame_slots() << LogBytesPerInt;
+  size_t framesize = C->frame_size_in_bytes();
+  int bangsize = C->bang_size_in_bytes();
 
   // Calls to C2R adapters often do not accept exceptional returns.
   // We require that their callers must bang for them.  But be careful, because
   // some VM calls (such as call site linkage) can use several kilobytes of
   // stack.  But the stack safety zone should account for that.
   // See bugs 4446381, 4468289, 4497237.
-  if (C->need_stack_bang(framesize)) {
-    st->print_cr("! stack bang"); st->print("\t");
+  if (C->need_stack_bang(bangsize)) {
+    st->print_cr("! stack bang (%d bytes)", bangsize); st->print("\t");
   }
 
   if (Assembler::is_simm13(-framesize)) {
@@ -1225,17 +1226,18 @@
 
   __ verify_thread();
 
-  size_t framesize = C->frame_slots() << LogBytesPerInt;
+  size_t framesize = C->frame_size_in_bytes();
   assert(framesize >= 16*wordSize, "must have room for reg. save area");
   assert(framesize%(2*wordSize) == 0, "must preserve 2*wordSize alignment");
+  int bangsize = C->bang_size_in_bytes();
 
   // Calls to C2R adapters often do not accept exceptional returns.
   // We require that their callers must bang for them.  But be careful, because
   // some VM calls (such as call site linkage) can use several kilobytes of
   // stack.  But the stack safety zone should account for that.
   // See bugs 4446381, 4468289, 4497237.
-  if (C->need_stack_bang(framesize)) {
-    __ generate_stack_overflow_check(framesize);
+  if (C->need_stack_bang(bangsize)) {
+    __ generate_stack_overflow_check(bangsize);
   }
 
   if (Assembler::is_simm13(-framesize)) {
@@ -1268,7 +1270,7 @@
 void MachEpilogNode::format( PhaseRegAlloc *ra_, outputStream *st ) const {
   Compile* C = ra_->C;
 
-  if( do_polling() && ra_->C->is_method_compilation() ) {
+  if(do_polling() && ra_->C->is_method_compilation()) {
     st->print("SETHI  #PollAddr,L0\t! Load Polling address\n\t");
 #ifdef _LP64
     st->print("LDX    [L0],G0\t!Poll for Safepointing\n\t");
@@ -1277,8 +1279,12 @@
 #endif
   }
 
-  if( do_polling() )
+  if(do_polling()) {
+    if (UseCBCond && !ra_->C->is_method_compilation()) {
+      st->print("NOP\n\t");
+    }
     st->print("RET\n\t");
+  }
 
   st->print("RESTORE");
 }
@@ -1291,15 +1297,20 @@
   __ verify_thread();
 
   // If this does safepoint polling, then do it here
-  if( do_polling() && ra_->C->is_method_compilation() ) {
+  if(do_polling() && ra_->C->is_method_compilation()) {
     AddressLiteral polling_page(os::get_polling_page());
     __ sethi(polling_page, L0);
     __ relocate(relocInfo::poll_return_type);
-    __ ld_ptr( L0, 0, G0 );
+    __ ld_ptr(L0, 0, G0);
   }
 
   // If this is a return, then stuff the restore in the delay slot
-  if( do_polling() ) {
+  if(do_polling()) {
+    if (UseCBCond && !ra_->C->is_method_compilation()) {
+      // Insert extra padding for the case when the epilogue is preceded by
+      // a cbcond jump, which can't be followed by a CTI instruction
+      __ nop();
+    }
     __ ret();
     __ delayed()->restore();
   } else {
@@ -2538,7 +2549,7 @@
   enc_class call_epilog %{
     if( VerifyStackAtCalls ) {
       MacroAssembler _masm(&cbuf);
-      int framesize = ra_->C->frame_slots() << LogBytesPerInt;
+      int framesize = ra_->C->frame_size_in_bytes();
       Register temp_reg = G3;
       __ add(SP, framesize, temp_reg);
       __ cmp(temp_reg, FP);
@@ -3330,7 +3341,18 @@
 //----------Instruction Attributes---------------------------------------------
 ins_attrib ins_cost(DEFAULT_COST); // Required cost attribute
 ins_attrib ins_size(32);           // Required size attribute (in bits)
-ins_attrib ins_avoid_back_to_back(0); // instruction should not be generated back to back
+
+// avoid_back_to_back attribute is an expression that must return
+// one of the following values defined in MachNode:
+// AVOID_NONE   - instruction can be placed anywhere
+// AVOID_BEFORE - instruction cannot be placed after an
+//                instruction with MachNode::AVOID_AFTER
+// AVOID_AFTER  - the next instruction cannot be the one 
+//                with MachNode::AVOID_BEFORE
+// AVOID_BEFORE_AND_AFTER - BEFORE and AFTER attributes at 
+//                          the same time                                
+ins_attrib ins_avoid_back_to_back(MachNode::AVOID_NONE);
+
 ins_attrib ins_short_branch(0);    // Required flag: is this instruction a
                                    // non-matching short branch variant of some
                                                             // long branch?
@@ -6630,6 +6652,7 @@
   ins_encode %{
     __ encode_heap_oop($src$$Register, $dst$$Register);
   %}
+  ins_avoid_back_to_back(Universe::narrow_oop_base() == NULL ? AVOID_NONE : AVOID_BEFORE);
   ins_pipe(ialu_reg);
 %}
 
@@ -9199,6 +9222,7 @@
     __ ba(*L);
     __ delayed()->nop();
   %}
+  ins_avoid_back_to_back(AVOID_BEFORE);
   ins_pipe(br);
 %}
 
@@ -9217,7 +9241,7 @@
     __ ba_short(*L);
   %}
   ins_short_branch(1);
-  ins_avoid_back_to_back(1);
+  ins_avoid_back_to_back(AVOID_BEFORE_AND_AFTER);
   ins_pipe(cbcond_reg_imm);
 %}
 
@@ -9231,6 +9255,7 @@
   format %{ "BP$cmp   $icc,$labl" %}
   // Prim = bits 24-22, Secnd = bits 31-30
   ins_encode( enc_bp( labl, cmp, icc ) );
+  ins_avoid_back_to_back(AVOID_BEFORE);
   ins_pipe(br_cc);
 %}
 
@@ -9242,6 +9267,7 @@
   format %{ "BP$cmp  $icc,$labl" %}
   // Prim = bits 24-22, Secnd = bits 31-30
   ins_encode( enc_bp( labl, cmp, icc ) );
+  ins_avoid_back_to_back(AVOID_BEFORE);
   ins_pipe(br_cc);
 %}
 
@@ -9260,6 +9286,7 @@
     __ bp( (Assembler::Condition)($cmp$$cmpcode), false, Assembler::ptr_cc, predict_taken, *L);
     __ delayed()->nop();
   %}
+  ins_avoid_back_to_back(AVOID_BEFORE);
   ins_pipe(br_cc);
 %}
 
@@ -9278,6 +9305,7 @@
     __ fbp( (Assembler::Condition)($cmp$$cmpcode), false, (Assembler::CC)($fcc$$reg), predict_taken, *L);
     __ delayed()->nop();
   %}
+  ins_avoid_back_to_back(AVOID_BEFORE);
   ins_pipe(br_fcc);
 %}
 
@@ -9290,6 +9318,7 @@
   format %{ "BP$cmp   $icc,$labl\t! Loop end" %}
   // Prim = bits 24-22, Secnd = bits 31-30
   ins_encode( enc_bp( labl, cmp, icc ) );
+  ins_avoid_back_to_back(AVOID_BEFORE);
   ins_pipe(br_cc);
 %}
 
@@ -9302,6 +9331,7 @@
   format %{ "BP$cmp  $icc,$labl\t! Loop end" %}
   // Prim = bits 24-22, Secnd = bits 31-30
   ins_encode( enc_bp( labl, cmp, icc ) );
+  ins_avoid_back_to_back(AVOID_BEFORE);
   ins_pipe(br_cc);
 %}
 
@@ -9552,7 +9582,7 @@
     __ cbcond((Assembler::Condition)($cmp$$cmpcode), Assembler::icc, $op1$$Register, $op2$$Register, *L);
   %}
   ins_short_branch(1);
-  ins_avoid_back_to_back(1);
+  ins_avoid_back_to_back(AVOID_BEFORE_AND_AFTER);
   ins_pipe(cbcond_reg_reg);
 %}
 
@@ -9570,7 +9600,7 @@
     __ cbcond((Assembler::Condition)($cmp$$cmpcode), Assembler::icc, $op1$$Register, $op2$$constant, *L);
   %}
   ins_short_branch(1);
-  ins_avoid_back_to_back(1);
+  ins_avoid_back_to_back(AVOID_BEFORE_AND_AFTER);
   ins_pipe(cbcond_reg_imm);
 %}
 
@@ -9588,7 +9618,7 @@
     __ cbcond((Assembler::Condition)($cmp$$cmpcode), Assembler::icc, $op1$$Register, $op2$$Register, *L);
   %}
   ins_short_branch(1);
-  ins_avoid_back_to_back(1);
+  ins_avoid_back_to_back(AVOID_BEFORE_AND_AFTER);
   ins_pipe(cbcond_reg_reg);
 %}
 
@@ -9606,7 +9636,7 @@
     __ cbcond((Assembler::Condition)($cmp$$cmpcode), Assembler::icc, $op1$$Register, $op2$$constant, *L);
   %}
   ins_short_branch(1);
-  ins_avoid_back_to_back(1);
+  ins_avoid_back_to_back(AVOID_BEFORE_AND_AFTER);
   ins_pipe(cbcond_reg_imm);
 %}
 
@@ -9624,7 +9654,7 @@
     __ cbcond((Assembler::Condition)($cmp$$cmpcode), Assembler::xcc, $op1$$Register, $op2$$Register, *L);
   %}
   ins_short_branch(1);
-  ins_avoid_back_to_back(1);
+  ins_avoid_back_to_back(AVOID_BEFORE_AND_AFTER);
   ins_pipe(cbcond_reg_reg);
 %}
 
@@ -9642,7 +9672,7 @@
     __ cbcond((Assembler::Condition)($cmp$$cmpcode), Assembler::xcc, $op1$$Register, $op2$$constant, *L);
   %}
   ins_short_branch(1);
-  ins_avoid_back_to_back(1);
+  ins_avoid_back_to_back(AVOID_BEFORE_AND_AFTER);
   ins_pipe(cbcond_reg_imm);
 %}
 
@@ -9665,7 +9695,7 @@
     __ cbcond((Assembler::Condition)($cmp$$cmpcode), Assembler::ptr_cc, $op1$$Register, $op2$$Register, *L);
   %}
   ins_short_branch(1);
-  ins_avoid_back_to_back(1);
+  ins_avoid_back_to_back(AVOID_BEFORE_AND_AFTER);
   ins_pipe(cbcond_reg_reg);
 %}
 
@@ -9687,7 +9717,7 @@
     __ cbcond((Assembler::Condition)($cmp$$cmpcode), Assembler::ptr_cc, $op1$$Register, G0, *L);
   %}
   ins_short_branch(1);
-  ins_avoid_back_to_back(1);
+  ins_avoid_back_to_back(AVOID_BEFORE_AND_AFTER);
   ins_pipe(cbcond_reg_reg);
 %}
 
@@ -9705,7 +9735,7 @@
     __ cbcond((Assembler::Condition)($cmp$$cmpcode), Assembler::icc, $op1$$Register, $op2$$Register, *L);
   %}
   ins_short_branch(1);
-  ins_avoid_back_to_back(1);
+  ins_avoid_back_to_back(AVOID_BEFORE_AND_AFTER);
   ins_pipe(cbcond_reg_reg);
 %}
 
@@ -9723,7 +9753,7 @@
     __ cbcond((Assembler::Condition)($cmp$$cmpcode), Assembler::icc, $op1$$Register, G0, *L);
   %}
   ins_short_branch(1);
-  ins_avoid_back_to_back(1);
+  ins_avoid_back_to_back(AVOID_BEFORE_AND_AFTER);
   ins_pipe(cbcond_reg_reg);
 %}
 
@@ -9742,7 +9772,7 @@
     __ cbcond((Assembler::Condition)($cmp$$cmpcode), Assembler::icc, $op1$$Register, $op2$$Register, *L);
   %}
   ins_short_branch(1);
-  ins_avoid_back_to_back(1);
+  ins_avoid_back_to_back(AVOID_BEFORE_AND_AFTER);
   ins_pipe(cbcond_reg_reg);
 %}
 
@@ -9760,7 +9790,7 @@
     __ cbcond((Assembler::Condition)($cmp$$cmpcode), Assembler::icc, $op1$$Register, $op2$$constant, *L);
   %}
   ins_short_branch(1);
-  ins_avoid_back_to_back(1);
+  ins_avoid_back_to_back(AVOID_BEFORE_AND_AFTER);
   ins_pipe(cbcond_reg_imm);
 %}
 
@@ -9777,6 +9807,7 @@
   ins_cost(BRANCH_COST);
   format %{ "BR$cmp   $op1,$labl" %}
   ins_encode( enc_bpr( labl, cmp, op1 ) );
+  ins_avoid_back_to_back(AVOID_BEFORE);
   ins_pipe(br_reg);
 %}
 
@@ -9789,6 +9820,7 @@
   ins_cost(BRANCH_COST);
   format %{ "BR$cmp   $op1,$labl" %}
   ins_encode( enc_bpr( labl, cmp, op1 ) );
+  ins_avoid_back_to_back(AVOID_BEFORE);
   ins_pipe(br_reg);
 %}
 
@@ -9801,6 +9833,7 @@
   ins_cost(BRANCH_COST);
   format %{ "BR$cmp   $op1,$labl" %}
   ins_encode( enc_bpr( labl, cmp, op1 ) );
+  ins_avoid_back_to_back(AVOID_BEFORE);
   ins_pipe(br_reg);
 %}
 
@@ -9841,6 +9874,7 @@
     __ bp( (Assembler::Condition)($cmp$$cmpcode), false, Assembler::xcc, predict_taken, *L);
     __ delayed()->nop();
   %}
+  ins_avoid_back_to_back(AVOID_BEFORE);
   ins_pipe(br_cc);
 %}
 
@@ -9968,6 +10002,7 @@
   ins_cost(CALL_COST);
   format %{ "CALL,static  ; NOP ==> " %}
   ins_encode( Java_Static_Call( meth ), call_epilog );
+  ins_avoid_back_to_back(AVOID_BEFORE);
   ins_pipe(simple_call);
 %}
 
@@ -10004,6 +10039,7 @@
   format %{ "CALL,runtime" %}
   ins_encode( Java_To_Runtime( meth ),
               call_epilog, adjust_long_from_native_call );
+  ins_avoid_back_to_back(AVOID_BEFORE);
   ins_pipe(simple_call);
 %}
 
@@ -10016,6 +10052,7 @@
   ins_encode( Java_To_Runtime( meth ),
               call_epilog,
               adjust_long_from_native_call );
+  ins_avoid_back_to_back(AVOID_BEFORE);
   ins_pipe(simple_call);
 %}
 
@@ -10028,6 +10065,7 @@
   ins_encode( Java_To_Runtime( meth ),
               call_epilog,
               adjust_long_from_native_call );
+  ins_avoid_back_to_back(AVOID_BEFORE);
   ins_pipe(simple_call);
 %}
 
@@ -10041,6 +10079,7 @@
   ins_cost(CALL_COST);
   format %{ "Jmp     $jump_target  ; NOP \t! $method_oop holds method oop" %}
   ins_encode(form_jmpl(jump_target));
+  ins_avoid_back_to_back(AVOID_BEFORE);
   ins_pipe(tail_call);
 %}
 
@@ -10072,6 +10111,7 @@
   // opcode(Assembler::jmpl_op3, Assembler::arith_op);
   // The hack duplicates the exception oop into G3, so that CreateEx can use it there.
   // ins_encode( form3_rs1_simm13_rd( jump_target, 0x00, R_G0 ), move_return_pc_to_o1() );
+  ins_avoid_back_to_back(AVOID_BEFORE);
   ins_pipe(tail_call);
 %}
 
@@ -10102,6 +10142,7 @@
   // use the following format syntax
   format %{ "Jmp    rethrow_stub" %}
   ins_encode(enc_rethrow);
+  ins_avoid_back_to_back(AVOID_BEFORE);
   ins_pipe(tail_call);
 %}
 
@@ -10130,6 +10171,7 @@
   ins_cost(DEFAULT_COST*10);
   format %{ "CALL   PartialSubtypeCheck\n\tNOP" %}
   ins_encode( enc_PartialSubtypeCheck() );
+  ins_avoid_back_to_back(AVOID_BEFORE);
   ins_pipe(partial_subtype_check_pipe);
 %}
 
@@ -10139,6 +10181,7 @@
   ins_cost(DEFAULT_COST*10);
   format %{ "CALL   PartialSubtypeCheck\n\tNOP\t# (sets condition codes)" %}
   ins_encode( enc_PartialSubtypeCheck() );
+  ins_avoid_back_to_back(AVOID_BEFORE);
   ins_pipe(partial_subtype_check_pipe);
 %}
 
diff --git a/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp b/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp
index f0e8fed..4ac4024 100644
--- a/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp
@@ -1564,37 +1564,23 @@
   int monitor_size    = method->is_synchronized() ?
                                 1*frame::interpreter_frame_monitor_size() : 0;
   return size_activation_helper(method->max_locals(), method->max_stack(),
-                                 monitor_size) + call_stub_size;
+                                monitor_size) + call_stub_size;
 }
 
-int AbstractInterpreter::layout_activation(Method* method,
-                                           int tempcount,
-                                           int popframe_extra_args,
-                                           int moncount,
-                                           int caller_actual_parameters,
-                                           int callee_param_count,
-                                           int callee_local_count,
-                                           frame* caller,
-                                           frame* interpreter_frame,
-                                           bool is_top_frame,
-                                           bool is_bottom_frame) {
+int AbstractInterpreter::size_activation(int max_stack,
+                                         int temps,
+                                         int extra_args,
+                                         int monitors,
+                                         int callee_params,
+                                         int callee_locals,
+                                         bool is_top_frame) {
   // Note: This calculation must exactly parallel the frame setup
   // in InterpreterGenerator::generate_fixed_frame.
-  // If f!=NULL, set up the following variables:
-  //   - Lmethod
-  //   - Llocals
-  //   - Lmonitors (to the indicated number of monitors)
-  //   - Lesp (to the indicated number of temps)
-  // The frame f (if not NULL) on entry is a description of the caller of the frame
-  // we are about to layout. We are guaranteed that we will be able to fill in a
-  // new interpreter frame as its callee (i.e. the stack space is allocated and
-  // the amount was determined by an earlier call to this method with f == NULL).
-  // On return f (if not NULL) while describe the interpreter frame we just layed out.
 
-  int monitor_size           = moncount * frame::interpreter_frame_monitor_size();
-  int rounded_vm_local_words = round_to(frame::interpreter_frame_vm_local_words,WordsPerLong);
+  int monitor_size           = monitors * frame::interpreter_frame_monitor_size();
 
   assert(monitor_size == round_to(monitor_size, WordsPerLong), "must align");
+
   //
   // Note: if you look closely this appears to be doing something much different
   // than generate_fixed_frame. What is happening is this. On sparc we have to do
@@ -1619,146 +1605,171 @@
   // there is no sense in messing working code.
   //
 
-  int rounded_cls = round_to((callee_local_count - callee_param_count), WordsPerLong);
+  int rounded_cls = round_to((callee_locals - callee_params), WordsPerLong);
   assert(rounded_cls == round_to(rounded_cls, WordsPerLong), "must align");
 
-  int raw_frame_size = size_activation_helper(rounded_cls, method->max_stack(),
-                                              monitor_size);
+  int raw_frame_size = size_activation_helper(rounded_cls, max_stack, monitor_size);
 
-  if (interpreter_frame != NULL) {
-    // The skeleton frame must already look like an interpreter frame
-    // even if not fully filled out.
-    assert(interpreter_frame->is_interpreted_frame(), "Must be interpreted frame");
+  return raw_frame_size;
+}
 
-    intptr_t* fp = interpreter_frame->fp();
+void AbstractInterpreter::layout_activation(Method* method,
+                                            int tempcount,
+                                            int popframe_extra_args,
+                                            int moncount,
+                                            int caller_actual_parameters,
+                                            int callee_param_count,
+                                            int callee_local_count,
+                                            frame* caller,
+                                            frame* interpreter_frame,
+                                            bool is_top_frame,
+                                            bool is_bottom_frame) {
+  // Set up the following variables:
+  //   - Lmethod
+  //   - Llocals
+  //   - Lmonitors (to the indicated number of monitors)
+  //   - Lesp (to the indicated number of temps)
+  // The frame caller on entry is a description of the caller of the
+  // frame we are about to layout. We are guaranteed that we will be
+  // able to fill in a new interpreter frame as its callee (i.e. the
+  // stack space is allocated and the amount was determined by an
+  // earlier call to the size_activation() method).  On return caller
+  // while describe the interpreter frame we just layed out.
 
-    JavaThread* thread = JavaThread::current();
-    RegisterMap map(thread, false);
-    // More verification that skeleton frame is properly walkable
-    assert(fp == caller->sp(), "fp must match");
+  // The skeleton frame must already look like an interpreter frame
+  // even if not fully filled out.
+  assert(interpreter_frame->is_interpreted_frame(), "Must be interpreted frame");
 
-    intptr_t* montop     = fp - rounded_vm_local_words;
+  int rounded_vm_local_words = round_to(frame::interpreter_frame_vm_local_words,WordsPerLong);
+  int monitor_size           = moncount * frame::interpreter_frame_monitor_size();
+  assert(monitor_size == round_to(monitor_size, WordsPerLong), "must align");
 
-    // preallocate monitors (cf. __ add_monitor_to_stack)
-    intptr_t* monitors = montop - monitor_size;
+  intptr_t* fp = interpreter_frame->fp();
 
-    // preallocate stack space
-    intptr_t*  esp = monitors - 1 -
-                     (tempcount * Interpreter::stackElementWords) -
-                     popframe_extra_args;
+  JavaThread* thread = JavaThread::current();
+  RegisterMap map(thread, false);
+  // More verification that skeleton frame is properly walkable
+  assert(fp == caller->sp(), "fp must match");
 
-    int local_words = method->max_locals() * Interpreter::stackElementWords;
-    NEEDS_CLEANUP;
-    intptr_t* locals;
-    if (caller->is_interpreted_frame()) {
-      // Can force the locals area to end up properly overlapping the top of the expression stack.
-      intptr_t* Lesp_ptr = caller->interpreter_frame_tos_address() - 1;
-      // Note that this computation means we replace size_of_parameters() values from the caller
-      // interpreter frame's expression stack with our argument locals
-      int parm_words  = caller_actual_parameters * Interpreter::stackElementWords;
-      locals = Lesp_ptr + parm_words;
-      int delta = local_words - parm_words;
-      int computed_sp_adjustment = (delta > 0) ? round_to(delta, WordsPerLong) : 0;
-      *interpreter_frame->register_addr(I5_savedSP)    = (intptr_t) (fp + computed_sp_adjustment) - STACK_BIAS;
-      if (!is_bottom_frame) {
-        // Llast_SP is set below for the current frame to SP (with the
-        // extra space for the callee's locals). Here we adjust
-        // Llast_SP for the caller's frame, removing the extra space
-        // for the current method's locals.
-        *caller->register_addr(Llast_SP) = *interpreter_frame->register_addr(I5_savedSP);
-      } else {
-        assert(*caller->register_addr(Llast_SP) >= *interpreter_frame->register_addr(I5_savedSP), "strange Llast_SP");
-      }
+  intptr_t* montop     = fp - rounded_vm_local_words;
+
+  // preallocate monitors (cf. __ add_monitor_to_stack)
+  intptr_t* monitors = montop - monitor_size;
+
+  // preallocate stack space
+  intptr_t*  esp = monitors - 1 -
+    (tempcount * Interpreter::stackElementWords) -
+    popframe_extra_args;
+
+  int local_words = method->max_locals() * Interpreter::stackElementWords;
+  NEEDS_CLEANUP;
+  intptr_t* locals;
+  if (caller->is_interpreted_frame()) {
+    // Can force the locals area to end up properly overlapping the top of the expression stack.
+    intptr_t* Lesp_ptr = caller->interpreter_frame_tos_address() - 1;
+    // Note that this computation means we replace size_of_parameters() values from the caller
+    // interpreter frame's expression stack with our argument locals
+    int parm_words  = caller_actual_parameters * Interpreter::stackElementWords;
+    locals = Lesp_ptr + parm_words;
+    int delta = local_words - parm_words;
+    int computed_sp_adjustment = (delta > 0) ? round_to(delta, WordsPerLong) : 0;
+    *interpreter_frame->register_addr(I5_savedSP)    = (intptr_t) (fp + computed_sp_adjustment) - STACK_BIAS;
+    if (!is_bottom_frame) {
+      // Llast_SP is set below for the current frame to SP (with the
+      // extra space for the callee's locals). Here we adjust
+      // Llast_SP for the caller's frame, removing the extra space
+      // for the current method's locals.
+      *caller->register_addr(Llast_SP) = *interpreter_frame->register_addr(I5_savedSP);
     } else {
-      assert(caller->is_compiled_frame() || caller->is_entry_frame(), "only possible cases");
-      // Don't have Lesp available; lay out locals block in the caller
-      // adjacent to the register window save area.
-      //
-      // Compiled frames do not allocate a varargs area which is why this if
-      // statement is needed.
-      //
-      if (caller->is_compiled_frame()) {
-        locals = fp + frame::register_save_words + local_words - 1;
-      } else {
-        locals = fp + frame::memory_parameter_word_sp_offset + local_words - 1;
-      }
-      if (!caller->is_entry_frame()) {
-        // Caller wants his own SP back
-        int caller_frame_size = caller->cb()->frame_size();
-        *interpreter_frame->register_addr(I5_savedSP) = (intptr_t)(caller->fp() - caller_frame_size) - STACK_BIAS;
+      assert(*caller->register_addr(Llast_SP) >= *interpreter_frame->register_addr(I5_savedSP), "strange Llast_SP");
+    }
+  } else {
+    assert(caller->is_compiled_frame() || caller->is_entry_frame(), "only possible cases");
+    // Don't have Lesp available; lay out locals block in the caller
+    // adjacent to the register window save area.
+    //
+    // Compiled frames do not allocate a varargs area which is why this if
+    // statement is needed.
+    //
+    if (caller->is_compiled_frame()) {
+      locals = fp + frame::register_save_words + local_words - 1;
+    } else {
+      locals = fp + frame::memory_parameter_word_sp_offset + local_words - 1;
+    }
+    if (!caller->is_entry_frame()) {
+      // Caller wants his own SP back
+      int caller_frame_size = caller->cb()->frame_size();
+      *interpreter_frame->register_addr(I5_savedSP) = (intptr_t)(caller->fp() - caller_frame_size) - STACK_BIAS;
+    }
+  }
+  if (TraceDeoptimization) {
+    if (caller->is_entry_frame()) {
+      // make sure I5_savedSP and the entry frames notion of saved SP
+      // agree.  This assertion duplicate a check in entry frame code
+      // but catches the failure earlier.
+      assert(*caller->register_addr(Lscratch) == *interpreter_frame->register_addr(I5_savedSP),
+             "would change callers SP");
+    }
+    if (caller->is_entry_frame()) {
+      tty->print("entry ");
+    }
+    if (caller->is_compiled_frame()) {
+      tty->print("compiled ");
+      if (caller->is_deoptimized_frame()) {
+        tty->print("(deopt) ");
       }
     }
-    if (TraceDeoptimization) {
-      if (caller->is_entry_frame()) {
-        // make sure I5_savedSP and the entry frames notion of saved SP
-        // agree.  This assertion duplicate a check in entry frame code
-        // but catches the failure earlier.
-        assert(*caller->register_addr(Lscratch) == *interpreter_frame->register_addr(I5_savedSP),
-               "would change callers SP");
-      }
-      if (caller->is_entry_frame()) {
-        tty->print("entry ");
-      }
-      if (caller->is_compiled_frame()) {
-        tty->print("compiled ");
-        if (caller->is_deoptimized_frame()) {
-          tty->print("(deopt) ");
-        }
-      }
-      if (caller->is_interpreted_frame()) {
-        tty->print("interpreted ");
-      }
-      tty->print_cr("caller fp=0x%x sp=0x%x", caller->fp(), caller->sp());
-      tty->print_cr("save area = 0x%x, 0x%x", caller->sp(), caller->sp() + 16);
-      tty->print_cr("save area = 0x%x, 0x%x", caller->fp(), caller->fp() + 16);
-      tty->print_cr("interpreter fp=0x%x sp=0x%x", interpreter_frame->fp(), interpreter_frame->sp());
-      tty->print_cr("save area = 0x%x, 0x%x", interpreter_frame->sp(), interpreter_frame->sp() + 16);
-      tty->print_cr("save area = 0x%x, 0x%x", interpreter_frame->fp(), interpreter_frame->fp() + 16);
-      tty->print_cr("Llocals = 0x%x", locals);
-      tty->print_cr("Lesp = 0x%x", esp);
-      tty->print_cr("Lmonitors = 0x%x", monitors);
+    if (caller->is_interpreted_frame()) {
+      tty->print("interpreted ");
     }
+    tty->print_cr("caller fp=0x%x sp=0x%x", caller->fp(), caller->sp());
+    tty->print_cr("save area = 0x%x, 0x%x", caller->sp(), caller->sp() + 16);
+    tty->print_cr("save area = 0x%x, 0x%x", caller->fp(), caller->fp() + 16);
+    tty->print_cr("interpreter fp=0x%x sp=0x%x", interpreter_frame->fp(), interpreter_frame->sp());
+    tty->print_cr("save area = 0x%x, 0x%x", interpreter_frame->sp(), interpreter_frame->sp() + 16);
+    tty->print_cr("save area = 0x%x, 0x%x", interpreter_frame->fp(), interpreter_frame->fp() + 16);
+    tty->print_cr("Llocals = 0x%x", locals);
+    tty->print_cr("Lesp = 0x%x", esp);
+    tty->print_cr("Lmonitors = 0x%x", monitors);
+  }
 
-    if (method->max_locals() > 0) {
-      assert(locals < caller->sp() || locals >= (caller->sp() + 16), "locals in save area");
-      assert(locals < caller->fp() || locals > (caller->fp() + 16), "locals in save area");
-      assert(locals < interpreter_frame->sp() || locals > (interpreter_frame->sp() + 16), "locals in save area");
-      assert(locals < interpreter_frame->fp() || locals >= (interpreter_frame->fp() + 16), "locals in save area");
-    }
+  if (method->max_locals() > 0) {
+    assert(locals < caller->sp() || locals >= (caller->sp() + 16), "locals in save area");
+    assert(locals < caller->fp() || locals > (caller->fp() + 16), "locals in save area");
+    assert(locals < interpreter_frame->sp() || locals > (interpreter_frame->sp() + 16), "locals in save area");
+    assert(locals < interpreter_frame->fp() || locals >= (interpreter_frame->fp() + 16), "locals in save area");
+  }
 #ifdef _LP64
-    assert(*interpreter_frame->register_addr(I5_savedSP) & 1, "must be odd");
+  assert(*interpreter_frame->register_addr(I5_savedSP) & 1, "must be odd");
 #endif
 
-    *interpreter_frame->register_addr(Lmethod)     = (intptr_t) method;
-    *interpreter_frame->register_addr(Llocals)     = (intptr_t) locals;
-    *interpreter_frame->register_addr(Lmonitors)   = (intptr_t) monitors;
-    *interpreter_frame->register_addr(Lesp)        = (intptr_t) esp;
-    // Llast_SP will be same as SP as there is no adapter space
-    *interpreter_frame->register_addr(Llast_SP)    = (intptr_t) interpreter_frame->sp() - STACK_BIAS;
-    *interpreter_frame->register_addr(LcpoolCache) = (intptr_t) method->constants()->cache();
+  *interpreter_frame->register_addr(Lmethod)     = (intptr_t) method;
+  *interpreter_frame->register_addr(Llocals)     = (intptr_t) locals;
+  *interpreter_frame->register_addr(Lmonitors)   = (intptr_t) monitors;
+  *interpreter_frame->register_addr(Lesp)        = (intptr_t) esp;
+  // Llast_SP will be same as SP as there is no adapter space
+  *interpreter_frame->register_addr(Llast_SP)    = (intptr_t) interpreter_frame->sp() - STACK_BIAS;
+  *interpreter_frame->register_addr(LcpoolCache) = (intptr_t) method->constants()->cache();
 #ifdef FAST_DISPATCH
-    *interpreter_frame->register_addr(IdispatchTables) = (intptr_t) Interpreter::dispatch_table();
+  *interpreter_frame->register_addr(IdispatchTables) = (intptr_t) Interpreter::dispatch_table();
 #endif
 
 
 #ifdef ASSERT
-    BasicObjectLock* mp = (BasicObjectLock*)monitors;
+  BasicObjectLock* mp = (BasicObjectLock*)monitors;
 
-    assert(interpreter_frame->interpreter_frame_method() == method, "method matches");
-    assert(interpreter_frame->interpreter_frame_local_at(9) == (intptr_t *)((intptr_t)locals - (9 * Interpreter::stackElementSize)), "locals match");
-    assert(interpreter_frame->interpreter_frame_monitor_end()   == mp, "monitor_end matches");
-    assert(((intptr_t *)interpreter_frame->interpreter_frame_monitor_begin()) == ((intptr_t *)mp)+monitor_size, "monitor_begin matches");
-    assert(interpreter_frame->interpreter_frame_tos_address()-1 == esp, "esp matches");
+  assert(interpreter_frame->interpreter_frame_method() == method, "method matches");
+  assert(interpreter_frame->interpreter_frame_local_at(9) == (intptr_t *)((intptr_t)locals - (9 * Interpreter::stackElementSize)), "locals match");
+  assert(interpreter_frame->interpreter_frame_monitor_end()   == mp, "monitor_end matches");
+  assert(((intptr_t *)interpreter_frame->interpreter_frame_monitor_begin()) == ((intptr_t *)mp)+monitor_size, "monitor_begin matches");
+  assert(interpreter_frame->interpreter_frame_tos_address()-1 == esp, "esp matches");
 
-    // check bounds
-    intptr_t* lo = interpreter_frame->sp() + (frame::memory_parameter_word_sp_offset - 1);
-    intptr_t* hi = interpreter_frame->fp() - rounded_vm_local_words;
-    assert(lo < monitors && montop <= hi, "monitors in bounds");
-    assert(lo <= esp && esp < monitors, "esp in bounds");
+  // check bounds
+  intptr_t* lo = interpreter_frame->sp() + (frame::memory_parameter_word_sp_offset - 1);
+  intptr_t* hi = interpreter_frame->fp() - rounded_vm_local_words;
+  assert(lo < monitors && montop <= hi, "monitors in bounds");
+  assert(lo <= esp && esp < monitors, "esp in bounds");
 #endif // ASSERT
-  }
-
-  return raw_frame_size;
 }
 
 //----------------------------------------------------------------------------------------------------
diff --git a/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp b/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp
index d6dff7b..b9702a3 100644
--- a/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp
+++ b/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp
@@ -288,7 +288,7 @@
 
   // build frame
   ciMethod* m = compilation()->method();
-  __ build_frame(initial_frame_size_in_bytes());
+  __ build_frame(initial_frame_size_in_bytes(), bang_size_in_bytes());
 
   // OSR buffer is
   //
@@ -376,7 +376,7 @@
 }
 
 // This specifies the rsp decrement needed to build the frame
-int LIR_Assembler::initial_frame_size_in_bytes() {
+int LIR_Assembler::initial_frame_size_in_bytes() const {
   // if rounding, must let FrameMap know!
 
   // The frame_map records size in slots (32bit word)
diff --git a/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp b/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp
index 0aeb8d7..9dfb279 100644
--- a/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp
+++ b/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp
@@ -349,13 +349,14 @@
 }
 
 
-void C1_MacroAssembler::build_frame(int frame_size_in_bytes) {
+void C1_MacroAssembler::build_frame(int frame_size_in_bytes, int bang_size_in_bytes) {
+  assert(bang_size_in_bytes >= frame_size_in_bytes, "stack bang size incorrect");
   // Make sure there is enough stack space for this method's activation.
   // Note that we do this before doing an enter(). This matches the
   // ordering of C2's stack overflow check / rsp decrement and allows
   // the SharedRuntime stack overflow handling to be consistent
   // between the two compilers.
-  generate_stack_overflow_check(frame_size_in_bytes);
+  generate_stack_overflow_check(bang_size_in_bytes);
 
   push(rbp);
 #ifdef TIERED
diff --git a/hotspot/src/cpu/x86/vm/cppInterpreter_x86.cpp b/hotspot/src/cpu/x86/vm/cppInterpreter_x86.cpp
index 4af338f..9eb1a6e 100644
--- a/hotspot/src/cpu/x86/vm/cppInterpreter_x86.cpp
+++ b/hotspot/src/cpu/x86/vm/cppInterpreter_x86.cpp
@@ -2342,29 +2342,42 @@
          "Stack top out of range");
 }
 
-int AbstractInterpreter::layout_activation(Method* method,
-                                           int tempcount,  //
-                                           int popframe_extra_args,
-                                           int moncount,
-                                           int caller_actual_parameters,
-                                           int callee_param_count,
-                                           int callee_locals,
-                                           frame* caller,
-                                           frame* interpreter_frame,
-                                           bool is_top_frame,
-                                           bool is_bottom_frame) {
 
-  assert(popframe_extra_args == 0, "FIX ME");
-  // NOTE this code must exactly mimic what InterpreterGenerator::generate_compute_interpreter_state()
-  // does as far as allocating an interpreter frame.
-  // If interpreter_frame!=NULL, set up the method, locals, and monitors.
-  // The frame interpreter_frame, if not NULL, is guaranteed to be the right size,
-  // as determined by a previous call to this method.
-  // It is also guaranteed to be walkable even though it is in a skeletal state
+static int frame_size_helper(int max_stack,
+                             int tempcount,
+                             int moncount,
+                             int callee_param_count,
+                             int callee_locals,
+                             bool is_top_frame,
+                             int& monitor_size,
+                             int& full_frame_size) {
+  int extra_locals_size = (callee_locals - callee_param_count) * BytesPerWord;
+  monitor_size = sizeof(BasicObjectLock) * moncount;
+
+  // First calculate the frame size without any java expression stack
+  int short_frame_size = size_activation_helper(extra_locals_size,
+                                                monitor_size);
+
+  // Now with full size expression stack
+  full_frame_size = short_frame_size + max_stack * BytesPerWord;
+
+  // and now with only live portion of the expression stack
+  short_frame_size = short_frame_size + tempcount * BytesPerWord;
+
+  // the size the activation is right now. Only top frame is full size
+  int frame_size = (is_top_frame ? full_frame_size : short_frame_size);
+  return frame_size;
+}
+
+int AbstractInterpreter::size_activation(int max_stack,
+                                         int tempcount,
+                                         int extra_args,
+                                         int moncount,
+                                         int callee_param_count,
+                                         int callee_locals,
+                                         bool is_top_frame) {
+  assert(extra_args == 0, "FIX ME");
   // NOTE: return size is in words not bytes
-  // NOTE: tempcount is the current size of the java expression stack. For top most
-  //       frames we will allocate a full sized expression stack and not the curback
-  //       version that non-top frames have.
 
   // Calculate the amount our frame will be adjust by the callee. For top frame
   // this is zero.
@@ -2374,87 +2387,102 @@
   // to it. So it ignores last_frame_adjust value. Seems suspicious as far
   // as getting sender_sp correct.
 
-  int extra_locals_size = (callee_locals - callee_param_count) * BytesPerWord;
-  int monitor_size = sizeof(BasicObjectLock) * moncount;
+  int unused_monitor_size = 0;
+  int unused_full_frame_size = 0;
+  return frame_size_helper(max_stack, tempcount, moncount, callee_param_count, callee_locals,
+                           is_top_frame, unused_monitor_size, unused_full_frame_size)/BytesPerWord;
+}
 
-  // First calculate the frame size without any java expression stack
-  int short_frame_size = size_activation_helper(extra_locals_size,
-                                                monitor_size);
+void AbstractInterpreter::layout_activation(Method* method,
+                                            int tempcount,  //
+                                            int popframe_extra_args,
+                                            int moncount,
+                                            int caller_actual_parameters,
+                                            int callee_param_count,
+                                            int callee_locals,
+                                            frame* caller,
+                                            frame* interpreter_frame,
+                                            bool is_top_frame,
+                                            bool is_bottom_frame) {
 
-  // Now with full size expression stack
-  int full_frame_size = short_frame_size + method->max_stack() * BytesPerWord;
+  assert(popframe_extra_args == 0, "FIX ME");
+  // NOTE this code must exactly mimic what InterpreterGenerator::generate_compute_interpreter_state()
+  // does as far as allocating an interpreter frame.
+  // Set up the method, locals, and monitors.
+  // The frame interpreter_frame is guaranteed to be the right size,
+  // as determined by a previous call to the size_activation() method.
+  // It is also guaranteed to be walkable even though it is in a skeletal state
+  // NOTE: tempcount is the current size of the java expression stack. For top most
+  //       frames we will allocate a full sized expression stack and not the curback
+  //       version that non-top frames have.
 
-  // and now with only live portion of the expression stack
-  short_frame_size = short_frame_size + tempcount * BytesPerWord;
+  int monitor_size = 0;
+  int full_frame_size = 0;
+  int frame_size = frame_size_helper(method->max_stack(), tempcount, moncount, callee_param_count, callee_locals,
+                                     is_top_frame, monitor_size, full_frame_size);
 
-  // the size the activation is right now. Only top frame is full size
-  int frame_size = (is_top_frame ? full_frame_size : short_frame_size);
-
-  if (interpreter_frame != NULL) {
 #ifdef ASSERT
-    assert(caller->unextended_sp() == interpreter_frame->interpreter_frame_sender_sp(), "Frame not properly walkable");
+  assert(caller->unextended_sp() == interpreter_frame->interpreter_frame_sender_sp(), "Frame not properly walkable");
 #endif
 
-    // MUCHO HACK
+  // MUCHO HACK
 
-    intptr_t* frame_bottom = (intptr_t*) ((intptr_t)interpreter_frame->sp() - (full_frame_size - frame_size));
+  intptr_t* frame_bottom = (intptr_t*) ((intptr_t)interpreter_frame->sp() - (full_frame_size - frame_size));
 
-    /* Now fillin the interpreterState object */
+  /* Now fillin the interpreterState object */
 
-    // The state object is the first thing on the frame and easily located
+  // The state object is the first thing on the frame and easily located
 
-    interpreterState cur_state = (interpreterState) ((intptr_t)interpreter_frame->fp() - sizeof(BytecodeInterpreter));
+  interpreterState cur_state = (interpreterState) ((intptr_t)interpreter_frame->fp() - sizeof(BytecodeInterpreter));
 
 
-    // Find the locals pointer. This is rather simple on x86 because there is no
-    // confusing rounding at the callee to account for. We can trivially locate
-    // our locals based on the current fp().
-    // Note: the + 2 is for handling the "static long no_params() method" issue.
-    // (too bad I don't really remember that issue well...)
+  // Find the locals pointer. This is rather simple on x86 because there is no
+  // confusing rounding at the callee to account for. We can trivially locate
+  // our locals based on the current fp().
+  // Note: the + 2 is for handling the "static long no_params() method" issue.
+  // (too bad I don't really remember that issue well...)
 
-    intptr_t* locals;
-    // If the caller is interpreted we need to make sure that locals points to the first
-    // argument that the caller passed and not in an area where the stack might have been extended.
-    // because the stack to stack to converter needs a proper locals value in order to remove the
-    // arguments from the caller and place the result in the proper location. Hmm maybe it'd be
-    // simpler if we simply stored the result in the BytecodeInterpreter object and let the c++ code
-    // adjust the stack?? HMMM QQQ
-    //
-    if (caller->is_interpreted_frame()) {
-      // locals must agree with the caller because it will be used to set the
-      // caller's tos when we return.
-      interpreterState prev  = caller->get_interpreterState();
-      // stack() is prepushed.
-      locals = prev->stack() + method->size_of_parameters();
-      // locals = caller->unextended_sp() + (method->size_of_parameters() - 1);
-      if (locals != interpreter_frame->fp() + frame::sender_sp_offset + (method->max_locals() - 1) + 2) {
-        // os::breakpoint();
-      }
-    } else {
-      // this is where a c2i would have placed locals (except for the +2)
-      locals = interpreter_frame->fp() + frame::sender_sp_offset + (method->max_locals() - 1) + 2;
+  intptr_t* locals;
+  // If the caller is interpreted we need to make sure that locals points to the first
+  // argument that the caller passed and not in an area where the stack might have been extended.
+  // because the stack to stack to converter needs a proper locals value in order to remove the
+  // arguments from the caller and place the result in the proper location. Hmm maybe it'd be
+  // simpler if we simply stored the result in the BytecodeInterpreter object and let the c++ code
+  // adjust the stack?? HMMM QQQ
+  //
+  if (caller->is_interpreted_frame()) {
+    // locals must agree with the caller because it will be used to set the
+    // caller's tos when we return.
+    interpreterState prev  = caller->get_interpreterState();
+    // stack() is prepushed.
+    locals = prev->stack() + method->size_of_parameters();
+    // locals = caller->unextended_sp() + (method->size_of_parameters() - 1);
+    if (locals != interpreter_frame->fp() + frame::sender_sp_offset + (method->max_locals() - 1) + 2) {
+      // os::breakpoint();
     }
-
-    intptr_t* monitor_base = (intptr_t*) cur_state;
-    intptr_t* stack_base = (intptr_t*) ((intptr_t) monitor_base - monitor_size);
-    /* +1 because stack is always prepushed */
-    intptr_t* stack = (intptr_t*) ((intptr_t) stack_base - (tempcount + 1) * BytesPerWord);
-
-
-    BytecodeInterpreter::layout_interpreterState(cur_state,
-                                          caller,
-                                          interpreter_frame,
-                                          method,
-                                          locals,
-                                          stack,
-                                          stack_base,
-                                          monitor_base,
-                                          frame_bottom,
-                                          is_top_frame);
-
-    // BytecodeInterpreter::pd_layout_interpreterState(cur_state, interpreter_return_address, interpreter_frame->fp());
+  } else {
+    // this is where a c2i would have placed locals (except for the +2)
+    locals = interpreter_frame->fp() + frame::sender_sp_offset + (method->max_locals() - 1) + 2;
   }
-  return frame_size/BytesPerWord;
+
+  intptr_t* monitor_base = (intptr_t*) cur_state;
+  intptr_t* stack_base = (intptr_t*) ((intptr_t) monitor_base - monitor_size);
+  /* +1 because stack is always prepushed */
+  intptr_t* stack = (intptr_t*) ((intptr_t) stack_base - (tempcount + 1) * BytesPerWord);
+
+
+  BytecodeInterpreter::layout_interpreterState(cur_state,
+                                               caller,
+                                               interpreter_frame,
+                                               method,
+                                               locals,
+                                               stack,
+                                               stack_base,
+                                               monitor_base,
+                                               frame_bottom,
+                                               is_top_frame);
+
+  // BytecodeInterpreter::pd_layout_interpreterState(cur_state, interpreter_return_address, interpreter_frame->fp());
 }
 
 bool AbstractInterpreter::can_be_compiled(methodHandle m) {
diff --git a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp
index 406c990..47b6a9c 100644
--- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp
+++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp
@@ -1051,7 +1051,7 @@
   // was post-decremented.)  Skip this address by starting at i=1, and
   // touch a few more pages below.  N.B.  It is important to touch all
   // the way down to and including i=StackShadowPages.
-  for (int i = 1; i <= StackShadowPages; i++) {
+  for (int i = 1; i < StackShadowPages; i++) {
     // this could be any sized move but this is can be a debugging crumb
     // so the bigger the better.
     movptr(Address(tmp, (-i*os::vm_page_size())), size );
@@ -6093,7 +6093,7 @@
 
 
 // C2 compiled method's prolog code.
-void MacroAssembler::verified_entry(int framesize, bool stack_bang, bool fp_mode_24b) {
+void MacroAssembler::verified_entry(int framesize, int stack_bang_size, bool fp_mode_24b) {
 
   // WARNING: Initial instruction MUST be 5 bytes or longer so that
   // NativeJump::patch_verified_entry will be able to patch out the entry
@@ -6101,18 +6101,20 @@
   // the frame allocation can be either 3 or 6 bytes. So if we don't do
   // stack bang then we must use the 6 byte frame allocation even if
   // we have no frame. :-(
+  assert(stack_bang_size >= framesize || stack_bang_size <= 0, "stack bang size incorrect");
 
   assert((framesize & (StackAlignmentInBytes-1)) == 0, "frame size not aligned");
   // Remove word for return addr
   framesize -= wordSize;
+  stack_bang_size -= wordSize;
 
   // Calls to C2R adapters often do not accept exceptional returns.
   // We require that their callers must bang for them.  But be careful, because
   // some VM calls (such as call site linkage) can use several kilobytes of
   // stack.  But the stack safety zone should account for that.
   // See bugs 4446381, 4468289, 4497237.
-  if (stack_bang) {
-    generate_stack_overflow_check(framesize);
+  if (stack_bang_size > 0) {
+    generate_stack_overflow_check(stack_bang_size);
 
     // We always push rbp, so that on return to interpreter rbp, will be
     // restored correctly and we can correct the stack.
diff --git a/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp b/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp
index e154ae8..3d88026 100644
--- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp
+++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp
@@ -1170,7 +1170,7 @@
   void movl2ptr(Register dst, Register src) { LP64_ONLY(movslq(dst, src)) NOT_LP64(if (dst != src) movl(dst, src)); }
 
   // C2 compiled method's prolog code.
-  void verified_entry(int framesize, bool stack_bang, bool fp_mode_24b);
+  void verified_entry(int framesize, int stack_bang_size, bool fp_mode_24b);
 
   // clear memory of size 'cnt' qwords, starting at 'base'.
   void clear_mem(Register base, Register cnt, Register rtmp);
diff --git a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp
index f3dbdd9..c97b430 100644
--- a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp
+++ b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp
@@ -3014,11 +3014,15 @@
   // restore rbp before stack bang because if stack overflow is thrown it needs to be pushed (and preserved)
   __ movptr(rbp, Address(rdi, Deoptimization::UnrollBlock::initial_info_offset_in_bytes()));
 
-  // Stack bang to make sure there's enough room for these interpreter frames.
+#ifdef ASSERT
+  // Compilers generate code that bang the stack by as much as the
+  // interpreter would need. So this stack banging should never
+  // trigger a fault. Verify that it does not on non product builds.
   if (UseStackBanging) {
     __ movl(rbx, Address(rdi ,Deoptimization::UnrollBlock::total_frame_sizes_offset_in_bytes()));
     __ bang_stack_size(rbx, rcx);
   }
+#endif
 
   // Load array of frame pcs into ECX
   __ movptr(rcx,Address(rdi,Deoptimization::UnrollBlock::frame_pcs_offset_in_bytes()));
@@ -3240,12 +3244,15 @@
   // restore rbp before stack bang because if stack overflow is thrown it needs to be pushed (and preserved)
   __ movptr(rbp, Address(rdi, Deoptimization::UnrollBlock::initial_info_offset_in_bytes()));
 
-  // Stack bang to make sure there's enough room for these interpreter frames.
+#ifdef ASSERT
+  // Compilers generate code that bang the stack by as much as the
+  // interpreter would need. So this stack banging should never
+  // trigger a fault. Verify that it does not on non product builds.
   if (UseStackBanging) {
     __ movl(rbx, Address(rdi ,Deoptimization::UnrollBlock::total_frame_sizes_offset_in_bytes()));
     __ bang_stack_size(rbx, rcx);
   }
-
+#endif
 
   // Load array of frame pcs into ECX
   __ movl(rcx,Address(rdi,Deoptimization::UnrollBlock::frame_pcs_offset_in_bytes()));
diff --git a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp
index 5482cf6..be2bfcf 100644
--- a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp
+++ b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp
@@ -3484,11 +3484,15 @@
   // restore rbp before stack bang because if stack overflow is thrown it needs to be pushed (and preserved)
   __ movptr(rbp, Address(rdi, Deoptimization::UnrollBlock::initial_info_offset_in_bytes()));
 
-  // Stack bang to make sure there's enough room for these interpreter frames.
+#ifdef ASSERT
+  // Compilers generate code that bang the stack by as much as the
+  // interpreter would need. So this stack banging should never
+  // trigger a fault. Verify that it does not on non product builds.
   if (UseStackBanging) {
     __ movl(rbx, Address(rdi, Deoptimization::UnrollBlock::total_frame_sizes_offset_in_bytes()));
     __ bang_stack_size(rbx, rcx);
   }
+#endif
 
   // Load address of array of frame pcs into rcx
   __ movptr(rcx, Address(rdi, Deoptimization::UnrollBlock::frame_pcs_offset_in_bytes()));
@@ -3682,11 +3686,15 @@
   // restore rbp before stack bang because if stack overflow is thrown it needs to be pushed (and preserved)
   __ movptr(rbp, Address(rdi, Deoptimization::UnrollBlock::initial_info_offset_in_bytes()));
 
-  // Stack bang to make sure there's enough room for these interpreter frames.
+#ifdef ASSERT
+  // Compilers generate code that bang the stack by as much as the
+  // interpreter would need. So this stack banging should never
+  // trigger a fault. Verify that it does not on non product builds.
   if (UseStackBanging) {
     __ movl(rbx, Address(rdi ,Deoptimization::UnrollBlock::total_frame_sizes_offset_in_bytes()));
     __ bang_stack_size(rbx, rcx);
   }
+#endif
 
   // Load address of array of frame pcs into rcx (address*)
   __ movptr(rcx, Address(rdi, Deoptimization::UnrollBlock::frame_pcs_offset_in_bytes()));
diff --git a/hotspot/src/cpu/x86/vm/templateInterpreter_x86.cpp b/hotspot/src/cpu/x86/vm/templateInterpreter_x86.cpp
new file mode 100644
index 0000000..e470aa6
--- /dev/null
+++ b/hotspot/src/cpu/x86/vm/templateInterpreter_x86.cpp
@@ -0,0 +1,124 @@
+/*
+ * 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.
+ *
+ * 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.
+ *
+ */
+
+#include "precompiled.hpp"
+#include "ci/ciMethod.hpp"
+#include "interpreter/interpreter.hpp"
+#include "runtime/frame.inline.hpp"
+
+#ifndef CC_INTERP
+
+// asm based interpreter deoptimization helpers
+int AbstractInterpreter::size_activation(int max_stack,
+                                         int temps,
+                                         int extra_args,
+                                         int monitors,
+                                         int callee_params,
+                                         int callee_locals,
+                                         bool is_top_frame) {
+  // Note: This calculation must exactly parallel the frame setup
+  // in AbstractInterpreterGenerator::generate_method_entry.
+
+  // fixed size of an interpreter frame:
+  int overhead = frame::sender_sp_offset -
+                 frame::interpreter_frame_initial_sp_offset;
+  // Our locals were accounted for by the caller (or last_frame_adjust
+  // on the transistion) Since the callee parameters already account
+  // for the callee's params we only need to account for the extra
+  // locals.
+  int size = overhead +
+         (callee_locals - callee_params)*Interpreter::stackElementWords +
+         monitors * frame::interpreter_frame_monitor_size() +
+         temps* Interpreter::stackElementWords + extra_args;
+
+  return size;
+}
+
+void AbstractInterpreter::layout_activation(Method* method,
+                                            int tempcount,
+                                            int popframe_extra_args,
+                                            int moncount,
+                                            int caller_actual_parameters,
+                                            int callee_param_count,
+                                            int callee_locals,
+                                            frame* caller,
+                                            frame* interpreter_frame,
+                                            bool is_top_frame,
+                                            bool is_bottom_frame) {
+  // The frame interpreter_frame is guaranteed to be the right size,
+  // as determined by a previous call to the size_activation() method.
+  // It is also guaranteed to be walkable even though it is in a
+  // skeletal state
+
+  int max_locals = method->max_locals() * Interpreter::stackElementWords;
+  int extra_locals = (method->max_locals() - method->size_of_parameters()) *
+    Interpreter::stackElementWords;
+
+#ifdef ASSERT
+  if (!EnableInvokeDynamic) {
+    // @@@ FIXME: Should we correct interpreter_frame_sender_sp in the calling sequences?
+    // Probably, since deoptimization doesn't work yet.
+    assert(caller->unextended_sp() == interpreter_frame->interpreter_frame_sender_sp(), "Frame not properly walkable");
+  }
+  assert(caller->sp() == interpreter_frame->sender_sp(), "Frame not properly walkable(2)");
+#endif
+
+  interpreter_frame->interpreter_frame_set_method(method);
+  // NOTE the difference in using sender_sp and
+  // interpreter_frame_sender_sp interpreter_frame_sender_sp is
+  // the original sp of the caller (the unextended_sp) and
+  // sender_sp is fp+8/16 (32bit/64bit) XXX
+  intptr_t* locals = interpreter_frame->sender_sp() + max_locals - 1;
+
+#ifdef ASSERT
+  if (caller->is_interpreted_frame()) {
+    assert(locals < caller->fp() + frame::interpreter_frame_initial_sp_offset, "bad placement");
+  }
+#endif
+
+  interpreter_frame->interpreter_frame_set_locals(locals);
+  BasicObjectLock* montop = interpreter_frame->interpreter_frame_monitor_begin();
+  BasicObjectLock* monbot = montop - moncount;
+  interpreter_frame->interpreter_frame_set_monitor_end(monbot);
+
+  // Set last_sp
+  intptr_t*  esp = (intptr_t*) monbot -
+    tempcount*Interpreter::stackElementWords -
+    popframe_extra_args;
+  interpreter_frame->interpreter_frame_set_last_sp(esp);
+
+  // All frames but the initial (oldest) interpreter frame we fill in have
+  // a value for sender_sp that allows walking the stack but isn't
+  // truly correct. Correct the value here.
+  if (extra_locals != 0 &&
+      interpreter_frame->sender_sp() ==
+      interpreter_frame->interpreter_frame_sender_sp()) {
+    interpreter_frame->set_interpreter_frame_sender_sp(caller->sp() +
+                                                       extra_locals);
+  }
+  *interpreter_frame->interpreter_frame_cache_addr() =
+    method->constants()->cache();
+}
+
+#endif // CC_INTERP
diff --git a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp
index 8051e15..d7f85cf 100644
--- a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp
+++ b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp
@@ -1686,91 +1686,6 @@
   return overhead_size + method_stack + stub_code;
 }
 
-// asm based interpreter deoptimization helpers
-
-int AbstractInterpreter::layout_activation(Method* method,
-                                           int tempcount,
-                                           int popframe_extra_args,
-                                           int moncount,
-                                           int caller_actual_parameters,
-                                           int callee_param_count,
-                                           int callee_locals,
-                                           frame* caller,
-                                           frame* interpreter_frame,
-                                           bool is_top_frame,
-                                           bool is_bottom_frame) {
-  // Note: This calculation must exactly parallel the frame setup
-  // in AbstractInterpreterGenerator::generate_method_entry.
-  // If interpreter_frame!=NULL, set up the method, locals, and monitors.
-  // The frame interpreter_frame, if not NULL, is guaranteed to be the right size,
-  // as determined by a previous call to this method.
-  // It is also guaranteed to be walkable even though it is in a skeletal state
-  // NOTE: return size is in words not bytes
-
-  // fixed size of an interpreter frame:
-  int max_locals = method->max_locals() * Interpreter::stackElementWords;
-  int extra_locals = (method->max_locals() - method->size_of_parameters()) *
-                     Interpreter::stackElementWords;
-
-  int overhead = frame::sender_sp_offset - frame::interpreter_frame_initial_sp_offset;
-
-  // Our locals were accounted for by the caller (or last_frame_adjust on the transistion)
-  // Since the callee parameters already account for the callee's params we only need to account for
-  // the extra locals.
-
-
-  int size = overhead +
-         ((callee_locals - callee_param_count)*Interpreter::stackElementWords) +
-         (moncount*frame::interpreter_frame_monitor_size()) +
-         tempcount*Interpreter::stackElementWords + popframe_extra_args;
-
-  if (interpreter_frame != NULL) {
-#ifdef ASSERT
-    if (!EnableInvokeDynamic)
-      // @@@ FIXME: Should we correct interpreter_frame_sender_sp in the calling sequences?
-      // Probably, since deoptimization doesn't work yet.
-      assert(caller->unextended_sp() == interpreter_frame->interpreter_frame_sender_sp(), "Frame not properly walkable");
-    assert(caller->sp() == interpreter_frame->sender_sp(), "Frame not properly walkable(2)");
-#endif
-
-    interpreter_frame->interpreter_frame_set_method(method);
-    // NOTE the difference in using sender_sp and interpreter_frame_sender_sp
-    // interpreter_frame_sender_sp is the original sp of the caller (the unextended_sp)
-    // and sender_sp is fp+8
-    intptr_t* locals = interpreter_frame->sender_sp() + max_locals - 1;
-
-#ifdef ASSERT
-    if (caller->is_interpreted_frame()) {
-      assert(locals < caller->fp() + frame::interpreter_frame_initial_sp_offset, "bad placement");
-    }
-#endif
-
-    interpreter_frame->interpreter_frame_set_locals(locals);
-    BasicObjectLock* montop = interpreter_frame->interpreter_frame_monitor_begin();
-    BasicObjectLock* monbot = montop - moncount;
-    interpreter_frame->interpreter_frame_set_monitor_end(monbot);
-
-    // Set last_sp
-    intptr_t*  rsp = (intptr_t*) monbot  -
-                     tempcount*Interpreter::stackElementWords -
-                     popframe_extra_args;
-    interpreter_frame->interpreter_frame_set_last_sp(rsp);
-
-    // All frames but the initial (oldest) interpreter frame we fill in have a
-    // value for sender_sp that allows walking the stack but isn't
-    // truly correct. Correct the value here.
-
-    if (extra_locals != 0 &&
-        interpreter_frame->sender_sp() == interpreter_frame->interpreter_frame_sender_sp() ) {
-      interpreter_frame->set_interpreter_frame_sender_sp(caller->sp() + extra_locals);
-    }
-    *interpreter_frame->interpreter_frame_cache_addr() =
-      method->constants()->cache();
-  }
-  return size;
-}
-
-
 //------------------------------------------------------------------------------------------------------------------------
 // Exceptions
 
diff --git a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp
index fb75ac9..652c706 100644
--- a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp
+++ b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp
@@ -1695,87 +1695,6 @@
   return (overhead_size + method_stack + stub_code);
 }
 
-int AbstractInterpreter::layout_activation(Method* method,
-                                           int tempcount,
-                                           int popframe_extra_args,
-                                           int moncount,
-                                           int caller_actual_parameters,
-                                           int callee_param_count,
-                                           int callee_locals,
-                                           frame* caller,
-                                           frame* interpreter_frame,
-                                           bool is_top_frame,
-                                           bool is_bottom_frame) {
-  // Note: This calculation must exactly parallel the frame setup
-  // in AbstractInterpreterGenerator::generate_method_entry.
-  // If interpreter_frame!=NULL, set up the method, locals, and monitors.
-  // The frame interpreter_frame, if not NULL, is guaranteed to be the
-  // right size, as determined by a previous call to this method.
-  // It is also guaranteed to be walkable even though it is in a skeletal state
-
-  // fixed size of an interpreter frame:
-  int max_locals = method->max_locals() * Interpreter::stackElementWords;
-  int extra_locals = (method->max_locals() - method->size_of_parameters()) *
-                     Interpreter::stackElementWords;
-
-  int overhead = frame::sender_sp_offset -
-                 frame::interpreter_frame_initial_sp_offset;
-  // Our locals were accounted for by the caller (or last_frame_adjust
-  // on the transistion) Since the callee parameters already account
-  // for the callee's params we only need to account for the extra
-  // locals.
-  int size = overhead +
-         (callee_locals - callee_param_count)*Interpreter::stackElementWords +
-         moncount * frame::interpreter_frame_monitor_size() +
-         tempcount* Interpreter::stackElementWords + popframe_extra_args;
-  if (interpreter_frame != NULL) {
-#ifdef ASSERT
-    if (!EnableInvokeDynamic)
-      // @@@ FIXME: Should we correct interpreter_frame_sender_sp in the calling sequences?
-      // Probably, since deoptimization doesn't work yet.
-      assert(caller->unextended_sp() == interpreter_frame->interpreter_frame_sender_sp(), "Frame not properly walkable");
-    assert(caller->sp() == interpreter_frame->sender_sp(), "Frame not properly walkable(2)");
-#endif
-
-    interpreter_frame->interpreter_frame_set_method(method);
-    // NOTE the difference in using sender_sp and
-    // interpreter_frame_sender_sp interpreter_frame_sender_sp is
-    // the original sp of the caller (the unextended_sp) and
-    // sender_sp is fp+16 XXX
-    intptr_t* locals = interpreter_frame->sender_sp() + max_locals - 1;
-
-#ifdef ASSERT
-    if (caller->is_interpreted_frame()) {
-      assert(locals < caller->fp() + frame::interpreter_frame_initial_sp_offset, "bad placement");
-    }
-#endif
-
-    interpreter_frame->interpreter_frame_set_locals(locals);
-    BasicObjectLock* montop = interpreter_frame->interpreter_frame_monitor_begin();
-    BasicObjectLock* monbot = montop - moncount;
-    interpreter_frame->interpreter_frame_set_monitor_end(monbot);
-
-    // Set last_sp
-    intptr_t*  esp = (intptr_t*) monbot -
-                     tempcount*Interpreter::stackElementWords -
-                     popframe_extra_args;
-    interpreter_frame->interpreter_frame_set_last_sp(esp);
-
-    // All frames but the initial (oldest) interpreter frame we fill in have
-    // a value for sender_sp that allows walking the stack but isn't
-    // truly correct. Correct the value here.
-    if (extra_locals != 0 &&
-        interpreter_frame->sender_sp() ==
-        interpreter_frame->interpreter_frame_sender_sp()) {
-      interpreter_frame->set_interpreter_frame_sender_sp(caller->sp() +
-                                                         extra_locals);
-    }
-    *interpreter_frame->interpreter_frame_cache_addr() =
-      method->constants()->cache();
-  }
-  return size;
-}
-
 //-----------------------------------------------------------------------------
 // Exceptions
 
diff --git a/hotspot/src/cpu/x86/vm/x86_32.ad b/hotspot/src/cpu/x86/vm/x86_32.ad
index cd4b7c7..63a7a06 100644
--- a/hotspot/src/cpu/x86/vm/x86_32.ad
+++ b/hotspot/src/cpu/x86/vm/x86_32.ad
@@ -512,14 +512,15 @@
 void MachPrologNode::format(PhaseRegAlloc* ra_, outputStream* st) const {
   Compile* C = ra_->C;
 
-  int framesize = C->frame_slots() << LogBytesPerInt;
+  int framesize = C->frame_size_in_bytes();
+  int bangsize = C->bang_size_in_bytes();
   assert((framesize & (StackAlignmentInBytes-1)) == 0, "frame size not aligned");
   // Remove wordSize for return addr which is already pushed.
   framesize -= wordSize;
 
-  if (C->need_stack_bang(framesize)) {
+  if (C->need_stack_bang(bangsize)) {
     framesize -= wordSize;
-    st->print("# stack bang");
+    st->print("# stack bang (%d bytes)", bangsize);
     st->print("\n\t");
     st->print("PUSH   EBP\t# Save EBP");
     if (framesize) {
@@ -563,9 +564,10 @@
   Compile* C = ra_->C;
   MacroAssembler _masm(&cbuf);
 
-  int framesize = C->frame_slots() << LogBytesPerInt;
+  int framesize = C->frame_size_in_bytes();
+  int bangsize = C->bang_size_in_bytes();
 
-  __ verified_entry(framesize, C->need_stack_bang(framesize), C->in_24_bit_fp_mode());
+  __ verified_entry(framesize, C->need_stack_bang(bangsize)?bangsize:0, C->in_24_bit_fp_mode());
 
   C->set_frame_complete(cbuf.insts_size());
 
@@ -589,7 +591,7 @@
 #ifndef PRODUCT
 void MachEpilogNode::format( PhaseRegAlloc *ra_, outputStream* st ) const {
   Compile *C = ra_->C;
-  int framesize = C->frame_slots() << LogBytesPerInt;
+  int framesize = C->frame_size_in_bytes();
   assert((framesize & (StackAlignmentInBytes-1)) == 0, "frame size not aligned");
   // Remove two words for return addr and rbp,
   framesize -= 2*wordSize;
@@ -629,7 +631,7 @@
     masm.fldcw(ExternalAddress(StubRoutines::addr_fpu_cntrl_wrd_std()));
   }
 
-  int framesize = C->frame_slots() << LogBytesPerInt;
+  int framesize = C->frame_size_in_bytes();
   assert((framesize & (StackAlignmentInBytes-1)) == 0, "frame size not aligned");
   // Remove two words for return addr and rbp,
   framesize -= 2*wordSize;
@@ -663,7 +665,7 @@
   if (C->max_vector_size() > 16) size += 3; // vzeroupper
   if (do_polling() && C->is_method_compilation()) size += 6;
 
-  int framesize = C->frame_slots() << LogBytesPerInt;
+  int framesize = C->frame_size_in_bytes();
   assert((framesize & (StackAlignmentInBytes-1)) == 0, "frame size not aligned");
   // Remove two words for return addr and rbp,
   framesize -= 2*wordSize;
diff --git a/hotspot/src/cpu/x86/vm/x86_64.ad b/hotspot/src/cpu/x86/vm/x86_64.ad
index 2a0e299..1233dbf 100644
--- a/hotspot/src/cpu/x86/vm/x86_64.ad
+++ b/hotspot/src/cpu/x86/vm/x86_64.ad
@@ -713,14 +713,15 @@
 void MachPrologNode::format(PhaseRegAlloc* ra_, outputStream* st) const {
   Compile* C = ra_->C;
 
-  int framesize = C->frame_slots() << LogBytesPerInt;
+  int framesize = C->frame_size_in_bytes();
+  int bangsize = C->bang_size_in_bytes();
   assert((framesize & (StackAlignmentInBytes-1)) == 0, "frame size not aligned");
   // Remove wordSize for return addr which is already pushed.
   framesize -= wordSize;
 
-  if (C->need_stack_bang(framesize)) {
+  if (C->need_stack_bang(bangsize)) {
     framesize -= wordSize;
-    st->print("# stack bang");
+    st->print("# stack bang (%d bytes)", bangsize);
     st->print("\n\t");
     st->print("pushq   rbp\t# Save rbp");
     if (framesize) {
@@ -751,9 +752,10 @@
   Compile* C = ra_->C;
   MacroAssembler _masm(&cbuf);
 
-  int framesize = C->frame_slots() << LogBytesPerInt;
+  int framesize = C->frame_size_in_bytes();
+  int bangsize = C->bang_size_in_bytes();
 
-  __ verified_entry(framesize, C->need_stack_bang(framesize), false);
+  __ verified_entry(framesize, C->need_stack_bang(bangsize)?bangsize:0, false);
 
   C->set_frame_complete(cbuf.insts_size());
 
@@ -786,7 +788,7 @@
     st->cr(); st->print("\t");
   }
 
-  int framesize = C->frame_slots() << LogBytesPerInt;
+  int framesize = C->frame_size_in_bytes();
   assert((framesize & (StackAlignmentInBytes-1)) == 0, "frame size not aligned");
   // Remove word for return adr already pushed
   // and RBP
@@ -822,7 +824,7 @@
     __ vzeroupper();
   }
 
-  int framesize = C->frame_slots() << LogBytesPerInt;
+  int framesize = C->frame_size_in_bytes();
   assert((framesize & (StackAlignmentInBytes-1)) == 0, "frame size not aligned");
   // Remove word for return adr already pushed
   // and RBP
diff --git a/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp b/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp
index 95a5d29..8ac274b 100644
--- a/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp
+++ b/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp
@@ -916,17 +916,32 @@
   return (InterpreterFrame *) fp;
 }
 
-int AbstractInterpreter::layout_activation(Method* method,
-                                           int       tempcount,
-                                           int       popframe_extra_args,
-                                           int       moncount,
-                                           int       caller_actual_parameters,
-                                           int       callee_param_count,
-                                           int       callee_locals,
-                                           frame*    caller,
-                                           frame*    interpreter_frame,
-                                           bool      is_top_frame,
-                                           bool      is_bottom_frame) {
+int AbstractInterpreter::size_activation(int       max_stack,
+                                         int       tempcount,
+                                         int       extra_args,
+                                         int       moncount,
+                                         int       callee_param_count,
+                                         int       callee_locals,
+                                         bool      is_top_frame) {
+  int header_words        = InterpreterFrame::header_words;
+  int monitor_words       = moncount * frame::interpreter_frame_monitor_size();
+  int stack_words         = is_top_frame ? max_stack : tempcount;
+  int callee_extra_locals = callee_locals - callee_param_count;
+
+  return header_words + monitor_words + stack_words + callee_extra_locals;
+}
+
+void AbstractInterpreter::layout_activation(Method* method,
+                                            int       tempcount,
+                                            int       popframe_extra_args,
+                                            int       moncount,
+                                            int       caller_actual_parameters,
+                                            int       callee_param_count,
+                                            int       callee_locals,
+                                            frame*    caller,
+                                            frame*    interpreter_frame,
+                                            bool      is_top_frame,
+                                            bool      is_bottom_frame) {
   assert(popframe_extra_args == 0, "what to do?");
   assert(!is_top_frame || (!callee_locals && !callee_param_count),
          "top frame should have no caller");
@@ -935,39 +950,31 @@
   // does (the full InterpreterFrame::build, that is, not the
   // one that creates empty frames for the deoptimizer).
   //
-  // If interpreter_frame is not NULL then it will be filled in.
-  // It's size is determined by a previous call to this method,
-  // so it should be correct.
+  // interpreter_frame will be filled in.  It's size is determined by
+  // a previous call to the size_activation() method,
   //
   // Note that tempcount is the current size of the expression
   // stack.  For top most frames we will allocate a full sized
   // expression stack and not the trimmed version that non-top
   // frames have.
 
-  int header_words        = InterpreterFrame::header_words;
   int monitor_words       = moncount * frame::interpreter_frame_monitor_size();
-  int stack_words         = is_top_frame ? method->max_stack() : tempcount;
-  int callee_extra_locals = callee_locals - callee_param_count;
+  intptr_t *locals        = interpreter_frame->fp() + method->max_locals();
+  interpreterState istate = interpreter_frame->get_interpreterState();
+  intptr_t *monitor_base  = (intptr_t*) istate;
+  intptr_t *stack_base    = monitor_base - monitor_words;
+  intptr_t *stack         = stack_base - tempcount - 1;
 
-  if (interpreter_frame) {
-    intptr_t *locals        = interpreter_frame->fp() + method->max_locals();
-    interpreterState istate = interpreter_frame->get_interpreterState();
-    intptr_t *monitor_base  = (intptr_t*) istate;
-    intptr_t *stack_base    = monitor_base - monitor_words;
-    intptr_t *stack         = stack_base - tempcount - 1;
-
-    BytecodeInterpreter::layout_interpreterState(istate,
-                                                 caller,
-                                                 NULL,
-                                                 method,
-                                                 locals,
-                                                 stack,
-                                                 stack_base,
-                                                 monitor_base,
-                                                 NULL,
-                                                 is_top_frame);
-  }
-  return header_words + monitor_words + stack_words + callee_extra_locals;
+  BytecodeInterpreter::layout_interpreterState(istate,
+                                               caller,
+                                               NULL,
+                                               method,
+                                               locals,
+                                               stack,
+                                               stack_base,
+                                               monitor_base,
+                                               NULL,
+                                               is_top_frame);
 }
 
 void BytecodeInterpreter::layout_interpreterState(interpreterState istate,
diff --git a/hotspot/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/CallSite.java b/hotspot/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/CallSite.java
index c36f4ca..faef0ce 100644
--- a/hotspot/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/CallSite.java
+++ b/hotspot/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/CallSite.java
@@ -25,6 +25,7 @@
 package com.sun.hotspot.tools.compiler;
 
 import java.io.PrintStream;
+import java.util.ArrayDeque;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -40,6 +41,7 @@
     private int endNodes;
     private int endLiveNodes;
     private double timeStamp;
+    private long inlineId;
 
     CallSite() {
     }
@@ -94,7 +96,7 @@
 
     public void print(PrintStream stream, int indent) {
         emit(stream, indent);
-        String m = getMethod().getHolder().replace('/', '.') + "::" + getMethod().getName();
+        String m = getMethod().getHolder() + "::" + getMethod().getName();
         if (getReason() == null) {
             stream.print("  @ " + getBci() + " " + m + " (" + getMethod().getBytes() + " bytes)");
 
@@ -214,4 +216,45 @@
         return timeStamp;
     }
 
+    private boolean matches(CallSite other) {
+        // Every late inline call site has a unique inline id. If the
+        // call site we're looking for has one then use it other rely
+        // on method name and bci.
+        if (other.inlineId != 0) {
+            return inlineId == other.inlineId;
+        }
+        return method.equals(other.method) && bci == other.bci;
+    }
+
+    public CallSite findCallSite(ArrayDeque<CallSite> sites) {
+        // Locate a late inline call site. Multiple chains of
+        // identical call sites with the same method name/bci are
+        // possible so we have to try them all until we find the late
+        // inline call site that has a matching inline id.
+        CallSite site = sites.pop();
+        for (CallSite c : calls) {
+            if (c.matches(site)) {
+                if (!sites.isEmpty()) {
+                    CallSite res = c.findCallSite(sites);
+                    if (res != null) {
+                        sites.push(site);
+                        return res;
+                    }
+                } else {
+                    sites.push(site);
+                    return c;
+                }
+            }
+        }
+        sites.push(site);
+        return null;
+    }
+
+    public long getInlineId() {
+        return inlineId;
+    }
+
+    public void setInlineId(long inlineId) {
+        this.inlineId = inlineId;
+    }
 }
diff --git a/hotspot/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/LogParser.java b/hotspot/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/LogParser.java
index c24a210..077c1d2 100644
--- a/hotspot/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/LogParser.java
+++ b/hotspot/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/LogParser.java
@@ -31,6 +31,7 @@
 
 import java.io.FileReader;
 import java.io.Reader;
+import java.util.ArrayDeque;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Comparator;
@@ -144,9 +145,12 @@
     private Stack<CallSite> scopes = new Stack<CallSite>();
     private Compilation compile;
     private CallSite site;
+    private CallSite methodHandleSite;
     private Stack<Phase> phaseStack = new Stack<Phase>();
     private UncommonTrapEvent currentTrap;
-    private Stack<CallSite> late_inline_scope;
+    private Stack<CallSite> lateInlineScope;
+    private boolean lateInlining;
+
 
     long parseLong(String l) {
         try {
@@ -330,18 +334,61 @@
             }
             methods.put(id, m);
         } else if (qname.equals("call")) {
-            site = new CallSite(bci, method(search(atts, "method")));
+            if (methodHandleSite != null) {
+                methodHandleSite = null;
+            }
+            Method m = method(search(atts, "method"));
+            if (lateInlining && scopes.size() == 0) {
+                // re-attempting already seen call site (late inlining for MH invokes)
+                if (m != site.getMethod()) {
+                    if (bci != site.getBci()) {
+                        System.out.println(m + " bci: " + bci);
+                        System.out.println(site.getMethod() +  " bci: " + site.getBci());
+                        throw new InternalError("bci mismatch after late inlining");
+                    }
+                    site.setMethod(m);
+                }
+            } else {
+                site = new CallSite(bci, m);
+            }
             site.setCount(Integer.parseInt(search(atts, "count", "0")));
             String receiver = atts.getValue("receiver");
             if (receiver != null) {
                 site.setReceiver(type(receiver));
                 site.setReceiver_count(Integer.parseInt(search(atts, "receiver_count")));
             }
-            scopes.peek().add(site);
+            int methodHandle = Integer.parseInt(search(atts, "method_handle_intrinsic", "0"));
+            if (lateInlining && scopes.size() == 0) {
+                // The call was added before this round of late inlining
+            } else if (methodHandle == 0) {
+                scopes.peek().add(site);
+            } else {
+                // method handle call site can be followed by another
+                // call (in case it is inlined). If that happens we
+                // discard the method handle call site. So we keep
+                // track of it but don't add it to the list yet.
+                methodHandleSite = site;
+            }
         } else if (qname.equals("regalloc")) {
             compile.setAttempts(Integer.parseInt(search(atts, "attempts")));
         } else if (qname.equals("inline_fail")) {
-            scopes.peek().last().setReason(search(atts, "reason"));
+            if (methodHandleSite != null) {
+                scopes.peek().add(methodHandleSite);
+                methodHandleSite = null;
+            }
+            if (lateInlining && scopes.size() == 0) {
+                site.setReason(search(atts, "reason"));
+                lateInlining = false;
+            } else {
+                scopes.peek().last().setReason(search(atts, "reason"));
+            }
+        } else if (qname.equals("inline_success")) {
+            if (methodHandleSite != null) {
+                throw new InternalError("method handle site should have been replaced");
+            }
+            if (lateInlining && scopes.size() == 0) {
+                site.setReason(null);
+            }
         } else if (qname.equals("failure")) {
             failureReason = search(atts, "reason");
         } else if (qname.equals("task_done")) {
@@ -371,22 +418,30 @@
                 // ignore for now
             }
         } else if (qname.equals("late_inline")) {
-            late_inline_scope = new Stack<CallSite>();
+            long inlineId = Long.parseLong(search(atts, "inline_id"));
+            lateInlineScope = new Stack<CallSite>();
             site = new CallSite(-999, method(search(atts, "method")));
-            late_inline_scope.push(site);
+            site.setInlineId(inlineId);
+            lateInlineScope.push(site);
         } else if (qname.equals("jvms")) {
             // <jvms bci='4' method='java/io/DataInputStream readChar ()C' bytes='40' count='5815' iicount='20815'/>
             if (currentTrap != null) {
                 currentTrap.addJVMS(atts.getValue("method"), Integer.parseInt(atts.getValue("bci")));
-            } else if (late_inline_scope != null) {
+            } else if (lateInlineScope != null) {
                 bci = Integer.parseInt(search(atts, "bci"));
                 site = new CallSite(bci, method(search(atts, "method")));
-                late_inline_scope.push(site);
+                lateInlineScope.push(site);
             } else {
                 // Ignore <eliminate_allocation type='667'>,
                 //        <eliminate_lock lock='1'>,
                 //        <replace_string_concat arguments='2' string_alloc='0' multiple='0'>
             }
+        } else if (qname.equals("inline_id")) {
+            if (methodHandleSite != null) {
+                throw new InternalError("method handle site should have been replaced");
+            }
+            long id = Long.parseLong(search(atts, "id"));
+            site.setInlineId(id);
         } else if (qname.equals("nmethod")) {
             String id = makeId(atts);
             NMethod nm = new NMethod(Double.parseDouble(search(atts, "stamp")),
@@ -396,8 +451,18 @@
             nmethods.put(id, nm);
             events.add(nm);
         } else if (qname.equals("parse")) {
+            if (methodHandleSite != null) {
+                throw new InternalError("method handle site should have been replaced");
+            }
             Method m = method(search(atts, "method"));
-            if (scopes.size() == 0) {
+            if (lateInlining && scopes.size() == 0) {
+                if (site.getMethod() != m) {
+                    System.out.println(site.getMethod());
+                    System.out.println(m);
+                    throw new InternalError("Unexpected method mismatch during late inlining");
+                }
+            }
+            if (scopes.size() == 0 && !lateInlining) {
                 compile.setMethod(m);
                 scopes.push(site);
             } else {
@@ -427,14 +492,19 @@
         if (qname.equals("parse")) {
             indent -= 2;
             scopes.pop();
+            if (scopes.size() == 0) {
+                lateInlining = false;
+            }
         } else if (qname.equals("uncommon_trap")) {
             currentTrap = null;
         } else if (qname.equals("late_inline")) {
             // Populate late inlining info.
-
-            // late_inline scopes are specified in reverse order:
+            if (scopes.size() != 0) {
+                throw new InternalError("scopes should be empty for late inline");
+            }
+            // late inline scopes are specified in reverse order:
             // compiled method should be on top of stack.
-            CallSite caller = late_inline_scope.pop();
+            CallSite caller = lateInlineScope.pop();
             Method m = compile.getMethod();
             if (m != caller.getMethod()) {
                 System.out.println(m);
@@ -444,28 +514,42 @@
 
             // late_inline contains caller+bci info, convert it
             // to bci+callee info used by LogCompilation.
-            site = compile.getLateInlineCall();
+            CallSite lateInlineSite = compile.getLateInlineCall();
+            ArrayDeque<CallSite> thisCallScopes = new ArrayDeque<CallSite>();
             do {
                 bci = caller.getBci();
                 // Next inlined call.
-                caller = late_inline_scope.pop();
+                caller = lateInlineScope.pop();
                 CallSite callee =  new CallSite(bci, caller.getMethod());
-                site.add(callee);
-                site = callee;
-            } while (!late_inline_scope.empty());
+                callee.setInlineId(caller.getInlineId());
+                thisCallScopes.addLast(callee);
+                lateInlineSite.add(callee);
+                lateInlineSite = callee;
+            } while (!lateInlineScope.empty());
+
+            site = compile.getCall().findCallSite(thisCallScopes);
+            if (site == null) {
+                System.out.println(caller.getMethod() + " bci: " + bci);
+                throw new InternalError("couldn't find call site");
+            }
+            lateInlining = true;
 
             if (caller.getBci() != -999) {
                 System.out.println(caller.getMethod());
                 throw new InternalError("broken late_inline info");
             }
             if (site.getMethod() != caller.getMethod()) {
-                System.out.println(site.getMethod());
-                System.out.println(caller.getMethod());
-                throw new InternalError("call site and late_inline info don't match");
+                if (site.getInlineId() == caller.getInlineId()) {
+                    site.setMethod(caller.getMethod());
+                } else {
+                    System.out.println(site.getMethod());
+                    System.out.println(caller.getMethod());
+                    throw new InternalError("call site and late_inline info don't match");
+                }
             }
             // late_inline is followed by parse with scopes.size() == 0,
             // 'site' will be pushed to scopes.
-            late_inline_scope = null;
+            lateInlineScope = null;
         } else if (qname.equals("task")) {
             types.clear();
             methods.clear();
diff --git a/hotspot/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/Method.java b/hotspot/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/Method.java
index 2f6c8d4..ffce1de 100644
--- a/hotspot/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/Method.java
+++ b/hotspot/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/Method.java
@@ -51,15 +51,15 @@
 
     String format(int osr_bci) {
         if (osr_bci >= 0) {
-            return getHolder().replace('/', '.') + "::" + getName() + " @ " + osr_bci + " (" + getBytes() + " bytes)";
+            return getHolder() + "::" + getName() + " @ " + osr_bci + " (" + getBytes() + " bytes)";
         } else {
-            return getHolder().replace('/', '.') + "::" + getName() + " (" + getBytes() + " bytes)";
+            return getHolder() + "::" + getName() + " (" + getBytes() + " bytes)";
         }
     }
 
     @Override
     public String toString() {
-        return getHolder().replace('/', '.') + "::" + getName() + " (" + getBytes() + " bytes)";
+        return getHolder() + "::" + getName() + " (" + getBytes() + " bytes)";
     }
 
     public String getHolder() {
@@ -117,4 +117,14 @@
     public void setFlags(String flags) {
         this.flags = flags;
     }
+
+    @Override
+    public boolean equals(Object o) {
+        if (o instanceof Method) {
+            Method other = (Method)o;
+            return holder.equals(other.holder) && name.equals(other.name) &&
+                arguments.equals(other.arguments) && returnType.equals(other.returnType);
+        }
+        return false;
+    }
 }
diff --git a/hotspot/src/share/vm/adlc/output_h.cpp b/hotspot/src/share/vm/adlc/output_h.cpp
index 1bf7def..2279e75 100644
--- a/hotspot/src/share/vm/adlc/output_h.cpp
+++ b/hotspot/src/share/vm/adlc/output_h.cpp
@@ -1613,21 +1613,20 @@
     // Each instruction attribute results in a virtual call of same name.
     // The ins_cost is not handled here.
     Attribute *attr = instr->_attribs;
-    bool avoid_back_to_back = false;
+    Attribute *avoid_back_to_back_attr = NULL;
     while (attr != NULL) {
-      if (strcmp (attr->_ident, "ins_cost") != 0 &&
+      if (strcmp (attr->_ident, "ins_is_TrapBasedCheckNode") == 0) {
+        fprintf(fp, "  virtual bool           is_TrapBasedCheckNode() const { return %s; }\n", attr->_val);
+      } else if (strcmp (attr->_ident, "ins_cost") != 0 &&
           strncmp(attr->_ident, "ins_field_", 10) != 0 &&
           // Must match function in node.hpp: return type bool, no prefix "ins_".
           strcmp (attr->_ident, "ins_is_TrapBasedCheckNode") != 0 &&
           strcmp (attr->_ident, "ins_short_branch") != 0) {
         fprintf(fp, "  virtual int            %s() const { return %s; }\n", attr->_ident, attr->_val);
       }
-      // Check value for ins_avoid_back_to_back, and if it is true (1), set the flag
-      if (!strcmp(attr->_ident, "ins_avoid_back_to_back") != 0 && attr->int_val(*this) != 0)
-        avoid_back_to_back = true;
-      if (strcmp (attr->_ident, "ins_is_TrapBasedCheckNode") == 0)
-        fprintf(fp, "  virtual bool           is_TrapBasedCheckNode() const { return %s; }\n", attr->_val);
-
+      if (strcmp(attr->_ident, "ins_avoid_back_to_back") == 0) {
+        avoid_back_to_back_attr = attr;
+      }
       attr = (Attribute *)attr->_next;
     }
 
@@ -1799,11 +1798,11 @@
     }
 
     // flag: if this instruction should not be generated back to back.
-    if ( avoid_back_to_back ) {
-      if ( node_flags_set ) {
-        fprintf(fp," | Flag_avoid_back_to_back");
+    if (avoid_back_to_back_attr != NULL) {
+      if (node_flags_set) {
+        fprintf(fp," | (%s)", avoid_back_to_back_attr->_val);
       } else {
-        fprintf(fp,"init_flags(Flag_avoid_back_to_back");
+        fprintf(fp,"init_flags((%s)", avoid_back_to_back_attr->_val);
         node_flags_set = true;
       }
     }
diff --git a/hotspot/src/share/vm/asm/codeBuffer.cpp b/hotspot/src/share/vm/asm/codeBuffer.cpp
index 7e58599..0c10e1f 100644
--- a/hotspot/src/share/vm/asm/codeBuffer.cpp
+++ b/hotspot/src/share/vm/asm/codeBuffer.cpp
@@ -968,6 +968,7 @@
 
 void CodeBuffer::log_section_sizes(const char* name) {
   if (xtty != NULL) {
+    ttyLocker ttyl;
     // log info about buffer usage
     xtty->print_cr("<blob name='%s' size='%d'>", name, _total_size);
     for (int n = (int) CodeBuffer::SECT_FIRST; n < (int) CodeBuffer::SECT_LIMIT; n++) {
diff --git a/hotspot/src/share/vm/c1/c1_Compilation.cpp b/hotspot/src/share/vm/c1/c1_Compilation.cpp
index 404c4e3..6a0b709 100644
--- a/hotspot/src/share/vm/c1/c1_Compilation.cpp
+++ b/hotspot/src/share/vm/c1/c1_Compilation.cpp
@@ -546,6 +546,7 @@
 , _code(buffer_blob)
 , _has_access_indexed(false)
 , _current_instruction(NULL)
+, _interpreter_frame_size(0)
 #ifndef PRODUCT
 , _last_instruction_printed(NULL)
 #endif // PRODUCT
diff --git a/hotspot/src/share/vm/c1/c1_Compilation.hpp b/hotspot/src/share/vm/c1/c1_Compilation.hpp
index 8953d52..8ff7f3e 100644
--- a/hotspot/src/share/vm/c1/c1_Compilation.hpp
+++ b/hotspot/src/share/vm/c1/c1_Compilation.hpp
@@ -88,6 +88,7 @@
   CodeOffsets        _offsets;
   CodeBuffer         _code;
   bool               _has_access_indexed;
+  int                _interpreter_frame_size; // Stack space needed in case of a deoptimization
 
   // compilation helpers
   void initialize();
@@ -262,6 +263,18 @@
 
   // Dump inlining replay data to the stream.
   void dump_inline_data(outputStream* out) { /* do nothing now */ }
+
+  // How much stack space would the interpreter need in case of a
+  // deoptimization (worst case)
+  void update_interpreter_frame_size(int size) {
+    if (_interpreter_frame_size < size) {
+      _interpreter_frame_size = size;
+    }
+  }
+
+  int interpreter_frame_size() const {
+    return _interpreter_frame_size;
+  }
 };
 
 
diff --git a/hotspot/src/share/vm/c1/c1_IR.cpp b/hotspot/src/share/vm/c1/c1_IR.cpp
index b2a4fbb..ff7587a 100644
--- a/hotspot/src/share/vm/c1/c1_IR.cpp
+++ b/hotspot/src/share/vm/c1/c1_IR.cpp
@@ -227,8 +227,38 @@
   _oop_map->set_oop(name);
 }
 
+// Mirror the stack size calculation in the deopt code
+// How much stack space would we need at this point in the program in
+// case of deoptimization?
+int CodeEmitInfo::interpreter_frame_size() const {
+  ValueStack* state = _stack;
+  int size = 0;
+  int callee_parameters = 0;
+  int callee_locals = 0;
+  int extra_args = state->scope()->method()->max_stack() - state->stack_size();
 
+  while (state != NULL) {
+    int locks = state->locks_size();
+    int temps = state->stack_size();
+    bool is_top_frame = (state == _stack);
+    ciMethod* method = state->scope()->method();
 
+    int frame_size = BytesPerWord * Interpreter::size_activation(method->max_stack(),
+                                                                 temps + callee_parameters,
+                                                                 extra_args,
+                                                                 locks,
+                                                                 callee_parameters,
+                                                                 callee_locals,
+                                                                 is_top_frame);
+    size += frame_size;
+
+    callee_parameters = method->size_of_parameters();
+    callee_locals = method->max_locals();
+    extra_args = 0;
+    state = state->caller_state();
+  }
+  return size + Deoptimization::last_frame_adjust(0, callee_locals) * BytesPerWord;
+}
 
 // Implementation of IR
 
diff --git a/hotspot/src/share/vm/c1/c1_IR.hpp b/hotspot/src/share/vm/c1/c1_IR.hpp
index 6dc0e3a..ccc9c1b 100644
--- a/hotspot/src/share/vm/c1/c1_IR.hpp
+++ b/hotspot/src/share/vm/c1/c1_IR.hpp
@@ -284,6 +284,8 @@
 
   bool     is_method_handle_invoke() const { return _is_method_handle_invoke;     }
   void set_is_method_handle_invoke(bool x) {        _is_method_handle_invoke = x; }
+
+  int interpreter_frame_size() const;
 };
 
 
diff --git a/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp b/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp
index 5a49c0d..826cf70 100644
--- a/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp
+++ b/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp
@@ -190,6 +190,13 @@
   return _masm->pc();
 }
 
+// To bang the stack of this compiled method we use the stack size
+// that the interpreter would need in case of a deoptimization. This
+// removes the need to bang the stack in the deoptimization blob which
+// in turn simplifies stack overflow handling.
+int LIR_Assembler::bang_size_in_bytes() const {
+  return MAX2(initial_frame_size_in_bytes(), _compilation->interpreter_frame_size());
+}
 
 void LIR_Assembler::emit_exception_entries(ExceptionInfoList* info_list) {
   for (int i = 0; i < info_list->length(); i++) {
@@ -797,7 +804,7 @@
 
 
 void LIR_Assembler::build_frame() {
-  _masm->build_frame(initial_frame_size_in_bytes());
+  _masm->build_frame(initial_frame_size_in_bytes(), bang_size_in_bytes());
 }
 
 
diff --git a/hotspot/src/share/vm/c1/c1_LIRAssembler.hpp b/hotspot/src/share/vm/c1/c1_LIRAssembler.hpp
index 68f249a..0d4c648 100644
--- a/hotspot/src/share/vm/c1/c1_LIRAssembler.hpp
+++ b/hotspot/src/share/vm/c1/c1_LIRAssembler.hpp
@@ -132,7 +132,8 @@
   int code_offset() const;
   address pc() const;
 
-  int  initial_frame_size_in_bytes();
+  int  initial_frame_size_in_bytes() const;
+  int  bang_size_in_bytes() const;
 
   // test for constants which can be encoded directly in instructions
   static bool is_small_constant(LIR_Opr opr);
diff --git a/hotspot/src/share/vm/c1/c1_LinearScan.cpp b/hotspot/src/share/vm/c1/c1_LinearScan.cpp
index 089058a..74e04f8 100644
--- a/hotspot/src/share/vm/c1/c1_LinearScan.cpp
+++ b/hotspot/src/share/vm/c1/c1_LinearScan.cpp
@@ -2451,6 +2451,9 @@
     CodeEmitInfo* info = visitor.info_at(i);
     OopMap* oop_map = first_oop_map;
 
+    // compute worst case interpreter size in case of a deoptimization
+    _compilation->update_interpreter_frame_size(info->interpreter_frame_size());
+
     if (info->stack()->locks_size() != first_info->stack()->locks_size()) {
       // this info has a different number of locks then the precomputed oop map
       // (possible for lock and unlock instructions) -> compute oop map with
diff --git a/hotspot/src/share/vm/c1/c1_MacroAssembler.hpp b/hotspot/src/share/vm/c1/c1_MacroAssembler.hpp
index f5e84bb..324c5a3 100644
--- a/hotspot/src/share/vm/c1/c1_MacroAssembler.hpp
+++ b/hotspot/src/share/vm/c1/c1_MacroAssembler.hpp
@@ -39,7 +39,7 @@
   void explicit_null_check(Register base);
 
   void inline_cache_check(Register receiver, Register iCache);
-  void build_frame(int frame_size_in_bytes);
+  void build_frame(int frame_size_in_bytes, int bang_size_in_bytes);
   void remove_frame(int frame_size_in_bytes);
 
   void unverified_entry(Register receiver, Register ic_klass);
diff --git a/hotspot/src/share/vm/ci/ciKlass.cpp b/hotspot/src/share/vm/ci/ciKlass.cpp
index 0cd20e5..2c3dd19 100644
--- a/hotspot/src/share/vm/ci/ciKlass.cpp
+++ b/hotspot/src/share/vm/ci/ciKlass.cpp
@@ -237,3 +237,9 @@
 void ciKlass::print_name_on(outputStream* st) {
   name()->print_symbol_on(st);
 }
+
+const char* ciKlass::external_name() const {
+  GUARDED_VM_ENTRY(
+    return get_Klass()->external_name();
+  )
+}
diff --git a/hotspot/src/share/vm/ci/ciKlass.hpp b/hotspot/src/share/vm/ci/ciKlass.hpp
index 8e6574b..b28edd7 100644
--- a/hotspot/src/share/vm/ci/ciKlass.hpp
+++ b/hotspot/src/share/vm/ci/ciKlass.hpp
@@ -125,6 +125,8 @@
   virtual ciKlass* exact_klass() = 0;
 
   void print_name_on(outputStream* st);
+
+  const char* external_name() const;
 };
 
 #endif // SHARE_VM_CI_CIKLASS_HPP
diff --git a/hotspot/src/share/vm/ci/ciMethod.cpp b/hotspot/src/share/vm/ci/ciMethod.cpp
index 9cbed6f..dbbbb7fa 100644
--- a/hotspot/src/share/vm/ci/ciMethod.cpp
+++ b/hotspot/src/share/vm/ci/ciMethod.cpp
@@ -80,6 +80,7 @@
   _code_size          = h_m()->code_size();
   _intrinsic_id       = h_m()->intrinsic_id();
   _handler_count      = h_m()->exception_table_length();
+  _size_of_parameters = h_m()->size_of_parameters();
   _uses_monitors      = h_m()->access_flags().has_monitor_bytecodes();
   _balanced_monitors  = !_uses_monitors || h_m()->access_flags().is_monitor_matching();
   _is_c1_compilable   = !h_m()->is_not_c1_compilable();
diff --git a/hotspot/src/share/vm/ci/ciMethod.hpp b/hotspot/src/share/vm/ci/ciMethod.hpp
index 9598674..e061ea4 100644
--- a/hotspot/src/share/vm/ci/ciMethod.hpp
+++ b/hotspot/src/share/vm/ci/ciMethod.hpp
@@ -71,6 +71,7 @@
   int _interpreter_invocation_count;
   int _interpreter_throwout_count;
   int _instructions_size;
+  int _size_of_parameters;
 
   bool _uses_monitors;
   bool _balanced_monitors;
@@ -166,6 +167,7 @@
   int exception_table_length() const             { check_is_loaded(); return _handler_count; }
   int interpreter_invocation_count() const       { check_is_loaded(); return _interpreter_invocation_count; }
   int interpreter_throwout_count() const         { check_is_loaded(); return _interpreter_throwout_count; }
+  int size_of_parameters() const                 { check_is_loaded(); return _size_of_parameters; }
 
   // Code size for inlining decisions.
   int code_size_for_inlining();
@@ -241,7 +243,6 @@
 
   ciField*      get_field_at_bci( int bci, bool &will_link);
   ciMethod*     get_method_at_bci(int bci, bool &will_link, ciSignature* *declared_signature);
-
   // Given a certain calling environment, find the monomorphic target
   // for the call.  Return NULL if the call is not monomorphic in
   // its calling environment.
diff --git a/hotspot/src/share/vm/ci/ciSymbol.cpp b/hotspot/src/share/vm/ci/ciSymbol.cpp
index 1a89adf..f141832 100644
--- a/hotspot/src/share/vm/ci/ciSymbol.cpp
+++ b/hotspot/src/share/vm/ci/ciSymbol.cpp
@@ -123,6 +123,10 @@
   GUARDED_VM_ENTRY(get_symbol()->print_symbol_on(st);)
 }
 
+const char* ciSymbol::as_klass_external_name() const {
+  GUARDED_VM_ENTRY(return get_symbol()->as_klass_external_name(););
+}
+
 // ------------------------------------------------------------------
 // ciSymbol::make_impl
 //
diff --git a/hotspot/src/share/vm/ci/ciSymbol.hpp b/hotspot/src/share/vm/ci/ciSymbol.hpp
index 3c974cf..9999e36 100644
--- a/hotspot/src/share/vm/ci/ciSymbol.hpp
+++ b/hotspot/src/share/vm/ci/ciSymbol.hpp
@@ -90,6 +90,7 @@
   void print_symbol() {
     print_symbol_on(tty);
   }
+  const char* as_klass_external_name() const;
 
   // Make a ciSymbol from a C string.
   // Consider adding to vmSymbols.hpp instead of using this constructor.
diff --git a/hotspot/src/share/vm/classfile/defaultMethods.cpp b/hotspot/src/share/vm/classfile/defaultMethods.cpp
index 72020ba..b5e4da6 100644
--- a/hotspot/src/share/vm/classfile/defaultMethods.cpp
+++ b/hotspot/src/share/vm/classfile/defaultMethods.cpp
@@ -390,20 +390,6 @@
   Symbol* get_exception_message() { return _exception_message; }
   Symbol* get_exception_name() { return _exception_name; }
 
-  // Return true if the specified klass has a static method that matches
-  // the name and signature of the target method.
-  bool has_matching_static(InstanceKlass* root) {
-    if (_members.length() > 0) {
-      Pair<Method*,QualifiedState> entry = _members.at(0);
-      Method* impl = root->find_method(entry.first->name(),
-                                       entry.first->signature());
-      if ((impl != NULL) && impl->is_static()) {
-        return true;
-      }
-    }
-    return false;
-  }
-
   // Either sets the target or the exception error message
   void determine_target(InstanceKlass* root, TRAPS) {
     if (has_target() || throws_exception()) {
@@ -433,21 +419,19 @@
       // If the root klass has a static method with matching name and signature
       // then do not generate an overpass method because it will hide the
       // static method during resolution.
-      if (!has_matching_static(root)) {
-        if (qualified_methods.length() == 0) {
-          _exception_message = generate_no_defaults_message(CHECK);
-        } else {
-          assert(root != NULL, "Null root class");
-          _exception_message = generate_method_message(root->name(), qualified_methods.at(0), CHECK);
-        }
-        _exception_name = vmSymbols::java_lang_AbstractMethodError();
+      if (qualified_methods.length() == 0) {
+        _exception_message = generate_no_defaults_message(CHECK);
+      } else {
+        assert(root != NULL, "Null root class");
+        _exception_message = generate_method_message(root->name(), qualified_methods.at(0), CHECK);
       }
+      _exception_name = vmSymbols::java_lang_AbstractMethodError();
 
     // If only one qualified method is default, select that
     } else if (num_defaults == 1) {
         _selected_target = qualified_methods.at(default_index);
 
-    } else if (num_defaults > 1 && !has_matching_static(root)) {
+    } else if (num_defaults > 1) {
       _exception_message = generate_conflicts_message(&qualified_methods,CHECK);
       _exception_name = vmSymbols::java_lang_IncompatibleClassChangeError();
       if (TraceDefaultMethods) {
diff --git a/hotspot/src/share/vm/classfile/verificationType.hpp b/hotspot/src/share/vm/classfile/verificationType.hpp
index eec0bf3..1626647 100644
--- a/hotspot/src/share/vm/classfile/verificationType.hpp
+++ b/hotspot/src/share/vm/classfile/verificationType.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -299,7 +299,7 @@
   int dimensions() const {
     assert(is_array(), "Must be an array");
     int index = 0;
-    while (name()->byte_at(index++) == '[');
+    while (name()->byte_at(index) == '[') index++;
     return index;
   }
 
diff --git a/hotspot/src/share/vm/classfile/verifier.cpp b/hotspot/src/share/vm/classfile/verifier.cpp
index 2e64747..c75a29d 100644
--- a/hotspot/src/share/vm/classfile/verifier.cpp
+++ b/hotspot/src/share/vm/classfile/verifier.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2013, 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
@@ -1943,7 +1943,7 @@
   InstanceKlass* target_instance = InstanceKlass::cast(target_class);
   fieldDescriptor fd;
   if (is_method) {
-    Method* m = target_instance->uncached_lookup_method(field_name, field_sig);
+    Method* m = target_instance->uncached_lookup_method(field_name, field_sig, Klass::normal);
     if (m != NULL && m->is_protected()) {
       if (!this_class->is_same_class_package(m->method_holder())) {
         return true;
@@ -2280,7 +2280,8 @@
         ref_class_type.name(), CHECK_VERIFY(this));
       Method* m = InstanceKlass::cast(ref_klass)->uncached_lookup_method(
         vmSymbols::object_initializer_name(),
-        cp->signature_ref_at(bcs->get_index_u2()));
+        cp->signature_ref_at(bcs->get_index_u2()),
+        Klass::normal);
       instanceKlassHandle mh(THREAD, m->method_holder());
       if (m->is_protected() && !mh->is_same_class_package(_klass())) {
         bool assignable = current_type().is_assignable_from(
diff --git a/hotspot/src/share/vm/compiler/compileLog.cpp b/hotspot/src/share/vm/compiler/compileLog.cpp
index bff35b1..8753e7b 100644
--- a/hotspot/src/share/vm/compiler/compileLog.cpp
+++ b/hotspot/src/share/vm/compiler/compileLog.cpp
@@ -106,7 +106,7 @@
     if (mobj->is_klass()) {
       ciKlass* klass = mobj->as_klass();
       begin_elem("klass id='%d'", id);
-      name(klass->name());
+      name(klass);
       if (!klass->is_loaded()) {
         print(" unloaded='1'");
       } else {
@@ -171,6 +171,15 @@
   print("'");
 }
 
+void CompileLog::name(ciKlass* k) {
+  print(" name='");
+  if (!k->is_loaded()) {
+    text()->print(k->name()->as_klass_external_name());
+  } else {
+    text()->print(k->external_name());
+  }
+  print("'");
+}
 
 // ------------------------------------------------------------------
 // CompileLog::clear_identities
diff --git a/hotspot/src/share/vm/compiler/compileLog.hpp b/hotspot/src/share/vm/compiler/compileLog.hpp
index d0fe07b..094dc76 100644
--- a/hotspot/src/share/vm/compiler/compileLog.hpp
+++ b/hotspot/src/share/vm/compiler/compileLog.hpp
@@ -28,6 +28,7 @@
 #include "utilities/xmlstream.hpp"
 
 class ciBaseObject;
+class ciKlass;
 class ciObject;
 class ciMetadata;
 class ciSymbol;
@@ -72,6 +73,7 @@
 
   void          name(ciSymbol* s);               // name='s'
   void          name(Symbol* s)                  { xmlStream::name(s); }
+  void          name(ciKlass* k);
 
   // Output an object description, return obj->ident().
   int           identify(ciBaseObject* obj);
diff --git a/hotspot/src/share/vm/gc_interface/collectedHeap.hpp b/hotspot/src/share/vm/gc_interface/collectedHeap.hpp
index dd7c551..ecf50c9 100644
--- a/hotspot/src/share/vm/gc_interface/collectedHeap.hpp
+++ b/hotspot/src/share/vm/gc_interface/collectedHeap.hpp
@@ -151,7 +151,7 @@
   inline static void post_allocation_setup_no_klass_install(KlassHandle klass,
                                                             HeapWord* objPtr);
 
-  inline static void post_allocation_setup_obj(KlassHandle klass, HeapWord* obj);
+  inline static void post_allocation_setup_obj(KlassHandle klass, HeapWord* obj, int size);
 
   inline static void post_allocation_setup_array(KlassHandle klass,
                                                  HeapWord* obj, int length);
diff --git a/hotspot/src/share/vm/gc_interface/collectedHeap.inline.hpp b/hotspot/src/share/vm/gc_interface/collectedHeap.inline.hpp
index 0bf322f..89315a9 100644
--- a/hotspot/src/share/vm/gc_interface/collectedHeap.inline.hpp
+++ b/hotspot/src/share/vm/gc_interface/collectedHeap.inline.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2013, 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
@@ -70,7 +70,7 @@
 }
 
 // Support for jvmti and dtrace
-inline void post_allocation_notify(KlassHandle klass, oop obj) {
+inline void post_allocation_notify(KlassHandle klass, oop obj, int size) {
   // support low memory notifications (no-op if not enabled)
   LowMemoryDetector::detect_low_memory_for_collected_pools();
 
@@ -80,18 +80,19 @@
   if (DTraceAllocProbes) {
     // support for Dtrace object alloc event (no-op most of the time)
     if (klass() != NULL && klass()->name() != NULL) {
-      SharedRuntime::dtrace_object_alloc(obj);
+      SharedRuntime::dtrace_object_alloc(obj, size);
     }
   }
 }
 
 void CollectedHeap::post_allocation_setup_obj(KlassHandle klass,
-                                              HeapWord* obj) {
+                                              HeapWord* obj,
+                                              int size) {
   post_allocation_setup_common(klass, obj);
   assert(Universe::is_bootstrapping() ||
          !((oop)obj)->is_array(), "must not be an array");
   // notify jvmti and dtrace
-  post_allocation_notify(klass, (oop)obj);
+  post_allocation_notify(klass, (oop)obj, size);
 }
 
 void CollectedHeap::post_allocation_setup_array(KlassHandle klass,
@@ -103,9 +104,10 @@
   assert(length >= 0, "length should be non-negative");
   ((arrayOop)obj)->set_length(length);
   post_allocation_setup_common(klass, obj);
-  assert(((oop)obj)->is_array(), "must be an array");
+  oop new_obj = (oop)obj;
+  assert(new_obj->is_array(), "must be an array");
   // notify jvmti and dtrace (must be after length is set for dtrace)
-  post_allocation_notify(klass, (oop)obj);
+  post_allocation_notify(klass, new_obj, new_obj->size());
 }
 
 HeapWord* CollectedHeap::common_mem_allocate_noinit(KlassHandle klass, size_t size, TRAPS) {
@@ -199,7 +201,7 @@
   assert(!Universe::heap()->is_gc_active(), "Allocation during gc not allowed");
   assert(size >= 0, "int won't convert to size_t");
   HeapWord* obj = common_mem_allocate_init(klass, size, CHECK_NULL);
-  post_allocation_setup_obj(klass, obj);
+  post_allocation_setup_obj(klass, obj, size);
   NOT_PRODUCT(Universe::heap()->check_for_bad_heap_word_value(obj, size));
   return (oop)obj;
 }
diff --git a/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp b/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp
index 921dc9e..d5d1b15 100644
--- a/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp
+++ b/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp
@@ -181,30 +181,16 @@
   // Deoptimization should reexecute this bytecode
   static bool    bytecode_should_reexecute(Bytecodes::Code code);
 
-  // share implementation of size_activation and layout_activation:
-  static int        size_activation(Method* method,
+  // deoptimization support
+  static int        size_activation(int max_stack,
                                     int temps,
-                                    int popframe_args,
+                                    int extra_args,
                                     int monitors,
-                                    int caller_actual_parameters,
                                     int callee_params,
                                     int callee_locals,
-                                    bool is_top_frame,
-                                    bool is_bottom_frame) {
-    return layout_activation(method,
-                             temps,
-                             popframe_args,
-                             monitors,
-                             caller_actual_parameters,
-                             callee_params,
-                             callee_locals,
-                             (frame*)NULL,
-                             (frame*)NULL,
-                             is_top_frame,
-                             is_bottom_frame);
-  }
+                                    bool is_top_frame);
 
-  static int       layout_activation(Method* method,
+  static void      layout_activation(Method* method,
                                      int temps,
                                      int popframe_args,
                                      int monitors,
diff --git a/hotspot/src/share/vm/interpreter/linkResolver.cpp b/hotspot/src/share/vm/interpreter/linkResolver.cpp
index aa11784..8bcfc1f 100644
--- a/hotspot/src/share/vm/interpreter/linkResolver.cpp
+++ b/hotspot/src/share/vm/interpreter/linkResolver.cpp
@@ -243,7 +243,8 @@
 // Look up method in klasses, including static methods
 // Then look up local default methods
 void LinkResolver::lookup_method_in_klasses(methodHandle& result, KlassHandle klass, Symbol* name, Symbol* signature, bool checkpolymorphism, bool in_imethod_resolve, TRAPS) {
-  Method* result_oop = klass->uncached_lookup_method(name, signature);
+  // Ignore overpasses so statics can be found during resolution
+  Method* result_oop = klass->uncached_lookup_method(name, signature, Klass::skip_overpass);
 
   // JDK 8, JVMS 5.4.3.4: Interface method resolution should
   // ignore static and non-public methods of java.lang.Object,
@@ -256,6 +257,12 @@
     result_oop = NULL;
   }
 
+  // Before considering default methods, check for an overpass in the
+  // current class if a method has not been found.
+  if (result_oop == NULL) {
+    result_oop = InstanceKlass::cast(klass())->find_method(name, signature);
+  }
+
   if (result_oop == NULL) {
     Array<Method*>* default_methods = InstanceKlass::cast(klass())->default_methods();
     if (default_methods != NULL) {
@@ -276,11 +283,11 @@
 // returns first instance method
 // Looks up method in classes, then looks up local default methods
 void LinkResolver::lookup_instance_method_in_klasses(methodHandle& result, KlassHandle klass, Symbol* name, Symbol* signature, TRAPS) {
-  Method* result_oop = klass->uncached_lookup_method(name, signature);
+  Method* result_oop = klass->uncached_lookup_method(name, signature, Klass::normal);
   result = methodHandle(THREAD, result_oop);
   while (!result.is_null() && result->is_static() && result->method_holder()->super() != NULL) {
     KlassHandle super_klass = KlassHandle(THREAD, result->method_holder()->super());
-    result = methodHandle(THREAD, super_klass->uncached_lookup_method(name, signature));
+    result = methodHandle(THREAD, super_klass->uncached_lookup_method(name, signature, Klass::normal));
   }
 
   if (result.is_null()) {
@@ -302,7 +309,7 @@
   // First check in default method array
   if (!resolved_method->is_abstract() &&
     (InstanceKlass::cast(klass())->default_methods() != NULL)) {
-    int index = InstanceKlass::find_method_index(InstanceKlass::cast(klass())->default_methods(), name, signature);
+    int index = InstanceKlass::find_method_index(InstanceKlass::cast(klass())->default_methods(), name, signature, false);
     if (index >= 0 ) {
       vtable_index = InstanceKlass::cast(klass())->default_vtable_indices()->at(index);
     }
@@ -322,7 +329,7 @@
   // Specify 'true' in order to skip default methods when searching the
   // interfaces.  Function lookup_method_in_klasses() already looked for
   // the method in the default methods table.
-  result = methodHandle(THREAD, ik->lookup_method_in_all_interfaces(name, signature, true));
+  result = methodHandle(THREAD, ik->lookup_method_in_all_interfaces(name, signature, Klass::skip_defaults));
 }
 
 void LinkResolver::lookup_polymorphic_method(methodHandle& result,
diff --git a/hotspot/src/share/vm/oops/arrayKlass.cpp b/hotspot/src/share/vm/oops/arrayKlass.cpp
index fcb46b1..c55992f 100644
--- a/hotspot/src/share/vm/oops/arrayKlass.cpp
+++ b/hotspot/src/share/vm/oops/arrayKlass.cpp
@@ -64,10 +64,10 @@
   return NULL;
 }
 
-Method* ArrayKlass::uncached_lookup_method(Symbol* name, Symbol* signature) const {
+Method* ArrayKlass::uncached_lookup_method(Symbol* name, Symbol* signature, MethodLookupMode mode) const {
   // There are no methods in an array klass but the super class (Object) has some
   assert(super(), "super klass must be present");
-  return super()->uncached_lookup_method(name, signature);
+  return super()->uncached_lookup_method(name, signature, mode);
 }
 
 ArrayKlass::ArrayKlass(Symbol* name) {
diff --git a/hotspot/src/share/vm/oops/arrayKlass.hpp b/hotspot/src/share/vm/oops/arrayKlass.hpp
index 7b4ad2e..f42d96e 100644
--- a/hotspot/src/share/vm/oops/arrayKlass.hpp
+++ b/hotspot/src/share/vm/oops/arrayKlass.hpp
@@ -86,7 +86,7 @@
   objArrayOop allocate_arrayArray(int n, int length, TRAPS);
 
   // Lookup operations
-  Method* uncached_lookup_method(Symbol* name, Symbol* signature) const;
+  Method* uncached_lookup_method(Symbol* name, Symbol* signature, MethodLookupMode mode) const;
 
   // Casting from Klass*
   static ArrayKlass* cast(Klass* k) {
diff --git a/hotspot/src/share/vm/oops/instanceKlass.cpp b/hotspot/src/share/vm/oops/instanceKlass.cpp
index 43c37a4..a5d16b6 100644
--- a/hotspot/src/share/vm/oops/instanceKlass.cpp
+++ b/hotspot/src/share/vm/oops/instanceKlass.cpp
@@ -1389,7 +1389,11 @@
 
 // find_method looks up the name/signature in the local methods array
 Method* InstanceKlass::find_method(Symbol* name, Symbol* signature) const {
-  return InstanceKlass::find_method(methods(), name, signature);
+  return find_method_impl(name, signature, false);
+}
+
+Method* InstanceKlass::find_method_impl(Symbol* name, Symbol* signature, bool skipping_overpass) const {
+  return InstanceKlass::find_method_impl(methods(), name, signature, skipping_overpass);
 }
 
 // find_instance_method looks up the name/signature in the local methods array
@@ -1406,40 +1410,49 @@
 // find_method looks up the name/signature in the local methods array
 Method* InstanceKlass::find_method(
     Array<Method*>* methods, Symbol* name, Symbol* signature) {
-  int hit = find_method_index(methods, name, signature);
+  return InstanceKlass::find_method_impl(methods, name, signature, false);
+}
+
+Method* InstanceKlass::find_method_impl(
+    Array<Method*>* methods, Symbol* name, Symbol* signature, bool skipping_overpass) {
+  int hit = find_method_index(methods, name, signature, skipping_overpass);
   return hit >= 0 ? methods->at(hit): NULL;
 }
 
 // Used directly for default_methods to find the index into the
 // default_vtable_indices, and indirectly by find_method
 // find_method_index looks in the local methods array to return the index
-// of the matching name/signature
+// of the matching name/signature. If, overpass methods are being ignored,
+// the search continues to find a potential non-overpass match.  This capability
+// is important during method resolution to prefer a static method, for example,
+// over an overpass method.
 int InstanceKlass::find_method_index(
-    Array<Method*>* methods, Symbol* name, Symbol* signature) {
+    Array<Method*>* methods, Symbol* name, Symbol* signature, bool skipping_overpass) {
   int hit = binary_search(methods, name);
   if (hit != -1) {
     Method* m = methods->at(hit);
     // Do linear search to find matching signature.  First, quick check
-    // for common case
-    if (m->signature() == signature) return hit;
+    // for common case, ignoring overpasses if requested.
+    if ((m->signature() == signature) && (!skipping_overpass || !m->is_overpass())) return hit;
+
     // search downwards through overloaded methods
     int i;
     for (i = hit - 1; i >= 0; --i) {
         Method* m = methods->at(i);
         assert(m->is_method(), "must be method");
         if (m->name() != name) break;
-        if (m->signature() == signature) return i;
+        if ((m->signature() == signature) && (!skipping_overpass || !m->is_overpass())) return i;
     }
     // search upwards
     for (i = hit + 1; i < methods->length(); ++i) {
         Method* m = methods->at(i);
         assert(m->is_method(), "must be method");
         if (m->name() != name) break;
-        if (m->signature() == signature) return i;
+        if ((m->signature() == signature) && (!skipping_overpass || !m->is_overpass())) return i;
     }
     // not found
 #ifdef ASSERT
-    int index = linear_search(methods, name, signature);
+    int index = skipping_overpass ? -1 : linear_search(methods, name, signature);
     assert(index == -1, err_msg("binary search should have found entry %d", index));
 #endif
   }
@@ -1465,16 +1478,16 @@
 
 // uncached_lookup_method searches both the local class methods array and all
 // superclasses methods arrays, skipping any overpass methods in superclasses.
-Method* InstanceKlass::uncached_lookup_method(Symbol* name, Symbol* signature) const {
+Method* InstanceKlass::uncached_lookup_method(Symbol* name, Symbol* signature, MethodLookupMode mode) const {
+  MethodLookupMode lookup_mode = mode;
   Klass* klass = const_cast<InstanceKlass*>(this);
-  bool dont_ignore_overpasses = true;  // For the class being searched, find its overpasses.
   while (klass != NULL) {
-    Method* method = InstanceKlass::cast(klass)->find_method(name, signature);
-    if ((method != NULL) && (dont_ignore_overpasses || !method->is_overpass())) {
+    Method* method = InstanceKlass::cast(klass)->find_method_impl(name, signature, (lookup_mode == skip_overpass));
+    if (method != NULL) {
       return method;
     }
     klass = InstanceKlass::cast(klass)->super();
-    dont_ignore_overpasses = false;  // Ignore overpass methods in all superclasses.
+    lookup_mode = skip_overpass;   // Always ignore overpass methods in superclasses
   }
   return NULL;
 }
@@ -1489,7 +1502,7 @@
   }
   // Look up interfaces
   if (m == NULL) {
-    m = lookup_method_in_all_interfaces(name, signature, false);
+    m = lookup_method_in_all_interfaces(name, signature, normal);
   }
   return m;
 }
@@ -1499,7 +1512,7 @@
 // They should only be found in the initial InterfaceMethodRef
 Method* InstanceKlass::lookup_method_in_all_interfaces(Symbol* name,
                                                        Symbol* signature,
-                                                       bool skip_default_methods) const {
+                                                       MethodLookupMode mode) const {
   Array<Klass*>* all_ifs = transitive_interfaces();
   int num_ifs = all_ifs->length();
   InstanceKlass *ik = NULL;
@@ -1507,7 +1520,7 @@
     ik = InstanceKlass::cast(all_ifs->at(i));
     Method* m = ik->lookup_method(name, signature);
     if (m != NULL && m->is_public() && !m->is_static() &&
-        (!skip_default_methods || !m->is_default_method())) {
+        ((mode != skip_defaults) || !m->is_default_method())) {
       return m;
     }
   }
diff --git a/hotspot/src/share/vm/oops/instanceKlass.hpp b/hotspot/src/share/vm/oops/instanceKlass.hpp
index b1ed376..9010b91 100644
--- a/hotspot/src/share/vm/oops/instanceKlass.hpp
+++ b/hotspot/src/share/vm/oops/instanceKlass.hpp
@@ -490,14 +490,14 @@
   static Method* find_instance_method(Array<Method*>* methods, Symbol* name, Symbol* signature);
 
   // find a local method index in default_methods (returns -1 if not found)
-  static int find_method_index(Array<Method*>* methods, Symbol* name, Symbol* signature);
+  static int find_method_index(Array<Method*>* methods, Symbol* name, Symbol* signature, bool skipping_overpass);
 
   // lookup operation (returns NULL if not found)
-  Method* uncached_lookup_method(Symbol* name, Symbol* signature) const;
+  Method* uncached_lookup_method(Symbol* name, Symbol* signature, MethodLookupMode mode) const;
 
   // lookup a method in all the interfaces that this class implements
   // (returns NULL if not found)
-  Method* lookup_method_in_all_interfaces(Symbol* name, Symbol* signature, bool skip_default_methods) const;
+  Method* lookup_method_in_all_interfaces(Symbol* name, Symbol* signature, MethodLookupMode mode) const;
 
   // lookup a method in local defaults then in all interfaces
   // (returns NULL if not found)
@@ -1020,6 +1020,10 @@
   // Returns the array class with this class as element type
   Klass* array_klass_impl(bool or_null, TRAPS);
 
+  // find a local method (returns NULL if not found)
+  Method* find_method_impl(Symbol* name, Symbol* signature, bool skipping_overpass) const;
+  static Method* find_method_impl(Array<Method*>* methods, Symbol* name, Symbol* signature, bool skipping_overpass);
+
   // Free CHeap allocated fields.
   void release_C_heap_structures();
 public:
diff --git a/hotspot/src/share/vm/oops/klass.cpp b/hotspot/src/share/vm/oops/klass.cpp
index 5789c3f..9f02d1a 100644
--- a/hotspot/src/share/vm/oops/klass.cpp
+++ b/hotspot/src/share/vm/oops/klass.cpp
@@ -129,7 +129,7 @@
 }
 
 
-Method* Klass::uncached_lookup_method(Symbol* name, Symbol* signature) const {
+Method* Klass::uncached_lookup_method(Symbol* name, Symbol* signature, MethodLookupMode mode) const {
 #ifdef ASSERT
   tty->print_cr("Error: uncached_lookup_method called on a klass oop."
                 " Likely error: reflection method does not correctly"
diff --git a/hotspot/src/share/vm/oops/klass.hpp b/hotspot/src/share/vm/oops/klass.hpp
index e1a1f81..4b42209 100644
--- a/hotspot/src/share/vm/oops/klass.hpp
+++ b/hotspot/src/share/vm/oops/klass.hpp
@@ -154,6 +154,8 @@
   void* operator new(size_t size, ClassLoaderData* loader_data, size_t word_size, TRAPS) throw();
 
  public:
+  enum MethodLookupMode { normal, skip_overpass, skip_defaults };
+
   bool is_klass() const volatile { return true; }
 
   // super
@@ -391,10 +393,10 @@
   virtual void initialize(TRAPS);
   // lookup operation for MethodLookupCache
   friend class MethodLookupCache;
-  virtual Method* uncached_lookup_method(Symbol* name, Symbol* signature) const;
+  virtual Method* uncached_lookup_method(Symbol* name, Symbol* signature, MethodLookupMode mode) const;
  public:
   Method* lookup_method(Symbol* name, Symbol* signature) const {
-    return uncached_lookup_method(name, signature);
+    return uncached_lookup_method(name, signature, normal);
   }
 
   // array class with specific rank
diff --git a/hotspot/src/share/vm/oops/klassVtable.cpp b/hotspot/src/share/vm/oops/klassVtable.cpp
index a7fc062..ad185c7 100644
--- a/hotspot/src/share/vm/oops/klassVtable.cpp
+++ b/hotspot/src/share/vm/oops/klassVtable.cpp
@@ -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
@@ -622,7 +622,7 @@
   // this check for all access permissions.
   InstanceKlass *sk = InstanceKlass::cast(super);
   if (sk->has_miranda_methods()) {
-    if (sk->lookup_method_in_all_interfaces(name, signature, false) != NULL) {
+    if (sk->lookup_method_in_all_interfaces(name, signature, Klass::normal) != NULL) {
       return false;  // found a matching miranda; we do not need a new entry
     }
   }
@@ -698,7 +698,7 @@
              && mo->method_holder() != NULL
              && mo->method_holder()->super() != NULL)
       {
-         mo = mo->method_holder()->super()->uncached_lookup_method(name, signature);
+         mo = mo->method_holder()->super()->uncached_lookup_method(name, signature, Klass::normal);
       }
       if (mo == NULL || mo->access_flags().is_private() ) {
         // super class hierarchy does not implement it or protection is different
@@ -743,7 +743,7 @@
       if (is_miranda(im, class_methods, default_methods, super)) { // is it a miranda at all?
         InstanceKlass *sk = InstanceKlass::cast(super);
         // check if it is a duplicate of a super's miranda
-        if (sk->lookup_method_in_all_interfaces(im->name(), im->signature(), false) == NULL) {
+        if (sk->lookup_method_in_all_interfaces(im->name(), im->signature(), Klass::normal) == NULL) {
           new_mirandas->append(im);
         }
         if (all_mirandas != NULL) {
diff --git a/hotspot/src/share/vm/opto/callGenerator.cpp b/hotspot/src/share/vm/opto/callGenerator.cpp
index 7ecc1f7..ef1921a 100644
--- a/hotspot/src/share/vm/opto/callGenerator.cpp
+++ b/hotspot/src/share/vm/opto/callGenerator.cpp
@@ -266,14 +266,17 @@
 
 // Allow inlining decisions to be delayed
 class LateInlineCallGenerator : public DirectCallGenerator {
+ private:
+  // unique id for log compilation
+  jlong _unique_id;
+
  protected:
   CallGenerator* _inline_cg;
-
   virtual bool do_late_inline_check(JVMState* jvms) { return true; }
 
  public:
   LateInlineCallGenerator(ciMethod* method, CallGenerator* inline_cg) :
-    DirectCallGenerator(method, true), _inline_cg(inline_cg) {}
+    DirectCallGenerator(method, true), _inline_cg(inline_cg), _unique_id(0) {}
 
   virtual bool is_late_inline() const { return true; }
 
@@ -283,6 +286,8 @@
   virtual JVMState* generate(JVMState* jvms, Parse* parent_parser) {
     Compile *C = Compile::current();
 
+    C->log_inline_id(this);
+
     // Record that this call site should be revisited once the main
     // parse is finished.
     if (!is_mh_late_inline()) {
@@ -304,6 +309,14 @@
     C->print_inlining_move_to(this);
     C->print_inlining_update_delayed(this);
   }
+
+  virtual void set_unique_id(jlong id) {
+    _unique_id = id;
+  }
+
+  virtual jlong unique_id() const {
+    return _unique_id;
+  }
 };
 
 void LateInlineCallGenerator::do_late_inline() {
@@ -368,6 +381,8 @@
 
   C->print_inlining_move_to(this);
 
+  C->log_late_inline(this);
+
   // This check is done here because for_method_handle_inline() method
   // needs jvms for inlined state.
   if (!do_late_inline_check(jvms)) {
@@ -375,17 +390,6 @@
     return;
   }
 
-  CompileLog* log = C->log();
-  if (log != NULL) {
-    log->head("late_inline method='%d'", log->identify(method()));
-    JVMState* p = jvms;
-    while (p != NULL) {
-      log->elem("jvms bci='%d' method='%d'", p->bci(), log->identify(p->method()));
-      p = p->caller();
-    }
-    log->tail("late_inline");
-  }
-
   // Setup default node notes to be picked up by the inlining
   Node_Notes* old_nn = C->default_node_notes();
   if (old_nn != NULL) {
@@ -438,11 +442,12 @@
   virtual JVMState* generate(JVMState* jvms, Parse* parent_parser) {
     JVMState* new_jvms = LateInlineCallGenerator::generate(jvms, parent_parser);
 
+    Compile* C = Compile::current();
     if (_input_not_const) {
       // inlining won't be possible so no need to enqueue right now.
       call_node()->set_generator(this);
     } else {
-      Compile::current()->add_late_inline(this);
+      C->add_late_inline(this);
     }
     return new_jvms;
   }
@@ -483,6 +488,9 @@
 
   virtual JVMState* generate(JVMState* jvms, Parse* parent_parser) {
     Compile *C = Compile::current();
+
+    C->log_inline_id(this);
+
     C->add_string_late_inline(this);
 
     JVMState* new_jvms =  DirectCallGenerator::generate(jvms, parent_parser);
@@ -505,6 +513,8 @@
   virtual JVMState* generate(JVMState* jvms, Parse* parent_parser) {
     Compile *C = Compile::current();
 
+    C->log_inline_id(this);
+
     C->add_boxing_late_inline(this);
 
     JVMState* new_jvms =  DirectCallGenerator::generate(jvms, parent_parser);
@@ -786,6 +796,7 @@
       } else {
         const char* msg = "receiver not constant";
         if (PrintInlining)  C->print_inlining(callee, jvms->depth() - 1, jvms->bci(), msg);
+        C->log_inline_failure(msg);
       }
     }
     break;
@@ -858,6 +869,7 @@
       } else {
         const char* msg = "member_name not constant";
         if (PrintInlining)  C->print_inlining(callee, jvms->depth() - 1, jvms->bci(), msg);
+        C->log_inline_failure(msg);
       }
     }
     break;
diff --git a/hotspot/src/share/vm/opto/callGenerator.hpp b/hotspot/src/share/vm/opto/callGenerator.hpp
index d03555f..707015f 100644
--- a/hotspot/src/share/vm/opto/callGenerator.hpp
+++ b/hotspot/src/share/vm/opto/callGenerator.hpp
@@ -84,6 +84,9 @@
 
   virtual CallStaticJavaNode* call_node() const { ShouldNotReachHere(); return NULL; }
 
+  virtual void set_unique_id(jlong id)          { fatal("unique id only for late inlines"); };
+  virtual jlong unique_id() const               { fatal("unique id only for late inlines"); return 0; };
+
   // Note:  It is possible for a CG to be both inline and virtual.
   // (The hashCode intrinsic does a vtable check and an inlined fast path.)
 
diff --git a/hotspot/src/share/vm/opto/callnode.cpp b/hotspot/src/share/vm/opto/callnode.cpp
index cfe86b1..1637741 100644
--- a/hotspot/src/share/vm/opto/callnode.cpp
+++ b/hotspot/src/share/vm/opto/callnode.cpp
@@ -608,6 +608,39 @@
   }
 }
 
+// Mirror the stack size calculation in the deopt code
+// How much stack space would we need at this point in the program in
+// case of deoptimization?
+int JVMState::interpreter_frame_size() const {
+  const JVMState* jvms = this;
+  int size = 0;
+  int callee_parameters = 0;
+  int callee_locals = 0;
+  int extra_args = method()->max_stack() - stk_size();
+
+  while (jvms != NULL) {
+    int locks = jvms->nof_monitors();
+    int temps = jvms->stk_size();
+    bool is_top_frame = (jvms == this);
+    ciMethod* method = jvms->method();
+
+    int frame_size = BytesPerWord * Interpreter::size_activation(method->max_stack(),
+                                                                 temps + callee_parameters,
+                                                                 extra_args,
+                                                                 locks,
+                                                                 callee_parameters,
+                                                                 callee_locals,
+                                                                 is_top_frame);
+    size += frame_size;
+
+    callee_parameters = method->size_of_parameters();
+    callee_locals = method->max_locals();
+    extra_args = 0;
+    jvms = jvms->caller();
+  }
+  return size + Deoptimization::last_frame_adjust(0, callee_locals) * BytesPerWord;
+}
+
 //=============================================================================
 uint CallNode::cmp( const Node &n ) const
 { return _tf == ((CallNode&)n)._tf && _jvms == ((CallNode&)n)._jvms; }
diff --git a/hotspot/src/share/vm/opto/callnode.hpp b/hotspot/src/share/vm/opto/callnode.hpp
index 0d9e469..398cbfe 100644
--- a/hotspot/src/share/vm/opto/callnode.hpp
+++ b/hotspot/src/share/vm/opto/callnode.hpp
@@ -300,6 +300,7 @@
   JVMState* clone_shallow(Compile* C) const; // retains uncloned caller
   void      set_map_deep(SafePointNode *map);// reset map for all callers
   void      adapt_position(int delta);       // Adapt offsets in in-array after adding an edge.
+  int       interpreter_frame_size() const;
 
 #ifndef PRODUCT
   void      format(PhaseRegAlloc *regalloc, const Node *n, outputStream* st) const;
diff --git a/hotspot/src/share/vm/opto/compile.cpp b/hotspot/src/share/vm/opto/compile.cpp
index 4830367..36e39bc 100644
--- a/hotspot/src/share/vm/opto/compile.cpp
+++ b/hotspot/src/share/vm/opto/compile.cpp
@@ -440,6 +440,14 @@
   return words;
 }
 
+// To bang the stack of this compiled method we use the stack size
+// that the interpreter would need in case of a deoptimization. This
+// removes the need to bang the stack in the deoptimization blob which
+// in turn simplifies stack overflow handling.
+int Compile::bang_size_in_bytes() const {
+  return MAX2(_interpreter_frame_size, frame_size_in_bytes());
+}
+
 // ============================================================================
 //------------------------------CompileWrapper---------------------------------
 class CompileWrapper : public StackObj {
@@ -664,7 +672,8 @@
                   _print_inlining_list(NULL),
                   _print_inlining_stream(NULL),
                   _print_inlining_idx(0),
-                  _preserve_jvm_state(0) {
+                  _preserve_jvm_state(0),
+                  _interpreter_frame_size(0) {
   C = this;
 
   CompileWrapper cw(this);
@@ -969,7 +978,8 @@
     _print_inlining_stream(NULL),
     _print_inlining_idx(0),
     _preserve_jvm_state(0),
-    _allowed_reasons(0) {
+    _allowed_reasons(0),
+    _interpreter_frame_size(0) {
   C = this;
 
 #ifndef PRODUCT
@@ -3078,8 +3088,12 @@
       Node* m = n->in(i);
       ++i;
       if (m != NULL && !frc._visited.test_set(m->_idx)) {
-        if (m->is_SafePoint() && m->as_SafePoint()->jvms() != NULL)
+        if (m->is_SafePoint() && m->as_SafePoint()->jvms() != NULL) {
+          // compute worst case interpreter size in case of a deoptimization
+          update_interpreter_frame_size(m->as_SafePoint()->jvms()->interpreter_frame_size());
+
           sfpt.push(m);
+        }
         cnt = m->req();
         nstack.push(n, i); // put on stack parent and next input's index
         n = m;
@@ -3851,7 +3865,7 @@
 
 void Compile::dump_inlining() {
   bool do_print_inlining = print_inlining() || print_intrinsics();
-  if (do_print_inlining) {
+  if (do_print_inlining || log() != NULL) {
     // Print inlining message for candidates that we couldn't inline
     // for lack of space
     for (int i = 0; i < _late_inlines.length(); i++) {
@@ -3861,6 +3875,7 @@
         if (do_print_inlining) {
           cg->print_inlining_late(msg);
         }
+        log_late_inline_failure(cg, msg);
       }
     }
   }
@@ -3871,6 +3886,48 @@
   }
 }
 
+void Compile::log_late_inline(CallGenerator* cg) {
+  if (log() != NULL) {
+    log()->head("late_inline method='%d'  inline_id='" JLONG_FORMAT "'", log()->identify(cg->method()),
+                cg->unique_id());
+    JVMState* p = cg->call_node()->jvms();
+    while (p != NULL) {
+      log()->elem("jvms bci='%d' method='%d'", p->bci(), log()->identify(p->method()));
+      p = p->caller();
+    }
+    log()->tail("late_inline");
+  }
+}
+
+void Compile::log_late_inline_failure(CallGenerator* cg, const char* msg) {
+  log_late_inline(cg);
+  if (log() != NULL) {
+    log()->inline_fail(msg);
+  }
+}
+
+void Compile::log_inline_id(CallGenerator* cg) {
+  if (log() != NULL) {
+    // The LogCompilation tool needs a unique way to identify late
+    // inline call sites. This id must be unique for this call site in
+    // this compilation. Try to have it unique across compilations as
+    // well because it can be convenient when grepping through the log
+    // file.
+    // Distinguish OSR compilations from others in case CICountOSR is
+    // on.
+    jlong id = ((jlong)unique()) + (((jlong)compile_id()) << 33) + (CICountOSR && is_osr_compilation() ? ((jlong)1) << 32 : 0);
+    cg->set_unique_id(id);
+    log()->elem("inline_id id='" JLONG_FORMAT "'", id);
+  }
+}
+
+void Compile::log_inline_failure(const char* msg) {
+  if (C->log() != NULL) {
+    C->log()->inline_fail(msg);
+  }
+}
+
+
 // Dump inlining replay data to the stream.
 // Don't change thread state and acquire any locks.
 void Compile::dump_inline_data(outputStream* out) {
@@ -4048,8 +4105,8 @@
     worklist.push(root());
     for (uint next = 0; next < worklist.size(); ++next) {
       Node *n  = worklist.at(next);
-      const Type* t = igvn.type(n);
-      assert(t == t->remove_speculative(), "no more speculative types");
+      const Type* t = igvn.type_or_null(n);
+      assert((t == NULL) || (t == t->remove_speculative()), "no more speculative types");
       if (n->is_Type()) {
         t = n->as_Type()->type();
         assert(t == t->remove_speculative(), "no more speculative types");
diff --git a/hotspot/src/share/vm/opto/compile.hpp b/hotspot/src/share/vm/opto/compile.hpp
index 43e691e..76ff092 100644
--- a/hotspot/src/share/vm/opto/compile.hpp
+++ b/hotspot/src/share/vm/opto/compile.hpp
@@ -440,6 +440,8 @@
   void print_inlining_push();
   PrintInliningBuffer& print_inlining_current();
 
+  void log_late_inline_failure(CallGenerator* cg, const char* msg);
+
  public:
 
   outputStream* print_inlining_stream() const {
@@ -459,6 +461,10 @@
     print_inlining_stream()->print(ss.as_string());
   }
 
+  void log_late_inline(CallGenerator* cg);
+  void log_inline_id(CallGenerator* cg);
+  void log_inline_failure(const char* msg);
+
   void* replay_inline_data() const { return _replay_inline_data; }
 
   // Dump inlining replay data to the stream.
@@ -478,6 +484,7 @@
   RegMask               _FIRST_STACK_mask;      // All stack slots usable for spills (depends on frame layout)
   Arena*                _indexSet_arena;        // control IndexSet allocation within PhaseChaitin
   void*                 _indexSet_free_block_list; // free list of IndexSet bit blocks
+  int                   _interpreter_frame_size;
 
   uint                  _node_bundling_limit;
   Bundle*               _node_bundling_base;    // Information for instruction bundling
@@ -935,6 +942,7 @@
   PhaseRegAlloc*    regalloc()                  { return _regalloc; }
   int               frame_slots() const         { return _frame_slots; }
   int               frame_size_in_words() const; // frame_slots in units of the polymorphic 'words'
+  int               frame_size_in_bytes() const { return _frame_slots << LogBytesPerInt; }
   RegMask&          FIRST_STACK_mask()          { return _FIRST_STACK_mask; }
   Arena*            indexSet_arena()            { return _indexSet_arena; }
   void*             indexSet_free_block_list()  { return _indexSet_free_block_list; }
@@ -946,6 +954,13 @@
   bool          need_stack_bang(int frame_size_in_bytes) const;
   bool          need_register_stack_bang() const;
 
+  void  update_interpreter_frame_size(int size) {
+    if (_interpreter_frame_size < size) {
+      _interpreter_frame_size = size;
+    }
+  }
+  int           bang_size_in_bytes() const;
+
   void          set_matcher(Matcher* m)                 { _matcher = m; }
 //void          set_regalloc(PhaseRegAlloc* ra)           { _regalloc = ra; }
   void          set_indexSet_arena(Arena* a)            { _indexSet_arena = a; }
diff --git a/hotspot/src/share/vm/opto/doCall.cpp b/hotspot/src/share/vm/opto/doCall.cpp
index c2cfe8a..d806d0a 100644
--- a/hotspot/src/share/vm/opto/doCall.cpp
+++ b/hotspot/src/share/vm/opto/doCall.cpp
@@ -104,6 +104,9 @@
         log->print(" receiver2='%d' receiver2_count='%d'", r2id, profile.receiver_count(1));
       }
     }
+    if (callee->is_method_handle_intrinsic()) {
+      log->print(" method_handle_intrinsic='1'");
+    }
     log->end_elem();
   }
 
@@ -296,6 +299,7 @@
   if (call_does_dispatch) {
     const char* msg = "virtual call";
     if (PrintInlining) print_inlining(callee, jvms->depth() - 1, jvms->bci(), msg);
+    C->log_inline_failure(msg);
     return CallGenerator::for_virtual_call(callee, vtable_index);
   } else {
     // Class Hierarchy Analysis or Type Profile reveals a unique target,
diff --git a/hotspot/src/share/vm/opto/escape.cpp b/hotspot/src/share/vm/opto/escape.cpp
index 286216c..883adef 100644
--- a/hotspot/src/share/vm/opto/escape.cpp
+++ b/hotspot/src/share/vm/opto/escape.cpp
@@ -711,7 +711,7 @@
         Node *val = n->in(MemNode::ValueIn);
         PointsToNode* ptn = ptnode_adr(val->_idx);
         assert(ptn != NULL, "node should be registered");
-        ptn->set_escape_state(PointsToNode::GlobalEscape);
+        set_escape_state(ptn, PointsToNode::GlobalEscape);
         // Add edge to object for unsafe access with offset.
         PointsToNode* adr_ptn = ptnode_adr(adr->_idx);
         assert(adr_ptn != NULL, "node should be registered");
diff --git a/hotspot/src/share/vm/opto/loopTransform.cpp b/hotspot/src/share/vm/opto/loopTransform.cpp
index 040345b..0893981 100644
--- a/hotspot/src/share/vm/opto/loopTransform.cpp
+++ b/hotspot/src/share/vm/opto/loopTransform.cpp
@@ -1150,6 +1150,7 @@
   // Now force out all loop-invariant dominating tests.  The optimizer
   // finds some, but we _know_ they are all useless.
   peeled_dom_test_elim(loop,old_new);
+  loop->record_for_igvn();
 }
 
 //------------------------------is_invariant-----------------------------
diff --git a/hotspot/src/share/vm/opto/loopnode.cpp b/hotspot/src/share/vm/opto/loopnode.cpp
index 401d40e7..a940674 100644
--- a/hotspot/src/share/vm/opto/loopnode.cpp
+++ b/hotspot/src/share/vm/opto/loopnode.cpp
@@ -3172,17 +3172,16 @@
   bool had_error = false;
 #ifdef ASSERT
   if (early != C->root()) {
-    // Make sure that there's a dominance path from use to LCA
-    Node* d = use;
-    while (d != LCA) {
-      d = idom(d);
+    // Make sure that there's a dominance path from LCA to early
+    Node* d = LCA;
+    while (d != early) {
       if (d == C->root()) {
-        tty->print_cr("*** Use %d isn't dominated by def %s", use->_idx, n->_idx);
-        n->dump();
-        use->dump();
+        dump_bad_graph("Bad graph detected in compute_lca_of_uses", n, early, LCA);
+        tty->print_cr("*** Use %d isn't dominated by def %d ***", use->_idx, n->_idx);
         had_error = true;
         break;
       }
+      d = idom(d);
     }
   }
 #endif
@@ -3435,6 +3434,13 @@
     _igvn._worklist.push(n);  // Maybe we'll normalize it, if no more loops.
   }
 
+#ifdef ASSERT
+  if (_verify_only && !n->is_CFG()) {
+    // Check def-use domination.
+    compute_lca_of_uses(n, get_ctrl(n), true /* verify */);
+  }
+#endif
+
   // CFG and pinned nodes already handled
   if( n->in(0) ) {
     if( n->in(0)->is_top() ) return; // Dead?
diff --git a/hotspot/src/share/vm/opto/loopopts.cpp b/hotspot/src/share/vm/opto/loopopts.cpp
index 661a9bc..67a6d70 100644
--- a/hotspot/src/share/vm/opto/loopopts.cpp
+++ b/hotspot/src/share/vm/opto/loopopts.cpp
@@ -2700,6 +2700,7 @@
   // Inhibit more partial peeling on this loop
   new_head_clone->set_partial_peel_loop();
   C->set_major_progress();
+  loop->record_for_igvn();
 
 #if !defined(PRODUCT)
   if (TracePartialPeeling) {
diff --git a/hotspot/src/share/vm/opto/machnode.hpp b/hotspot/src/share/vm/opto/machnode.hpp
index def4a0d..8d42093 100644
--- a/hotspot/src/share/vm/opto/machnode.hpp
+++ b/hotspot/src/share/vm/opto/machnode.hpp
@@ -210,7 +210,14 @@
   bool may_be_short_branch() const { return (flags() & Flag_may_be_short_branch) != 0; }
 
   // Avoid back to back some instructions on some CPUs.
-  bool avoid_back_to_back() const { return (flags() & Flag_avoid_back_to_back) != 0; }
+  enum AvoidBackToBackFlag { AVOID_NONE = 0,
+                             AVOID_BEFORE = Flag_avoid_back_to_back_before,
+                             AVOID_AFTER = Flag_avoid_back_to_back_after,
+                             AVOID_BEFORE_AND_AFTER = AVOID_BEFORE | AVOID_AFTER };
+
+  bool avoid_back_to_back(AvoidBackToBackFlag flag_value) const {
+    return (flags() & flag_value) == flag_value;
+  }
 
   // instruction implemented with a call
   bool has_call() const { return (flags() & Flag_has_call) != 0; }
diff --git a/hotspot/src/share/vm/opto/node.hpp b/hotspot/src/share/vm/opto/node.hpp
index 5f883d5..0b51d04 100644
--- a/hotspot/src/share/vm/opto/node.hpp
+++ b/hotspot/src/share/vm/opto/node.hpp
@@ -645,17 +645,18 @@
 
   // Flags are sorted by usage frequency.
   enum NodeFlags {
-    Flag_is_Copy             = 0x01, // should be first bit to avoid shift
-    Flag_rematerialize       = Flag_is_Copy << 1,
+    Flag_is_Copy                     = 0x01, // should be first bit to avoid shift
+    Flag_rematerialize               = Flag_is_Copy << 1,
     Flag_needs_anti_dependence_check = Flag_rematerialize << 1,
-    Flag_is_macro            = Flag_needs_anti_dependence_check << 1,
-    Flag_is_Con              = Flag_is_macro << 1,
-    Flag_is_cisc_alternate   = Flag_is_Con << 1,
-    Flag_is_dead_loop_safe   = Flag_is_cisc_alternate << 1,
-    Flag_may_be_short_branch = Flag_is_dead_loop_safe << 1,
-    Flag_avoid_back_to_back  = Flag_may_be_short_branch << 1,
-    Flag_has_call            = Flag_avoid_back_to_back << 1,
-    Flag_is_expensive        = Flag_has_call << 1,
+    Flag_is_macro                    = Flag_needs_anti_dependence_check << 1,
+    Flag_is_Con                      = Flag_is_macro << 1,
+    Flag_is_cisc_alternate           = Flag_is_Con << 1,
+    Flag_is_dead_loop_safe           = Flag_is_cisc_alternate << 1,
+    Flag_may_be_short_branch         = Flag_is_dead_loop_safe << 1,
+    Flag_avoid_back_to_back_before   = Flag_may_be_short_branch << 1,
+    Flag_avoid_back_to_back_after    = Flag_avoid_back_to_back_before << 1,
+    Flag_has_call                    = Flag_avoid_back_to_back_after << 1,
+    Flag_is_expensive                = Flag_has_call << 1,
     _max_flags = (Flag_is_expensive << 1) - 1 // allow flags combination
   };
 
diff --git a/hotspot/src/share/vm/opto/output.cpp b/hotspot/src/share/vm/opto/output.cpp
index debf136..ede7534 100644
--- a/hotspot/src/share/vm/opto/output.cpp
+++ b/hotspot/src/share/vm/opto/output.cpp
@@ -165,8 +165,13 @@
   // Determine if we need to generate a stack overflow check.
   // Do it if the method is not a stub function and
   // has java calls or has frame size > vm_page_size/8.
+  // The debug VM checks that deoptimization doesn't trigger an
+  // unexpected stack overflow (compiled method stack banging should
+  // guarantee it doesn't happen) so we always need the stack bang in
+  // a debug VM.
   return (UseStackBanging && stub_function() == NULL &&
-          (has_java_calls() || frame_size_in_bytes > os::vm_page_size()>>3));
+          (has_java_calls() || frame_size_in_bytes > os::vm_page_size()>>3
+           DEBUG_ONLY(|| true)));
 }
 
 bool Compile::need_register_stack_bang() const {
@@ -411,7 +416,7 @@
             blk_size += nop_size;
           }
         }
-        if (mach->avoid_back_to_back()) {
+        if (mach->avoid_back_to_back(MachNode::AVOID_BEFORE)) {
           // Nop is inserted between "avoid back to back" instructions.
           // ScheduleAndBundle() can rearrange nodes in a block,
           // check for all offsets inside this block.
@@ -439,7 +444,7 @@
         last_call_adr = blk_starts[i]+blk_size;
       }
       // Remember end of avoid_back_to_back offset
-      if (nj->is_Mach() && nj->as_Mach()->avoid_back_to_back()) {
+      if (nj->is_Mach() && nj->as_Mach()->avoid_back_to_back(MachNode::AVOID_AFTER)) {
         last_avoid_back_to_back_adr = blk_starts[i]+blk_size;
       }
     }
@@ -525,11 +530,11 @@
           int new_size = replacement->size(_regalloc);
           int diff     = br_size - new_size;
           assert(diff >= (int)nop_size, "short_branch size should be smaller");
-          // Conservatively take into accound padding between
+          // Conservatively take into account padding between
           // avoid_back_to_back branches. Previous branch could be
           // converted into avoid_back_to_back branch during next
           // rounds.
-          if (needs_padding && replacement->avoid_back_to_back()) {
+          if (needs_padding && replacement->avoid_back_to_back(MachNode::AVOID_BEFORE)) {
             jmp_offset[i] += nop_size;
             diff -= nop_size;
           }
@@ -548,7 +553,7 @@
         }
       } // (mach->may_be_short_branch())
       if (mach != NULL && (mach->may_be_short_branch() ||
-                           mach->avoid_back_to_back())) {
+                           mach->avoid_back_to_back(MachNode::AVOID_AFTER))) {
         last_may_be_short_branch_adr = blk_starts[i] + jmp_offset[i] + jmp_size[i];
       }
       blk_starts[i+1] -= adjust_block_start;
@@ -1313,7 +1318,7 @@
         if (is_sfn && !is_mcall && padding == 0 && current_offset == last_call_offset) {
           padding = nop_size;
         }
-        if (padding == 0 && mach->avoid_back_to_back() &&
+        if (padding == 0 && mach->avoid_back_to_back(MachNode::AVOID_BEFORE) &&
             current_offset == last_avoid_back_to_back_offset) {
           // Avoid back to back some instructions.
           padding = nop_size;
@@ -1407,7 +1412,7 @@
               int new_size = replacement->size(_regalloc);
               assert((br_size - new_size) >= (int)nop_size, "short_branch size should be smaller");
               // Insert padding between avoid_back_to_back branches.
-              if (needs_padding && replacement->avoid_back_to_back()) {
+              if (needs_padding && replacement->avoid_back_to_back(MachNode::AVOID_BEFORE)) {
                 MachNode *nop = new (this) MachNopNode();
                 block->insert_node(nop, j++);
                 _cfg->map_node_to_block(nop, block);
@@ -1515,7 +1520,7 @@
         last_call_offset = current_offset;
       }
 
-      if (n->is_Mach() && n->as_Mach()->avoid_back_to_back()) {
+      if (n->is_Mach() && n->as_Mach()->avoid_back_to_back(MachNode::AVOID_AFTER)) {
         // Avoid back to back some instructions.
         last_avoid_back_to_back_offset = current_offset;
       }
diff --git a/hotspot/src/share/vm/opto/phaseX.cpp b/hotspot/src/share/vm/opto/phaseX.cpp
index 61918f4..276fafc 100644
--- a/hotspot/src/share/vm/opto/phaseX.cpp
+++ b/hotspot/src/share/vm/opto/phaseX.cpp
@@ -831,154 +831,111 @@
   }
 }
 
+/**
+ * Initialize worklist for each node.
+ */
+void PhaseIterGVN::init_worklist(Node* first) {
+  Unique_Node_List to_process;
+  to_process.push(first);
+
+  while (to_process.size() > 0) {
+    Node* n = to_process.pop();
+    if (!_worklist.member(n)) {
+      _worklist.push(n);
+
+      uint cnt = n->req();
+      for(uint i = 0; i < cnt; i++) {
+        Node* m = n->in(i);
+        if (m != NULL) {
+          to_process.push(m);
+        }
+      }
+    }
+  }
+}
 
 #ifndef PRODUCT
 void PhaseIterGVN::verify_step(Node* n) {
-  _verify_window[_verify_counter % _verify_window_size] = n;
-  ++_verify_counter;
-  ResourceMark rm;
-  ResourceArea *area = Thread::current()->resource_area();
-  VectorSet old_space(area), new_space(area);
-  if (C->unique() < 1000 ||
-      0 == _verify_counter % (C->unique() < 10000 ? 10 : 100)) {
-    ++_verify_full_passes;
-    Node::verify_recur(C->root(), -1, old_space, new_space);
-  }
-  const int verify_depth = 4;
-  for ( int i = 0; i < _verify_window_size; i++ ) {
-    Node* n = _verify_window[i];
-    if ( n == NULL )  continue;
-    if( n->in(0) == NodeSentinel ) {  // xform_idom
-      _verify_window[i] = n->in(1);
-      --i; continue;
+  if (VerifyIterativeGVN) {
+    _verify_window[_verify_counter % _verify_window_size] = n;
+    ++_verify_counter;
+    ResourceMark rm;
+    ResourceArea* area = Thread::current()->resource_area();
+    VectorSet old_space(area), new_space(area);
+    if (C->unique() < 1000 ||
+        0 == _verify_counter % (C->unique() < 10000 ? 10 : 100)) {
+      ++_verify_full_passes;
+      Node::verify_recur(C->root(), -1, old_space, new_space);
     }
-    // Typical fanout is 1-2, so this call visits about 6 nodes.
-    Node::verify_recur(n, verify_depth, old_space, new_space);
-  }
-}
-#endif
-
-
-//------------------------------init_worklist----------------------------------
-// Initialize worklist for each node.
-void PhaseIterGVN::init_worklist( Node *n ) {
-  if( _worklist.member(n) ) return;
-  _worklist.push(n);
-  uint cnt = n->req();
-  for( uint i =0 ; i < cnt; i++ ) {
-    Node *m = n->in(i);
-    if( m ) init_worklist(m);
-  }
-}
-
-//------------------------------optimize---------------------------------------
-void PhaseIterGVN::optimize() {
-  debug_only(uint num_processed  = 0;);
-#ifndef PRODUCT
-  {
-    _verify_counter = 0;
-    _verify_full_passes = 0;
+    const int verify_depth = 4;
     for ( int i = 0; i < _verify_window_size; i++ ) {
-      _verify_window[i] = NULL;
+      Node* n = _verify_window[i];
+      if ( n == NULL )  continue;
+      if( n->in(0) == NodeSentinel ) {  // xform_idom
+        _verify_window[i] = n->in(1);
+        --i; continue;
+      }
+      // Typical fanout is 1-2, so this call visits about 6 nodes.
+      Node::verify_recur(n, verify_depth, old_space, new_space);
     }
   }
-#endif
+}
 
-#ifdef ASSERT
-  Node* prev = NULL;
-  uint rep_cnt = 0;
-#endif
-  uint loop_count = 0;
-
-  // Pull from worklist; transform node;
-  // If node has changed: update edge info and put uses on worklist.
-  while( _worklist.size() ) {
-    if (C->check_node_count(NodeLimitFudgeFactor * 2,
-                            "out of nodes optimizing method")) {
-      return;
-    }
-    Node *n  = _worklist.pop();
-    if (++loop_count >= K * C->live_nodes()) {
-      debug_only(n->dump(4);)
-      assert(false, "infinite loop in PhaseIterGVN::optimize");
-      C->record_method_not_compilable("infinite loop in PhaseIterGVN::optimize");
-      return;
-    }
-#ifdef ASSERT
-    if (n == prev) {
-      if (++rep_cnt > 3) {
-        n->dump(4);
-        assert(false, "loop in Ideal transformation");
+void PhaseIterGVN::trace_PhaseIterGVN(Node* n, Node* nn, const Type* oldtype) {
+  if (TraceIterativeGVN) {
+    uint wlsize = _worklist.size();
+    const Type* newtype = type_or_null(n);
+    if (nn != n) {
+      // print old node
+      tty->print("< ");
+      if (oldtype != newtype && oldtype != NULL) {
+        oldtype->dump();
       }
-    } else {
-      rep_cnt = 0;
+      do { tty->print("\t"); } while (tty->position() < 16);
+      tty->print("<");
+      n->dump();
     }
-    prev = n;
-#endif
-    if (TraceIterativeGVN && Verbose) {
-      tty->print("  Pop ");
-      NOT_PRODUCT( n->dump(); )
-      debug_only(if( (num_processed++ % 100) == 0 ) _worklist.print_set();)
+    if (oldtype != newtype || nn != n) {
+      // print new node and/or new type
+      if (oldtype == NULL) {
+        tty->print("* ");
+      } else if (nn != n) {
+        tty->print("> ");
+      } else {
+        tty->print("= ");
+      }
+      if (newtype == NULL) {
+        tty->print("null");
+      } else {
+        newtype->dump();
+      }
+      do { tty->print("\t"); } while (tty->position() < 16);
+      nn->dump();
     }
-
-    if (n->outcnt() != 0) {
-
-#ifndef PRODUCT
-      uint wlsize = _worklist.size();
-      const Type* oldtype = type_or_null(n);
-#endif //PRODUCT
-
-      Node *nn = transform_old(n);
-
-#ifndef PRODUCT
-      if (TraceIterativeGVN) {
-        const Type* newtype = type_or_null(n);
-        if (nn != n) {
-          // print old node
-          tty->print("< ");
-          if (oldtype != newtype && oldtype != NULL) {
-            oldtype->dump();
-          }
-          do { tty->print("\t"); } while (tty->position() < 16);
-          tty->print("<");
-          n->dump();
-        }
-        if (oldtype != newtype || nn != n) {
-          // print new node and/or new type
-          if (oldtype == NULL) {
-            tty->print("* ");
-          } else if (nn != n) {
-            tty->print("> ");
-          } else {
-            tty->print("= ");
-          }
-          if (newtype == NULL) {
-            tty->print("null");
-          } else {
-            newtype->dump();
-          }
-          do { tty->print("\t"); } while (tty->position() < 16);
-          nn->dump();
-        }
-        if (Verbose && wlsize < _worklist.size()) {
-          tty->print("  Push {");
-          while (wlsize != _worklist.size()) {
-            Node* pushed = _worklist.at(wlsize++);
-            tty->print(" %d", pushed->_idx);
-          }
-          tty->print_cr(" }");
-        }
+    if (Verbose && wlsize < _worklist.size()) {
+      tty->print("  Push {");
+      while (wlsize != _worklist.size()) {
+        Node* pushed = _worklist.at(wlsize++);
+        tty->print(" %d", pushed->_idx);
       }
-      if( VerifyIterativeGVN && nn != n ) {
-        verify_step((Node*) NULL);  // ignore n, it might be subsumed
-      }
-#endif
-    } else if (!n->is_top()) {
-      remove_dead_node(n);
+      tty->print_cr(" }");
+    }
+    if (nn != n) {
+      // ignore n, it might be subsumed
+      verify_step((Node*) NULL);
     }
   }
+}
 
-#ifndef PRODUCT
+void PhaseIterGVN::init_verifyPhaseIterGVN() {
+  _verify_counter = 0;
+  _verify_full_passes = 0;
+  for (int i = 0; i < _verify_window_size; i++) {
+    _verify_window[i] = NULL;
+  }
+}
+
+void PhaseIterGVN::verify_PhaseIterGVN() {
   C->verify_graph_edges();
   if( VerifyOpto && allow_progress() ) {
     // Must turn off allow_progress to enable assert and break recursion
@@ -998,21 +955,78 @@
       igvn2.set_allow_progress(true);
     }
   }
-  if ( VerifyIterativeGVN && PrintOpto ) {
-    if ( _verify_counter == _verify_full_passes )
+  if (VerifyIterativeGVN && PrintOpto) {
+    if (_verify_counter == _verify_full_passes) {
       tty->print_cr("VerifyIterativeGVN: %d transforms and verify passes",
                     _verify_full_passes);
-    else
+    } else {
       tty->print_cr("VerifyIterativeGVN: %d transforms, %d full verify passes",
                   _verify_counter, _verify_full_passes);
+    }
   }
-#endif
+}
+#endif /* PRODUCT */
+
+#ifdef ASSERT
+/**
+ * Dumps information that can help to debug the problem. A debug
+ * build fails with an assert.
+ */
+void PhaseIterGVN::dump_infinite_loop_info(Node* n) {
+  n->dump(4);
+  _worklist.dump();
+  assert(false, "infinite loop in PhaseIterGVN::optimize");
+}
+
+/**
+ * Prints out information about IGVN if the 'verbose' option is used.
+ */
+void PhaseIterGVN::trace_PhaseIterGVN_verbose(Node* n, int num_processed) {
+  if (TraceIterativeGVN && Verbose) {
+    tty->print("  Pop ");
+    n->dump();
+    if ((num_processed % 100) == 0) {
+      _worklist.print_set();
+    }
+  }
+}
+#endif /* ASSERT */
+
+void PhaseIterGVN::optimize() {
+  DEBUG_ONLY(uint num_processed  = 0;)
+  NOT_PRODUCT(init_verifyPhaseIterGVN();)
+
+  uint loop_count = 0;
+  // Pull from worklist and transform the node. If the node has changed,
+  // update edge info and put uses on worklist.
+  while(_worklist.size()) {
+    if (C->check_node_count(NodeLimitFudgeFactor * 2, "Out of nodes")) {
+      return;
+    }
+    Node* n  = _worklist.pop();
+    if (++loop_count >= K * C->live_nodes()) {
+      DEBUG_ONLY(dump_infinite_loop_info(n);)
+      C->record_method_not_compilable("infinite loop in PhaseIterGVN::optimize");
+      return;
+    }
+    DEBUG_ONLY(trace_PhaseIterGVN_verbose(n, num_processed++);)
+    if (n->outcnt() != 0) {
+      NOT_PRODUCT(const Type* oldtype = type_or_null(n));
+      // Do the transformation
+      Node* nn = transform_old(n);
+      NOT_PRODUCT(trace_PhaseIterGVN(n, nn, oldtype);)
+    } else if (!n->is_top()) {
+      remove_dead_node(n);
+    }
+  }
+  NOT_PRODUCT(verify_PhaseIterGVN();)
 }
 
 
-//------------------register_new_node_with_optimizer---------------------------
-// Register a new node with the optimizer.  Update the types array, the def-use
-// info.  Put on worklist.
+/**
+ * Register a new node with the optimizer.  Update the types array, the def-use
+ * info.  Put on worklist.
+ */
 Node* PhaseIterGVN::register_new_node_with_optimizer(Node* n, Node* orig) {
   set_type_bottom(n);
   _worklist.push(n);
@@ -1038,32 +1052,29 @@
   return transform_old(n);
 }
 
-//------------------------------transform_old----------------------------------
-Node *PhaseIterGVN::transform_old( Node *n ) {
-#ifndef PRODUCT
-  debug_only(uint loop_count = 0;);
-  set_transforms();
-#endif
+Node *PhaseIterGVN::transform_old(Node* n) {
+  DEBUG_ONLY(uint loop_count = 0;);
+  NOT_PRODUCT(set_transforms());
+
   // Remove 'n' from hash table in case it gets modified
   _table.hash_delete(n);
-  if( VerifyIterativeGVN ) {
-   assert( !_table.find_index(n->_idx), "found duplicate entry in table");
+  if (VerifyIterativeGVN) {
+   assert(!_table.find_index(n->_idx), "found duplicate entry in table");
   }
 
   // Apply the Ideal call in a loop until it no longer applies
-  Node *k = n;
+  Node* k = n;
   DEBUG_ONLY(dead_loop_check(k);)
   DEBUG_ONLY(bool is_new = (k->outcnt() == 0);)
-  Node *i = k->Ideal(this, /*can_reshape=*/true);
+  Node* i = k->Ideal(this, /*can_reshape=*/true);
   assert(i != k || is_new || i->outcnt() > 0, "don't return dead nodes");
 #ifndef PRODUCT
-  if( VerifyIterativeGVN )
-    verify_step(k);
-  if( i && VerifyOpto ) {
-    if( !allow_progress() ) {
-      if (i->is_Add() && i->outcnt() == 1) {
+  verify_step(k);
+  if (i && VerifyOpto ) {
+    if (!allow_progress()) {
+      if (i->is_Add() && (i->outcnt() == 1)) {
         // Switched input to left side because this is the only use
-      } else if( i->is_If() && (i->in(0) == NULL) ) {
+      } else if (i->is_If() && (i->in(0) == NULL)) {
         // This IF is dead because it is dominated by an equivalent IF When
         // dominating if changed, info is not propagated sparsely to 'this'
         // Propagating this info further will spuriously identify other
@@ -1071,35 +1082,38 @@
         return i;
       } else
         set_progress();
-    } else
+    } else {
       set_progress();
+    }
   }
 #endif
 
-  while( i ) {
+  while (i != NULL) {
 #ifndef PRODUCT
-    debug_only( if( loop_count >= K ) i->dump(4); )
-    assert(loop_count < K, "infinite loop in PhaseIterGVN::transform");
-    debug_only( loop_count++; )
+    if (loop_count >= K) {
+      dump_infinite_loop_info(i);
+    }
+    loop_count++;
 #endif
     assert((i->_idx >= k->_idx) || i->is_top(), "Idealize should return new nodes, use Identity to return old nodes");
     // Made a change; put users of original Node on worklist
-    add_users_to_worklist( k );
+    add_users_to_worklist(k);
     // Replacing root of transform tree?
-    if( k != i ) {
+    if (k != i) {
       // Make users of old Node now use new.
-      subsume_node( k, i );
+      subsume_node(k, i);
       k = i;
     }
     DEBUG_ONLY(dead_loop_check(k);)
     // Try idealizing again
     DEBUG_ONLY(is_new = (k->outcnt() == 0);)
     i = k->Ideal(this, /*can_reshape=*/true);
-    assert(i != k || is_new || i->outcnt() > 0, "don't return dead nodes");
+    assert(i != k || is_new || (i->outcnt() > 0), "don't return dead nodes");
 #ifndef PRODUCT
-    if( VerifyIterativeGVN )
-      verify_step(k);
-    if( i && VerifyOpto ) set_progress();
+    verify_step(k);
+    if (i && VerifyOpto) {
+      set_progress();
+    }
 #endif
   }
 
@@ -1107,48 +1121,49 @@
   ensure_type_or_null(k);
 
   // See what kind of values 'k' takes on at runtime
-  const Type *t = k->Value(this);
+  const Type* t = k->Value(this);
   assert(t != NULL, "value sanity");
 
   // Since I just called 'Value' to compute the set of run-time values
   // for this Node, and 'Value' is non-local (and therefore expensive) I'll
   // cache Value.  Later requests for the local phase->type of this Node can
   // use the cached Value instead of suffering with 'bottom_type'.
-  if (t != type_or_null(k)) {
-    NOT_PRODUCT( set_progress(); )
-    NOT_PRODUCT( inc_new_values();)
+  if (type_or_null(k) != t) {
+#ifndef PRODUCT
+    inc_new_values();
+    set_progress();
+#endif
     set_type(k, t);
     // If k is a TypeNode, capture any more-precise type permanently into Node
     k->raise_bottom_type(t);
     // Move users of node to worklist
-    add_users_to_worklist( k );
+    add_users_to_worklist(k);
   }
-
   // If 'k' computes a constant, replace it with a constant
-  if( t->singleton() && !k->is_Con() ) {
-    NOT_PRODUCT( set_progress(); )
-    Node *con = makecon(t);     // Make a constant
-    add_users_to_worklist( k );
-    subsume_node( k, con );     // Everybody using k now uses con
+  if (t->singleton() && !k->is_Con()) {
+    NOT_PRODUCT(set_progress();)
+    Node* con = makecon(t);     // Make a constant
+    add_users_to_worklist(k);
+    subsume_node(k, con);       // Everybody using k now uses con
     return con;
   }
 
   // Now check for Identities
-  i = k->Identity(this);        // Look for a nearby replacement
-  if( i != k ) {                // Found? Return replacement!
-    NOT_PRODUCT( set_progress(); )
-    add_users_to_worklist( k );
-    subsume_node( k, i );       // Everybody using k now uses i
+  i = k->Identity(this);      // Look for a nearby replacement
+  if (i != k) {                // Found? Return replacement!
+    NOT_PRODUCT(set_progress();)
+    add_users_to_worklist(k);
+    subsume_node(k, i);       // Everybody using k now uses i
     return i;
   }
 
   // Global Value Numbering
   i = hash_find_insert(k);      // Check for pre-existing node
-  if( i && (i != k) ) {
+  if (i && (i != k)) {
     // Return the pre-existing node if it isn't dead
-    NOT_PRODUCT( set_progress(); )
-    add_users_to_worklist( k );
-    subsume_node( k, i );       // Everybody using k now uses i
+    NOT_PRODUCT(set_progress();)
+    add_users_to_worklist(k);
+    subsume_node(k, i);       // Everybody using k now uses i
     return i;
   }
 
@@ -1514,6 +1529,21 @@
   C->set_root( transform(C->root())->as_Root() );
   assert( C->top(),  "missing TOP node" );
   assert( C->root(), "missing root" );
+
+  // Eagerly remove castPP nodes here. CastPP nodes might not be
+  // removed in the subsequent IGVN phase if a node that changes
+  // in(1) of a castPP is processed prior to the castPP node.
+  for (uint i = 0; i < _worklist.size(); i++) {
+    Node* n = _worklist.at(i);
+
+    if (n->is_ConstraintCast()) {
+      Node* nn = n->Identity(this);
+      if (nn != n) {
+        replace_node(n, nn);
+        --i;
+      }
+    }
+  }
 }
 
 //------------------------------transform--------------------------------------
diff --git a/hotspot/src/share/vm/opto/phaseX.hpp b/hotspot/src/share/vm/opto/phaseX.hpp
index fcdd47e..ccb2481 100644
--- a/hotspot/src/share/vm/opto/phaseX.hpp
+++ b/hotspot/src/share/vm/opto/phaseX.hpp
@@ -440,6 +440,17 @@
   // and dominator info to a fixed point.
   void optimize();
 
+#ifndef PRODUCT
+  void trace_PhaseIterGVN(Node* n, Node* nn, const Type* old_type);
+  void init_verifyPhaseIterGVN();
+  void verify_PhaseIterGVN();
+#endif
+
+#ifdef ASSERT
+  void dump_infinite_loop_info(Node* n);
+  void trace_PhaseIterGVN_verbose(Node* n, int num_processed);
+#endif
+
   // Register a new node with the iter GVN pass without transforming it.
   // Used when we need to restructure a Region/Phi area and all the Regions
   // and Phis need to complete this one big transform before any other
diff --git a/hotspot/src/share/vm/prims/jni.cpp b/hotspot/src/share/vm/prims/jni.cpp
index c73b677..ad48167 100644
--- a/hotspot/src/share/vm/prims/jni.cpp
+++ b/hotspot/src/share/vm/prims/jni.cpp
@@ -2420,7 +2420,7 @@
 
 DEFINE_SETSTATICFIELD(jboolean, bool,   Boolean, 'Z', z
                       , HOTSPOT_JNI_SETSTATICBOOLEANFIELD_ENTRY(env, clazz, (uintptr_t)fieldID, value),
-                      HOTSPOT_JNI_SETBOOLEANFIELD_RETURN())
+                      HOTSPOT_JNI_SETSTATICBOOLEANFIELD_RETURN())
 DEFINE_SETSTATICFIELD(jbyte,    byte,   Byte,    'B', b
                       , HOTSPOT_JNI_SETSTATICBYTEFIELD_ENTRY(env, clazz, (uintptr_t) fieldID, value),
                       HOTSPOT_JNI_SETSTATICBYTEFIELD_RETURN())
diff --git a/hotspot/src/share/vm/prims/jvm.cpp b/hotspot/src/share/vm/prims/jvm.cpp
index fec483f..9104fb5 100644
--- a/hotspot/src/share/vm/prims/jvm.cpp
+++ b/hotspot/src/share/vm/prims/jvm.cpp
@@ -1215,7 +1215,8 @@
   // get run() method
   Method* m_oop = object->klass()->uncached_lookup_method(
                                            vmSymbols::run_method_name(),
-                                           vmSymbols::void_object_signature());
+                                           vmSymbols::void_object_signature(),
+                                           Klass::normal);
   methodHandle m (THREAD, m_oop);
   if (m.is_null() || !m->is_method() || !m()->is_public() || m()->is_static()) {
     THROW_MSG_0(vmSymbols::java_lang_InternalError(), "No run method");
diff --git a/hotspot/src/share/vm/prims/nativeLookup.cpp b/hotspot/src/share/vm/prims/nativeLookup.cpp
index d301513..188e7fc 100644
--- a/hotspot/src/share/vm/prims/nativeLookup.cpp
+++ b/hotspot/src/share/vm/prims/nativeLookup.cpp
@@ -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
@@ -408,7 +408,7 @@
 
   // Find method and invoke standard lookup
   methodHandle method (THREAD,
-                       klass->uncached_lookup_method(m_name, s_name));
+                       klass->uncached_lookup_method(m_name, s_name, Klass::normal));
   address result = lookup(method, in_base_library, CATCH);
   assert(in_base_library, "must be in basic library");
   guarantee(result != NULL, "must be non NULL");
diff --git a/hotspot/src/share/vm/runtime/advancedThresholdPolicy.cpp b/hotspot/src/share/vm/runtime/advancedThresholdPolicy.cpp
index 4c36c44..5483a72 100644
--- a/hotspot/src/share/vm/runtime/advancedThresholdPolicy.cpp
+++ b/hotspot/src/share/vm/runtime/advancedThresholdPolicy.cpp
@@ -53,7 +53,8 @@
   }
 
   set_c1_count(MAX2(count / 3, 1));
-  set_c2_count(MAX2(count - count / 3, 1));
+  set_c2_count(MAX2(count - c1_count(), 1));
+  FLAG_SET_ERGO(intx, CICompilerCount, c1_count() + c2_count());
 
   // Some inlining tuning
 #ifdef X86
diff --git a/hotspot/src/share/vm/runtime/arguments.cpp b/hotspot/src/share/vm/runtime/arguments.cpp
index f1b53de..0d1655c 100644
--- a/hotspot/src/share/vm/runtime/arguments.cpp
+++ b/hotspot/src/share/vm/runtime/arguments.cpp
@@ -2402,6 +2402,10 @@
   const int num_min_compiler_threads = (TieredCompilation && (TieredStopAtLevel >= CompLevel_full_optimization)) ? 2 : 1;
   status &=verify_min_value(CICompilerCount, num_min_compiler_threads, "CICompilerCount");
 
+  if (!FLAG_IS_DEFAULT(CICompilerCount) && !FLAG_IS_DEFAULT(CICompilerCountPerCPU) && CICompilerCountPerCPU) {
+    warning("The VM option CICompilerCountPerCPU overrides CICompilerCount.");
+  }
+
   return status;
 }
 
diff --git a/hotspot/src/share/vm/runtime/compilationPolicy.cpp b/hotspot/src/share/vm/runtime/compilationPolicy.cpp
index 1178509..268a670 100644
--- a/hotspot/src/share/vm/runtime/compilationPolicy.cpp
+++ b/hotspot/src/share/vm/runtime/compilationPolicy.cpp
@@ -182,6 +182,7 @@
     // max(log2(8)-1,1) = 2 compiler threads on an 8-way machine.
     // May help big-app startup time.
     _compiler_count = MAX2(log2_intptr(os::active_processor_count())-1,1);
+    FLAG_SET_ERGO(intx, CICompilerCount, _compiler_count);
   } else {
     _compiler_count = CICompilerCount;
   }
diff --git a/hotspot/src/share/vm/runtime/deoptimization.cpp b/hotspot/src/share/vm/runtime/deoptimization.cpp
index 8e3b14c..75e6859 100644
--- a/hotspot/src/share/vm/runtime/deoptimization.cpp
+++ b/hotspot/src/share/vm/runtime/deoptimization.cpp
@@ -420,15 +420,9 @@
     // frame[number_of_frames - 1 ] = on_stack_size(youngest)
     // frame[number_of_frames - 2 ] = on_stack_size(sender(youngest))
     // frame[number_of_frames - 3 ] = on_stack_size(sender(sender(youngest)))
-    int caller_parms = callee_parameters;
-    if ((index == array->frames() - 1) && caller_was_method_handle) {
-      caller_parms = 0;
-    }
-    frame_sizes[number_of_frames - 1 - index] = BytesPerWord * array->element(index)->on_stack_size(caller_parms,
-                                                                                                    callee_parameters,
+    frame_sizes[number_of_frames - 1 - index] = BytesPerWord * array->element(index)->on_stack_size(callee_parameters,
                                                                                                     callee_locals,
                                                                                                     index == 0,
-                                                                                                    index == array->frames() - 1,
                                                                                                     popframe_extra_args);
     // This pc doesn't have to be perfect just good enough to identify the frame
     // as interpreted so the skeleton frame will be walkable
diff --git a/hotspot/src/share/vm/runtime/sharedRuntime.cpp b/hotspot/src/share/vm/runtime/sharedRuntime.cpp
index c14f8d4..51eea31 100644
--- a/hotspot/src/share/vm/runtime/sharedRuntime.cpp
+++ b/hotspot/src/share/vm/runtime/sharedRuntime.cpp
@@ -775,10 +775,13 @@
         // going to be unwound. Dispatch to a shared runtime stub
         // which will cause the StackOverflowError to be fabricated
         // and processed.
-        // For stack overflow in deoptimization blob, cleanup thread.
-        if (thread->deopt_mark() != NULL) {
-          Deoptimization::cleanup_deopt_info(thread, NULL);
-        }
+        // Stack overflow should never occur during deoptimization:
+        // the compiled method bangs the stack by as much as the
+        // interpreter would need in case of a deoptimization. The
+        // deoptimization blob and uncommon trap blob bang the stack
+        // in a debug VM to verify the correctness of the compiled
+        // method stack banging.
+        assert(thread->deopt_mark() == NULL, "no stack overflow from deopt blob/uncommon trap");
         Events::log_exception(thread, "StackOverflowError at " INTPTR_FORMAT, pc);
         return StubRoutines::throw_StackOverflowError_entry();
       }
@@ -946,14 +949,13 @@
  * it gets turned into a tail-call on sparc, which runs into dtrace bug
  * 6254741.  Once that is fixed we can remove the dummy return value.
  */
-int SharedRuntime::dtrace_object_alloc(oopDesc* o) {
-  return dtrace_object_alloc_base(Thread::current(), o);
+int SharedRuntime::dtrace_object_alloc(oopDesc* o, int size) {
+  return dtrace_object_alloc_base(Thread::current(), o, size);
 }
 
-int SharedRuntime::dtrace_object_alloc_base(Thread* thread, oopDesc* o) {
+int SharedRuntime::dtrace_object_alloc_base(Thread* thread, oopDesc* o, int size) {
   assert(DTraceAllocProbes, "wrong call");
   Klass* klass = o->klass();
-  int size = o->size();
   Symbol* name = klass->name();
   HOTSPOT_OBJECT_ALLOC(
                    get_java_tid(thread),
diff --git a/hotspot/src/share/vm/runtime/sharedRuntime.hpp b/hotspot/src/share/vm/runtime/sharedRuntime.hpp
index 9bb5038..c28c469 100644
--- a/hotspot/src/share/vm/runtime/sharedRuntime.hpp
+++ b/hotspot/src/share/vm/runtime/sharedRuntime.hpp
@@ -258,8 +258,8 @@
   static void register_finalizer(JavaThread* thread, oopDesc* obj);
 
   // dtrace notifications
-  static int dtrace_object_alloc(oopDesc* o);
-  static int dtrace_object_alloc_base(Thread* thread, oopDesc* o);
+  static int dtrace_object_alloc(oopDesc* o, int size);
+  static int dtrace_object_alloc_base(Thread* thread, oopDesc* o, int size);
   static int dtrace_method_entry(JavaThread* thread, Method* m);
   static int dtrace_method_exit(JavaThread* thread, Method* m);
 
diff --git a/hotspot/src/share/vm/runtime/simpleThresholdPolicy.cpp b/hotspot/src/share/vm/runtime/simpleThresholdPolicy.cpp
index 85b34bb..11cc67f 100644
--- a/hotspot/src/share/vm/runtime/simpleThresholdPolicy.cpp
+++ b/hotspot/src/share/vm/runtime/simpleThresholdPolicy.cpp
@@ -142,7 +142,8 @@
     count = MAX2(log2_intptr(os::active_processor_count()), 1) * 3 / 2;
   }
   set_c1_count(MAX2(count / 3, 1));
-  set_c2_count(MAX2(count - count / 3, 1));
+  set_c2_count(MAX2(count - c1_count(), 1));
+  FLAG_SET_ERGO(intx, CICompilerCount, c1_count() + c2_count());
 }
 
 void SimpleThresholdPolicy::set_carry_if_necessary(InvocationCounter *counter) {
diff --git a/hotspot/src/share/vm/runtime/vframeArray.cpp b/hotspot/src/share/vm/runtime/vframeArray.cpp
index b13d560..5dff2d7 100644
--- a/hotspot/src/share/vm/runtime/vframeArray.cpp
+++ b/hotspot/src/share/vm/runtime/vframeArray.cpp
@@ -418,24 +418,20 @@
 
 }
 
-int vframeArrayElement::on_stack_size(int caller_actual_parameters,
-                                      int callee_parameters,
+int vframeArrayElement::on_stack_size(int callee_parameters,
                                       int callee_locals,
                                       bool is_top_frame,
-                                      bool is_bottom_frame,
                                       int popframe_extra_stack_expression_els) const {
   assert(method()->max_locals() == locals()->size(), "just checking");
   int locks = monitors() == NULL ? 0 : monitors()->number_of_monitors();
   int temps = expressions()->size();
-  return Interpreter::size_activation(method(),
+  return Interpreter::size_activation(method()->max_stack(),
                                       temps + callee_parameters,
                                       popframe_extra_stack_expression_els,
                                       locks,
-                                      caller_actual_parameters,
                                       callee_parameters,
                                       callee_locals,
-                                      is_top_frame,
-                                      is_bottom_frame);
+                                      is_top_frame);
 }
 
 
diff --git a/hotspot/src/share/vm/runtime/vframeArray.hpp b/hotspot/src/share/vm/runtime/vframeArray.hpp
index e828eb5..e4665c4 100644
--- a/hotspot/src/share/vm/runtime/vframeArray.hpp
+++ b/hotspot/src/share/vm/runtime/vframeArray.hpp
@@ -85,10 +85,8 @@
 
   // Returns the on stack word size for this frame
   // callee_parameters is the number of callee locals residing inside this frame
-  int on_stack_size(int caller_actual_parameters,
-                    int callee_parameters,
+  int on_stack_size(int callee_parameters,
                     int callee_locals,
-                    bool is_bottom_frame,
                     bool is_top_frame,
                     int popframe_extra_stack_expression_els) const;
 
diff --git a/hotspot/src/share/vm/utilities/growableArray.hpp b/hotspot/src/share/vm/utilities/growableArray.hpp
index 7eebe93..1fca26e 100644
--- a/hotspot/src/share/vm/utilities/growableArray.hpp
+++ b/hotspot/src/share/vm/utilities/growableArray.hpp
@@ -147,6 +147,9 @@
   }
 };
 
+template<class E> class GrowableArrayIterator;
+template<class E, class UnaryPredicate> class GrowableArrayFilterIterator;
+
 template<class E> class GrowableArray : public GenericGrowableArray {
   friend class VMStructs;
 
@@ -243,6 +246,14 @@
     return _data[_len-1];
   }
 
+  GrowableArrayIterator<E> begin() const {
+    return GrowableArrayIterator<E>(this, 0);
+  }
+
+  GrowableArrayIterator<E> end() const {
+    return GrowableArrayIterator<E>(this, length());
+  }
+
   void push(const E& elem) { append(elem); }
 
   E pop() {
@@ -412,4 +423,83 @@
     tty->print("}\n");
 }
 
+// Custom STL-style iterator to iterate over GrowableArrays
+// It is constructed by invoking GrowableArray::begin() and GrowableArray::end()
+template<class E> class GrowableArrayIterator : public StackObj {
+  friend class GrowableArray<E>;
+  template<class F, class UnaryPredicate> friend class GrowableArrayFilterIterator;
+
+ private:
+  const GrowableArray<E>* _array; // GrowableArray we iterate over
+  int _position;                  // The current position in the GrowableArray
+
+  // Private constructor used in GrowableArray::begin() and GrowableArray::end()
+  GrowableArrayIterator(const GrowableArray<E>* array, int position) : _array(array), _position(position) {
+    assert(0 <= position && position <= _array->length(), "illegal position");
+  }
+
+ public:
+  GrowableArrayIterator<E>& operator++()  { ++_position; return *this; }
+  E operator*()                           { return _array->at(_position); }
+
+  bool operator==(const GrowableArrayIterator<E>& rhs)  {
+    assert(_array == rhs._array, "iterator belongs to different array");
+    return _position == rhs._position;
+  }
+
+  bool operator!=(const GrowableArrayIterator<E>& rhs)  {
+    assert(_array == rhs._array, "iterator belongs to different array");
+    return _position != rhs._position;
+  }
+};
+
+// Custom STL-style iterator to iterate over elements of a GrowableArray that satisfy a given predicate
+template<class E, class UnaryPredicate> class GrowableArrayFilterIterator : public StackObj {
+  friend class GrowableArray<E>;
+
+ private:
+  const GrowableArray<E>* _array;   // GrowableArray we iterate over
+  int _position;                    // Current position in the GrowableArray
+  UnaryPredicate _predicate;        // Unary predicate the elements of the GrowableArray should satisfy
+
+ public:
+  GrowableArrayFilterIterator(const GrowableArrayIterator<E>& begin, UnaryPredicate filter_predicate)
+   : _array(begin._array), _position(begin._position), _predicate(filter_predicate) {
+    // Advance to first element satisfying the predicate
+    while(_position != _array->length() && !_predicate(_array->at(_position))) {
+      ++_position;
+    }
+  }
+
+  GrowableArrayFilterIterator<E, UnaryPredicate>& operator++() {
+    do {
+      // Advance to next element satisfying the predicate
+      ++_position;
+    } while(_position != _array->length() && !_predicate(_array->at(_position)));
+    return *this;
+  }
+
+  E operator*()   { return _array->at(_position); }
+
+  bool operator==(const GrowableArrayIterator<E>& rhs)  {
+    assert(_array == rhs._array, "iterator belongs to different array");
+    return _position == rhs._position;
+  }
+
+  bool operator!=(const GrowableArrayIterator<E>& rhs)  {
+    assert(_array == rhs._array, "iterator belongs to different array");
+    return _position != rhs._position;
+  }
+
+  bool operator==(const GrowableArrayFilterIterator<E, UnaryPredicate>& rhs)  {
+    assert(_array == rhs._array, "iterator belongs to different array");
+    return _position == rhs._position;
+  }
+
+  bool operator!=(const GrowableArrayFilterIterator<E, UnaryPredicate>& rhs)  {
+    assert(_array == rhs._array, "iterator belongs to different array");
+    return _position != rhs._position;
+  }
+};
+
 #endif // SHARE_VM_UTILITIES_GROWABLEARRAY_HPP
diff --git a/hotspot/src/share/vm/utilities/xmlstream.cpp b/hotspot/src/share/vm/utilities/xmlstream.cpp
index 3a386a7..e6714e1 100644
--- a/hotspot/src/share/vm/utilities/xmlstream.cpp
+++ b/hotspot/src/share/vm/utilities/xmlstream.cpp
@@ -396,10 +396,10 @@
 }
 
 void xmlStream::method_text(methodHandle method) {
+  ResourceMark rm;
   assert_if_no_error(inside_attrs(), "printing attributes");
   if (method.is_null())  return;
-  //method->print_short_name(text());
-  method->method_holder()->name()->print_symbol_on(text());
+  text()->print(method->method_holder()->external_name());
   print_raw(" ");  // " " is easier for tools to parse than "::"
   method->name()->print_symbol_on(text());
   print_raw(" ");  // separator
diff --git a/hotspot/test/TEST.groups b/hotspot/test/TEST.groups
index b0a4f60..4fe50e2 100644
--- a/hotspot/test/TEST.groups
+++ b/hotspot/test/TEST.groups
@@ -134,7 +134,8 @@
   runtime/InternalApi/ThreadCpuTimesDeadlock.java \
   serviceability/threads/TestFalseDeadLock.java \
   compiler/tiered/NonTieredLevelsTest.java \
-  compiler/tiered/TieredLevelsTest.java
+  compiler/tiered/TieredLevelsTest.java \
+  compiler/intrinsics/bmi/verifycode
 
 # Compact 2 adds full VM tests
 compact2 = \
diff --git a/hotspot/test/compiler/EscapeAnalysis/TestUnsafePutAddressNullObjMustNotEscape.java b/hotspot/test/compiler/EscapeAnalysis/TestUnsafePutAddressNullObjMustNotEscape.java
new file mode 100644
index 0000000..e016a99
--- /dev/null
+++ b/hotspot/test/compiler/EscapeAnalysis/TestUnsafePutAddressNullObjMustNotEscape.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright 2014 SAP AG.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug 8038048
+ * @summary assert(null_obj->escape_state() == PointsToNode::NoEscape,etc)
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+DoEscapeAnalysis -XX:-TieredCompilation -Xbatch TestUnsafePutAddressNullObjMustNotEscape
+ * @author Richard Reingruber richard DOT reingruber AT sap DOT com
+ */
+
+import java.lang.reflect.Field;
+import sun.misc.Unsafe;
+
+public class TestUnsafePutAddressNullObjMustNotEscape {
+
+    public static Unsafe usafe;
+    public static long mem;
+    public static long checksum;
+
+    public static void main(String[] args) throws Exception {
+        System.out.println("EXECUTING test.");
+
+        {
+            System.out.println("Acquiring sun.misc.Unsafe.theUnsafe using reflection.");
+            getUnsafe();
+            System.out.println("Allocating raw memory.");
+            mem = (usafe.allocateMemory(1024) + 8L) & ~7L;
+            System.out.println("Triggering JIT compilation of the test method");
+            triggerJitCompilationOfTestMethod();
+        }
+
+        System.out.println("SUCCESSFULLY passed test.");
+    }
+
+    public static void triggerJitCompilationOfTestMethod() {
+        long sum = 0;
+        for (int ii = 50000; ii >= 0; ii--) {
+            sum = testMethod();
+        }
+        checksum = sum;
+    }
+
+    public static class IDGen {
+        private static long id;
+        public long nextId() {
+            return id++;
+        }
+    }
+
+    public static long testMethod() {
+        // dummy alloc to trigger escape analysis
+        IDGen gen = new IDGen();
+        // StoreP of null_obj to raw mem triggers assertion in escape analysis
+        usafe.putAddress(mem, 0L);
+        return gen.nextId();
+    }
+
+    private static void getUnsafe() throws Exception {
+        Field field = sun.misc.Unsafe.class.getDeclaredField("theUnsafe");
+        field.setAccessible(true);
+        usafe = (sun.misc.Unsafe) field.get(null);
+    }
+}
diff --git a/hotspot/test/compiler/intrinsics/bmi/verifycode/AddnTestI.java b/hotspot/test/compiler/intrinsics/bmi/verifycode/AddnTestI.java
new file mode 100644
index 0000000..2a77347
--- /dev/null
+++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/AddnTestI.java
@@ -0,0 +1,57 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8031321
+ * @library /testlibrary /testlibrary/whitebox /compiler/whitebox ..
+ * @build AddnTestI
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ * @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
+ *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+UseBMI1Instructions AddnTestI
+ */
+
+import java.lang.reflect.Method;
+
+public class AddnTestI extends BmiIntrinsicBase.BmiTestCase {
+
+    protected AddnTestI(Method method) {
+        super(method);
+        // from intel manual VEX.NDS.LZ.0F38.W0 F2 /r, example c4e260f2c2
+        instrMask = new byte[]{
+                (byte) 0xFF,
+                (byte) 0x1F,
+                (byte) 0x00,
+                (byte) 0xFF};
+        instrPattern = new byte[]{
+                (byte) 0xC4, // prefix for 3-byte VEX instruction
+                (byte) 0x02, // 00010 implied 0F 38 leading opcode bytes
+                (byte) 0x00,
+                (byte) 0xF2};
+    }
+
+    public static void main(String[] args) throws Exception {
+        BmiIntrinsicBase.verifyTestCase(AddnTestI::new, TestAndnI.AndnIExpr.class.getDeclaredMethods());
+        BmiIntrinsicBase.verifyTestCase(AddnTestI::new, TestAndnI.AndnICommutativeExpr.class.getDeclaredMethods());
+    }
+}
diff --git a/hotspot/test/compiler/intrinsics/bmi/verifycode/AddnTestL.java b/hotspot/test/compiler/intrinsics/bmi/verifycode/AddnTestL.java
new file mode 100644
index 0000000..72da9a0
--- /dev/null
+++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/AddnTestL.java
@@ -0,0 +1,47 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8031321
+ * @library /testlibrary /testlibrary/whitebox /compiler/whitebox ..
+ * @build AddnTestL
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ * @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
+ *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+UseBMI1Instructions AddnTestL
+ */
+
+import java.lang.reflect.Method;
+
+public class AddnTestL extends AddnTestI {
+
+    protected AddnTestL(Method method) {
+        super(method);
+        isLongOperation = true;
+    }
+
+    public static void main(String[] args) throws Exception {
+        BmiIntrinsicBase.verifyTestCase(AddnTestL::new, TestAndnL.AndnLExpr.class.getDeclaredMethods());
+        BmiIntrinsicBase.verifyTestCase(AddnTestL::new, TestAndnL.AndnLCommutativeExpr.class.getDeclaredMethods());
+    }
+}
diff --git a/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsiTestI.java b/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsiTestI.java
new file mode 100644
index 0000000..ce234a9
--- /dev/null
+++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsiTestI.java
@@ -0,0 +1,59 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8031321
+ * @library /testlibrary /testlibrary/whitebox /compiler/whitebox ..
+ * @build BlsiTestI
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ * @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
+ *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+UseBMI1Instructions BlsiTestI
+ */
+
+import java.lang.reflect.Method;
+
+public class BlsiTestI extends BmiIntrinsicBase.BmiTestCase {
+
+    protected BlsiTestI(Method method) {
+        super(method);
+        //from intel manual VEX.NDD.LZ.0F38.W0 F3 /3
+        instrMask = new byte[]{
+                (byte) 0xFF,
+                (byte) 0x1F,
+                (byte) 0x00,
+                (byte) 0xFF,
+                (byte) 0b0011_1000};
+        instrPattern = new byte[]{
+                (byte) 0xC4, // prefix for 3-byte VEX instruction
+                (byte) 0x02, // 00010 implied 0F 38 leading opcode bytes
+                (byte) 0x00,
+                (byte) 0xF3,
+                (byte) 0b0001_1000}; // bits 543 == 011 (3)
+    }
+
+    public static void main(String[] args) throws Exception {
+        BmiIntrinsicBase.verifyTestCase(BlsiTestI::new, TestBlsiI.BlsiIExpr.class.getDeclaredMethods());
+        BmiIntrinsicBase.verifyTestCase(BlsiTestI::new, TestBlsiI.BlsiICommutativeExpr.class.getDeclaredMethods());
+    }
+}
diff --git a/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsiTestL.java b/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsiTestL.java
new file mode 100644
index 0000000..f8544f3
--- /dev/null
+++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsiTestL.java
@@ -0,0 +1,47 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8031321
+ * @library /testlibrary /testlibrary/whitebox /compiler/whitebox ..
+ * @build BlsiTestL
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ * @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
+ *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+UseBMI1Instructions BlsiTestL
+ */
+
+import java.lang.reflect.Method;
+
+public class BlsiTestL extends BlsiTestI {
+
+    protected BlsiTestL(Method method) {
+        super(method);
+        isLongOperation = true;
+    }
+
+    public static void main(String[] args) throws Exception {
+        BmiIntrinsicBase.verifyTestCase(BlsiTestL::new, TestBlsiL.BlsiLExpr.class.getDeclaredMethods());
+        BmiIntrinsicBase.verifyTestCase(BlsiTestL::new, TestBlsiL.BlsiLCommutativeExpr.class.getDeclaredMethods());
+    }
+}
diff --git a/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsmskTestI.java b/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsmskTestI.java
new file mode 100644
index 0000000..1a7dd8f
--- /dev/null
+++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsmskTestI.java
@@ -0,0 +1,59 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8031321
+ * @library /testlibrary /testlibrary/whitebox /compiler/whitebox ..
+ * @build BlsmskTestI
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ * @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
+ *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+UseBMI1Instructions BlsmskTestI
+ */
+
+import java.lang.reflect.Method;
+
+public class BlsmskTestI extends BmiIntrinsicBase.BmiTestCase {
+
+    protected BlsmskTestI(Method method) {
+        super(method);
+        //from intel manual VEX.NDD.LZ.0F38.W0 F3 /2
+        instrMask = new byte[]{
+                (byte) 0xFF,
+                (byte) 0x1F,
+                (byte) 0x00,
+                (byte) 0xFF,
+                (byte) 0b0011_1000};
+        instrPattern = new byte[]{
+                (byte) 0xC4, // prefix for 3-byte VEX instruction
+                (byte) 0x02, // 00010 implied 0F 38 leading opcode bytes
+                (byte) 0x00,
+                (byte) 0xF3,
+                (byte) 0b0001_0000}; // bits 543 == 011 (3)
+    }
+
+    public static void main(String[] args) throws Exception {
+        BmiIntrinsicBase.verifyTestCase(BlsmskTestI::new, TestBlsmskI.BlsmskIExpr.class.getDeclaredMethods());
+        BmiIntrinsicBase.verifyTestCase(BlsmskTestI::new, TestBlsmskI.BlsmskICommutativeExpr.class.getDeclaredMethods());
+    }
+}
diff --git a/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsmskTestL.java b/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsmskTestL.java
new file mode 100644
index 0000000..e061206
--- /dev/null
+++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsmskTestL.java
@@ -0,0 +1,47 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8031321
+ * @library /testlibrary /testlibrary/whitebox /compiler/whitebox ..
+ * @build BlsmskTestL
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ * @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
+ *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+UseBMI1Instructions BlsmskTestL
+ */
+
+import java.lang.reflect.Method;
+
+public class BlsmskTestL extends BlsmskTestI {
+
+    protected BlsmskTestL(Method method) {
+        super(method);
+        isLongOperation = true;
+    }
+
+    public static void main(String[] args) throws Exception {
+        BmiIntrinsicBase.verifyTestCase(BlsmskTestL::new, TestBlsmskL.BlsmskLExpr.class.getDeclaredMethods());
+        BmiIntrinsicBase.verifyTestCase(BlsmskTestL::new, TestBlsmskL.BlsmskLCommutativeExpr.class.getDeclaredMethods());
+    }
+}
diff --git a/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsrTestI.java b/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsrTestI.java
new file mode 100644
index 0000000..e086f9b
--- /dev/null
+++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsrTestI.java
@@ -0,0 +1,59 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8031321
+ * @library /testlibrary /testlibrary/whitebox /compiler/whitebox ..
+ * @build BlsrTestI
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ * @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
+ *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+UseBMI1Instructions BlsrTestI
+ */
+
+import java.lang.reflect.Method;
+
+public class BlsrTestI extends BmiIntrinsicBase.BmiTestCase {
+
+    protected BlsrTestI(Method method) {
+        super(method);
+        //from intel manual VEX.NDD.LZ.0F38.W0 F3 /1
+        instrMask = new byte[]{
+                (byte) 0xFF,
+                (byte) 0x1F,
+                (byte) 0x00,
+                (byte) 0xFF,
+                (byte) 0b0011_1000};
+        instrPattern = new byte[]{
+                (byte) 0xC4, // prefix for 3-byte VEX instruction
+                (byte) 0x02, // 00010 implied 0F 38 leading opcode bytes
+                (byte) 0x00,
+                (byte) 0xF3,
+                (byte) 0b0000_1000}; // bits 543 == 011 (3)
+    }
+
+    public static void main(String[] args) throws Exception {
+        BmiIntrinsicBase.verifyTestCase(BlsrTestI::new, TestBlsrI.BlsrIExpr.class.getDeclaredMethods());
+        BmiIntrinsicBase.verifyTestCase(BlsrTestI::new, TestBlsrI.BlsrICommutativeExpr.class.getDeclaredMethods());
+    }
+}
diff --git a/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsrTestL.java b/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsrTestL.java
new file mode 100644
index 0000000..0185aeb
--- /dev/null
+++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsrTestL.java
@@ -0,0 +1,47 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8031321
+ * @library /testlibrary /testlibrary/whitebox /compiler/whitebox ..
+ * @build BlsrTestL
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ * @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
+ *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+UseBMI1Instructions BlsrTestL
+ */
+
+import java.lang.reflect.Method;
+
+public class BlsrTestL extends BlsrTestI {
+
+    protected BlsrTestL(Method method) {
+        super(method);
+        isLongOperation = true;
+    }
+
+    public static void main(String[] args) throws Exception {
+        BmiIntrinsicBase.verifyTestCase(BlsrTestL::new, TestBlsrL.BlsrLExpr.class.getDeclaredMethods());
+        BmiIntrinsicBase.verifyTestCase(BlsrTestL::new, TestBlsrL.BlsrLCommutativeExpr.class.getDeclaredMethods());
+    }
+}
diff --git a/hotspot/test/compiler/intrinsics/bmi/verifycode/BmiIntrinsicBase.java b/hotspot/test/compiler/intrinsics/bmi/verifycode/BmiIntrinsicBase.java
new file mode 100644
index 0000000..0425baf
--- /dev/null
+++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/BmiIntrinsicBase.java
@@ -0,0 +1,186 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+import com.oracle.java.testlibrary.Asserts;
+import com.oracle.java.testlibrary.Platform;
+import com.oracle.java.testlibrary.Utils;
+import sun.hotspot.code.NMethod;
+import sun.hotspot.cpuinfo.CPUInfo;
+
+import java.lang.reflect.Executable;
+import java.lang.reflect.Method;
+import java.util.concurrent.Callable;
+import java.util.function.Function;
+
+public class BmiIntrinsicBase extends CompilerWhiteBoxTest {
+
+    protected BmiIntrinsicBase(BmiTestCase testCase) {
+        super(testCase);
+    }
+
+    public static void verifyTestCase(Function<Method, BmiTestCase> constructor, Method... methods) throws Exception {
+        for (Method method : methods) {
+            new BmiIntrinsicBase(constructor.apply(method)).test();
+        }
+    }
+
+    @Override
+    protected void test() throws Exception {
+        BmiTestCase bmiTestCase = (BmiTestCase) testCase;
+
+        if (!(Platform.isX86() || Platform.isX64())) {
+            System.out.println("Unsupported platform, test SKIPPED");
+            return;
+        }
+
+        if (!Platform.isServer()) {
+            System.out.println("Not server VM, test SKIPPED");
+            return;
+        }
+
+        if (!CPUInfo.hasFeature(bmiTestCase.getCpuFlag())) {
+            System.out.println("Unsupported hardware, no required CPU flag " + bmiTestCase.getCpuFlag() + " , test SKIPPED");
+            return;
+        }
+
+        if (!Boolean.valueOf(getVMOption(bmiTestCase.getVMFlag()))) {
+            System.out.println("VM flag " + bmiTestCase.getVMFlag() + " disabled, test SKIPPED");
+            return;
+        }
+
+        System.out.println(testCase.name());
+
+        switch (MODE) {
+            case "compiled mode":
+            case "mixed mode":
+                if (TIERED_COMPILATION && TIERED_STOP_AT_LEVEL != CompilerWhiteBoxTest.COMP_LEVEL_MAX) {
+                    System.out.println("TieredStopAtLevel value (" + TIERED_STOP_AT_LEVEL + ") is too low, test SKIPPED");
+                    return;
+                }
+                deoptimize();
+                compileAtLevelAndCheck(CompilerWhiteBoxTest.COMP_LEVEL_MAX);
+                break;
+            case "interpreted mode": // test is not applicable in this mode;
+                System.err.println("Warning: This test is not applicable in mode: " + MODE);
+                break;
+            default:
+                throw new AssertionError("Test bug, unknown VM mode: " + MODE);
+        }
+    }
+
+    protected void compileAtLevelAndCheck(int level) {
+        WHITE_BOX.enqueueMethodForCompilation(method, level);
+        waitBackgroundCompilation();
+        checkCompilation(method, level);
+        checkEmittedCode(method);
+    }
+
+    protected void checkCompilation(Executable executable, int level) {
+        if (!WHITE_BOX.isMethodCompiled(executable)) {
+            throw new AssertionError("Test bug, expected compilation (level): " + level + ", but not compiled" + WHITE_BOX.isMethodCompilable(executable, level));
+        }
+        final int compilationLevel = WHITE_BOX.getMethodCompilationLevel(executable);
+        if (compilationLevel != level) {
+            throw new AssertionError("Test bug, expected compilation (level): " + level + ", but level: " + compilationLevel);
+        }
+    }
+
+    protected void checkEmittedCode(Executable executable) {
+        final byte[] nativeCode = NMethod.get(executable, false).insts;
+        if (!((BmiTestCase) testCase).verifyPositive(nativeCode)) {
+            throw new AssertionError(testCase.name() + "CPU instructions expected not found: " + Utils.toHexString(nativeCode));
+        } else {
+            System.out.println("CPU instructions found, PASSED");
+        }
+    }
+
+    abstract static class BmiTestCase implements CompilerWhiteBoxTest.TestCase {
+        private final Method method;
+        protected byte[] instrMask;
+        protected byte[] instrPattern;
+        protected boolean isLongOperation;
+
+        public BmiTestCase(Method method) {
+            this.method = method;
+        }
+
+        @Override
+        public String name() {
+            return method.toGenericString();
+        }
+
+        @Override
+        public Executable getExecutable() {
+            return method;
+        }
+
+        @Override
+        public Callable<Integer> getCallable() {
+            return null;
+        }
+
+        @Override
+        public boolean isOsr() {
+            return false;
+        }
+
+        protected int countCpuInstructions(byte[] nativeCode) {
+            int count = 0;
+            int patternSize = Math.min(instrMask.length, instrPattern.length);
+            boolean found;
+            Asserts.assertGreaterThan(patternSize, 0);
+            for (int i = 0, n = nativeCode.length - patternSize; i < n; i++) {
+                found = true;
+                for (int j = 0; j < patternSize; j++) {
+                    if ((nativeCode[i + j] & instrMask[j]) != instrPattern[j]) {
+                        found = false;
+                        break;
+                    }
+                }
+                if (found) {
+                    ++count;
+                    i += patternSize - 1;
+                }
+            }
+            return count;
+        }
+
+        public boolean verifyPositive(byte[] nativeCode) {
+            final int cnt = countCpuInstructions(nativeCode);
+            if (Platform.isX86()) {
+                return cnt >= (isLongOperation ? 2 : 1);
+            } else {
+                return Platform.isX64() && cnt >= 1;
+            }
+        }
+
+        protected String getCpuFlag() {
+            return "bmi1";
+        }
+
+        protected String getVMFlag() {
+            return "UseBMI1Instructions";
+        }
+    }
+}
diff --git a/hotspot/test/compiler/intrinsics/bmi/verifycode/LZcntTestI.java b/hotspot/test/compiler/intrinsics/bmi/verifycode/LZcntTestI.java
new file mode 100644
index 0000000..0ba76e6
--- /dev/null
+++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/LZcntTestI.java
@@ -0,0 +1,59 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8031321
+ * @library /testlibrary /testlibrary/whitebox /compiler/whitebox ..
+ * @build LZcntTestI
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ * @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
+ *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCountLeadingZerosInstruction LZcntTestI
+ */
+
+import java.lang.reflect.Method;
+
+public class LZcntTestI extends BmiIntrinsicBase.BmiTestCase {
+
+    protected LZcntTestI(Method method) {
+        super(method);
+        instrMask = new byte[]{(byte) 0xFF, (byte) 0xFF, (byte) 0xFF};
+        instrPattern = new byte[]{(byte) 0xF3, (byte) 0x0F, (byte) 0xBD};
+    }
+
+    public static void main(String[] args) throws Exception {
+        // j.l.Integer and Long should be loaded to allow a compilation of the methods that use their methods
+        System.out.println("class java.lang.Integer should be loaded. Proof: " + Integer.class);
+        BmiIntrinsicBase.verifyTestCase(LZcntTestI::new, TestLzcntI.LzcntIExpr.class.getDeclaredMethods());
+    }
+
+    @Override
+    protected String getVMFlag() {
+        return "UseCountLeadingZerosInstruction";
+    }
+
+    @Override
+    protected String getCpuFlag() {
+        return "lzcnt";
+    }
+}
diff --git a/hotspot/test/compiler/intrinsics/bmi/verifycode/LZcntTestL.java b/hotspot/test/compiler/intrinsics/bmi/verifycode/LZcntTestL.java
new file mode 100644
index 0000000..5ecfb96
--- /dev/null
+++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/LZcntTestL.java
@@ -0,0 +1,54 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8031321
+ * @library /testlibrary /testlibrary/whitebox /compiler/whitebox ..
+ * @build LZcntTestL
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ * @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
+ *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCountLeadingZerosInstruction LZcntTestL
+ */
+
+import com.oracle.java.testlibrary.Platform;
+
+import java.lang.reflect.Method;
+
+public class LZcntTestL extends LZcntTestI {
+
+    protected LZcntTestL(Method method) {
+        super(method);
+        isLongOperation = true;
+        if (Platform.isX64()) {
+            instrMask = new byte[]{(byte) 0xFF, (byte) 0x00, (byte) 0xFF, (byte) 0xFF};
+            instrPattern = new byte[]{(byte) 0xF3, (byte) 0x00, (byte) 0x0F, (byte) 0xBD};
+        }
+    }
+
+    public static void main(String[] args) throws Exception {
+        // j.l.Integer and Long should be loaded to allow a compilation of the methods that use their methods
+        System.out.println("classes java.lang.Long should be loaded. Proof: " + Long.class);
+        BmiIntrinsicBase.verifyTestCase(LZcntTestL::new, TestLzcntL.LzcntLExpr.class.getDeclaredMethods());
+    }
+}
diff --git a/hotspot/test/compiler/intrinsics/bmi/verifycode/TZcntTestI.java b/hotspot/test/compiler/intrinsics/bmi/verifycode/TZcntTestI.java
new file mode 100644
index 0000000..ad2af2c
--- /dev/null
+++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/TZcntTestI.java
@@ -0,0 +1,54 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8031321
+ * @library /testlibrary /testlibrary/whitebox /compiler/whitebox ..
+ * @build TZcntTestI
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ * @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
+ *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCountTrailingZerosInstruction TZcntTestI
+ */
+
+import java.lang.reflect.Method;
+
+public class TZcntTestI extends BmiIntrinsicBase.BmiTestCase {
+
+    protected TZcntTestI(Method method) {
+        super(method);
+        instrMask = new byte[]{(byte) 0xFF, (byte) 0xFF, (byte) 0xFF};
+        instrPattern = new byte[]{(byte) 0xF3, (byte) 0x0F, (byte) 0xBC};
+    }
+
+    public static void main(String[] args) throws Exception {
+        // j.l.Integer and Long should be loaded to allow a compilation of the methods that use their methods
+        System.out.println("class java.lang.Integer should be loaded. Proof: " + Integer.class);
+        BmiIntrinsicBase.verifyTestCase(TZcntTestI::new, TestTzcntI.TzcntIExpr.class.getDeclaredMethods());
+    }
+
+    @Override
+    protected String getVMFlag() {
+        return "UseCountTrailingZerosInstruction";
+    }
+}
diff --git a/hotspot/test/compiler/intrinsics/bmi/verifycode/TZcntTestL.java b/hotspot/test/compiler/intrinsics/bmi/verifycode/TZcntTestL.java
new file mode 100644
index 0000000..0a856df
--- /dev/null
+++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/TZcntTestL.java
@@ -0,0 +1,55 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8031321
+ * @library /testlibrary /testlibrary/whitebox /compiler/whitebox ..
+ * @build TZcntTestL
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ * @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
+ *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCountTrailingZerosInstruction TZcntTestL
+ */
+
+import com.oracle.java.testlibrary.Platform;
+
+import java.lang.reflect.Method;
+
+public class TZcntTestL extends TZcntTestI {
+
+    protected TZcntTestL(Method method) {
+        super(method);
+        isLongOperation = true;
+        if (Platform.isX64()) {
+            instrMask = new byte[]{(byte) 0xFF, (byte) 0x00, (byte) 0xFF, (byte) 0xFF};
+            instrPattern = new byte[]{(byte) 0xF3, (byte) 0x00, (byte) 0x0F, (byte) 0xBC};
+        }
+        isLongOperation = true;
+    }
+
+    public static void main(String[] args) throws Exception {
+        // j.l.Integer and Long should be loaded to allow a compilation of the methods that use their methods
+        System.out.println("classes java.lang.Long should be loaded. Proof: " + Long.class);
+        BmiIntrinsicBase.verifyTestCase(TZcntTestL::new, TestTzcntL.TzcntLExpr.class.getDeclaredMethods());
+    }
+}
diff --git a/hotspot/test/compiler/rtm/cli/RTMGenericCommandLineOptionTest.java b/hotspot/test/compiler/rtm/cli/RTMGenericCommandLineOptionTest.java
new file mode 100644
index 0000000..1617715
--- /dev/null
+++ b/hotspot/test/compiler/rtm/cli/RTMGenericCommandLineOptionTest.java
@@ -0,0 +1,198 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+import com.oracle.java.testlibrary.*;
+import com.oracle.java.testlibrary.cli.*;
+
+import java.util.function.BooleanSupplier;
+
+/**
+ * Base for all RTM-related CLI tests.
+ */
+public abstract class RTMGenericCommandLineOptionTest
+        extends CommandLineOptionTest {
+    protected static final String RTM_INSTR_ERROR
+            = "RTM instructions are not available on this CPU";
+    protected static final String RTM_UNSUPPORTED_VM_ERROR
+            = "RTM locking optimization is not supported in this VM";
+    protected static final String RTM_ABORT_RATIO_WARNING
+            = "RTMAbortRatio must be in the range 0 to 100, resetting it to 50";
+    protected static final String RTM_FOR_STACK_LOCKS_WARNING
+            = "UseRTMForStackLocks flag should be off when UseRTMLocking "
+            + "flag is off";
+    protected static final String RTM_COUNT_INCR_WARNING
+            = "RTMTotalCountIncrRate must be a power of 2, resetting it to 64";
+    protected static final String RTM_BIASED_LOCKING_WARNING
+            = "Biased locking is not supported with RTM locking; "
+            + "ignoring UseBiasedLocking flag";
+
+    protected final String optionName;
+    protected final String errorMessage;
+    protected final String experimentalOptionError;
+    protected final boolean isExperimental;
+    protected final boolean isBoolean;
+    protected final String defaultValue;
+    protected final String[] optionValues;
+
+    /**
+     * Constructs new genetic RTM CLI test, for option {@code optionName} which
+     * has default value {@code defaultValue}. Test cases will use option's
+     * values passed via {@code optionValues} for verification of correct
+     * option processing.
+     *
+     * Test constructed using this ctor will be started on any cpu regardless
+     * it's architecture and supported/unsupported features.
+     *
+     * @param predicate predicate responsible for test's preconditions check
+     * @param optionName name of option to be tested
+     * @param isBoolean {@code true} if option is binary
+     * @param isExperimental {@code true} if option is experimental
+     * @param defaultValue default value of tested option
+     * @param optionValues different option values
+     */
+    public RTMGenericCommandLineOptionTest(BooleanSupplier predicate,
+            String optionName, boolean isBoolean, boolean isExperimental,
+            String defaultValue, String... optionValues) {
+        super(predicate);
+        this.optionName = optionName;
+        this.isExperimental = isExperimental;
+        this.isBoolean = isBoolean;
+        this.defaultValue = defaultValue;
+        this.optionValues = optionValues;
+        this.errorMessage = CommandLineOptionTest.
+                getUnrecognizedOptionErrorMessage(optionName);
+        this.experimentalOptionError = CommandLineOptionTest.
+                getExperimentalOptionErrorMessage(optionName);
+    }
+
+    @Override
+    public void runTestCases() throws Throwable {
+        if (Platform.isX86() || Platform.isX64()) {
+            if (Platform.isServer() && !Platform.isEmbedded()) {
+                runX86SupportedVMTestCases();
+            } else {
+                runX86UnsupportedVMTestCases();
+            }
+        } else {
+            runNonX86TestCases();
+        }
+    }
+
+    /**
+     * Runs test cases on X86 CPU if VM supports RTM locking.
+     * @throws Throwable
+     */
+    protected void runX86SupportedVMTestCases() throws Throwable {
+        runGenericX86TestCases();
+    }
+
+    /**
+     * Runs test cases on non-X86 CPU if VM does not support RTM locking.
+     * @throws Throwable
+     */
+    protected void runX86UnsupportedVMTestCases() throws Throwable {
+        runGenericX86TestCases();
+    }
+
+    /**
+     * Runs test cases on non-X86 CPU.
+     * @throws Throwable
+     */
+    protected void runNonX86TestCases() throws Throwable {
+        CommandLineOptionTest.verifySameJVMStartup(
+                new String[] { errorMessage }, null, ExitCode.FAIL,
+                prepareOptionValue(defaultValue));
+    }
+
+    /**
+     * Runs generic X86 test cases.
+     * @throws Throwable
+     */
+    protected void runGenericX86TestCases() throws Throwable {
+        verifyJVMStartup();
+        verifyOptionValues();
+    }
+
+    protected void verifyJVMStartup() throws Throwable {
+        String optionValue = prepareOptionValue(defaultValue);
+        if (isExperimental) {
+            // verify that option is experimental
+            CommandLineOptionTest.verifySameJVMStartup(
+                    new String[] { experimentalOptionError },
+                    new String[] { errorMessage }, ExitCode.FAIL,
+                    optionValue);
+            // verify that it could be passed if experimental options
+            // are unlocked
+            CommandLineOptionTest.verifySameJVMStartup(null,
+                    new String[] {
+                            experimentalOptionError,
+                            errorMessage
+                    },
+                    ExitCode.OK,
+                    CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
+                    optionValue);
+        } else {
+            // verify that option could be passed
+            CommandLineOptionTest.verifySameJVMStartup(null,
+                    new String[]{errorMessage}, ExitCode.OK, optionValue);
+        }
+    }
+
+    protected void verifyOptionValues() throws Throwable {
+        // verify default value
+        if (isExperimental) {
+            CommandLineOptionTest.verifyOptionValueForSameVM(optionName,
+                    defaultValue,
+                    CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS);
+        } else {
+            CommandLineOptionTest.verifyOptionValueForSameVM(optionName,
+                    defaultValue);
+        }
+        // verify other specified option values
+        if (optionValues == null) {
+            return;
+        }
+
+        for (String value : optionValues) {
+            if (isExperimental) {
+                CommandLineOptionTest.verifyOptionValueForSameVM(optionName,
+                        value,
+                        CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
+                        prepareOptionValue(value));
+            } else {
+                CommandLineOptionTest.verifyOptionValueForSameVM(optionName,
+                        value, prepareOptionValue(value));
+            }
+        }
+    }
+
+    protected String prepareOptionValue(String value) {
+        if (isBoolean) {
+            return CommandLineOptionTest.prepareBooleanFlag(optionName,
+                    Boolean.valueOf(value));
+        } else {
+            return String.format("-XX:%s=%s", optionName, value);
+        }
+    }
+}
diff --git a/hotspot/test/compiler/rtm/cli/RTMLockingAwareTest.java b/hotspot/test/compiler/rtm/cli/RTMLockingAwareTest.java
new file mode 100644
index 0000000..bcc75ef
--- /dev/null
+++ b/hotspot/test/compiler/rtm/cli/RTMLockingAwareTest.java
@@ -0,0 +1,154 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+import java.util.List;
+import java.util.LinkedList;
+
+import com.oracle.java.testlibrary.ExitCode;
+import com.oracle.java.testlibrary.cli.*;
+import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
+import rtm.predicate.SupportedCPU;
+import rtm.predicate.SupportedVM;
+
+/**
+ * Base for all RTM-related CLI tests on options whose processing depends
+ * on UseRTMLocking value.
+ *
+ * Since UseRTMLocking option could be used when both CPU and VM supports RTM
+ * locking, this test will be skipped on all unsupported configurations.
+ */
+public abstract class RTMLockingAwareTest
+        extends RTMGenericCommandLineOptionTest {
+    protected final String warningMessage;
+    protected final String[] correctValues;
+    protected final String[] incorrectValues;
+    /**
+     * Constructs new test for option {@code optionName} that should be executed
+     * only on CPU with RTM support.
+     * Test will be executed using set of correct values from
+     * {@code correctValues} and set of incorrect values from
+     * {@code incorrectValues}.
+     *
+     * @param optionName name of option to be tested
+     * @param isBoolean {@code true} if tested option is binary
+     * @param isExperimental {@code true} if tested option is experimental
+     * @param defaultValue default value of tested option
+     * @param correctValues array with correct values, that should not emit
+     *                      {@code warningMessage} to VM output
+     * @param incorrectValues array with incorrect values, that should emit
+     *                        {@code waningMessage} to VM output
+     * @param warningMessage warning message associated with tested option
+     */
+    protected RTMLockingAwareTest(String optionName, boolean isBoolean,
+            boolean isExperimental, String defaultValue,
+            String[] correctValues, String[] incorrectValues,
+            String warningMessage) {
+        super(new AndPredicate(new SupportedCPU(), new SupportedVM()),
+                optionName, isBoolean, isExperimental, defaultValue);
+        this.correctValues = correctValues;
+        this.incorrectValues = incorrectValues;
+        this.warningMessage = warningMessage;
+    }
+
+    @Override
+    protected void verifyJVMStartup() throws Throwable {
+        // Run generic sanity checks
+        super.verifyJVMStartup();
+        // Verify how option values will be processed depending on
+        // UseRTMLocking value.
+        if (correctValues != null) {
+            for (String correctValue : correctValues) {
+                // For correct values it is expected to see no warnings
+                // regardless to UseRTMLocking
+                verifyStartupWarning(correctValue, true, false);
+                verifyStartupWarning(correctValue, false, false);
+            }
+        }
+
+        if (incorrectValues != null) {
+            for (String incorrectValue : incorrectValues) {
+                // For incorrect values it is expected to see warning
+                // only with -XX:+UseRTMLocking
+                verifyStartupWarning(incorrectValue, true, true);
+                verifyStartupWarning(incorrectValue, false, false);
+            }
+        }
+    }
+
+    @Override
+    protected void verifyOptionValues() throws Throwable {
+        super.verifyOptionValues();
+        // Verify how option values will be setup after processing
+        // depending on UseRTMLocking value
+        if (correctValues != null) {
+            for (String correctValue : correctValues) {
+                // Correct value could be set up regardless to UseRTMLocking
+                verifyOptionValues(correctValue, false, correctValue);
+                verifyOptionValues(correctValue, true, correctValue);
+            }
+        }
+
+        if (incorrectValues != null) {
+            for (String incorrectValue : incorrectValues) {
+                // With -XX:+UseRTMLocking, incorrect value will be changed to
+                // default value.
+                verifyOptionValues(incorrectValue, false, incorrectValue);
+                verifyOptionValues(incorrectValue, true, defaultValue);
+            }
+        }
+    }
+
+    private void verifyStartupWarning(String value, boolean useRTMLocking,
+            boolean isWarningExpected) throws Throwable {
+        String warnings[] = new String[] { warningMessage };
+        List<String> options = new LinkedList<>();
+        options.add(CommandLineOptionTest.prepareBooleanFlag("UseRTMLocking",
+                useRTMLocking));
+
+        if (isExperimental) {
+            options.add(CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS);
+        }
+        options.add(prepareOptionValue(value));
+
+        CommandLineOptionTest.verifySameJVMStartup(
+                (isWarningExpected ? warnings : null),
+                (isWarningExpected ? null : warnings),
+                ExitCode.OK, options.toArray(new String[options.size()]));
+    }
+
+    private void verifyOptionValues(String value, boolean useRTMLocking,
+            String expectedValue) throws Throwable {
+        List<String> options = new LinkedList<>();
+        options.add(CommandLineOptionTest.prepareBooleanFlag("UseRTMLocking",
+                useRTMLocking));
+
+        if (isExperimental) {
+            options.add(CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS);
+        }
+        options.add(prepareOptionValue(value));
+
+        CommandLineOptionTest.verifyOptionValueForSameVM(optionName,
+                expectedValue, options.toArray(new String[options.size()]));
+    }
+}
diff --git a/hotspot/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsBase.java b/hotspot/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsBase.java
new file mode 100644
index 0000000..2c7d565
--- /dev/null
+++ b/hotspot/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsBase.java
@@ -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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+import com.oracle.java.testlibrary.*;
+import com.oracle.java.testlibrary.cli.*;
+
+import java.util.function.BooleanSupplier;
+
+public abstract class TestPrintPreciseRTMLockingStatisticsBase
+        extends RTMGenericCommandLineOptionTest {
+    protected static final String DEFAULT_VALUE = "false";
+
+    protected TestPrintPreciseRTMLockingStatisticsBase(
+            BooleanSupplier predicate) {
+        super(predicate, "PrintPreciseRTMLockingStatistics", true, false,
+                TestPrintPreciseRTMLockingStatisticsBase.DEFAULT_VALUE);
+    }
+
+    @Override
+    protected void runNonX86TestCases() throws Throwable {
+        verifyJVMStartup();
+        verifyOptionValues();
+    }
+
+    @Override
+    protected void verifyJVMStartup() throws Throwable {
+        if (Platform.isServer()) {
+            if (!Platform.isDebugBuild()) {
+                String errorMessage = CommandLineOptionTest.
+                        getDiagnosticOptionErrorMessage(optionName);
+                // verify that option is actually diagnostic
+                CommandLineOptionTest.verifySameJVMStartup(
+                        new String[] { errorMessage }, null, ExitCode.FAIL,
+                        prepareOptionValue("true"));
+
+                CommandLineOptionTest.verifySameJVMStartup(null,
+                        new String[] { errorMessage }, ExitCode.OK,
+                        CommandLineOptionTest.UNLOCK_DIAGNOSTIC_VM_OPTIONS,
+                        prepareOptionValue("true"));
+            } else {
+                CommandLineOptionTest.verifySameJVMStartup(
+                        null, null, ExitCode.OK, prepareOptionValue("true"));
+            }
+        } else {
+            String errorMessage = CommandLineOptionTest.
+                    getUnrecognizedOptionErrorMessage(optionName);
+
+            CommandLineOptionTest.verifySameJVMStartup(
+                    new String[]{errorMessage}, null, ExitCode.FAIL,
+                    CommandLineOptionTest.UNLOCK_DIAGNOSTIC_VM_OPTIONS,
+                    prepareOptionValue("true"));
+        }
+    }
+
+    @Override
+    protected void verifyOptionValues() throws Throwable {
+        if (Platform.isServer()) {
+            // Verify default value
+            CommandLineOptionTest.verifyOptionValueForSameVM(optionName,
+                    TestPrintPreciseRTMLockingStatisticsBase.DEFAULT_VALUE,
+                    CommandLineOptionTest.UNLOCK_DIAGNOSTIC_VM_OPTIONS);
+        }
+    }
+}
diff --git a/hotspot/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig.java b/hotspot/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig.java
new file mode 100644
index 0000000..0b336c8
--- /dev/null
+++ b/hotspot/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig.java
@@ -0,0 +1,73 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+/**
+ * @test
+ * @bug 8031320
+ * @summary Verify PrintPreciseRTMLockingStatistics on CPUs with
+ *          rtm support and on VM with rtm locking support,
+ * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
+ * @build TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *                   -XX:+WhiteBoxAPI
+ *                   TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig
+ */
+
+import com.oracle.java.testlibrary.cli.*;
+import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
+import rtm.predicate.SupportedCPU;
+import rtm.predicate.SupportedVM;
+
+public class TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig
+        extends TestPrintPreciseRTMLockingStatisticsBase {
+    private TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig() {
+        super(new AndPredicate(new SupportedVM(), new SupportedCPU()));
+    }
+
+    @Override
+    protected void verifyOptionValues() throws Throwable {
+        super.verifyOptionValues();
+        // verify default value
+        CommandLineOptionTest.verifyOptionValueForSameVM(optionName,
+                TestPrintPreciseRTMLockingStatisticsBase.DEFAULT_VALUE,
+                CommandLineOptionTest.UNLOCK_DIAGNOSTIC_VM_OPTIONS,
+                "-XX:+UseRTMLocking");
+
+        CommandLineOptionTest.verifyOptionValueForSameVM(optionName,
+                TestPrintPreciseRTMLockingStatisticsBase.DEFAULT_VALUE,
+                CommandLineOptionTest.UNLOCK_DIAGNOSTIC_VM_OPTIONS,
+                "-XX:-UseRTMLocking", prepareOptionValue("true"));
+
+        // verify that option could be turned on
+        CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "true",
+                CommandLineOptionTest.UNLOCK_DIAGNOSTIC_VM_OPTIONS,
+                "-XX:+UseRTMLocking", prepareOptionValue("true"));
+    }
+
+    public static void main(String args[]) throws Throwable {
+        new TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig()
+                .test();
+    }
+}
diff --git a/hotspot/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig.java b/hotspot/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig.java
new file mode 100644
index 0000000..b22c6ab
--- /dev/null
+++ b/hotspot/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig.java
@@ -0,0 +1,54 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+/**
+ * @test
+ * @bug 8031320
+ * @summary Verify PrintPreciseRTMLockingStatistics on CPUs without
+ *          rtm support and/or unsupported VM.
+ * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
+ * @build TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *                   -XX:+WhiteBoxAPI
+ *                 TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig
+ */
+
+import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
+import com.oracle.java.testlibrary.cli.predicate.NotPredicate;
+import rtm.predicate.SupportedCPU;
+import rtm.predicate.SupportedVM;
+
+public class TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig
+        extends TestPrintPreciseRTMLockingStatisticsBase {
+    private TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig() {
+        super(new NotPredicate(new AndPredicate(new SupportedCPU(),
+                new SupportedVM())));
+    }
+
+    public static void main(String args[]) throws Throwable {
+        new TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig()
+                .test();
+    }
+}
diff --git a/hotspot/test/compiler/rtm/cli/TestRTMAbortRatioOptionOnSupportedConfig.java b/hotspot/test/compiler/rtm/cli/TestRTMAbortRatioOptionOnSupportedConfig.java
new file mode 100644
index 0000000..ea3d2d3
--- /dev/null
+++ b/hotspot/test/compiler/rtm/cli/TestRTMAbortRatioOptionOnSupportedConfig.java
@@ -0,0 +1,54 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+/**
+ * @test
+ * @bug 8031320
+ * @summary Verify RTMAbortRatio option processing on CPU with rtm
+ *          support and on VM with rtm locking support.
+ * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
+ * @build TestRTMAbortRatioOptionOnSupportedConfig
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *                   -XX:+WhiteBoxAPI TestRTMAbortRatioOptionOnSupportedConfig
+ */
+
+public class TestRTMAbortRatioOptionOnSupportedConfig
+        extends RTMLockingAwareTest {
+    private static final String DEFAULT_VALUE = "50";
+
+    private TestRTMAbortRatioOptionOnSupportedConfig() {
+        super("RTMAbortRatio", false, true,
+                TestRTMAbortRatioOptionOnSupportedConfig.DEFAULT_VALUE,
+                /* correct values */
+                new String[] { "0", "20", "100" },
+                /* incorrect values */
+                new String[] { "-1", "101" },
+                RTMGenericCommandLineOptionTest.RTM_ABORT_RATIO_WARNING);
+    }
+
+    public static void main(String args[]) throws Throwable {
+        new TestRTMAbortRatioOptionOnSupportedConfig().test();
+    }
+}
diff --git a/hotspot/test/compiler/rtm/cli/TestRTMAbortRatioOptionOnUnsupportedConfig.java b/hotspot/test/compiler/rtm/cli/TestRTMAbortRatioOptionOnUnsupportedConfig.java
new file mode 100644
index 0000000..d480774
--- /dev/null
+++ b/hotspot/test/compiler/rtm/cli/TestRTMAbortRatioOptionOnUnsupportedConfig.java
@@ -0,0 +1,57 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+/**
+ * @test
+ * @bug 8031320
+ * @summary Verify RTMAbortRatio option processing on CPU without rtm
+ *          support or on VM that does not support rtm locking.
+ * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
+ * @build TestRTMAbortRatioOptionOnUnsupportedConfig
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *                   -XX:+WhiteBoxAPI TestRTMAbortRatioOptionOnUnsupportedConfig
+ */
+
+import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
+import com.oracle.java.testlibrary.cli.predicate.NotPredicate;
+import rtm.predicate.SupportedCPU;
+import rtm.predicate.SupportedVM;
+
+public class TestRTMAbortRatioOptionOnUnsupportedConfig
+        extends RTMGenericCommandLineOptionTest {
+    private static final String DEFAULT_VALUE = "50";
+
+    private TestRTMAbortRatioOptionOnUnsupportedConfig() {
+        super(new NotPredicate(new AndPredicate(new SupportedVM(),
+                        new SupportedCPU())),
+                "RTMAbortRatio", false, true,
+                TestRTMAbortRatioOptionOnUnsupportedConfig.DEFAULT_VALUE,
+                "0", "10", "100", "200");
+    }
+
+    public static void main(String args[]) throws Throwable {
+        new TestRTMAbortRatioOptionOnUnsupportedConfig().test();
+    }
+}
diff --git a/hotspot/test/compiler/rtm/cli/TestRTMAbortThresholdOption.java b/hotspot/test/compiler/rtm/cli/TestRTMAbortThresholdOption.java
new file mode 100644
index 0000000..120d6f9
--- /dev/null
+++ b/hotspot/test/compiler/rtm/cli/TestRTMAbortThresholdOption.java
@@ -0,0 +1,47 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+/**
+ * @test
+ * @bug 8031320
+ * @summary Verify processing of RTMAbortThreshold option.
+ * @library /testlibrary
+ * @build TestRTMAbortThresholdOption
+ * @run main/othervm TestRTMAbortThresholdOption
+ */
+
+public class TestRTMAbortThresholdOption
+        extends RTMGenericCommandLineOptionTest {
+    private static final String DEFAULT_VALUE = "1000";
+
+    private TestRTMAbortThresholdOption() {
+        super(Boolean.TRUE::booleanValue, "RTMAbortThreshold", false, true,
+                TestRTMAbortThresholdOption.DEFAULT_VALUE,
+                "0", "42", "100", "10000");
+    }
+
+    public static void main(String args[]) throws Throwable {
+        new TestRTMAbortThresholdOption().test();
+    }
+}
diff --git a/hotspot/test/compiler/rtm/cli/TestRTMLockingCalculationDelayOption.java b/hotspot/test/compiler/rtm/cli/TestRTMLockingCalculationDelayOption.java
new file mode 100644
index 0000000..90e85e6
--- /dev/null
+++ b/hotspot/test/compiler/rtm/cli/TestRTMLockingCalculationDelayOption.java
@@ -0,0 +1,46 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+/**
+ * @test
+ * @bug 8031320
+ * @summary Verify processing of RTMLockingCalculationDelay option.
+ * @library /testlibrary
+ * @build TestRTMLockingCalculationDelayOption
+ * @run main/othervm TestRTMLockingCalculationDelayOption
+ */
+
+public class TestRTMLockingCalculationDelayOption
+        extends RTMGenericCommandLineOptionTest {
+    private static final String DEFAULT_VALUE = "0";
+
+    private TestRTMLockingCalculationDelayOption() {
+        super(Boolean.TRUE::booleanValue, "RTMLockingCalculationDelay", false,
+                true, TestRTMLockingCalculationDelayOption.DEFAULT_VALUE);
+    }
+
+    public static void main(String agrs[]) throws Throwable {
+        new TestRTMLockingCalculationDelayOption().test();
+    }
+}
diff --git a/hotspot/test/compiler/rtm/cli/TestRTMLockingThresholdOption.java b/hotspot/test/compiler/rtm/cli/TestRTMLockingThresholdOption.java
new file mode 100644
index 0000000..81f2e60
--- /dev/null
+++ b/hotspot/test/compiler/rtm/cli/TestRTMLockingThresholdOption.java
@@ -0,0 +1,46 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+/**
+ * @test
+ * @bug 8031320
+ * @summary Verify processing of RTMLockingThreshold option.
+ * @library /testlibrary
+ * @build TestRTMLockingThresholdOption
+ * @run main/othervm TestRTMLockingThresholdOption
+ */
+
+public class TestRTMLockingThresholdOption
+        extends RTMGenericCommandLineOptionTest {
+    private static final String DEFAULT_VALUE = "10000";
+
+    private TestRTMLockingThresholdOption() {
+        super(Boolean.TRUE::booleanValue, "RTMLockingThreshold", false, true,
+                TestRTMLockingThresholdOption.DEFAULT_VALUE);
+    }
+
+    public static void main(String args[]) throws Throwable {
+        new TestRTMLockingThresholdOption().test();
+    }
+}
diff --git a/hotspot/test/compiler/rtm/cli/TestRTMRetryCountOption.java b/hotspot/test/compiler/rtm/cli/TestRTMRetryCountOption.java
new file mode 100644
index 0000000..0d4e52c
--- /dev/null
+++ b/hotspot/test/compiler/rtm/cli/TestRTMRetryCountOption.java
@@ -0,0 +1,46 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+/**
+ * @test
+ * @bug 8031320
+ * @summary Verify processing of RTMRetryCount option.
+ * @library /testlibrary
+ * @build TestRTMRetryCountOption
+ * @run main/othervm TestRTMRetryCountOption
+ */
+
+public class TestRTMRetryCountOption extends RTMGenericCommandLineOptionTest {
+    private static final String DEFAULT_VALUE = "5";
+
+    private TestRTMRetryCountOption() {
+        super(Boolean.TRUE::booleanValue, "RTMRetryCount", false, false,
+                TestRTMRetryCountOption.DEFAULT_VALUE,
+                "0", "10", "100", "1000");
+    }
+
+    public static void main(String args[]) throws Throwable {
+        new TestRTMRetryCountOption().test();
+    }
+}
diff --git a/hotspot/test/compiler/rtm/cli/TestRTMSpinLoopCountOption.java b/hotspot/test/compiler/rtm/cli/TestRTMSpinLoopCountOption.java
new file mode 100644
index 0000000..33015d0
--- /dev/null
+++ b/hotspot/test/compiler/rtm/cli/TestRTMSpinLoopCountOption.java
@@ -0,0 +1,47 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+/**
+ * @test
+ * @bug 8031320
+ * @summary Verify processing of RTMSpinLoopCount option.
+ * @library /testlibrary
+ * @build TestRTMSpinLoopCountOption
+ * @run main/othervm TestRTMSpinLoopCountOption
+ */
+
+public class TestRTMSpinLoopCountOption
+        extends RTMGenericCommandLineOptionTest {
+    private static final String DEFAULT_VALUE = "100";
+
+    private TestRTMSpinLoopCountOption() {
+        super(Boolean.TRUE::booleanValue, "RTMSpinLoopCount", false, true,
+                TestRTMSpinLoopCountOption.DEFAULT_VALUE,
+                "0", "10", "42", "1000");
+    }
+
+    public static void main(String args[]) throws Throwable {
+        new TestRTMSpinLoopCountOption().test();
+    }
+}
diff --git a/hotspot/test/compiler/rtm/cli/TestRTMTotalCountIncrRateOptionOnSupportedConfig.java b/hotspot/test/compiler/rtm/cli/TestRTMTotalCountIncrRateOptionOnSupportedConfig.java
new file mode 100644
index 0000000..86ddcdc
--- /dev/null
+++ b/hotspot/test/compiler/rtm/cli/TestRTMTotalCountIncrRateOptionOnSupportedConfig.java
@@ -0,0 +1,55 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+/**
+ * @test
+ * @bug 8031320
+ * @summary Verify RTMTotalCountIncrRate option processing on CPU with
+ *          rtm support and on VM with rtm locking support.
+ * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
+ * @build TestRTMTotalCountIncrRateOptionOnSupportedConfig
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *                   -XX:+WhiteBoxAPI
+ *                   TestRTMTotalCountIncrRateOptionOnSupportedConfig
+ */
+
+public class TestRTMTotalCountIncrRateOptionOnSupportedConfig
+        extends RTMLockingAwareTest {
+    private static final String DEFAULT_VALUE = "64";
+
+    private TestRTMTotalCountIncrRateOptionOnSupportedConfig() {
+        super("RTMTotalCountIncrRate", false, true,
+                TestRTMTotalCountIncrRateOptionOnSupportedConfig.DEFAULT_VALUE,
+                /* correct values */
+                new String[] { "1", "2", "128", "1024" },
+                /* incorrect values */
+                new String[] { "-1", "0", "3", "42" },
+                RTMGenericCommandLineOptionTest.RTM_COUNT_INCR_WARNING);
+    }
+
+    public static void main(String args[]) throws Throwable {
+        new TestRTMTotalCountIncrRateOptionOnSupportedConfig().test();
+    }
+}
diff --git a/hotspot/test/compiler/rtm/cli/TestRTMTotalCountIncrRateOptionOnUnsupportedConfig.java b/hotspot/test/compiler/rtm/cli/TestRTMTotalCountIncrRateOptionOnUnsupportedConfig.java
new file mode 100644
index 0000000..32cd417
--- /dev/null
+++ b/hotspot/test/compiler/rtm/cli/TestRTMTotalCountIncrRateOptionOnUnsupportedConfig.java
@@ -0,0 +1,59 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
+import com.oracle.java.testlibrary.cli.predicate.NotPredicate;
+import rtm.predicate.SupportedCPU;
+import rtm.predicate.SupportedVM;
+
+/**
+ * @test
+ * @bug 8031320
+ * @summary Verify RTMTotalCountIncrRate option processing on CPU without
+ *          rtm support and/or on VM without rtm locking support.
+ * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
+ * @build TestRTMTotalCountIncrRateOptionOnUnsupportedConfig
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *                   -XX:+WhiteBoxAPI
+ *                   TestRTMTotalCountIncrRateOptionOnUnsupportedConfig
+ */
+
+public class TestRTMTotalCountIncrRateOptionOnUnsupportedConfig
+        extends RTMGenericCommandLineOptionTest {
+    private static final String DEFAULT_VALUE = "64";
+
+    private TestRTMTotalCountIncrRateOptionOnUnsupportedConfig() {
+        super(new NotPredicate(new AndPredicate(new SupportedCPU(),
+                        new SupportedVM())),
+                "RTMTotalCountIncrRate", false, true,
+                TestRTMTotalCountIncrRateOptionOnUnsupportedConfig
+                        .DEFAULT_VALUE,
+                "-1", "0", "42", "128");
+    }
+
+    public static void main(String args[]) throws Throwable {
+        new TestRTMTotalCountIncrRateOptionOnUnsupportedConfig().test();
+    }
+}
diff --git a/hotspot/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnSupportedConfig.java b/hotspot/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnSupportedConfig.java
new file mode 100644
index 0000000..39eee00
--- /dev/null
+++ b/hotspot/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnSupportedConfig.java
@@ -0,0 +1,77 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+/**
+ * @test
+ * @bug 8031320
+ * @summary Verify UseRTMDeopt option processing on CPUs with rtm support
+ *          when rtm locking is supported by VM.
+ * @library /testlibrary /testlibrary/whitebox
+ * @build TestUseRTMDeoptOptionOnSupportedConfig
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *                   -XX:+WhiteBoxAPI TestUseRTMDeoptOptionOnSupportedConfig
+ */
+
+import com.oracle.java.testlibrary.ExitCode;
+import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
+import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
+import rtm.predicate.SupportedCPU;
+import rtm.predicate.SupportedVM;
+
+public class TestUseRTMDeoptOptionOnSupportedConfig
+        extends CommandLineOptionTest {
+    private static final String DEFAULT_VALUE = "false";
+
+    private TestUseRTMDeoptOptionOnSupportedConfig() {
+        super(new AndPredicate(new SupportedVM(), new SupportedCPU()));
+    }
+
+    @Override
+    public void runTestCases() throws Throwable {
+        // verify that option could be turned on
+        CommandLineOptionTest.verifySameJVMStartup(
+                null, null, ExitCode.OK, "-XX:+UseRTMDeopt");
+        // verify that option could be turned off
+        CommandLineOptionTest.verifySameJVMStartup(
+                null, null, ExitCode.OK, "-XX:-UseRTMDeopt");
+        // verify default value
+        CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMDeopt",
+                TestUseRTMDeoptOptionOnSupportedConfig.DEFAULT_VALUE);
+        // verify default value
+        CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMDeopt",
+                TestUseRTMDeoptOptionOnSupportedConfig.DEFAULT_VALUE,
+                "-XX:+UseRTMLocking");
+        // verify that option is off when UseRTMLocking is off
+        CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMDeopt",
+                "false", "-XX:-UseRTMLocking", "-XX:+UseRTMDeopt");
+        // verify that option could be turned on
+        CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMDeopt",
+                "true", "-XX:+UseRTMLocking", "-XX:+UseRTMDeopt");
+    }
+
+    public static void main(String args[]) throws Throwable {
+        new TestUseRTMDeoptOptionOnSupportedConfig().test();
+    }
+}
diff --git a/hotspot/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnUnsupportedConfig.java b/hotspot/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnUnsupportedConfig.java
new file mode 100644
index 0000000..68c4ef6
--- /dev/null
+++ b/hotspot/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnUnsupportedConfig.java
@@ -0,0 +1,70 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+/**
+ * @test
+ * @bug 8031320
+ * @summary Verify UseRTMDeopt option processing on CPUs without rtm support
+ *          or on VMs without rtm locking support.
+ * @library /testlibrary /testlibrary/whitebox
+ * @build TestUseRTMDeoptOptionOnUnsupportedConfig
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *                   -XX:+WhiteBoxAPI TestUseRTMDeoptOptionOnUnsupportedConfig
+ */
+
+import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
+
+import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
+import com.oracle.java.testlibrary.cli.predicate.NotPredicate;
+import rtm.predicate.SupportedCPU;
+import rtm.predicate.SupportedVM;
+
+public class TestUseRTMDeoptOptionOnUnsupportedConfig
+        extends RTMGenericCommandLineOptionTest {
+    private static final String DEFAULT_VALUE = "false";
+
+    private TestUseRTMDeoptOptionOnUnsupportedConfig() {
+        super(new NotPredicate(new AndPredicate(new SupportedCPU(),
+                        new SupportedVM())),
+                "UseRTMDeopt", true, false,
+                TestUseRTMDeoptOptionOnUnsupportedConfig.DEFAULT_VALUE, "true");
+    }
+
+    @Override
+    protected void runX86SupportedVMTestCases() throws Throwable {
+        super.verifyJVMStartup();
+        // verify default value
+        CommandLineOptionTest.verifyOptionValueForSameVM(optionName,
+                defaultValue);
+        // verify that until RTMLocking is not used, value
+        // will be set to default false.
+        CommandLineOptionTest.verifyOptionValueForSameVM(optionName,
+                defaultValue, "-XX:+UseRTMDeopt");
+    }
+
+    public static void main(String args[]) throws Throwable {
+        new TestUseRTMDeoptOptionOnUnsupportedConfig().test();
+    }
+}
diff --git a/hotspot/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnSupportedConfig.java b/hotspot/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnSupportedConfig.java
new file mode 100644
index 0000000..b01a6a7
--- /dev/null
+++ b/hotspot/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnSupportedConfig.java
@@ -0,0 +1,102 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+/**
+ * @test
+ * @bug 8031320
+ * @summary Verify UseRTMForStackLocks option processing on CPU with
+ *          rtm support when VM supports rtm locking.
+ * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
+ * @build TestUseRTMForStackLocksOptionOnSupportedConfig
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *                   -XX:+WhiteBoxAPI
+ *                   TestUseRTMForStackLocksOptionOnSupportedConfig
+ */
+
+import com.oracle.java.testlibrary.*;
+import com.oracle.java.testlibrary.cli.*;
+import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
+import rtm.predicate.SupportedCPU;
+import rtm.predicate.SupportedVM;
+
+public class TestUseRTMForStackLocksOptionOnSupportedConfig
+        extends CommandLineOptionTest {
+    private static final String DEFAULT_VALUE = "false";
+
+    private TestUseRTMForStackLocksOptionOnSupportedConfig() {
+        super(new AndPredicate(new SupportedVM(), new SupportedCPU()));
+    }
+
+    @Override
+    public void runTestCases() throws Throwable {
+        String errorMessage
+                = CommandLineOptionTest.getExperimentalOptionErrorMessage(
+                "UseRTMForStackLocks");
+        String warningMessage
+                = RTMGenericCommandLineOptionTest.RTM_FOR_STACK_LOCKS_WARNING;
+
+        CommandLineOptionTest.verifySameJVMStartup(
+                new String[] { errorMessage }, null, ExitCode.FAIL,
+                "-XX:+UseRTMForStackLocks");
+        // verify that we get a warning when trying to use rtm for stack
+        // lock, but not using rtm locking.
+        CommandLineOptionTest.verifySameJVMStartup(
+                new String[] { warningMessage }, null, ExitCode.OK,
+                CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
+                "-XX:+UseRTMForStackLocks",
+                "-XX:-UseRTMLocking");
+        // verify that we don't get a warning when no using rtm for stack
+        // lock and not using rtm locking.
+        CommandLineOptionTest.verifySameJVMStartup(null,
+                new String[] { warningMessage }, ExitCode.OK,
+                CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
+                "-XX:-UseRTMForStackLocks",
+                "-XX:-UseRTMLocking");
+        // verify that we don't get a warning when using rtm for stack
+        // lock and using rtm locking.
+        CommandLineOptionTest.verifySameJVMStartup(null,
+                new String[] { warningMessage }, ExitCode.OK,
+                CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
+                "-XX:+UseRTMForStackLocks",
+                "-XX:+UseRTMLocking");
+        // verify that default value if false
+        CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMForStackLocks",
+                TestUseRTMForStackLocksOptionOnSupportedConfig.DEFAULT_VALUE,
+                CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS);
+        // verify that default value is false even with +UseRTMLocking
+        CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMForStackLocks",
+                TestUseRTMForStackLocksOptionOnSupportedConfig.DEFAULT_VALUE,
+                CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
+                "-XX:+UseRTMLocking");
+        // verify that we can turn the option on
+        CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMForStackLocks",
+                "true", CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
+                "-XX:+UseRTMLocking", "-XX:+UseRTMForStackLocks");
+    }
+
+    public static void main(String args[]) throws Throwable {
+        new TestUseRTMForStackLocksOptionOnSupportedConfig().test();
+    }
+}
diff --git a/hotspot/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnUnsupportedConfig.java b/hotspot/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnUnsupportedConfig.java
new file mode 100644
index 0000000..557f17a4
--- /dev/null
+++ b/hotspot/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnUnsupportedConfig.java
@@ -0,0 +1,93 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+/**
+ * @test
+ * @bug 8031320
+ * @summary Verify UseRTMForStackLocks option processing on CPUs without
+ *          rtm support and/or on VMs without rtm locking support.
+ * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
+ * @build TestUseRTMForStackLocksOptionOnUnsupportedConfig
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *                   -XX:+WhiteBoxAPI
+ *                    TestUseRTMForStackLocksOptionOnUnsupportedConfig
+ */
+
+import com.oracle.java.testlibrary.ExitCode;
+import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
+import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
+import com.oracle.java.testlibrary.cli.predicate.NotPredicate;
+import rtm.predicate.SupportedCPU;
+import rtm.predicate.SupportedVM;
+
+public class TestUseRTMForStackLocksOptionOnUnsupportedConfig
+        extends RTMGenericCommandLineOptionTest {
+    private static final String DEFAULT_VALUE = "false";
+
+    private TestUseRTMForStackLocksOptionOnUnsupportedConfig() {
+        super(new NotPredicate(new AndPredicate(new SupportedCPU(),
+                        new SupportedVM())),
+                "UseRTMForStackLocks", true, true,
+                TestUseRTMForStackLocksOptionOnUnsupportedConfig.DEFAULT_VALUE,
+                "true");
+    }
+
+    @Override
+    protected void runX86SupportedVMTestCases() throws Throwable {
+        // verify that option is experimental
+        CommandLineOptionTest.verifySameJVMStartup(
+                new String[]{ experimentalOptionError },
+                null, ExitCode.FAIL, prepareOptionValue("true"));
+
+        CommandLineOptionTest.verifySameJVMStartup(
+                new String[]{ experimentalOptionError },
+                null, ExitCode.FAIL, prepareOptionValue("false"));
+
+        // verify that if we turn it on, then VM output will contain
+        // warning saying that this option could be turned on only
+        // when we use rtm locking
+        CommandLineOptionTest.verifySameJVMStartup(
+                new String[]{
+                    RTMGenericCommandLineOptionTest.RTM_FOR_STACK_LOCKS_WARNING
+                },
+                null, ExitCode.OK,
+                CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
+                prepareOptionValue("true")
+        );
+        // verify that options is turned off by default
+        CommandLineOptionTest.verifyOptionValueForSameVM(optionName,
+                TestUseRTMForStackLocksOptionOnUnsupportedConfig.DEFAULT_VALUE,
+                CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS);
+        // verify that it could not be turned on without rtm locking
+        CommandLineOptionTest.verifyOptionValueForSameVM(optionName,
+                TestUseRTMForStackLocksOptionOnUnsupportedConfig.DEFAULT_VALUE,
+                CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
+                prepareOptionValue("true"));
+    }
+
+    public static void main(String args[]) throws Throwable {
+        new TestUseRTMForStackLocksOptionOnUnsupportedConfig().test();
+    }
+}
diff --git a/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionOnSupportedConfig.java b/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionOnSupportedConfig.java
new file mode 100644
index 0000000..72af535
--- /dev/null
+++ b/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionOnSupportedConfig.java
@@ -0,0 +1,84 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+/**
+ * @test
+ * @bug 8031320
+ * @summary Verify UseRTMLocking option processing on CPU with rtm support and
+ *          on VM with rtm-locking support.
+ * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
+ * @build TestUseRTMLockingOptionOnSupportedConfig
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *                   -XX:+WhiteBoxAPI TestUseRTMLockingOptionOnSupportedConfig
+ */
+
+import com.oracle.java.testlibrary.ExitCode;
+import com.oracle.java.testlibrary.cli.*;
+import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
+import rtm.predicate.SupportedCPU;
+import rtm.predicate.SupportedVM;
+
+public class TestUseRTMLockingOptionOnSupportedConfig
+        extends CommandLineOptionTest {
+    private static final String DEFAULT_VALUE = "false";
+
+    private TestUseRTMLockingOptionOnSupportedConfig() {
+        super(new AndPredicate(new SupportedVM(), new SupportedCPU()));
+    }
+
+    @Override
+    public void runTestCases() throws Throwable {
+        String unrecongnizedOption
+                =  CommandLineOptionTest.getUnrecognizedOptionErrorMessage(
+                "UseRTMLocking");
+        // verify that there are no warning or error in VM output
+        CommandLineOptionTest.verifySameJVMStartup(null,
+                new String[]{
+                        RTMGenericCommandLineOptionTest.RTM_INSTR_ERROR,
+                        unrecongnizedOption
+                }, ExitCode.OK, "-XX:+UseRTMLocking"
+        );
+
+        CommandLineOptionTest.verifySameJVMStartup(null,
+                new String[]{
+                        RTMGenericCommandLineOptionTest.RTM_INSTR_ERROR,
+                        unrecongnizedOption
+                }, ExitCode.OK, "-XX:-UseRTMLocking"
+        );
+        // verify that UseRTMLocking is of by default
+        CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMLocking",
+                TestUseRTMLockingOptionOnSupportedConfig.DEFAULT_VALUE);
+        // verify that we can change UseRTMLocking value
+        CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMLocking",
+                TestUseRTMLockingOptionOnSupportedConfig.DEFAULT_VALUE,
+                "-XX:-UseRTMLocking");
+        CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMLocking",
+                "true", "-XX:+UseRTMLocking");
+    }
+
+    public static void main(String args[]) throws Throwable {
+        new TestUseRTMLockingOptionOnSupportedConfig().test();
+    }
+}
diff --git a/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionOnUnsupportedCPU.java b/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionOnUnsupportedCPU.java
new file mode 100644
index 0000000..6e10024
--- /dev/null
+++ b/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionOnUnsupportedCPU.java
@@ -0,0 +1,94 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+/**
+ * @test
+ * @bug 8031320
+ * @summary Verify UseRTMLocking option processing on CPU without
+ *          rtm support.
+ * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
+ * @build TestUseRTMLockingOptionOnUnsupportedCPU
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *                   -XX:+WhiteBoxAPI TestUseRTMLockingOptionOnUnsupportedCPU
+ */
+
+import com.oracle.java.testlibrary.*;
+import com.oracle.java.testlibrary.cli.*;
+import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
+import com.oracle.java.testlibrary.cli.predicate.NotPredicate;
+import rtm.predicate.SupportedCPU;
+import rtm.predicate.SupportedVM;
+
+public class TestUseRTMLockingOptionOnUnsupportedCPU
+        extends CommandLineOptionTest {
+    private static final String DEFAULT_VALUE = "false";
+
+    private TestUseRTMLockingOptionOnUnsupportedCPU() {
+        super(new AndPredicate(new NotPredicate(new SupportedCPU()),
+                new SupportedVM()));
+    }
+
+    @Override
+    public void runTestCases() throws Throwable {
+        String unrecongnizedOption
+                = CommandLineOptionTest.getUnrecognizedOptionErrorMessage(
+                "UseRTMLocking");
+        String errorMessage = RTMGenericCommandLineOptionTest.RTM_INSTR_ERROR;
+
+        if (Platform.isX86() || Platform.isX64()) {
+            // verify that we get an error when use +UseRTMLocking
+            // on unsupported CPU
+            CommandLineOptionTest.verifySameJVMStartup(
+                    new String[] { errorMessage },
+                    new String[] { unrecongnizedOption },
+                    ExitCode.FAIL, "-XX:+UseRTMLocking");
+            // verify that we can pass -UseRTMLocking without
+            // getting any error messages
+            CommandLineOptionTest.verifySameJVMStartup(
+                    null,
+                    new String[]{
+                            errorMessage,
+                            unrecongnizedOption
+                    }, ExitCode.OK, "-XX:-UseRTMLocking");
+
+            // verify that UseRTMLocking is false by default
+            CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMLocking",
+                    TestUseRTMLockingOptionOnUnsupportedCPU.DEFAULT_VALUE);
+        } else {
+            // verify that on non-x86 CPUs RTMLocking could not be used
+            CommandLineOptionTest.verifySameJVMStartup(
+                    new String[] { unrecongnizedOption },
+                    null, ExitCode.FAIL, "-XX:+UseRTMLocking");
+
+            CommandLineOptionTest.verifySameJVMStartup(
+                    new String[] { unrecongnizedOption },
+                    null, ExitCode.FAIL, "-XX:-UseRTMLocking");
+        }
+    }
+
+    public static void main(String args[]) throws Throwable {
+        new TestUseRTMLockingOptionOnUnsupportedCPU().test();
+    }
+}
diff --git a/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionOnUnsupportedVM.java b/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionOnUnsupportedVM.java
new file mode 100644
index 0000000..0121856
--- /dev/null
+++ b/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionOnUnsupportedVM.java
@@ -0,0 +1,72 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+/**
+ * @test
+ * @bug 8031320
+ * @summary Verify UseRTMLocking option processing on CPU with rtm support
+ *          in case when VM should not support this option.
+ * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
+ * @build TestUseRTMLockingOptionOnUnsupportedVM
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *                   -XX:+WhiteBoxAPI TestUseRTMLockingOptionOnUnsupportedVM
+ */
+
+import com.oracle.java.testlibrary.ExitCode;
+import com.oracle.java.testlibrary.cli.*;
+import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
+import com.oracle.java.testlibrary.cli.predicate.NotPredicate;
+import rtm.predicate.SupportedCPU;
+import rtm.predicate.SupportedVM;
+
+public class TestUseRTMLockingOptionOnUnsupportedVM
+        extends CommandLineOptionTest {
+    private static final String DEFAULT_VALUE = "false";
+
+    private TestUseRTMLockingOptionOnUnsupportedVM() {
+        super(new AndPredicate(new SupportedCPU(),
+                new NotPredicate(new SupportedVM())));
+    }
+    @Override
+    public void runTestCases() throws Throwable {
+        String errorMessage
+                = RTMGenericCommandLineOptionTest.RTM_UNSUPPORTED_VM_ERROR;
+        // verify that we can't use +UseRTMLocking
+        CommandLineOptionTest.verifySameJVMStartup(
+                new String[] { errorMessage }, null, ExitCode.FAIL,
+                "-XX:+UseRTMLocking");
+        // verify that we can turn it off
+        CommandLineOptionTest.verifySameJVMStartup(null,
+                new String[] { errorMessage }, ExitCode.OK,
+                "-XX:-UseRTMLocking");
+        // verify that it is off by default
+        CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMLocking",
+                TestUseRTMLockingOptionOnUnsupportedVM.DEFAULT_VALUE);
+    }
+
+    public static void main(String args[]) throws Throwable {
+        new TestUseRTMLockingOptionOnUnsupportedVM().test();
+    }
+}
diff --git a/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionWithBiasedLocking.java b/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionWithBiasedLocking.java
new file mode 100644
index 0000000..89b30bf
--- /dev/null
+++ b/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionWithBiasedLocking.java
@@ -0,0 +1,73 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+/**
+ * @test
+ * @bug 8031320
+ * @summary Verify processing of UseRTMLocking and UseBiasedLocking
+ *          options combination on CPU and VM with rtm support.
+ * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
+ * @build TestUseRTMLockingOptionWithBiasedLocking
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *                   -XX:+WhiteBoxAPI TestUseRTMLockingOptionWithBiasedLocking
+ */
+
+import com.oracle.java.testlibrary.*;
+import com.oracle.java.testlibrary.cli.*;
+import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
+import rtm.predicate.SupportedCPU;
+import rtm.predicate.SupportedVM;
+
+public class TestUseRTMLockingOptionWithBiasedLocking
+        extends CommandLineOptionTest {
+    private TestUseRTMLockingOptionWithBiasedLocking() {
+        super(new AndPredicate(new SupportedCPU(), new SupportedVM()));
+    }
+
+    @Override
+    public void runTestCases() throws Throwable {
+        String warningMessage
+                = RTMGenericCommandLineOptionTest.RTM_BIASED_LOCKING_WARNING;
+        // verify that we will not get a warning
+        CommandLineOptionTest.verifySameJVMStartup(null,
+                new String[] { warningMessage }, ExitCode.OK,
+                "-XX:+UseRTMLocking", "-XX:-UseBiasedLocking");
+        // verify that we will get a warning
+        CommandLineOptionTest.verifySameJVMStartup(
+                new String[] { warningMessage }, null, ExitCode.OK,
+                "-XX:+UseRTMLocking", "-XX:+UseBiasedLocking");
+        // verify that UseBiasedLocking is false when we use rtm locking
+        CommandLineOptionTest.verifyOptionValueForSameVM("UseBiasedLocking",
+                "false", "-XX:+UseRTMLocking");
+        // verify that we can't turn on biased locking when
+        // using rtm locking
+        CommandLineOptionTest.verifyOptionValueForSameVM("UseBiasedLocking",
+                "false", "-XX:+UseRTMLocking", "-XX:+UseBiasedLocking");
+    }
+
+    public static void main(String args[]) throws Throwable {
+        new TestUseRTMLockingOptionWithBiasedLocking().test();
+    }
+}
diff --git a/hotspot/test/compiler/rtm/cli/TestUseRTMXendForLockBusyOption.java b/hotspot/test/compiler/rtm/cli/TestUseRTMXendForLockBusyOption.java
new file mode 100644
index 0000000..0d112ce
--- /dev/null
+++ b/hotspot/test/compiler/rtm/cli/TestUseRTMXendForLockBusyOption.java
@@ -0,0 +1,46 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+/**
+ * @test
+ * @bug 8031320
+ * @summary Verify processing of UseRTMXendForLockBusy option.
+ * @library /testlibrary
+ * @build TestUseRTMXendForLockBusyOption
+ * @run main/othervm TestUseRTMXendForLockBusyOption
+ */
+
+public class TestUseRTMXendForLockBusyOption
+        extends RTMGenericCommandLineOptionTest {
+    private static final String DEFAULT_VALUE = "true";
+
+    public TestUseRTMXendForLockBusyOption() {
+        super(Boolean.TRUE::booleanValue, "UseRTMXendForLockBusy", true, true,
+                TestUseRTMXendForLockBusyOption.DEFAULT_VALUE, "true");
+    }
+
+    public static void main(String agrs[]) throws Throwable {
+        new TestUseRTMXendForLockBusyOption().test();
+    }
+}
diff --git a/hotspot/test/compiler/rtm/locking/TestRTMAbortRatio.java b/hotspot/test/compiler/rtm/locking/TestRTMAbortRatio.java
new file mode 100644
index 0000000..2c179d8
--- /dev/null
+++ b/hotspot/test/compiler/rtm/locking/TestRTMAbortRatio.java
@@ -0,0 +1,163 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+/**
+ * @test
+ * @bug 8031320
+ * @summary Verify that RTMAbortRatio affects amount of aborts before
+ *          deoptimization.
+ * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
+ * @build TestRTMAbortRatio
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *                   -XX:+WhiteBoxAPI TestRTMAbortRatio
+ */
+
+import java.util.List;
+import com.oracle.java.testlibrary.*;
+import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
+import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
+import rtm.*;
+import rtm.predicate.SupportedCPU;
+import rtm.predicate.SupportedVM;
+import sun.misc.Unsafe;
+
+/**
+ * Test verifies that method will be deoptimized on high abort ratio
+ * as soon as abort ratio reaches RTMAbortRatio's value.
+ */
+public class TestRTMAbortRatio extends CommandLineOptionTest {
+    private TestRTMAbortRatio() {
+        super(new AndPredicate(new SupportedCPU(), new SupportedVM()));
+    }
+
+    @Override
+    protected void runTestCases() throws Throwable {
+        verifyAbortRatio(0, false);
+        verifyAbortRatio(10, false);
+        verifyAbortRatio(50, false);
+        verifyAbortRatio(100, false);
+
+        verifyAbortRatio(0, true);
+        verifyAbortRatio(10, true);
+        verifyAbortRatio(50, true);
+        verifyAbortRatio(100, true);
+    }
+
+    private void verifyAbortRatio(int abortRatio, boolean useStackLock)
+            throws Throwable {
+        CompilableTest test = new Test();
+
+        OutputAnalyzer outputAnalyzer = RTMTestBase.executeRTMTest(
+                test,
+                CommandLineOptionTest.prepareBooleanFlag("UseRTMForStackLocks",
+                        useStackLock),
+                "-XX:+UseRTMDeopt",
+                "-XX:RTMTotalCountIncrRate=1",
+                "-XX:RTMAbortThreshold=0",
+                CommandLineOptionTest.prepareNumericFlag("RTMLockingThreshold",
+                        10 * Test.TOTAL_ITERATIONS),
+                CommandLineOptionTest.prepareNumericFlag("RTMAbortRatio",
+                        abortRatio),
+                "-XX:+PrintPreciseRTMLockingStatistics",
+                test.getClass().getName(),
+                Boolean.toString(!useStackLock));
+
+        outputAnalyzer.shouldHaveExitValue(0);
+
+        List<RTMLockingStatistics> statistics = RTMLockingStatistics.fromString(
+                test.getMethodWithLockName(), outputAnalyzer.getOutput());
+
+        Asserts.assertEQ(statistics.size(), 1, "VM output should contain "
+                + "exactly one RTM locking statistics entry.");
+
+        RTMLockingStatistics lock = statistics.get(0);
+        int actualRatio;
+
+        if (lock.getTotalAborts() == 1L) {
+            actualRatio = 0;
+        } else {
+            actualRatio = (int) (lock.getTotalLocks()
+                    / (lock.getTotalAborts() - 1L));
+        }
+
+        Asserts.assertLTE(actualRatio, abortRatio, String.format(
+                "Actual abort ratio (%d) should lower or equal to "
+                + "specified (%d).", actualRatio, abortRatio));
+    }
+
+    /**
+     * Force abort after {@code Test.WARMUP_ITERATIONS} is done.
+     */
+    public static class Test implements CompilableTest {
+        private static final int TOTAL_ITERATIONS = 10000;
+        private static final int WARMUP_ITERATIONS = 1000;
+        private static final Unsafe UNSAFE = Utils.getUnsafe();
+        private final Object monitor = new Object();
+        // Following field have to be static in order to avoid escape analysis.
+        @SuppressWarnings("UnsuedDeclaration")
+        private static int field = 0;
+
+        @Override
+        public String getMethodWithLockName() {
+             return this.getClass().getName() + "::lock";
+         }
+
+        @Override
+        public String[] getMethodsToCompileNames() {
+            return new String[] {
+                    getMethodWithLockName(),
+                    Unsafe.class.getName() + "::addressSize"
+            };
+        }
+
+        public void lock(boolean abort) {
+            synchronized(monitor) {
+                if (abort) {
+                    Test.UNSAFE.addressSize();
+                }
+            }
+        }
+
+        /**
+         * Usage:
+         * Test &lt;inflate monitor&gt;
+         */
+        public static void main(String args[]) throws Throwable {
+            Asserts.assertGTE(args.length, 1, "One argument required.");
+            Test t = new Test();
+            if (Boolean.valueOf(args[0])) {
+                AbortProvoker.inflateMonitor(t.monitor);
+            }
+            for (int i = 0; i < Test.TOTAL_ITERATIONS; i++) {
+                t.lock(i >= Test.WARMUP_ITERATIONS);
+            }
+        }
+    }
+
+    public static void main(String args[]) throws Throwable {
+        new TestRTMAbortRatio().test();
+    }
+}
+
diff --git a/hotspot/test/compiler/rtm/locking/TestRTMAbortThreshold.java b/hotspot/test/compiler/rtm/locking/TestRTMAbortThreshold.java
new file mode 100644
index 0000000..dbed5f0
--- /dev/null
+++ b/hotspot/test/compiler/rtm/locking/TestRTMAbortThreshold.java
@@ -0,0 +1,102 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+/**
+ * @test
+ * @bug 8031320
+ * @summary Verify that RTMAbortThreshold option affects
+ *          amount of aborts after which abort ratio is calculated.
+ * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
+ * @build TestRTMAbortThreshold
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *                   -XX:+WhiteBoxAPI TestRTMAbortThreshold
+ */
+
+import java.util.List;
+import com.oracle.java.testlibrary.*;
+import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
+import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
+import rtm.*;
+import rtm.predicate.SupportedCPU;
+import rtm.predicate.SupportedVM;
+
+/**
+ * Test verifies that on RTMAbortThreshold option actually affects how soon
+ * method will be deoptimized on high abort ratio.
+ */
+public class TestRTMAbortThreshold extends CommandLineOptionTest {
+    private TestRTMAbortThreshold() {
+        super(new AndPredicate(new SupportedCPU(), new SupportedVM()));
+    }
+
+    @Override
+    protected void runTestCases() throws Throwable {
+        verifyAbortThreshold(false, 1);
+        verifyAbortThreshold(false, 10);
+        verifyAbortThreshold(false, 1000);
+
+        verifyAbortThreshold(true, 1);
+        verifyAbortThreshold(true, 10);
+        verifyAbortThreshold(true, 1000);
+    }
+
+    private void verifyAbortThreshold(boolean useStackLock,
+            long abortThreshold) throws Throwable {
+        AbortProvoker provoker = AbortType.XABORT.provoker();
+
+        OutputAnalyzer outputAnalyzer = RTMTestBase.executeRTMTest(
+                provoker,
+                "-XX:+UseRTMDeopt",
+                "-XX:RTMAbortRatio=0",
+                CommandLineOptionTest.prepareNumericFlag("RTMAbortThreshold",
+                        abortThreshold),
+                CommandLineOptionTest.prepareBooleanFlag("UseRTMForStackLocks",
+                        useStackLock),
+                "-XX:RTMTotalCountIncrRate=1",
+                "-XX:+PrintPreciseRTMLockingStatistics",
+                AbortProvoker.class.getName(),
+                AbortType.XABORT.toString(),
+                Boolean.toString(!useStackLock));
+
+        outputAnalyzer.shouldHaveExitValue(0);
+
+        List<RTMLockingStatistics> statistics = RTMLockingStatistics.fromString(
+                provoker.getMethodWithLockName(), outputAnalyzer.getOutput());
+
+        Asserts.assertEQ(statistics.size(), 1, "VM output should contain "
+                + "exactly one RTM locking statistics entry for method "
+                + provoker.getMethodWithLockName());
+
+        Asserts.assertEQ(statistics.get(0).getTotalLocks(), abortThreshold,
+                String.format("Expected that method with rtm lock elision was"
+                        + " deoptimized after %d lock attempts",
+                        abortThreshold));
+    }
+
+    public static void main(String args[]) throws Throwable {
+         new TestRTMAbortThreshold().test();
+    }
+}
+
diff --git a/hotspot/test/compiler/rtm/locking/TestRTMAfterNonRTMDeopt.java b/hotspot/test/compiler/rtm/locking/TestRTMAfterNonRTMDeopt.java
new file mode 100644
index 0000000..2cf81f7
--- /dev/null
+++ b/hotspot/test/compiler/rtm/locking/TestRTMAfterNonRTMDeopt.java
@@ -0,0 +1,210 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+/**
+ * @test
+ * @bug 8031320
+ * @summary Verify that if we use RTMDeopt, then deoptimization
+ *          caused by reason other then rtm_state_change will reset
+ *          method's RTM state. And if we don't use RTMDeopt, then
+ *          RTM state remain the same after such deoptimization.
+ * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
+ * @build TestRTMAfterNonRTMDeopt
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *                   -XX:+WhiteBoxAPI TestRTMAfterNonRTMDeopt
+ */
+
+import java.util.List;
+import com.oracle.java.testlibrary.*;
+import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
+import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
+import rtm.*;
+import rtm.predicate.SupportedCPU;
+import rtm.predicate.SupportedVM;
+import sun.misc.Unsafe;
+
+/**
+ * To verify that with +UseRTMDeopt method's RTM state will be
+ * changed to ProfileRTM on deoptimization unrelated to
+ * rtm_state_change following sequence of events is used:
+ * <pre>
+ *
+ *     rtm state ^
+ *               |
+ *       UseRTM  |      ******|     ******
+ *               |            |
+ *   ProfileRTM  |******|     |*****|
+ *               |      |     |     |
+ *              0-------|-----|-----|---------------------&gt; time
+ *                      |     |     \ force abort
+ *                      |     |
+ *                      |     \ force deoptimization
+ *                      |
+ *                      \ force xabort
+ * </pre>
+ * When xabort is forced by native method call method should
+ * change it's state to UseRTM, because we use RTMAbortRatio=100
+ * and low RTMLockingThreshold, so at this point actual abort
+ * ratio will be below 100% and there should be enough lock
+ * attempts to recompile method without RTM profiling.
+ */
+public class TestRTMAfterNonRTMDeopt extends CommandLineOptionTest {
+    private static final int ABORT_THRESHOLD = 1000;
+    private static final String RANGE_CHECK = "range_check";
+
+    private TestRTMAfterNonRTMDeopt() {
+        super(new AndPredicate(new SupportedCPU(), new SupportedVM()));
+    }
+
+    @Override
+    protected void runTestCases() throws Throwable {
+        verifyRTMAfterDeopt(false, false);
+        verifyRTMAfterDeopt(true, false);
+
+        verifyRTMAfterDeopt(false, true);
+        verifyRTMAfterDeopt(true, true);
+    }
+
+    private void verifyRTMAfterDeopt(boolean useStackLock,
+            boolean useRTMDeopt) throws Throwable {
+        CompilableTest test = new Test();
+        String logFile = String.format("rtm_%s_stack_lock_%s_deopt.xml",
+                (useStackLock ? "use" : "no"), (useRTMDeopt ? "use" : "no"));
+
+        OutputAnalyzer outputAnalyzer = RTMTestBase.executeRTMTest(
+                logFile,
+                test,
+                "-XX:CompileThreshold=1",
+                CommandLineOptionTest.prepareBooleanFlag("UseRTMForStackLocks",
+                        useStackLock),
+                CommandLineOptionTest.prepareBooleanFlag("UseRTMDeopt",
+                        useRTMDeopt),
+                "-XX:RTMAbortRatio=100",
+                CommandLineOptionTest.prepareNumericFlag("RTMAbortThreshold",
+                        TestRTMAfterNonRTMDeopt.ABORT_THRESHOLD),
+                CommandLineOptionTest.prepareNumericFlag("RTMLockingThreshold",
+                        TestRTMAfterNonRTMDeopt.ABORT_THRESHOLD / 2L),
+                "-XX:RTMTotalCountIncrRate=1",
+                "-XX:+PrintPreciseRTMLockingStatistics",
+                Test.class.getName(),
+                Boolean.toString(!useStackLock)
+        );
+
+        outputAnalyzer.shouldHaveExitValue(0);
+
+        int traps = RTMTestBase.firedRTMStateChangeTraps(logFile);
+
+        if (useRTMDeopt) {
+            Asserts.assertEQ(traps, 2, "Two uncommon traps with "
+                    + "reason rtm_state_change should be fired.");
+        } else {
+            Asserts.assertEQ(traps, 0, "No uncommon traps with "
+                    + "reason rtm_state_change should be fired.");
+        }
+
+        int rangeCheckTraps = RTMTestBase.firedUncommonTraps(logFile,
+                TestRTMAfterNonRTMDeopt.RANGE_CHECK);
+
+        Asserts.assertEQ(rangeCheckTraps, 1,
+                "One range_check uncommon trap should be fired.");
+
+        List<RTMLockingStatistics> statistics = RTMLockingStatistics.fromString(
+                test.getMethodWithLockName(), outputAnalyzer.getOutput());
+
+        int expectedStatEntries = (useRTMDeopt ? 4 : 2);
+
+        Asserts.assertEQ(statistics.size(), expectedStatEntries,
+                String.format("VM output should contain %d RTM locking "
+                        + "statistics entries.", expectedStatEntries));
+    }
+
+    public static class Test implements CompilableTest {
+        // Following field have to be static in order to avoid escape analysis.
+        @SuppressWarnings("UnsuedDeclaration")
+        private static int field = 0;
+        private static final int ITERATIONS = 10000;
+        private static final int RANGE_CHECK_AT = ITERATIONS / 2;
+        private static final Unsafe UNSAFE = Utils.getUnsafe();
+        private final Object monitor = new Object();
+
+        @Override
+        public String getMethodWithLockName() {
+            return this.getClass().getName() + "::forceAbort";
+        }
+
+        @Override
+        public String[] getMethodsToCompileNames() {
+            return new String[] {
+                getMethodWithLockName(),
+                sun.misc.Unsafe.class.getName() + "::forceAbort"
+            };
+        }
+
+        public void forceAbort(int a[], boolean abort) {
+            try {
+                synchronized(monitor) {
+                    a[0]++;
+                    if (abort) {
+                        Test.field = Test.UNSAFE.addressSize();
+                    }
+                }
+            } catch (Throwable t) {
+                // suppress any throwables
+            }
+        }
+
+        /**
+         * Usage:
+         * Test &lt;inflate monitor&gt;
+         */
+        public static void main(String args[]) throws Throwable {
+            Test t = new Test();
+
+            if (Boolean.valueOf(args[0])) {
+                AbortProvoker.inflateMonitor(t.monitor);
+            }
+
+            int tmp[] = new int[1];
+
+            for (int i = 0; i < Test.ITERATIONS; i++ ) {
+                if (i == Test.RANGE_CHECK_AT) {
+                    t.forceAbort(new int[0], false);
+                } else {
+                    boolean isThreshold
+                            = (i == TestRTMAfterNonRTMDeopt.ABORT_THRESHOLD);
+                    boolean isThresholdPlusRange
+                            = (i == TestRTMAfterNonRTMDeopt.ABORT_THRESHOLD
+                            + Test.RANGE_CHECK_AT);
+                    t.forceAbort(tmp, isThreshold || isThresholdPlusRange);
+                }
+            }
+        }
+    }
+
+    public static void main(String args[]) throws Throwable {
+        new TestRTMAfterNonRTMDeopt().test();
+    }
+}
+
diff --git a/hotspot/test/compiler/rtm/locking/TestRTMDeoptOnHighAbortRatio.java b/hotspot/test/compiler/rtm/locking/TestRTMDeoptOnHighAbortRatio.java
new file mode 100644
index 0000000..911cc21
--- /dev/null
+++ b/hotspot/test/compiler/rtm/locking/TestRTMDeoptOnHighAbortRatio.java
@@ -0,0 +1,114 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+/**
+ * @test
+ * @bug 8031320
+ * @summary Verify that on high abort ratio method will be recompiled
+ *          without rtm locking.
+ * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
+ * @build TestRTMDeoptOnHighAbortRatio
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *                   -XX:+WhiteBoxAPI TestRTMDeoptOnHighAbortRatio
+ */
+
+import java.util.List;
+import com.oracle.java.testlibrary.*;
+import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
+import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
+import rtm.*;
+import rtm.predicate.SupportedCPU;
+import rtm.predicate.SupportedVM;
+
+/**
+ * Test verifies that on high abort ratio method wil be deoptimized with
+ * <i>rtm_state_change</i> reason and after that RTM-based lock elision will not
+ * be used for that method.
+ * This test make asserts on total locks count done by compiled method,
+ * so in order to avoid issue with retriable locks -XX:RTMRetryCount=0 is used.
+ * For more details on that issue see {@link TestUseRTMAfterLockInflation}.
+ */
+public class TestRTMDeoptOnHighAbortRatio extends CommandLineOptionTest {
+    private static final long ABORT_THRESHOLD
+            = AbortProvoker.DEFAULT_ITERATIONS / 2L;
+
+    private TestRTMDeoptOnHighAbortRatio() {
+        super(new AndPredicate(new SupportedCPU(), new SupportedVM()));
+    }
+
+    @Override
+    protected void runTestCases() throws Throwable {
+        verifyDeopt(false);
+        verifyDeopt(true);
+    }
+
+    private void verifyDeopt(boolean useStackLock) throws Throwable {
+        AbortProvoker provoker = AbortType.XABORT.provoker();
+        String logFileName = String.format("rtm_deopt_%s_stack_lock.xml",
+                (useStackLock ? "use" : "no"));
+
+        OutputAnalyzer outputAnalyzer = RTMTestBase.executeRTMTest(
+                logFileName,
+                provoker,
+                "-XX:+UseRTMDeopt",
+                CommandLineOptionTest.prepareBooleanFlag("UseRTMForStackLocks",
+                        useStackLock),
+                "-XX:RTMRetryCount=0",
+                CommandLineOptionTest.prepareNumericFlag("RTMAbortThreshold",
+                        TestRTMDeoptOnHighAbortRatio.ABORT_THRESHOLD),
+                "-XX:RTMAbortRatio=100",
+                "-XX:CompileThreshold=1",
+                "-XX:RTMTotalCountIncrRate=1",
+                "-XX:+PrintPreciseRTMLockingStatistics",
+                AbortProvoker.class.getName(),
+                AbortType.XABORT.toString(),
+                Boolean.toString(!useStackLock)
+        );
+
+        outputAnalyzer.shouldHaveExitValue(0);
+
+        int firedTraps = RTMTestBase.firedRTMStateChangeTraps(logFileName);
+
+        Asserts.assertEQ(firedTraps, 1, "Expected to get only one "
+                + "deoptimization due to rtm state change");
+
+        List<RTMLockingStatistics> statistics = RTMLockingStatistics.fromString(
+                provoker.getMethodWithLockName(), outputAnalyzer.getOutput());
+
+        Asserts.assertEQ(statistics.size(), 1, "VM output should contain "
+                + "exactly one RTM locking statistics entry for method "
+                + provoker.getMethodWithLockName());
+
+        Asserts.assertEQ(statistics.get(0).getTotalLocks(),
+                TestRTMDeoptOnHighAbortRatio.ABORT_THRESHOLD,
+                "After AbortThreshold was reached, method should be"
+                + " recompiled without rtm lock eliding.");
+    }
+
+    public static void main(String args[]) throws Throwable {
+        new TestRTMDeoptOnHighAbortRatio().test();
+    }
+}
+
diff --git a/hotspot/test/compiler/rtm/locking/TestRTMDeoptOnLowAbortRatio.java b/hotspot/test/compiler/rtm/locking/TestRTMDeoptOnLowAbortRatio.java
new file mode 100644
index 0000000..bcadaab
--- /dev/null
+++ b/hotspot/test/compiler/rtm/locking/TestRTMDeoptOnLowAbortRatio.java
@@ -0,0 +1,167 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+/**
+ * @test
+ * @bug 8031320
+ * @summary Verify that on low abort ratio method will be recompiled.
+ * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
+ * @build TestRTMDeoptOnLowAbortRatio
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *                   -XX:+WhiteBoxAPI TestRTMDeoptOnLowAbortRatio
+ */
+
+import java.util.List;
+import com.oracle.java.testlibrary.*;
+import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
+import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
+import rtm.*;
+import rtm.predicate.SupportedCPU;
+import rtm.predicate.SupportedVM;
+import sun.misc.Unsafe;
+
+/**
+ * Test verifies that low abort ratio method will be deoptimized with
+ * <i>rtm_state_change</i> reason and will continue to use RTM-based lock
+ * elision after that.
+ * This test make asserts on total locks count done by compiled method,
+ * so in order to avoid issue with retriable locks -XX:RTMRetryCount=0 is used.
+ * For more details on that issue see {@link TestUseRTMAfterLockInflation}.
+ */
+public class TestRTMDeoptOnLowAbortRatio extends CommandLineOptionTest {
+    private static final long LOCKING_THRESHOLD = 100L;
+
+    private TestRTMDeoptOnLowAbortRatio() {
+        super(new AndPredicate(new SupportedCPU(), new SupportedVM()));
+    }
+
+    @Override
+    protected void runTestCases() throws Throwable {
+        verifyRTMDeopt(false);
+        verifyRTMDeopt(true);
+    }
+
+    private void verifyRTMDeopt(boolean useStackLock) throws Throwable {
+        CompilableTest test = new Test();
+        String logFileName = String.format("rtm_deopt_%s_stack_lock.xml",
+                                           useStackLock ? "use" : "no");
+
+        OutputAnalyzer outputAnalyzer = RTMTestBase.executeRTMTest(
+                logFileName,
+                test,
+                "-XX:+UseRTMDeopt",
+                CommandLineOptionTest.prepareBooleanFlag("UseRTMForStackLocks",
+                        useStackLock),
+                CommandLineOptionTest.prepareNumericFlag("RTMLockingThreshold",
+                        TestRTMDeoptOnLowAbortRatio.LOCKING_THRESHOLD),
+                "-XX:RTMAbortThreshold=1",
+                "-XX:RTMAbortRatio=100",
+                "-XX:CompileThreshold=1",
+                "-XX:RTMRetryCount=0",
+                "-XX:RTMTotalCountIncrRate=1",
+                "-XX:+PrintPreciseRTMLockingStatistics",
+                Test.class.getName(),
+                Boolean.toString(!useStackLock)
+        );
+
+        outputAnalyzer.shouldHaveExitValue(0);
+
+        int firedTraps = RTMTestBase.firedRTMStateChangeTraps(logFileName);
+
+        Asserts.assertEQ(firedTraps, 1,
+                        "Expected to get only one deoptimization due to rtm"
+                        + " state change");
+
+        List<RTMLockingStatistics> statistics = RTMLockingStatistics.fromString(
+                test.getMethodWithLockName(), outputAnalyzer.getOutput());
+
+        Asserts.assertEQ(statistics.size(), 2,
+                         "VM output should contain two RTM locking "
+                         + "statistics entries for method "
+                         + test.getMethodWithLockName());
+
+        RTMLockingStatistics statisticsBeforeDeopt = null;
+
+        for (RTMLockingStatistics s : statistics) {
+            if (s.getTotalLocks()
+                    == TestRTMDeoptOnLowAbortRatio.LOCKING_THRESHOLD + 1L) {
+                Asserts.assertNull(statisticsBeforeDeopt,
+                        "Only one abort was expected during test run");
+                statisticsBeforeDeopt = s;
+            }
+        }
+
+        Asserts.assertNotNull(statisticsBeforeDeopt,
+                "After LockThreshold was reached, method should be recompiled "
+                + "with rtm lock eliding.");
+    }
+
+    public static class Test implements CompilableTest {
+        private static final Unsafe UNSAFE = Utils.getUnsafe();
+        private final Object monitor = new Object();
+
+        @Override
+        public String getMethodWithLockName() {
+            return this.getClass().getName() + "::forceAbort";
+        }
+
+        @Override
+        public String[] getMethodsToCompileNames() {
+            return new String[] {
+                getMethodWithLockName(),
+                sun.misc.Unsafe.class.getName() + "::addressSize"
+            };
+        }
+
+        public void forceAbort(boolean abort) {
+            synchronized(monitor) {
+                if (abort) {
+                    Test.UNSAFE.addressSize();
+                }
+            }
+        }
+
+        /**
+         * Usage:
+         * Test &lt;inflate monitor&gt;
+         */
+        public static void main(String args[]) throws Throwable {
+            Asserts.assertGTE(args.length, 1, "One argument required.");
+            Test t = new Test();
+
+            if (Boolean.valueOf(args[0])) {
+                AbortProvoker.inflateMonitor(t.monitor);
+            }
+            for (int i = 0; i < AbortProvoker.DEFAULT_ITERATIONS; i++) {
+                t.forceAbort(
+                        i == TestRTMDeoptOnLowAbortRatio.LOCKING_THRESHOLD);
+            }
+        }
+    }
+
+    public static void main(String args[]) throws Throwable {
+        new TestRTMDeoptOnLowAbortRatio().test();
+    }
+}
diff --git a/hotspot/test/compiler/rtm/locking/TestRTMLockingCalculationDelay.java b/hotspot/test/compiler/rtm/locking/TestRTMLockingCalculationDelay.java
new file mode 100644
index 0000000..61f84e4
--- /dev/null
+++ b/hotspot/test/compiler/rtm/locking/TestRTMLockingCalculationDelay.java
@@ -0,0 +1,106 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+/**
+ * @test
+ * @bug 8031320
+ * @summary Verify that RTMLockingCalculationDelay affect when
+ *          abort ratio calculation is started.
+ * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
+ * @build TestRTMLockingCalculationDelay
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *                   -XX:+WhiteBoxAPI TestRTMLockingCalculationDelay
+ */
+
+import com.oracle.java.testlibrary.*;
+import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
+import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
+import rtm.*;
+import rtm.predicate.SupportedCPU;
+import rtm.predicate.SupportedVM;
+
+/**
+ * Test verifies that abort ratio calculation could be delayed using
+ * RTMLockingCalculationDelay option.
+ */
+public class TestRTMLockingCalculationDelay extends CommandLineOptionTest {
+    private static final boolean INFLATE_MONITOR = true;
+
+    private TestRTMLockingCalculationDelay() {
+        super(new AndPredicate(new SupportedCPU(), new SupportedVM()));
+    }
+
+    @Override
+    protected void runTestCases() throws Throwable {
+        // verify that calculation will be started immediately
+        verifyLockingCalculationDelay(0, 0, true);
+
+        // verify that calculation will not be started during
+        // first 10 minutes, while test will be started immediately
+        verifyLockingCalculationDelay(600000, 0, false);
+
+        // verify that calculation will be started after a second
+        verifyLockingCalculationDelay(1000, 1000, true);
+    }
+
+    private void verifyLockingCalculationDelay(long delay, long testDelay,
+            boolean deoptExpected) throws Throwable {
+        AbortProvoker provoker = AbortType.XABORT.provoker();
+        String logFileName = String.format("rtm_delay_%d_%d.xml", delay,
+                testDelay);
+
+        OutputAnalyzer outputAnalyzer = RTMTestBase.executeRTMTest(
+                logFileName,
+                provoker,
+                "-XX:+UseRTMDeopt",
+                CommandLineOptionTest.prepareNumericFlag(
+                        "RTMLockingCalculationDelay", delay),
+                "-XX:RTMAbortRatio=0",
+                "-XX:RTMAbortThreshold=0",
+                AbortProvoker.class.getName(),
+                AbortType.XABORT.toString(),
+                Boolean.toString(
+                        TestRTMLockingCalculationDelay.INFLATE_MONITOR),
+                Long.toString(AbortProvoker.DEFAULT_ITERATIONS),
+                Long.toString(testDelay)
+        );
+
+        outputAnalyzer.shouldHaveExitValue(0);
+
+        int deopts = RTMTestBase.firedRTMStateChangeTraps(logFileName);
+
+        if (deoptExpected) {
+            Asserts.assertGT(deopts, 0, "At least one deoptimization due to "
+                    + "rtm_state_chage is expected");
+        } else {
+            Asserts.assertEQ(deopts, 0, "No deoptimizations due to "
+                    + "rtm_state_chage are expected");
+        }
+    }
+
+    public static void main(String args[]) throws Throwable {
+        new TestRTMLockingCalculationDelay().test();
+    }
+}
diff --git a/hotspot/test/compiler/rtm/locking/TestRTMLockingThreshold.java b/hotspot/test/compiler/rtm/locking/TestRTMLockingThreshold.java
new file mode 100644
index 0000000..548a09c
--- /dev/null
+++ b/hotspot/test/compiler/rtm/locking/TestRTMLockingThreshold.java
@@ -0,0 +1,179 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+/**
+ * @test
+ * @bug 8031320
+ * @summary Verify that RTMLockingThreshold affects rtm state transition
+ *          ProfileRTM => UseRTM.
+ * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
+ * @build TestRTMLockingThreshold
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *                   -XX:+WhiteBoxAPI TestRTMLockingThreshold
+ */
+
+import java.util.List;
+import com.oracle.java.testlibrary.*;
+import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
+import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
+import rtm.*;
+import rtm.predicate.SupportedCPU;
+import rtm.predicate.SupportedVM;
+import sun.misc.Unsafe;
+
+/**
+ * Test verifies that RTMLockingThreshold option actually affects how soon
+ * method will be deoptimized on low abort ratio.
+ */
+public class TestRTMLockingThreshold extends CommandLineOptionTest {
+    private TestRTMLockingThreshold() {
+        super(new AndPredicate(new SupportedVM(), new SupportedCPU()));
+    }
+
+    /**
+     * We use non-zero abort threshold to avoid abort related to
+     * interrupts, VMM calls, etc. during first lock attempt.
+     *
+     */
+    private static final int ABORT_THRESHOLD = 10;
+
+    @Override
+    protected void runTestCases() throws Throwable {
+        verifyLockingThreshold(0, false);
+        verifyLockingThreshold(100, false);
+        verifyLockingThreshold(1000, false);
+
+        verifyLockingThreshold(0, true);
+        verifyLockingThreshold(100, true);
+        verifyLockingThreshold(1000, true);
+    }
+
+    private void verifyLockingThreshold(int lockingThreshold,
+            boolean useStackLock) throws Throwable {
+        CompilableTest test = new Test();
+
+        OutputAnalyzer outputAnalyzer = RTMTestBase.executeRTMTest(
+                test,
+                "-XX:CompileThreshold=1",
+                CommandLineOptionTest.prepareBooleanFlag("UseRTMForStackLocks",
+                        useStackLock),
+                "-XX:+UseRTMDeopt",
+                "-XX:RTMTotalCountIncrRate=1",
+                "-XX:RTMRetryCount=0",
+                CommandLineOptionTest.prepareNumericFlag("RTMAbortThreshold",
+                        TestRTMLockingThreshold.ABORT_THRESHOLD),
+                CommandLineOptionTest.prepareNumericFlag("RTMLockingThreshold",
+                        lockingThreshold),
+                "-XX:RTMAbortRatio=100",
+                "-XX:+PrintPreciseRTMLockingStatistics",
+                Test.class.getName(),
+                Boolean.toString(!useStackLock),
+                Integer.toString(lockingThreshold)
+        );
+
+        outputAnalyzer.shouldHaveExitValue(0);
+
+        List<RTMLockingStatistics> statistics = RTMLockingStatistics.fromString(
+                test.getMethodWithLockName(), outputAnalyzer.getOutput());
+
+        Asserts.assertEQ(statistics.size(), 2, "VM output should contain two "
+                + "RTM locking statistics entries.");
+
+        /**
+         * We force abort on each odd iteration, so if RTMLockingThreshold==0,
+         * then we have to make 1 call without abort to avoid rtm state
+         * transition to NoRTM (otherwise actual abort ratio will be 100%),
+         * and after that make 1 call with abort to force deoptimization.
+         * This leads us to two locks for threshold 0.
+         * For other threshold values we have to make RTMLockingThreshold + 1
+         * locks if locking threshold is even, or + 0 if odd.
+         */
+        long expectedValue = lockingThreshold +
+                (lockingThreshold == 0L ? 2L : lockingThreshold % 2L);
+
+        RTMLockingStatistics statBeforeDeopt = null;
+        for (RTMLockingStatistics s : statistics) {
+            if (s.getTotalLocks() == expectedValue) {
+                Asserts.assertNull(statBeforeDeopt,
+                        "Only one statistics entry should contain aborts");
+                statBeforeDeopt = s;
+            }
+        }
+
+        Asserts.assertNotNull(statBeforeDeopt, "There should be exactly one "
+                + "statistics entry corresponding to ProfileRTM state.");
+    }
+
+    public static class Test implements CompilableTest {
+        // Following field have to be static in order to avoid escape analysis.
+        @SuppressWarnings("UnsuedDeclaration")
+        private static int field = 0;
+        private static final int TOTAL_ITERATIONS = 10000;
+        private static final Unsafe UNSAFE = Utils.getUnsafe();
+        private final Object monitor = new Object();
+
+
+        @Override
+        public String getMethodWithLockName() {
+            return this.getClass().getName() + "::lock";
+        }
+
+        @Override
+        public String[] getMethodsToCompileNames() {
+            return new String[] {
+                getMethodWithLockName(),
+                sun.misc.Unsafe.class.getName() + "::addressSize"
+            };
+        }
+
+        public void lock(boolean abort) {
+            synchronized(monitor) {
+                if (abort) {
+                    Test.field += Test.UNSAFE.addressSize();
+                }
+            }
+        }
+
+        /**
+         * Usage:
+         * Test &lt;inflate monitor&gt;
+         */
+        public static void main(String args[]) throws Throwable {
+            Asserts.assertGTE(args.length, 1, "One argument required.");
+            Test t = new Test();
+
+            if (Boolean.valueOf(args[0])) {
+                AbortProvoker.inflateMonitor(t.monitor);
+            }
+            for (int i = 0; i < Test.TOTAL_ITERATIONS; i++) {
+                t.lock(i % 2 == 1);
+            }
+        }
+    }
+
+    public static void main(String args[]) throws Throwable {
+        new TestRTMLockingThreshold().test();
+    }
+}
diff --git a/hotspot/test/compiler/rtm/locking/TestRTMRetryCount.java b/hotspot/test/compiler/rtm/locking/TestRTMRetryCount.java
new file mode 100644
index 0000000..1a0c20c
--- /dev/null
+++ b/hotspot/test/compiler/rtm/locking/TestRTMRetryCount.java
@@ -0,0 +1,102 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+/**
+ * @test
+ * @bug 8031320
+ * @summary Verify that RTMRetryCount affects actual amount of retries.
+ * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
+ * @build TestRTMRetryCount
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *                   -XX:+WhiteBoxAPI TestRTMRetryCount
+ */
+
+import java.util.List;
+
+import com.oracle.java.testlibrary.*;
+import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
+import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
+import rtm.*;
+import rtm.predicate.SupportedCPU;
+import rtm.predicate.SupportedVM;
+
+/**
+ * Test verifies that RTMRetryCount option actually affects amount of
+ * retries on lock busy.
+ */
+public class TestRTMRetryCount extends CommandLineOptionTest {
+    /**
+     * Time in ms, during which busy lock will be locked.
+     */
+    private static final int LOCKING_TIME = 5000;
+    private static final boolean INFLATE_MONITOR = true;
+
+    private TestRTMRetryCount() {
+        super(new AndPredicate(new SupportedCPU(), new SupportedVM()));
+    }
+
+    @Override
+    protected void runTestCases() throws Throwable {
+        verifyRTMRetryCount(0);
+        verifyRTMRetryCount(1);
+        verifyRTMRetryCount(5);
+        verifyRTMRetryCount(10);
+    }
+
+    private void verifyRTMRetryCount(int retryCount) throws Throwable {
+        CompilableTest busyLock = new BusyLock();
+        long expectedAborts = retryCount + 1L;
+
+        OutputAnalyzer outputAnalyzer = RTMTestBase.executeRTMTest(
+                busyLock,
+                "-XX:-UseRTMXendForLockBusy",
+                "-XX:RTMTotalCountIncrRate=1",
+                CommandLineOptionTest.prepareNumericFlag("RTMRetryCount",
+                        retryCount),
+                "-XX:RTMTotalCountIncrRate=1",
+                "-XX:+PrintPreciseRTMLockingStatistics",
+                BusyLock.class.getName(),
+                Boolean.toString(TestRTMRetryCount.INFLATE_MONITOR),
+                Integer.toString(TestRTMRetryCount.LOCKING_TIME)
+        );
+
+        outputAnalyzer.shouldHaveExitValue(0);
+
+        List<RTMLockingStatistics> statistics = RTMLockingStatistics.fromString(
+                busyLock.getMethodWithLockName(), outputAnalyzer.getStdout());
+
+        Asserts.assertEQ(statistics.size(), 1, "VM output should contain "
+                + "exactly one rtm locking statistics entry for method "
+                + busyLock.getMethodWithLockName());
+
+        Asserts.assertEQ(statistics.get(0).getTotalAborts(), expectedAborts,
+                String.format("It is expected to get %d aborts",
+                        expectedAborts));
+    }
+
+    public static void main(String args[]) throws Throwable {
+        new TestRTMRetryCount().test();
+    }
+}
diff --git a/hotspot/test/compiler/rtm/locking/TestRTMSpinLoopCount.java b/hotspot/test/compiler/rtm/locking/TestRTMSpinLoopCount.java
new file mode 100644
index 0000000..8cb4bbb
--- /dev/null
+++ b/hotspot/test/compiler/rtm/locking/TestRTMSpinLoopCount.java
@@ -0,0 +1,115 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+/**
+ * @test
+ * @bug 8031320
+ * @summary Verify that RTMSpinLoopCount affects time spent
+ *          between locking attempts.
+ * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
+ * @build TestRTMSpinLoopCount
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *                   -XX:+WhiteBoxAPI TestRTMSpinLoopCount
+ */
+
+import java.util.List;
+import com.oracle.java.testlibrary.*;
+import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
+import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
+import rtm.*;
+import rtm.predicate.SupportedCPU;
+import rtm.predicate.SupportedVM;
+
+/**
+ * Test verifies that RTMSpinLoopCount increase time spent between retries
+ * by comparing amount of retries done with different RTMSpinLoopCount's values.
+ */
+public class TestRTMSpinLoopCount extends CommandLineOptionTest {
+    private static final int LOCKING_TIME = 1000;
+    private static final int RTM_RETRY_COUNT = 1000;
+    private static final boolean INFLATE_MONITOR = true;
+    private static final long MAX_ABORTS = RTM_RETRY_COUNT + 1L;
+    private static final int[] SPIN_LOOP_COUNTS
+            = new int[] { 0, 100, 1_000, 1_000_000, 10_000_000 };
+
+    private TestRTMSpinLoopCount() {
+        super(new AndPredicate(new SupportedVM(), new SupportedCPU()));
+    }
+
+    @Override
+    protected void runTestCases() throws Throwable {
+        long[] aborts = new long[TestRTMSpinLoopCount.SPIN_LOOP_COUNTS.length];
+        for (int i = 0; i < TestRTMSpinLoopCount.SPIN_LOOP_COUNTS.length; i++) {
+            aborts[i] = getAbortsCountOnLockBusy(
+                    TestRTMSpinLoopCount.SPIN_LOOP_COUNTS[i]);
+        }
+
+        for (int i = 1; i < aborts.length; i++) {
+            Asserts.assertLTE(aborts[i], aborts[i - 1], "Increased spin loop "
+                    + "count should not increase retries count.");
+        }
+    }
+
+    private long getAbortsCountOnLockBusy(int spinLoopCount) throws Throwable {
+        CompilableTest test = new BusyLock();
+
+        OutputAnalyzer outputAnalyzer = RTMTestBase.executeRTMTest(
+                test,
+                CommandLineOptionTest.prepareNumericFlag("RTMRetryCount",
+                        TestRTMSpinLoopCount.RTM_RETRY_COUNT),
+                CommandLineOptionTest.prepareNumericFlag("RTMSpinLoopCount",
+                        spinLoopCount),
+                "-XX:-UseRTMXendForLockBusy",
+                "-XX:RTMTotalCountIncrRate=1",
+                "-XX:+PrintPreciseRTMLockingStatistics",
+                BusyLock.class.getName(),
+                Boolean.toString(TestRTMSpinLoopCount.INFLATE_MONITOR),
+                Integer.toString(TestRTMSpinLoopCount.LOCKING_TIME)
+        );
+
+        outputAnalyzer.shouldHaveExitValue(0);
+
+        List<RTMLockingStatistics> statistics = RTMLockingStatistics.fromString(
+                test.getMethodWithLockName(), outputAnalyzer.getOutput());
+
+        Asserts.assertEQ(statistics.size(), 1,
+                "VM output should contain exactly one entry for method "
+                 + test.getMethodWithLockName());
+
+        RTMLockingStatistics lock = statistics.get(0);
+
+        Asserts.assertLTE(lock.getTotalAborts(),
+                TestRTMSpinLoopCount.MAX_ABORTS, String.format("Total aborts "
+                        + "count (%d) should be less or equal to %d",
+                        lock.getTotalAborts(),
+                        TestRTMSpinLoopCount.MAX_ABORTS));
+
+        return lock.getTotalAborts();
+    }
+
+    public static void main(String args[]) throws Throwable {
+        new TestRTMSpinLoopCount().test();
+    }
+}
diff --git a/hotspot/test/compiler/rtm/locking/TestRTMTotalCountIncrRate.java b/hotspot/test/compiler/rtm/locking/TestRTMTotalCountIncrRate.java
new file mode 100644
index 0000000..e1f94d3
--- /dev/null
+++ b/hotspot/test/compiler/rtm/locking/TestRTMTotalCountIncrRate.java
@@ -0,0 +1,150 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+/**
+ * @test
+ * @bug 8031320
+ * @summary Verify that RTMTotalCountIncrRate option affects
+ *          RTM locking statistics.
+ * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
+ * @build TestRTMTotalCountIncrRate
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *                   -XX:+WhiteBoxAPI TestRTMTotalCountIncrRate
+ */
+
+import java.util.List;
+
+import com.oracle.java.testlibrary.*;
+import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
+import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
+import rtm.*;
+import rtm.predicate.SupportedCPU;
+import rtm.predicate.SupportedVM;
+
+/**
+ * Test verifies that with RTMTotalCountIncrRate=1 RTM locking statistics
+ * contains precise information abort attempted locks and that with other values
+ * statistics contains information abort non-zero locking attempts.
+ * Since assert done for RTMTotalCountIncrRate=1 is pretty strict, test uses
+ * -XX:RTMRetryCount=0 to avoid issue with retriable aborts. For more details on
+ * that issue see {@link TestUseRTMAfterLockInflation}.
+ */
+public class TestRTMTotalCountIncrRate extends CommandLineOptionTest {
+    private TestRTMTotalCountIncrRate() {
+        super(new AndPredicate(new SupportedCPU(), new SupportedVM()));
+    }
+
+    @Override
+    protected void runTestCases() throws Throwable {
+        verifyLocksCount(1, false);
+        verifyLocksCount(64, false);
+        verifyLocksCount(128, false);
+        verifyLocksCount(1, true);
+        verifyLocksCount(64, true);
+        verifyLocksCount(128, true);
+    }
+
+    private void verifyLocksCount(int incrRate, boolean useStackLock)
+            throws Throwable{
+        CompilableTest test = new Test();
+
+        OutputAnalyzer outputAnalyzer = RTMTestBase.executeRTMTest(
+                test,
+                CommandLineOptionTest.prepareBooleanFlag("UseRTMForStackLocks",
+                        useStackLock),
+                CommandLineOptionTest.prepareNumericFlag(
+                        "RTMTotalCountIncrRate", incrRate),
+                "-XX:RTMRetryCount=0",
+                "-XX:+PrintPreciseRTMLockingStatistics",
+                Test.class.getName(),
+                Boolean.toString(!useStackLock)
+        );
+
+        outputAnalyzer.shouldHaveExitValue(0);
+
+        List<RTMLockingStatistics> statistics = RTMLockingStatistics.fromString(
+                test.getMethodWithLockName(), outputAnalyzer.getOutput());
+
+        Asserts.assertEQ(statistics.size(), 1, "VM output should contain "
+                + "exactly one RTM locking statistics entry for method "
+                + test.getMethodWithLockName());
+
+        RTMLockingStatistics lock = statistics.get(0);
+        if (incrRate == 1) {
+            Asserts.assertEQ(lock.getTotalLocks(), Test.TOTAL_ITERATIONS,
+                    "Total locks should be exactly the same as amount of "
+                    + "iterations.");
+        } else {
+            Asserts.assertGT(lock.getTotalLocks(), 0L, "RTM statistics "
+                    + "should contain information for at least on lock.");
+        }
+    }
+
+    public static class Test implements CompilableTest {
+        private static final long TOTAL_ITERATIONS = 10000L;
+        private final Object monitor = new Object();
+        // Following field have to be static in order to avoid escape analysis.
+        @SuppressWarnings("UnsuedDeclaration")
+        private static int field = 0;
+
+        @Override
+        public String getMethodWithLockName() {
+            return this.getClass().getName() + "::lock";
+        }
+
+        @Override
+        public String[] getMethodsToCompileNames() {
+            return new String[] {
+                getMethodWithLockName()
+            };
+        }
+
+        public void lock() {
+            synchronized(monitor) {
+                Test.field++;
+            }
+        }
+
+        /**
+         * Usage:
+         * Test &lt;inflate monitor&gt;
+         */
+        public static void main(String args[]) throws Throwable {
+            Asserts.assertGTE(args.length, 1, "One argument required.");
+            Test test = new Test();
+
+            if (Boolean.valueOf(args[0])) {
+                AbortProvoker.inflateMonitor(test.monitor);
+            }
+            for (long i = 0L; i < Test.TOTAL_ITERATIONS; i++) {
+                test.lock();
+            }
+        }
+    }
+
+    public static void main(String args[]) throws Throwable {
+        new TestRTMTotalCountIncrRate().test();
+    }
+}
diff --git a/hotspot/test/compiler/rtm/locking/TestUseRTMAfterLockInflation.java b/hotspot/test/compiler/rtm/locking/TestUseRTMAfterLockInflation.java
new file mode 100644
index 0000000..f1fa139
--- /dev/null
+++ b/hotspot/test/compiler/rtm/locking/TestUseRTMAfterLockInflation.java
@@ -0,0 +1,127 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+/**
+ * @test
+ * @bug 8031320
+ * @summary Verify that rtm locking is used for stack locks before
+ *          inflation and after it used for inflated locks.
+ * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
+ * @build TestUseRTMAfterLockInflation
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *                   -XX:+WhiteBoxAPI TestUseRTMAfterLockInflation
+ */
+
+import java.util.List;
+
+import com.oracle.java.testlibrary.*;
+import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
+import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
+import rtm.*;
+import rtm.predicate.SupportedCPU;
+import rtm.predicate.SupportedVM;
+
+/**
+ * Test verifies that RTM is used after lock inflation by executing compiled
+ * method with RTM-based lock elision using stack lock first, then that lock
+ * is inflated and the same compiled method invoked again.
+ *
+ * Compiled method invoked {@code AbortProvoker.DEFAULT_ITERATIONS} times before
+ * lock inflation and the same amount of times after inflation.
+ * As a result total locks count should be equal to
+ * {@code 2*AbortProvoker.DEFAULT_ITERATIONS}.
+ * It is a pretty strict assertion which could fail if some retriable abort
+ * happened: it could be {@code AbortType.RETRIABLE} or
+ * {@code AbortType.MEM_CONFLICT}, but unfortunately abort can has both these
+ * reasons simultaneously. In order to avoid false negative failures related
+ * to incorrect aborts counting, -XX:RTMRetryCount=0 is used.
+ */
+public class TestUseRTMAfterLockInflation extends CommandLineOptionTest {
+    private static final long EXPECTED_LOCKS
+            = 2L * AbortProvoker.DEFAULT_ITERATIONS;
+
+    private TestUseRTMAfterLockInflation() {
+        super(new AndPredicate(new SupportedVM(), new SupportedCPU()));
+    }
+
+    @Override
+    protected void runTestCases() throws Throwable {
+        AbortProvoker provoker = AbortType.XABORT.provoker();
+        long totalLocksCount = 0;
+
+        OutputAnalyzer outputAnalyzer = RTMTestBase.executeRTMTest(
+                provoker,
+                "-XX:+UseRTMForStackLocks",
+                "-XX:RTMTotalCountIncrRate=1",
+                "-XX:RTMRetryCount=0",
+                "-XX:+PrintPreciseRTMLockingStatistics",
+                Test.class.getName(),
+                AbortType.XABORT.toString());
+
+        outputAnalyzer.shouldHaveExitValue(0);
+
+        List<RTMLockingStatistics> statistics = RTMLockingStatistics.fromString(
+                provoker.getMethodWithLockName(), outputAnalyzer.getOutput());
+
+        Asserts.assertEQ(statistics.size(), 2,
+                "VM output should contain two rtm locking statistics entries "
+                + "for method " + provoker.getMethodWithLockName());
+
+        for (RTMLockingStatistics s : statistics) {
+            totalLocksCount += s.getTotalLocks();
+        }
+
+        Asserts.assertEQ(totalLocksCount,
+                TestUseRTMAfterLockInflation.EXPECTED_LOCKS,
+                "Total lock count should be greater or equal to "
+                + TestUseRTMAfterLockInflation.EXPECTED_LOCKS);
+    }
+
+    public static class Test {
+
+        /**
+         * Usage:
+         * Test &lt;provoker type&gt;
+         */
+        public static void main(String args[]) throws Throwable {
+            Asserts.assertGT(args.length, 0,
+                    "AbortType name is expected as first argument.");
+
+            AbortProvoker provoker
+                    = AbortType.lookup(Integer.valueOf(args[0])).provoker();
+            for (int i = 0; i < AbortProvoker.DEFAULT_ITERATIONS; i++) {
+                provoker.forceAbort();
+            }
+            provoker.inflateMonitor();
+            for (int i = 0; i < AbortProvoker.DEFAULT_ITERATIONS; i++) {
+                provoker.forceAbort();
+            }
+        }
+    }
+
+    public static void main(String args[]) throws Throwable {
+        new TestUseRTMAfterLockInflation().test();
+    }
+}
diff --git a/hotspot/test/compiler/rtm/locking/TestUseRTMDeopt.java b/hotspot/test/compiler/rtm/locking/TestUseRTMDeopt.java
new file mode 100644
index 0000000..2e0dcbc
--- /dev/null
+++ b/hotspot/test/compiler/rtm/locking/TestUseRTMDeopt.java
@@ -0,0 +1,88 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+/**
+ * @test
+ * @bug 8031320
+ * @summary Verify that UseRTMDeopt affects uncommon trap installation in
+ *          copmpiled methods with synchronized block.
+ * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
+ * @build TestUseRTMDeopt
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *                   -XX:+WhiteBoxAPI TestUseRTMDeopt
+ */
+
+import com.oracle.java.testlibrary.*;
+import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
+import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
+import rtm.*;
+import rtm.predicate.SupportedCPU;
+import rtm.predicate.SupportedVM;
+
+/**
+ * Test verifies that usage of UseRTMDeopt option affects uncommon traps usage
+ * for methods that use locking.
+ */
+public class TestUseRTMDeopt extends CommandLineOptionTest {
+    private TestUseRTMDeopt() {
+        super(new AndPredicate(new SupportedVM(), new SupportedCPU()));
+    }
+
+    @Override
+    protected void runTestCases() throws Throwable {
+        verifyUseRTMDeopt(false);
+        verifyUseRTMDeopt(true);
+    }
+
+    private void verifyUseRTMDeopt(boolean useRTMDeopt) throws Throwable {
+        AbortProvoker provoker = AbortType.XABORT.provoker();
+        String logFileName = String.format("rtm_%s_deopt.xml",
+                useRTMDeopt ? "use" : "no");
+
+        OutputAnalyzer outputAnalyzer = RTMTestBase.executeRTMTest(
+                logFileName,
+                provoker,
+                CommandLineOptionTest.prepareBooleanFlag("UseRTMDeopt",
+                        useRTMDeopt),
+                AbortProvoker.class.getName(),
+                AbortType.XABORT.toString()
+        );
+
+        outputAnalyzer.shouldHaveExitValue(0);
+
+        int expectedUncommonTraps = useRTMDeopt ? 1 : 0;
+        int installedUncommonTraps
+                = RTMTestBase.installedRTMStateChangeTraps(logFileName);
+
+        Asserts.assertEQ(expectedUncommonTraps, installedUncommonTraps,
+                String.format("Expected to find %d uncommon traps "
+                              + "installed with reason rtm_state_change.",
+                        expectedUncommonTraps));
+    }
+
+    public static void main(String args[]) throws Throwable {
+        new TestUseRTMDeopt().test();
+    }
+}
diff --git a/hotspot/test/compiler/rtm/locking/TestUseRTMForInflatedLocks.java b/hotspot/test/compiler/rtm/locking/TestUseRTMForInflatedLocks.java
new file mode 100644
index 0000000..34fa34c
--- /dev/null
+++ b/hotspot/test/compiler/rtm/locking/TestUseRTMForInflatedLocks.java
@@ -0,0 +1,92 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+/**
+ * @test
+ * @bug 8031320
+ * @summary Verify that rtm locking is used for inflated locks.
+ * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
+ * @build TestUseRTMForInflatedLocks
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *                   -XX:+WhiteBoxAPI TestUseRTMForInflatedLocks
+ */
+
+import java.util.List;
+
+import com.oracle.java.testlibrary.*;
+import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
+import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
+import rtm.*;
+import rtm.predicate.SupportedCPU;
+import rtm.predicate.SupportedVM;
+
+/**
+ * Test verifies that RTM-based lock elision could be used for inflated locks
+ * by calling compiled method that use RTM-based lock elision and using
+ * manually inflated lock.
+ * Compiled method invoked {@code AbortProvoker.DEFAULT_ITERATIONS} times,
+ * so total locks count should be the same.
+ * This test could also be affected by retriable aborts, so -XX:RTMRetryCount=0
+ * is used. For more information abort that issue see
+ * {@link TestUseRTMAfterLockInflation}.
+ */
+public class TestUseRTMForInflatedLocks extends CommandLineOptionTest {
+    private TestUseRTMForInflatedLocks() {
+        super(new AndPredicate(new SupportedCPU(), new SupportedVM()));
+    }
+
+    @Override
+    protected void runTestCases() throws Throwable {
+        AbortProvoker provoker = AbortType.XABORT.provoker();
+        RTMLockingStatistics lock;
+
+        OutputAnalyzer outputAnalyzer = RTMTestBase.executeRTMTest(
+                provoker,
+                "-XX:-UseRTMForStackLocks",
+                "-XX:RTMTotalCountIncrRate=1",
+                "-XX:RTMRetryCount=0",
+                "-XX:+PrintPreciseRTMLockingStatistics",
+                AbortProvoker.class.getName(),
+                AbortType.XABORT.toString());
+
+        outputAnalyzer.shouldHaveExitValue(0);
+
+        List<RTMLockingStatistics> statistics = RTMLockingStatistics.fromString(
+                provoker.getMethodWithLockName(), outputAnalyzer.getOutput());
+
+        Asserts.assertEQ(statistics.size(), 1,
+                "VM output should contain exactly one rtm locking statistics "
+                + "entry for method " + provoker.getMethodWithLockName());
+
+        lock = statistics.get(0);
+        Asserts.assertEQ(lock.getTotalLocks(), AbortProvoker.DEFAULT_ITERATIONS,
+                "Total lock count should be greater or equal to "
+                + AbortProvoker.DEFAULT_ITERATIONS);
+    }
+
+    public static void main(String args[]) throws Throwable {
+        new TestUseRTMForInflatedLocks().test();
+    }
+}
diff --git a/hotspot/test/compiler/rtm/locking/TestUseRTMForStackLocks.java b/hotspot/test/compiler/rtm/locking/TestUseRTMForStackLocks.java
new file mode 100644
index 0000000..0a54511
--- /dev/null
+++ b/hotspot/test/compiler/rtm/locking/TestUseRTMForStackLocks.java
@@ -0,0 +1,95 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+/**
+ * @test
+ * @bug 8031320
+ * @summary Verify that rtm locking is used for stack locks.
+ * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
+ * @build TestUseRTMForStackLocks
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *                   -XX:+WhiteBoxAPI TestUseRTMForStackLocks
+ */
+
+import java.util.List;
+
+import com.oracle.java.testlibrary.*;
+import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
+import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
+import rtm.*;
+import rtm.predicate.SupportedCPU;
+import rtm.predicate.SupportedVM;
+
+/**
+ * Test verifies that RTM-based lock elision could be used for stack locks
+ * by calling compiled method that use RTM-based lock elision and using
+ * stack lock.
+ * Compiled method invoked {@code AbortProvoker.DEFAULT_ITERATIONS} times,
+ * so total locks count should be the same.
+ * This test could also be affected by retriable aborts, so -XX:RTMRetryCount=0
+ * is used. For more information abort that issue see
+ * {@link TestUseRTMAfterLockInflation}.
+ */
+public class TestUseRTMForStackLocks extends CommandLineOptionTest {
+    private static final boolean INFLATE_MONITOR = false;
+
+    private TestUseRTMForStackLocks() {
+        super(new AndPredicate(new SupportedCPU(), new SupportedVM()));
+    }
+
+    @Override
+    protected void runTestCases() throws Throwable {
+        AbortProvoker provoker = AbortType.XABORT.provoker();
+        RTMLockingStatistics lock;
+
+        OutputAnalyzer outputAnalyzer = RTMTestBase.executeRTMTest(
+                provoker,
+                "-XX:+UseRTMForStackLocks",
+                "-XX:RTMTotalCountIncrRate=1",
+                "-XX:RTMRetryCount=0",
+                "-XX:+PrintPreciseRTMLockingStatistics",
+                AbortProvoker.class.getName(),
+                AbortType.XABORT.toString(),
+                Boolean.toString(TestUseRTMForStackLocks.INFLATE_MONITOR));
+
+        outputAnalyzer.shouldHaveExitValue(0);
+
+        List<RTMLockingStatistics> statistics = RTMLockingStatistics.fromString(
+                provoker.getMethodWithLockName(), outputAnalyzer.getOutput());
+
+        Asserts.assertEQ(statistics.size(), 1,
+                "VM output should contain exactly one rtm locking statistics "
+                + "entry for method " + provoker.getMethodWithLockName());
+
+        lock = statistics.get(0);
+        Asserts.assertEQ(lock.getTotalLocks(), AbortProvoker.DEFAULT_ITERATIONS,
+                "Total locks count should be greater or equal to "
+                + AbortProvoker.DEFAULT_ITERATIONS);
+    }
+
+    public static void main(String args[]) throws Throwable {
+        new TestUseRTMForStackLocks().test();
+    }
+}
diff --git a/hotspot/test/compiler/rtm/locking/TestUseRTMXendForLockBusy.java b/hotspot/test/compiler/rtm/locking/TestUseRTMXendForLockBusy.java
new file mode 100644
index 0000000..4fc5d99
--- /dev/null
+++ b/hotspot/test/compiler/rtm/locking/TestUseRTMXendForLockBusy.java
@@ -0,0 +1,111 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+/**
+ * @test
+ * @bug 8031320
+ * @summary Verify that UseRTMXendForLockBusy option affects
+ *          method behaviour if lock is busy.
+ * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
+ * @build TestUseRTMXendForLockBusy
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *                   -XX:+WhiteBoxAPI TestUseRTMXendForLockBusy
+ */
+
+import java.util.List;
+
+import com.oracle.java.testlibrary.*;
+import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
+import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
+import rtm.*;
+import rtm.predicate.SupportedCPU;
+import rtm.predicate.SupportedVM;
+
+/**
+ * Test verifies that with +UseRTMXendForLockBusy there will be no aborts
+ * forced by the test.
+ */
+public class TestUseRTMXendForLockBusy extends CommandLineOptionTest {
+    private final static int LOCKING_TIME = 5000;
+
+    private TestUseRTMXendForLockBusy() {
+        super(new AndPredicate(new SupportedVM(), new SupportedCPU()));
+    }
+
+    @Override
+    protected void runTestCases() throws Throwable {
+        // inflated lock, xabort on lock busy
+        verifyXendForLockBusy(true, false);
+        // inflated lock, xend on lock busy
+        verifyXendForLockBusy(true, true);
+        // stack lock, xabort on lock busy
+        verifyXendForLockBusy(false, false);
+        // stack lock, xend on lock busy
+        verifyXendForLockBusy(false, true);
+    }
+
+    private void verifyXendForLockBusy(boolean inflateMonitor,
+            boolean useXend) throws Throwable {
+        CompilableTest test = new BusyLock();
+
+        OutputAnalyzer outputAnalyzer = RTMTestBase.executeRTMTest(
+                test,
+                CommandLineOptionTest.prepareBooleanFlag("UseRTMForStackLocks",
+                        inflateMonitor),
+                CommandLineOptionTest.prepareBooleanFlag(
+                        "UseRTMXendForLockBusy",
+                        useXend),
+                "-XX:RTMRetryCount=0",
+                "-XX:RTMTotalCountIncrRate=1",
+                "-XX:+PrintPreciseRTMLockingStatistics",
+                BusyLock.class.getName(),
+                Boolean.toString(inflateMonitor),
+                Integer.toString(TestUseRTMXendForLockBusy.LOCKING_TIME)
+        );
+
+        outputAnalyzer.shouldHaveExitValue(0);
+
+        List<RTMLockingStatistics> statistics = RTMLockingStatistics.fromString(
+                test.getMethodWithLockName(), outputAnalyzer.getOutput());
+
+        Asserts.assertEQ(statistics.size(), 1, "VM output should contain "
+                + "exactly one rtm locking statistics entry for method "
+                + test.getMethodWithLockName());
+
+        long aborts = statistics.get(0).getAborts(AbortType.XABORT);
+
+        if (useXend) {
+            Asserts.assertEQ(aborts, 0L,
+                    "Expected to get no aborts on busy lock");
+        } else {
+            Asserts.assertGT(aborts, 0L,
+                    "Expected to get at least one abort on busy lock");
+        }
+    }
+
+    public static void main(String args[]) throws Throwable {
+        new TestUseRTMXendForLockBusy().test();
+    }
+}
diff --git a/hotspot/test/compiler/rtm/method_options/TestNoRTMLockElidingOption.java b/hotspot/test/compiler/rtm/method_options/TestNoRTMLockElidingOption.java
new file mode 100644
index 0000000..46c9482
--- /dev/null
+++ b/hotspot/test/compiler/rtm/method_options/TestNoRTMLockElidingOption.java
@@ -0,0 +1,102 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+/**
+ * @test
+ * @bug 8031320
+ * @summary Verify that NoRTMLockEliding option could be applied to
+ *          specified method and that such method will not use rtm.
+ * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
+ * @build TestNoRTMLockElidingOption
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *                   -XX:+WhiteBoxAPI TestNoRTMLockElidingOption
+ */
+
+import java.util.List;
+import com.oracle.java.testlibrary.*;
+import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
+import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
+import rtm.*;
+import rtm.predicate.SupportedCPU;
+import rtm.predicate.SupportedVM;
+
+/**
+ * Test verifies that method tagged with option <i>NoRTMLockElidingOption</i>
+ * will not use RTM-based lock elision.
+ * Test invokes compiled method and checks that no deoptimization with
+ * <i>rtm_state_change</i> reason had happened and that that VM output
+ * does not contain RTM locking statistics for compiled method.
+ */
+public class TestNoRTMLockElidingOption extends CommandLineOptionTest {
+    private TestNoRTMLockElidingOption() {
+        super(new AndPredicate(new SupportedCPU(), new SupportedVM()));
+    }
+
+    @Override
+    public void runTestCases() throws Throwable {
+        verifyOption(false);
+        verifyOption(true);
+    }
+
+    public void verifyOption(boolean useStackLock) throws Throwable {
+        AbortProvoker provoker = AbortType.XABORT.provoker();
+        String logFileName = String.format("rtm_deopt_%s_stack_lock.xml",
+                (useStackLock ? "use" : "no"));
+        String methodOption = String.format("-XX:CompileCommand=option," +
+                "%s,NoRTMLockEliding", provoker.getMethodWithLockName());
+
+        OutputAnalyzer outputAnalyzer = RTMTestBase.executeRTMTest(
+                logFileName,
+                provoker,
+                CommandLineOptionTest.prepareBooleanFlag("UseRTMForStackLocks",
+                        useStackLock),
+                methodOption,
+                "-XX:RTMTotalCountIncrRate=1",
+                "-XX:+UseRTMDeopt",
+                "-XX:+PrintPreciseRTMLockingStatistics",
+                AbortProvoker.class.getName(),
+                AbortType.XABORT.toString(),
+                Boolean.toString(!useStackLock)
+        );
+
+        outputAnalyzer.shouldHaveExitValue(0);
+
+        int firedTraps = RTMTestBase.firedRTMStateChangeTraps(logFileName);
+
+        Asserts.assertEQ(firedTraps, 0,
+                "No deoptimizations with rtm_state_change reason are expected");
+
+        List<RTMLockingStatistics> statistics = RTMLockingStatistics.fromString(
+                provoker.getMethodWithLockName(), outputAnalyzer.getOutput());
+
+        Asserts.assertEQ(statistics.size(), 0,
+                "VM output should not contain RTM locking statistics entries "
+                + "for method " + provoker.getMethodWithLockName());
+    }
+
+    public static void main(String args[]) throws Throwable {
+        new TestNoRTMLockElidingOption().test();
+    }
+}
diff --git a/hotspot/test/compiler/rtm/method_options/TestUseRTMLockElidingOption.java b/hotspot/test/compiler/rtm/method_options/TestUseRTMLockElidingOption.java
new file mode 100644
index 0000000..701cf8d
--- /dev/null
+++ b/hotspot/test/compiler/rtm/method_options/TestUseRTMLockElidingOption.java
@@ -0,0 +1,116 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+/**
+ * @test
+ * @bug 8031320
+ * @summary Verify that UseRTMLockEliding option could be applied to
+ *          specified method and that such method will not be deoptimized
+ *          on high abort ratio.
+ * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
+ * @build TestUseRTMLockElidingOption
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *                   -XX:+WhiteBoxAPI TestUseRTMLockElidingOption
+ */
+
+import java.util.List;
+import com.oracle.java.testlibrary.*;
+import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
+import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
+import rtm.*;
+import rtm.predicate.SupportedCPU;
+import rtm.predicate.SupportedVM;
+
+/**
+ * Test verifies that method tagged with option <i>UseRTMLockElidingOption</i>
+ * will use RTM-based lock elision, but will be never deoptimized with
+ * <i>rtm_state_change reason</i>.
+ * Test invokes compiled method and checks that no deoptimization with
+ * <i>rtm_state_change</i> reason had happened and that that VM output
+ * contains RTM locking statistics for compiled method and that total locks
+ * count equals to method's invocations.
+ * Since last assert is pretty strict, test uses -XX:RTMRetryCount=0 in order
+ * to avoid issue with retriable aborts described in
+ * {@link TestUseRTMAfterLockInflation}.
+ */
+public class TestUseRTMLockElidingOption extends CommandLineOptionTest {
+    private TestUseRTMLockElidingOption() {
+        super(new AndPredicate(new SupportedCPU(), new SupportedVM()));
+    }
+
+    @Override
+    public void runTestCases() throws Throwable {
+        verifyOption(false);
+        verifyOption(true);
+    }
+
+    public void verifyOption(boolean useStackLock) throws Throwable {
+        AbortProvoker provoker = AbortType.XABORT.provoker();
+        String logFileName = String.format("rtm_deopt_%s_stack_lock.xml",
+                (useStackLock ? "use" : "no"));
+        String methodOption = String.format("-XX:CompileCommand=option," +
+                "%s,UseRTMLockEliding", provoker.getMethodWithLockName());
+
+        OutputAnalyzer outputAnalyzer = RTMTestBase.executeRTMTest(
+                logFileName,
+                provoker,
+                CommandLineOptionTest.prepareBooleanFlag("UseRTMForStackLocks",
+                        useStackLock),
+                methodOption,
+                "-XX:RTMTotalCountIncrRate=1",
+                "-XX:RTMRetryCount=0",
+                "-XX:+UseRTMDeopt",
+                "-XX:+PrintPreciseRTMLockingStatistics",
+                provoker.getClass().getName(),
+                AbortType.XABORT.toString(),
+                Boolean.toString(!useStackLock)
+        );
+
+        outputAnalyzer.shouldHaveExitValue(0);
+
+        int firedTraps = RTMTestBase.firedRTMStateChangeTraps(logFileName);
+
+        Asserts.assertEQ(firedTraps, 0,
+                "Method deoptimization with rtm_state_change is unexpected");
+
+        List<RTMLockingStatistics> statistics = RTMLockingStatistics.fromString(
+                provoker.getMethodWithLockName(), outputAnalyzer.getOutput());
+
+        Asserts.assertEQ(statistics.size(), 1,
+                "VM output should contain exactly one RTM locking "
+                + "statistics entry for method "
+                + provoker.getMethodWithLockName());
+
+        RTMLockingStatistics lock = statistics.get(0);
+
+        Asserts.assertEQ(lock.getTotalLocks(), AbortProvoker.DEFAULT_ITERATIONS,
+                "Expected to get total locks count equal to total amount of "
+                + "lock attempts.");
+    }
+
+    public static void main(String args[]) throws Throwable {
+        new TestUseRTMLockElidingOption().test();
+    }
+}
diff --git a/hotspot/test/compiler/rtm/print/TestPrintPreciseRTMLockingStatistics.java b/hotspot/test/compiler/rtm/print/TestPrintPreciseRTMLockingStatistics.java
new file mode 100644
index 0000000..eebaac2
--- /dev/null
+++ b/hotspot/test/compiler/rtm/print/TestPrintPreciseRTMLockingStatistics.java
@@ -0,0 +1,142 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+/**
+ * @test
+ * @bug 8031320
+ * @summary Verify that rtm locking statistics contain proper information
+ *          on overall aborts and locks count and count of aborts of
+ *          different types. Test also verify that VM output does not
+ *          contain rtm locking statistics when it should not.
+ * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
+ * @build TestPrintPreciseRTMLockingStatistics
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *                   -XX:+WhiteBoxAPI TestPrintPreciseRTMLockingStatistics
+ */
+
+import java.util.*;
+
+import com.oracle.java.testlibrary.*;
+import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
+import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
+import rtm.*;
+import rtm.predicate.SupportedCPU;
+import rtm.predicate.SupportedVM;
+
+/**
+ * Test verifies that VM output does not contain RTM locking statistics when it
+ * should not (when PrintPreciseRTMLockingStatistics is off) and that with
+ * -XX:+PrintPreciseRTMLockingStatistics locking statistics contains sane
+ * total locks and aborts count as well as for specific abort types.
+ */
+public class TestPrintPreciseRTMLockingStatistics
+        extends CommandLineOptionTest {
+    private TestPrintPreciseRTMLockingStatistics() {
+        super(new AndPredicate(new SupportedCPU(), new SupportedVM()));
+    }
+
+    @Override
+    public void runTestCases() throws Throwable {
+        verifyNoStatistics();
+        verifyStatistics();
+    }
+
+    // verify that VM output does not contain
+    // rtm locking statistics
+    private void verifyNoStatistics() throws Throwable {
+        verifyNoStatistics(AbortType.XABORT);
+
+        verifyNoStatistics(AbortType.XABORT,
+                "-XX:-PrintPreciseRTMLockingStatistics");
+
+        verifyNoStatistics(AbortType.XABORT, "-XX:-UseRTMLocking",
+                "-XX:+PrintPreciseRTMLockingStatistics");
+    }
+
+    // verify that rtm locking statistics contain information
+    // about each type of aborts
+    private void verifyStatistics() throws Throwable {
+        verifyAbortsCount(AbortType.XABORT);
+        verifyAbortsCount(AbortType.MEM_CONFLICT);
+        verifyAbortsCount(AbortType.BUF_OVERFLOW);
+        verifyAbortsCount(AbortType.NESTED_ABORT);
+    }
+
+    private void verifyNoStatistics(AbortType abortProvokerType,
+            String... vmOpts) throws Throwable {
+        AbortProvoker provoker = abortProvokerType.provoker();
+        List<String> finalVMOpts = new LinkedList<>();
+        Collections.addAll(finalVMOpts, vmOpts);
+        Collections.addAll(finalVMOpts, AbortProvoker.class.getName(),
+                abortProvokerType.toString());
+
+        OutputAnalyzer outputAnalyzer = RTMTestBase.executeRTMTest(provoker,
+                finalVMOpts.toArray(new String[finalVMOpts.size()]));
+
+        outputAnalyzer.shouldHaveExitValue(0);
+
+        List<RTMLockingStatistics> statistics = RTMLockingStatistics.fromString(
+                outputAnalyzer.getOutput());
+
+        Asserts.assertEQ(statistics.size(), 0, "VM output should not contain "
+                + "any RTM locking statistics");
+    }
+
+    private void verifyAbortsCount(AbortType abortType) throws Throwable {
+        AbortProvoker provoker = abortType.provoker();
+
+        OutputAnalyzer outputAnalyzer = RTMTestBase.executeRTMTest(
+                provoker,
+                "-XX:+PrintPreciseRTMLockingStatistics",
+                AbortProvoker.class.getName(),
+                abortType.toString());
+
+        outputAnalyzer.shouldHaveExitValue(0);
+
+        List<RTMLockingStatistics> statistics = RTMLockingStatistics.fromString(
+                provoker.getMethodWithLockName(),outputAnalyzer.getOutput());
+
+        Asserts.assertGT(statistics.size(), 0, "VM output should contain one "
+                + "rtm locking statistics entry for method "
+                + provoker.getMethodWithLockName());
+
+        RTMLockingStatistics lock = statistics.get(0);
+
+        Asserts.assertGT(lock.getTotalLocks(), 0L, "RTM locking statistics "
+                + "should contain non zero total locks count");
+
+        Asserts.assertGT(lock.getTotalAborts(), 0L,
+                "RTM locking statistics should contain non zero total aborts "
+                + "count");
+
+        Asserts.assertGT(lock.getAborts(abortType), 0L, String.format(
+                "RTM locking statistics should contain non zero aborts count "
+                + "for abort reason %s", abortType));
+    }
+
+    public static void main(String args[]) throws Throwable {
+        new TestPrintPreciseRTMLockingStatistics().test();
+    }
+}
diff --git a/hotspot/test/compiler/testlibrary/rtm/AbortProvoker.java b/hotspot/test/compiler/testlibrary/rtm/AbortProvoker.java
new file mode 100644
index 0000000..1d12908
--- /dev/null
+++ b/hotspot/test/compiler/testlibrary/rtm/AbortProvoker.java
@@ -0,0 +1,172 @@
+/*
+ * 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.
+ *
+ * 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 rtm;
+
+import java.util.Objects;
+import java.util.concurrent.BrokenBarrierException;
+import java.util.concurrent.CyclicBarrier;
+
+import com.oracle.java.testlibrary.Asserts;
+import com.oracle.java.testlibrary.Utils;
+import sun.misc.Unsafe;
+
+/**
+ * Base class for different transactional execution abortion
+ * provokers aimed to force abort due to specified reason.
+ */
+public abstract class AbortProvoker implements CompilableTest {
+    public static final long DEFAULT_ITERATIONS = 10000L;
+    /**
+     * Inflates monitor associated with object {@code monitor}.
+     * Inflation is forced by entering the same monitor from
+     * two different threads.
+     *
+     * @param monitor monitor to be inflated.
+     * @return inflated monitor.
+     * @throws Exception if something went wrong.
+     */
+    public static Object inflateMonitor(Object monitor) throws Exception {
+        Unsafe unsafe = Utils.getUnsafe();
+        CyclicBarrier barrier = new CyclicBarrier(2);
+
+        Runnable inflatingRunnable = () -> {
+            unsafe.monitorEnter(monitor);
+            try {
+                barrier.await();
+                barrier.await();
+            } catch (InterruptedException | BrokenBarrierException e) {
+                throw new RuntimeException(
+                        "Synchronization issue occurred.", e);
+            } finally {
+                unsafe.monitorExit(monitor);
+            }
+        };
+
+        Thread t = new Thread(inflatingRunnable);
+        t.start();
+        // Wait until thread t enters the monitor.
+        barrier.await();
+        // At this point monitor will be owned by thread t,
+        // so our attempt to enter the same monitor will force
+        // monitor inflation.
+        Asserts.assertFalse(unsafe.tryMonitorEnter(monitor),
+                            "Not supposed to enter the monitor first");
+        barrier.await();
+        t.join();
+        return monitor;
+    }
+
+
+    /**
+     * Get instance of specified AbortProvoker, inflate associated monitor
+     * if needed and then invoke forceAbort method in a loop.
+     *
+     * Usage:
+     * AbortProvoker &lt;AbortType name&gt; [&lt;inflate monitor&gt
+     * [&lt;iterations&gt; [ &lt;delay&gt;]]]
+     *
+     *  Default parameters are:
+     *  <ul>
+     *  <li>inflate monitor = <b>true</b></li>
+     *  <li>iterations = {@code AbortProvoker.DEFAULT_ITERATIONS}</li>
+     *  <li>delay = <b>0</b></li>
+     *  </ul>
+     */
+    public static void main(String args[]) throws Throwable {
+        Asserts.assertGT(args.length, 0, "At least one argument is required.");
+
+        AbortType abortType = AbortType.lookup(Integer.valueOf(args[0]));
+        boolean monitorShouldBeInflated = true;
+        long iterations = AbortProvoker.DEFAULT_ITERATIONS;
+
+        if (args.length > 1) {
+            monitorShouldBeInflated = Boolean.valueOf(args[1]);
+
+            if (args.length > 2) {
+                iterations = Long.valueOf(args[2]);
+
+                if (args.length > 3) {
+                    Thread.sleep(Integer.valueOf(args[3]));
+                }
+            }
+        }
+
+        AbortProvoker provoker = abortType.provoker();
+
+        if (monitorShouldBeInflated) {
+            provoker.inflateMonitor();
+        }
+
+        for (long i = 0; i < iterations; i++) {
+            provoker.forceAbort();
+        }
+    }
+
+    protected final Object monitor;
+
+    protected AbortProvoker() {
+        this(new Object());
+    }
+
+    protected AbortProvoker(Object monitor) {
+        this.monitor = Objects.requireNonNull(monitor);
+    }
+
+    /**
+     * Inflates monitor used by this AbortProvoker instance.
+     * @throws Exception
+     */
+    public void inflateMonitor() throws Exception {
+        AbortProvoker.inflateMonitor(monitor);
+    }
+
+    /**
+     * Forces transactional execution abortion.
+     */
+    public abstract void forceAbort();
+
+    /**
+     * Returns names of all methods that have to be compiled
+     * in order to successfully force transactional execution
+     * abortion.
+     *
+     * @return array with methods' names that have to be compiled.
+     */
+    @Override
+    public String[] getMethodsToCompileNames() {
+        return new String[] { getMethodWithLockName() };
+    }
+
+    /**
+     * Returns name of the method that will contain monitor whose locking
+     * will be elided using transactional execution.
+     *
+     * @return name of the method that will contain elided lock.
+     */
+    @Override
+    public String getMethodWithLockName() {
+        return this.getClass().getName() + "::forceAbort";
+    }
+}
diff --git a/hotspot/test/compiler/testlibrary/rtm/AbortType.java b/hotspot/test/compiler/testlibrary/rtm/AbortType.java
new file mode 100644
index 0000000..5e14f67
--- /dev/null
+++ b/hotspot/test/compiler/testlibrary/rtm/AbortType.java
@@ -0,0 +1,103 @@
+/*
+ * 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.
+ *
+ * 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 rtm;
+
+import com.oracle.java.testlibrary.Asserts;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Type of transactional execution abort.
+ * For more details on different abort types please see
+ * shared/vm/runtime/rtmLocking.hpp
+ */
+public enum AbortType {
+    XABORT(0),
+    RETRIABLE(1),
+    MEM_CONFLICT(2),
+    BUF_OVERFLOW(3),
+    DEBUG_BREAKPOINT(4),
+    NESTED_ABORT(5);
+
+    private final int type;
+    private static final Map<Integer, AbortType> LOOKUP_MAP = new HashMap<>();
+
+    static {
+        for (AbortType abortType : AbortType.values()) {
+            Asserts.assertFalse(LOOKUP_MAP.containsKey(abortType.type),
+                    "Abort type values should be unique.");
+            LOOKUP_MAP.put(abortType.type, abortType);
+        }
+    }
+
+    private AbortType(int type) {
+        this.type = type;
+    }
+
+    /**
+     * Returns AbortProvoker for aborts represented by this abort type.
+     *
+     * @return an AbortProvoker instance
+     */
+    public AbortProvoker provoker() {
+        return AbortType.createNewProvoker(this);
+    }
+
+    public static AbortType lookup(int type) {
+        Asserts.assertLT(type, AbortType.values().length,
+                "Unknown abort type.");
+        return LOOKUP_MAP.get(type);
+    }
+
+    /**
+     * Returns transaction execution abort provoker for specified abortion type.
+     *
+     * @param type a type of abort which will be forced by returned
+     *             AbortProvoker instance.
+     * @return AbortProvoker instance that will force abort of specified type
+     * @throws RuntimeException if there is no provoker for specified type
+     */
+    private static AbortProvoker createNewProvoker(AbortType type) {
+        switch (type) {
+            case XABORT:
+                return new XAbortProvoker();
+            case MEM_CONFLICT:
+                return new MemoryConflictProvoker();
+            case BUF_OVERFLOW:
+                return new BufferOverflowProvoker();
+            case NESTED_ABORT:
+                return new NestedAbortProvoker();
+            default:
+                throw new RuntimeException("No provoker exists for type "
+                        + type.name());
+        }
+    }
+
+    @Override
+    public String toString() {
+        return Integer.toString(type);
+    }
+}
diff --git a/hotspot/test/compiler/testlibrary/rtm/BufferOverflowProvoker.java b/hotspot/test/compiler/testlibrary/rtm/BufferOverflowProvoker.java
new file mode 100644
index 0000000..7dac0db
--- /dev/null
+++ b/hotspot/test/compiler/testlibrary/rtm/BufferOverflowProvoker.java
@@ -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.
+ *
+ * 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 rtm;
+
+/**
+ * In order to provoke transactional execution abort due to
+ * internal's buffer overflow BufferOverflowProvoker modifies
+ * 1MB of BYTES during single transaction.
+ */
+class BufferOverflowProvoker extends AbortProvoker {
+    /**
+     * To force buffer overflow abort we modify memory region with
+     * size more then L1d cache size.
+     */
+    private static final int MORE_THAN_L1D_SIZE = 1024 * 1024;
+    private static final byte[] DATA = new byte[MORE_THAN_L1D_SIZE];
+
+    @Override
+    public void forceAbort() {
+        synchronized(monitor) {
+            for (int i = 0; i < BufferOverflowProvoker.DATA.length; i++) {
+                BufferOverflowProvoker.DATA[i]++;
+            }
+        }
+    }
+}
diff --git a/hotspot/test/compiler/testlibrary/rtm/BusyLock.java b/hotspot/test/compiler/testlibrary/rtm/BusyLock.java
new file mode 100644
index 0000000..70e80f7
--- /dev/null
+++ b/hotspot/test/compiler/testlibrary/rtm/BusyLock.java
@@ -0,0 +1,136 @@
+/*
+ * 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.
+ *
+ * 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 rtm;
+
+import com.oracle.java.testlibrary.Utils;
+import sun.misc.Unsafe;
+
+import java.util.concurrent.BrokenBarrierException;
+import java.util.concurrent.CyclicBarrier;
+
+/**
+ * Test case for busy lock scenario.
+ * One thread enters the monitor and sleep for a while.
+ * Another thread is blocked on the same monitor.
+ */
+public class BusyLock implements CompilableTest, Runnable {
+    private static final int DEFAULT_TIMEOUT = 1000;
+    private final CyclicBarrier barrier;
+
+    // Following field have to be static in order to avoid escape analysis.
+    @SuppressWarnings("UnsuedDeclaration")
+    private static int field = 0;
+    private static final Unsafe UNSAFE = Utils.getUnsafe();
+    protected final Object monitor;
+    protected final int timeout;
+
+    public BusyLock() {
+        this(BusyLock.DEFAULT_TIMEOUT);
+    }
+
+    public BusyLock(int timeout) {
+        this.timeout = timeout;
+        this.monitor = new Object();
+        this.barrier = new CyclicBarrier(2);
+    }
+
+    @Override
+    public void run() {
+        try {
+            // wait until forceAbort leave monitor
+            barrier.await();
+            if (UNSAFE.tryMonitorEnter(monitor)) {
+                try {
+                    barrier.await();
+                    Thread.sleep(timeout);
+                } finally {
+                    UNSAFE.monitorExit(monitor);
+                }
+            } else {
+                throw new RuntimeException("Monitor should be entered by " +
+                                           "::run() first.");
+            }
+        } catch (InterruptedException | BrokenBarrierException e) {
+            throw new RuntimeException("Synchronization error happened.", e);
+        }
+    }
+
+    public void test() {
+        try {
+            barrier.await();
+            // wait until monitor is locked by a ::run method
+            barrier.await();
+        } catch (InterruptedException | BrokenBarrierException e) {
+            throw new RuntimeException("Synchronization error happened.", e);
+        }
+        synchronized(monitor) {
+            BusyLock.field++;
+        }
+    }
+
+    @Override
+    public String getMethodWithLockName() {
+        return this.getClass().getName() + "::test";
+    }
+
+    @Override
+    public String[] getMethodsToCompileNames() {
+        return new String[] { getMethodWithLockName() };
+    }
+
+    /**
+     * Usage:
+     * BusyLock [ &lt;inflate monitor&gt; [ &lt;timeout&gt; ] ]
+     *
+     * Default values are:
+     * <ul>
+     *     <li>inflate monitor = {@code true}</li>
+     *     <li>timeout = {@code BusyLock.DEFAULT_TIMEOUT}</li>
+     * </ul>
+     */
+    public static void main(String args[]) throws Exception {
+        int timeoutValue = BusyLock.DEFAULT_TIMEOUT;
+        boolean inflateMonitor = true;
+
+        if (args.length > 0 ) {
+            inflateMonitor = Boolean.valueOf(args[0]);
+
+            if (args.length > 1) {
+                timeoutValue = Integer.valueOf(args[1]);
+            }
+        }
+
+        BusyLock busyLock = new BusyLock(timeoutValue);
+
+        if (inflateMonitor) {
+            AbortProvoker.inflateMonitor(busyLock.monitor);
+        }
+
+        Thread t = new Thread(busyLock);
+        t.start();
+        busyLock.test();
+        t.join();
+    }
+}
diff --git a/hotspot/test/compiler/testlibrary/rtm/CompilableTest.java b/hotspot/test/compiler/testlibrary/rtm/CompilableTest.java
new file mode 100644
index 0000000..840e956
--- /dev/null
+++ b/hotspot/test/compiler/testlibrary/rtm/CompilableTest.java
@@ -0,0 +1,41 @@
+/*
+ * 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.
+ *
+ * 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 rtm;
+
+/**
+ * Interface for test scenarios that contain methods
+ * that should be compiled.
+ */
+public interface CompilableTest {
+    /**
+     * @return array with methods' names that should be compiled.
+     */
+    String[] getMethodsToCompileNames();
+
+    /**
+     * @return name of method with RTM-elided lock.
+     */
+    String getMethodWithLockName();
+}
diff --git a/hotspot/test/compiler/testlibrary/rtm/MemoryConflictProvoker.java b/hotspot/test/compiler/testlibrary/rtm/MemoryConflictProvoker.java
new file mode 100644
index 0000000..48cf799
--- /dev/null
+++ b/hotspot/test/compiler/testlibrary/rtm/MemoryConflictProvoker.java
@@ -0,0 +1,100 @@
+/*
+ * 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.
+ *
+ * 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 rtm;
+
+import java.util.concurrent.BrokenBarrierException;
+import java.util.concurrent.CyclicBarrier;
+
+/**
+ * To force transactional execution abort due to memory conflict
+ * one thread should access memory region from transactional region
+ * while another thread should modify the same memory region.
+ * Since this scenario is based on the race condition between threads
+ * you should not expect some particular amount of aborts.
+ */
+class MemoryConflictProvoker extends AbortProvoker {
+    // Following field have to be static in order to avoid escape analysis.
+    @SuppressWarnings("UnsuedDeclaration")
+    private static int field = 0;
+    private static final int INNER_ITERATIONS = 10000;
+    private final CyclicBarrier barrier;
+    /**
+     * This thread will access and modify memory region
+     * from outside of the transaction.
+     */
+    private final Runnable conflictingThread;
+
+    public MemoryConflictProvoker() {
+        this(new Object());
+    }
+
+    public MemoryConflictProvoker(Object monitor) {
+        super(monitor);
+        barrier = new CyclicBarrier(2);
+        conflictingThread = () -> {
+            try {
+                barrier.await();
+            } catch (Exception e) {
+                throw new RuntimeException(e);
+            }
+            for (int i = 0; i < MemoryConflictProvoker.INNER_ITERATIONS; i++) {
+                MemoryConflictProvoker.field++;
+            }
+        };
+    }
+
+    /**
+     * Accesses and modifies memory region from within the transaction.
+     */
+    public void transactionalRegion() {
+        try {
+            barrier.await();
+        } catch (InterruptedException | BrokenBarrierException e) {
+            throw new RuntimeException(e);
+        }
+        for (int i = 0; i < MemoryConflictProvoker.INNER_ITERATIONS; i++) {
+            synchronized(monitor) {
+                MemoryConflictProvoker.field--;
+            }
+        }
+    }
+
+    @Override
+    public void forceAbort() {
+        try {
+            Thread t = new Thread(conflictingThread);
+            t.start();
+            transactionalRegion();
+            t.join();
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    @Override
+    public String getMethodWithLockName() {
+        return this.getClass().getName() + "::transactionalRegion";
+    }
+}
diff --git a/hotspot/test/compiler/testlibrary/rtm/NestedAbortProvoker.java b/hotspot/test/compiler/testlibrary/rtm/NestedAbortProvoker.java
new file mode 100644
index 0000000..8fae9e4
--- /dev/null
+++ b/hotspot/test/compiler/testlibrary/rtm/NestedAbortProvoker.java
@@ -0,0 +1,61 @@
+/*
+ * 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.
+ *
+ * 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 rtm;
+
+import java.util.Arrays;
+
+/**
+ * In order to force nested transaction abort NestedAbortProvoker
+ * invoke BufferOverflowProvoker from transactional region.
+ */
+class NestedAbortProvoker extends AbortProvoker {
+    // Following field have to be static in order to avoid escape analysis.
+    @SuppressWarnings("UnsuedDeclaration")
+    private static int field = 0;
+    private final AbortProvoker nestedAbortProvoker;
+
+    public NestedAbortProvoker() {
+        this.nestedAbortProvoker = new XAbortProvoker(monitor);
+    }
+
+    @Override
+    public void forceAbort() {
+        synchronized(monitor) {
+            NestedAbortProvoker.field++;
+            nestedAbortProvoker.forceAbort();
+            NestedAbortProvoker.field--;
+        }
+    }
+
+    @Override
+    public String[] getMethodsToCompileNames() {
+        String nestedProvokerMethods[]
+                = nestedAbortProvoker.getMethodsToCompileNames();
+        String methods[] = Arrays.copyOf(nestedProvokerMethods,
+                nestedProvokerMethods.length + 1);
+        methods[methods.length - 1] = getMethodWithLockName();
+        return methods;
+    }
+}
diff --git a/hotspot/test/compiler/testlibrary/rtm/RTMLockingStatistics.java b/hotspot/test/compiler/testlibrary/rtm/RTMLockingStatistics.java
new file mode 100644
index 0000000..4c354bf
--- /dev/null
+++ b/hotspot/test/compiler/testlibrary/rtm/RTMLockingStatistics.java
@@ -0,0 +1,227 @@
+/*
+ * 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.
+ *
+ * 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 rtm;
+
+import java.util.EnumMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.regex.Pattern;
+import java.util.regex.Matcher;
+
+/**
+ * Wrapper for +UsePreciseRTMLockingStatistics output.
+ *
+ * Example of locking statistics:
+ *
+ * java/lang/ClassLoader.loadClass@7
+ * # rtm locks total (estimated): 0
+ * # rtm lock aborts  : 13
+ * # rtm lock aborts 0: 12
+ * # rtm lock aborts 1: 0
+ * # rtm lock aborts 2: 0
+ * # rtm lock aborts 3: 0
+ * # rtm lock aborts 4: 0
+ * # rtm lock aborts 5: 0
+ */
+public class RTMLockingStatistics {
+    /**
+     * Pattern for aborts per abort type entries.
+     */
+    private static final Pattern ABORT_PATTERN;
+
+    /**
+     * Pattern for whole statistics.
+     */
+    private static final Pattern RTM_LOCKING_STATISTICS_PATTERN;
+
+    static {
+        String abortRe
+                = "# rtm lock aborts\\s+(?<type>[0-9]+):\\s(?<count>[0-9]+)";
+
+        ABORT_PATTERN = Pattern.compile(abortRe);
+        RTM_LOCKING_STATISTICS_PATTERN = Pattern.compile(
+                "(?<className>[^.\n]+)\\." +
+                "(?<methodName>[^@\n]+)@(?<bci>[0-9]+)\n" +
+                "# rtm locks total \\(estimated\\):\\s*" +
+                "(?<totalLocks>[0-9]+)\n" +
+                "# rtm lock aborts\\s+:\\s*(?<totalAborts>[0-9]+)\n" +
+                "(?<abortStats>(" + abortRe + "\n)+)");
+    }
+
+    private final long totalLocks;
+    private final long totalAborts;
+    private final String className;
+    private final String methodName;
+    private final int bci;
+    private final Map<AbortType, Long> aborts = new EnumMap<>(AbortType.class);
+
+    /**
+     * Constructs RTMLockingStatistics from matcher captured statistics entry.
+     * @param matcher Matcher captured statistics entry.
+     */
+    private RTMLockingStatistics(Matcher matcher) {
+        className = matcher.group("className");
+        methodName = matcher.group("methodName");
+        bci = Integer.valueOf(matcher.group("bci"));
+        totalLocks = Long.valueOf(matcher.group("totalLocks"));
+        totalAborts = Long.valueOf(matcher.group("totalAborts"));
+
+        Matcher abortMatcher = ABORT_PATTERN.matcher(matcher.
+                group("abortStats"));
+
+        while (abortMatcher.find()) {
+            int type = Integer.valueOf(abortMatcher.group("type"));
+            long count = Long.valueOf(abortMatcher.group("count"));
+            setAborts(AbortType.lookup(type), count);
+        }
+    }
+
+
+    /**
+     * Parses string and return all founded RTM locking statistics entries.
+     *
+     * @param str the string to be parsed.
+     * @return list with all founded RTM locking statistics entries or
+     *         empty list if nothing was found.
+     */
+    public static List<RTMLockingStatistics> fromString(String str) {
+        List<RTMLockingStatistics> statistics = new LinkedList<>();
+        Matcher matcher = RTM_LOCKING_STATISTICS_PATTERN.matcher(str);
+
+        while (matcher.find()) {
+            RTMLockingStatistics lock = new RTMLockingStatistics(matcher);
+            statistics.add(lock);
+        }
+
+        return statistics;
+    }
+
+    /**
+     * Parses string and return all founded RTM locking statistics entries
+     * for locks in method {@code methodName}.
+     *
+     * @param methodName a name of the method for locks from which statistics
+     *                   should be gathered.
+     * @param str the string to be parsed.
+     * @return list with all founded RTM locking statistics entries or
+     *         empty list if nothing was found.
+     */
+    public static List<RTMLockingStatistics> fromString(String methodName,
+            String str) {
+        String formattedMethodName = formatMethodName(methodName);
+
+        List<RTMLockingStatistics> statisticsForMethod = new LinkedList<>();
+        for (RTMLockingStatistics statistics : fromString(str)) {
+            if (statistics.getLockName().startsWith(formattedMethodName)) {
+                statisticsForMethod.add(statistics);
+            }
+        }
+        return statisticsForMethod;
+    }
+
+    /**
+     * Formats method's name so it will have the same format as
+     * in rtm locking statistics.
+     *
+     * <pre>
+     * Example:
+     * com/example/Klass::method =&gt; com/example/Klass.method
+     * com/example/Klass.method  =&gt; com/example/Klass.method
+     * com.example.Klass::method =&gt; com/example/Klass.method
+     * com.example.Klass.method  =&gt; com/example/Klass.method
+     * </pre>
+     *
+     * @param methodName method's name that should be formatted.
+     * @return formatted method's name.
+     */
+    private static String formatMethodName(String methodName) {
+        String m[];
+        if (methodName.contains("::")) {
+            m = methodName.split("::");
+        } else {
+            int splitAt = methodName.lastIndexOf('.');
+            m = new String[2];
+            m[0] = methodName.substring(0, splitAt);
+            m[1] = methodName.substring(splitAt + 1);
+        }
+        return String.format("%s.%s", m[0].replaceAll("\\.", "/"), m[1]);
+    }
+
+    /**
+     * Returns name of lock for which this statistics was collected.
+     * Lock name has following format:
+     * &lt;class name&gt;.&lt;method name&gt;@&lt;bci&gt;
+     *
+     * @return name of lock.
+     */
+    public String getLockName() {
+        return String.format("%s.%s@%d", className, methodName, bci);
+    }
+
+    /**
+     * Returns aborts count for specified abort type.
+     *
+     * @param type an abort type.
+     * @return count of aborts.
+     */
+    public long getAborts(AbortType type) {
+        return aborts.getOrDefault(type, 0L);
+    }
+
+    /**
+     * Sets aborts count for specified abort type.
+     *
+     * @param type an abort type.
+     * @param count count of aborts.
+     */
+    public void setAborts(AbortType type, long count) {
+        aborts.put(type, count);
+    }
+
+    public long getTotalLocks() {
+        return totalLocks;
+    }
+
+    public long getTotalAborts() {
+        return totalAborts;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder builder = new StringBuilder();
+        builder.append(getLockName()).append('\n');
+        builder.append(String.format("# rtm locks total (estimated): %d\n",
+                getTotalLocks()));
+        builder.append(String.format("# rtm lock aborts: %d\n",
+                getTotalLocks()));
+
+        for (AbortType type : AbortType.values()) {
+            builder.append(String.format("# rtm lock aborts %s %d\n",
+                    type.toString(), getAborts(type)));
+        }
+        return builder.toString();
+    }
+}
diff --git a/hotspot/test/compiler/testlibrary/rtm/RTMTestBase.java b/hotspot/test/compiler/testlibrary/rtm/RTMTestBase.java
new file mode 100644
index 0000000..c4bbcc1
--- /dev/null
+++ b/hotspot/test/compiler/testlibrary/rtm/RTMTestBase.java
@@ -0,0 +1,279 @@
+/*
+ * 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.
+ *
+ * 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 rtm;
+
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.List;
+import java.util.LinkedList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import com.oracle.java.testlibrary.OutputAnalyzer;
+import com.oracle.java.testlibrary.ProcessTools;
+import com.oracle.java.testlibrary.Utils;
+import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
+
+/**
+ * Auxiliary methods used for RTM testing.
+ */
+public class RTMTestBase {
+    private static final String RTM_STATE_CHANGE_REASON = "rtm_state_change";
+    /**
+     * We don't parse compilation log as XML-document and use regular
+     * expressions instead, because in some cases it could be
+     * malformed.
+     */
+    private static final String FIRED_UNCOMMON_TRAP_PATTERN_TEMPLATE
+            = "<uncommon_trap thread='[0-9]+' reason='%s'";
+    private static final String INSTALLED_UNCOMMON_TRAP_PATTERN_TEMPLATE
+            = "<uncommon_trap bci='[0-9]+' reason='%s'";
+
+    /**
+     * Executes RTM test in a new JVM started with {@code options} cli options.
+     *
+     * @param test test case to execute.
+     * @param options additional options for VM
+     * @throws Exception when something went wrong.
+     */
+    public static OutputAnalyzer executeRTMTest(CompilableTest test,
+            String... options) throws Exception {
+        ProcessBuilder processBuilder
+                = ProcessTools.createJavaProcessBuilder(
+                RTMTestBase.prepareTestOptions(test, options));
+        OutputAnalyzer outputAnalyzer
+                = new OutputAnalyzer(processBuilder.start());
+        System.out.println(outputAnalyzer.getOutput());
+        return outputAnalyzer;
+    }
+
+    /**
+     * Executes test case and save compilation log to {@code logFileName}.
+     *
+     * @param logFileName a name of compilation log file
+     * @param test a test case to execute case to execute
+     * @param options additional options to VM
+     * @return OutputAnalyzer for started test case
+     * @throws Exception when something went wrong
+     */
+    public static OutputAnalyzer executeRTMTest(String logFileName,
+            CompilableTest test, String... options) throws Exception {
+        ProcessBuilder processBuilder
+                = ProcessTools.createJavaProcessBuilder(
+                RTMTestBase.prepareTestOptions(logFileName, test, options));
+        OutputAnalyzer outputAnalyzer
+                = new OutputAnalyzer(processBuilder.start());
+
+        System.out.println(outputAnalyzer.getOutput());
+
+        return outputAnalyzer;
+    }
+
+    /**
+     * Finds count of uncommon traps with reason {@code reason} installed
+     * during compilation.
+     *
+     * @param compilationLogFile a path to file with LogCompilation output.
+     * @param reason reason of installed uncommon traps.
+     * @return count of installed uncommon traps with reason {@code reason}.
+     * @throws IOException
+     */
+    public static int installedUncommonTraps(String compilationLogFile,
+            String reason)throws IOException {
+        String pattern = String.format(
+                RTMTestBase.INSTALLED_UNCOMMON_TRAP_PATTERN_TEMPLATE,
+                reason);
+        return RTMTestBase.findTraps(compilationLogFile, pattern);
+    }
+
+    /**
+     * Finds count of uncommon traps with reason <i>rtm_state_change</i>
+     * installed during compilation.
+     *
+     * @param compilationLogFile a path to file with LogCompilation output.
+     * @return count of installed uncommon traps with reason
+     *         <i>rtm_state_change</i>.
+     * @throws IOException
+     */
+    public static int installedRTMStateChangeTraps(String compilationLogFile)
+            throws IOException {
+        return RTMTestBase.installedUncommonTraps(compilationLogFile,
+                RTMTestBase.RTM_STATE_CHANGE_REASON);
+    }
+
+    /**
+     * Finds count of fired uncommon traps with reason {@code reason}.
+     *
+     * @param compilationLogFile a path to file with LogCompilation output.
+     * @param reason a reason of fired uncommon traps.
+     * @return count of fired uncommon traps with reason {@code reason}.
+     * @throws IOException
+     */
+    public static int firedUncommonTraps(String compilationLogFile,
+            String reason) throws IOException {
+        String pattern = String.format(
+                RTMTestBase.FIRED_UNCOMMON_TRAP_PATTERN_TEMPLATE,
+                reason);
+        return RTMTestBase.findTraps(compilationLogFile, pattern);
+    }
+
+    /**
+     * Finds count of fired uncommon traps with reason <i>rtm_state_change</i>.
+     *
+     * @param compilationLogFile a path to file with LogCompilation output.
+     * @return count of fired uncommon traps with reason
+     *         <i>rtm_state_change</i>.
+     * @throws IOException
+     */
+    public static int firedRTMStateChangeTraps(String compilationLogFile)
+            throws IOException {
+        return RTMTestBase.firedUncommonTraps(compilationLogFile,
+                RTMTestBase.RTM_STATE_CHANGE_REASON);
+    }
+
+    /**
+     * Finds count of uncommon traps that matches regular
+     * expression in {@code re}.
+     *
+     * @param compilationLogFile a path to file with LogCompilation output.
+     * @param re regular expression to match uncommon traps.
+     * @throws IOException
+     */
+    private static int findTraps(String compilationLogFile, String re)
+            throws IOException {
+        String compilationLog = RTMTestBase.fileAsString(compilationLogFile);
+        Pattern pattern = Pattern.compile(re);
+        Matcher matcher = pattern.matcher(compilationLog);
+        int traps = 0;
+        while (matcher.find()) {
+            traps++;
+        }
+        return traps;
+    }
+
+    /**
+     * Returns file's content as a string.
+     *
+     * @param path a path to file to operate on.
+     * @return string with content of file.
+     * @throws IOException
+     */
+    private static String fileAsString(String path) throws IOException {
+        byte[] fileAsBytes = Files.readAllBytes(Paths.get(path));
+        return new String(fileAsBytes);
+    }
+
+    /**
+     * Prepares VM options for test execution.
+     * This method get test java options, filter out all RTM-related options,
+     * adds CompileCommand=compileonly,method_name options for each method
+     * from {@code methodToCompile} and finally appends all {@code vmOpts}.
+     *
+     * @param test test case whose methods that should be compiled.
+     *             If {@code null} then no additional <i>compileonly</i>
+     *             commands will be added to VM options.
+     * @param vmOpts additional options to pass to VM.
+     * @return Array with VM options.
+     */
+    private static String[] prepareTestOptions(CompilableTest test,
+            String... vmOpts) {
+        return RTMTestBase.prepareFilteredTestOptions(test, null, vmOpts);
+    }
+
+    /**
+     * Prepares VM options for test execution.
+     * This method get test java options, filter out all RTM-related options
+     * and all options that matches regexps in {@code additionalFilters},
+     * adds CompileCommand=compileonly,method_name options for each method
+     * from {@code methodToCompile} and finally appends all {@code vmOpts}.
+     *
+     * @param test test case whose methods that should be compiled.
+     *             If {@code null} then no additional <i>compileonly</i>
+     *             commands will be added to VM options.
+     * @param additionalFilters array with regular expression that will be
+     *                          used to filter out test java options.
+     *                          If {@code null} then no additional filters
+     *                          will be used.
+     * @param vmOpts additional options to pass to VM.
+     * @return array with VM options.
+     */
+    private static String[] prepareFilteredTestOptions(CompilableTest test,
+            String[] additionalFilters, String... vmOpts) {
+        List<String> finalVMOpts = new LinkedList<>();
+        String[] filters;
+
+        if (additionalFilters != null) {
+            filters = Arrays.copyOf(additionalFilters,
+                    additionalFilters.length + 1);
+        } else {
+            filters = new String[1];
+        }
+
+        filters[filters.length - 1] = "RTM";
+        String[] filteredVMOpts = Utils.getFilteredTestJavaOpts(filters);
+        Collections.addAll(finalVMOpts, filteredVMOpts);
+        Collections.addAll(finalVMOpts, "-Xcomp", "-server",
+                "-XX:-TieredCompilation", "-XX:+UseRTMLocking",
+                CommandLineOptionTest.UNLOCK_DIAGNOSTIC_VM_OPTIONS,
+                CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS);
+
+        if (test != null) {
+            for (String method : test.getMethodsToCompileNames()) {
+                finalVMOpts.add("-XX:CompileCommand=compileonly," + method);
+            }
+        }
+        Collections.addAll(finalVMOpts, vmOpts);
+        return finalVMOpts.toArray(new String[finalVMOpts.size()]);
+    }
+
+    /**
+     * Adds additional options for VM required for successful execution of test.
+     *
+     * @param logFileName a name of compilation log file
+     * @param test a test case to execute
+     * @param options additional options to VM
+     * @return an array with VM options
+     */
+    private static String[] prepareTestOptions(String logFileName,
+            CompilableTest test, String... options) {
+        String[] preparedOptions = RTMTestBase.prepareFilteredTestOptions(
+                test,
+                new String[] {
+                        "LogCompilation",
+                        "LogFile"
+                });
+        List<String> updatedOptions = new LinkedList<>();
+        Collections.addAll(updatedOptions, preparedOptions);
+        Collections.addAll(updatedOptions,
+                "-XX:+LogCompilation",
+                "-XX:LogFile=" + logFileName);
+        Collections.addAll(updatedOptions, options);
+
+        return updatedOptions.toArray(new String[updatedOptions.size()]);
+    }
+}
diff --git a/hotspot/test/compiler/testlibrary/rtm/XAbortProvoker.java b/hotspot/test/compiler/testlibrary/rtm/XAbortProvoker.java
new file mode 100644
index 0000000..4f45590
--- /dev/null
+++ b/hotspot/test/compiler/testlibrary/rtm/XAbortProvoker.java
@@ -0,0 +1,62 @@
+/*
+ * 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.
+ *
+ * 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 rtm;
+
+import com.oracle.java.testlibrary.Utils;
+import sun.misc.Unsafe;
+
+/**
+ * Current RTM locking implementation force transaction abort
+ * before native method call by explicit xabort(0) call.
+ */
+class XAbortProvoker extends AbortProvoker {
+    // Following field have to be static in order to avoid escape analysis.
+    @SuppressWarnings("UnsuedDeclaration")
+    private static int field = 0;
+    private static final Unsafe UNSAFE = Utils.getUnsafe();
+
+    public XAbortProvoker() {
+        this(new Object());
+    }
+
+    public XAbortProvoker(Object monitor) {
+        super(monitor);
+    }
+
+    @Override
+    public void forceAbort() {
+        synchronized(monitor) {
+            XAbortProvoker.field = UNSAFE.addressSize();
+        }
+    }
+
+    @Override
+    public String[] getMethodsToCompileNames() {
+        return new String[] {
+                getMethodWithLockName(),
+                Unsafe.class.getName() + "::addressSize"
+        };
+    }
+}
diff --git a/hotspot/test/compiler/testlibrary/rtm/predicate/SupportedCPU.java b/hotspot/test/compiler/testlibrary/rtm/predicate/SupportedCPU.java
new file mode 100644
index 0000000..c445ef7
--- /dev/null
+++ b/hotspot/test/compiler/testlibrary/rtm/predicate/SupportedCPU.java
@@ -0,0 +1,36 @@
+/*
+ * 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.
+ *
+ * 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 rtm.predicate;
+
+import sun.hotspot.cpuinfo.CPUInfo;
+
+import java.util.function.BooleanSupplier;
+
+public class SupportedCPU implements BooleanSupplier {
+    @Override
+    public boolean getAsBoolean() {
+        return CPUInfo.hasFeature("rtm");
+    }
+}
diff --git a/hotspot/test/compiler/testlibrary/rtm/predicate/SupportedVM.java b/hotspot/test/compiler/testlibrary/rtm/predicate/SupportedVM.java
new file mode 100644
index 0000000..ed1e726
--- /dev/null
+++ b/hotspot/test/compiler/testlibrary/rtm/predicate/SupportedVM.java
@@ -0,0 +1,36 @@
+/*
+ * 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.
+ *
+ * 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 rtm.predicate;
+
+import com.oracle.java.testlibrary.Platform;
+
+import java.util.function.BooleanSupplier;
+
+public class SupportedVM implements BooleanSupplier {
+    @Override
+    public boolean getAsBoolean() {
+        return Platform.isServer() && !Platform.isEmbedded();
+    }
+}
diff --git a/hotspot/test/compiler/types/correctness/CorrectnessTest.java b/hotspot/test/compiler/types/correctness/CorrectnessTest.java
new file mode 100644
index 0000000..9c84167
--- /dev/null
+++ b/hotspot/test/compiler/types/correctness/CorrectnessTest.java
@@ -0,0 +1,159 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test CorrectnessTest
+ * @bug 8038418
+ * @library /testlibrary /testlibrary/whitebox
+ * @compile execution/TypeConflict.java execution/TypeProfile.java
+ *          execution/MethodHandleDelegate.java
+ * @build CorrectnessTest
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions
+ *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
+ *                   -XX:TypeProfileLevel=222 -XX:+UseTypeSpeculation
+ *                   -XX:CompileCommand=exclude,execution/*::methodNotToCompile
+ *                   -XX:CompileCommand=dontinline,scenarios/Scenario::collectReturnType
+ *                   CorrectnessTest RETURN
+ * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions
+ *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
+ *                   -XX:TypeProfileLevel=222 -XX:+UseTypeSpeculation
+ *                   -XX:CompileCommand=exclude,execution/*::methodNotToCompile
+ *                   -XX:CompileCommand=dontinline,scenarios/Scenario::collectReturnType
+ *                   CorrectnessTest PARAMETERS
+ * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions
+ *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
+ *                   -XX:TypeProfileLevel=222 -XX:+UseTypeSpeculation
+ *                   -XX:CompileCommand=exclude,execution/*::methodNotToCompile
+ *                   -XX:CompileCommand=dontinline,scenarios/Scenario::collectReturnType
+ *                   CorrectnessTest ARGUMENTS
+ * @summary Tests correctness of type usage with type profiling and speculations
+ */
+
+import com.oracle.java.testlibrary.Asserts;
+import com.oracle.java.testlibrary.Platform;
+import execution.Execution;
+import execution.MethodHandleDelegate;
+import execution.TypeConflict;
+import execution.TypeProfile;
+import hierarchies.*;
+import scenarios.*;
+import sun.hotspot.WhiteBox;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.function.BiFunction;
+
+public class CorrectnessTest {
+    private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox();
+
+    public static void main(String[] args) {
+        if (!Platform.isServer()) {
+            System.out.println("ALL TESTS SKIPPED");
+        }
+        Asserts.assertGTE(args.length, 1);
+        ProfilingType profilingType = ProfilingType.valueOf(args[0]);
+        if (runTests(profilingType)) {
+            System.out.println("ALL TESTS PASSED");
+        } else {
+            throw new RuntimeException("SOME TESTS FAILED");
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    public static boolean runTests(ProfilingType profilingType) {
+        boolean result = true;
+
+        List<Execution> executionList = new ArrayList<>();
+        executionList.add(new TypeConflict());
+        executionList.add(new TypeProfile());
+        for (int i = 0, n = executionList.size(); i < n; i++) {
+            executionList.add(new MethodHandleDelegate(executionList.get(i)));
+        }
+
+        List<TypeHierarchy> hierarchyList = new ArrayList<>();
+        hierarchyList.add(new DefaultMethodInterface.Hierarchy());
+        hierarchyList.add(new DefaultMethodInterface2.Hierarchy());
+        hierarchyList.add(new Linear.Hierarchy());
+        hierarchyList.add(new Linear2.Hierarchy());
+        hierarchyList.add(new OneRank.Hierarchy());
+        for (int i = 0, n = hierarchyList.size(); i < n; i++) {
+            hierarchyList.add(new NullableType(hierarchyList.get(i)));
+        }
+
+        List<BiFunction<ProfilingType, TypeHierarchy, Scenario<?, ?>>> testCasesConstructors
+                = new ArrayList<>();
+        testCasesConstructors.add(ArrayCopy::new);
+        testCasesConstructors.add(ArrayReferenceStore::new);
+        testCasesConstructors.add(ClassIdentity::new);
+        testCasesConstructors.add(ClassInstanceOf::new);
+        testCasesConstructors.add(ClassIsInstance::new);
+        testCasesConstructors.add(ReceiverAtInvokes::new);
+        testCasesConstructors.add(CheckCast::new);
+
+        for (TypeHierarchy hierarchy : hierarchyList) {
+            for (BiFunction<ProfilingType, TypeHierarchy, Scenario<?, ?>> constructor : testCasesConstructors) {
+                for (Execution execution : executionList) {
+                    Scenario<?, ?> scenario = constructor.apply(profilingType, hierarchy);
+                    if (scenario.isApplicable()) {
+                        result &= executeTest(hierarchy, execution, scenario);
+                    }
+                }
+            }
+        }
+        return result;
+    }
+
+    /**
+     * Executes test case
+     *
+     * @param hierarchy type hierarchy for the test
+     * @param execution execution scenario
+     * @param scenario  test scenario executed with given Execution
+     */
+    private static boolean executeTest(TypeHierarchy hierarchy, Execution execution, Scenario<?, ?> scenario) {
+        boolean testCaseResult = false;
+        String testName = hierarchy.getClass().getName() + " :: " + scenario.getName() + " @ " + execution.getName();
+        clearAllMethodsState(scenario.getClass());
+        try {
+            execution.execute(scenario);
+            testCaseResult = true;
+        } catch (Exception e) {
+            System.err.println(testName + " failed with exception " + e);
+            e.printStackTrace();
+        }
+        System.out.println((testCaseResult ? "PASSED: " : "FAILED: ") + testName);
+        return testCaseResult;
+    }
+
+    private static void clearAllMethodsState(Class aClass) {
+        while (aClass != null) {
+            for (Method m : aClass.getDeclaredMethods()) {
+                WHITE_BOX.clearMethodState(m);
+            }
+            aClass = aClass.getSuperclass();
+        }
+    }
+}
diff --git a/hotspot/test/compiler/types/correctness/OffTest.java b/hotspot/test/compiler/types/correctness/OffTest.java
new file mode 100644
index 0000000..52bd894
--- /dev/null
+++ b/hotspot/test/compiler/types/correctness/OffTest.java
@@ -0,0 +1,108 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test CorrectnessTest
+ * @bug 8038418
+ * @library /testlibrary /testlibrary/whitebox
+ * @compile execution/TypeConflict.java execution/TypeProfile.java
+ *          execution/MethodHandleDelegate.java
+ * @build CorrectnessTest
+ * @build OffTest
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ * @run main/timeout=1200 OffTest
+ */
+
+import com.oracle.java.testlibrary.OutputAnalyzer;
+import com.oracle.java.testlibrary.ProcessTools;
+import scenarios.ProfilingType;
+
+import java.util.Random;
+
+public class OffTest {
+    private static final String[] OPTIONS = {
+            "-Xbootclasspath/a:.",
+            "-XX:+IgnoreUnrecognizedVMOptions",
+            "-XX:+UnlockExperimentalVMOptions",
+            "-XX:+UnlockDiagnosticVMOptions",
+            "-XX:+WhiteBoxAPI",
+            "-XX:CompileCommand=exclude,execution/*::methodNotToCompile",
+            "-XX:CompileCommand=dontinline,scenarios/Scenario::collectReturnType",
+            "", // -XX:TypeProfileLevel=?
+            "", // -XX:?UseTypeSpeculation
+            CorrectnessTest.class.getName(),
+            "", // ProfilingType.name()
+    };
+
+    private static final String TYPE_PROFILE_LEVEL = "TypeProfileLevel";
+    private static final String USE_TYPE_SPECULATION = "UseTypeSpeculation";
+    private static final int TYPE_PROFILE_LEVEL_LENGTH = 3;
+    private static final int TYPE_PROFILE_LEVEL_BOUND = 3;
+    private static final int DEFAULT_COUNT = 10;
+    private static final int PROFILING_TYPE_INDEX = OPTIONS.length - 1;
+    private static final int TYPE_PROFILE_INDEX = OPTIONS.length - 4;
+    private static final int USE_TYPE_SPECULATION_INDEX = OPTIONS.length - 3;
+    private static final Random RNG;
+
+    static {
+        String str = System.getProperty("seed");
+        long seed = str != null ? Long.parseLong(str) : new Random().nextLong();
+        RNG = new Random(seed);
+        System.out.printf("-Dseed=%d%n", seed);
+    }
+
+    public static void main(String[] args) throws Exception {
+        int count = DEFAULT_COUNT;
+        if (args.length > 0) {
+            count = Integer.parseInt(args[0]) ;
+        }
+        for (int i = 0; i < count; ++i) {
+            runTest();
+        }
+    }
+
+    private static void runTest() throws Exception {
+        String useTypeSpeculation = "-XX:" + (RNG.nextBoolean() ? "+" : "-") +  USE_TYPE_SPECULATION;
+        String typeProfileLevel = "-XX:" + TYPE_PROFILE_LEVEL + "=" + randomTypeProfileLevel();
+        ProfilingType type = randomProfileType();
+        OPTIONS[TYPE_PROFILE_INDEX] = typeProfileLevel;
+        OPTIONS[USE_TYPE_SPECULATION_INDEX] = useTypeSpeculation;
+        OPTIONS[PROFILING_TYPE_INDEX] = type.name();
+        ProcessBuilder processBuilder = ProcessTools.createJavaProcessBuilder(/* addTestVmOptions= */ true, OPTIONS);
+        OutputAnalyzer outputAnalyzer = new OutputAnalyzer(processBuilder.start());
+        outputAnalyzer.shouldHaveExitValue(0);
+    }
+
+    private static ProfilingType randomProfileType() {
+        ProfilingType[] value = ProfilingType.values();
+        return value[RNG.nextInt(value.length)];
+    }
+
+    private static String randomTypeProfileLevel() {
+        StringBuilder stringBuilder = new StringBuilder();
+        for (int i = 0; i < TYPE_PROFILE_LEVEL_LENGTH; ++i) {
+            stringBuilder.append(RNG.nextInt(TYPE_PROFILE_LEVEL_BOUND));
+        }
+        return stringBuilder.toString();
+    }
+}
diff --git a/hotspot/test/compiler/types/correctness/execution/Execution.java b/hotspot/test/compiler/types/correctness/execution/Execution.java
new file mode 100644
index 0000000..f0b1949
--- /dev/null
+++ b/hotspot/test/compiler/types/correctness/execution/Execution.java
@@ -0,0 +1,45 @@
+/*
+ * 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.
+ *
+ * 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 execution;
+
+import hierarchies.TypeHierarchy;
+import scenarios.Scenario;
+
+/**
+ * Execution scenario represents test methods execution type.
+ * @param <T> parameter type
+ * @param <R> result Type
+ */
+public interface Execution<T extends TypeHierarchy.I, R> {
+    /**
+     * Executes the test code of the given scenario
+     * See {@link scenarios.Scenario#run(T)}
+     *
+     * @param scenario test scenario
+     */
+    void execute(Scenario<T, R> scenario);
+
+    default String getName() {
+        return this.getClass().getName();
+    }
+}
diff --git a/hotspot/test/compiler/types/correctness/execution/MethodHandleDelegate.java b/hotspot/test/compiler/types/correctness/execution/MethodHandleDelegate.java
new file mode 100644
index 0000000..d067449
--- /dev/null
+++ b/hotspot/test/compiler/types/correctness/execution/MethodHandleDelegate.java
@@ -0,0 +1,105 @@
+/*
+ * 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.
+ *
+ * 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 execution;
+
+import hierarchies.TypeHierarchy;
+import scenarios.Scenario;
+
+import java.lang.invoke.MethodHandle;
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.MethodType;
+
+/**
+ * Executes test scenario using {@link MethodHandle#invoke(Object...)}.
+ * Delegates execution to the given {@link Execution} by creating
+ * new test scenario, see {@link Scenario}
+ */
+public class MethodHandleDelegate<T  extends TypeHierarchy.I, R> implements Execution<T, R> {
+    private final Execution<T, R> delegate;
+
+    public MethodHandleDelegate(Execution<T, R> delegate) {
+        this.delegate = delegate;
+    }
+
+    @Override
+    public void execute(Scenario<T, R> scenario) {
+        delegate.execute(new MHScenario<T, R>(scenario));
+    }
+
+    @Override
+    public String getName() {
+        return "MethodHandleDelegate # " + delegate.getName();
+    }
+
+    private static class MHScenario<T extends TypeHierarchy.I, R> extends Scenario<T, R> {
+        private final Scenario<T, R> scenario;
+        private static final MethodHandle METHOD_HANDLE_RUN;
+
+        static {
+            MethodHandles.Lookup lookup = MethodHandles.lookup();
+            MethodType methodType = MethodType.methodType(Object.class, TypeHierarchy.I.class);
+
+            try {
+                METHOD_HANDLE_RUN = lookup.findVirtual(Scenario.class, "run", methodType);
+            } catch (NoSuchMethodException | IllegalAccessException e) {
+                System.err.println("Failed to get target method run() with " + e);
+                e.printStackTrace();
+                throw new RuntimeException(e);
+            }
+        }
+
+        /**
+         * Constructor
+         *
+         * @param scenario test scenario to be executed
+         */
+        private MHScenario(Scenario<T, R> scenario) {
+            super("MethodHandle::" + scenario.getName(), scenario.profilingType, scenario.hierarchy);
+            this.scenario = scenario;
+        }
+
+        /**
+         * Runs {@link Scenario#run(T)} with {@link MethodHandle#invoke(Object...)}
+         *
+         * @param t subject of the test
+         * @return  result of the underlying {@link Scenario#run(T)} invocation
+         */
+        @SuppressWarnings("unchecked")
+        @Override
+        public R run(T t) {
+            try {
+                return (R) METHOD_HANDLE_RUN.invoke(scenario, t);
+            } catch (Throwable thr) {
+                System.err.println(scenario.getName()
+                        + " failed to invoke target method run() with " + thr);
+                throw new RuntimeException("Invocation failed", thr);
+            }
+        }
+
+        @Override
+        public void check(R r, T t) {
+            scenario.check(r, t);
+        }
+    }
+}
diff --git a/hotspot/test/compiler/types/correctness/execution/TypeConflict.java b/hotspot/test/compiler/types/correctness/execution/TypeConflict.java
new file mode 100644
index 0000000..a171504
--- /dev/null
+++ b/hotspot/test/compiler/types/correctness/execution/TypeConflict.java
@@ -0,0 +1,74 @@
+/*
+ * 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.
+ *
+ * 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 execution;
+
+import hierarchies.TypeHierarchy;
+import scenarios.Scenario;
+
+/**
+ *  Type profiling conflict execution scenario. The main goal is
+ *  to make compiler profile and compile methods with different types.
+ *  Scenario tests guards by passing conflicting types (incompatible
+ *  for the profiled data).
+ */
+public class TypeConflict<T extends TypeHierarchy.I, R> implements Execution<T, R> {
+    /** Test methods execution number to make profile  */
+    private final static int POLLUTION_THRESHOLD = 5000;
+    /** Test methods execution number to make it profiled and compiled*/
+    private final static int PROFILE_THRESHOLD = 20000;
+
+    @Override
+    public void execute(Scenario<T, R> scenario) {
+        T base = scenario.getProfiled();
+        T incompatible = scenario.getConflict();
+
+        // pollute profile by passing different types
+        R baseResult = null;
+        R incResult = null;
+        for (int i = 0; i < POLLUTION_THRESHOLD; i++) {
+            baseResult = methodNotToCompile(scenario, base);
+            incResult = methodNotToCompile(scenario, incompatible);
+        }
+        scenario.check(baseResult, base);
+        scenario.check(incResult, incompatible);
+
+        // profile and compile
+        R result = null;
+        for (int i = 0; i < PROFILE_THRESHOLD; i++) {
+            result = methodNotToCompile(scenario, base);
+        }
+        scenario.check(result, base);
+
+        // pass another type to make guard work and recompile
+        for (int i = 0; i < PROFILE_THRESHOLD; i++) {
+            result = methodNotToCompile(scenario, incompatible);
+        }
+        scenario.check(result, incompatible);
+    }
+
+    private R methodNotToCompile(Scenario<T, R> scenario, T t) {
+        return scenario.run(t);
+    }
+}
+
diff --git a/hotspot/test/compiler/types/correctness/execution/TypeProfile.java b/hotspot/test/compiler/types/correctness/execution/TypeProfile.java
new file mode 100644
index 0000000..446fdb8
--- /dev/null
+++ b/hotspot/test/compiler/types/correctness/execution/TypeProfile.java
@@ -0,0 +1,59 @@
+/*
+ * 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.
+ *
+ * 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 execution;
+
+import hierarchies.TypeHierarchy;
+import scenarios.Scenario;
+
+/**
+ * Profile type execution scenario. Executes tester method
+ * in a loop without any manipulation with types or instances.
+ */
+public class TypeProfile<T extends TypeHierarchy.I, R> implements Execution<T, R> {
+    /** Number of test method execution to make it profiled and compiled */
+    private final static int PROFILE_THRESHOLD = 100000;
+
+    /**
+     * Makes scenario code be profiled and compiled
+     * @param scenario Test scenario
+     */
+    @Override
+    public void execute(Scenario<T, R> scenario) {
+        R result = null;
+        T prof = scenario.getProfiled();
+        T confl = scenario.getConflict();
+
+        for (int i = 0; i < PROFILE_THRESHOLD; i++) {
+            result = methodNotToCompile(scenario, prof);
+        }
+        scenario.check(result, prof);
+
+        result = methodNotToCompile(scenario, confl);
+        scenario.check(result, confl);
+    }
+
+    protected R methodNotToCompile(Scenario<T, R> scenario, T t) {
+        return scenario.run(t);
+    }
+}
diff --git a/hotspot/test/compiler/types/correctness/hierarchies/DefaultMethodInterface.java b/hotspot/test/compiler/types/correctness/hierarchies/DefaultMethodInterface.java
new file mode 100644
index 0000000..bad66a0
--- /dev/null
+++ b/hotspot/test/compiler/types/correctness/hierarchies/DefaultMethodInterface.java
@@ -0,0 +1,54 @@
+/*
+ * 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.
+ *
+ * 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 hierarchies;
+
+public class DefaultMethodInterface {
+    private DefaultMethodInterface() {
+    }
+
+    public static class Hierarchy
+            extends TypeHierarchy<DefaultMethodInterface.A, DefaultMethodInterface.B> {
+        public Hierarchy() {
+            super(new DefaultMethodInterface.A(), new DefaultMethodInterface.B(),
+                    DefaultMethodInterface.A.class, DefaultMethodInterface.B.class);
+        }
+    }
+
+    public static interface I2 extends TypeHierarchy.I {
+        default int m() {
+            return TypeHierarchy.ANSWER;
+        }
+    }
+
+    public static class A implements I2 {
+        // use default method from I2
+    }
+
+    public static class B extends A {
+        @Override
+        public int m() {
+            return TypeHierarchy.YEAR;
+        }
+    }
+}
diff --git a/hotspot/test/compiler/types/correctness/hierarchies/DefaultMethodInterface2.java b/hotspot/test/compiler/types/correctness/hierarchies/DefaultMethodInterface2.java
new file mode 100644
index 0000000..05c0ded
--- /dev/null
+++ b/hotspot/test/compiler/types/correctness/hierarchies/DefaultMethodInterface2.java
@@ -0,0 +1,47 @@
+/*
+ * 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.
+ *
+ * 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 hierarchies;
+
+public class DefaultMethodInterface2 {
+    private DefaultMethodInterface2() {
+    }
+
+    public static class Hierarchy
+            extends TypeHierarchy<TypeHierarchy.A, DefaultMethodInterface2.B> {
+        public Hierarchy() {
+            super(new TypeHierarchy.A(), new DefaultMethodInterface2.B(),
+                    TypeHierarchy.A.class, DefaultMethodInterface2.B.class);
+        }
+    }
+
+    public static interface I2 extends TypeHierarchy.I {
+        default int m() {
+            return TypeHierarchy.ANSWER;
+        }
+    }
+
+    public static class B implements I2 {
+        // default method I2.m()
+    }
+}
diff --git a/hotspot/test/compiler/types/correctness/hierarchies/Linear.java b/hotspot/test/compiler/types/correctness/hierarchies/Linear.java
new file mode 100644
index 0000000..85927ef
--- /dev/null
+++ b/hotspot/test/compiler/types/correctness/hierarchies/Linear.java
@@ -0,0 +1,43 @@
+/*
+ * 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.
+ *
+ * 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 hierarchies;
+
+public class Linear {
+    private Linear() {
+    }
+
+    public static class Hierarchy extends TypeHierarchy<TypeHierarchy.A, Linear.B> {
+        public Hierarchy() {
+            super(new TypeHierarchy.A(), new Linear.B(),
+                    TypeHierarchy.A.class, Linear.B.class);
+        }
+    }
+
+    public static class B extends TypeHierarchy.A {
+        @Override
+        public int m() {
+            return TypeHierarchy.YEAR;
+        }
+    }
+}
diff --git a/hotspot/test/compiler/types/correctness/hierarchies/Linear2.java b/hotspot/test/compiler/types/correctness/hierarchies/Linear2.java
new file mode 100644
index 0000000..a5df9b9
--- /dev/null
+++ b/hotspot/test/compiler/types/correctness/hierarchies/Linear2.java
@@ -0,0 +1,47 @@
+/*
+ * 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.
+ *
+ * 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 hierarchies;
+
+public class Linear2 {
+    private Linear2() {
+    }
+
+    public static class Hierarchy extends TypeHierarchy<TypeHierarchy.A, Linear2.B> {
+        public Hierarchy() {
+            super(new A(), new Linear2.B(),
+                    A.class, Linear2.B.class);
+        }
+    }
+
+    public static interface I2 {
+        int m();
+    }
+
+    public static class B extends TypeHierarchy.A implements Linear2.I2 {
+        @Override
+        public int m() {
+            return TypeHierarchy.YEAR;
+        }
+    }
+}
diff --git a/hotspot/test/compiler/types/correctness/hierarchies/NullableType.java b/hotspot/test/compiler/types/correctness/hierarchies/NullableType.java
new file mode 100644
index 0000000..409a7c8
--- /dev/null
+++ b/hotspot/test/compiler/types/correctness/hierarchies/NullableType.java
@@ -0,0 +1,33 @@
+/*
+ * 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.
+ *
+ * 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 hierarchies;
+
+public class NullableType<M extends TypeHierarchy.I, N extends TypeHierarchy.I>
+        extends TypeHierarchy<M, N> {
+
+    public NullableType(TypeHierarchy<M, N> delegate) {
+        super(delegate.getM(), null,
+                delegate.getClassM(), delegate.getClassN());
+    }
+}
diff --git a/hotspot/test/compiler/types/correctness/hierarchies/OneRank.java b/hotspot/test/compiler/types/correctness/hierarchies/OneRank.java
new file mode 100644
index 0000000..4dcba0f
--- /dev/null
+++ b/hotspot/test/compiler/types/correctness/hierarchies/OneRank.java
@@ -0,0 +1,44 @@
+/*
+ * 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.
+ *
+ * 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 hierarchies;
+
+public class OneRank {
+    private OneRank() {
+    }
+
+    public static class Hierarchy extends TypeHierarchy<TypeHierarchy.A, OneRank.B> {
+        public Hierarchy() {
+            super(new TypeHierarchy.A(), new OneRank.B(),
+                    TypeHierarchy.A.class, OneRank.B.class);
+        }
+    }
+
+    public static class B implements TypeHierarchy.I {
+        @Override
+        public int m() {
+            return TypeHierarchy.YEAR;
+        }
+    }
+
+}
diff --git a/hotspot/test/compiler/types/correctness/hierarchies/TypeHierarchy.java b/hotspot/test/compiler/types/correctness/hierarchies/TypeHierarchy.java
new file mode 100644
index 0000000..91e168b
--- /dev/null
+++ b/hotspot/test/compiler/types/correctness/hierarchies/TypeHierarchy.java
@@ -0,0 +1,73 @@
+/*
+ * 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.
+ *
+ * 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 hierarchies;
+
+/**
+ * Type hierarchy contains classes the type profiling and speculation are tested with
+ */
+public abstract class TypeHierarchy<M extends TypeHierarchy.I, N extends TypeHierarchy.I> {
+    // Magic numbers
+    public static final int ANSWER = 42;
+    public static final int TEMP = 451;
+    public static final int YEAR = 1984;
+
+    private final M m;
+    private final N n;
+    private final Class<M> classM;
+    private final Class<N> classN;
+
+    protected TypeHierarchy(M m, N n, Class<M> classM, Class<N> classN) {
+        this.m = m;
+        this.n = n;
+        this.classM = classM;
+        this.classN = classN;
+    }
+
+    public final M getM() {
+        return m;
+    }
+
+    public final N getN() {
+        return n;
+    }
+
+    public final Class<M> getClassM() {
+        return classM;
+    }
+
+    public final Class<N> getClassN() {
+        return classN;
+    }
+
+    public interface I {
+        int m();
+    }
+
+    public static class A implements I {
+        @Override
+        public int m() {
+            return TypeHierarchy.ANSWER;
+        }
+    }
+}
diff --git a/hotspot/test/compiler/types/correctness/scenarios/ArrayCopy.java b/hotspot/test/compiler/types/correctness/scenarios/ArrayCopy.java
new file mode 100644
index 0000000..3f51162
--- /dev/null
+++ b/hotspot/test/compiler/types/correctness/scenarios/ArrayCopy.java
@@ -0,0 +1,63 @@
+/*
+ * 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.
+ *
+ * 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 scenarios;
+
+import hierarchies.TypeHierarchy;
+
+import java.util.Arrays;
+
+/**
+ * Tests System.arraycopy()
+ */
+public class ArrayCopy extends ArrayScenario {
+    public ArrayCopy(ProfilingType profilingType,
+                     TypeHierarchy<? extends TypeHierarchy.I, ? extends TypeHierarchy.I> hierarchy) {
+        super("ArrayCopy", profilingType, hierarchy);
+    }
+
+    /**
+     * @param obj is used to fill arrays
+     * @return the same obj
+     */
+    @Override
+    public TypeHierarchy.I run(TypeHierarchy.I obj) {
+        switch (profilingType) {
+            case RETURN:
+                TypeHierarchy.I t = collectReturnType(obj);
+                Arrays.fill(array, t);
+                System.arraycopy(array, 0, matrix[0], 0, array.length);
+                return array[0];
+            case ARGUMENTS:
+                field = obj;
+                Arrays.fill(array, field);
+                System.arraycopy(array, 0, matrix[0], 0, array.length);
+                return array[0];
+            case PARAMETERS:
+                Arrays.fill(array, obj);
+                System.arraycopy(array, 0, matrix[0], 0, array.length);
+                return array[0];
+        }
+        throw new RuntimeException("Should not reach here");
+    }
+}
diff --git a/hotspot/test/compiler/types/correctness/scenarios/ArrayReferenceStore.java b/hotspot/test/compiler/types/correctness/scenarios/ArrayReferenceStore.java
new file mode 100644
index 0000000..f63e47e
--- /dev/null
+++ b/hotspot/test/compiler/types/correctness/scenarios/ArrayReferenceStore.java
@@ -0,0 +1,63 @@
+/*
+ * 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.
+ *
+ * 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 scenarios;
+
+import hierarchies.TypeHierarchy;
+
+import java.util.Arrays;
+
+/**
+ * Tests aastore bytecode
+ */
+public class ArrayReferenceStore extends ArrayScenario {
+    public ArrayReferenceStore(ProfilingType profilingType,
+                               TypeHierarchy<? extends TypeHierarchy.I, ? extends TypeHierarchy.I> hierarchy) {
+        super("ArrayReferenceStore", profilingType, hierarchy);
+    }
+
+    /**
+     * @param obj is used to fill arrays
+     * @return obj
+     */
+    @Override
+    public TypeHierarchy.I run(TypeHierarchy.I obj) {
+        switch (profilingType) {
+            case RETURN:
+                TypeHierarchy.I t = collectReturnType(obj);
+                Arrays.fill(array, t);
+                matrix[0] = array;
+                return matrix[0][0];
+            case ARGUMENTS:
+                field = obj;
+                Arrays.fill(array, field);
+                matrix[0] = array;
+                return matrix[0][0];
+            case PARAMETERS:
+                Arrays.fill(array, obj);
+                matrix[0] = array;
+                return matrix[0][0];
+        }
+        throw new RuntimeException("Should not reach here");
+    }
+}
diff --git a/hotspot/test/compiler/types/correctness/scenarios/ArrayScenario.java b/hotspot/test/compiler/types/correctness/scenarios/ArrayScenario.java
new file mode 100644
index 0000000..bc6f537
--- /dev/null
+++ b/hotspot/test/compiler/types/correctness/scenarios/ArrayScenario.java
@@ -0,0 +1,68 @@
+/*
+ * 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.
+ *
+ * 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 scenarios;
+
+import com.oracle.java.testlibrary.Asserts;
+import hierarchies.TypeHierarchy;
+
+import java.lang.reflect.Array;
+import java.util.Arrays;
+
+/**
+ *  Base class for array scenarios
+ */
+public abstract class ArrayScenario extends Scenario<TypeHierarchy.I, TypeHierarchy.I> {
+    protected final TypeHierarchy.I[] array;
+    protected final TypeHierarchy.I[][] matrix;
+
+    protected ArrayScenario(String name, ProfilingType profilingType,
+                            TypeHierarchy<? extends TypeHierarchy.I, ? extends TypeHierarchy.I> hierarchy) {
+        super(name, profilingType, hierarchy);
+        final int x = 20;
+        final int y = 10;
+
+        TypeHierarchy.I prof = hierarchy.getM();
+        TypeHierarchy.I confl = hierarchy.getN();
+
+        this.array = (TypeHierarchy.I[]) Array.newInstance(hierarchy.getClassM(), y);
+        Arrays.fill(array, prof);
+
+        this.matrix = (TypeHierarchy.I[][]) Array.newInstance(hierarchy.getClassM(), x, y);
+        for (int i = 0; i < x; i++) {
+            this.matrix[i] = this.array;
+        }
+
+        Asserts.assertEquals(array.length, matrix[0].length, "Invariant");
+    }
+
+    @Override
+    public boolean isApplicable() {
+        return hierarchy.getClassM().isAssignableFrom(hierarchy.getClassN());
+    }
+
+    @Override
+    public void check(TypeHierarchy.I res, TypeHierarchy.I orig) {
+        Asserts.assertEquals(res, orig, "Check failed");
+    }
+}
diff --git a/hotspot/test/compiler/types/correctness/scenarios/CheckCast.java b/hotspot/test/compiler/types/correctness/scenarios/CheckCast.java
new file mode 100644
index 0000000..eeaf0f7
--- /dev/null
+++ b/hotspot/test/compiler/types/correctness/scenarios/CheckCast.java
@@ -0,0 +1,77 @@
+/*
+ * 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.
+ *
+ * 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 scenarios;
+
+import com.oracle.java.testlibrary.Asserts;
+import hierarchies.TypeHierarchy;
+
+import java.util.Objects;
+
+/**
+ * Checkcast scenario
+ * @param <T> profiling parameter
+ */
+public class CheckCast<T extends TypeHierarchy.I> extends Scenario<T, Integer> {
+    public CheckCast(ProfilingType profilingType, TypeHierarchy<? extends T, ? extends T> hierarchy) {
+        super("CheckCast", profilingType, hierarchy);
+    }
+
+    /**
+     * Returns type profiling.
+     * @param obj is a profiled parameter for the test
+     * @return parameter casted to the type R
+     */
+    @Override
+    public Integer run(T obj) {
+        switch (profilingType) {
+            case RETURN:
+                T t = collectReturnType(obj);
+                if (t != null) {
+                    return t.m();
+                }
+                return null;
+            case ARGUMENTS:
+                field = obj;
+                if (field != null) {
+                    return field.m();
+                }
+                return null;
+            case PARAMETERS:
+                if (obj != null) {
+                    return obj.m();
+                }
+                return null;
+        }
+        throw new RuntimeException("Should not reach here");
+    }
+
+    @Override
+    public void check(Integer result, T orig) {
+        if (result != null || orig != null) {
+            Objects.requireNonNull(result);
+            Objects.requireNonNull(orig);
+            Asserts.assertEquals(result, orig.m(), "Results mismatch");
+        }
+    }
+}
diff --git a/hotspot/test/compiler/types/correctness/scenarios/ClassIdentity.java b/hotspot/test/compiler/types/correctness/scenarios/ClassIdentity.java
new file mode 100644
index 0000000..e4be5c9
--- /dev/null
+++ b/hotspot/test/compiler/types/correctness/scenarios/ClassIdentity.java
@@ -0,0 +1,80 @@
+/*
+ * 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.
+ *
+ * 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 scenarios;
+
+import com.oracle.java.testlibrary.Asserts;
+import hierarchies.TypeHierarchy;
+
+/**
+ * Tests pattern: if (a.getClass() == D.class)
+ */
+public class ClassIdentity<T extends TypeHierarchy.I> extends Scenario<T, Integer> {
+    public ClassIdentity(ProfilingType profilingType,
+                         TypeHierarchy<? extends T, ? extends T> hierarchy) {
+        super("ClassIdentity", profilingType, hierarchy);
+    }
+
+    @Override
+    public boolean isApplicable() {
+        return hierarchy.getM() != null && hierarchy.getN() != null;
+    }
+
+    @Override
+    public Integer run(T obj) {
+        switch (profilingType) {
+            case RETURN:
+                T t = collectReturnType(obj);
+                if (t.getClass() == TypeHierarchy.A.class) {
+                    return inlinee(t);
+                }
+                return TypeHierarchy.TEMP;
+            case ARGUMENTS:
+                field = obj;
+                if (field.getClass() == TypeHierarchy.A.class) {
+                    return inlinee(field);
+                }
+                return TypeHierarchy.TEMP;
+            case PARAMETERS:
+                if (obj.getClass() == TypeHierarchy.A.class) {
+                    return inlinee(obj);
+                }
+                return TypeHierarchy.TEMP;
+        }
+        throw new RuntimeException("Should not reach here");
+    }
+
+    public int inlinee(T obj) {
+        return obj.m();
+    }
+
+    @Override
+    public void check(Integer result, T orig) {
+        if (orig.getClass() == TypeHierarchy.A.class) {
+            Asserts.assertEquals(result, orig.m(),
+                    "Results are not equal for TypeHierarchy.A.class");
+        } else {
+            Asserts.assertEquals(result, TypeHierarchy.TEMP, "Result differs from expected");
+        }
+    }
+}
diff --git a/hotspot/test/compiler/types/correctness/scenarios/ClassInstanceOf.java b/hotspot/test/compiler/types/correctness/scenarios/ClassInstanceOf.java
new file mode 100644
index 0000000..8686c1b
--- /dev/null
+++ b/hotspot/test/compiler/types/correctness/scenarios/ClassInstanceOf.java
@@ -0,0 +1,74 @@
+/*
+ * 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.
+ *
+ * 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 scenarios;
+
+import com.oracle.java.testlibrary.Asserts;
+import hierarchies.TypeHierarchy;
+
+/**
+ * Tests instanceof
+ */
+public class ClassInstanceOf<T extends TypeHierarchy.I> extends Scenario<T, Integer> {
+    public ClassInstanceOf(ProfilingType profilingType,
+                           TypeHierarchy<? extends T, ? extends T> hierarchy) {
+        super("ClassInstanceOf", profilingType, hierarchy);
+    }
+
+    @Override
+    public Integer run(T obj) {
+        switch (profilingType) {
+            case RETURN:
+                T t = collectReturnType(obj);
+                if (t instanceof TypeHierarchy.A) {
+                    return inlinee(t);
+                }
+                return TypeHierarchy.TEMP;
+            case ARGUMENTS:
+                field = obj;
+                if (field instanceof TypeHierarchy.A) {
+                    return inlinee(field);
+                }
+                return TypeHierarchy.TEMP;
+            case PARAMETERS:
+                if (obj instanceof TypeHierarchy.A) {
+                    return inlinee(obj);
+                }
+                return TypeHierarchy.TEMP;
+        }
+        throw new RuntimeException("Should not reach here");
+    }
+
+    public int inlinee(T obj) {
+        return obj.m();
+    }
+
+    @Override
+    public void check(Integer result, T orig) {
+        if (orig instanceof TypeHierarchy.A) {
+            Asserts.assertEquals(result, orig.m(), "Results are not equal for TypeHierarchy.A");
+        } else {
+            Asserts.assertEquals(result, TypeHierarchy.TEMP, "Result differs from expected");
+        }
+    }
+}
diff --git a/hotspot/test/compiler/types/correctness/scenarios/ClassIsInstance.java b/hotspot/test/compiler/types/correctness/scenarios/ClassIsInstance.java
new file mode 100644
index 0000000..c6e85d3
--- /dev/null
+++ b/hotspot/test/compiler/types/correctness/scenarios/ClassIsInstance.java
@@ -0,0 +1,77 @@
+/*
+ * 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.
+ *
+ * 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 scenarios;
+
+import com.oracle.java.testlibrary.Asserts;
+import hierarchies.TypeHierarchy;
+
+/**
+ * Tests {@link Class#isInstance(Object)}
+ */
+public class ClassIsInstance<T extends TypeHierarchy.I> extends Scenario<T, Integer> {
+    private final Class<?> baseClass;
+
+    public ClassIsInstance(ProfilingType profilingType,
+                           TypeHierarchy<? extends T, ? extends T> hierarchy) {
+        super("ClassIsInstance", profilingType, hierarchy);
+        this.baseClass = hierarchy.getClassM();
+    }
+
+    @Override
+    public Integer run(T obj) {
+        switch (profilingType) {
+            case RETURN:
+                T t = collectReturnType(obj);
+                if (baseClass.isInstance(t)) {
+                    return inlinee(t);
+                }
+                return TypeHierarchy.TEMP;
+            case ARGUMENTS:
+                field = obj;
+                if (baseClass.isInstance(field)) {
+                    return inlinee(field);
+                }
+                return TypeHierarchy.TEMP;
+            case PARAMETERS:
+                if (baseClass.isInstance(obj)) {
+                    return inlinee(obj);
+                }
+                return TypeHierarchy.TEMP;
+        }
+        throw new RuntimeException("Should not reach here");
+    }
+
+    public int inlinee(T obj) {
+        return obj.m();
+    }
+
+    @Override
+    public void check(Integer result, T orig) {
+        if (baseClass.isInstance(orig)) {
+            Asserts.assertEquals(result, orig.m(), "Results are not equal for base class");
+        } else {
+            Asserts.assertEquals(result, TypeHierarchy.TEMP, "Result differs from expected");
+        }
+    }
+}
diff --git a/hotspot/test/compiler/types/correctness/scenarios/ProfilingType.java b/hotspot/test/compiler/types/correctness/scenarios/ProfilingType.java
new file mode 100644
index 0000000..449fb16
--- /dev/null
+++ b/hotspot/test/compiler/types/correctness/scenarios/ProfilingType.java
@@ -0,0 +1,33 @@
+/*
+ * 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.
+ *
+ * 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 scenarios;
+
+public enum ProfilingType {
+    /** type profiling of return values of reference types from an invoke */
+    RETURN,
+    /** type profiling for reference parameters on method entries */
+    PARAMETERS,
+    /** type profiling for reference arguments at an invoke */
+    ARGUMENTS,
+}
diff --git a/hotspot/test/compiler/types/correctness/scenarios/ReceiverAtInvokes.java b/hotspot/test/compiler/types/correctness/scenarios/ReceiverAtInvokes.java
new file mode 100644
index 0000000..68afb8d
--- /dev/null
+++ b/hotspot/test/compiler/types/correctness/scenarios/ReceiverAtInvokes.java
@@ -0,0 +1,74 @@
+/*
+ * 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.
+ *
+ * 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 scenarios;
+
+import com.oracle.java.testlibrary.Asserts;
+import hierarchies.TypeHierarchy;
+
+/**
+ * Receiver at invokes profiling and speculation
+ *
+ * @param <T> parameter to be returned
+ */
+public class ReceiverAtInvokes<T extends TypeHierarchy.I> extends Scenario<T, Integer> {
+    public ReceiverAtInvokes(ProfilingType profilingType,
+                             TypeHierarchy<? extends T, ? extends T> hierarchy) {
+        super("ReceiverAtInvokes", profilingType, hierarchy);
+    }
+
+    @Override
+    public boolean isApplicable() {
+        return hierarchy.getM() != null && hierarchy.getN() != null;
+    }
+
+    /**
+     * Receiver profiling
+     *
+     * @param obj is a profiled parameter for the test
+     * @return parameter casted to the type R
+     */
+    @Override
+    public Integer run(T obj) {
+        switch (profilingType) {
+            case RETURN:
+                T t = collectReturnType(obj);
+                return inlinee(t);
+            case ARGUMENTS:
+                field = obj;
+                return inlinee(field);
+            case PARAMETERS:
+                return inlinee(obj);
+        }
+        throw new RuntimeException("Should not reach here");
+    }
+
+    private Integer inlinee(T obj) {
+        return obj.m(); // should be inlined
+    }
+
+    @Override
+    public void check(Integer result, T orig) {
+        Asserts.assertEquals(result, orig.m(), "Results mismatch");
+    }
+}
diff --git a/hotspot/test/compiler/types/correctness/scenarios/Scenario.java b/hotspot/test/compiler/types/correctness/scenarios/Scenario.java
new file mode 100644
index 0000000..4867920
--- /dev/null
+++ b/hotspot/test/compiler/types/correctness/scenarios/Scenario.java
@@ -0,0 +1,108 @@
+/*
+ * 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.
+ *
+ * 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 scenarios;
+
+import hierarchies.TypeHierarchy;
+
+/**
+ * Test scenario
+ *
+ * @param <T> parameter type
+ * @param <R> result type
+ */
+public abstract class Scenario<T extends TypeHierarchy.I, R> {
+
+    private final String name;
+    public final ProfilingType profilingType;
+    public final TypeHierarchy <? extends T, ? extends T> hierarchy;
+    protected volatile T field;
+
+    /**
+     * Constructor
+     *
+     * @param name          scenario name
+     * @param profilingType tested profiling type
+     * @param hierarchy     type hierarchy
+     */
+    protected Scenario(String name, ProfilingType profilingType,
+                       TypeHierarchy<? extends T, ? extends T> hierarchy) {
+        this.profilingType = profilingType;
+        this.name = name + " # " + profilingType.name();
+        this.hierarchy = hierarchy;
+    }
+
+    /**
+     * Returns the object which should be used as a parameter
+     * for the methods used for profile data
+     *
+     * @return profiled type object
+     */
+    public T getProfiled() {
+        return hierarchy.getM();
+    }
+
+    /**
+     * Returns the object which makes a conflict for a profiled data
+     * when passed instead of {@linkplain Scenario#getProfiled}
+     *
+     * @return incompatible to profiled object
+     */
+    public T getConflict() {
+        return hierarchy.getN();
+    }
+
+    /**
+     * @return scenario name
+     */
+    public String getName() {
+        return name;
+    }
+
+    /** Is this scenario applicable for a hierarchy it was constructed with */
+    public boolean isApplicable() {
+        return true;
+    }
+
+    /**
+     * Runs test scenario
+     *
+     * @param t subject of the test
+     * @return  result of the test invocation
+     */
+    public abstract R run(T t);
+
+    /** Used for a return type profiling */
+    protected final T collectReturnType(T t) {
+        return t;
+    }
+
+    /**
+     * Checks the result for R and T
+     *
+     * @param r result
+     * @param t original
+     * @throws java.lang.RuntimeException on result mismatch
+     */
+    public abstract void check(R r, T t);
+}
diff --git a/hotspot/test/compiler/uncommontrap/TestStackBangMonitorOwned.java b/hotspot/test/compiler/uncommontrap/TestStackBangMonitorOwned.java
new file mode 100644
index 0000000..3d93d7d
--- /dev/null
+++ b/hotspot/test/compiler/uncommontrap/TestStackBangMonitorOwned.java
@@ -0,0 +1,268 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8032410
+ * @summary Stack overflow at deoptimization doesn't release owned monitors
+ * @run main/othervm -XX:-BackgroundCompilation -XX:CompileCommand=dontinline,TestStackBangMonitorOwned::m1 -XX:CompileCommand=exclude,TestStackBangMonitorOwned::m2 -Xss256K -XX:-UseOnStackReplacement TestStackBangMonitorOwned
+ *
+ */
+public class TestStackBangMonitorOwned {
+
+    static class UnloadedClass1 {
+        volatile int field;
+    }
+
+    static Object m1(boolean deopt) {
+        long l0, l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11, l12,
+        l13, l14, l15, l16, l17, l18, l19, l20, l21, l22, l23, l24,
+        l25, l26, l27, l28, l29, l30, l31, l32, l33, l34, l35, l36,
+        l37, l38, l39, l40, l41, l42, l43, l44, l45, l46, l47, l48,
+        l49, l50, l51, l52, l53, l54, l55, l56, l57, l58, l59, l60,
+        l61, l62, l63, l64, l65, l66, l67, l68, l69, l70, l71, l72,
+        l73, l74, l75, l76, l77, l78, l79, l80, l81, l82, l83, l84,
+        l85, l86, l87, l88, l89, l90, l91, l92, l93, l94, l95, l96,
+        l97, l98, l99, l100, l101, l102, l103, l104, l105, l106, l107,
+        l108, l109, l110, l111, l112, l113, l114, l115, l116, l117,
+        l118, l119, l120, l121, l122, l123, l124, l125, l126, l127,
+        l128, l129, l130, l131, l132, l133, l134, l135, l136, l137,
+        l138, l139, l140, l141, l142, l143, l144, l145, l146, l147,
+        l148, l149, l150, l151, l152, l153, l154, l155, l156, l157,
+        l158, l159, l160, l161, l162, l163, l164, l165, l166, l167,
+        l168, l169, l170, l171, l172, l173, l174, l175, l176, l177,
+        l178, l179, l180, l181, l182, l183, l184, l185, l186, l187,
+        l188, l189, l190, l191, l192, l193, l194, l195, l196, l197,
+        l198, l199, l200, l201, l202, l203, l204, l205, l206, l207,
+        l208, l209, l210, l211, l212, l213, l214, l215, l216, l217,
+        l218, l219, l220, l221, l222, l223, l224, l225, l226, l227,
+        l228, l229, l230, l231, l232, l233, l234, l235, l236, l237,
+        l238, l239, l240, l241, l242, l243, l244, l245, l246, l247,
+        l248, l249, l250, l251, l252, l253, l254, l255, l256, l257,
+        l258, l259, l260, l261, l262, l263, l264, l265, l266, l267,
+        l268, l269, l270, l271, l272, l273, l274, l275, l276, l277,
+        l278, l279, l280, l281, l282, l283, l284, l285, l286, l287,
+        l288, l289, l290, l291, l292, l293, l294, l295, l296, l297,
+        l298, l299, l300, l301, l302, l303, l304, l305, l306, l307,
+        l308, l309, l310, l311, l312, l313, l314, l315, l316, l317,
+        l318, l319, l320, l321, l322, l323, l324, l325, l326, l327,
+        l328, l329, l330, l331, l332, l333, l334, l335, l336, l337,
+        l338, l339, l340, l341, l342, l343, l344, l345, l346, l347,
+        l348, l349, l350, l351, l352, l353, l354, l355, l356, l357,
+        l358, l359, l360, l361, l362, l363, l364, l365, l366, l367,
+        l368, l369, l370, l371, l372, l373, l374, l375, l376, l377,
+        l378, l379, l380, l381, l382, l383, l384, l385, l386, l387,
+        l388, l389, l390, l391, l392, l393, l394, l395, l396, l397,
+        l398, l399, l400, l401, l402, l403, l404, l405, l406, l407,
+        l408, l409, l410, l411, l412, l413, l414, l415, l416, l417,
+        l418, l419, l420, l421, l422, l423, l424, l425, l426, l427,
+        l428, l429, l430, l431, l432, l433, l434, l435, l436, l437,
+        l438, l439, l440, l441, l442, l443, l444, l445, l446, l447,
+        l448, l449, l450, l451, l452, l453, l454, l455, l456, l457,
+        l458, l459, l460, l461, l462, l463, l464, l465, l466, l467,
+        l468, l469, l470, l471, l472, l473, l474, l475, l476, l477,
+        l478, l479, l480, l481, l482, l483, l484, l485, l486, l487,
+        l488, l489, l490, l491, l492, l493, l494, l495, l496, l497,
+        l498, l499, l500, l501, l502, l503, l504, l505, l506, l507,
+        l508, l509, l510, l511;
+
+        long ll0, ll1, ll2, ll3, ll4, ll5, ll6, ll7, ll8, ll9, ll10, ll11, ll12,
+        ll13, ll14, ll15, ll16, ll17, ll18, ll19, ll20, ll21, ll22, ll23, ll24,
+        ll25, ll26, ll27, ll28, ll29, ll30, ll31, ll32, ll33, ll34, ll35, ll36,
+        ll37, ll38, ll39, ll40, ll41, ll42, ll43, ll44, ll45, ll46, ll47, ll48,
+        ll49, ll50, ll51, ll52, ll53, ll54, ll55, ll56, ll57, ll58, ll59, ll60,
+        ll61, ll62, ll63, ll64, ll65, ll66, ll67, ll68, ll69, ll70, ll71, ll72,
+        ll73, ll74, ll75, ll76, ll77, ll78, ll79, ll80, ll81, ll82, ll83, ll84,
+        ll85, ll86, ll87, ll88, ll89, ll90, ll91, ll92, ll93, ll94, ll95, ll96,
+        ll97, ll98, ll99, ll100, ll101, ll102, ll103, ll104, ll105, ll106, ll107,
+        ll108, ll109, ll110, ll111, ll112, ll113, ll114, ll115, ll116, ll117,
+        ll118, ll119, ll120, ll121, ll122, ll123, ll124, ll125, ll126, ll127,
+        ll128, ll129, ll130, ll131, ll132, ll133, ll134, ll135, ll136, ll137,
+        ll138, ll139, ll140, ll141, ll142, ll143, ll144, ll145, ll146, ll147,
+        ll148, ll149, ll150, ll151, ll152, ll153, ll154, ll155, ll156, ll157,
+        ll158, ll159, ll160, ll161, ll162, ll163, ll164, ll165, ll166, ll167,
+        ll168, ll169, ll170, ll171, ll172, ll173, ll174, ll175, ll176, ll177,
+        ll178, ll179, ll180, ll181, ll182, ll183, ll184, ll185, ll186, ll187,
+        ll188, ll189, ll190, ll191, ll192, ll193, ll194, ll195, ll196, ll197,
+        ll198, ll199, ll200, ll201, ll202, ll203, ll204, ll205, ll206, ll207,
+        ll208, ll209, ll210, ll211, ll212, ll213, ll214, ll215, ll216, ll217,
+        ll218, ll219, ll220, ll221, ll222, ll223, ll224, ll225, ll226, ll227,
+        ll228, ll229, ll230, ll231, ll232, ll233, ll234, ll235, ll236, ll237,
+        ll238, ll239, ll240, ll241, ll242, ll243, ll244, ll245, ll246, ll247,
+        ll248, ll249, ll250, ll251, ll252, ll253, ll254, ll255, ll256, ll257,
+        ll258, ll259, ll260, ll261, ll262, ll263, ll264, ll265, ll266, ll267,
+        ll268, ll269, ll270, ll271, ll272, ll273, ll274, ll275, ll276, ll277,
+        ll278, ll279, ll280, ll281, ll282, ll283, ll284, ll285, ll286, ll287,
+        ll288, ll289, ll290, ll291, ll292, ll293, ll294, ll295, ll296, ll297,
+        ll298, ll299, ll300, ll301, ll302, ll303, ll304, ll305, ll306, ll307,
+        ll308, ll309, ll310, ll311, ll312, ll313, ll314, ll315, ll316, ll317,
+        ll318, ll319, ll320, ll321, ll322, ll323, ll324, ll325, ll326, ll327,
+        ll328, ll329, ll330, ll331, ll332, ll333, ll334, ll335, ll336, ll337,
+        ll338, ll339, ll340, ll341, ll342, ll343, ll344, ll345, ll346, ll347,
+        ll348, ll349, ll350, ll351, ll352, ll353, ll354, ll355, ll356, ll357,
+        ll358, ll359, ll360, ll361, ll362, ll363, ll364, ll365, ll366, ll367,
+        ll368, ll369, ll370, ll371, ll372, ll373, ll374, ll375, ll376, ll377,
+        ll378, ll379, ll380, ll381, ll382, ll383, ll384, ll385, ll386, ll387,
+        ll388, ll389, ll390, ll391, ll392, ll393, ll394, ll395, ll396, ll397,
+        ll398, ll399, ll400, ll401, ll402, ll403, ll404, ll405, ll406, ll407,
+        ll408, ll409, ll410, ll411, ll412, ll413, ll414, ll415, ll416, ll417,
+        ll418, ll419, ll420, ll421, ll422, ll423, ll424, ll425, ll426, ll427,
+        ll428, ll429, ll430, ll431, ll432, ll433, ll434, ll435, ll436, ll437,
+        ll438, ll439, ll440, ll441, ll442, ll443, ll444, ll445, ll446, ll447,
+        ll448, ll449, ll450, ll451, ll452, ll453, ll454, ll455, ll456, ll457,
+        ll458, ll459, ll460, ll461, ll462, ll463, ll464, ll465, ll466, ll467,
+        ll468, ll469, ll470, ll471, ll472, ll473, ll474, ll475, ll476, ll477,
+        ll478, ll479, ll480, ll481, ll482, ll483, ll484, ll485, ll486, ll487,
+        ll488, ll489, ll490, ll491, ll492, ll493, ll494, ll495, ll496, ll497,
+        ll498, ll499, ll500, ll501, ll502, ll503, ll504, ll505, ll506, ll507,
+        ll508, ll509, ll510, ll511;
+
+        if (deopt) {
+            method_entered = true;
+            synchronized(monitor) {
+                do_monitor_acquire = true;
+                UnloadedClass1 res = new UnloadedClass1(); // forces deopt with c2
+                res.field = 0; //forced deopt with c1
+                return res;
+            }
+        }
+        return null;
+    }
+
+    static boolean m2(boolean deopt) {
+        long l0, l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11, l12,
+        l13, l14, l15, l16, l17, l18, l19, l20, l21, l22, l23, l24,
+        l25, l26, l27, l28, l29, l30, l31, l32, l33, l34, l35, l36,
+        l37, l38, l39, l40, l41, l42, l43, l44, l45, l46, l47, l48,
+        l49, l50, l51, l52, l53, l54, l55, l56, l57, l58, l59, l60,
+        l61, l62, l63, l64, l65, l66, l67, l68, l69, l70, l71, l72,
+        l73, l74, l75, l76, l77, l78, l79, l80, l81, l82, l83, l84,
+        l85, l86, l87, l88, l89, l90, l91, l92, l93, l94, l95, l96,
+        l97, l98, l99, l100, l101, l102, l103, l104, l105, l106, l107,
+        l108, l109, l110, l111, l112, l113, l114, l115, l116, l117,
+        l118, l119, l120, l121, l122, l123, l124, l125, l126, l127,
+        l128, l129, l130, l131, l132, l133, l134, l135, l136, l137,
+        l138, l139, l140, l141, l142, l143, l144, l145, l146, l147,
+        l148, l149, l150, l151, l152, l153, l154, l155, l156, l157,
+        l158, l159, l160, l161, l162, l163, l164, l165, l166, l167,
+        l168, l169, l170, l171, l172, l173, l174, l175, l176, l177,
+        l178, l179, l180, l181, l182, l183, l184, l185, l186, l187,
+        l188, l189, l190, l191, l192, l193, l194, l195, l196, l197,
+        l198, l199, l200, l201, l202, l203, l204, l205, l206, l207,
+        l208, l209, l210, l211, l212, l213, l214, l215, l216, l217,
+        l218, l219, l220, l221, l222, l223, l224, l225, l226, l227,
+        l228, l229, l230, l231, l232, l233, l234, l235, l236, l237,
+        l238, l239, l240, l241, l242, l243, l244, l245, l246, l247,
+        l248, l249, l250, l251, l252, l253, l254, l255, l256, l257,
+        l258, l259, l260, l261, l262, l263, l264, l265, l266, l267,
+        l268, l269, l270, l271, l272, l273, l274, l275, l276, l277,
+        l278, l279, l280, l281, l282, l283, l284, l285, l286, l287,
+        l288, l289, l290, l291, l292, l293, l294, l295, l296, l297,
+        l298, l299, l300, l301, l302, l303, l304, l305, l306, l307,
+        l308, l309, l310, l311, l312, l313, l314, l315, l316, l317,
+        l318, l319, l320, l321, l322, l323, l324, l325, l326, l327,
+        l328, l329, l330, l331, l332, l333, l334, l335, l336, l337,
+        l338, l339, l340, l341, l342, l343, l344, l345, l346, l347,
+        l348, l349, l350, l351, l352, l353, l354, l355, l356, l357,
+        l358, l359, l360, l361, l362, l363, l364, l365, l366, l367,
+        l368, l369, l370, l371, l372, l373, l374, l375, l376, l377,
+        l378, l379, l380, l381, l382, l383, l384, l385, l386, l387,
+        l388, l389, l390, l391, l392, l393, l394, l395, l396, l397,
+        l398, l399, l400, l401, l402, l403, l404, l405, l406, l407,
+        l408, l409, l410, l411, l412, l413, l414, l415, l416, l417,
+        l418, l419, l420, l421, l422, l423, l424, l425, l426, l427,
+        l428, l429, l430, l431, l432, l433, l434, l435, l436, l437,
+        l438, l439, l440, l441, l442, l443, l444, l445, l446, l447,
+        l448, l449, l450, l451, l452, l453, l454, l455, l456, l457,
+        l458, l459, l460, l461, l462, l463, l464, l465, l466, l467,
+        l468, l469, l470, l471, l472, l473, l474, l475, l476, l477,
+        l478, l479, l480, l481, l482, l483, l484, l485, l486, l487,
+        l488, l489, l490, l491, l492, l493, l494, l495, l496, l497,
+        l498, l499, l500, l501, l502, l503, l504, l505, l506, l507,
+        l508, l509, l510, l511;
+
+        boolean do_m3 = false;
+        try {
+            do_m3 = m2(deopt);
+        } catch (StackOverflowError e) {
+            return true;
+        }
+        if (do_m3) {
+            try {
+                m1(deopt);
+            } catch (StackOverflowError e) {}
+        }
+        return false;
+    }
+
+    // Used for synchronization betwen threads
+    static volatile boolean thread_started = false;
+    static volatile boolean do_monitor_acquire = false;
+    static volatile boolean monitor_acquired = false;
+    static volatile boolean method_entered = false;
+
+    static Object monitor = new Object();
+
+    static public void main(String[] args) {
+        // get m1 compiled
+        for (int i = 0; i < 20000; i++) {
+            m1(false);
+        }
+
+        Thread thread = new Thread() {
+            public void run() {
+                thread_started = true;
+                while(!do_monitor_acquire);
+                System.out.println("Ok to try to acquire the lock");
+                synchronized(monitor) {
+                    monitor_acquired = true;
+                }
+            }
+        };
+
+        thread.setDaemon(true);
+        thread.start();
+
+        while(!thread_started);
+
+        m2(true);
+
+        if (!method_entered) {
+            System.out.println("TEST PASSED");
+            return;
+        }
+
+        for (int i = 0; i < 10; i++) {
+            System.out.println("Is lock acquired?");
+            if (monitor_acquired) {
+                System.out.println("TEST PASSED");
+                return;
+            }
+            try {
+                Thread.sleep(10000);
+            } catch(InterruptedException ie) {
+            }
+        }
+        System.out.println("TEST FAILED");
+    }
+}
diff --git a/hotspot/test/runtime/6929067/Test6929067.sh b/hotspot/test/runtime/6929067/Test6929067.sh
index 3757278..e1fd6b7 100644
--- a/hotspot/test/runtime/6929067/Test6929067.sh
+++ b/hotspot/test/runtime/6929067/Test6929067.sh
@@ -18,115 +18,39 @@
 ## Adding common setup Variables for running shell tests.
 . ${TESTSRC}/../../test_env.sh
 
-# set platform-dependent variables
-OS=`uname -s`
-case "$OS" in
-  Linux)
-    gcc_cmd=`which gcc`
-    if [ "x$gcc_cmd" == "x" ]; then
-        echo "WARNING: gcc not found. Cannot execute test." 2>&1
-        exit 0;
-    fi
-    NULL=/dev/null
-    PS=":"
-    FS="/"
-    ;;
-  * )
-    echo "Test passed; only valid for Linux"
-    exit 0;
-    ;;
-esac
-
-${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -Xinternalversion > vm_version.out 2>&1 
-
-# Bitness:
-# Cannot simply look at TESTVMOPTS as -d64 is not
-# passed if there is only a 64-bit JVM available.
-
-grep "64-Bit" vm_version.out > ${NULL}
-if [ "$?" = "0" ]
+if [ "${VM_OS}" != "linux" ]
 then
-  COMP_FLAG="-m64"
-else
-  COMP_FLAG="-m32"
+  echo "Test only valid for Linux"
+  exit 0
 fi
 
-
-# Architecture:
-# Translate uname output to JVM directory name, but permit testing
-# 32-bit x86 on an x64 platform.
-ARCH=`uname -m`
-case "$ARCH" in
-  x86_64)
-    if [ "$COMP_FLAG" = "-m32" ]; then
-      ARCH=i386
-    else 
-      ARCH=amd64
-    fi
-    ;;
-  ppc64)
-    if [ "$COMP_FLAG" = "-m32" ]; then
-      ARCH=ppc
-    else 
-      ARCH=ppc64
-    fi
-    ;;
-  sparc64)
-    if [ "$COMP_FLAG" = "-m32" ]; then
-      ARCH=sparc
-    else 
-      ARCH=sparc64
-    fi
-    ;;
-  arm*)
-    # 32-bit ARM machine: compiler may not recognise -m32
-    COMP_FLAG=""
-    ARCH=arm
-    ;;
-  aarch64)
-    # 64-bit arm machine, could be testing 32 or 64-bit:
-    if [ "$COMP_FLAG" = "-m32" ]; then
-      ARCH=arm
-    else 
-      ARCH=aarch64
-    fi
-    ;;
-  i586)
-    ARCH=i386
-    ;;
-  i686)
-    ARCH=i386
-    ;;
-  # Assuming other ARCH values need no translation
-esac
-
-
-# VM type: need to know server or client
-VMTYPE=client
-grep Server vm_version.out > ${NULL}
-if [ "$?" = "0" ]
-then
-  VMTYPE=server
+gcc_cmd=`which gcc`
+if [ "x$gcc_cmd" = "x" ]; then
+  echo "WARNING: gcc not found. Cannot execute test." 2>&1
+  exit 0;
 fi
 
+CFLAGS=-m${VM_BITS}
 
-LD_LIBRARY_PATH=.:${COMPILEJAVA}/jre/lib/${ARCH}/${VMTYPE}:/usr/lib:$LD_LIBRARY_PATH
+LD_LIBRARY_PATH=.:${TESTJAVA}/jre/lib/${VM_CPU}/${VM_TYPE}:/usr/lib:$LD_LIBRARY_PATH
 export LD_LIBRARY_PATH
 
-cp ${TESTSRC}${FS}*.java ${THIS_DIR}
-${COMPILEJAVA}${FS}bin${FS}javac *.java
+cp ${TESTSRC}/*.java ${THIS_DIR}
+${COMPILEJAVA}/bin/javac *.java
 
-echo "Architecture: ${ARCH}"
-echo "Compilation flag: ${COMP_FLAG}"
-echo "VM type: ${VMTYPE}"
+echo "Architecture: ${VM_CPU}"
+echo "Compilation flag: ${CFLAGS}"
+echo "VM type: ${VM_TYPE}"
+echo "LD_LIBRARY_PATH: ${LD_LIBRARY_PATH}"
+
 # Note pthread may not be found thus invoke creation will fail to be created.
 # Check to ensure you have a /usr/lib/libpthread.so if you don't please look
 # for /usr/lib/`uname -m`-linux-gnu version ensure to add that path to below compilation.
 
-$gcc_cmd -DLINUX ${COMP_FLAG} -o invoke \
-    -I${COMPILEJAVA}/include -I${COMPILEJAVA}/include/linux \
-    -L${COMPILEJAVA}/jre/lib/${ARCH}/${VMTYPE} \
-     ${TESTSRC}${FS}invoke.c -ljvm -lpthread
+$gcc_cmd -DLINUX ${CFLAGS} -o invoke \
+    -I${TESTJAVA}/include -I${TESTJAVA}/include/linux \
+    -L${TESTJAVA}/jre/lib/${VM_CPU}/${VM_TYPE} \
+     ${TESTSRC}/invoke.c -ljvm -lpthread
 
 ./invoke
 exit $?
diff --git a/hotspot/test/runtime/InitialThreadOverflow/invoke.cxx b/hotspot/test/runtime/InitialThreadOverflow/invoke.c
similarity index 83%
rename from hotspot/test/runtime/InitialThreadOverflow/invoke.cxx
rename to hotspot/test/runtime/InitialThreadOverflow/invoke.c
index 55213c0..84f0e40 100644
--- a/hotspot/test/runtime/InitialThreadOverflow/invoke.cxx
+++ b/hotspot/test/runtime/InitialThreadOverflow/invoke.c
@@ -31,18 +31,20 @@
 void *
 floobydust (void *p) {
   JNIEnv *env;
+  jclass class_id;
+  jmethodID method_id;
 
-  jvm->AttachCurrentThread((void**)&env, NULL);
+  (*jvm)->AttachCurrentThread(jvm, (void**)&env, NULL);
 
-  jclass class_id = env->FindClass ("DoOverflow");
+  class_id = (*env)->FindClass (env, "DoOverflow");
   assert (class_id);
 
-  jmethodID method_id = env->GetStaticMethodID(class_id, "printIt", "()V");
+  method_id = (*env)->GetStaticMethodID(env, class_id, "printIt", "()V");
   assert (method_id);
 
-  env->CallStaticVoidMethod(class_id, method_id, NULL);
+  (*env)->CallStaticVoidMethod(env, class_id, method_id, NULL);
 
-  jvm->DetachCurrentThread();
+  (*jvm)->DetachCurrentThread(jvm);
 }
 
 int
diff --git a/hotspot/test/runtime/InitialThreadOverflow/testme.sh b/hotspot/test/runtime/InitialThreadOverflow/testme.sh
index 8bdd702..d5d0eb2 100644
--- a/hotspot/test/runtime/InitialThreadOverflow/testme.sh
+++ b/hotspot/test/runtime/InitialThreadOverflow/testme.sh
@@ -21,7 +21,6 @@
 # or visit www.oracle.com if you need additional information or have any
 # questions.
 
-# @ignore 8029139
 # @test testme.sh
 # @bug 8009062
 # @summary Poor performance of JNI AttachCurrentThread after fix for 7017193
@@ -44,31 +43,35 @@
   exit 0
 fi
 
-gcc_cmd=`which g++`
+gcc_cmd=`which gcc`
 if [ "x$gcc_cmd" = "x" ]; then
-    echo "WARNING: g++ not found. Cannot execute test." 2>&1
+    echo "WARNING: gcc not found. Cannot execute test." 2>&1
     exit 0;
 fi
 
 CFLAGS="-m${VM_BITS}"
 
-LD_LIBRARY_PATH=.:${COMPILEJAVA}/jre/lib/${VM_CPU}/${VM_TYPE}:/usr/lib:$LD_LIBRARY_PATH
+LD_LIBRARY_PATH=.:${TESTJAVA}/jre/lib/${VM_CPU}/${VM_TYPE}:/usr/lib:$LD_LIBRARY_PATH
 export LD_LIBRARY_PATH
 
-cp ${TESTSRC}${FS}invoke.cxx .
+cp ${TESTSRC}/invoke.c .
 
 # Copy the result of our @compile action:
-cp ${TESTCLASSES}${FS}DoOverflow.class .
+cp ${TESTCLASSES}/DoOverflow.class .
 
-echo "Compilation flag: ${COMP_FLAG}"
+echo "Architecture: ${VM_CPU}"
+echo "Compilation flag: ${CFLAGS}"
+echo "VM type: ${VM_TYPE}"
+echo "LD_LIBRARY_PATH: ${LD_LIBRARY_PATH}"
+
 # Note pthread may not be found thus invoke creation will fail to be created.
 # Check to ensure you have a /usr/lib/libpthread.so if you don't please look
 # for /usr/lib/`uname -m`-linux-gnu version ensure to add that path to below compilation.
 
 $gcc_cmd -DLINUX ${CFLAGS} -o invoke \
-    -I${COMPILEJAVA}/include -I${COMPILEJAVA}/include/linux \
-    -L${COMPILEJAVA}/jre/lib/${VM_CPU}/${VM_TYPE} \
-    -ljvm -lpthread invoke.cxx
+    -I${TESTJAVA}/include -I${TESTJAVA}/include/linux \
+    -L${TESTJAVA}/jre/lib/${VM_CPU}/${VM_TYPE} \
+    -ljvm -lpthread invoke.c
 
 ./invoke
 exit $?
diff --git a/hotspot/test/runtime/Thread/CancellableThreadTest.java b/hotspot/test/runtime/Thread/CancellableThreadTest.java
new file mode 100644
index 0000000..6002abe
--- /dev/null
+++ b/hotspot/test/runtime/Thread/CancellableThreadTest.java
@@ -0,0 +1,167 @@
+/*
+ * 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.
+ *
+ * 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.
+ */
+
+/**
+ * This test is useful for finding out whether a Thread can have a
+ * private variable indicate whether or not it is finished, and to illustrate
+ * the ease with which Threads terminate each other.
+ *
+ * @test
+ */
+
+public class CancellableThreadTest {
+    public static final int THREADPAIRS = Integer.parseInt(System.getProperty("test.threadpairs", "128"));
+
+    public static void main(String args[]) {
+        Thread[] threads = new Thread[THREADPAIRS];
+        Canceller[] cancellers = new Canceller[THREADPAIRS];
+
+        System.out.println("Running with " + THREADPAIRS + " thread pairs");
+
+        for (int i = 0; i < THREADPAIRS; i++) {
+            cancellers[i] = new Canceller(i);
+            threads[i] = new Thread(cancellers[i]);
+            threads[i].start();
+        }
+
+        for (int i = 0; i < THREADPAIRS; i++) {
+            try {
+                threads[i].join();
+            } catch (InterruptedException e) {
+            }
+
+            if (cancellers[i].failed) {
+                throw new RuntimeException(" Test failed in " + i + " th pair. See error messages above.");
+            }
+        }
+    }
+}
+
+class Canceller implements Runnable {
+
+    private final CancellableTimer timer;
+
+    public final String name;
+    public volatile boolean failed = false;
+    private volatile boolean hasBeenNotified = false;
+
+    public Canceller(int index) {
+        this.name = "Canceller #" + index;
+        timer = new CancellableTimer(index, this);
+    }
+
+    public void setHasBeenNotified() {
+        hasBeenNotified = true;
+    }
+
+    /**
+     * This method contains the "action" of this Canceller Thread.
+     * It starts a CancellableTimer, waits, and then interrupts the
+     * CancellableTimer after the CancellableTimer notifies it.  It then
+     * tries to join the CancellableTimer to itself and reports on whether
+     * it was successful in doing so.
+     */
+    public void run() {
+        Thread timerThread = new Thread(timer);
+
+        try {
+            synchronized(this) {
+                timerThread.start();
+                wait();
+            }
+        } catch (InterruptedException e) {
+            System.err.println(name + " was interrupted during wait()");
+            failed = true;
+        }
+
+        if (!hasBeenNotified) {
+            System.err.println(name + ".hasBeenNotified is not true as expected");
+            failed = true;
+        }
+
+        synchronized (timer) {
+            timerThread.interrupt();
+        }
+
+        try {
+            timerThread.join();
+        } catch (InterruptedException ie) {
+            System.err.println(name + " was interrupted while joining " +
+                    timer.name);
+            failed = true;
+        }
+
+        if (timerThread.isAlive()) {
+            System.err.println(timer.name + " is still alive after " + name +
+                    " attempted to join it.");
+            failed = true;
+        }
+    }
+}
+
+/**
+ * This non-public class is the Thread which the Canceller Thread deliberately
+ * interrupts and then joins to itself after this Thread has slept for a few milliseconds.
+ */
+
+class CancellableTimer implements Runnable {
+
+    public final String name;
+    private final Canceller myCanceller;
+
+    public CancellableTimer(int index, Canceller aCanceller) {
+        this.name = "CancellableTimer #" + index;
+        this.myCanceller = aCanceller;
+    }
+
+    /**
+     * This is where this CancellableTimer does its work. It notifies its
+     * Canceller, waits for the Canceller to interrupt it, then catches the
+     * InterruptedException, and sleeps for a few milliseconds before exiting.
+     */
+    public void run() {
+        try {
+            synchronized (this) {
+                synchronized (myCanceller) {
+                    myCanceller.setHasBeenNotified();
+                    myCanceller.notify();
+                }
+                wait();
+            }
+        } catch (InterruptedException first) {
+            // isInterrupted should've been cleared here and we should not register a
+            // second interrupt
+            if (Thread.currentThread().isInterrupted()) {
+                System.err.println(name + " should not register an interrupt here");
+                myCanceller.failed = true;
+            }
+
+            try {
+                Thread.sleep(1);
+            } catch (InterruptedException e) {
+                System.err.println(name + " was interrupted when sleeping");
+                myCanceller.failed = true;
+            }
+        }
+    }
+}
diff --git a/hotspot/test/runtime/verifier/TestMultiANewArray.java b/hotspot/test/runtime/verifier/TestMultiANewArray.java
new file mode 100644
index 0000000..52afd43
--- /dev/null
+++ b/hotspot/test/runtime/verifier/TestMultiANewArray.java
@@ -0,0 +1,82 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.File;
+import java.io.FileOutputStream;
+import jdk.internal.org.objectweb.asm.ClassWriter;
+import jdk.internal.org.objectweb.asm.MethodVisitor;
+import static jdk.internal.org.objectweb.asm.Opcodes.*;
+import com.oracle.java.testlibrary.*;
+
+/*
+ * @test TestMultiANewArray
+ * @bug 8038076
+ * @library /testlibrary
+ * @compile -XDignore.symbol.file TestMultiANewArray.java
+ * @run main/othervm TestMultiANewArray 49
+ * @run main/othervm TestMultiANewArray 50
+ * @run main/othervm TestMultiANewArray 51
+ * @run main/othervm TestMultiANewArray 52
+ */
+
+public class TestMultiANewArray {
+    public static void main(String... args) throws Exception {
+        int cfv = Integer.parseInt(args[0]);
+        writeClassFile(cfv);
+        System.err.println("Running with cfv: " + cfv);
+        ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, "-cp", ".",  "ClassFile");
+        OutputAnalyzer output = new OutputAnalyzer(pb.start());
+        output.shouldContain("VerifyError");
+        output.shouldHaveExitValue(1);
+    }
+
+    public static void writeClassFile(int cfv) throws Exception {
+        ClassWriter cw = new ClassWriter(0);
+        MethodVisitor mv;
+
+        cw.visit(cfv, ACC_PUBLIC + ACC_SUPER, "ClassFile", null, "java/lang/Object", null);
+        mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
+        mv.visitCode();
+        mv.visitVarInsn(ALOAD, 0);
+        mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V", false);
+        mv.visitInsn(RETURN);
+        mv.visitMaxs(1, 1);
+        mv.visitEnd();
+
+        mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, "main", "([Ljava/lang/String;)V", null, null);
+        mv.visitCode();
+        mv.visitInsn(ICONST_1);
+        mv.visitInsn(ICONST_2);
+        mv.visitMultiANewArrayInsn("[I", 2);
+        mv.visitVarInsn(ASTORE, 1);
+        mv.visitInsn(RETURN);
+        mv.visitMaxs(2, 2);
+        mv.visitEnd();
+
+        cw.visitEnd();
+
+        try (FileOutputStream fos = new FileOutputStream(new File("ClassFile.class"))) {
+             fos.write(cw.toByteArray());
+        }
+    }
+}
diff --git a/hotspot/test/testlibrary/com/oracle/java/testlibrary/Platform.java b/hotspot/test/testlibrary/com/oracle/java/testlibrary/Platform.java
index 34b2f20..fa4b363 100644
--- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/Platform.java
+++ b/hotspot/test/testlibrary/com/oracle/java/testlibrary/Platform.java
@@ -30,13 +30,25 @@
     private static final String osArch      = System.getProperty("os.arch");
     private static final String vmName      = System.getProperty("java.vm.name");
 
-     public static boolean isClient() {
-         return vmName.endsWith(" Client VM");
-     }
+    public static boolean isClient() {
+        return vmName.endsWith(" Client VM");
+    }
 
-     public static boolean isServer() {
-         return vmName.endsWith(" Server VM");
-     }
+    public static boolean isServer() {
+        return vmName.endsWith(" Server VM");
+    }
+
+    public static boolean isGraal() {
+        return vmName.endsWith(" Graal VM");
+    }
+
+    public static boolean isMinimal() {
+        return vmName.endsWith(" Minimal VM");
+    }
+
+    public static boolean isEmbedded() {
+        return vmName.contains("Embedded");
+    }
 
     public static boolean is32bit() {
         return dataModel.equals("32");
diff --git a/hotspot/test/testlibrary/com/oracle/java/testlibrary/ProcessTools.java b/hotspot/test/testlibrary/com/oracle/java/testlibrary/ProcessTools.java
index 649b7a1..c63076e 100644
--- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/ProcessTools.java
+++ b/hotspot/test/testlibrary/com/oracle/java/testlibrary/ProcessTools.java
@@ -145,18 +145,15 @@
     return createJavaProcessBuilder(false, command);
   }
 
-  public static ProcessBuilder createJavaProcessBuilder(boolean addTestVmOptions, String... command) throws Exception {
+  public static ProcessBuilder createJavaProcessBuilder(boolean addTestVmAndJavaOptions, String... command) throws Exception {
     String javapath = JDKToolFinder.getJDKTool("java");
 
     ArrayList<String> args = new ArrayList<>();
     args.add(javapath);
     Collections.addAll(args, getPlatformSpecificVMArgs());
 
-    if (addTestVmOptions) {
-      String vmopts = System.getProperty("test.vm.opts");
-      if (vmopts != null && vmopts.length() > 0) {
-        Collections.addAll(args, vmopts.split("\\s"));
-      }
+    if (addTestVmAndJavaOptions) {
+      Collections.addAll(args, Utils.getTestJavaOpts());
     }
 
     Collections.addAll(args, command);
diff --git a/hotspot/test/testlibrary/com/oracle/java/testlibrary/Utils.java b/hotspot/test/testlibrary/com/oracle/java/testlibrary/Utils.java
index 03fd773..ba4bea5 100644
--- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/Utils.java
+++ b/hotspot/test/testlibrary/com/oracle/java/testlibrary/Utils.java
@@ -38,6 +38,8 @@
 import java.util.Collections;
 import java.util.regex.Pattern;
 import java.util.regex.Matcher;
+import java.lang.reflect.Field;
+import sun.misc.Unsafe;
 
 /**
  * Common library for various test helper functions.
@@ -59,6 +61,8 @@
      */
     public static final String JAVA_OPTIONS = System.getProperty("test.java.opts", "").trim();
 
+    private static Unsafe unsafe = null;
+
     /**
     * Returns the value of 'test.timeout.factor' system property
     * converted to {@code double}.
@@ -109,10 +113,10 @@
 
     /**
      * Returns the default JTReg arguments for a jvm running a test without
-     * options that matches regular expresions in {@code filters}.
+     * options that matches regular expressions in {@code filters}.
      * This is the combination of JTReg arguments test.vm.opts and test.java.opts.
      * @param filters Regular expressions used to filter out options.
-     * @return An array of options, or an empty array if no opptions.
+     * @return An array of options, or an empty array if no options.
      */
     public static String[] getFilteredTestJavaOpts(String... filters) {
         String options[] = getTestJavaOpts();
@@ -294,4 +298,38 @@
         return output;
     }
 
+    /**
+     * @return Unsafe instance.
+     */
+    public static synchronized Unsafe getUnsafe() {
+        if (unsafe == null) {
+            try {
+                Field f = Unsafe.class.getDeclaredField("theUnsafe");
+                f.setAccessible(true);
+                unsafe = (Unsafe) f.get(null);
+            } catch (NoSuchFieldException | IllegalAccessException e) {
+                throw new RuntimeException("Unable to get Unsafe instance.", e);
+            }
+        }
+        return unsafe;
+    }
+    private static final char[] hexArray = new char[]{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
+
+    /**
+     * Returns hex view of byte array
+     *
+     * @param bytes byte array to process
+     * @return Space separated hexadecimal string representation of bytes
+     */
+
+    public static String toHexString(byte[] bytes) {
+        char[] hexView = new char[bytes.length * 3];
+        int i = 0;
+        for (byte b : bytes) {
+            hexView[i++] = hexArray[(b >> 4) & 0x0F];
+            hexView[i++] = hexArray[b & 0x0F];
+            hexView[i++] = ' ';
+        }
+        return new String(hexView);
+    }
 }
diff --git a/hotspot/test/testlibrary/com/oracle/java/testlibrary/cli/CPUSpecificCommandLineOptionTest.java b/hotspot/test/testlibrary/com/oracle/java/testlibrary/cli/CPUSpecificCommandLineOptionTest.java
index a300e03..3e6edc5 100644
--- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/cli/CPUSpecificCommandLineOptionTest.java
+++ b/hotspot/test/testlibrary/com/oracle/java/testlibrary/cli/CPUSpecificCommandLineOptionTest.java
@@ -23,22 +23,16 @@
 
 package com.oracle.java.testlibrary.cli;
 
-import sun.hotspot.cpuinfo.CPUInfo;
-import com.oracle.java.testlibrary.*;
+import com.oracle.java.testlibrary.cli.predicate.CPUSpecificPredicate;
 
 /**
  * Base class for command line options tests that
  * requires specific CPU arch or specific CPU features.
  */
 public abstract class CPUSpecificCommandLineOptionTest
-              extends CommandLineOptionTest {
-
-    private String cpuArchPattern;
-    private String supportedCPUFeatures[];
-    private String unsupportedCPUFeatures[];
-
+        extends CommandLineOptionTest {
     /**
-     * Create new CPU specific test instance that does not
+     * Creates new CPU specific test instance that does not
      * require any CPU features.
      *
      * @param cpuArchPattern Regular expression that should
@@ -49,62 +43,23 @@
     }
 
     /**
-     * Create new CPU specific test instance that does not
+     * Creates new CPU specific test instance that does not
      * require from CPU support of {@code supportedCPUFeatures} features
      * and no support of {@code unsupportedCPUFeatures}.
      *
      * @param cpuArchPattern Regular expression that should
      *                       match os.arch.
      * @param supportedCPUFeatures Array with names of features that
-     *                             should be supported by CPU. If <b>null</b>,
+     *                             should be supported by CPU. If {@code null},
      *                             then no features have to be supported.
      * @param unsupportedCPUFeatures Array with names of features that
      *                               should not be supported by CPU.
-     *                               If <b>null</b>, then CPU may support any
+     *                               If {@code null}, then CPU may support any
      *                               features.
      */
     public CPUSpecificCommandLineOptionTest(String cpuArchPattern,
-                                            String supportedCPUFeatures[],
-                                            String unsupportedCPUFeatures[]) {
-        this.cpuArchPattern = cpuArchPattern;
-        this.supportedCPUFeatures = supportedCPUFeatures;
-        this.unsupportedCPUFeatures = unsupportedCPUFeatures;
-    }
-
-    /**
-     * Check that CPU on test box has appropriate architecture, support all
-     * required features and does not support all features that should not be
-     * supported.
-     *
-     * @return <b>true</b> if CPU on test box fulfill all requirements.
-     */
-    @Override
-    public boolean checkPreconditions() {
-        if (!Platform.getOsArch().matches(cpuArchPattern)) {
-            System.out.println("CPU arch does not match " + cpuArchPattern);
-            return false;
-        }
-
-        if (supportedCPUFeatures != null) {
-            for (String feature : supportedCPUFeatures) {
-                if (!CPUInfo.hasFeature(feature)) {
-                    System.out.println("CPU does not support " + feature +
-                                       " feature");
-                    return false;
-                }
-            }
-        }
-
-        if (unsupportedCPUFeatures != null) {
-            for (String feature : unsupportedCPUFeatures) {
-                if (CPUInfo.hasFeature(feature)) {
-                    System.out.println("CPU support " + feature + " feature");
-                    return false;
-                }
-            }
-        }
-
-        return true;
+            String supportedCPUFeatures[], String unsupportedCPUFeatures[]) {
+        super(new CPUSpecificPredicate(cpuArchPattern, supportedCPUFeatures,
+                unsupportedCPUFeatures));
     }
 }
-
diff --git a/hotspot/test/testlibrary/com/oracle/java/testlibrary/cli/CommandLineOptionTest.java b/hotspot/test/testlibrary/com/oracle/java/testlibrary/cli/CommandLineOptionTest.java
index d4d4e7c..8da6c02 100644
--- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/cli/CommandLineOptionTest.java
+++ b/hotspot/test/testlibrary/com/oracle/java/testlibrary/cli/CommandLineOptionTest.java
@@ -26,6 +26,7 @@
 import java.util.List;
 import java.util.ArrayList;
 import java.util.Collections;
+import java.util.function.BooleanSupplier;
 
 import com.oracle.java.testlibrary.*;
 
@@ -33,34 +34,71 @@
  * Base class for command line option tests.
  */
 public abstract class CommandLineOptionTest {
-
-    public static final String UNRECOGNIZED_OPTION_ERROR_FORMAT =
-        "Unrecognized VM option '[+-]?%s'";
-
-    public static final String printFlagsFinalFormat = "%s\\s*:?=\\s*%s";
+    public static final String UNLOCK_DIAGNOSTIC_VM_OPTIONS
+            = "-XX:+UnlockDiagnosticVMOptions";
+    public static final String UNLOCK_EXPERIMENTAL_VM_OPTIONS
+            = "-XX:+UnlockExperimentalVMOptions";
+    protected static final String UNRECOGNIZED_OPTION_ERROR_FORMAT
+            = "Unrecognized VM option '[+-]?%s(=.*)?'";
+    protected static final String EXPERIMENTAL_OPTION_ERROR_FORMAT
+            = "VM option '%s' is experimental and must be enabled via "
+            + "-XX:\\+UnlockExperimentalVMOptions.";
+    protected static final String DIAGNOSTIC_OPTION_ERROR_FORMAT
+            = " VM option '%s' is diagnostic and must be enabled via "
+            + "-XX:\\+UnlockDiagnosticVMOptions.";
+    private static final String PRINT_FLAGS_FINAL_FORMAT = "%s\\s*:?=\\s*%s";
 
     /**
-     * Verify that JVM startup behaviour matches our expectations.
+     * Verifies that JVM startup behaviour matches our expectations.
      *
-     * @param option The option that should be passed to JVM
-     * @param excpectedMessages Array of patterns that should occur
-     *                          in JVM output. If <b>null</b> then
+     * @param option an option that should be passed to JVM
+     * @param expectedMessages an array of patterns that should occur
+     *                          in JVM output. If {@code null} then
      *                          JVM output could be empty.
-     * @param unexpectedMessages Array of patterns that should not
-     *                           occur in JVM output. If <b>null</b> then
-     *                          JVM output could be empty.
+     * @param unexpectedMessages an array of patterns that should not
+     *                           occur in JVM output. If {@code null} then
+     *                           JVM output could be empty.
      * @param exitCode expected exit code.
      * @throws Throwable if verification fails or some other issues occur.
      */
     public static void verifyJVMStartup(String option,
-                                        String expectedMessages[],
-                                        String unexpectedMessages[],
-                                        ExitCode exitCode)
-                                 throws Throwable {
+            String expectedMessages[], String unexpectedMessages[],
+            ExitCode exitCode) throws Throwable {
+        CommandLineOptionTest.verifyJVMStartup(expectedMessages,
+                unexpectedMessages, exitCode, false, option);
+    }
 
-        OutputAnalyzer outputAnalyzer =
-            ProcessTools.executeTestJvm(option, "-version");
+    /**
+     * Verifies that JVM startup behaviour matches our expectations.
+     *
+     * @param expectedMessages an array of patterns that should occur
+     *                         in JVM output. If {@code null} then
+     *                         JVM output could be empty.
+     * @param unexpectedMessages an array of patterns that should not
+     *                           occur in JVM output. If {@code null} then
+     *                           JVM output could be empty.
+     * @param exitCode expected exit code.
+     * @param addTestVMOptions if {@code true} then test VM options will be
+     *                         passed to VM.
+     * @param options options that should be passed to VM in addition to mode
+     *                flag.
+     * @throws Throwable if verification fails or some other issues occur.
+     */
+    public static void verifyJVMStartup(String expectedMessages[],
+            String unexpectedMessages[], ExitCode exitCode,
+            boolean addTestVMOptions, String... options) throws Throwable {
+        List<String> finalOptions = new ArrayList<>();
+        if (addTestVMOptions) {
+            Collections.addAll(finalOptions, Utils.getTestJavaOpts());
+        }
+        Collections.addAll(finalOptions, options);
+        finalOptions.add("-version");
 
+        ProcessBuilder processBuilder
+                = ProcessTools.createJavaProcessBuilder(finalOptions.toArray(
+                new String[finalOptions.size()]));
+        OutputAnalyzer outputAnalyzer
+                = new OutputAnalyzer(processBuilder.start());
         outputAnalyzer.shouldHaveExitValue(exitCode.value);
 
         if (expectedMessages != null) {
@@ -77,97 +115,216 @@
     }
 
     /**
-     * Verify that value of specified JVM option is the same as
+     * Verifies that JVM startup behaviour matches our expectations when type
+     * of newly started VM is the same as the type of current.
+     *
+     * @param expectedMessages an array of patterns that should occur
+     *                         in JVM output. If {@code null} then
+     *                         JVM output could be empty.
+     * @param unexpectedMessages an array of patterns that should not
+     *                           occur in JVM output. If {@code null} then
+     *                           JVM output could be empty.
+     * @param exitCode expected exit code.
+     * @param options options that should be passed to VM in addition to mode
+     *                flag.
+     * @throws Throwable if verification fails or some other issues occur.
+     */
+    public static void verifySameJVMStartup(String expectedMessages[],
+            String unexpectedMessages[], ExitCode exitCode, String... options)
+            throws  Throwable {
+        List<String> finalOptions = new ArrayList<>();
+        finalOptions.add(CommandLineOptionTest.getVMTypeOption());
+        Collections.addAll(finalOptions, options);
+
+        CommandLineOptionTest.verifyJVMStartup(expectedMessages,
+                unexpectedMessages, exitCode, false,
+                finalOptions.toArray(new String[finalOptions.size()]));
+    }
+
+    /**
+     * Verifies that value of specified JVM option is the same as
      * expected value.
      * This method filter out option with {@code optionName}
      * name from test java options.
      *
-     * @param optionName Name of tested option.
-     * @param expectedValue Expected value of tested option.
-     * @param additionalVMOpts Additonal options that should be
+     * @param optionName a name of tested option.
+     * @param expectedValue expected value of tested option.
+     * @param additionalVMOpts additional options that should be
      *                         passed to JVM.
      * @throws Throwable if verification fails or some other issues occur.
      */
     public static void verifyOptionValue(String optionName,
-                                         String expectedValue,
-                                         String... additionalVMOpts)
-                                  throws Throwable {
+            String expectedValue, String... additionalVMOpts) throws Throwable {
         verifyOptionValue(optionName, expectedValue, true, additionalVMOpts);
     }
 
     /**
-     * Verify that value of specified JVM option is the same as
+     * Verifies that value of specified JVM option is the same as
      * expected value.
      * This method filter out option with {@code optionName}
      * name from test java options.
      *
-     * @param optionName Name of tested option.
-     * @param expectedValue Expected value of tested option.
-     * @param addTestVmOptions If <b>true</b>, then test VM options
+     * @param optionName a name of tested option.
+     * @param expectedValue expected value of tested option.
+     * @param addTestVmOptions if {@code true}, then test VM options
      *                         will be used.
-     * @param additionalVMOpts Additonal options that should be
+     * @param additionalVMOpts additional options that should be
      *                         passed to JVM.
-     * @throws Throwable if verification fails or some other issues occur.
+     * @throws Throwable if verification fails or some other issues
+     *                          occur.
      */
     public static void verifyOptionValue(String optionName,
-                                         String expectedValue,
-                                         boolean addTestVmOptions,
-                                         String... additionalVMOpts)
-                                  throws Throwable {
-
-        List<String> vmOpts = new ArrayList<String>();
+            String expectedValue, boolean addTestVmOptions,
+            String... additionalVMOpts) throws Throwable {
+        List<String> vmOpts = new ArrayList<>();
 
         if (addTestVmOptions) {
             Collections.addAll(vmOpts,
                                Utils.getFilteredTestJavaOpts(optionName));
         }
         Collections.addAll(vmOpts, additionalVMOpts);
-        Collections.addAll(vmOpts, new String[] {
-                "-XX:+PrintFlagsFinal",
-                "-version"
-            });
+        Collections.addAll(vmOpts, "-XX:+PrintFlagsFinal", "-version");
 
-        ProcessBuilder processBuilder =
-            ProcessTools.
-            createJavaProcessBuilder(vmOpts.
-                                     toArray(new String[vmOpts.size()]));
+        ProcessBuilder processBuilder = ProcessTools.createJavaProcessBuilder(
+                vmOpts.toArray(new String[vmOpts.size()]));
 
-        OutputAnalyzer outputAnalyzer =
-            new OutputAnalyzer(processBuilder.start());
+        OutputAnalyzer outputAnalyzer
+                = new OutputAnalyzer(processBuilder.start());
 
         outputAnalyzer.shouldHaveExitValue(0);
-        outputAnalyzer.shouldMatch(String.
-                                   format(printFlagsFinalFormat,
-                                          optionName,
-                                          expectedValue));
+        outputAnalyzer.shouldMatch(String.format(
+                CommandLineOptionTest.PRINT_FLAGS_FINAL_FORMAT,
+                optionName, expectedValue));
     }
 
+    /**
+     * Verifies that value of specified JVM when type of newly started VM
+     * is the same as the type of current.
+     * This method filter out option with {@code optionName}
+     * name from test java options.
+     * Only mode flag will be passed to VM in addition to
+     * {@code additionalVMOpts}
+     *
+     * @param optionName name of tested option.
+     * @param expectedValue expected value of tested option.
+     * @param additionalVMOpts additional options that should be
+     *                         passed to JVM.
+     * @throws Throwable if verification fails or some other issues occur.
+     */
+    public static void verifyOptionValueForSameVM(String optionName,
+            String expectedValue, String... additionalVMOpts) throws Throwable {
+        List<String> finalOptions = new ArrayList<>();
+        finalOptions.add(CommandLineOptionTest.getVMTypeOption());
+        Collections.addAll(finalOptions, additionalVMOpts);
+
+        CommandLineOptionTest.verifyOptionValue(optionName, expectedValue,
+                false, finalOptions.toArray(new String[finalOptions.size()]));
+    }
 
     /**
-     * Run command line option test.
+     * Prepares boolean command line flag with name {@code name} according
+     * to it's {@code value}.
      *
-     * @throws Throwable if test failed.
+     * @param name the name of option to be prepared
+     * @param value the value of option
+     * @return prepared command line flag
+     */
+    public static String prepareBooleanFlag(String name, boolean value) {
+        return String.format("-XX:%c%s", (value ? '+' : '-'), name);
+    }
+
+    /**
+     * Prepares numeric command line flag with name {@code name} by setting
+     * it's value to {@code value}.
+     *
+     * @param name the name of option to be prepared
+     * @param value the value of option
+     * @return prepared command line flag
+     */
+    public static String prepareNumericFlag(String name, Number value) {
+        return String.format("-XX:%s=%s", name, value.toString());
+    }
+
+    /**
+     * Returns message that should occur in VM output if option
+     * {@code optionName} if unrecognized.
+     *
+     * @param optionName the name of option for which message should be returned
+     * @return message saying that option {@code optionName} is unrecognized
+     */
+    public static String getUnrecognizedOptionErrorMessage(String optionName) {
+        return String.format(
+                CommandLineOptionTest.UNRECOGNIZED_OPTION_ERROR_FORMAT,
+                optionName);
+    }
+
+    /**
+     * Returns message that should occur in VM output if option
+     * {@code optionName} is experimental and
+     * -XX:+UnlockExperimentalVMOptions was not passed to VM.
+     *
+     * @param optionName the name of option for which message should be returned
+     * @return message saying that option {@code optionName} is experimental
+     */
+    public static String getExperimentalOptionErrorMessage(String optionName) {
+        return String.format(
+                CommandLineOptionTest.EXPERIMENTAL_OPTION_ERROR_FORMAT,
+                optionName);
+    }
+
+    /**
+     * Returns message that should occur in VM output if option
+     * {@code optionName} is diagnostic and -XX:+UnlockDiagnosticVMOptions
+     * was not passed to VM.
+     *
+     * @param optionName the name of option for which message should be returned
+     * @return message saying that option {@code optionName} is diganostic
+     */
+    public static String getDiagnosticOptionErrorMessage(String optionName) {
+        return String.format(
+                CommandLineOptionTest.DIAGNOSTIC_OPTION_ERROR_FORMAT,
+                optionName);
+    }
+
+    /**
+     * @return option required to start a new VM with the same type as current.
+     * @throws RuntimeException when VM type is unknown.
+     */
+    private static String getVMTypeOption() {
+        if (Platform.isServer()) {
+            return "-server";
+        } else if (Platform.isClient()) {
+            return "-client";
+        } else if (Platform.isMinimal()) {
+            return "-minimal";
+        } else if (Platform.isGraal()) {
+            return "-graal";
+        }
+        throw new RuntimeException("Unknown VM mode.");
+    }
+
+    private final BooleanSupplier predicate;
+
+    /**
+     * Constructs new CommandLineOptionTest that will be executed only if
+     * predicate {@code predicate} return {@code true}.
+     * @param predicate a predicate responsible for test's preconditions check.
+     */
+    public CommandLineOptionTest(BooleanSupplier predicate) {
+        this.predicate = predicate;
+    }
+
+    /**
+     * Runs command line option test.
      */
     public final void test() throws Throwable {
-        if (checkPreconditions()) {
+        if (predicate.getAsBoolean()) {
             runTestCases();
         }
     }
 
     /**
-     * Check that all preconditions for test execution are met.
-     *
-     * @return <b>true</b> if test could be executed.
+     * @throws Throwable if some issue happened during test cases execution.
      */
-    public boolean checkPreconditions() {
-        return true;
-    }
-
-    /**
-     * Run test cases.
-     *
-     * @throws Throwable if test failed.
-     */
-    public abstract void runTestCases() throws Throwable;
+    protected abstract void runTestCases() throws Throwable;
 }
-
diff --git a/hotspot/test/testlibrary/com/oracle/java/testlibrary/cli/predicate/AndPredicate.java b/hotspot/test/testlibrary/com/oracle/java/testlibrary/cli/predicate/AndPredicate.java
new file mode 100644
index 0000000..001eca0
--- /dev/null
+++ b/hotspot/test/testlibrary/com/oracle/java/testlibrary/cli/predicate/AndPredicate.java
@@ -0,0 +1,41 @@
+/*
+ * 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.
+ *
+ * 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.oracle.java.testlibrary.cli.predicate;
+
+import java.util.function.BooleanSupplier;
+
+public class AndPredicate implements BooleanSupplier {
+    private final BooleanSupplier a;
+    private final BooleanSupplier b;
+
+    public AndPredicate(BooleanSupplier a, BooleanSupplier b) {
+        this.a = a;
+        this.b = b;
+    }
+
+    @Override
+    public boolean getAsBoolean() {
+        return a.getAsBoolean() && b.getAsBoolean();
+    }
+}
diff --git a/hotspot/test/testlibrary/com/oracle/java/testlibrary/cli/predicate/CPUSpecificPredicate.java b/hotspot/test/testlibrary/com/oracle/java/testlibrary/cli/predicate/CPUSpecificPredicate.java
new file mode 100644
index 0000000..60571bf
--- /dev/null
+++ b/hotspot/test/testlibrary/com/oracle/java/testlibrary/cli/predicate/CPUSpecificPredicate.java
@@ -0,0 +1,71 @@
+/*
+ * 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.
+ *
+ * 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.oracle.java.testlibrary.cli.predicate;
+
+import com.oracle.java.testlibrary.Platform;
+import sun.hotspot.cpuinfo.CPUInfo;
+
+import java.util.function.BooleanSupplier;
+
+public class CPUSpecificPredicate implements BooleanSupplier {
+    private final String cpuArchPattern;
+    private final String supportedCPUFeatures[];
+    private final String unsupportedCPUFeatures[];
+
+    public CPUSpecificPredicate(String cpuArchPattern,
+            String supportedCPUFeatures[],
+            String unsupportedCPUFeatures[]) {
+        this.cpuArchPattern = cpuArchPattern;
+        this.supportedCPUFeatures = supportedCPUFeatures;
+        this.unsupportedCPUFeatures = unsupportedCPUFeatures;
+    }
+
+    @Override
+    public boolean getAsBoolean() {
+        if (!Platform.getOsArch().matches(cpuArchPattern)) {
+            System.out.println("CPU arch does not match " + cpuArchPattern);
+            return false;
+        }
+
+        if (supportedCPUFeatures != null) {
+            for (String feature : supportedCPUFeatures) {
+                if (!CPUInfo.hasFeature(feature)) {
+                    System.out.println("CPU does not support " + feature
+                            + " feature");
+                    return false;
+                }
+            }
+        }
+
+        if (unsupportedCPUFeatures != null) {
+            for (String feature : unsupportedCPUFeatures) {
+                if (CPUInfo.hasFeature(feature)) {
+                    System.out.println("CPU support " + feature + " feature");
+                    return false;
+                }
+            }
+        }
+        return true;
+    }
+}
diff --git a/hotspot/test/testlibrary/com/oracle/java/testlibrary/cli/predicate/NotPredicate.java b/hotspot/test/testlibrary/com/oracle/java/testlibrary/cli/predicate/NotPredicate.java
new file mode 100644
index 0000000..ed503d6
--- /dev/null
+++ b/hotspot/test/testlibrary/com/oracle/java/testlibrary/cli/predicate/NotPredicate.java
@@ -0,0 +1,40 @@
+/*
+ * 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.
+ *
+ * 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.oracle.java.testlibrary.cli.predicate;
+
+import java.util.function.BooleanSupplier;
+
+public class NotPredicate implements BooleanSupplier {
+    private final BooleanSupplier s;
+
+    public NotPredicate(BooleanSupplier s) {
+        this.s = s;
+    }
+
+    @Override
+    public boolean getAsBoolean() {
+        return !s.getAsBoolean();
+    }
+}
diff --git a/hotspot/test/testlibrary/com/oracle/java/testlibrary/cli/predicate/OrPredicate.java b/hotspot/test/testlibrary/com/oracle/java/testlibrary/cli/predicate/OrPredicate.java
new file mode 100644
index 0000000..894e99e
--- /dev/null
+++ b/hotspot/test/testlibrary/com/oracle/java/testlibrary/cli/predicate/OrPredicate.java
@@ -0,0 +1,42 @@
+/*
+ * 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.
+ *
+ * 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.oracle.java.testlibrary.cli.predicate;
+
+import java.util.function.BooleanSupplier;
+
+public class OrPredicate implements BooleanSupplier {
+    private final BooleanSupplier a;
+    private final BooleanSupplier b;
+
+    public OrPredicate(BooleanSupplier a, BooleanSupplier b) {
+        this.a = a;
+        this.b = b;
+    }
+
+    @Override
+    public boolean getAsBoolean() {
+        return a.getAsBoolean() || b.getAsBoolean();
+    }
+}
diff --git a/jaxp/.hgtags b/jaxp/.hgtags
index 5e75b58..4ec338b 100644
--- a/jaxp/.hgtags
+++ b/jaxp/.hgtags
@@ -252,3 +252,4 @@
 389f4094fd603c17e215997b0b40171179629007 jdk9-b07
 3b360a77658e6b3ac150dd7cdbff1a7abe855afc jdk9-b08
 f93a792fe37279d4d37aea86a99f3abbdc6fe79b jdk9-b09
+4ce98701efe3b28f6ce3ab23385445731e968af7 jdk9-b10
diff --git a/jaxp/make/BuildJaxp.gmk b/jaxp/make/BuildJaxp.gmk
index 57c184b..4efd49f 100644
--- a/jaxp/make/BuildJaxp.gmk
+++ b/jaxp/make/BuildJaxp.gmk
@@ -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, \
diff --git a/jaxws/.hgtags b/jaxws/.hgtags
index 7d8f3d3..17a198b 100644
--- a/jaxws/.hgtags
+++ b/jaxws/.hgtags
@@ -255,3 +255,4 @@
 856a9132f506cafe2f251c1a16a0b14e4d16048d jdk9-b07
 2d9f4166e0be68aa43c5f4fd0f8d34768e11f652 jdk9-b08
 c9e8bb8c1144a966ca7b481142c6b5e55d14a29c jdk9-b09
+9af43f4d215f6f19b1767f6ac66da931b8ee9535 jdk9-b10
diff --git a/jaxws/make/BuildJaxws.gmk b/jaxws/make/BuildJaxws.gmk
index 1c15996..5994543 100644
--- a/jaxws/make/BuildJaxws.gmk
+++ b/jaxws/make/BuildJaxws.gmk
@@ -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, \
diff --git a/jdk/.hgtags b/jdk/.hgtags
index 52873cd..ee44f52 100644
--- a/jdk/.hgtags
+++ b/jdk/.hgtags
@@ -252,3 +252,4 @@
 f4e624447514f12dd7c51f1e5b0cb97efcd15be2 jdk9-b07
 9e7bd44ea85c72318130379c34b98716b9c7c248 jdk9-b08
 2cef452ba711b17950da275fd15931925799f07c jdk9-b09
+ab06ba2894313a47e4969ca37792ff119c49e711 jdk9-b10
diff --git a/jdk/make/CompileJavaClasses.gmk b/jdk/make/CompileJavaClasses.gmk
index ec003f5..aed9bec 100644
--- a/jdk/make/CompileJavaClasses.gmk
+++ b/jdk/make/CompileJavaClasses.gmk
@@ -326,7 +326,7 @@
 ifeq ($(ENABLE_SJAVAC),yes)
   # With sjavac enabled, excluded sources are not even considered for linking. 
   # Explicitly add the security sources to sourcepath for linking.
-  BUILD_JDK_SOURCEPATH:=$(patsubst %,-i$(SPACE)%.*,$(subst /,.,$(SECURITY_PKGS))) \
+  BUILD_JDK_SOURCEPATH:=$(patsubst %,-i$(SPACE)%/*,$(SECURITY_PKGS)) \
       -sourcepath $(JDK_TOPDIR)/src/share/classes
 endif
 
diff --git a/jdk/src/share/classes/com/sun/jarsigner/ContentSignerParameters.java b/jdk/src/share/classes/com/sun/jarsigner/ContentSignerParameters.java
index 425f802..94704dc 100644
--- a/jdk/src/share/classes/com/sun/jarsigner/ContentSignerParameters.java
+++ b/jdk/src/share/classes/com/sun/jarsigner/ContentSignerParameters.java
@@ -35,7 +35,7 @@
  * @since 1.5
  * @author Vincent Ryan
  */
-
+@jdk.Exported
 public interface ContentSignerParameters {
 
     /**
@@ -64,7 +64,20 @@
      *
      * @return The TSAPolicyID. May be null.
      */
-    public String getTSAPolicyID();
+    public default String getTSAPolicyID() {
+        return null;
+    }
+
+    /**
+     * Retreives the message digest algorithm that is used to generate
+     * the message imprint to be sent to the TSA server.
+     *
+     * @since 1.9
+     * @return The non-null string of the message digest algorithm name.
+     */
+    public default String getTSADigestAlg() {
+        return "SHA-256";
+    }
 
     /**
      * Retrieves the JAR file's signature.
diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/Obj.java b/jdk/src/share/classes/com/sun/jndi/ldap/Obj.java
index 6627ab3..e1be611 100644
--- a/jdk/src/share/classes/com/sun/jndi/ldap/Obj.java
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/Obj.java
@@ -38,13 +38,11 @@
 import java.io.ObjectStreamClass;
 import java.io.InputStream;
 
+import java.util.Base64;
 import java.util.Hashtable;
 import java.util.Vector;
 import java.util.StringTokenizer;
 
-import sun.misc.BASE64Encoder;
-import sun.misc.BASE64Decoder;
-
 import java.lang.reflect.Proxy;
 import java.lang.reflect.Modifier;
 
@@ -324,7 +322,7 @@
 
             Attribute refAttr = new BasicAttribute(JAVA_ATTRIBUTES[REF_ADDR]);
             RefAddr refAddr;
-            BASE64Encoder encoder = null;
+            Base64.Encoder encoder = null;
 
             for (int i = 0; i < count; i++) {
                 refAddr = ref.get(i);
@@ -335,12 +333,12 @@
                         separator + refAddr.getContent());
                 } else {
                     if (encoder == null)
-                        encoder = new BASE64Encoder();
+                        encoder = Base64.getMimeEncoder();
 
                     refAttr.add(""+ separator + i +
                         separator + refAddr.getType() +
                         separator + separator +
-                        encoder.encodeBuffer(serializeObject(refAddr)));
+                        encoder.encodeToString(serializeObject(refAddr)));
                 }
             }
             attrs.put(refAttr);
@@ -403,7 +401,7 @@
             String val, posnStr, type;
             char separator;
             int start, sep, posn;
-            BASE64Decoder decoder = null;
+            Base64.Decoder decoder = null;
 
             ClassLoader cl = helper.getURLClassLoader(codebases);
 
@@ -472,11 +470,11 @@
                     // %%% RL: exception if empty after double separator
 
                     if (decoder == null)
-                        decoder = new BASE64Decoder();
+                        decoder = Base64.getMimeDecoder();
 
                     RefAddr ra = (RefAddr)
                         deserializeObject(
-                            decoder.decodeBuffer(val.substring(start)),
+                            decoder.decode(val.substring(start).getBytes()),
                             cl);
 
                     refAddrList.setElementAt(ra, posn);
diff --git a/jdk/src/share/classes/java/net/DatagramSocketImpl.java b/jdk/src/share/classes/java/net/DatagramSocketImpl.java
index 07b2724a..73a7ba3 100644
--- a/jdk/src/share/classes/java/net/DatagramSocketImpl.java
+++ b/jdk/src/share/classes/java/net/DatagramSocketImpl.java
@@ -311,6 +311,7 @@
      *
      * @since 1.9
      */
+    @SuppressWarnings("unchecked")
     protected <T> T getOption(SocketOption<T> name) throws IOException {
         if (name == StandardSocketOptions.SO_SNDBUF) {
             return (T) getOption(SocketOptions.SO_SNDBUF);
diff --git a/jdk/src/share/classes/java/net/SocketImpl.java b/jdk/src/share/classes/java/net/SocketImpl.java
index 4aadf09..ebc527b 100644
--- a/jdk/src/share/classes/java/net/SocketImpl.java
+++ b/jdk/src/share/classes/java/net/SocketImpl.java
@@ -408,6 +408,7 @@
      *
      * @since 1.9
      */
+    @SuppressWarnings("unchecked")
     protected <T> T getOption(SocketOption<T> name) throws IOException {
         if (name == StandardSocketOptions.SO_KEEPALIVE) {
             return (T)getOption(SocketOptions.SO_KEEPALIVE);
diff --git a/jdk/src/share/classes/java/time/temporal/IsoFields.java b/jdk/src/share/classes/java/time/temporal/IsoFields.java
index 8d9cc84..70c3ffb 100644
--- a/jdk/src/share/classes/java/time/temporal/IsoFields.java
+++ b/jdk/src/share/classes/java/time/temporal/IsoFields.java
@@ -535,11 +535,17 @@
                 if (isSupportedBy(temporal) == false) {
                     throw new UnsupportedTemporalTypeException("Unsupported field: WeekBasedYear");
                 }
-                int newVal = range().checkValidIntValue(newValue, WEEK_BASED_YEAR);  // strict check
+                int newWby = range().checkValidIntValue(newValue, WEEK_BASED_YEAR);  // strict check
                 LocalDate date = LocalDate.from(temporal);
+                int dow = date.get(DAY_OF_WEEK);
                 int week = getWeek(date);
-                date = date.withDayOfYear(180).withYear(newVal).with(WEEK_OF_WEEK_BASED_YEAR, week);
-                return (R) date.with(date);
+                if (week == 53 && getWeekRange(newWby) == 52) {
+                    week = 52;
+                }
+                LocalDate resolved = LocalDate.of(newWby, 1, 4);  // 4th is guaranteed to be in week one
+                int days = (dow - resolved.get(DAY_OF_WEEK)) + ((week - 1) * 7);
+                resolved = resolved.plusDays(days);
+                return (R) temporal.with(resolved);
             }
             @Override
             public String toString() {
@@ -577,12 +583,16 @@
 
         private static ValueRange getWeekRange(LocalDate date) {
             int wby = getWeekBasedYear(date);
-            date = date.withDayOfYear(1).withYear(wby);
+            return ValueRange.of(1, getWeekRange(wby));
+        }
+
+        private static int getWeekRange(int wby) {
+            LocalDate date = LocalDate.of(wby, 1, 1);
             // 53 weeks if standard year starts on Thursday, or Wed in a leap year
             if (date.getDayOfWeek() == THURSDAY || (date.getDayOfWeek() == WEDNESDAY && date.isLeapYear())) {
-                return ValueRange.of(1, 53);
+                return 53;
             }
-            return ValueRange.of(1, 52);
+            return 52;
         }
 
         private static int getWeek(LocalDate date) {
diff --git a/jdk/src/share/classes/java/time/temporal/WeekFields.java b/jdk/src/share/classes/java/time/temporal/WeekFields.java
index 3aa362c..faee176 100644
--- a/jdk/src/share/classes/java/time/temporal/WeekFields.java
+++ b/jdk/src/share/classes/java/time/temporal/WeekFields.java
@@ -700,7 +700,7 @@
          * @see WeekFields#weekOfWeekBasedYear()
          */
         static ComputedDayOfField ofWeekOfWeekBasedYearField(WeekFields weekDef) {
-            return new ComputedDayOfField("WeekOfWeekBasedYear", weekDef, WEEKS, IsoFields.WEEK_BASED_YEARS, WEEK_OF_YEAR_RANGE);
+            return new ComputedDayOfField("WeekOfWeekBasedYear", weekDef, WEEKS, IsoFields.WEEK_BASED_YEARS, WEEK_OF_WEEK_BASED_YEAR_RANGE);
         }
 
         /**
@@ -753,6 +753,7 @@
         private static final ValueRange DAY_OF_WEEK_RANGE = ValueRange.of(1, 7);
         private static final ValueRange WEEK_OF_MONTH_RANGE = ValueRange.of(0, 1, 4, 6);
         private static final ValueRange WEEK_OF_YEAR_RANGE = ValueRange.of(0, 1, 52, 54);
+        private static final ValueRange WEEK_OF_WEEK_BASED_YEAR_RANGE = ValueRange.of(1, 52, 53);
 
         @Override
         public long getFrom(TemporalAccessor temporal) {
diff --git a/jdk/src/share/classes/sun/net/InetAddressCachePolicy.java b/jdk/src/share/classes/sun/net/InetAddressCachePolicy.java
index 8437a1d..31578b5 100644
--- a/jdk/src/share/classes/sun/net/InetAddressCachePolicy.java
+++ b/jdk/src/share/classes/sun/net/InetAddressCachePolicy.java
@@ -84,19 +84,31 @@
      * Initialize
      */
     static {
-        Integer tmp = null;
 
-        try {
-            tmp = new Integer(
-              java.security.AccessController.doPrivileged (
-                new PrivilegedAction<String>() {
-                  public String run() {
-                      return Security.getProperty(cachePolicyProp);
-                  }
-              }));
-        } catch (NumberFormatException e) {
-            // ignore
-        }
+        Integer tmp = java.security.AccessController.doPrivileged(
+          new PrivilegedAction<Integer>() {
+            public Integer run() {
+                try {
+                    String tmpString = Security.getProperty(cachePolicyProp);
+                    if (tmpString != null) {
+                        return Integer.valueOf(tmpString);
+                    }
+                } catch (NumberFormatException ignored) {
+                    // Ignore
+                }
+
+                try {
+                    String tmpString = System.getProperty(cachePolicyPropFallback);
+                    if (tmpString != null) {
+                        return Integer.decode(tmpString);
+                    }
+                } catch (NumberFormatException ignored) {
+                    // Ignore
+                }
+                return null;
+            }
+          });
+
         if (tmp != null) {
             cachePolicy = tmp.intValue();
             if (cachePolicy < 0) {
@@ -104,35 +116,36 @@
             }
             propertySet = true;
         } else {
-            tmp = java.security.AccessController.doPrivileged
-                (new sun.security.action.GetIntegerAction(cachePolicyPropFallback));
-            if (tmp != null) {
-                cachePolicy = tmp.intValue();
-                if (cachePolicy < 0) {
-                    cachePolicy = FOREVER;
-                }
-                propertySet = true;
-            } else {
-                /* No properties defined for positive caching. If there is no
-                 * security manager then use the default positive cache value.
-                 */
-                if (System.getSecurityManager() == null) {
-                    cachePolicy = DEFAULT_POSITIVE;
-                }
+            /* No properties defined for positive caching. If there is no
+             * security manager then use the default positive cache value.
+             */
+            if (System.getSecurityManager() == null) {
+                cachePolicy = DEFAULT_POSITIVE;
             }
         }
+        tmp = java.security.AccessController.doPrivileged (
+          new PrivilegedAction<Integer>() {
+            public Integer run() {
+                try {
+                    String tmpString = Security.getProperty(negativeCachePolicyProp);
+                    if (tmpString != null) {
+                        return Integer.valueOf(tmpString);
+                    }
+                } catch (NumberFormatException ignored) {
+                    // Ignore
+                }
 
-        try {
-            tmp = new Integer(
-              java.security.AccessController.doPrivileged (
-                new PrivilegedAction<String>() {
-                  public String run() {
-                      return Security.getProperty(negativeCachePolicyProp);
-                  }
-              }));
-        } catch (NumberFormatException e) {
-            // ignore
-        }
+                try {
+                    String tmpString = System.getProperty(negativeCachePolicyPropFallback);
+                    if (tmpString != null) {
+                        return Integer.decode(tmpString);
+                    }
+                } catch (NumberFormatException ignored) {
+                    // Ignore
+                }
+                return null;
+            }
+          });
 
         if (tmp != null) {
             negativeCachePolicy = tmp.intValue();
@@ -140,16 +153,6 @@
                 negativeCachePolicy = FOREVER;
             }
             propertyNegativeSet = true;
-        } else {
-            tmp = java.security.AccessController.doPrivileged
-                (new sun.security.action.GetIntegerAction(negativeCachePolicyPropFallback));
-            if (tmp != null) {
-                negativeCachePolicy = tmp.intValue();
-                if (negativeCachePolicy < 0) {
-                    negativeCachePolicy = FOREVER;
-                }
-                propertyNegativeSet = true;
-            }
         }
     }
 
diff --git a/jdk/src/share/classes/sun/net/ftp/impl/FtpClient.java b/jdk/src/share/classes/sun/net/ftp/impl/FtpClient.java
index 0f4bf3f..9c3fb96 100644
--- a/jdk/src/share/classes/sun/net/ftp/impl/FtpClient.java
+++ b/jdk/src/share/classes/sun/net/ftp/impl/FtpClient.java
@@ -32,6 +32,7 @@
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
+import java.util.Base64;
 import java.util.Calendar;
 import java.util.Date;
 import java.util.Iterator;
@@ -42,8 +43,6 @@
 import java.util.regex.Pattern;
 import javax.net.ssl.SSLSocket;
 import javax.net.ssl.SSLSocketFactory;
-import sun.misc.BASE64Decoder;
-import sun.misc.BASE64Encoder;
 import sun.net.ftp.*;
 import sun.util.logging.PlatformLogger;
 
@@ -1899,22 +1898,16 @@
     }
 
     private boolean sendSecurityData(byte[] buf) throws IOException {
-        BASE64Encoder encoder = new BASE64Encoder();
-        String s = encoder.encode(buf);
+        String s = Base64.getMimeEncoder().encodeToString(buf);
         return issueCommand("ADAT " + s);
     }
 
     private byte[] getSecurityData() {
         String s = getLastResponseString();
         if (s.substring(4, 9).equalsIgnoreCase("ADAT=")) {
-            BASE64Decoder decoder = new BASE64Decoder();
-            try {
-                // Need to get rid of the leading '315 ADAT='
-                // and the trailing newline
-                return decoder.decodeBuffer(s.substring(9, s.length() - 1));
-            } catch (IOException e) {
-                //
-            }
+            // Need to get rid of the leading '315 ADAT='
+            // and the trailing newline
+            return Base64.getMimeDecoder().decode(s.substring(9, s.length() - 1));
         }
         return null;
     }
diff --git a/jdk/src/share/classes/sun/net/util/IPAddressUtil.java b/jdk/src/share/classes/sun/net/util/IPAddressUtil.java
index 4cef8ab..4dafa8a 100644
--- a/jdk/src/share/classes/sun/net/util/IPAddressUtil.java
+++ b/jdk/src/share/classes/sun/net/util/IPAddressUtil.java
@@ -37,90 +37,73 @@
      * @param src a String representing an IPv4 address in standard format
      * @return a byte array representing the IPv4 numeric address
      */
+    @SuppressWarnings("fallthrough")
     public static byte[] textToNumericFormatV4(String src)
     {
-        if (src.length() == 0) {
+        byte[] res = new byte[INADDR4SZ];
+
+        long tmpValue = 0;
+        int currByte = 0;
+
+        int len = src.length();
+        if (len == 0 || len > 15) {
             return null;
         }
-
-        byte[] res = new byte[INADDR4SZ];
-        String[] s = src.split("\\.", -1);
-        long val;
-        try {
-            switch(s.length) {
-            case 1:
-                /*
-                 * When only one part is given, the value is stored directly in
-                 * the network address without any byte rearrangement.
-                 */
-
-                val = Long.parseLong(s[0]);
-                if (val < 0 || val > 0xffffffffL)
+        /*
+         * When only one part is given, the value is stored directly in
+         * the network address without any byte rearrangement.
+         *
+         * When a two part address is supplied, the last part is
+         * interpreted as a 24-bit quantity and placed in the right
+         * most three bytes of the network address. This makes the
+         * two part address format convenient for specifying Class A
+         * network addresses as net.host.
+         *
+         * When a three part address is specified, the last part is
+         * interpreted as a 16-bit quantity and placed in the right
+         * most two bytes of the network address. This makes the
+         * three part address format convenient for specifying
+         * Class B net- work addresses as 128.net.host.
+         *
+         * When four parts are specified, each is interpreted as a
+         * byte of data and assigned, from left to right, to the
+         * four bytes of an IPv4 address.
+         *
+         * We determine and parse the leading parts, if any, as single
+         * byte values in one pass directly into the resulting byte[],
+         * then the remainder is treated as a 8-to-32-bit entity and
+         * translated into the remaining bytes in the array.
+         */
+        for (int i = 0; i < len; i++) {
+            char c = src.charAt(i);
+            if (c == '.') {
+                if (tmpValue < 0 || tmpValue > 0xff || currByte == 3) {
                     return null;
-                res[0] = (byte) ((val >> 24) & 0xff);
-                res[1] = (byte) (((val & 0xffffff) >> 16) & 0xff);
-                res[2] = (byte) (((val & 0xffff) >> 8) & 0xff);
-                res[3] = (byte) (val & 0xff);
-                break;
-            case 2:
-                /*
-                 * When a two part address is supplied, the last part is
-                 * interpreted as a 24-bit quantity and placed in the right
-                 * most three bytes of the network address. This makes the
-                 * two part address format convenient for specifying Class A
-                 * network addresses as net.host.
-                 */
-
-                val = Integer.parseInt(s[0]);
-                if (val < 0 || val > 0xff)
-                    return null;
-                res[0] = (byte) (val & 0xff);
-                val = Integer.parseInt(s[1]);
-                if (val < 0 || val > 0xffffff)
-                    return null;
-                res[1] = (byte) ((val >> 16) & 0xff);
-                res[2] = (byte) (((val & 0xffff) >> 8) &0xff);
-                res[3] = (byte) (val & 0xff);
-                break;
-            case 3:
-                /*
-                 * When a three part address is specified, the last part is
-                 * interpreted as a 16-bit quantity and placed in the right
-                 * most two bytes of the network address. This makes the
-                 * three part address format convenient for specifying
-                 * Class B net- work addresses as 128.net.host.
-                 */
-                for (int i = 0; i < 2; i++) {
-                    val = Integer.parseInt(s[i]);
-                    if (val < 0 || val > 0xff)
-                        return null;
-                    res[i] = (byte) (val & 0xff);
                 }
-                val = Integer.parseInt(s[2]);
-                if (val < 0 || val > 0xffff)
+                res[currByte++] = (byte) (tmpValue & 0xff);
+                tmpValue = 0;
+            } else {
+                int digit = Character.digit(c, 10);
+                if (digit < 0) {
                     return null;
-                res[2] = (byte) ((val >> 8) & 0xff);
-                res[3] = (byte) (val & 0xff);
-                break;
-            case 4:
-                /*
-                 * When four parts are specified, each is interpreted as a
-                 * byte of data and assigned, from left to right, to the
-                 * four bytes of an IPv4 address.
-                 */
-                for (int i = 0; i < 4; i++) {
-                    val = Integer.parseInt(s[i]);
-                    if (val < 0 || val > 0xff)
-                        return null;
-                    res[i] = (byte) (val & 0xff);
                 }
-                break;
-            default:
-                return null;
+                tmpValue *= 10;
+                tmpValue += digit;
             }
-        } catch(NumberFormatException e) {
+        }
+        if (tmpValue < 0 || tmpValue >= (1L << ((4 - currByte) * 8))) {
             return null;
         }
+        switch (currByte) {
+            case 0:
+                res[0] = (byte) ((tmpValue >> 24) & 0xff);
+            case 1:
+                res[1] = (byte) ((tmpValue >> 16) & 0xff);
+            case 2:
+                res[2] = (byte) ((tmpValue >>  8) & 0xff);
+            case 3:
+                res[3] = (byte) ((tmpValue >>  0) & 0xff);
+        }
         return res;
     }
 
diff --git a/jdk/src/share/classes/sun/net/www/http/HttpClient.java b/jdk/src/share/classes/sun/net/www/http/HttpClient.java
index 44a5253..3013da0 100644
--- a/jdk/src/share/classes/sun/net/www/http/HttpClient.java
+++ b/jdk/src/share/classes/sun/net/www/http/HttpClient.java
@@ -665,7 +665,9 @@
                     // try once more
                     openServer();
                     if (needsTunneling()) {
+                        MessageHeader origRequests = requests;
                         httpuc.doTunneling();
+                        requests = origRequests;
                     }
                     afterConnect();
                     writeRequests(requests, poster);
@@ -776,7 +778,9 @@
                         cachedHttpClient = false;
                         openServer();
                         if (needsTunneling()) {
+                            MessageHeader origRequests = requests;
                             httpuc.doTunneling();
+                            requests = origRequests;
                         }
                         afterConnect();
                         writeRequests(requests, poster);
diff --git a/jdk/src/share/classes/sun/security/pkcs/PKCS7.java b/jdk/src/share/classes/sun/security/pkcs/PKCS7.java
index fdc295c..19211ae 100644
--- a/jdk/src/share/classes/sun/security/pkcs/PKCS7.java
+++ b/jdk/src/share/classes/sun/security/pkcs/PKCS7.java
@@ -802,7 +802,8 @@
                                             byte[] content,
                                             String signatureAlgorithm,
                                             URI tsaURI,
-                                            String tSAPolicyID)
+                                            String tSAPolicyID,
+                                            String tSADigestAlg)
         throws CertificateException, IOException, NoSuchAlgorithmException
     {
 
@@ -811,7 +812,8 @@
         if (tsaURI != null) {
             // Timestamp the signature
             HttpTimestamper tsa = new HttpTimestamper(tsaURI);
-            byte[] tsToken = generateTimestampToken(tsa, tSAPolicyID, signature);
+            byte[] tsToken = generateTimestampToken(
+                    tsa, tSAPolicyID, tSADigestAlg, signature);
 
             // Insert the timestamp token into the PKCS #7 signer info element
             // (as an unsigned attribute)
@@ -869,6 +871,7 @@
      */
     private static byte[] generateTimestampToken(Timestamper tsa,
                                                  String tSAPolicyID,
+                                                 String tSADigestAlg,
                                                  byte[] toBeTimestamped)
         throws IOException, CertificateException
     {
@@ -876,11 +879,10 @@
         MessageDigest messageDigest = null;
         TSRequest tsQuery = null;
         try {
-            // SHA-1 is always used.
-            messageDigest = MessageDigest.getInstance("SHA-1");
+            messageDigest = MessageDigest.getInstance(tSADigestAlg);
             tsQuery = new TSRequest(tSAPolicyID, toBeTimestamped, messageDigest);
         } catch (NoSuchAlgorithmException e) {
-            // ignore
+            throw new IllegalArgumentException(e);
         }
 
         // Generate a nonce
@@ -908,9 +910,13 @@
         PKCS7 tsToken = tsReply.getToken();
 
         TimestampToken tst = tsReply.getTimestampToken();
-        if (!tst.getHashAlgorithm().getName().equals("SHA-1")) {
-            throw new IOException("Digest algorithm not SHA-1 in "
-                                  + "timestamp token");
+        try {
+            if (!tst.getHashAlgorithm().equals(AlgorithmId.get(tSADigestAlg))) {
+                throw new IOException("Digest algorithm not " + tSADigestAlg + " in "
+                                      + "timestamp token");
+            }
+        } catch (NoSuchAlgorithmException nase) {
+            throw new IllegalArgumentException();   // should have been caught before
         }
         if (!MessageDigest.isEqual(tst.getHashedMessage(),
                                    tsQuery.getHashedMessage())) {
diff --git a/jdk/src/share/classes/sun/security/tools/jarsigner/Main.java b/jdk/src/share/classes/sun/security/tools/jarsigner/Main.java
index 727f92f..ec2247d 100644
--- a/jdk/src/share/classes/sun/security/tools/jarsigner/Main.java
+++ b/jdk/src/share/classes/sun/security/tools/jarsigner/Main.java
@@ -139,6 +139,7 @@
     String tsaAlias; // alias for the Timestamping Authority's certificate
     String altCertChain; // file to read alternative cert chain from
     String tSAPolicyID;
+    String tSADigestAlg = "SHA-256";
     boolean verify = false; // verify the jar
     String verbose = null; // verbose output when signing/verifying
     boolean showcerts = false; // show certs when verifying
@@ -342,6 +343,9 @@
             } else if (collator.compare(flags, "-tsapolicyid") ==0) {
                 if (++n == args.length) usageNoArg();
                 tSAPolicyID = args[n];
+            } else if (collator.compare(flags, "-tsadigestalg") ==0) {
+                if (++n == args.length) usageNoArg();
+                tSADigestAlg = args[n];
             } else if (collator.compare(flags, "-debug") ==0) {
                 debug = true;
             } else if (collator.compare(flags, "-keypass") ==0) {
@@ -536,6 +540,9 @@
                 (".tsapolicyid.tsapolicyid.for.Timestamping.Authority"));
         System.out.println();
         System.out.println(rb.getString
+                (".tsadigestalg.algorithm.of.digest.data.in.timestamping.request"));
+        System.out.println();
+        System.out.println(rb.getString
                 (".altsigner.class.class.name.of.an.alternative.signing.mechanism"));
         System.out.println();
         System.out.println(rb.getString
@@ -1270,8 +1277,8 @@
             try {
                 block =
                     sf.generateBlock(privateKey, sigalg, certChain,
-                        externalSF, tsaUrl, tsaCert, tSAPolicyID, signingMechanism, args,
-                        zipFile);
+                        externalSF, tsaUrl, tsaCert, tSAPolicyID, tSADigestAlg,
+                        signingMechanism, args, zipFile);
             } catch (SocketTimeoutException e) {
                 // Provide a helpful message when TSA is beyond a firewall
                 error(rb.getString("unable.to.sign.jar.") +
@@ -2254,13 +2261,14 @@
                                boolean externalSF, String tsaUrl,
                                X509Certificate tsaCert,
                                String tSAPolicyID,
+                               String tSADigestAlg,
                                ContentSigner signingMechanism,
                                String[] args, ZipFile zipFile)
         throws NoSuchAlgorithmException, InvalidKeyException, IOException,
             SignatureException, CertificateException
     {
         return new Block(this, privateKey, sigalg, certChain, externalSF,
-                tsaUrl, tsaCert, tSAPolicyID, signingMechanism, args, zipFile);
+                tsaUrl, tsaCert, tSAPolicyID, tSADigestAlg, signingMechanism, args, zipFile);
     }
 
 
@@ -2274,8 +2282,8 @@
          */
         Block(SignatureFile sfg, PrivateKey privateKey, String sigalg,
             X509Certificate[] certChain, boolean externalSF, String tsaUrl,
-            X509Certificate tsaCert, String tSAPolicyID, ContentSigner signingMechanism,
-            String[] args, ZipFile zipFile)
+            X509Certificate tsaCert, String tSAPolicyID, String tSADigestAlg,
+            ContentSigner signingMechanism, String[] args, ZipFile zipFile)
             throws NoSuchAlgorithmException, InvalidKeyException, IOException,
             SignatureException, CertificateException {
 
@@ -2357,7 +2365,8 @@
 
             // Assemble parameters for the signing mechanism
             ContentSignerParameters params =
-                new JarSignerParameters(args, tsaUri, tsaCert, tSAPolicyID, signature,
+                new JarSignerParameters(args, tsaUri, tsaCert, tSAPolicyID,
+                        tSADigestAlg, signature,
                     signatureAlgorithm, certChain, content, zipFile);
 
             // Generate the signature block
@@ -2402,24 +2411,26 @@
     private byte[] content;
     private ZipFile source;
     private String tSAPolicyID;
+    private String tSADigestAlg;
 
     /**
      * Create a new object.
      */
     JarSignerParameters(String[] args, URI tsa, X509Certificate tsaCertificate,
-        String tSAPolicyID,
+        String tSAPolicyID, String tSADigestAlg,
         byte[] signature, String signatureAlgorithm,
         X509Certificate[] signerCertificateChain, byte[] content,
         ZipFile source) {
 
         if (signature == null || signatureAlgorithm == null ||
-            signerCertificateChain == null) {
+            signerCertificateChain == null || tSADigestAlg == null) {
             throw new NullPointerException();
         }
         this.args = args;
         this.tsa = tsa;
         this.tsaCertificate = tsaCertificate;
         this.tSAPolicyID = tSAPolicyID;
+        this.tSADigestAlg = tSADigestAlg;
         this.signature = signature;
         this.signatureAlgorithm = signatureAlgorithm;
         this.signerCertificateChain = signerCertificateChain;
@@ -2458,6 +2469,10 @@
         return tSAPolicyID;
     }
 
+    public String getTSADigestAlg() {
+        return tSADigestAlg;
+    }
+
     /**
      * Retrieves the signature.
      *
diff --git a/jdk/src/share/classes/sun/security/tools/jarsigner/Resources.java b/jdk/src/share/classes/sun/security/tools/jarsigner/Resources.java
index 77b0628..db35b1e 100644
--- a/jdk/src/share/classes/sun/security/tools/jarsigner/Resources.java
+++ b/jdk/src/share/classes/sun/security/tools/jarsigner/Resources.java
@@ -88,6 +88,8 @@
                 "[-tsacert <alias>]          public key certificate for Timestamping Authority"},
         {".tsapolicyid.tsapolicyid.for.Timestamping.Authority",
                 "[-tsapolicyid <oid>]        TSAPolicyID for Timestamping Authority"},
+        {".tsadigestalg.algorithm.of.digest.data.in.timestamping.request",
+                "[-tsadigestalg <algorithm>] algorithm of digest data in timestamping request"},
         {".altsigner.class.class.name.of.an.alternative.signing.mechanism",
                 "[-altsigner <class>]        class name of an alternative signing mechanism"},
         {".altsignerpath.pathlist.location.of.an.alternative.signing.mechanism",
diff --git a/jdk/src/share/classes/sun/security/tools/jarsigner/TimestampedSigner.java b/jdk/src/share/classes/sun/security/tools/jarsigner/TimestampedSigner.java
index 3e50419..df9159f 100644
--- a/jdk/src/share/classes/sun/security/tools/jarsigner/TimestampedSigner.java
+++ b/jdk/src/share/classes/sun/security/tools/jarsigner/TimestampedSigner.java
@@ -134,7 +134,8 @@
         }
         return PKCS7.generateSignedData(signature, signerChain, content,
                                         params.getSignatureAlgorithm(), tsaURI,
-                                        params.getTSAPolicyID());
+                                        params.getTSAPolicyID(),
+                                        params.getTSADigestAlg());
     }
 
     /**
diff --git a/jdk/src/solaris/classes/java/net/PlainDatagramSocketImpl.java b/jdk/src/solaris/classes/java/net/PlainDatagramSocketImpl.java
index 1779cfb..6a29a9b 100644
--- a/jdk/src/solaris/classes/java/net/PlainDatagramSocketImpl.java
+++ b/jdk/src/solaris/classes/java/net/PlainDatagramSocketImpl.java
@@ -56,6 +56,7 @@
         }
     }
 
+    @SuppressWarnings("unchecked")
     protected <T> T getOption(SocketOption<T> name) throws IOException {
         if (!name.equals(ExtendedSocketOptions.SO_FLOW_SLA)) {
             return super.getOption(name);
@@ -70,7 +71,7 @@
     }
 
     protected Set<SocketOption<?>> supportedOptions() {
-        HashSet<SocketOption<?>> options = new HashSet(
+        HashSet<SocketOption<?>> options = new HashSet<>(
             super.supportedOptions());
 
         if (flowSupported()) {
diff --git a/jdk/src/solaris/classes/java/net/PlainSocketImpl.java b/jdk/src/solaris/classes/java/net/PlainSocketImpl.java
index b0dfd02..735f5d3 100644
--- a/jdk/src/solaris/classes/java/net/PlainSocketImpl.java
+++ b/jdk/src/solaris/classes/java/net/PlainSocketImpl.java
@@ -70,6 +70,7 @@
         }
     }
 
+    @SuppressWarnings("unchecked")
     protected <T> T getOption(SocketOption<T> name) throws IOException {
         if (!name.equals(ExtendedSocketOptions.SO_FLOW_SLA)) {
             return super.getOption(name);
@@ -84,7 +85,7 @@
     }
 
     protected Set<SocketOption<?>> supportedOptions() {
-        HashSet<SocketOption<?>> options = new HashSet(
+        HashSet<SocketOption<?>> options = new HashSet<>(
             super.supportedOptions());
 
         if (getSocket() != null && flowSupported()) {
diff --git a/jdk/test/ProblemList.txt b/jdk/test/ProblemList.txt
index 2b18741..2105846 100644
--- a/jdk/test/ProblemList.txt
+++ b/jdk/test/ProblemList.txt
@@ -1,6 +1,6 @@
 ###########################################################################
 #
-# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2009, 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
@@ -120,9 +120,6 @@
 
 # jdk_lang
 
-# 8029415
-java/lang/reflect/Method/invoke/TestPrivateInterfaceMethodReflect.java generic-all
-
 ############################################################################
 
 # jdk_management
@@ -151,9 +148,6 @@
 
 # jdk_net
 
-# Filed 7052625
-com/sun/net/httpserver/bugs/6725892/Test.java                   generic-all
-
 # 7148829
 sun/net/InetAddress/nameservice/simple/CacheTest.java		generic-all
 sun/net/InetAddress/nameservice/simple/DefaultCaching.java	generic-all
diff --git a/jdk/test/TEST.groups b/jdk/test/TEST.groups
index 1d58950..5ea0c43 100644
--- a/jdk/test/TEST.groups
+++ b/jdk/test/TEST.groups
@@ -194,7 +194,7 @@
     com/sun/jndi \
     com/sun/corba \
     lib/testlibrary \
-    demo/zipfs \
+    jdk/nio/zipfs \
     sample
 
 #
diff --git a/jdk/test/com/sun/jarsigner/DefaultMethod.java b/jdk/test/com/sun/jarsigner/DefaultMethod.java
new file mode 100644
index 0000000..fba9281
--- /dev/null
+++ b/jdk/test/com/sun/jarsigner/DefaultMethod.java
@@ -0,0 +1,78 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8039358
+ * @summary com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be default
+ * @compile DefaultMethod.java
+ */
+
+import com.sun.jarsigner.ContentSignerParameters;
+
+import java.net.URI;
+import java.security.cert.X509Certificate;
+import java.util.zip.ZipFile;
+
+public class DefaultMethod implements ContentSignerParameters {
+
+    @Override
+    public String[] getCommandLine() {
+        return new String[0];
+    }
+
+    @Override
+    public URI getTimestampingAuthority() {
+        return null;
+    }
+
+    @Override
+    public X509Certificate getTimestampingAuthorityCertificate() {
+        return null;
+    }
+
+    @Override
+    public byte[] getSignature() {
+        return new byte[0];
+    }
+
+    @Override
+    public String getSignatureAlgorithm() {
+        return null;
+    }
+
+    @Override
+    public X509Certificate[] getSignerCertificateChain() {
+        return new X509Certificate[0];
+    }
+
+    @Override
+    public byte[] getContent() {
+        return new byte[0];
+    }
+
+    @Override
+    public ZipFile getSource() {
+        return null;
+    }
+}
diff --git a/jdk/test/com/sun/jndi/ldap/Base64Test.java b/jdk/test/com/sun/jndi/ldap/Base64Test.java
new file mode 100644
index 0000000..a5547af
--- /dev/null
+++ b/jdk/test/com/sun/jndi/ldap/Base64Test.java
@@ -0,0 +1,214 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug 8035807
+ * @summary Confirm that old and new Base64 encodings are compatible.
+ */
+
+import java.io.*;
+import java.util.*;
+import javax.naming.*;
+import javax.naming.directory.*;
+
+import sun.misc.BASE64Decoder;
+
+/*
+ * RFC 2713 specifies an encoding for Java objects stored in an LDAP directory.
+ * Section 3.6 specifies how a binary-valued JNDI RefAddr object is encoded
+ * in the value of a javaReferenceAttribute LDAP attribute: first the RefAddr
+ * object is serialized and then it is encoded using Base64.
+ *
+ * Since JDK 9, the JNDI/LDAP provider uses the public Base64 encoder which
+ * adheres strictly to the MIME encoding rules. The encoder inserts '\r\n'
+ * as the line separator at intervals of 76 characters. Previously the
+ * JNDI/LDAP provider used a private Base64 encoder which inserted '\n'
+ * as the line separator. It is a compatible change.
+ *
+ * This test demonstrates that there is no compatability problem when
+ * encoding and decoding using either Base64 coder:
+ *
+ *   encode with s.m.BASE64Encoder,  decode with s.m.BASE64Decoder  => OK
+ *   encode with s.m.BASE64Encoder,  decode with j.u.Base64.Decoder => OK
+ *   encode with j.u.Base64.Encoder, decode with s.m.BASE64Decoder  => OK
+ *   encode with j.u.Base64.Encoder, decode with j.u.Base64.Decoder => OK
+ *
+ *
+ * NOTE: The two Base64 encodings used in this test were captured from
+ *       LDAP protocol exchanges during attempts by the JNDI/LDAP provider
+ *       to store a JNDI Reference test object.
+ */
+
+public class Base64Test {
+    /*
+     * The old Base64 encoding uses '\n' as the line separator at 76 character
+     * intervals:
+     *
+     * 0000: 72 4F 30 41 42 58 4E 79 41 42 70 71 59 58 5A 68  rO0ABXNyABpqYXZh
+     * 0010: 65 43 35 75 59 57 31 70 62 6D 63 75 51 6D 6C 75  eC5uYW1pbmcuQmlu
+     * 0020: 59 58 4A 35 55 6D 56 6D 51 57 52 6B 63 74 43 61  YXJ5UmVmQWRkctCa
+     * 0030: 6B 37 4C 65 73 34 68 48 41 67 41 42 57 77 41 44  k7Les4hHAgABWwAD
+     * 0040: 59 6E 56 6D 64 41 41 43 57 30 4A 34 0A 63 67 41  YnVmdAACW0J4.cgA <
+     * 0050: 55 61 6D 46 32 59 58 67 75 62 6D 46 74 61 57 35  UamF2YXgubmFtaW5
+     * 0060: 6E 4C 6C 4A 6C 5A 6B 46 6B 5A 48 4C 72 6F 41 65  nLlJlZkFkZHLroAe
+     * 0070: 61 41 6A 69 76 53 67 49 41 41 55 77 41 43 47 46  aAjivSgIAAUwACGF
+     * 0080: 6B 5A 48 4A 55 65 58 42 6C 64 41 41 53 54 47 70  kZHJUeXBldAASTGp
+     * 0090: 68 64 6D 45 76 62 47 46 75 0A 5A 79 39 54 64 48  hdmEvbGFu.Zy9TdH <
+     * 00A0: 4A 70 62 6D 63 37 65 48 42 30 41 41 52 30 5A 58  Jpbmc7eHB0AAR0ZX
+     * 00B0: 4E 30 64 58 49 41 41 6C 74 43 72 50 4D 58 2B 41  N0dXIAAltCrPMX+A
+     * 00C0: 59 49 56 4F 41 43 41 41 42 34 63 41 41 41 41 49  YIVOACAAB4cAAAAI
+     * 00D0: 41 41 41 51 49 44 42 41 55 47 42 77 67 4A 43 67  AAAQIDBAUGBwgJCg
+     * 00E0: 73 4D 44 51 34 50 0A 45 42 45 53 45 78 51 56 46  sMDQ4P.EBESExQVF <
+     * 00F0: 68 63 59 47 52 6F 62 48 42 30 65 48 79 41 68 49  hcYGRobHB0eHyAhI
+     * 0100: 69 4D 6B 4A 53 59 6E 4B 43 6B 71 4B 79 77 74 4C  iMkJSYnKCkqKywtL
+     * 0110: 69 38 77 4D 54 49 7A 4E 44 55 32 4E 7A 67 35 4F  i8wMTIzNDU2Nzg5O
+     * 0120: 6A 73 38 50 54 34 2F 51 45 46 43 51 30 52 46 52  js8PT4/QEFCQ0RFR
+     * 0130: 6B 64 49 0A 53 55 70 4C 54 45 31 4F 54 31 42 52  kdI.SUpLTE1OT1BR <
+     * 0140: 55 6C 4E 55 56 56 5A 58 57 46 6C 61 57 31 78 64  UlNUVVZXWFlaW1xd
+     * 0150: 58 6C 39 67 59 57 4A 6A 5A 47 56 6D 5A 32 68 70  Xl9gYWJjZGVmZ2hp
+     * 0160: 61 6D 74 73 62 57 35 76 63 48 46 79 63 33 52 31  amtsbW5vcHFyc3R1
+     * 0170: 64 6E 64 34 65 58 70 37 66 48 31 2B 66 77 3D 3D  dnd4eXp7fH1+fw==
+     * 0180: 0A                                                                <
+     */
+    private static final String OLD_ENCODING = "rO0ABXNyABpqYXZheC5uYW1pbmcuQmluYXJ5UmVmQWRkctCak7Les4hHAgABWwADYnVmdAACW0J4\ncgAUamF2YXgubmFtaW5nLlJlZkFkZHLroAeaAjivSgIAAUwACGFkZHJUeXBldAASTGphdmEvbGFu\nZy9TdHJpbmc7eHB0AAR0ZXN0dXIAAltCrPMX+AYIVOACAAB4cAAAAIAAAQIDBAUGBwgJCgsMDQ4P\nEBESExQVFhcYGRobHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2Nzg5Ojs8PT4/QEFCQ0RFRkdI\nSUpLTE1OT1BRUlNUVVZXWFlaW1xdXl9gYWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXp7fH1+fw==\n";
+
+    /*
+     * The new Base64 encoding uses '\r\n' as the line separator at 76 character
+     * intervals:
+     *
+     * 0000: 72 4F 30 41 42 58 4E 79 41 42 70 71 59 58 5A 68  rO0ABXNyABpqYXZh
+     * 0010: 65 43 35 75 59 57 31 70 62 6D 63 75 51 6D 6C 75  eC5uYW1pbmcuQmlu
+     * 0020: 59 58 4A 35 55 6D 56 6D 51 57 52 6B 63 74 43 61  YXJ5UmVmQWRkctCa
+     * 0030: 6B 37 4C 65 73 34 68 48 41 67 41 42 57 77 41 44  k7Les4hHAgABWwAD
+     * 0040: 59 6E 56 6D 64 41 41 43 57 30 4A 34 0D 0A 63 67  YnVmdAACW0J4..cg <
+     * 0050: 41 55 61 6D 46 32 59 58 67 75 62 6D 46 74 61 57  AUamF2YXgubmFtaW
+     * 0060: 35 6E 4C 6C 4A 6C 5A 6B 46 6B 5A 48 4C 72 6F 41  5nLlJlZkFkZHLroA
+     * 0070: 65 61 41 6A 69 76 53 67 49 41 41 55 77 41 43 47  eaAjivSgIAAUwACG
+     * 0080: 46 6B 5A 48 4A 55 65 58 42 6C 64 41 41 53 54 47  FkZHJUeXBldAASTG
+     * 0090: 70 68 64 6D 45 76 62 47 46 75 0D 0A 5A 79 39 54  phdmEvbGFu..Zy9T <
+     * 00A0: 64 48 4A 70 62 6D 63 37 65 48 42 30 41 41 52 30  dHJpbmc7eHB0AAR0
+     * 00B0: 5A 58 4E 30 64 58 49 41 41 6C 74 43 72 50 4D 58  ZXN0dXIAAltCrPMX
+     * 00C0: 2B 41 59 49 56 4F 41 43 41 41 42 34 63 41 41 41  +AYIVOACAAB4cAAA
+     * 00D0: 41 49 41 41 41 51 49 44 42 41 55 47 42 77 67 4A  AIAAAQIDBAUGBwgJ
+     * 00E0: 43 67 73 4D 44 51 34 50 0D 0A 45 42 45 53 45 78  CgsMDQ4P..EBESEx <
+     * 00F0: 51 56 46 68 63 59 47 52 6F 62 48 42 30 65 48 79  QVFhcYGRobHB0eHy
+     * 0100: 41 68 49 69 4D 6B 4A 53 59 6E 4B 43 6B 71 4B 79  AhIiMkJSYnKCkqKy
+     * 0110: 77 74 4C 69 38 77 4D 54 49 7A 4E 44 55 32 4E 7A  wtLi8wMTIzNDU2Nz
+     * 0120: 67 35 4F 6A 73 38 50 54 34 2F 51 45 46 43 51 30  g5Ojs8PT4/QEFCQ0
+     * 0130: 52 46 52 6B 64 49 0D 0A 53 55 70 4C 54 45 31 4F  RFRkdI..SUpLTE1O <
+     * 0140: 54 31 42 52 55 6C 4E 55 56 56 5A 58 57 46 6C 61  T1BRUlNUVVZXWFla
+     * 0150: 57 31 78 64 58 6C 39 67 59 57 4A 6A 5A 47 56 6D  W1xdXl9gYWJjZGVm
+     * 0160: 5A 32 68 70 61 6D 74 73 62 57 35 76 63 48 46 79  Z2hpamtsbW5vcHFy
+     * 0170: 63 33 52 31 64 6E 64 34 65 58 70 37 66 48 31 2B  c3R1dnd4eXp7fH1+
+     * 0180: 66 77 3D 3D
+     */
+    private static final String NEW_ENCODING = "rO0ABXNyABpqYXZheC5uYW1pbmcuQmluYXJ5UmVmQWRkctCak7Les4hHAgABWwADYnVmdAACW0J4\r\ncgAUamF2YXgubmFtaW5nLlJlZkFkZHLroAeaAjivSgIAAUwACGFkZHJUeXBldAASTGphdmEvbGFu\r\nZy9TdHJpbmc7eHB0AAR0ZXN0dXIAAltCrPMX+AYIVOACAAB4cAAAAIAAAQIDBAUGBwgJCgsMDQ4P\r\nEBESExQVFhcYGRobHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2Nzg5Ojs8PT4/QEFCQ0RFRkdI\r\nSUpLTE1OT1BRUlNUVVZXWFlaW1xdXl9gYWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXp7fH1+fw==";
+
+    /*
+     * Binary-valued JNDI RefAddr test object
+     */
+    private static final RefAddr BINARY_REF_ADDR =
+        new BinaryRefAddr("test", new byte[] {
+        0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B,
+        0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+        0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23,
+        0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F,
+        0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B,
+        0x3C, 0x3D, 0x3E, 0x3F, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
+        0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50, 0x51, 0x52, 0x53,
+        0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F,
+        0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B,
+        0x6C, 0x6D, 0x6E, 0x6F, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
+        0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E, 0x7F
+    });
+
+    public static void main(String[] args) throws Exception {
+
+        System.out.println("\nOriginal RefAddr object:\n" + BINARY_REF_ADDR);
+        System.out.println("Old Base64 encoded serialized RefAddr object:\n" +
+            OLD_ENCODING);
+        System.out.println("Decode using old Base64 decoder...");
+        deserialize(new BASE64Decoder().decodeBuffer(OLD_ENCODING));
+
+        System.out.println("----");
+
+        System.out.println("\nOriginal RefAddr object:\n" + BINARY_REF_ADDR);
+        System.out.println("Old Base64 encoded serialized RefAddr object:\n" +
+            OLD_ENCODING);
+        System.out.println("Decode using new Base64 decoder...");
+        deserialize(new BASE64Decoder().decodeBuffer(OLD_ENCODING));
+
+        System.out.println("----");
+
+        System.out.println("\nOriginal RefAddr object:\n" + BINARY_REF_ADDR);
+        System.out.println("New Base64 encoded serialized RefAddr object:\n" +
+            NEW_ENCODING + "\n");
+        System.out.println("Decode using old Base64 decoder...");
+        deserialize(new BASE64Decoder().decodeBuffer(OLD_ENCODING));
+
+        System.out.println("----");
+
+        System.out.println("\nOriginal RefAddr object:\n" + BINARY_REF_ADDR);
+        System.out.println("New Base64 encoded serialized RefAddr object:\n" +
+            NEW_ENCODING + "\n");
+        System.out.println("Decode using new Base64 decoder...");
+        deserialize(Base64.getMimeDecoder().decode(NEW_ENCODING));
+
+        System.out.println("----");
+    }
+
+    /*
+     * Deserialize the decoded Base64 bytes to recover the BinaryRefAddr object.
+     */
+    private static void deserialize(byte[] bytes) throws Exception {
+
+        //System.out.println("\nSerialized RefAddr object: ");
+        //System.out.println(new sun.misc.HexDumpEncoder().encode(bytes));
+
+        ObjectInputStream objectStream =
+            new ObjectInputStream(new ByteArrayInputStream(bytes));
+        Object object = objectStream.readObject();
+        if (!BINARY_REF_ADDR.equals(object)) {
+            throw new Exception("Recovered object does not match the original");
+        }
+        System.out.println("Recovered RefAddr object:\n" + object);
+    }
+
+    /*
+     * Dumps the encoding of a JNDI Reference object during an attempt to store
+     * in an LDAP directory.
+     */
+    private static void storeObjectInLDAP() {
+        Hashtable env = new Hashtable();
+        env.put(Context.REFERRAL, "follow"); // omit an LDAP control
+        env.put("java.naming.ldap.version", "3"); // omit LDAP bind operation
+        env.put("com.sun.jndi.ldap.trace.ber", System.err); // dump protocol
+        try {
+            DirContext ctx = new InitialDirContext(env);
+            Reference reference = new Reference("test", BINARY_REF_ADDR);
+            ctx.bind("ldap://ldap.example.com/cn=test", reference);
+        } catch (NamingException ignore) {
+        }
+    }
+}
diff --git a/jdk/test/com/sun/nio/sctp/SctpChannel/SocketOptionTests.java b/jdk/test/com/sun/nio/sctp/SctpChannel/SocketOptionTests.java
index df1cbcc..af0aed0 100644
--- a/jdk/test/com/sun/nio/sctp/SctpChannel/SocketOptionTests.java
+++ b/jdk/test/com/sun/nio/sctp/SctpChannel/SocketOptionTests.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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
@@ -39,13 +39,13 @@
 import com.sun.nio.sctp.SctpServerChannel;
 import com.sun.nio.sctp.SctpSocketOption;
 import java.security.AccessController;
-import sun.security.action.GetPropertyAction;
+import java.security.PrivilegedAction;
 import static com.sun.nio.sctp.SctpStandardSocketOptions.*;
 import static java.lang.System.out;
 
 public class SocketOptionTests {
     final String osName = AccessController.doPrivileged(
-                    new GetPropertyAction("os.name"));
+                    (PrivilegedAction<String>)() -> System.getProperty("os.name"));
 
     <T> void checkOption(SctpChannel sc, SctpSocketOption<T> name,
             T expectedValue) throws IOException {
diff --git a/jdk/test/com/sun/nio/sctp/SctpMultiChannel/SocketOptionTests.java b/jdk/test/com/sun/nio/sctp/SctpMultiChannel/SocketOptionTests.java
index 8f7c6fc..250bf4c 100644
--- a/jdk/test/com/sun/nio/sctp/SctpMultiChannel/SocketOptionTests.java
+++ b/jdk/test/com/sun/nio/sctp/SctpMultiChannel/SocketOptionTests.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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
@@ -47,13 +47,13 @@
 import com.sun.nio.sctp.SctpServerChannel;
 import com.sun.nio.sctp.SctpSocketOption;
 import java.security.AccessController;
-import sun.security.action.GetPropertyAction;
+import java.security.PrivilegedAction;
 import static com.sun.nio.sctp.SctpStandardSocketOptions.*;
 import static java.lang.System.out;
 
 public class SocketOptionTests {
     final String osName = AccessController.doPrivileged(
-                    new GetPropertyAction("os.name"));
+                    (PrivilegedAction<String>)() -> System.getProperty("os.name"));
 
     <T> void checkOption(SctpMultiChannel smc, SctpSocketOption<T> name,
             T expectedValue) throws IOException {
diff --git a/jdk/test/java/lang/StringCoding/Enormous.java b/jdk/test/java/lang/StringCoding/Enormous.java
index 5f5066c..d05e5a3 100644
--- a/jdk/test/java/lang/StringCoding/Enormous.java
+++ b/jdk/test/java/lang/StringCoding/Enormous.java
@@ -34,6 +34,6 @@
         new String(bytes,"ASCII");
 
         // Another manifestation of this bug, reported in bug 6192102.
-        new sun.misc.BASE64Encoder().encode(bytes);
+        java.util.Base64.getEncoder().encodeToString(bytes);
     }
 }
diff --git a/jdk/test/java/lang/annotation/AnnotationType/AnnotationTypeRuntimeAssumptionTest.java b/jdk/test/java/lang/annotation/AnnotationType/AnnotationTypeRuntimeAssumptionTest.java
index 2d79c61..3258925 100644
--- a/jdk/test/java/lang/annotation/AnnotationType/AnnotationTypeRuntimeAssumptionTest.java
+++ b/jdk/test/java/lang/annotation/AnnotationType/AnnotationTypeRuntimeAssumptionTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 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,15 +25,18 @@
  * @test
  * @summary Test consistent parsing of ex-RUNTIME annotations that
  *          were changed and separately compiled to have CLASS retention
+ * @library /lib/testlibrary
+ * @build jdk.testlibrary.IOUtils
+ * @run main AnnotationTypeRuntimeAssumptionTest
  */
 
-import sun.misc.IOUtils;
-
 import java.io.IOException;
 import java.io.InputStream;
 import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
 
+import jdk.testlibrary.IOUtils;
+
 import static java.lang.annotation.RetentionPolicy.CLASS;
 import static java.lang.annotation.RetentionPolicy.RUNTIME;
 
@@ -137,7 +140,7 @@
                 String altPath = altName.replace('.', '/').concat(".class");
                 try (InputStream is = getResourceAsStream(altPath)) {
                     if (is != null) {
-                        byte[] bytes = IOUtils.readFully(is, -1, true);
+                        byte[] bytes = IOUtils.readFully(is);
                         // patch class bytes to contain original name
                         for (int i = 0; i < bytes.length - 2; i++) {
                             if (bytes[i] == '_' &&
@@ -160,7 +163,7 @@
                 String path = name.replace('.', '/').concat(".class");
                 try (InputStream is = getResourceAsStream(path)) {
                     if (is != null) {
-                        byte[] bytes = IOUtils.readFully(is, -1, true);
+                        byte[] bytes = IOUtils.readFully(is);
                         return defineClass(name, bytes, 0, bytes.length);
                     }
                     else {
diff --git a/jdk/test/java/lang/invoke/lambda/LambdaClassLoaderSerialization.java b/jdk/test/java/lang/invoke/lambda/LambdaClassLoaderSerialization.java
index 9d38102..6c97e34 100644
--- a/jdk/test/java/lang/invoke/lambda/LambdaClassLoaderSerialization.java
+++ b/jdk/test/java/lang/invoke/lambda/LambdaClassLoaderSerialization.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 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
@@ -22,11 +22,14 @@
  */
 
 /*
-@test
-@bug 8004970
-@summary Lambda serialization in the presence of class loaders
-@author Peter Levart
-*/
+ * @test
+ * @bug 8004970
+ * @summary Lambda serialization in the presence of class loaders
+ * @library /lib/testlibrary
+ * @build jdk.testlibrary.IOUtils
+ * @run main LambdaClassLoaderSerialization
+ * @author Peter Levart
+ */
 
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
@@ -37,6 +40,8 @@
 import java.io.Serializable;
 import java.util.Arrays;
 
+import jdk.testlibrary.IOUtils;
+
 public class LambdaClassLoaderSerialization {
 
     public interface SerializableRunnable extends Runnable, Serializable {}
@@ -125,7 +130,7 @@
             String path = name.replace('.', '/').concat(".class");
             try (InputStream is = getResourceAsStream(path)) {
                 if (is != null) {
-                    byte[] bytes = readFully(is);
+                    byte[] bytes = IOUtils.readFully(is);
                     return defineClass(name, bytes, 0, bytes.length);
                 } else {
                     throw new ClassNotFoundException(name);
@@ -135,30 +140,5 @@
                 throw new ClassNotFoundException(name, e);
             }
         }
-
-        static byte[] readFully(InputStream is) throws IOException {
-            byte[] output = {};
-            int pos = 0;
-            while (true) {
-                int bytesToRead;
-                if (pos >= output.length) { // Only expand when there's no room
-                    bytesToRead = output.length + 1024;
-                    if (output.length < pos + bytesToRead) {
-                        output = Arrays.copyOf(output, pos + bytesToRead);
-                    }
-                } else {
-                    bytesToRead = output.length - pos;
-                }
-                int cc = is.read(output, pos, bytesToRead);
-                if (cc < 0) {
-                    if (output.length != pos) {
-                        output = Arrays.copyOf(output, pos);
-                    }
-                    break;
-                }
-                pos += cc;
-            }
-            return output;
-        }
     }
 }
diff --git a/jdk/test/java/lang/ref/EarlyTimeout.java b/jdk/test/java/lang/ref/EarlyTimeout.java
index cbbc269..d103725 100644
--- a/jdk/test/java/lang/ref/EarlyTimeout.java
+++ b/jdk/test/java/lang/ref/EarlyTimeout.java
@@ -33,6 +33,7 @@
 import java.lang.ref.ReferenceQueue;
 import java.lang.ref.WeakReference;
 import java.util.concurrent.CountDownLatch;
+import static java.util.concurrent.TimeUnit.NANOSECONDS;
 
 /**
  * In order to demonstrate the issue we make several threads (two appears to be sufficient)
@@ -93,9 +94,9 @@
     public void run() {
         try {
             startedSignal.countDown();
-            long start = System.currentTimeMillis();
+            long start = System.nanoTime();
             reference = queue.remove(TIMEOUT);
-            actual = System.currentTimeMillis() - start;
+            actual = NANOSECONDS.toMillis(System.nanoTime() - start);
         } catch (InterruptedException ex) {
             throw new RuntimeException(ex);
         }
diff --git a/jdk/test/java/lang/reflect/Method/InterfaceStatic/StaticInterfaceMethodInWayOfDefault.java b/jdk/test/java/lang/reflect/Method/InterfaceStatic/StaticInterfaceMethodInWayOfDefault.java
index ffb384f..4ad93eb 100644
--- a/jdk/test/java/lang/reflect/Method/InterfaceStatic/StaticInterfaceMethodInWayOfDefault.java
+++ b/jdk/test/java/lang/reflect/Method/InterfaceStatic/StaticInterfaceMethodInWayOfDefault.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 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
@@ -27,6 +27,9 @@
  * @summary Test that a static method on an interface doesn't hide a default
  *          method with the same name and signature in a separate compilation
  *          scenario.
+ * @library /lib/testlibrary
+ * @build jdk.testlibrary.IOUtils
+ * @run main StaticInterfaceMethodInWayOfDefault
  */
 
 import java.io.IOException;
@@ -35,7 +38,7 @@
 import java.lang.reflect.Method;
 import java.util.concurrent.Callable;
 
-import sun.misc.IOUtils;
+import jdk.testlibrary.IOUtils;
 
 public class StaticInterfaceMethodInWayOfDefault {
     public interface A_v1 {
@@ -144,7 +147,7 @@
                 String altPath = altName.replace('.', '/').concat(".class");
                 try (InputStream is = getResourceAsStream(altPath)) {
                     if (is != null) {
-                        byte[] bytes = IOUtils.readFully(is, -1, true);
+                        byte[] bytes = IOUtils.readFully(is);
                         // patch class bytes to contain original name
                         for (int i = 0; i < bytes.length - 2; i++) {
                             if (bytes[i] == '_' &&
@@ -167,7 +170,7 @@
                 String path = name.replace('.', '/').concat(".class");
                 try (InputStream is = getResourceAsStream(path)) {
                     if (is != null) {
-                        byte[] bytes = IOUtils.readFully(is, -1, true);
+                        byte[] bytes = IOUtils.readFully(is);
                         return defineClass(name, bytes, 0, bytes.length);
                     }
                     else {
diff --git a/jdk/test/java/math/BigInteger/BitLengthOverflow.java b/jdk/test/java/math/BigInteger/BitLengthOverflow.java
index 04f11b2..ccbc3e9 100644
--- a/jdk/test/java/math/BigInteger/BitLengthOverflow.java
+++ b/jdk/test/java/math/BigInteger/BitLengthOverflow.java
@@ -22,7 +22,7 @@
  */
 
 /*
- * @ test
+ * @test
  * @bug 6910473
  * @summary Test that bitLength() is not negative
  * @author Dmitry Nadezhin
@@ -32,18 +32,15 @@
 public class BitLengthOverflow {
 
     public static void main(String[] args) {
-
         try {
             BigInteger x = BigInteger.ONE.shiftLeft(Integer.MAX_VALUE); // x = pow(2,Integer.MAX_VALUE)
-            if (x.bitLength() != (1L << 31))
+            if (x.bitLength() != (1L << 31)) {
                 throw new RuntimeException("Incorrect bitLength() " + x.bitLength());
+            }
             System.out.println("Surprisingly passed with correct bitLength() " + x.bitLength());
         } catch (ArithmeticException e) {
             // expected
             System.out.println("Overflow is reported by ArithmeticException, as expected");
-        } catch (OutOfMemoryError e) {
-            // possible
-            System.out.println("OutOfMemoryError");
         }
     }
 }
diff --git a/jdk/test/java/math/BigInteger/DivisionOverflow.java b/jdk/test/java/math/BigInteger/DivisionOverflow.java
index 075ecab..7f35d07 100644
--- a/jdk/test/java/math/BigInteger/DivisionOverflow.java
+++ b/jdk/test/java/math/BigInteger/DivisionOverflow.java
@@ -22,9 +22,10 @@
  */
 
 /*
- * @ test
+ * @test
  * @bug 8022780
  * @summary Test division of large values
+ * @run main/othervm -Xshare:off DivisionOverflow
  * @author Dmitry Nadezhin
  */
 import java.math.BigInteger;
@@ -38,14 +39,17 @@
             BigInteger[] qr = a.divideAndRemainder(b);
             BigInteger q = qr[0];
             BigInteger r = qr[1];
-            if (!r.equals(BigInteger.ZERO))
-                throw new RuntimeException("Incorrect singum() of remainder " + r.signum());
-            if (q.bitLength() != 2147482079)
+            if (!r.equals(BigInteger.ZERO)) {
+                throw new RuntimeException("Incorrect signum() of remainder " + r.signum());
+            }
+            if (q.bitLength() != 2147482079) {
                 throw new RuntimeException("Incorrect bitLength() of quotient " + q.bitLength());
+            }
             System.out.println("Division of large values passed without overflow.");
         } catch (OutOfMemoryError e) {
             // possible
-            System.out.println("OutOfMemoryError");
+            System.err.println("DivisionOverflow skipped: OutOfMemoryError");
+            System.err.println("Run jtreg with -javaoption:-Xmx8g");
         }
     }
 }
diff --git a/jdk/test/java/math/BigInteger/DoubleValueOverflow.java b/jdk/test/java/math/BigInteger/DoubleValueOverflow.java
index 443d6ae..bef5fba 100644
--- a/jdk/test/java/math/BigInteger/DoubleValueOverflow.java
+++ b/jdk/test/java/math/BigInteger/DoubleValueOverflow.java
@@ -22,7 +22,7 @@
  */
 
 /*
- * @ test
+ * @test
  * @bug 8021203
  * @summary Test that doubleValue() doesn't overflow
  * @author Dmitry Nadezhin
@@ -32,18 +32,15 @@
 public class DoubleValueOverflow {
 
     public static void main(String[] args) {
-
         try {
             BigInteger x = BigInteger.valueOf(2).shiftLeft(Integer.MAX_VALUE); // x = pow(2,pow(2,31))
-            if (x.doubleValue() != Double.POSITIVE_INFINITY)
+            if (x.doubleValue() != Double.POSITIVE_INFINITY) {
                 throw new RuntimeException("Incorrect doubleValue() " + x.doubleValue());
+            }
             System.out.println("Passed with correct result");
         } catch (ArithmeticException e) {
             // expected
             System.out.println("Overflow is reported by ArithmeticException, as expected");
-        } catch (OutOfMemoryError e) {
-            // possible
-            System.out.println("OutOfMemoryError");
         }
     }
 }
diff --git a/jdk/test/java/math/BigInteger/StringConstructorOverflow.java b/jdk/test/java/math/BigInteger/StringConstructorOverflow.java
index ac362d0..121b4c4 100644
--- a/jdk/test/java/math/BigInteger/StringConstructorOverflow.java
+++ b/jdk/test/java/math/BigInteger/StringConstructorOverflow.java
@@ -22,9 +22,11 @@
  */
 
 /*
- * @ test
+ * @test
+ * @ignore This test has huge memory requirements
  * @bug 8021204
  * @summary Test constructor BigInteger(String val, int radix) on very long string
+ * @run main/othervm -Xshare:off -Xmx8g StringConstructorOverflow
  * @author Dmitry Nadezhin
  */
 import java.math.BigInteger;
@@ -45,15 +47,16 @@
     public static void main(String[] args) {
         try {
             BigInteger bi = new BigInteger(makeLongHexString(), 16);
-            if (bi.compareTo(BigInteger.ONE) <= 0)
+            if (bi.compareTo(BigInteger.ONE) <= 0) {
                 throw new RuntimeException("Incorrect result " + bi.toString());
+            }
         } catch (ArithmeticException e) {
             // expected
             System.out.println("Overflow is reported by ArithmeticException, as expected");
         } catch (OutOfMemoryError e) {
             // possible
-            System.out.println("OutOfMemoryError");
-            System.out.println("Run jtreg with -javaoption:-Xmx8g");
+            System.err.println("StringConstructorOverflow skipped: OutOfMemoryError");
+            System.err.println("Run jtreg with -javaoption:-Xmx8g");
         }
     }
 }
diff --git a/jdk/test/java/math/BigInteger/SymmetricRangeTests.java b/jdk/test/java/math/BigInteger/SymmetricRangeTests.java
index abded05..b944a95 100644
--- a/jdk/test/java/math/BigInteger/SymmetricRangeTests.java
+++ b/jdk/test/java/math/BigInteger/SymmetricRangeTests.java
@@ -22,8 +22,8 @@
  */
 
 /*
- * This test is intentionally ignored because of huge memory requirements
- * @ test
+ * @test
+ * @ignore This test has huge memory requirements
  * @run main/timeout=180/othervm -Xmx8g SymmetricRangeTests
  * @bug 6910473 8021204 8021203 9005933
  * @summary Test range of BigInteger values
diff --git a/jdk/test/java/net/Inet4Address/textToNumericFormat.java b/jdk/test/java/net/Inet4Address/textToNumericFormat.java
index 8a74ba5..3fbb3fb 100644
--- a/jdk/test/java/net/Inet4Address/textToNumericFormat.java
+++ b/jdk/test/java/net/Inet4Address/textToNumericFormat.java
@@ -34,19 +34,25 @@
 public class textToNumericFormat {
 
     public static void main(String[] args) throws UnknownHostException {
-        List goodList = new ArrayList();
-        List badList = new ArrayList();
+        List<String> goodList = new ArrayList<>();
+        List<String> badList = new ArrayList<>();
         String goodAddrs[] = {
                            "224.0.1.0",
                            "238.255.255.255",
-                           "239.255.255.255" };
+                           "239.255.255.255",
+                           "239.255.65535",
+                           "239.16777215",
+                           "4294967295" };
 
         String badAddrs[] = {
                            "238.255.255.2550",
                            "256.255.255.255",
                            "238.255.2550.255",
                            "238.2550.255.255",
-                           "2380.255.255.255"};
+                           "2380.255.255.255",
+                           "239.255.65536",
+                           "239.16777216",
+                           "4294967296" };
 
         for (int i=0; i<goodAddrs.length; i++) {
             try {
diff --git a/jdk/test/java/nio/charset/Charset/NIOCharsetAvailabilityTest.java b/jdk/test/java/nio/charset/Charset/NIOCharsetAvailabilityTest.java
index 78913f2..1e50571 100644
--- a/jdk/test/java/nio/charset/Charset/NIOCharsetAvailabilityTest.java
+++ b/jdk/test/java/nio/charset/Charset/NIOCharsetAvailabilityTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 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.net.URL;
 import java.net.URLClassLoader;
 import java.nio.charset.Charset;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 import java.util.Collection;
 import java.util.HashSet;
 import java.util.Iterator;
@@ -89,12 +91,10 @@
     private static void addCharsets(Set charsets, final String packageName)
             throws Exception {
 
-        String classPath =
-            (String) java.security.AccessController.doPrivileged(
-             new sun.security.action.GetPropertyAction("sun.boot.class.path"));
-        String s =
-            (String) java.security.AccessController.doPrivileged(
-             new sun.security.action.GetPropertyAction("java.class.path"));
+        String classPath = AccessController.doPrivileged(
+             (PrivilegedAction<String>)() -> System.getProperty("sun.boot.class.path"));
+        String s = AccessController.doPrivileged(
+             (PrivilegedAction<String>)() -> System.getProperty("java.class.path"));
 
         // Search combined system and application class path
         if (s != null && s.length() != 0) {
diff --git a/jdk/test/java/sql/TEST.properties b/jdk/test/java/sql/TEST.properties
new file mode 100644
index 0000000..295505b
--- /dev/null
+++ b/jdk/test/java/sql/TEST.properties
@@ -0,0 +1,3 @@
+# JDBC unit tests uses TestNG
+TestNG.dirs = .
+
diff --git a/jdk/test/java/sql/test/sql/BatchUpdateExceptionTests.java b/jdk/test/java/sql/test/sql/BatchUpdateExceptionTests.java
new file mode 100644
index 0000000..2b1111b
--- /dev/null
+++ b/jdk/test/java/sql/test/sql/BatchUpdateExceptionTests.java
@@ -0,0 +1,326 @@
+/*
+ * 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.
+ *
+ * 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 test.sql;
+
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.ObjectInputStream;
+import java.sql.BatchUpdateException;
+import java.sql.SQLException;
+import java.util.Arrays;
+import static org.testng.Assert.*;
+import org.testng.annotations.Test;
+import util.SerializedBatchUpdateException;
+import util.BaseTest;
+
+public class BatchUpdateExceptionTests extends BaseTest {
+
+    private final int[] uc = {1, 2, 3};
+    private final long[] luc = {1, 2, 3};
+
+    private final String testSrcDir = System.getProperty("test.src", ".")
+            + File.separatorChar;
+
+    /**
+     * Create BatchUpdateException and setting all objects to null
+     */
+    @Test
+    public void test() {
+        BatchUpdateException be = new BatchUpdateException(null,
+                null, errorCode, (int[]) null, null);
+        assertTrue(be.getMessage() == null && be.getSQLState() == null
+                && be.getUpdateCounts() == null && be.getCause() == null
+                && be.getLargeUpdateCounts() == null
+                && be.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create BatchUpdateException with no-arg constructor
+     */
+    @Test
+    public void test1() {
+        BatchUpdateException ex = new BatchUpdateException();
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0
+                && ex.getUpdateCounts() == null
+                && ex.getLargeUpdateCounts() == null);
+    }
+
+    /**
+     * Create BatchUpdateException with null Throwable
+     */
+    @Test
+    public void test2() {
+        BatchUpdateException ex = new BatchUpdateException((Throwable) null);
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0
+                && ex.getUpdateCounts() == null
+                && ex.getLargeUpdateCounts() == null);
+    }
+
+    /**
+     * Create BatchUpdateException with message and update counts
+     */
+    @Test
+    public void test3() {
+
+        BatchUpdateException ex = new BatchUpdateException(reason, uc);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0
+                && Arrays.equals(ex.getUpdateCounts(), uc)
+                && Arrays.equals(ex.getLargeUpdateCounts(), luc)
+        );
+    }
+
+    /**
+     * Create BatchUpdateException with update counts
+     */
+    @Test
+    public void test4() {
+        BatchUpdateException ex = new BatchUpdateException(uc);
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0
+                && Arrays.equals(ex.getUpdateCounts(), uc)
+                && Arrays.equals(ex.getLargeUpdateCounts(), luc)
+        );
+    }
+
+    /**
+     * Create BatchUpdateException with Throwable and update counts
+     */
+    @Test
+    public void test5() {
+        BatchUpdateException ex = new BatchUpdateException(uc, t);
+        assertTrue(ex.getMessage().equals(cause)
+                && ex.getSQLState() == null
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0
+                && Arrays.equals(ex.getUpdateCounts(), uc)
+                && Arrays.equals(ex.getLargeUpdateCounts(), luc)
+        );
+    }
+
+    /**
+     * Create BatchUpdateException with message, Throwable, and update counts
+     */
+    @Test
+    public void test6() {
+        BatchUpdateException ex = new BatchUpdateException(reason, uc, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0
+                && Arrays.equals(ex.getUpdateCounts(), uc)
+                && Arrays.equals(ex.getLargeUpdateCounts(), luc)
+        );
+    }
+
+    /**
+     * Create BatchUpdateException with message, SQLState, Throwable, and update
+     * counts
+     */
+    @Test
+    public void test7() {
+        BatchUpdateException ex = new BatchUpdateException(reason, state, uc, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0
+                && Arrays.equals(ex.getUpdateCounts(), uc)
+                && Arrays.equals(ex.getLargeUpdateCounts(), luc)
+        );
+    }
+
+    /**
+     * Create BatchUpdateException with message, SQLState, errorCode code
+     * Throwable, and update counts
+     */
+    @Test
+    public void test8() {
+        BatchUpdateException ex = new BatchUpdateException(reason, state, errorCode,
+                uc, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == errorCode
+                && Arrays.equals(ex.getUpdateCounts(), uc)
+                && Arrays.equals(ex.getLargeUpdateCounts(), luc)
+        );
+    }
+
+    /**
+     * Create BatchUpdateException with message, SQLState, errorCode code
+     * Throwable, and long [] update counts
+     */
+    @Test
+    public void test9() {
+        BatchUpdateException ex = new BatchUpdateException(reason, state, errorCode,
+                luc, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == errorCode
+                && Arrays.equals(ex.getUpdateCounts(), uc)
+                && Arrays.equals(ex.getLargeUpdateCounts(), luc)
+        );
+    }
+
+    /**
+     * Validate that a copy of the update counts array is made
+     */
+    @Test
+    public void test10() {
+        int[] uc1 = {1, 2};
+        BatchUpdateException ex = new BatchUpdateException(uc1);
+        assertTrue(Arrays.equals(ex.getUpdateCounts(), uc1));
+        uc1[0] = 6689;
+        assertFalse(Arrays.equals(ex.getUpdateCounts(), uc1));
+    }
+
+    /**
+     * Validate that if null is specified for the update count, it is returned
+     * as null
+     */
+    @Test
+    public void test11() {
+        BatchUpdateException ex = new BatchUpdateException((int[]) null);
+        assertTrue(ex.getMessage() == null && ex.getSQLState() == null
+                && ex.getErrorCode() == 0 && ex.getUpdateCounts() == null
+                && ex.getLargeUpdateCounts() == null);
+    }
+
+    /**
+     * Serialize a BatchUpdateException and make sure you can read it back
+     * properly
+     */
+    @Test
+    public void test12() throws Exception {
+        BatchUpdateException be = new BatchUpdateException(reason, state, errorCode,
+                uc, t);
+        BatchUpdateException bue
+                = createSerializedException(be);
+        assertTrue(reason.equals(bue.getMessage())
+                && bue.getSQLState().equals(state)
+                && cause.equals(bue.getCause().toString())
+                && bue.getErrorCode() == errorCode
+                && Arrays.equals(bue.getLargeUpdateCounts(), luc)
+                && Arrays.equals(bue.getUpdateCounts(), uc));
+    }
+
+
+
+    /**
+     * De-Serialize a BatchUpdateException from JDBC 4.0 and make sure you can
+     * read it back properly
+     */
+    @Test
+    public void test13() throws Exception {
+        String reason1 = "This was the error msg";
+        String state1 = "user defined sqlState";
+        String cause1 = "java.lang.Throwable: throw 1";
+        int errorCode1 = 99999;
+        Throwable t = new Throwable("throw 1");
+        int[] uc1 = {1, 2, 21};
+        long[] luc1 = {1, 2, 21};
+
+        ObjectInputStream ois = new ObjectInputStream(
+                new ByteArrayInputStream(SerializedBatchUpdateException.DATA));
+        BatchUpdateException bue = (BatchUpdateException) ois.readObject();
+        assertTrue(reason1.equals(bue.getMessage())
+                && bue.getSQLState().equals(state1)
+                && bue.getErrorCode() == errorCode1
+                && cause1.equals(bue.getCause().toString())
+                && Arrays.equals(bue.getLargeUpdateCounts(), luc1)
+                && Arrays.equals(bue.getUpdateCounts(), uc1));
+    }
+
+    /**
+     * Serialize a BatchUpdateException with an Integer.MAX_VALUE + 1 and
+     * validate you can read it back properly
+     */
+    @Test
+    public void test14() throws Exception {
+        int[] uc1 = {Integer.MAX_VALUE, Integer.MAX_VALUE + 1};
+        long[] luc1 = {Integer.MAX_VALUE, Integer.MAX_VALUE + 1};
+        BatchUpdateException be = new BatchUpdateException(reason, state, errorCode,
+                luc1, t);
+                BatchUpdateException bue
+                = createSerializedException(be);
+        assertTrue(reason.equals(bue.getMessage())
+                && bue.getSQLState().equals(state)
+                && cause.equals(bue.getCause().toString())
+                && bue.getErrorCode() == errorCode
+                && Arrays.equals(bue.getLargeUpdateCounts(), luc1)
+                && Arrays.equals(bue.getUpdateCounts(), uc1));
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct
+     * using for-each loop
+     */
+    @Test
+    public void test15() {
+        BatchUpdateException ex = new BatchUpdateException("Exception 1", uc, t1);
+        BatchUpdateException ex1 = new BatchUpdateException("Exception 2", uc);
+        BatchUpdateException ex2 = new BatchUpdateException("Exception 3", uc, t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        for (Throwable e : ex) {
+            assertTrue(msgs[num++].equals(e.getMessage()));
+        }
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct
+     * using traditional while loop
+     */
+    @Test
+    public void test16() {
+        BatchUpdateException ex = new BatchUpdateException("Exception 1", uc,  t1);
+        BatchUpdateException ex1 = new BatchUpdateException("Exception 2", uc);
+        BatchUpdateException ex2 = new BatchUpdateException("Exception 3", uc, t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        SQLException sqe = ex;
+        int num = 0;
+        while (sqe != null) {
+            assertTrue(msgs[num++].equals(sqe.getMessage()));
+            Throwable c = sqe.getCause();
+            while (c != null) {
+                assertTrue(msgs[num++].equals(c.getMessage()));
+                c = c.getCause();
+            }
+            sqe = sqe.getNextException();
+        }
+    }
+
+}
diff --git a/jdk/test/java/sql/test/sql/DataTruncationTests.java b/jdk/test/java/sql/test/sql/DataTruncationTests.java
new file mode 100644
index 0000000..fbf7eeb
--- /dev/null
+++ b/jdk/test/java/sql/test/sql/DataTruncationTests.java
@@ -0,0 +1,209 @@
+/*
+ * 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.
+ *
+ * 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 test.sql;
+
+import java.sql.DataTruncation;
+import java.sql.SQLException;
+import static org.testng.Assert.*;
+import org.testng.annotations.Test;
+import util.BaseTest;
+
+public class DataTruncationTests extends BaseTest {
+
+    private final String READ_TRUNCATION = "01004";
+    private final String WRITE_TRUNCATION = "22001";
+    private final String dtReason = "Data truncation";
+    private final int dterrorCode = 0;
+    private final String[] dtmsgs = {dtReason, "cause 1", dtReason,
+        dtReason, "cause 2"};
+    private boolean onRead = false;
+    private final boolean parameter = false;
+    private final int index = 21;
+    private final int dataSize = 25;
+    private final int transferSize = 10;
+
+    /**
+     * Create DataTruncation object indicating a truncation on read
+     */
+    @Test
+    public void test() {
+        onRead = true;
+        DataTruncation e = new DataTruncation(index, parameter, onRead,
+                dataSize, transferSize);
+        assertTrue(e.getMessage().equals(dtReason)
+                && e.getSQLState().equals(READ_TRUNCATION)
+                && e.getCause() == null
+                && e.getErrorCode() == dterrorCode
+                && e.getParameter() == parameter
+                && e.getRead() == onRead
+                && e.getDataSize() == dataSize
+                && e.getTransferSize() == transferSize
+                && e.getIndex() == index);
+    }
+
+    /**
+     * Create DataTruncation object indicating a truncation on write
+     */
+    @Test
+    public void test1() {
+        onRead = false;
+        DataTruncation e = new DataTruncation(index, parameter, onRead,
+                dataSize, transferSize);
+        assertTrue(e.getMessage().equals(dtReason)
+                && e.getSQLState().equals(WRITE_TRUNCATION)
+                && e.getCause() == null
+                && e.getErrorCode() == dterrorCode
+                && e.getParameter() == parameter
+                && e.getRead() == onRead
+                && e.getDataSize() == dataSize
+                && e.getTransferSize() == transferSize
+                && e.getIndex() == index);
+    }
+
+    /**
+     * Create DataTruncation object indicating a truncation on read with a
+     * Throwable
+     */
+    @Test
+    public void test2() {
+        onRead = true;
+        DataTruncation e = new DataTruncation(index, parameter, onRead,
+                dataSize, transferSize, t);
+        assertTrue(e.getMessage().equals(dtReason)
+                && e.getSQLState().equals(READ_TRUNCATION)
+                && cause.equals(e.getCause().toString())
+                && e.getErrorCode() == dterrorCode
+                && e.getParameter() == parameter
+                && e.getRead() == onRead
+                && e.getDataSize() == dataSize
+                && e.getTransferSize() == transferSize
+                && e.getIndex() == index);
+    }
+
+    /**
+     * Create DataTruncation object indicating a truncation on read with null
+     * specified for the Throwable
+     */
+    @Test
+    public void test3() {
+        onRead = true;;
+        DataTruncation e = new DataTruncation(index, parameter, onRead,
+                dataSize, transferSize, null);
+        assertTrue(e.getMessage().equals(dtReason)
+                && e.getSQLState().equals(READ_TRUNCATION)
+                && e.getCause() == null
+                && e.getErrorCode() == dterrorCode
+                && e.getParameter() == parameter
+                && e.getRead() == onRead
+                && e.getDataSize() == dataSize
+                && e.getTransferSize() == transferSize
+                && e.getIndex() == index);
+    }
+
+    /**
+     * Create DataTruncation object indicating a truncation on read and you can
+     * pass a -1 for the index
+     */
+    @Test
+    public void test4() {
+        onRead = true;
+        int negIndex = -1;
+        DataTruncation e = new DataTruncation(negIndex, parameter, onRead,
+                dataSize, transferSize);
+        assertTrue(e.getMessage().equals(dtReason)
+                && e.getSQLState().equals(READ_TRUNCATION)
+                && e.getCause() == null
+                && e.getErrorCode() == dterrorCode
+                && e.getParameter() == parameter
+                && e.getRead() == onRead
+                && e.getDataSize() == dataSize
+                && e.getTransferSize() == transferSize
+                && e.getIndex() == negIndex);
+    }
+
+    /**
+     * Serialize a DataTruncation and make sure you can read it back properly
+     */
+    @Test
+    public void test5() throws Exception {
+        DataTruncation e = new DataTruncation(index, parameter, onRead,
+                dataSize, transferSize);
+        DataTruncation ex1 = createSerializedException(e);
+        assertTrue(e.getMessage().equals(dtReason)
+                && e.getSQLState().equals(READ_TRUNCATION)
+                && e.getCause() == null
+                && e.getErrorCode() == dterrorCode
+                && e.getParameter() == parameter
+                && e.getRead() == onRead
+                && e.getDataSize() == dataSize
+                && e.getTransferSize() == transferSize
+                && e.getIndex() == index);
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct using
+     * for-each loop
+     */
+    @Test
+    public void test11() {
+        DataTruncation ex = new DataTruncation(index, parameter, onRead,
+                dataSize, transferSize, t1);
+        DataTruncation ex1 = new DataTruncation(index, parameter, onRead,
+                dataSize, transferSize);
+        DataTruncation ex2 = new DataTruncation(index, parameter, onRead,
+                dataSize, transferSize, t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        for (Throwable e : ex) {
+            assertTrue(dtmsgs[num++].equals(e.getMessage()));
+        }
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct using
+     * traditional while loop
+     */
+    @Test
+    public void test12() {
+        DataTruncation ex = new DataTruncation(index, parameter, onRead,
+                dataSize, transferSize, t1);
+        DataTruncation ex1 = new DataTruncation(index, parameter, onRead,
+                dataSize, transferSize);
+        DataTruncation ex2 = new DataTruncation(index, parameter, onRead,
+                dataSize, transferSize, t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        SQLException sqe = ex;
+        while (sqe != null) {
+            assertTrue(dtmsgs[num++].equals(sqe.getMessage()));
+            Throwable c = sqe.getCause();
+            while (c != null) {
+                assertTrue(dtmsgs[num++].equals(c.getMessage()));
+                c = c.getCause();
+            }
+            sqe = sqe.getNextException();
+        }
+    }
+}
diff --git a/jdk/test/java/sql/test/sql/DateTests.java b/jdk/test/java/sql/test/sql/DateTests.java
new file mode 100644
index 0000000..5a66050
--- /dev/null
+++ b/jdk/test/java/sql/test/sql/DateTests.java
@@ -0,0 +1,542 @@
+/*
+ * 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.
+ *
+ * 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 test.sql;
+
+import java.sql.Date;
+import java.time.Instant;
+import java.time.LocalDate;
+import static org.testng.Assert.*;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+public class DateTests {
+
+    public DateTests() {
+    }
+
+    @BeforeClass
+    public static void setUpClass() throws Exception {
+    }
+
+    @AfterClass
+    public static void tearDownClass() throws Exception {
+    }
+
+    @BeforeMethod
+    public void setUpMethod() throws Exception {
+    }
+
+    @AfterMethod
+    public void tearDownMethod() throws Exception {
+    }
+
+    /**
+     * Validate an IllegalArgumentException is thrown for an invalid Date string
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void testInvalid_year() throws Exception {
+        String expResult = "20009-11-01";
+        Date.valueOf(expResult);
+    }
+
+    /**
+     * Validate an IllegalArgumentException is thrown for an invalid Date string
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void testInvalid_year2() throws Exception {
+        String expResult = "09-11-01";
+        Date.valueOf(expResult);
+    }
+
+    /**
+     * Validate an IllegalArgumentException is thrown for an invalid Date string
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void testInvalid_year3() throws Exception {
+        String expResult = "-11-01";
+        Date.valueOf(expResult);
+    }
+
+    /**
+     * Validate an IllegalArgumentException is thrown for an invalid Date string
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void testInvalid_month() throws Exception {
+        String expResult = "2009-111-01";
+        Date.valueOf(expResult);
+    }
+
+    /**
+     * Validate an IllegalArgumentException is thrown for an invalid Date string
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void testInvalid_month3() throws Exception {
+        String expResult = "2009--01";
+        Date.valueOf(expResult);
+    }
+
+    /**
+     * Validate an IllegalArgumentException is thrown for an invalid Date string
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void testInvalid_month4() throws Exception {
+        String expResult = "2009-13-01";
+        Date.valueOf(expResult);
+    }
+
+    /**
+     * Validate an IllegalArgumentException is thrown for an invalid Date string
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void testInvalid_day() throws Exception {
+        String expResult = "2009-11-011";
+        Date.valueOf(expResult);
+    }
+
+    /**
+     * Validate an IllegalArgumentException is thrown for an invalid Date string
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void testInvalid_day3() throws Exception {
+        String expResult = "2009-11-";
+        Date.valueOf(expResult);
+    }
+
+    /**
+     * Validate an IllegalArgumentException is thrown for an invalid Date string
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void testInvalid_day4() throws Exception {
+        String expResult = "2009-11-00";
+        Date.valueOf(expResult);
+    }
+
+    /**
+     * Validate an IllegalArgumentException is thrown for an invalid Date string
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void testInvalid_day5() throws Exception {
+        String expResult = "2009-11-33";
+        Date.valueOf(expResult);
+    }
+
+    /**
+     * Validate an IllegalArgumentException is thrown for an invalid Date string
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void testInvalid_valueOf() throws Exception {
+        String expResult = "--";
+        Date.valueOf(expResult);
+    }
+
+    /**
+     * Validate an IllegalArgumentException is thrown for an invalid Date string
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void testInvalid_valueOf2() throws Exception {
+        String expResult = "";
+        Date.valueOf(expResult);
+    }
+
+    /**
+     * Validate an IllegalArgumentException is thrown for an invalid Date string
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void testInvalid_valueOf3() throws Exception {
+        String expResult = null;
+        Date.valueOf(expResult);
+    }
+
+    /**
+     * Validate an IllegalArgumentException is thrown for an invalid Date string
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void testInvalid_valueOf4() throws Exception {
+        String expResult = "-";
+        Date.valueOf(expResult);
+    }
+
+    /**
+     * Validate an IllegalArgumentException is thrown for an invalid Date string
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void testInvalid_valueOf5() throws Exception {
+        String expResult = "2009";
+        Date.valueOf(expResult);
+    }
+
+    /**
+     * Validate an IllegalArgumentException is thrown for an invalid Date string
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void testInvalid_valueOf6() throws Exception {
+        String expResult = "2009-01";
+        Date.valueOf(expResult);
+    }
+
+    /**
+     * Validate an IllegalArgumentException is thrown for an invalid Date string
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void testInvalid_valueOf7() throws Exception {
+        String expResult = "---";
+        Date.valueOf(expResult);
+    }
+
+    /**
+     * Validate an IllegalArgumentException is thrown for an invalid Date string
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void testInvalid_valueOf8() throws Exception {
+        String expResult = "2009-13--1";
+        Date.valueOf(expResult);
+    }
+
+    /**
+     * Validate an IllegalArgumentException is thrown for an invalid Date string
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void testInvalid_valueOf10() {
+        String expResult = "1900-1-0";
+        Date.valueOf(expResult);
+    }
+
+    /**
+     * Test that a date created from a date string is equal to the value
+     * returned from toString()
+     */
+    @Test
+    public void test_valueOf() {
+        String expResult = "2009-08-30";
+        Date d = Date.valueOf(expResult);
+        assertEquals(expResult, d.toString());
+    }
+
+    /**
+     * Test that two dates, one with lead 0s omitted for month are equal
+     */
+    @Test
+    public void testValid_month_single_digit() {
+        String testDate = "2009-1-01";
+        String expResult = "2009-01-01";
+        Date d = Date.valueOf(testDate);
+        Date d2 = Date.valueOf(expResult);
+        assertEquals(d, d2);
+    }
+
+    /**
+     * Test that two dates, one with lead 0s omitted for day are equal
+     */
+    @Test
+    public void testValid_day_single_digit() {
+        String testDate = "2009-11-1";
+        String expResult = "2009-11-01";
+        Date d = Date.valueOf(testDate);
+        Date d2 = Date.valueOf(expResult);
+        assertEquals(d, d2);
+    }
+
+    /**
+     * Test that two dates, one with lead 0s omitted for month and day are equal
+     */
+    @Test
+    public void testValid_month_day_single_digit() {
+        String testDate = "2009-1-1";
+        String expResult = "2009-01-01";
+        Date d = Date.valueOf(testDate);
+        Date d2 = Date.valueOf(expResult);
+        assertEquals(d, d2);
+    }
+
+    /**
+     * Validate that a Date.after() returns false when same date is compared
+     */
+    @Test
+    public void test1() {
+        Date d = Date.valueOf("1961-08-30");
+        assertFalse(d.after(d), "Error d.after(d) = true");
+    }
+
+    /**
+     * Validate that a Date.after() returns true when later date is compared to
+     * earlier date
+     */
+    @Test
+    public void test2() {
+        Date d = Date.valueOf("1961-08-30");
+        Date d2 = new Date(System.currentTimeMillis());
+        assertTrue(d2.after(d), "Error d2.after(d) = false");
+    }
+
+    /**
+     * Validate that a Date.after() returns false when earlier date is compared
+     * to later date
+     */
+    @Test
+    public void test3() {
+        Date d = Date.valueOf("1961-08-30");
+        Date d2 = new Date(d.getTime());
+        assertFalse(d.after(d2), "Error d.after(d2) = true");
+    }
+
+    /**
+     * Validate that a Date.after() returns false when date compared to another
+     * date created from the original date
+     */
+    @Test
+    public void test4() {
+        Date d = Date.valueOf("1961-08-30");
+        Date d2 = new Date(d.getTime());
+        assertFalse(d.after(d2), "Error d.after(d2) = true");
+        assertFalse(d2.after(d), "Error d2.after(d) = true");
+    }
+
+    /**
+     * Validate that a Date.before() returns false when same date is compared
+     */
+    @Test
+    public void test5() {
+        Date d = Date.valueOf("1961-08-30");
+        assertFalse(d.before(d), "Error d.before(d) = true");
+    }
+
+    /**
+     * Validate that a Date.before() returns true when earlier date is compared
+     * to later date
+     */
+    @Test
+    public void test6() {
+        Date d = Date.valueOf("1961-08-30");
+        Date d2 = new Date(System.currentTimeMillis());
+        assertTrue(d.before(d2), "Error d.before(d2) = false");
+    }
+
+    /**
+     * Validate that a Date.before() returns false when later date is compared
+     * to earlier date
+     */
+    @Test
+    public void test7() {
+        Date d = Date.valueOf("1961-08-30");
+        Date d2 = new Date(d.getTime());
+        assertFalse(d2.before(d), "Error d2.before(d) = true");
+    }
+
+    /**
+     * Validate that a Date.before() returns false when date compared to another
+     * date created from the original date
+     */
+    @Test
+    public void test8() {
+        Date d = Date.valueOf("1961-08-30");
+        Date d2 = new Date(d.getTime());
+        assertFalse(d.before(d2), "Error d.before(d2) = true");
+        assertFalse(d2.before(d), "Error d2.before(d) = true");
+    }
+
+    /**
+     * Validate that a Date.compareTo returns 0 when both Date objects are the
+     * same
+     */
+    @Test
+    public void test9() {
+        Date d = Date.valueOf("1961-08-30");
+        assertTrue(d.compareTo(d) == 0, "Error d.compareTo(d) !=0");
+    }
+
+    /**
+     * Validate that a Date.compareTo returns 0 when both Date objects represent
+     * the same date
+     */
+    @Test
+    public void test10() {
+        Date d = Date.valueOf("1961-08-30");
+        Date d2 = new Date(d.getTime());
+        assertTrue(d.compareTo(d2) == 0, "Error d.compareTo(d2) !=0");
+    }
+
+    /**
+     * Validate that a Date.compareTo returns -1 when comparing a date to a
+     * later date
+     */
+    @Test
+    public void test11() {
+        Date d = Date.valueOf("1961-08-30");
+        Date d2 = new Date(System.currentTimeMillis());
+        assertTrue(d.compareTo(d2) == -1, "Error d.compareTo(d2) != -1");
+    }
+
+    /**
+     * Validate that a Date.compareTo returns 1 when comparing a date to an
+     * earlier date
+     */
+    @Test
+    public void test12() {
+        Date d = Date.valueOf("1961-08-30");
+        Date d2 = new Date(System.currentTimeMillis());
+        assertTrue(d2.compareTo(d) == 1, "Error d.compareTo(d2) != 1");
+    }
+
+    /**
+     * Validate that a Date made from a LocalDate are equal
+     */
+    @Test
+    public void test13() {
+        Date d = Date.valueOf("1961-08-30");
+        LocalDate ldt = d.toLocalDate();
+        Date d2 = Date.valueOf(ldt);
+        assertTrue(d.equals(d2), "Error d != d2");
+    }
+
+    /**
+     * Validate that a Date LocalDate value, made from a LocalDate are equal
+     */
+    @Test
+    public void test14() {
+        LocalDate ldt = LocalDate.now();
+        Date d = Date.valueOf(ldt);
+        assertTrue(ldt.equals(d.toLocalDate()),
+                "Error LocalDate values are not equal");
+    }
+
+    /**
+     * Validate an NPE occurs when a null LocalDate is passed to valueOf
+     */
+    @Test(expectedExceptions = NullPointerException.class)
+    public void test15() throws Exception {
+        LocalDate ld = null;
+        Date.valueOf(ld);
+    }
+
+    /**
+     * Validate an UnsupportedOperationException occurs when toInstant() is
+     * called
+     */
+    @Test(expectedExceptions = UnsupportedOperationException.class)
+    public void test16() throws Exception {
+        Date d = Date.valueOf("1961-08-30");
+        Instant instant = d.toInstant();
+    }
+
+    /**
+     * Validate that two Date objects are equal when one is created from the
+     * toString() of the other
+     */
+    @Test
+    public void test17() {
+        Date d = Date.valueOf("1961-08-30");
+        Date d2 = Date.valueOf(d.toString());
+        assertTrue(d.equals(d2) && d2.equals(d), "Error d != d2");
+    }
+
+    /**
+     * Validate that two Date values one created using valueOf and another via a
+     * constructor are equal
+     */
+    @Test
+    public void test18() {
+
+        Date d = Date.valueOf("1961-08-30");
+        Date d2 = new Date(61, 7, 30);
+        assertTrue(d.equals(d2), "Error d != d2");
+    }
+
+    /**
+     * Validate that two Date values one created using getTime() of the other
+     * are equal
+     */
+    @Test
+    public void test19() {
+
+        Date d = Date.valueOf("1961-08-30");
+        Date d2 = new Date(d.getTime());
+        assertTrue(d.equals(d2), "Error d != d2");
+    }
+
+    /**
+     * Validate that a Date value is equal to itself
+     */
+    @Test
+    public void test20() {
+
+        Date d = Date.valueOf("1961-08-30");
+        assertTrue(d.equals(d), "Error d != d");
+    }
+
+    /**
+     * Validate an IllegalArgumentException is thrown for calling getHours
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void test21() throws Exception {
+        Date d = Date.valueOf("1961-08-30");
+        d.getHours();
+    }
+
+    /**
+     * Validate an IllegalArgumentException is thrown for calling getMinutes
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void test22() throws Exception {
+        Date d = Date.valueOf("1961-08-30");
+        d.getMinutes();
+    }
+
+    /**
+     * Validate an IllegalArgumentException is thrown for calling getSeconds
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void test23() throws Exception {
+        Date d = Date.valueOf("1961-08-30");
+        d.getSeconds();
+    }
+
+    /**
+     * Validate an IllegalArgumentException is thrown for calling setHours
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void test24() throws Exception {
+        Date d = Date.valueOf("1961-08-30");
+        d.setHours(8);
+    }
+
+    /**
+     * Validate an IllegalArgumentException is thrown for calling setMinutes
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void test25() throws Exception {
+        Date d = Date.valueOf("1961-08-30");
+        d.setMinutes(0);
+    }
+
+    /**
+     * Validate an IllegalArgumentException is thrown for calling setSeconds
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void test26() throws Exception {
+        Date d = Date.valueOf("1961-08-30");
+        d.setSeconds(0);
+    }
+}
diff --git a/jdk/test/java/sql/test/sql/DriverManagerTests.java b/jdk/test/java/sql/test/sql/DriverManagerTests.java
new file mode 100644
index 0000000..938f23e
--- /dev/null
+++ b/jdk/test/java/sql/test/sql/DriverManagerTests.java
@@ -0,0 +1,354 @@
+/*
+ * 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.
+ *
+ * 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 test.sql;
+
+import java.io.BufferedReader;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.CharArrayReader;
+import java.io.CharArrayWriter;
+import java.io.File;
+import java.io.InputStreamReader;
+import java.io.PrintStream;
+import java.io.PrintWriter;
+import java.sql.Driver;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+import java.util.Properties;
+import static org.testng.Assert.*;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+import util.StubDriver;
+
+public class DriverManagerTests {
+
+    private final String StubDriverURL = "jdbc:tennis:boy";
+    private final String StubDriverDAURL = "jdbc:luckydog:tennis";
+    private final String InvalidURL = "jdbc:cardio:tennis";
+    private String[] results = {"output", "more output", "and more", "the end"};
+    private String noOutput = "should not find this";
+
+    public DriverManagerTests() {
+    }
+
+    @BeforeClass
+    public static void setUpClass() throws Exception {
+    }
+
+    @AfterClass
+    public static void tearDownClass() throws Exception {
+    }
+
+    @BeforeMethod
+    public void setUpMethod() throws Exception {
+        removeAllDrivers();
+    }
+
+    @AfterMethod
+    public void tearDownMethod() throws Exception {
+    }
+
+    /**
+     * Utility method to remove all registered drivers
+     */
+    private static void removeAllDrivers() {
+        java.util.Enumeration e = DriverManager.getDrivers();
+        while (e.hasMoreElements()) {
+            try {
+                DriverManager.deregisterDriver((Driver) (e.nextElement()));
+            } catch (SQLException ex) {
+                System.out.print(ex.getMessage());
+            }
+        }
+    }
+
+    /**
+     * Utility method to see if a driver is registered
+     */
+    private boolean isDriverRegistered(Driver d) {
+        boolean foundDriver = false;
+        java.util.Enumeration e = DriverManager.getDrivers();
+        while (e.hasMoreElements()) {
+            if (d == (Driver) e.nextElement()) {
+                foundDriver = true;
+                break;
+            }
+        }
+        return foundDriver;
+    }
+
+    /**
+     * Validate that values set using setLoginTimeout will be returned by
+     * getLoginTimeout
+     */
+    @Test
+    public void test() {
+        int[] vals = {-1, 0, 5};
+        for (int val : vals) {
+            DriverManager.setLoginTimeout(val);
+            assertEquals(val, DriverManager.getLoginTimeout());
+        }
+    }
+
+    /**
+     * Validate that NullPointerException is thrown when null is passed to
+     * registerDriver
+     */
+    @Test(expectedExceptions = NullPointerException.class)
+    public void test1() throws Exception {
+        Driver d = null;
+        DriverManager.registerDriver(d);
+    }
+
+    /**
+     * Validate that NullPointerException is thrown when null is passed to
+     * registerDriver
+     */
+    @Test(expectedExceptions = NullPointerException.class)
+    public void test2() throws Exception {
+        Driver d = null;
+        DriverManager.registerDriver(d, null);
+    }
+
+    /**
+     * Validate that a null value allows for deRegisterDriver to return
+     */
+    @Test
+    public void test3() throws Exception {
+        DriverManager.deregisterDriver(null);
+
+    }
+
+    /**
+     * Validate that SQLException is thrown when there is no Driver to service
+     * the URL
+     */
+    @Test(expectedExceptions = SQLException.class)
+    public void test4() throws Exception {
+        DriverManager.getConnection(InvalidURL);
+    }
+
+    /**
+     * Validate that SQLException is thrown when there is no Driver to service
+     * the URL
+     */
+    @Test(expectedExceptions = SQLException.class)
+    public void test5() throws Exception {
+        DriverManager.getConnection(InvalidURL, new Properties());
+    }
+
+    /**
+     * Validate that SQLException is thrown when there is no Driver to service
+     * the URL
+     */
+    @Test(expectedExceptions = SQLException.class)
+    public void test6() throws Exception {
+        DriverManager.getConnection(InvalidURL, "LuckyDog", "tennisanyone");
+    }
+
+    /**
+     * Validate that SQLException is thrown when null is passed for the URL
+     */
+    @Test(expectedExceptions = SQLException.class)
+    public void test7() throws Exception {
+        DriverManager.getConnection(null);
+    }
+
+    /**
+     * Validate that SQLException is thrown when null is passed for the URL
+     */
+    @Test(expectedExceptions = SQLException.class)
+    public void test8() throws Exception {
+        DriverManager.getConnection(null, new Properties());
+    }
+
+    /**
+     * Validate that SQLException is thrown when null is passed for the URL
+     */
+    @Test(expectedExceptions = SQLException.class)
+    public void test9() throws Exception {
+        DriverManager.getConnection(null, "LuckyDog", "tennisanyone");
+    }
+
+    /**
+     * Validate that SQLException is thrown when there is no Driver to service
+     * the URL
+     */
+    @Test(expectedExceptions = SQLException.class)
+    public void test10() throws Exception {
+        DriverManager.getDriver(InvalidURL);
+    }
+
+    /**
+     * Validate that SQLException is thrown when null is passed for the URL
+     */
+    @Test(expectedExceptions = SQLException.class)
+    public void test11() throws Exception {
+        DriverManager.getDriver(null);
+    }
+
+    /**
+     * Validate that a non-null Driver is returned by getDriver when a valid URL
+     * is specified
+     */
+    @Test
+    public void test12() throws Exception {
+
+        DriverManager.registerDriver(new StubDriver());
+        assertTrue(DriverManager.getDriver(StubDriverURL) != null);
+    }
+
+    /**
+     * Validate that SQLException is thrown when the URL is not valid for any of
+     * the registered drivers
+     */
+    @Test(expectedExceptions = SQLException.class)
+    public void test13() throws Exception {
+        DriverManager.registerDriver(new StubDriver());
+        DriverManager.getDriver(InvalidURL);
+    }
+
+    /**
+     * Validate that a Connection object is returned when a valid URL is
+     * specified to getConnection
+     *
+     */
+    @Test
+    public void test14() throws Exception {
+
+        DriverManager.registerDriver(new StubDriver());
+        assertTrue(
+                DriverManager.getConnection(StubDriverURL) != null);
+        assertTrue(DriverManager.getConnection(StubDriverURL,
+                "LuckyDog", "tennisanyone") != null);
+        Properties props = new Properties();
+        props.put("user", "LuckyDog");
+        props.put("password", "tennisanyone");
+        assertTrue(
+                DriverManager.getConnection(StubDriverURL,
+                        props) != null);
+    }
+
+    /**
+     * Register a driver and make sure you find it via its URL. Deregister the
+     * driver and validate it is not longer registered
+     *
+     * @throws Exception
+     */
+    @Test()
+    public void test15() throws Exception {
+        DriverManager.registerDriver(new StubDriver());
+        Driver d = DriverManager.getDriver(StubDriverURL);
+        assertTrue(d != null);
+        assertTrue(isDriverRegistered(d));
+        DriverManager.deregisterDriver(d);
+        assertFalse(isDriverRegistered(d));
+    }
+
+    /**
+     * Validate that DriverAction.release is called when a driver is registered
+     * via registerDriver(Driver, DriverAction)
+     *
+     * @throws Exception
+     */
+    @Test
+    public void test16() throws Exception {
+        File file = new File(util.StubDriverDA.DriverActionCalled);
+        file.delete();
+        assertFalse(file.exists());
+        Driver d = null;
+        Class.forName("util.StubDriverDA");
+        d = DriverManager.getDriver(StubDriverDAURL);
+        DriverManager.deregisterDriver(d);
+        assertFalse(isDriverRegistered(d), "Driver is registered");
+        assertTrue(file.exists());
+    }
+
+    /**
+     * Create a PrintStream and use to send output via DriverManager.println
+     * Validate that if you disable the stream, the output sent is not present
+     */
+    @Test
+    public void tests17() throws Exception {
+        ByteArrayOutputStream os = new ByteArrayOutputStream();
+        PrintStream ps = new PrintStream(os);
+        DriverManager.setLogStream(ps);
+        assertTrue(DriverManager.getLogStream() == ps);
+
+        DriverManager.println(results[0]);
+        DriverManager.setLogStream((PrintStream) null);
+        assertTrue(DriverManager.getLogStream() == null);
+        DriverManager.println(noOutput);
+        DriverManager.setLogStream(ps);
+        DriverManager.println(results[1]);
+        DriverManager.println(results[2]);
+        DriverManager.println(results[3]);
+        DriverManager.setLogStream((PrintStream) null);
+        DriverManager.println(noOutput);
+
+        /*
+         * Check we do not get the output when the stream is disabled
+         */
+        InputStreamReader is
+                = new InputStreamReader(new ByteArrayInputStream(os.toByteArray()));
+        BufferedReader reader = new BufferedReader(is);
+        for (String result : results) {
+            assertTrue(result.equals(reader.readLine()));
+        }
+    }
+
+    /**
+     * Create a PrintWriter and use to to send output via DriverManager.println
+     * Validate that if you disable the writer, the output sent is not present
+     */
+    @Test
+    public void tests18() throws Exception {
+        CharArrayWriter cw = new CharArrayWriter();
+        PrintWriter pw = new PrintWriter(cw);
+        DriverManager.setLogWriter(pw);
+        assertTrue(DriverManager.getLogWriter() == pw);
+
+        DriverManager.println(results[0]);
+        DriverManager.setLogWriter(null);
+        assertTrue(DriverManager.getLogWriter() == null);
+        DriverManager.println(noOutput);
+        DriverManager.setLogWriter(pw);
+        DriverManager.println(results[1]);
+        DriverManager.println(results[2]);
+        DriverManager.println(results[3]);
+        DriverManager.setLogWriter(null);
+        DriverManager.println(noOutput);
+
+        /*
+         * Check we do not get the output when the stream is disabled
+         */
+        BufferedReader reader
+                = new BufferedReader(new CharArrayReader(cw.toCharArray()));
+        for (String result : results) {
+            assertTrue(result.equals(reader.readLine()));
+        }
+    }
+}
diff --git a/jdk/test/java/sql/test/sql/SQLClientInfoExceptionTests.java b/jdk/test/java/sql/test/sql/SQLClientInfoExceptionTests.java
new file mode 100644
index 0000000..84230b8
--- /dev/null
+++ b/jdk/test/java/sql/test/sql/SQLClientInfoExceptionTests.java
@@ -0,0 +1,227 @@
+/*
+ * 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.
+ *
+ * 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 test.sql;
+
+import java.sql.ClientInfoStatus;
+import java.sql.SQLClientInfoException;
+import java.sql.SQLException;
+import java.util.HashMap;
+import static org.testng.Assert.*;
+import org.testng.annotations.Test;
+import util.BaseTest;
+
+public class SQLClientInfoExceptionTests extends BaseTest {
+
+    private final HashMap<String, ClientInfoStatus> map = new HashMap<>();
+
+    public SQLClientInfoExceptionTests() {
+        map.put("1", ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
+        map.put("21", ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
+    }
+
+    /**
+     * Create SQLClientInfoException and setting all objects to null
+     */
+    @Test
+    public void test() {
+        SQLClientInfoException e = new SQLClientInfoException(null);
+        assertTrue(e.getMessage() == null && e.getSQLState() == null
+                && e.getCause() == null && e.getErrorCode() == 0
+                && e.getFailedProperties() == null);
+    }
+
+    /**
+     * Create SQLClientInfoException with no-arg constructor
+     */
+    @Test
+    public void test1() {
+        SQLClientInfoException ex = new SQLClientInfoException();
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0
+                && ex.getFailedProperties() == null);
+    }
+
+    /**
+     * Create SQLClientInfoException with null Throwable
+     */
+    @Test
+    public void test2() {
+
+        SQLClientInfoException ex = new SQLClientInfoException(map, null);
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0
+                && ex.getFailedProperties().equals(map));
+    }
+
+    /**
+     * Create SQLClientInfoException with message
+     */
+    @Test
+    public void test3() {
+        SQLClientInfoException ex = new SQLClientInfoException(reason, map);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0
+                && ex.getFailedProperties().equals(map));
+    }
+
+    /**
+     * Create SQLClientInfoException with null Throwable
+     */
+    @Test
+    public void test4() {
+        SQLClientInfoException ex = new SQLClientInfoException(reason, map, null);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0
+                && ex.getFailedProperties().equals(map));
+    }
+
+    /**
+     * Create SQLClientInfoException with message, and SQLState
+     */
+    @Test
+    public void test5() {
+        SQLClientInfoException ex = new SQLClientInfoException(reason, state,
+                map);
+
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0
+                && ex.getFailedProperties().equals(map));
+    }
+
+    /**
+     * Create SQLClientInfoException with message, and SQLState
+     */
+    @Test
+    public void test6() {
+        SQLClientInfoException ex = new SQLClientInfoException(reason, state,
+                map, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0
+                && ex.getFailedProperties().equals(map));
+    }
+
+    /**
+     * Create SQLClientInfoException with message, SQLState, errorCode, and
+     * Throwable
+     */
+    @Test
+    public void test7() {
+        SQLClientInfoException ex = new SQLClientInfoException(reason, state,
+                errorCode, map);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && ex.getCause() == null
+                && ex.getErrorCode() == errorCode
+                && ex.getFailedProperties().equals(map));
+    }
+
+    /**
+     * Create SQLClientInfoException with message, SQLState, and error code
+     */
+    @Test
+    public void test8() {
+        SQLClientInfoException ex = new SQLClientInfoException(reason, state,
+                errorCode, map, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == errorCode
+                && ex.getFailedProperties().equals(map));
+    }
+
+    /**
+     * Serialize a SQLClientInfoException and make sure you can read it back
+     * properly
+     */
+    @Test
+    public void test10() throws Exception {
+        SQLClientInfoException e = new SQLClientInfoException(reason, state,
+                errorCode, map, t);
+        SQLClientInfoException ex1 =
+                createSerializedException(e);
+        assertTrue(reason.equals(ex1.getMessage())
+                && ex1.getSQLState().equals(state)
+                && cause.equals(ex1.getCause().toString())
+                && ex1.getErrorCode() == errorCode
+                && ex1.getFailedProperties().equals(map));
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct using
+     * for-each loop
+     */
+    @Test
+    public void test11() {
+        SQLClientInfoException ex = new SQLClientInfoException("Exception 1",
+                map, t1);
+        SQLClientInfoException ex1 = new SQLClientInfoException("Exception 2",
+                map);
+        SQLClientInfoException ex2 = new SQLClientInfoException("Exception 3",
+                map, t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        for (Throwable e : ex) {
+            assertTrue(msgs[num++].equals(e.getMessage()));
+        }
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct using
+     * traditional while loop
+     */
+    @Test
+    public void test12() {
+        SQLClientInfoException ex = new SQLClientInfoException("Exception 1",
+                map, t1);
+        SQLClientInfoException ex1 = new SQLClientInfoException("Exception 2",
+                map);
+        SQLClientInfoException ex2 = new SQLClientInfoException("Exception 3",
+                map, t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        SQLException sqe = ex;
+        while (sqe != null) {
+            assertTrue(msgs[num++].equals(sqe.getMessage()));
+            Throwable c = sqe.getCause();
+            while (c != null) {
+                assertTrue(msgs[num++].equals(c.getMessage()));
+                c = c.getCause();
+            }
+            sqe = sqe.getNextException();
+        }
+    }
+}
diff --git a/jdk/test/java/sql/test/sql/SQLDataExceptionTests.java b/jdk/test/java/sql/test/sql/SQLDataExceptionTests.java
new file mode 100644
index 0000000..8a5f8d1
--- /dev/null
+++ b/jdk/test/java/sql/test/sql/SQLDataExceptionTests.java
@@ -0,0 +1,215 @@
+/*
+ * 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.
+ *
+ * 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 test.sql;
+
+import java.sql.SQLDataException;
+import java.sql.SQLException;
+import java.sql.SQLNonTransientException;
+import static org.testng.Assert.*;
+import org.testng.annotations.Test;
+import util.BaseTest;
+
+public class SQLDataExceptionTests extends BaseTest {
+
+    /**
+     * Create SQLDataException and setting all objects to null
+     */
+    @Test
+    public void test() {
+        SQLDataException e = new SQLDataException(null, null, errorCode, null);
+        assertTrue(e.getMessage() == null && e.getSQLState() == null
+                && e.getCause() == null && e.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLDataException with no-arg constructor
+     */
+    @Test
+    public void test1() {
+        SQLDataException ex = new SQLDataException();
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLDataException with message
+     */
+    @Test
+    public void test2() {
+        SQLDataException ex = new SQLDataException(reason);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLDataException with message, and SQLState
+     */
+    @Test
+    public void test3() {
+        SQLDataException ex = new SQLDataException(reason, state);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLDataException with message, SQLState, and error code
+     */
+    @Test
+    public void test4() {
+        SQLDataException ex = new SQLDataException(reason, state, errorCode);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && ex.getCause() == null
+                && ex.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLDataException with message, SQLState, errorCode, and Throwable
+     */
+    @Test
+    public void test5() {
+        SQLDataException ex = new SQLDataException(reason, state, errorCode, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLDataException with message, SQLState, and Throwable
+     */
+    @Test
+    public void test6() {
+        SQLDataException ex = new SQLDataException(reason, state, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLDataException with message, and Throwable
+     */
+    @Test
+    public void test7() {
+        SQLDataException ex = new SQLDataException(reason, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLDataException with null Throwable
+     */
+    @Test
+    public void test8() {
+        SQLDataException ex = new SQLDataException((Throwable)null);
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLDataException with Throwable
+     */
+    @Test
+    public void test9() {
+        SQLDataException ex = new SQLDataException(t);
+        assertTrue(ex.getMessage().equals(cause)
+                && ex.getSQLState() == null
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Serialize a SQLDataException and make sure you can read it back properly
+     */
+    @Test
+    public void test10() throws Exception {
+        SQLDataException e = new SQLDataException(reason, state, errorCode, t);
+        SQLDataException ex1 = createSerializedException(e);
+        assertTrue(reason.equals(ex1.getMessage())
+                && ex1.getSQLState().equals(state)
+                && cause.equals(ex1.getCause().toString())
+                && ex1.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct
+     * using for-each loop
+     */
+    @Test
+    public void test11() {
+        SQLDataException ex = new SQLDataException("Exception 1", t1);
+        SQLDataException ex1 = new SQLDataException("Exception 2");
+        SQLDataException ex2 = new SQLDataException("Exception 3", t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        for (Throwable e : ex) {
+            assertTrue(msgs[num++].equals(e.getMessage()));
+        }
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct
+     * using traditional while loop
+     */
+    @Test
+    public void test12() {
+        SQLDataException ex = new SQLDataException("Exception 1", t1);
+        SQLDataException ex1 = new SQLDataException("Exception 2");
+        SQLDataException ex2 = new SQLDataException("Exception 3", t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        SQLException sqe = ex;
+        while (sqe != null) {
+            assertTrue(msgs[num++].equals(sqe.getMessage()));
+            Throwable c = sqe.getCause();
+            while (c != null) {
+                assertTrue(msgs[num++].equals(c.getMessage()));
+                c = c.getCause();
+            }
+            sqe = sqe.getNextException();
+        }
+    }
+
+    /**
+     * Create SQLDataException and validate it is an instance of
+     * SQLNonTransientException
+     */
+    @Test
+    public void test13() {
+        Exception ex = new SQLDataException();
+        assertTrue(ex instanceof SQLNonTransientException);
+    }
+}
diff --git a/jdk/test/java/sql/test/sql/SQLExceptionTests.java b/jdk/test/java/sql/test/sql/SQLExceptionTests.java
new file mode 100644
index 0000000..e3643ef
--- /dev/null
+++ b/jdk/test/java/sql/test/sql/SQLExceptionTests.java
@@ -0,0 +1,202 @@
+/*
+ * 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.
+ *
+ * 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 test.sql;
+
+import java.sql.SQLException;
+import static org.testng.Assert.*;
+import org.testng.annotations.Test;
+import util.BaseTest;
+
+public class SQLExceptionTests extends BaseTest {
+
+    /**
+     * Create SQLException and setting all objects to null
+     */
+    @Test
+    public void test() {
+        SQLException e = new SQLException(null, null, errorCode, null);
+        assertTrue(e.getMessage() == null && e.getSQLState() == null
+                && e.getCause() == null && e.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLException with no-arg constructor
+     */
+    @Test
+    public void test1() {
+        SQLException ex = new SQLException();
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLException with message
+     */
+    @Test
+    public void test2() {
+        SQLException ex = new SQLException(reason);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLException with message, and SQLState
+     */
+    @Test
+    public void test3() {
+        SQLException ex = new SQLException(reason, state);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLException with message, SQLState, and error code
+     */
+    @Test
+    public void test4() {
+        SQLException ex = new SQLException(reason, state, errorCode);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && ex.getCause() == null
+                && ex.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLException with message, SQLState, errorCode, and Throwable
+     */
+    @Test
+    public void test5() {
+        SQLException ex = new SQLException(reason, state, errorCode, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLException with message, SQLState, and Throwable
+     */
+    @Test
+    public void test6() {
+        SQLException ex = new SQLException(reason, state, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLException with message, and Throwable
+     */
+    @Test
+    public void test7() {
+        SQLException ex = new SQLException(reason, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLException with null Throwable
+     */
+    @Test
+    public void test8() {
+        SQLException ex = new SQLException((Throwable)null);
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLException with Throwable
+     */
+    @Test
+    public void test9() {
+        SQLException ex = new SQLException(t);
+        assertTrue(ex.getMessage().equals(cause)
+                && ex.getSQLState() == null
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Serialize a SQLException and make sure you can read it back properly
+     */
+    @Test
+    public void test10() throws Exception {
+        SQLException e = new SQLException(reason, state, errorCode, t);
+        SQLException ex1 = createSerializedException(e);
+        assertTrue(reason.equals(ex1.getMessage())
+                && ex1.getSQLState().equals(state)
+                && cause.equals(ex1.getCause().toString())
+                && ex1.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct
+     * using for-each loop
+     */
+    @Test
+    public void test11() {
+        SQLException ex = new SQLException("Exception 1", t1);
+        SQLException ex1 = new SQLException("Exception 2");
+        SQLException ex2 = new SQLException("Exception 3", t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        for (Throwable e : ex) {
+            assertTrue(msgs[num++].equals(e.getMessage()));
+        }
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct
+     * using traditional while loop
+     */
+    @Test
+    public void test12() {
+        SQLException ex = new SQLException("Exception 1", t1);
+        SQLException ex1 = new SQLException("Exception 2");
+        SQLException ex2 = new SQLException("Exception 3", t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        while (ex != null) {
+            assertTrue(msgs[num++].equals(ex.getMessage()));
+            Throwable c = ex.getCause();
+            while (c != null) {
+                assertTrue(msgs[num++].equals(c.getMessage()));
+                c = c.getCause();
+            }
+            ex = ex.getNextException();
+        }
+    }
+}
diff --git a/jdk/test/java/sql/test/sql/SQLFeatureNotSupportedExceptionTests.java b/jdk/test/java/sql/test/sql/SQLFeatureNotSupportedExceptionTests.java
new file mode 100644
index 0000000..5b95894
--- /dev/null
+++ b/jdk/test/java/sql/test/sql/SQLFeatureNotSupportedExceptionTests.java
@@ -0,0 +1,232 @@
+/*
+ * 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.
+ *
+ * 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 test.sql;
+
+import java.sql.SQLException;
+import java.sql.SQLFeatureNotSupportedException;
+import java.sql.SQLNonTransientException;
+import static org.testng.Assert.*;
+import org.testng.annotations.Test;
+import util.BaseTest;
+
+public class SQLFeatureNotSupportedExceptionTests extends BaseTest {
+
+    /**
+     * Create SQLFeatureNotSupportedException and setting all objects to null
+     */
+    @Test
+    public void test() {
+        SQLFeatureNotSupportedException e =
+                new SQLFeatureNotSupportedException(null, null, errorCode, null);
+        assertTrue(e.getMessage() == null && e.getSQLState() == null
+                && e.getCause() == null && e.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLFeatureNotSupportedException with no-arg constructor
+     */
+    @Test
+    public void test1() {
+        SQLFeatureNotSupportedException ex = new SQLFeatureNotSupportedException();
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLFeatureNotSupportedException with message
+     */
+    @Test
+    public void test2() {
+        SQLFeatureNotSupportedException ex =
+                new SQLFeatureNotSupportedException(reason);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLFeatureNotSupportedException with message, and SQLState
+     */
+    @Test
+    public void test3() {
+        SQLFeatureNotSupportedException ex =
+                new SQLFeatureNotSupportedException(reason, state);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLFeatureNotSupportedException with message, SQLState, and error code
+     */
+    @Test
+    public void test4() {
+        SQLFeatureNotSupportedException ex =
+                new SQLFeatureNotSupportedException(reason, state, errorCode);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && ex.getCause() == null
+                && ex.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLFeatureNotSupportedException with message, SQLState, errorCode, and Throwable
+     */
+    @Test
+    public void test5() {
+        SQLFeatureNotSupportedException ex =
+                new SQLFeatureNotSupportedException(reason, state, errorCode, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLFeatureNotSupportedException with message, SQLState, and Throwable
+     */
+    @Test
+    public void test6() {
+        SQLFeatureNotSupportedException ex =
+                new SQLFeatureNotSupportedException(reason, state, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLFeatureNotSupportedException with message, and Throwable
+     */
+    @Test
+    public void test7() {
+        SQLFeatureNotSupportedException ex =
+                new SQLFeatureNotSupportedException(reason, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLFeatureNotSupportedException with null Throwable
+     */
+    @Test
+    public void test8() {
+        SQLFeatureNotSupportedException ex =
+                new SQLFeatureNotSupportedException((Throwable) null);
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLFeatureNotSupportedException with Throwable
+     */
+    @Test
+    public void test9() {
+        SQLFeatureNotSupportedException ex =
+                new SQLFeatureNotSupportedException(t);
+        assertTrue(ex.getMessage().equals(cause)
+                && ex.getSQLState() == null
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Serialize a SQLFeatureNotSupportedException and make sure you can read it back properly
+     */
+    @Test
+    public void test10() throws Exception {
+        SQLFeatureNotSupportedException e =
+                new SQLFeatureNotSupportedException(reason, state, errorCode, t);
+        SQLFeatureNotSupportedException ex1 =
+                createSerializedException(e);
+        assertTrue(reason.equals(ex1.getMessage())
+                && ex1.getSQLState().equals(state)
+                && cause.equals(ex1.getCause().toString())
+                && ex1.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct
+     * using for-each loop
+     */
+    @Test
+    public void test11() {
+        SQLFeatureNotSupportedException ex =
+                new SQLFeatureNotSupportedException("Exception 1", t1);
+        SQLFeatureNotSupportedException ex1 =
+                new SQLFeatureNotSupportedException("Exception 2");
+        SQLFeatureNotSupportedException ex2 =
+                new SQLFeatureNotSupportedException("Exception 3", t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        for (Throwable e : ex) {
+            assertTrue(msgs[num++].equals(e.getMessage()));
+        }
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct
+     * using traditional while loop
+     */
+    @Test
+    public void test12() {
+        SQLFeatureNotSupportedException ex =
+                new SQLFeatureNotSupportedException("Exception 1", t1);
+        SQLFeatureNotSupportedException ex1 =
+                new SQLFeatureNotSupportedException("Exception 2");
+        SQLFeatureNotSupportedException ex2 =
+                new SQLFeatureNotSupportedException("Exception 3", t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        SQLException sqe = ex;
+        while (sqe != null) {
+            assertTrue(msgs[num++].equals(sqe.getMessage()));
+            Throwable c = sqe.getCause();
+            while (c != null) {
+                assertTrue(msgs[num++].equals(c.getMessage()));
+                c = c.getCause();
+            }
+            sqe = sqe.getNextException();
+        }
+    }
+
+    /**
+     * Create SQLFeatureNotSupportedException and validate it is an instance of
+     * SQLNonTransientException
+     */
+    @Test
+    public void test13() {
+        Exception ex = new SQLFeatureNotSupportedException();
+        assertTrue(ex instanceof SQLNonTransientException);
+    }
+}
diff --git a/jdk/test/java/sql/test/sql/SQLIntegrityConstraintViolationExceptionTests.java b/jdk/test/java/sql/test/sql/SQLIntegrityConstraintViolationExceptionTests.java
new file mode 100644
index 0000000..082e0af
--- /dev/null
+++ b/jdk/test/java/sql/test/sql/SQLIntegrityConstraintViolationExceptionTests.java
@@ -0,0 +1,235 @@
+/*
+ * 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.
+ *
+ * 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 test.sql;
+
+import java.sql.SQLException;
+import java.sql.SQLIntegrityConstraintViolationException;
+import java.sql.SQLNonTransientException;
+import static org.testng.Assert.*;
+import org.testng.annotations.Test;
+import util.BaseTest;
+
+public class SQLIntegrityConstraintViolationExceptionTests extends BaseTest {
+
+    /**
+     * Create SQLIntegrityConstraintViolationException and setting all objects to null
+     */
+    @Test
+    public void test() {
+        SQLIntegrityConstraintViolationException e =
+                new SQLIntegrityConstraintViolationException(null,
+                null, errorCode, null);
+        assertTrue(e.getMessage() == null && e.getSQLState() == null
+                && e.getCause() == null && e.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLIntegrityConstraintViolationException with no-arg constructor
+     */
+    @Test
+    public void test1() {
+        SQLIntegrityConstraintViolationException ex =
+                new SQLIntegrityConstraintViolationException();
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLIntegrityConstraintViolationException with message
+     */
+    @Test
+    public void test2() {
+        SQLIntegrityConstraintViolationException ex =
+                new SQLIntegrityConstraintViolationException(reason);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLIntegrityConstraintViolationException with message, and SQLState
+     */
+    @Test
+    public void test3() {
+        SQLIntegrityConstraintViolationException ex =
+                new SQLIntegrityConstraintViolationException(reason, state);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLIntegrityConstraintViolationException with message, SQLState, and error code
+     */
+    @Test
+    public void test4() {
+        SQLIntegrityConstraintViolationException ex =
+                new SQLIntegrityConstraintViolationException(reason, state, errorCode);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && ex.getCause() == null
+                && ex.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLIntegrityConstraintViolationException with message, SQLState, errorCode, and Throwable
+     */
+    @Test
+    public void test5() {
+        SQLIntegrityConstraintViolationException ex =
+                new SQLIntegrityConstraintViolationException(reason, state, errorCode, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLIntegrityConstraintViolationException with message, SQLState, and Throwable
+     */
+    @Test
+    public void test6() {
+        SQLIntegrityConstraintViolationException ex =
+                new SQLIntegrityConstraintViolationException(reason, state, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLIntegrityConstraintViolationException with message, and Throwable
+     */
+    @Test
+    public void test7() {
+        SQLIntegrityConstraintViolationException ex =
+                new SQLIntegrityConstraintViolationException(reason, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLIntegrityConstraintViolationException with null Throwable
+     */
+    @Test
+    public void test8() {
+        SQLIntegrityConstraintViolationException ex =
+                new SQLIntegrityConstraintViolationException((Throwable)null);
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLIntegrityConstraintViolationException with Throwable
+     */
+    @Test
+    public void test9() {
+        SQLIntegrityConstraintViolationException ex =
+                new SQLIntegrityConstraintViolationException(t);
+        assertTrue(ex.getMessage().equals(cause)
+                && ex.getSQLState() == null
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Serialize a SQLIntegrityConstraintViolationException and make sure
+     * you can read it back properly
+     */
+    @Test
+    public void test10() throws Exception {
+        SQLIntegrityConstraintViolationException e =
+                new SQLIntegrityConstraintViolationException(reason, state, errorCode, t);
+        SQLIntegrityConstraintViolationException ex1 =
+                createSerializedException(e);
+        assertTrue(reason.equals(ex1.getMessage())
+                && ex1.getSQLState().equals(state)
+                && cause.equals(ex1.getCause().toString())
+                && ex1.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct
+     * using for-each loop
+     */
+    @Test
+    public void test11() {
+        SQLIntegrityConstraintViolationException ex =
+                new SQLIntegrityConstraintViolationException("Exception 1", t1);
+        SQLIntegrityConstraintViolationException ex1 =
+                new SQLIntegrityConstraintViolationException("Exception 2");
+        SQLIntegrityConstraintViolationException ex2 =
+                new SQLIntegrityConstraintViolationException("Exception 3", t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        for (Throwable e : ex) {
+            assertTrue(msgs[num++].equals(e.getMessage()));
+        }
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct
+     * using traditional while loop
+     */
+    @Test
+    public void test12() {
+        SQLIntegrityConstraintViolationException ex =
+                new SQLIntegrityConstraintViolationException("Exception 1", t1);
+        SQLIntegrityConstraintViolationException ex1 =
+                new SQLIntegrityConstraintViolationException("Exception 2");
+        SQLIntegrityConstraintViolationException ex2 =
+                new SQLIntegrityConstraintViolationException("Exception 3", t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        SQLException sqe = ex;
+        while (sqe != null) {
+            assertTrue(msgs[num++].equals(sqe.getMessage()));
+            Throwable c = sqe.getCause();
+            while (c != null) {
+                assertTrue(msgs[num++].equals(c.getMessage()));
+                c = c.getCause();
+            }
+            sqe = sqe.getNextException();
+        }
+    }
+
+    /**
+     * Create SQLIntegrityConstraintViolationException and validate it is an instance of
+     * SQLNonTransientException
+     */
+    @Test
+    public void test13() {
+        Exception ex = new SQLIntegrityConstraintViolationException();
+        assertTrue(ex instanceof SQLNonTransientException);
+    }
+}
diff --git a/jdk/test/java/sql/test/sql/SQLInvalidAuthorizationSpecExceptionTests.java b/jdk/test/java/sql/test/sql/SQLInvalidAuthorizationSpecExceptionTests.java
new file mode 100644
index 0000000..6e4eaa5
--- /dev/null
+++ b/jdk/test/java/sql/test/sql/SQLInvalidAuthorizationSpecExceptionTests.java
@@ -0,0 +1,239 @@
+/*
+ * 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.
+ *
+ * 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 test.sql;
+
+import java.sql.SQLException;
+import java.sql.SQLInvalidAuthorizationSpecException;
+import java.sql.SQLNonTransientException;
+import static org.testng.Assert.*;
+import org.testng.annotations.Test;
+import util.BaseTest;
+
+public class SQLInvalidAuthorizationSpecExceptionTests extends BaseTest {
+
+    /**
+     * Create SQLInvalidAuthorizationSpecException and setting all objects to
+     * null
+     */
+    @Test
+    public void test() {
+        SQLInvalidAuthorizationSpecException e
+                = new SQLInvalidAuthorizationSpecException(null,
+                        null, errorCode, null);
+        assertTrue(e.getMessage() == null && e.getSQLState() == null
+                && e.getCause() == null && e.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLInvalidAuthorizationSpecException with no-arg constructor
+     */
+    @Test
+    public void test1() {
+        SQLInvalidAuthorizationSpecException ex
+                = new SQLInvalidAuthorizationSpecException();
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLInvalidAuthorizationSpecException with message
+     */
+    @Test
+    public void test2() {
+        SQLInvalidAuthorizationSpecException ex
+                = new SQLInvalidAuthorizationSpecException(reason);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLInvalidAuthorizationSpecException with message, and SQLState
+     */
+    @Test
+    public void test3() {
+        SQLInvalidAuthorizationSpecException ex
+                = new SQLInvalidAuthorizationSpecException(reason, state);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLInvalidAuthorizationSpecException with message, SQLState, and
+     * error code
+     */
+    @Test
+    public void test4() {
+        SQLInvalidAuthorizationSpecException ex
+                = new SQLInvalidAuthorizationSpecException(reason, state, errorCode);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && ex.getCause() == null
+                && ex.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLInvalidAuthorizationSpecException with message, SQLState,
+     * errorCode, and Throwable
+     */
+    @Test
+    public void test5() {
+        SQLInvalidAuthorizationSpecException ex
+                = new SQLInvalidAuthorizationSpecException(reason, state, errorCode, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLInvalidAuthorizationSpecException with message, SQLState, and
+     * Throwable
+     */
+    @Test
+    public void test6() {
+        SQLInvalidAuthorizationSpecException ex
+                = new SQLInvalidAuthorizationSpecException(reason, state, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLInvalidAuthorizationSpecException with message, and Throwable
+     */
+    @Test
+    public void test7() {
+        SQLInvalidAuthorizationSpecException ex
+                = new SQLInvalidAuthorizationSpecException(reason, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLInvalidAuthorizationSpecException with null Throwable
+     */
+    @Test
+    public void test8() {
+        SQLInvalidAuthorizationSpecException ex
+                = new SQLInvalidAuthorizationSpecException((Throwable) null);
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLInvalidAuthorizationSpecException with Throwable
+     */
+    @Test
+    public void test9() {
+        SQLInvalidAuthorizationSpecException ex
+                = new SQLInvalidAuthorizationSpecException(t);
+        assertTrue(ex.getMessage().equals(cause)
+                && ex.getSQLState() == null
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Serialize a SQLInvalidAuthorizationSpecException and make sure you can
+     * read it back properly
+     */
+    @Test
+    public void test10() throws Exception {
+        SQLInvalidAuthorizationSpecException e
+                = new SQLInvalidAuthorizationSpecException(reason, state, errorCode, t);
+        SQLInvalidAuthorizationSpecException ex1 =
+                createSerializedException(e);
+        assertTrue(reason.equals(ex1.getMessage())
+                && ex1.getSQLState().equals(state)
+                && cause.equals(ex1.getCause().toString())
+                && ex1.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct using
+     * for-each loop
+     */
+    @Test
+    public void test11() {
+        SQLInvalidAuthorizationSpecException ex
+                = new SQLInvalidAuthorizationSpecException("Exception 1", t1);
+        SQLInvalidAuthorizationSpecException ex1
+                = new SQLInvalidAuthorizationSpecException("Exception 2");
+        SQLInvalidAuthorizationSpecException ex2
+                = new SQLInvalidAuthorizationSpecException("Exception 3", t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        for (Throwable e : ex) {
+            assertTrue(msgs[num++].equals(e.getMessage()));
+        }
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct using
+     * traditional while loop
+     */
+    @Test
+    public void test12() {
+        SQLInvalidAuthorizationSpecException ex
+                = new SQLInvalidAuthorizationSpecException("Exception 1", t1);
+        SQLInvalidAuthorizationSpecException ex1
+                = new SQLInvalidAuthorizationSpecException("Exception 2");
+        SQLInvalidAuthorizationSpecException ex2
+                = new SQLInvalidAuthorizationSpecException("Exception 3", t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        SQLException sqe = ex;
+        while (sqe != null) {
+            assertTrue(msgs[num++].equals(sqe.getMessage()));
+            Throwable c = sqe.getCause();
+            while (c != null) {
+                assertTrue(msgs[num++].equals(c.getMessage()));
+                c = c.getCause();
+            }
+            sqe = sqe.getNextException();
+        }
+    }
+
+    /**
+     * Create SQLInvalidAuthorizationSpecException and validate it is an
+     * instance of SQLNonTransientException
+     */
+    @Test
+    public void test13() {
+        Exception ex = new SQLInvalidAuthorizationSpecException();
+        assertTrue(ex instanceof SQLNonTransientException);
+    }
+}
diff --git a/jdk/test/java/sql/test/sql/SQLNonTransientConnectionExceptionTests.java b/jdk/test/java/sql/test/sql/SQLNonTransientConnectionExceptionTests.java
new file mode 100644
index 0000000..dbd8b68
--- /dev/null
+++ b/jdk/test/java/sql/test/sql/SQLNonTransientConnectionExceptionTests.java
@@ -0,0 +1,235 @@
+/*
+ * 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.
+ *
+ * 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 test.sql;
+
+import java.sql.SQLException;
+import java.sql.SQLNonTransientConnectionException;
+import java.sql.SQLNonTransientException;
+import static org.testng.Assert.*;
+import org.testng.annotations.Test;
+import util.BaseTest;
+
+public class SQLNonTransientConnectionExceptionTests extends BaseTest {
+
+    /**
+     * Create SQLNonTransientConnectionException and setting all objects to null
+     */
+    @Test
+    public void test() {
+        SQLNonTransientConnectionException e =
+                new SQLNonTransientConnectionException(null,
+                null, errorCode, null);
+        assertTrue(e.getMessage() == null && e.getSQLState() == null
+                && e.getCause() == null && e.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLNonTransientConnectionException with no-arg constructor
+     */
+    @Test
+    public void test1() {
+        SQLNonTransientConnectionException ex =
+                new SQLNonTransientConnectionException();
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLNonTransientConnectionException with message
+     */
+    @Test
+    public void test2() {
+        SQLNonTransientConnectionException ex =
+                new SQLNonTransientConnectionException(reason);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLNonTransientConnectionException with message, and SQLState
+     */
+    @Test
+    public void test3() {
+        SQLNonTransientConnectionException ex =
+                new SQLNonTransientConnectionException(reason, state);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLNonTransientConnectionException with message, SQLState, and error code
+     */
+    @Test
+    public void test4() {
+        SQLNonTransientConnectionException ex =
+                new SQLNonTransientConnectionException(reason, state, errorCode);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && ex.getCause() == null
+                && ex.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLNonTransientConnectionException with message, SQLState, errorCode, and Throwable
+     */
+    @Test
+    public void test5() {
+        SQLNonTransientConnectionException ex =
+                new SQLNonTransientConnectionException(reason, state, errorCode, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLNonTransientConnectionException with message, SQLState, and Throwable
+     */
+    @Test
+    public void test6() {
+        SQLNonTransientConnectionException ex =
+                new SQLNonTransientConnectionException(reason, state, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLNonTransientConnectionException with message, and Throwable
+     */
+    @Test
+    public void test7() {
+        SQLNonTransientConnectionException ex =
+                new SQLNonTransientConnectionException(reason, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLNonTransientConnectionException with null Throwable
+     */
+    @Test
+    public void test8() {
+        SQLNonTransientConnectionException ex =
+                new SQLNonTransientConnectionException((Throwable)null);
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLNonTransientConnectionException with Throwable
+     */
+    @Test
+    public void test9() {
+        SQLNonTransientConnectionException ex =
+                new SQLNonTransientConnectionException(t);
+        assertTrue(ex.getMessage().equals(cause)
+                && ex.getSQLState() == null
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Serialize a SQLNonTransientConnectionException and make sure you can
+     * read it back properly
+     */
+    @Test
+    public void test10() throws Exception {
+        SQLNonTransientConnectionException e =
+                new SQLNonTransientConnectionException(reason, state, errorCode, t);
+        SQLNonTransientConnectionException ex1 =
+                createSerializedException(e);
+        assertTrue(reason.equals(ex1.getMessage())
+                && ex1.getSQLState().equals(state)
+                && cause.equals(ex1.getCause().toString())
+                && ex1.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct
+     * using for-each loop
+     */
+    @Test
+    public void test11() {
+        SQLNonTransientConnectionException ex =
+                new SQLNonTransientConnectionException("Exception 1", t1);
+        SQLNonTransientConnectionException ex1 =
+                new SQLNonTransientConnectionException("Exception 2");
+        SQLNonTransientConnectionException ex2 =
+                new SQLNonTransientConnectionException("Exception 3", t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        for (Throwable e : ex) {
+            assertTrue(msgs[num++].equals(e.getMessage()));
+        }
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct
+     * using traditional while loop
+     */
+    @Test
+    public void test12() {
+        SQLNonTransientConnectionException ex =
+                new SQLNonTransientConnectionException("Exception 1", t1);
+        SQLNonTransientConnectionException ex1 =
+                new SQLNonTransientConnectionException("Exception 2");
+        SQLNonTransientConnectionException ex2 =
+                new SQLNonTransientConnectionException("Exception 3", t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        SQLException sqe = ex;
+        while (sqe != null) {
+            assertTrue(msgs[num++].equals(sqe.getMessage()));
+            Throwable c = sqe.getCause();
+            while (c != null) {
+                assertTrue(msgs[num++].equals(c.getMessage()));
+                c = c.getCause();
+            }
+            sqe = sqe.getNextException();
+        }
+    }
+
+    /**
+     * Create SQLNonTransientConnectionException and validate it is an instance of
+     * SQLNonTransientException
+     */
+    @Test
+    public void test13() {
+        Exception ex = new SQLNonTransientConnectionException();
+        assertTrue(ex instanceof SQLNonTransientException);
+    }
+}
diff --git a/jdk/test/java/sql/test/sql/SQLNonTransientExceptionTests.java b/jdk/test/java/sql/test/sql/SQLNonTransientExceptionTests.java
new file mode 100644
index 0000000..061ffe2
--- /dev/null
+++ b/jdk/test/java/sql/test/sql/SQLNonTransientExceptionTests.java
@@ -0,0 +1,209 @@
+/*
+ * 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.
+ *
+ * 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 test.sql;
+
+import java.sql.SQLException;
+import java.sql.SQLNonTransientException;
+import static org.testng.Assert.*;
+import org.testng.annotations.Test;
+import util.BaseTest;
+
+public class SQLNonTransientExceptionTests extends BaseTest {
+
+    /**
+     * Create SQLNonTransientException and setting all objects to null
+     */
+    @Test
+    public void test() {
+        SQLNonTransientException e = new SQLNonTransientException(null,
+                null, errorCode, null);
+        assertTrue(e.getMessage() == null && e.getSQLState() == null
+                && e.getCause() == null && e.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLNonTransientException with no-arg constructor
+     */
+    @Test
+    public void test1() {
+        SQLNonTransientException ex = new SQLNonTransientException();
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLNonTransientException with message
+     */
+    @Test
+    public void test2() {
+        SQLNonTransientException ex = new SQLNonTransientException(reason);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLNonTransientException with message, and SQLState
+     */
+    @Test
+    public void test3() {
+        SQLNonTransientException ex = new SQLNonTransientException(reason, state);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLNonTransientException with message, SQLState, and error code
+     */
+    @Test
+    public void test4() {;
+        SQLNonTransientException ex =
+                new SQLNonTransientException(reason, state, errorCode);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && ex.getCause() == null
+                && ex.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLNonTransientException with message, SQLState, errorCode, and Throwable
+     */
+    @Test
+    public void test5() {
+        SQLNonTransientException ex =
+                new SQLNonTransientException(reason, state, errorCode, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLNonTransientException with message, SQLState, and Throwable
+     */
+    @Test
+    public void test6() {
+        SQLNonTransientException ex = new SQLNonTransientException(reason, state, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLNonTransientException with message, and Throwable
+     */
+    @Test
+    public void test7() {
+        SQLNonTransientException ex = new SQLNonTransientException(reason, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLNonTransientException with null Throwable
+     */
+    @Test
+    public void test8() {
+        SQLNonTransientException ex = new SQLNonTransientException((Throwable)null);
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLNonTransientException with Throwable
+     */
+    @Test
+    public void test9() {
+        SQLNonTransientException ex = new SQLNonTransientException(t);
+        assertTrue(ex.getMessage().equals(cause)
+                && ex.getSQLState() == null
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Serialize a SQLNonTransientException and make sure you can read it back properly
+     */
+    @Test
+    public void test10() throws Exception {
+        SQLNonTransientException e =
+                new SQLNonTransientException(reason, state, errorCode, t);
+        SQLNonTransientException ex1 =
+                createSerializedException(e);
+        assertTrue(reason.equals(ex1.getMessage())
+                && ex1.getSQLState().equals(state)
+                && cause.equals(ex1.getCause().toString())
+                && ex1.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct
+     * using for-each loop
+     */
+    @Test
+    public void test11() {
+        SQLNonTransientException ex = new SQLNonTransientException("Exception 1", t1);
+        SQLNonTransientException ex1 = new SQLNonTransientException("Exception 2");
+        SQLNonTransientException ex2 = new SQLNonTransientException("Exception 3", t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        for (Throwable e : ex) {
+            assertTrue(msgs[num++].equals(e.getMessage()));
+        }
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct
+     * using traditional while loop
+     */
+    @Test
+    public void test12() {
+        SQLNonTransientException ex = new SQLNonTransientException("Exception 1", t1);
+        SQLNonTransientException ex1 = new SQLNonTransientException("Exception 2");
+        SQLNonTransientException ex2 = new SQLNonTransientException("Exception 3", t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        SQLException sqe = ex;
+        while (sqe != null) {
+            assertTrue(msgs[num++].equals(sqe.getMessage()));
+            Throwable c = sqe.getCause();
+            while (c != null) {
+                assertTrue(msgs[num++].equals(c.getMessage()));
+                c = c.getCause();
+            }
+            sqe = sqe.getNextException();
+        }
+    }
+}
diff --git a/jdk/test/java/sql/test/sql/SQLRecoverableExceptionTests.java b/jdk/test/java/sql/test/sql/SQLRecoverableExceptionTests.java
new file mode 100644
index 0000000..d23a131
--- /dev/null
+++ b/jdk/test/java/sql/test/sql/SQLRecoverableExceptionTests.java
@@ -0,0 +1,209 @@
+/*
+ * 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.
+ *
+ * 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 test.sql;
+
+import java.sql.SQLException;
+import java.sql.SQLRecoverableException;
+import static org.testng.Assert.*;
+import org.testng.annotations.Test;
+import util.BaseTest;
+
+public class SQLRecoverableExceptionTests extends BaseTest {
+
+    /**
+     * Create SQLRecoverableException and setting all objects to null
+     */
+    @Test
+    public void test() {
+        SQLRecoverableException e = new SQLRecoverableException(null,
+               null, errorCode, null);
+        assertTrue(e.getMessage() == null && e.getSQLState() == null
+                && e.getCause() == null && e.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLRecoverableException with no-arg constructor
+     */
+    @Test
+    public void test1() {
+        SQLRecoverableException ex = new SQLRecoverableException();
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLRecoverableException with message
+     */
+    @Test
+    public void test2() {
+        SQLRecoverableException ex = new SQLRecoverableException(reason);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLRecoverableException with message, and SQLState
+     */
+    @Test
+    public void test3() {
+        SQLRecoverableException ex = new SQLRecoverableException(reason, state);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLRecoverableException with message, SQLState, and error code
+     */
+    @Test
+    public void test4() {
+        SQLRecoverableException ex =
+                new SQLRecoverableException(reason, state, errorCode);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && ex.getCause() == null
+                && ex.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLRecoverableException with message, SQLState, errorCode, and Throwable
+     */
+    @Test
+    public void test5() {
+        SQLRecoverableException ex =
+                new SQLRecoverableException(reason, state, errorCode, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLRecoverableException with message, SQLState, and Throwable
+     */
+    @Test
+    public void test6() {
+        SQLRecoverableException ex = new SQLRecoverableException(reason, state, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLRecoverableException with message, and Throwable
+     */
+    @Test
+    public void test7() {
+        SQLRecoverableException ex = new SQLRecoverableException(reason, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLRecoverableException with null Throwable
+     */
+    @Test
+    public void test8() {
+        SQLRecoverableException ex = new SQLRecoverableException((Throwable)null);
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLRecoverableException with Throwable
+     */
+    @Test
+    public void test9() {
+        SQLRecoverableException ex = new SQLRecoverableException(t);
+        assertTrue(ex.getMessage().equals(cause)
+                && ex.getSQLState() == null
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Serialize a SQLRecoverableException and make sure you can read it back properly
+     */
+    @Test
+    public void test10() throws Exception {
+        SQLRecoverableException e =
+                new SQLRecoverableException(reason, state, errorCode, t);
+        SQLRecoverableException ex1 =
+                createSerializedException(e);
+        assertTrue(reason.equals(ex1.getMessage())
+                && ex1.getSQLState().equals(state)
+                && cause.equals(ex1.getCause().toString())
+                && ex1.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct
+     * using for-each loop
+     */
+    @Test
+    public void test11() {
+        SQLRecoverableException ex = new SQLRecoverableException("Exception 1", t1);
+        SQLRecoverableException ex1 = new SQLRecoverableException("Exception 2");
+        SQLRecoverableException ex2 = new SQLRecoverableException("Exception 3", t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        for (Throwable e : ex) {
+            assertTrue(msgs[num++].equals(e.getMessage()));
+        }
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct
+     * using traditional while loop
+     */
+    @Test
+    public void test12() {
+        SQLRecoverableException ex = new SQLRecoverableException("Exception 1", t1);
+        SQLRecoverableException ex1 = new SQLRecoverableException("Exception 2");
+        SQLRecoverableException ex2 = new SQLRecoverableException("Exception 3", t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        SQLException sqe = ex;
+        while (sqe != null) {
+            assertTrue(msgs[num++].equals(sqe.getMessage()));
+            Throwable c = sqe.getCause();
+            while (c != null) {
+                assertTrue(msgs[num++].equals(c.getMessage()));
+                c = c.getCause();
+            }
+            sqe = sqe.getNextException();
+        }
+    }
+}
diff --git a/jdk/test/java/sql/test/sql/SQLSyntaxErrorExceptionTests.java b/jdk/test/java/sql/test/sql/SQLSyntaxErrorExceptionTests.java
new file mode 100644
index 0000000..863213c
--- /dev/null
+++ b/jdk/test/java/sql/test/sql/SQLSyntaxErrorExceptionTests.java
@@ -0,0 +1,221 @@
+/*
+ * 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.
+ *
+ * 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 test.sql;
+
+import java.sql.SQLException;
+import java.sql.SQLNonTransientException;
+import java.sql.SQLSyntaxErrorException;
+import static org.testng.Assert.*;
+import org.testng.annotations.Test;
+import util.BaseTest;
+
+public class SQLSyntaxErrorExceptionTests extends BaseTest {
+
+    /**
+     * Create SQLSyntaxErrorException and setting all objects to null
+     */
+    @Test
+    public void test() {
+        SQLSyntaxErrorException e = new SQLSyntaxErrorException(null,
+                null, errorCode, null);
+        assertTrue(e.getMessage() == null && e.getSQLState() == null
+                && e.getCause() == null && e.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLSyntaxErrorException with no-arg constructor
+     */
+    @Test
+    public void test1() {
+        SQLSyntaxErrorException ex = new SQLSyntaxErrorException();
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLSyntaxErrorException with message
+     */
+    @Test
+    public void test2() {
+        SQLSyntaxErrorException ex = new SQLSyntaxErrorException(reason);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLSyntaxErrorException with message, and SQLState
+     */
+    @Test
+    public void test3() {
+        SQLSyntaxErrorException ex = new SQLSyntaxErrorException(reason, state);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLSyntaxErrorException with message, SQLState, and error code
+     */
+    @Test
+    public void test4() {
+        SQLSyntaxErrorException ex =
+                new SQLSyntaxErrorException(reason, state, errorCode);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && ex.getCause() == null
+                && ex.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLSyntaxErrorException with message, SQLState, errorCode, and Throwable
+     */
+    @Test
+    public void test5() {
+        SQLSyntaxErrorException ex =
+                new SQLSyntaxErrorException(reason, state, errorCode, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLSyntaxErrorException with message, SQLState, and Throwable
+     */
+    @Test
+    public void test6() {
+        SQLSyntaxErrorException ex = new SQLSyntaxErrorException(reason, state, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLSyntaxErrorException with message, and Throwable
+     */
+    @Test
+    public void test7() {
+        SQLSyntaxErrorException ex = new SQLSyntaxErrorException(reason, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLSyntaxErrorException with null Throwable
+     */
+    @Test
+    public void test8() {
+        SQLSyntaxErrorException ex = new SQLSyntaxErrorException((Throwable)null);
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLSyntaxErrorException with Throwable
+     */
+    @Test
+    public void test9() {
+        SQLSyntaxErrorException ex = new SQLSyntaxErrorException(t);
+        assertTrue(ex.getMessage().equals(cause)
+                && ex.getSQLState() == null
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Serialize a SQLSyntaxErrorException and make sure you can read it back properly
+     */
+    @Test
+    public void test10() throws Exception {
+
+        SQLSyntaxErrorException e =
+                new SQLSyntaxErrorException(reason, state, errorCode, t);
+        SQLSyntaxErrorException ex1 =
+                createSerializedException(e);
+        assertTrue(reason.equals(ex1.getMessage())
+                && ex1.getSQLState().equals(state)
+                && cause.equals(ex1.getCause().toString())
+                && ex1.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct
+     * using for-each loop
+     */
+    @Test
+    public void test11() {
+        SQLSyntaxErrorException ex = new SQLSyntaxErrorException("Exception 1", t1);
+        SQLSyntaxErrorException ex1 = new SQLSyntaxErrorException("Exception 2");
+        SQLSyntaxErrorException ex2 = new SQLSyntaxErrorException("Exception 3", t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        for (Throwable e : ex) {
+            assertTrue(msgs[num++].equals(e.getMessage()));
+        }
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct
+     * using traditional while loop
+     */
+    @Test
+    public void test12() {
+        SQLSyntaxErrorException ex = new SQLSyntaxErrorException("Exception 1", t1);
+        SQLSyntaxErrorException ex1 = new SQLSyntaxErrorException("Exception 2");
+        SQLSyntaxErrorException ex2 = new SQLSyntaxErrorException("Exception 3", t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        SQLException sqe = ex;
+        while (sqe != null) {
+            assertTrue(msgs[num++].equals(sqe.getMessage()));
+            Throwable c = sqe.getCause();
+            while (c != null) {
+                assertTrue(msgs[num++].equals(c.getMessage()));
+                c = c.getCause();
+            }
+            sqe = sqe.getNextException();
+        }
+    }
+
+    /**
+     * Create SQLSyntaxErrorException and validate it is an instance of
+     * SQLNonTransientException
+     */
+    @Test
+    public void test13() {
+        Exception ex = new SQLSyntaxErrorException();
+        assertTrue(ex instanceof SQLNonTransientException);
+    }
+}
diff --git a/jdk/test/java/sql/test/sql/SQLTimeoutExceptionTests.java b/jdk/test/java/sql/test/sql/SQLTimeoutExceptionTests.java
new file mode 100644
index 0000000..dfe3415
--- /dev/null
+++ b/jdk/test/java/sql/test/sql/SQLTimeoutExceptionTests.java
@@ -0,0 +1,218 @@
+/*
+ * 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.
+ *
+ * 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 test.sql;
+
+import java.sql.SQLException;
+import java.sql.SQLTimeoutException;
+import java.sql.SQLTransientException;
+import static org.testng.Assert.*;
+import org.testng.annotations.Test;
+import util.BaseTest;
+
+public class SQLTimeoutExceptionTests extends BaseTest {
+
+    /**
+     * Create SQLTimeoutException and setting all objects to null
+     */
+    @Test
+    public void test() {
+        SQLTimeoutException e = new SQLTimeoutException(null,
+                null, errorCode, null);
+        assertTrue(e.getMessage() == null && e.getSQLState() == null
+                && e.getCause() == null && e.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLTimeoutException with no-arg constructor
+     */
+    @Test
+    public void test1() {
+        SQLTimeoutException ex = new SQLTimeoutException();
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLTimeoutException with message
+     */
+    @Test
+    public void test2() {
+        SQLTimeoutException ex = new SQLTimeoutException(reason);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLTimeoutException with message, and SQLState
+     */
+    @Test
+    public void test3() {
+        SQLTimeoutException ex = new SQLTimeoutException(reason, state);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLTimeoutException with message, SQLState, and error code
+     */
+    @Test
+    public void test4() {
+        SQLTimeoutException ex = new SQLTimeoutException(reason, state, errorCode);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && ex.getCause() == null
+                && ex.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLTimeoutException with message, SQLState, errorCode, and Throwable
+     */
+    @Test
+    public void test5() {
+        SQLTimeoutException ex = new SQLTimeoutException(reason, state, errorCode, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLTimeoutException with message, SQLState, and Throwable
+     */
+    @Test
+    public void test6() {
+        SQLTimeoutException ex = new SQLTimeoutException(reason, state, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLTimeoutException with message, and Throwable
+     */
+    @Test
+    public void test7() {
+        SQLTimeoutException ex = new SQLTimeoutException(reason, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLTimeoutException with null Throwable
+     */
+    @Test
+    public void test8() {
+        SQLTimeoutException ex = new SQLTimeoutException((Throwable)null);
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLTimeoutException with Throwable
+     */
+    @Test
+    public void test9() {
+        SQLTimeoutException ex = new SQLTimeoutException(t);
+        assertTrue(ex.getMessage().equals(cause)
+                && ex.getSQLState() == null
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Serialize a SQLTimeoutException and make sure you can read it back properly
+     */
+    @Test
+    public void test10() throws Exception {
+        SQLTimeoutException e =
+                new SQLTimeoutException(reason, state, errorCode, t);
+        SQLTimeoutException ex1 =
+                createSerializedException(e);
+        assertTrue(reason.equals(ex1.getMessage())
+                && ex1.getSQLState().equals(state)
+                && cause.equals(ex1.getCause().toString())
+                && ex1.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct
+     * using for-each loop
+     */
+    @Test
+    public void test11() {
+        SQLTimeoutException ex = new SQLTimeoutException("Exception 1", t1);
+        SQLTimeoutException ex1 = new SQLTimeoutException("Exception 2");
+        SQLTimeoutException ex2 = new SQLTimeoutException("Exception 3", t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        for (Throwable e : ex) {
+            assertTrue(msgs[num++].equals(e.getMessage()));
+        }
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct
+     * using traditional while loop
+     */
+    @Test
+    public void test12() {
+        SQLTimeoutException ex = new SQLTimeoutException("Exception 1", t1);
+        SQLTimeoutException ex1 = new SQLTimeoutException("Exception 2");
+        SQLTimeoutException ex2 = new SQLTimeoutException("Exception 3", t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        SQLException sqe = ex;
+        while (sqe != null) {
+            assertTrue(msgs[num++].equals(sqe.getMessage()));
+            Throwable c = sqe.getCause();
+            while (c != null) {
+                assertTrue(msgs[num++].equals(c.getMessage()));
+                c = c.getCause();
+            }
+            sqe = sqe.getNextException();
+        }
+    }
+
+    /**
+     * Create SQLTimeoutException and validate it is an instance of
+     * SQLNonTransientException
+     */
+    @Test
+    public void test13() {
+        Exception ex = new SQLTimeoutException();
+        assertTrue(ex instanceof SQLTransientException);
+    }
+}
diff --git a/jdk/test/java/sql/test/sql/SQLTransactionRollbackExceptionTests.java b/jdk/test/java/sql/test/sql/SQLTransactionRollbackExceptionTests.java
new file mode 100644
index 0000000..8453ebe
--- /dev/null
+++ b/jdk/test/java/sql/test/sql/SQLTransactionRollbackExceptionTests.java
@@ -0,0 +1,233 @@
+/*
+ * 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.
+ *
+ * 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 test.sql;
+
+import java.sql.SQLException;
+import java.sql.SQLTransactionRollbackException;
+import java.sql.SQLTransientException;
+import static org.testng.Assert.*;
+import org.testng.annotations.Test;
+import util.BaseTest;
+
+public class SQLTransactionRollbackExceptionTests extends BaseTest {
+
+    /**
+     * Create SQLTransactionRollbackException and setting all objects to null
+     */
+    @Test
+    public void test() {
+        SQLTransactionRollbackException e =
+                new SQLTransactionRollbackException(null,
+                null, errorCode, null);
+        assertTrue(e.getMessage() == null && e.getSQLState() == null
+                && e.getCause() == null && e.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLTransactionRollbackException with no-arg constructor
+     */
+    @Test
+    public void test1() {
+        SQLTransactionRollbackException ex = new SQLTransactionRollbackException();
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLTransactionRollbackException with message
+     */
+    @Test
+    public void test2() {
+        SQLTransactionRollbackException ex =
+                new SQLTransactionRollbackException(reason);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLTransactionRollbackException with message, and SQLState
+     */
+    @Test
+    public void test3() {
+        SQLTransactionRollbackException ex =
+                new SQLTransactionRollbackException(reason, state);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLTransactionRollbackException with message, SQLState, and error code
+     */
+    @Test
+    public void test4() {
+        SQLTransactionRollbackException ex =
+                new SQLTransactionRollbackException(reason, state, errorCode);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && ex.getCause() == null
+                && ex.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLTransactionRollbackException with message, SQLState, errorCode, and Throwable
+     */
+    @Test
+    public void test5() {
+        SQLTransactionRollbackException ex =
+                new SQLTransactionRollbackException(reason, state, errorCode, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLTransactionRollbackException with message, SQLState, and Throwable
+     */
+    @Test
+    public void test6() {
+        SQLTransactionRollbackException ex =
+                new SQLTransactionRollbackException(reason, state, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLTransactionRollbackException with message, and Throwable
+     */
+    @Test
+    public void test7() {
+        SQLTransactionRollbackException ex =
+                new SQLTransactionRollbackException(reason, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLTransactionRollbackException with null Throwable
+     */
+    @Test
+    public void test8() {
+        SQLTransactionRollbackException ex =
+                new SQLTransactionRollbackException((Throwable)null);
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLTransactionRollbackException with Throwable
+     */
+    @Test
+    public void test9() {
+        SQLTransactionRollbackException ex =
+                new SQLTransactionRollbackException(t);
+        assertTrue(ex.getMessage().equals(cause)
+                && ex.getSQLState() == null
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Serialize a SQLTransactionRollbackException and make sure you can read it back properly
+     */
+    @Test
+    public void test10() throws Exception {
+        SQLTransactionRollbackException e =
+                new SQLTransactionRollbackException(reason, state, errorCode, t);
+        SQLTransactionRollbackException ex1 =
+                createSerializedException(e);
+        assertTrue(reason.equals(ex1.getMessage())
+                && ex1.getSQLState().equals(state)
+                && cause.equals(ex1.getCause().toString())
+                && ex1.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct
+     * using for-each loop
+     */
+    @Test
+    public void test11() {
+        SQLTransactionRollbackException ex =
+                new SQLTransactionRollbackException("Exception 1", t1);
+        SQLTransactionRollbackException ex1 =
+                new SQLTransactionRollbackException("Exception 2");
+        SQLTransactionRollbackException ex2 =
+                new SQLTransactionRollbackException("Exception 3", t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        for (Throwable e : ex) {
+            assertTrue(msgs[num++].equals(e.getMessage()));
+        }
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct
+     * using traditional while loop
+     */
+    @Test
+    public void test12() {
+        SQLTransactionRollbackException ex =
+                new SQLTransactionRollbackException("Exception 1", t1);
+        SQLTransactionRollbackException ex1 =
+                new SQLTransactionRollbackException("Exception 2");
+        SQLTransactionRollbackException ex2 =
+                new SQLTransactionRollbackException("Exception 3", t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        SQLException sqe = ex;
+        while (sqe != null) {
+            assertTrue(msgs[num++].equals(sqe.getMessage()));
+            Throwable c = sqe.getCause();
+            while (c != null) {
+                assertTrue(msgs[num++].equals(c.getMessage()));
+                c = c.getCause();
+            }
+            sqe = sqe.getNextException();
+        }
+    }
+
+    /**
+     * Create SQLTransactionRollbackException and validate it is an instance of
+     * SQLNonTransientException
+     */
+    @Test
+    public void test13() {
+        Exception ex = new SQLTransactionRollbackException();
+        assertTrue(ex instanceof SQLTransientException);
+    }
+}
diff --git a/jdk/test/java/sql/test/sql/SQLTransientConnectionExceptionTests.java b/jdk/test/java/sql/test/sql/SQLTransientConnectionExceptionTests.java
new file mode 100644
index 0000000..7999253
--- /dev/null
+++ b/jdk/test/java/sql/test/sql/SQLTransientConnectionExceptionTests.java
@@ -0,0 +1,233 @@
+/*
+ * 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.
+ *
+ * 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 test.sql;
+
+import java.sql.SQLException;
+import java.sql.SQLTransientConnectionException;
+import java.sql.SQLTransientException;
+import static org.testng.Assert.*;
+import org.testng.annotations.Test;
+import util.BaseTest;
+
+public class SQLTransientConnectionExceptionTests extends BaseTest {
+
+    /**
+     * Create SQLTransientConnectionException and setting all objects to null
+     */
+    @Test
+    public void test() {
+        SQLTransientConnectionException e =
+                new SQLTransientConnectionException( null,
+                null, errorCode, null);
+        assertTrue(e.getMessage() == null && e.getSQLState() == null
+                && e.getCause() == null && e.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLTransientConnectionException with no-arg constructor
+     */
+    @Test
+    public void test1() {
+        SQLTransientConnectionException ex = new SQLTransientConnectionException();
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLTransientConnectionException with message
+     */
+    @Test
+    public void test2() {
+        SQLTransientConnectionException ex =
+                new SQLTransientConnectionException(reason);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLTransientConnectionException with message, and SQLState
+     */
+    @Test
+    public void test3() {
+        SQLTransientConnectionException ex =
+                new SQLTransientConnectionException(reason, state);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLTransientConnectionException with message, SQLState, and error code
+     */
+    @Test
+    public void test4() {;
+        SQLTransientConnectionException ex =
+                new SQLTransientConnectionException(reason, state, errorCode);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && ex.getCause() == null
+                && ex.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLTransientConnectionException with message, SQLState, errorCode, and Throwable
+     */
+    @Test
+    public void test5() {
+        SQLTransientConnectionException ex =
+                new SQLTransientConnectionException(reason, state, errorCode, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLTransientConnectionException with message, SQLState, and Throwable
+     */
+    @Test
+    public void test6() {
+        SQLTransientConnectionException ex =
+                new SQLTransientConnectionException(reason, state, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLTransientConnectionException with message, and Throwable
+     */
+    @Test
+    public void test7() {
+        SQLTransientConnectionException ex =
+                new SQLTransientConnectionException(reason, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLTransientConnectionException with null Throwable
+     */
+    @Test
+    public void test8() {
+        SQLTransientConnectionException ex =
+                new SQLTransientConnectionException((Throwable)null);
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLTransientConnectionException with Throwable
+     */
+    @Test
+    public void test9() {
+        SQLTransientConnectionException ex =
+                new SQLTransientConnectionException(t);
+        assertTrue(ex.getMessage().equals(cause)
+                && ex.getSQLState() == null
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Serialize a SQLTransientConnectionException and make sure you can read it back properly
+     */
+    @Test
+    public void test10() throws Exception {
+        SQLTransientConnectionException e =
+                new SQLTransientConnectionException(reason, state, errorCode, t);
+        SQLTransientConnectionException ex1 =
+                createSerializedException(e);
+        assertTrue(reason.equals(ex1.getMessage())
+                && ex1.getSQLState().equals(state)
+                && cause.equals(ex1.getCause().toString())
+                && ex1.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct
+     * using for-each loop
+     */
+    @Test
+    public void test11() {
+        SQLTransientConnectionException ex =
+                new SQLTransientConnectionException("Exception 1", t1);
+        SQLTransientConnectionException ex1 =
+                new SQLTransientConnectionException("Exception 2");
+        SQLTransientConnectionException ex2 =
+                new SQLTransientConnectionException("Exception 3", t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        for (Throwable e : ex) {
+            assertTrue(msgs[num++].equals(e.getMessage()));
+        }
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct
+     * using traditional while loop
+     */
+    @Test
+    public void test12() {
+        SQLTransientConnectionException ex =
+                new SQLTransientConnectionException("Exception 1", t1);
+        SQLTransientConnectionException ex1 =
+                new SQLTransientConnectionException("Exception 2");
+        SQLTransientConnectionException ex2 =
+                new SQLTransientConnectionException("Exception 3", t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        SQLException sqe = ex;
+        while (sqe != null) {
+            assertTrue(msgs[num++].equals(sqe.getMessage()));
+            Throwable c = sqe.getCause();
+            while (c != null) {
+                assertTrue(msgs[num++].equals(c.getMessage()));
+                c = c.getCause();
+            }
+            sqe = sqe.getNextException();
+        }
+    }
+
+    /**
+     * Create SQLTransientConnectionException and validate it is an instance of
+     * SQLNonTransientException
+     */
+    @Test
+    public void test13() {
+        Exception ex = new SQLTransientConnectionException();
+        assertTrue(ex instanceof SQLTransientException);
+    }
+}
diff --git a/jdk/test/java/sql/test/sql/SQLTransientExceptionTests.java b/jdk/test/java/sql/test/sql/SQLTransientExceptionTests.java
new file mode 100644
index 0000000..d86f86b
--- /dev/null
+++ b/jdk/test/java/sql/test/sql/SQLTransientExceptionTests.java
@@ -0,0 +1,207 @@
+/*
+ * 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.
+ *
+ * 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 test.sql;
+
+import java.sql.SQLException;
+import java.sql.SQLTransientException;
+import static org.testng.Assert.*;
+import org.testng.annotations.Test;
+import util.BaseTest;
+
+public class SQLTransientExceptionTests extends BaseTest {
+
+    /**
+     * Create SQLTransientException and setting all objects to null
+     */
+    @Test
+    public void test() {
+        SQLTransientException e = new SQLTransientException(null,
+                null, errorCode, null);
+        assertTrue(e.getMessage() == null && e.getSQLState() == null
+                && e.getCause() == null && e.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLTransientException with no-arg constructor
+     */
+    @Test
+    public void test1() {
+        SQLTransientException ex = new SQLTransientException();
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLTransientException with message
+     */
+    @Test
+    public void test2() {
+        SQLTransientException ex = new SQLTransientException(reason);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLTransientException with message, and SQLState
+     */
+    @Test
+    public void test3() {
+        SQLTransientException ex = new SQLTransientException(reason, state);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLTransientException with message, SQLState, and error code
+     */
+    @Test
+    public void test4() {
+        SQLTransientException ex = new SQLTransientException(reason, state, errorCode);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && ex.getCause() == null
+                && ex.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLTransientException with message, SQLState, errorCode, and Throwable
+     */
+    @Test
+    public void test5() {
+        SQLTransientException ex =
+                new SQLTransientException(reason, state, errorCode, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLTransientException with message, SQLState, and Throwable
+     */
+    @Test
+    public void test6() {
+        SQLTransientException ex = new SQLTransientException(reason, state, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLTransientException with message, and Throwable
+     */
+    @Test
+    public void test7() {
+        SQLTransientException ex = new SQLTransientException(reason, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLTransientException with null Throwable
+     */
+    @Test
+    public void test8() {
+        SQLTransientException ex = new SQLTransientException((Throwable)null);
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLTransientException with Throwable
+     */
+    @Test
+    public void test9() {
+        SQLTransientException ex = new SQLTransientException(t);
+        assertTrue(ex.getMessage().equals(cause)
+                && ex.getSQLState() == null
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Serialize a SQLTransientException and make sure you can read it back properly
+     */
+    @Test
+    public void test10() throws Exception {
+        SQLTransientException e =
+                new SQLTransientException(reason, state, errorCode, t);
+        SQLTransientException ex1 = createSerializedException(e);
+        assertTrue(reason.equals(ex1.getMessage())
+                && ex1.getSQLState().equals(state)
+                && cause.equals(ex1.getCause().toString())
+                && ex1.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct
+     * using for-each loop
+     */
+    @Test
+    public void test11() {
+        SQLTransientException ex = new SQLTransientException("Exception 1", t1);
+        SQLTransientException ex1 = new SQLTransientException("Exception 2");
+        SQLTransientException ex2 = new SQLTransientException("Exception 3", t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        for (Throwable e : ex) {
+            assertTrue(msgs[num++].equals(e.getMessage()));
+        }
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct
+     * using traditional while loop
+     */
+    @Test
+    public void test12() {
+        SQLTransientException ex = new SQLTransientException("Exception 1", t1);
+        SQLTransientException ex1 = new SQLTransientException("Exception 2");
+        SQLTransientException ex2 = new SQLTransientException("Exception 3", t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        SQLException sqe = ex;
+        while (sqe != null) {
+            assertTrue(msgs[num++].equals(sqe.getMessage()));
+            Throwable c = sqe.getCause();
+            while (c != null) {
+                assertTrue(msgs[num++].equals(c.getMessage()));
+                c = c.getCause();
+            }
+            sqe = sqe.getNextException();
+        }
+    }
+}
diff --git a/jdk/test/java/sql/test/sql/SQLWarningTests.java b/jdk/test/java/sql/test/sql/SQLWarningTests.java
new file mode 100644
index 0000000..2856742
--- /dev/null
+++ b/jdk/test/java/sql/test/sql/SQLWarningTests.java
@@ -0,0 +1,249 @@
+/*
+ * 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.
+ *
+ * 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 test.sql;
+
+import java.sql.SQLException;
+import java.sql.SQLWarning;
+import static org.testng.Assert.*;
+import org.testng.annotations.Test;
+import util.BaseTest;
+
+public class SQLWarningTests extends BaseTest {
+
+    private final String[] warnings = {"Warning 1", "cause 1", "Warning 2",
+            "Warning 3", "cause 2"};
+
+    /**
+     * Create SQLWarning and setting all objects to null
+     */
+    @Test
+    public void test() {
+        SQLWarning e = new SQLWarning(null, null, errorCode, null);
+        assertTrue(e.getMessage() == null && e.getSQLState() == null
+                && e.getCause() == null && e.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLWarning with no-arg constructor
+     */
+    @Test
+    public void test1() {
+        SQLWarning ex = new SQLWarning();
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLWarning with message
+     */
+    @Test
+    public void test2() {
+        SQLWarning ex = new SQLWarning(reason);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLWarning with message, and SQLState
+     */
+    @Test
+    public void test3() {
+
+        SQLWarning ex = new SQLWarning(reason, state);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLWarning with message, SQLState, and error code
+     */
+    @Test
+    public void test4() {
+        SQLWarning ex = new SQLWarning(reason, state, errorCode);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && ex.getCause() == null
+                && ex.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLWarning with message, SQLState, errorCode, and Throwable
+     */
+    @Test
+    public void test5() {
+        SQLWarning ex = new SQLWarning(reason, state, errorCode, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLWarning with message, SQLState, and Throwable
+     */
+    @Test
+    public void test6() {
+        SQLWarning ex = new SQLWarning(reason, state, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLWarning with message, and Throwable
+     */
+    @Test
+    public void test7() {
+        SQLWarning ex = new SQLWarning(reason, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLWarning with null Throwable
+     */
+    @Test
+    public void test8() {
+        SQLWarning ex = new SQLWarning((Throwable) null);
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLWarning with Throwable
+     */
+    @Test
+    public void test9() {
+        SQLWarning ex = new SQLWarning(t);
+        assertTrue(ex.getMessage().equals(cause)
+                && ex.getSQLState() == null
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Serialize a SQLWarning and make sure you can read it back properly
+     */
+    @Test
+    public void test10() throws Exception {
+        SQLWarning e = new SQLWarning(reason, state, errorCode, t);
+        SQLWarning ex1 = createSerializedException(e);
+        assertTrue(reason.equals(ex1.getMessage())
+                && ex1.getSQLState().equals(state)
+                && cause.equals(ex1.getCause().toString())
+                && ex1.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct using
+     * for-each loop
+     */
+    @Test
+    public void test11() {
+        SQLWarning ex = new SQLWarning("Exception 1", t1);
+        SQLWarning ex1 = new SQLWarning("Exception 2");
+        SQLWarning ex2 = new SQLWarning("Exception 3", t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        for (Throwable e : ex) {
+            assertTrue(msgs[num++].equals(e.getMessage()));
+        }
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct using
+     * traditional while loop
+     */
+    @Test
+    public void test12() {
+        SQLWarning ex = new SQLWarning("Exception 1", t1);
+        SQLWarning ex1 = new SQLWarning("Exception 2");
+        SQLWarning ex2 = new SQLWarning("Exception 3", t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        SQLException sqe = ex;
+        while (sqe != null) {
+            assertTrue(msgs[num++].equals(sqe.getMessage()));
+            Throwable c = sqe.getCause();
+            while (c != null) {
+                assertTrue(msgs[num++].equals(c.getMessage()));
+                c = c.getCause();
+            }
+            sqe = sqe.getNextException();
+        }
+    }
+
+    /**
+     * Validate that the ordering of the returned SQLWarning is correct using
+     * for-each loop
+     */
+    @Test
+    public void test13() {
+        SQLWarning ex = new SQLWarning("Warning 1", t1);
+        SQLWarning ex1 = new SQLWarning("Warning 2");
+        SQLWarning ex2 = new SQLWarning("Warning 3", t2);
+        ex.setNextWarning(ex1);
+        ex.setNextWarning(ex2);
+        int num = 0;
+        for (Throwable e : ex) {
+            assertTrue(warnings[num++].equals(e.getMessage()));
+        }
+    }
+
+    /**
+     * Validate that the ordering of the returned SQLWarning is correct using
+     * traditional while loop
+     */
+    @Test
+    public void test14() {
+        SQLWarning ex = new SQLWarning("Warning 1", t1);
+        SQLWarning ex1 = new SQLWarning("Warning 2");
+        SQLWarning ex2 = new SQLWarning("Warning 3", t2);
+        ex.setNextWarning(ex1);
+        ex.setNextWarning(ex2);
+        int num = 0;
+        SQLWarning sqe = ex;
+        while (sqe != null) {
+            assertTrue(warnings[num++].equals(sqe.getMessage()));
+            Throwable c = sqe.getCause();
+            while (c != null) {
+                assertTrue(msgs[num++].equals(c.getMessage()));
+                c = c.getCause();
+            }
+            sqe = sqe.getNextWarning();
+        }
+    }
+}
diff --git a/jdk/test/java/sql/test/sql/TimeTests.java b/jdk/test/java/sql/test/sql/TimeTests.java
new file mode 100644
index 0000000..4064c37
--- /dev/null
+++ b/jdk/test/java/sql/test/sql/TimeTests.java
@@ -0,0 +1,376 @@
+/*
+ * 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.
+ *
+ * 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 test.sql;
+
+import java.sql.Time;
+import java.time.LocalTime;
+import static org.testng.Assert.*;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+public class TimeTests {
+
+    public TimeTests() {
+    }
+
+    @BeforeClass
+    public static void setUpClass() throws Exception {
+    }
+
+    @AfterClass
+    public static void tearDownClass() throws Exception {
+    }
+
+    @BeforeMethod
+    public void setUpMethod() throws Exception {
+    }
+
+    @AfterMethod
+    public void tearDownMethod() throws Exception {
+    }
+
+    /**
+     * Validate an IllegalArgumentException is thrown for calling getYear
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void test1() {
+        Time t = Time.valueOf("08:30:59");
+        t.getYear();
+    }
+
+    /**
+     * Validate an IllegalArgumentException is thrown for calling getMonth
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void test2() {
+        Time t = Time.valueOf("08:30:59");
+        t.getMonth();
+    }
+
+    /**
+     * Validate an IllegalArgumentException is thrown for calling getDay
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void test3() {
+        Time t = Time.valueOf("08:30:59");
+        t.getDay();
+    }
+
+    /**
+     * Validate an IllegalArgumentException is thrown for calling getDate
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void test4() {
+        Time t = Time.valueOf("08:30:59");
+        t.getDate();
+    }
+
+    /**
+     * Validate an IllegalArgumentException is thrown for calling setYear
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void test5() {
+        Time t = Time.valueOf("08:30:59");
+        t.setYear(8);
+    }
+
+    /**
+     * Validate an IllegalArgumentException is thrown for calling setMonth
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void test6() {
+        Time t = Time.valueOf("08:30:59");
+        t.setMonth(8);
+    }
+
+    /**
+     * Validate an IllegalArgumentException is thrown for calling setDate
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void test7() {
+        Time t = Time.valueOf("08:30:59");
+        t.setDate(30);
+    }
+
+    /**
+     * Validate an IllegalArgumentException is thrown for calling getDate
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void test8() {
+        Time t = Time.valueOf("08:30:59");
+        t.getDate();
+    }
+
+    /**
+     * Validate that a Time made from a toLocalTime() LocalTime are equal
+     */
+    @Test
+    public void test13() {
+        Time t = Time.valueOf("08:30:59");
+        Time t2 = Time.valueOf(t.toLocalTime());
+        assertTrue(t.equals(t2), "Error t != t2");
+    }
+
+    /**
+     * Validate that a Time LocalTime value, made from a LocalTime are equal
+     */
+    @Test
+    public void test14() {
+        LocalTime lt = LocalTime.of(8, 30, 59);
+        Time t = Time.valueOf(lt);
+        System.out.println("lt=" + lt + ",t=" + t.toLocalTime());
+        assertTrue(lt.equals(t.toLocalTime()),
+                "Error LocalTime values are not equal");
+    }
+
+    /**
+     * Validate an NPE occurs when a null LocalDate is passed to valueOf
+     */
+    @Test(expectedExceptions = NullPointerException.class)
+    public void test15() throws Exception {
+        LocalTime ld = null;
+        Time.valueOf(ld);
+    }
+
+    /**
+     * Validate an UnsupportedOperationException occurs when toInstant() is
+     * called
+     */
+    @Test(expectedExceptions = UnsupportedOperationException.class)
+    public void test16() throws Exception {
+        Time t = new Time(System.currentTimeMillis());
+        t.toInstant();
+    }
+
+    /**
+     * Validate that a Time made from valueOf(String) returns the same String
+     * from Time.toString();
+     */
+    @Test
+    public void test17() {
+        String time = "08:30:59";
+        Time t = Time.valueOf(time);
+        assertTrue(time.equals(t.toString()), "Error t != t2");
+    }
+
+    /**
+     * Validate that two Time objects are equal when one is created from the
+     * toString() of the other
+     */
+    @Test
+    public void test18() {
+        Time t = Time.valueOf("08:30:59");
+        Time t2 = Time.valueOf(t.toString());
+        assertTrue(t.equals(t2) && t2.equals(t), "Error t != t2");
+    }
+
+    /**
+     * Validate that two Time values one created using valueOf and another via a
+     * constructor are equal
+     */
+    @Test
+    public void test19() {
+        Time t = Time.valueOf("08:30:59");
+        Time t2 = new Time(8, 30, 59);
+        assertTrue(t.equals(t2) && t2.equals(t), "Error t != t2");
+    }
+
+    /**
+     * Validate that two Time values one created using valueOf and another via a
+     * constructor are equal
+     */
+    @Test
+    public void test20() {
+        Time t = Time.valueOf("08:30:59");
+        Time t2 = new Time(t.getTime());
+        assertTrue(t.equals(t2) && t2.equals(t), "Error t != t2");
+    }
+
+    /**
+     * Validate an IllegalArgumentException is thrown for calling valueOf with a
+     * null String
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void test21() {
+        String time = null;
+        Time t = Time.valueOf(time);
+
+    }
+
+    /**
+     * Validate an IllegalArgumentException is thrown for an invalid Time string
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void test22() throws Exception {
+        Time.valueOf("1961-08-30");
+    }
+
+    /**
+     * Validate an IllegalArgumentException is thrown for an invalid Time string
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void test23() throws Exception {
+        Time.valueOf("8:");
+    }
+
+    /**
+     * Validate an IllegalArgumentException is thrown for an invalid Time string
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void test24() throws Exception {
+        Time.valueOf("a:b:c");
+    }
+
+    /**
+     * Validate an IllegalArgumentException is thrown for an invalid Time string
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void test25() throws Exception {
+        Time.valueOf("08:10");
+    }
+
+    /**
+     * Validate an IllegalArgumentException is thrown for an invalid Time string
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void test26() throws Exception {
+        Time.valueOf("08:10:10:10");
+    }
+
+    /**
+     * Validate an IllegalArgumentException is thrown for an invalid Time string
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void test27() throws Exception {
+        Time.valueOf("08:10:Batman");
+    }
+
+    /**
+     * Validate that Time.after() returns false when same date is compared
+     */
+    @Test
+    public void test28() {
+        Time t = Time.valueOf("08:30:59");
+        assertFalse(t.after(t), "Error t.after(t) = true");
+    }
+
+    /**
+     * Validate that Time.after() returns true when later date is compared to
+     * earlier date
+     */
+    @Test
+    public void test29() {
+        Time t = Time.valueOf("08:30:59");
+        Time t2 = new Time(System.currentTimeMillis());
+        assertTrue(t2.after(t), "Error t2.after(t) = false");
+    }
+
+    /**
+     * Validate that Time.after() returns false when earlier date is compared to
+     * itself
+     */
+    @Test
+    public void test30() {
+        Time t = Time.valueOf("08:30:59");
+        Time t2 = new Time(t.getTime());
+        assertFalse(t.after(t2), "Error t.after(t2) = true");
+        assertFalse(t2.after(t), "Error t2.after(t) = true");
+    }
+
+    /**
+     * Validate that Time.before() returns false when same date is compared
+     */
+    @Test
+    public void test31() {
+        Time t = Time.valueOf("08:30:59");
+        assertFalse(t.before(t), "Error t.before(t) = true");
+    }
+
+    /**
+     * Validate that Time.before() returns true when earlier date is compared to
+     * later date
+     */
+    @Test
+    public void test32() {
+        Time t = Time.valueOf("08:30:59");
+        Time t2 = new Time(System.currentTimeMillis());
+        assertTrue(t.before(t2), "Error t.before(t2) = false");
+    }
+
+    /**
+     * Validate that Time.before() returns false when earlier date is compared
+     * to itself
+     */
+    @Test
+    public void test33() {
+        Time t = Time.valueOf("08:30:59");
+        Time t2 = new Time(t.getTime());
+        assertFalse(t.before(t2), "Error t.after(t2) = true");
+        assertFalse(t2.before(t), "Error t2.after(t) = true");
+    }
+
+    /**
+     * Validate that Time.compareTo returns 0 when both Date objects are the
+     * same
+     */
+    @Test
+    public void test34() {
+        Time t = Time.valueOf("08:30:59");
+        assertTrue(t.compareTo(t) == 0, "Error t.compareTo(t) !=0");
+    }
+
+    /**
+     * Validate thatTime.compareTo returns 0 when both Time objects are the same
+     */
+    @Test
+    public void test35() {
+        Time t = Time.valueOf("08:30:59");
+        Time t2 = new Time(t.getTime());
+        assertTrue(t.compareTo(t2) == 0, "Error t.compareTo(t2) !=0");
+    }
+
+    /**
+     * Validate that Time.compareTo returns 1 when comparing a later Time to an
+     * earlier Time
+     */
+    @Test
+    public void test36() {
+        Time t = Time.valueOf("08:30:59");
+        Time t2 = new Time(t.getTime() + 1);
+        assertTrue(t2.compareTo(t) == 1, "Error t2.compareTo(t) !=1");
+    }
+
+    /**
+     * Validate thatTime.compareTo returns 1 when comparing a later Time to an
+     * earlier Time
+     */
+    @Test
+    public void test37() {
+        Time t = Time.valueOf("08:30:59");
+        Time t2 = new Time(t.getTime() + 1);
+        assertTrue(t.compareTo(t2) == -1, "Error t.compareTo(t2) != -1");
+    }
+}
diff --git a/jdk/test/java/sql/test/sql/TimestampTests.java b/jdk/test/java/sql/test/sql/TimestampTests.java
new file mode 100644
index 0000000..ac87f16
--- /dev/null
+++ b/jdk/test/java/sql/test/sql/TimestampTests.java
@@ -0,0 +1,640 @@
+/*
+ * 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.
+ *
+ * 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 test.sql;
+
+import java.sql.Date;
+import java.sql.Time;
+import java.sql.Timestamp;
+import java.time.Instant;
+import java.time.LocalDateTime;
+import java.util.Calendar;
+import static org.testng.Assert.*;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+public class TimestampTests {
+
+    public TimestampTests() {
+    }
+
+    @BeforeClass
+    public static void setUpClass() throws Exception {
+    }
+
+    @AfterClass
+    public static void tearDownClass() throws Exception {
+    }
+
+    @BeforeMethod
+    public void setUpMethod() throws Exception {
+    }
+
+    @AfterMethod
+    public void tearDownMethod() throws Exception {
+    }
+
+    /**
+     * Validate an IllegalArgumentException is thrown for an invalid Timestamp
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void testInvalid_timestamp() throws Exception {
+        String testTS = "2009-11-01-01 10:50";
+        Timestamp.valueOf(testTS);
+    }
+
+    /**
+     * Validate an IllegalArgumentException is thrown for an invalid Timestamp
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void testInvalid_year2() throws Exception {
+        String testTS = "aaaa-11-01-01 10:50";
+        Timestamp.valueOf(testTS);
+    }
+
+    /**
+     * Validate an IllegalArgumentException is thrown for an invalid Timestamp
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void testInvalid_year3() throws Exception {
+        String testTS = "aaaa-11-01 10:50";
+        Timestamp.valueOf(testTS);
+    }
+
+    /**
+     * Validate that two Timestamp are equal when the leading 0 in seconds is
+     * omitted
+     */
+    @Test
+    public void test1() throws Exception {
+        String testTS = "2009-01-01 10:50:00";
+        String ExpectedTS = "2009-01-01 10:50:0";
+        Timestamp ts = Timestamp.valueOf(testTS);
+        Timestamp ts2 = Timestamp.valueOf(ExpectedTS);
+        assertEquals(ts, ts2, "Error ts1 != ts2");
+    }
+
+    /**
+     * Validate two Timestamps created from the same string are equal
+     */
+    @Test
+    public void test2() throws Exception {
+        String testTS = "2009-01-01 10:50:0";
+        Timestamp ts = Timestamp.valueOf(testTS);
+        Timestamp ts2 = Timestamp.valueOf(testTS);
+        assertEquals(ts, ts2, "Error ts1 != ts2");
+    }
+
+    /**
+     * Validate that two Timestamp values one with leading 0s for month and day
+     * equals same string without the leading 0s.
+     */
+    @Test
+    public void test3() throws Exception {
+        String testTS = "2009-1-1 10:50:0";
+        String ExpectedTS = "2009-01-01 10:50:0";
+        Timestamp ts = Timestamp.valueOf(testTS);
+        Timestamp ts2 = Timestamp.valueOf(ExpectedTS);
+        assertEquals(ts, ts2, "Error ts1 != ts2");
+    }
+
+    /**
+     * Validate that two Timestamp values one with leading 0s for day omitted
+     * are equal
+     */
+    @Test
+    public void test4() throws Exception {
+        String testTS = "2009-01-1 10:50:0";
+        String ExpectedTS = "2009-01-01 10:50:0";
+        Timestamp ts = Timestamp.valueOf(testTS);
+        Timestamp ts2 = Timestamp.valueOf(ExpectedTS);
+        assertEquals(ts, ts2, "Error ts1 != ts2");
+    }
+
+    /**
+     * Validate that two Timestamp values one with leading 0s for month omitted
+     * and both with leading 0s for seconds omitted are equal
+     */
+    @Test
+    public void test5() throws Exception {
+        String testTS = "2009-1-01 10:50:0";
+        String ExpectedTS = "2009-01-01 10:50:0";
+        Timestamp ts = Timestamp.valueOf(testTS);
+        Timestamp ts2 = Timestamp.valueOf(ExpectedTS);
+        assertEquals(ts, ts2, "Error ts1 != ts2");
+    }
+
+    /**
+     * Validate that two Timestamp values one with leading 0s for month omitted
+     */
+    @Test
+    public void test6() throws Exception {
+        String testTS = "2005-1-01 10:20:50.00";
+        String ExpectedTS = "2005-01-01 10:20:50.00";
+        Timestamp ts = Timestamp.valueOf(testTS);
+        Timestamp ts2 = Timestamp.valueOf(ExpectedTS);
+        assertEquals(ts, ts2, "Error ts1 != ts2");
+    }
+
+    /**
+     * Validate that two Timestamp values one created using valueOf and another
+     * via a constructor are equal
+     */
+    @Test
+    public void test7() {
+
+        Timestamp ts1 = Timestamp.valueOf("1996-12-13 14:15:25.001");
+        Timestamp ts2 = new Timestamp(96, 11, 13, 14, 15, 25, 1000000);
+        assertTrue(ts1.equals(ts2), "Error ts1 != ts2");
+    }
+
+    /**
+     * Validate that two Timestamp values one created using valueOf and another
+     * via a constructor are equal
+     */
+    @Test
+    public void test8() {
+        Timestamp ts1 = Timestamp.valueOf("1996-12-13 14:15:25.001");
+        Timestamp ts2 = new Timestamp(ts1.getTime());
+        assertTrue(ts1.equals(ts2), "Error ts1 != ts2");
+    }
+
+    /**
+     * Validate that two Timestamp values one created using valueOf and another
+     * via a constructor are equal
+     */
+    @Test
+    public void test9() {
+
+        Timestamp ts1 = Timestamp.valueOf("1996-12-13 14:15:25.0");
+        Timestamp ts2 = new Timestamp(96, 11, 13, 14, 15, 25, 0);
+        assertTrue(ts1.equals(ts2), "Error ts1 != ts2");
+    }
+
+    /**
+     * Validate that a Timestamp cannot be equal to null
+     */
+    @Test
+    public void test10() {
+
+        Timestamp ts1 = Timestamp.valueOf("1961-08-30 14:15:25.745634");
+        assertFalse(ts1.equals(null), "Error ts1 == null");
+    }
+
+    /**
+     * Validate that a Timestamp is equal to another timestamp created with the
+     * using the same value but not equal to a Timestamp which is one day later
+     */
+    @Test
+    public void test11() {
+
+        Timestamp ts1 = Timestamp.valueOf("1996-12-10 12:26:19.12");
+        Timestamp ts2 = Timestamp.valueOf("1996-12-10 12:26:19.12");
+        Timestamp ts3 = Timestamp.valueOf("1996-12-11 12:24:19.12");
+        assertTrue(ts1.equals(ts2) && ts2.equals(ts1), "Error ts1 != ts2");
+        assertFalse(ts1.equals(ts3) && ts3.equals(ts1), "Error ts1 == ts3");
+
+    }
+
+    /**
+     * Validate that a Timestamp is equal to itself
+     */
+    @Test
+    public void test12() {
+        Timestamp ts1 = Timestamp.valueOf("1996-10-15 12:26:19.12");
+        assertTrue(ts1.equals(ts1), "Error ts1 != ts1");
+    }
+
+    /**
+     * Validate that two Timestamps are equal when one is created from the
+     * toString() of the other
+     */
+    @Test
+    public void test13() {
+        Timestamp ts1 = Timestamp.valueOf("1996-12-10 12:26:19.12");
+        Timestamp ts2 = Timestamp.valueOf(ts1.toString());
+        assertTrue(ts1.equals(ts2) && ts2.equals(ts1), "Error ts1 != ts2");
+    }
+
+    // Before Tests
+    /**
+     * Validate that Timestamp ts1 is before Timestamp ts2
+     */
+    @Test
+    public void test14() {
+        Timestamp ts1 = Timestamp.valueOf("1996-12-13 14:15:25.745634");
+        Timestamp ts2 = Timestamp.valueOf("1996-12-13 15:15:25.645634");
+        assertTrue(ts1.before(ts2), "Error ts1 not before ts2");
+    }
+
+    /**
+     * Validate that Timestamp ts1 is before Timestamp ts2
+     */
+    @Test
+    public void test15() {
+        Timestamp ts1 = Timestamp.valueOf("1961-08-30 14:15:25");
+        Timestamp ts2 = Timestamp.valueOf("1999-12-13 15:15:25");
+        assertTrue(ts1.before(ts2), "Error ts1 not before ts2");
+    }
+
+    /**
+     * Validate that Timestamp ts1 is before Timestamp ts2
+     */
+    @Test
+    public void test16() {
+
+        Timestamp ts1 = Timestamp.valueOf("1999-12-13 14:15:25.745634");
+        Timestamp ts2 = Timestamp.valueOf("1999-11-13 15:15:25.645634");
+        assertFalse(ts1.before(ts2), "Error ts1 before ts2");
+    }
+
+    /*
+     * Validate that a NullPointerException is thrown if a null is passed to
+     * the before method
+     */
+    @Test(expectedExceptions = NullPointerException.class)
+    public void test17() throws Exception {
+        Timestamp ts1 = Timestamp.valueOf("1996-12-13 14:15:25.745634");
+        ts1.before(null);
+    }
+
+    /*
+     * Validate a Timestamp cannot be before itself
+     */
+    @Test
+    public void test18() {
+        Timestamp ts1 = Timestamp.valueOf("1999-11-10 12:26:19.3456543");
+        assertFalse(ts1.before(ts1), "Error ts1 before ts1!");
+    }
+
+    /**
+     * Create 3 Timestamps and make sure the 1st is before the other two
+     * Timestamps which are each greater than the one before it
+     */
+    @Test
+    public void test19() {
+
+        Timestamp ts1 = new Timestamp(1234560000);
+        Timestamp ts2 = new Timestamp(1234567000);
+        Timestamp ts3 = new Timestamp(1234569000);
+        assertTrue(ts1.before(ts2) && ts2.before(ts3) && ts1.before(ts3));
+    }
+
+    /**
+     * Validate that Timestamp ts1 is not after Timestamp ts2
+     */
+    @Test
+    public void test20() {
+        Timestamp ts1 = Timestamp.valueOf("1999-12-13 14:15:25.745634");
+        Timestamp ts2 = Timestamp.valueOf("1999-12-13 15:15:25.645634");
+        assertFalse(ts1.after(ts2), "Error ts1 is after ts2");
+
+    }
+
+    /**
+     * Validate that Timestamp ts1 is after Timestamp ts2
+     */
+    @Test
+    public void test21() {
+        Timestamp ts1 = Timestamp.valueOf("1996-12-13 14:15:25.745634");
+        Timestamp ts2 = Timestamp.valueOf("1996-11-13 15:15:25.645634");
+        assertTrue(ts1.after(ts2), "Error ts1 not after ts2");
+    }
+
+    /**
+     * Validate that a NullPointerException is thrown if a null is passed to the
+     * after method
+     */
+    @Test(expectedExceptions = NullPointerException.class)
+    public void test22() throws Exception {
+        Timestamp ts1 = Timestamp.valueOf("1966-08-30 08:08:08");
+        ts1.after(null);
+    }
+
+    /**
+     * Validate that a Timestamp cannot be after itself
+     */
+    @Test
+    public void test23() {
+        Timestamp ts1 = Timestamp.valueOf("1999-11-10 12:26:19.3456543");
+        assertFalse(ts1.after(ts1), "Error ts1 is after itself");
+    }
+    /**
+     * Validate that a Timestamp after() works correctly with Timestamp
+     * created using milliseconds
+     */
+    @Test
+    public void test24() {
+
+        Timestamp ts1 = new Timestamp(1234568000);
+        Timestamp ts2 = new Timestamp(1234565000);
+        Timestamp ts3 = new Timestamp(1234562000);
+        assertTrue(ts1.after(ts2) && ts2.after(ts3) && ts1.after(ts3));
+    }
+
+    /**
+     * Validate compareTo returns 0 for Timestamps that are the same
+     */
+    @Test
+    public void test25() {
+        Timestamp ts1 = Timestamp.valueOf("1966-08-30 08:08:08");
+        Timestamp ts2 = new Timestamp(ts1.getTime());
+        assertTrue(ts1.compareTo(ts2) == 0, "Error ts1 != ts2");
+    }
+
+    /**
+     * Validate compareTo returns -1 for when the 1st Timestamp is earlier than
+     * the 2nd Timestamp
+     */
+    @Test
+    public void test26() {
+        Timestamp ts1 = Timestamp.valueOf("1966-08-30 08:08:08");
+        Timestamp ts2 = new Timestamp(ts1.getTime() + 1000);
+        assertTrue(ts1.compareTo(ts2) == -1, "Error ts1 not before ts2");
+        assertTrue(ts2.compareTo(ts1) == 1, "Error ts1 is not before ts2");
+    }
+
+    /**
+     * Validate compareTo returns 1 for when the 1st Timestamp is later than the
+     * 2nd Timestamp
+     */
+    @Test
+    public void test27() {
+        Timestamp ts1 = Timestamp.valueOf("1966-08-30 08:08:08");
+        Timestamp ts2 = new Timestamp(ts1.getTime() - 1000);
+        assertTrue(ts1.compareTo(ts2) == 1, "Error ts1 not after ts2");
+        assertTrue(ts2.compareTo(ts1) == -1, "Error ts1 not after ts2");
+    }
+
+    /**
+     * Validate compareTo returns 0 for Timestamps that are the same
+     */
+    @Test
+    public void test28() {
+        Timestamp ts1 = Timestamp.valueOf("1966-08-30 08:08:08");
+        java.util.Date ts2 = new java.util.Date(ts1.getTime());
+        assertTrue(ts1.compareTo(ts2) == 0, "Error ts1 != ts2");
+    }
+
+    /**
+     * Validate compareTo returns 0 for Timestamps that are the same
+     */
+    @Test
+    public void test29() {
+        Timestamp ts1 = Timestamp.valueOf("1966-08-30 08:08:08");
+        java.util.Date d = new java.util.Date(ts1.getTime());
+        assertFalse(ts1.equals(d), "Error ts1 == d");
+    }
+
+    /**
+     * Validate compareTo returns 0 for Timestamps that are the same
+     */
+    @Test
+    public void test30() {
+        Timestamp ts1 = Timestamp.valueOf("1966-08-30 08:08:08");
+        java.util.Date d = new Timestamp(ts1.getTime());
+        assertTrue(ts1.equals(d), "Error ts1 != d");
+    }
+
+    /**
+     * Validate equals returns false when a Date object is passed to equals
+     */
+    @Test
+    public void test31() {
+        Timestamp ts1 = Timestamp.valueOf("1966-08-30 08:08:08");
+        Date d = new Date(ts1.getTime());
+        assertFalse(ts1.equals(d), "Error ts1 != d");
+    }
+
+    /**
+     * Validate equals returns false when a Date object is passed to equals
+     */
+    @Test
+    public void test32() {
+        Timestamp ts1 = Timestamp.valueOf("1966-08-30 08:08:08");
+        java.util.Date d = new Date(ts1.getTime());
+        assertFalse(ts1.equals(d), "Error ts1 != d");
+    }
+
+    /**
+     * Validate equals returns false when a Time object is passed to equals
+     */
+    @Test
+    public void test33() {
+        Timestamp ts1 = Timestamp.valueOf("1966-08-30 08:08:08");
+        Time t1 = new Time(ts1.getTime());
+        assertFalse(ts1.equals(t1), "Error ts1 == t1");
+    }
+
+    /**
+     * Validate equals returns false when a String object is passed to equals
+     */
+    @Test
+    public void test34() {
+        Timestamp ts1 = Timestamp.valueOf("1966-08-30 08:08:08");
+        assertFalse(ts1.equals("1966-08-30 08:08:08"), "Error ts1 == a String");
+    }
+
+    /**
+     * Validate getTime() returns the same value from 2 timeStamps created by
+     */
+    @Test
+    public void test35() {
+        Timestamp ts1 = Timestamp.valueOf("1966-08-30 08:08:08");
+        Timestamp ts2 = Timestamp.valueOf("1966-08-30 08:08:08");
+        assertTrue(ts2.getTime() == ts1.getTime(),
+                "ts1.getTime() != ts2.getTime()");
+        assertTrue(ts1.equals(ts2), "Error ts1 != ts2");
+    }
+
+    /**
+     * Validate getTime() returns the same value from 2 timeStamps when
+     * setTime() is used to specify the same value for both Timestamps
+     */
+    @Test
+    public void test36() {
+        Timestamp ts1 = Timestamp.valueOf("1966-08-30 08:08:08");
+        Timestamp ts2 = Timestamp.valueOf("1961-08-30 00:00:00");
+        ts2.setTime(ts1.getTime());
+        assertTrue(ts2.getTime() == ts1.getTime(),
+                "ts1.getTime() != ts2.getTime()");
+        assertTrue(ts1.equals(ts2), "Error ts1 != ts2");
+    }
+
+    /**
+     * Validate an IllegalArgumentException is thrown for an invalid nanos value
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void test38() throws Exception {
+        Timestamp ts1 = Timestamp.valueOf("1961-08-30 00:00:00");
+        ts1.setNanos(-1);
+
+    }
+
+    /**
+     * Validate an IllegalArgumentException is thrown for an invalid nanos value
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void test39() throws Exception {
+        int nanos = 999999999;
+        Timestamp ts1 = Timestamp.valueOf("1961-08-30 00:00:00");
+        ts1.setNanos(nanos + 1);
+
+    }
+
+    /**
+     * Validate you can set nanos to 999999999
+     */
+    @Test
+    public void test40() throws Exception {
+        int nanos = 999999999;
+        Timestamp ts1 = Timestamp.valueOf("1961-08-30 00:00:00");
+        ts1.setNanos(nanos);
+        assertTrue(ts1.getNanos() == nanos, "Error Invalid Nanos value");
+
+    }
+
+    /**
+     * Validate you can set nanos to 0
+     */
+    @Test
+    public void test41() throws Exception {
+        int nanos = 0;
+        Timestamp ts1 = Timestamp.valueOf("1961-08-30 00:00:00");
+        ts1.setNanos(nanos);
+        assertTrue(ts1.getNanos() == nanos, "Error Invalid Nanos value");
+
+    }
+
+    /**
+     * Validate that a Timestamp made from a LocalDateTime are equal
+     */
+    @Test
+    public void test42() throws Exception {
+        Timestamp ts1 = Timestamp.valueOf("1961-08-30 00:00:00");
+        LocalDateTime ldt = ts1.toLocalDateTime();
+        Timestamp ts2 = Timestamp.valueOf(ldt);
+        assertTrue(ts1.equals(ts2), "Error ts1 != ts2");
+    }
+
+    /**
+     * Validate that a Timestamp LocalDateTime value, made from a LocalDateTime
+     * are equal
+     */
+    @Test
+    public void test43() throws Exception {
+        LocalDateTime ldt = LocalDateTime.now();
+        Timestamp ts2 = Timestamp.valueOf(ldt);
+        assertTrue(ldt.equals(ts2.toLocalDateTime()),
+                "Error LocalDateTime values are not equal");
+    }
+
+    /**
+     * Validate an NPE occurs when a null LocalDateTime is passed to valueOF
+     */
+    @Test(expectedExceptions = NullPointerException.class)
+    public void test44() throws Exception {
+        LocalDateTime ldt = null;
+        Timestamp.valueOf(ldt);
+    }
+
+    /**
+     * Validate that a Timestamp made from a Instant are equal
+     */
+    @Test
+    public void test45() throws Exception {
+        Timestamp ts1 = Timestamp.valueOf("1961-08-30 00:00:00");
+        Instant instant = ts1.toInstant();
+        Timestamp ts2 = Timestamp.from(instant);
+        assertTrue(ts1.equals(ts2), "Error ts1 != ts2");
+    }
+
+    /**
+     * Validate that a Timestamp made from a Instant are equal
+     */
+    @Test
+    public void test46() throws Exception {
+        Instant instant = Instant.now();
+        Timestamp ts2 = Timestamp.from(instant);
+        assertTrue(instant.equals(ts2.toInstant()),
+                "Error Instant values do not match");
+    }
+
+    /**
+     * Validate an NPE occurs when a null instant is passed to from
+     */
+    @Test(expectedExceptions = NullPointerException.class)
+    public void test47() throws Exception {
+        Instant instant = null;
+        Timestamp.from(instant);
+    }
+
+    // Added SQE tests
+    /**
+     * Create a Timestamp and a 2nd Timestamp that is 1 month earlier and
+     * validate that it is not before or after the original Timestamp
+     */
+    @Test
+    public void test48() {
+        Calendar cal = Calendar.getInstance();
+        Timestamp ts1 = new Timestamp(System.currentTimeMillis());
+        cal.setTimeInMillis(ts1.getTime());
+        cal.add(Calendar.MONTH, -1);
+        cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH));
+        Timestamp ts2 = new Timestamp(cal.getTimeInMillis());
+        assertFalse(ts1.before(ts2) || ts2.after(ts1));
+    }
+
+    /**
+     * Create two Timestamps and validate that compareTo returns 1 to indicate
+     * the 1st Timestamp is greater than the 2nd Timestamp
+     */
+    @Test
+    public void test49() {
+        Calendar cal = Calendar.getInstance();
+        Timestamp ts1 = new Timestamp(System.currentTimeMillis());
+        cal.setTimeInMillis(ts1.getTime());
+        cal.add(Calendar.MONTH, -1);
+        cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH));
+        Timestamp ts2 = new Timestamp(cal.getTimeInMillis());
+        assertTrue(ts1.compareTo(ts2) == 1);
+    }
+
+    /**
+     * Create two Timestamps and validate that the 1st Timestamp is not equal to
+     * the 2nd Timestamp but equal to itself
+     */
+    @Test
+    public void test50() {
+        Calendar cal = Calendar.getInstance();
+        Timestamp ts1 = new Timestamp(System.currentTimeMillis());
+        cal.setTimeInMillis(ts1.getTime());
+        cal.add(Calendar.MONTH, -1);
+        cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH));
+        Timestamp ts2 = new Timestamp(cal.getTimeInMillis());
+        assertTrue(!ts1.equals(ts2) && ts1.equals(ts1));
+    }
+
+}
diff --git a/jdk/test/java/sql/util/BaseTest.java b/jdk/test/java/sql/util/BaseTest.java
new file mode 100644
index 0000000..2668c48
--- /dev/null
+++ b/jdk/test/java/sql/util/BaseTest.java
@@ -0,0 +1,89 @@
+/*
+ * 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.
+ *
+ * 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 util;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.sql.SQLException;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.BeforeMethod;
+
+public class BaseTest {
+
+    protected final String reason = "reason";
+    protected final String state = "SQLState";
+    protected final String cause = "java.lang.Throwable: cause";
+    protected final Throwable t = new Throwable("cause");
+    protected final Throwable t1 = new Throwable("cause 1");
+    protected final Throwable t2 = new Throwable("cause 2");
+    protected final int errorCode = 21;
+    protected final String[] msgs = {"Exception 1", "cause 1", "Exception 2",
+        "Exception 3", "cause 2"};
+
+    @BeforeClass
+    public static void setUpClass() throws Exception {
+    }
+
+    @AfterClass
+    public static void tearDownClass() throws Exception {
+    }
+
+    @BeforeMethod
+    public void setUpMethod() throws Exception {
+    }
+
+    @AfterMethod
+    public void tearDownMethod() throws Exception {
+    }
+
+    /**
+     * Take some form of SQLException, serialize and deserialize it
+     *
+     * @param <T> SQLException
+     * @param ex SQLException
+     * @return deserialized SQLException
+     * @throws IOException
+     * @throws ClassNotFoundException
+     */
+    @SuppressWarnings("unchecked")
+    protected <T extends SQLException> T
+            createSerializedException(T ex)
+            throws IOException, ClassNotFoundException {
+        T ex1;
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        try (ObjectOutputStream oos = new ObjectOutputStream(baos) ) {
+            oos.writeObject(ex);
+        }
+        try (ObjectInputStream ois =
+                new ObjectInputStream(new ByteArrayInputStream(baos.toByteArray()))) {
+            ex1 = (T) ois.readObject();
+        }
+        return ex1;
+    }
+
+}
diff --git a/jdk/test/java/sql/util/DriverActionImpl.java b/jdk/test/java/sql/util/DriverActionImpl.java
new file mode 100644
index 0000000..4a286ad
--- /dev/null
+++ b/jdk/test/java/sql/util/DriverActionImpl.java
@@ -0,0 +1,43 @@
+/*
+ * 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.
+ *
+ * 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 util;
+
+import java.sql.DriverAction;
+
+/**
+ * Simple implementation of DriverAction which calls back into the Driver when
+ * release is called.
+ */
+class DriverActionImpl implements DriverAction {
+
+    public DriverActionImpl(StubDriverDA d) {
+        driver = d;
+    }
+
+    private final StubDriverDA driver;
+
+    @Override
+    public void deregister() {
+        driver.release();
+    }
+}
diff --git a/jdk/test/java/sql/util/SerializedBatchUpdateException.java b/jdk/test/java/sql/util/SerializedBatchUpdateException.java
new file mode 100644
index 0000000..00efc52
--- /dev/null
+++ b/jdk/test/java/sql/util/SerializedBatchUpdateException.java
@@ -0,0 +1,65 @@
+/*
+ * 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.
+ *
+ * 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 util;
+
+public class SerializedBatchUpdateException {
+    /**
+     * Serialized BatchUpdateException from JDBC 4.0 with the following values
+     *  reason = "This was the error msg"
+     *  SQLState   = "user defined sqlState"
+     *  vendor Code = 99999
+     *  Update Counts = {1, 2, 21}
+     *  cause = = "java.lang.Throwable: throw 1"
+     */
+    public static byte[] DATA = {
+        (byte) 0xac, (byte) 0xed, (byte) 0x0, (byte) 0x5, (byte) 0x73, (byte) 0x72, (byte) 0x0, (byte) 0x1d, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2e, (byte) 0x73, (byte) 0x71, (byte) 0x6c, (byte) 0x2e, (byte) 0x42, (byte) 0x61, (byte) 0x74, (byte) 0x63, (byte) 0x68, (byte) 0x55, (byte) 0x70, (byte) 0x64, (byte) 0x61, (byte) 0x74, (byte) 0x65, (byte) 0x45, (byte) 0x78, (byte) 0x63, (byte) 0x65,
+        (byte) 0x70, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0x52, (byte) 0xf4, (byte) 0x73, (byte) 0xc0, (byte) 0xc1, (byte) 0x8b, (byte) 0xe, (byte) 0x5d, (byte) 0x3, (byte) 0x0, (byte) 0x2, (byte) 0x5b, (byte) 0x0, (byte) 0x10, (byte) 0x6c, (byte) 0x6f, (byte) 0x6e, (byte) 0x67, (byte) 0x55, (byte) 0x70, (byte) 0x64, (byte) 0x61, (byte) 0x74, (byte) 0x65, (byte) 0x43, (byte) 0x6f, (byte) 0x75,
+        (byte) 0x6e, (byte) 0x74, (byte) 0x73, (byte) 0x74, (byte) 0x0, (byte) 0x2, (byte) 0x5b, (byte) 0x4a, (byte) 0x5b, (byte) 0x0, (byte) 0xc, (byte) 0x75, (byte) 0x70, (byte) 0x64, (byte) 0x61, (byte) 0x74, (byte) 0x65, (byte) 0x43, (byte) 0x6f, (byte) 0x75, (byte) 0x6e, (byte) 0x74, (byte) 0x73, (byte) 0x74, (byte) 0x0, (byte) 0x2, (byte) 0x5b, (byte) 0x49, (byte) 0x78, (byte) 0x72, (byte) 0x0, (byte) 0x15,
+        (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2e, (byte) 0x73, (byte) 0x71, (byte) 0x6c, (byte) 0x2e, (byte) 0x53, (byte) 0x51, (byte) 0x4c, (byte) 0x45, (byte) 0x78, (byte) 0x63, (byte) 0x65, (byte) 0x70, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0x1d, (byte) 0xa1, (byte) 0xe9, (byte) 0x30, (byte) 0xdb, (byte) 0x3e, (byte) 0x75, (byte) 0xdc, (byte) 0x2, (byte) 0x0, (byte) 0x3,
+        (byte) 0x49, (byte) 0x0, (byte) 0xa, (byte) 0x76, (byte) 0x65, (byte) 0x6e, (byte) 0x64, (byte) 0x6f, (byte) 0x72, (byte) 0x43, (byte) 0x6f, (byte) 0x64, (byte) 0x65, (byte) 0x4c, (byte) 0x0, (byte) 0x8, (byte) 0x53, (byte) 0x51, (byte) 0x4c, (byte) 0x53, (byte) 0x74, (byte) 0x61, (byte) 0x74, (byte) 0x65, (byte) 0x74, (byte) 0x0, (byte) 0x12, (byte) 0x4c, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61,
+        (byte) 0x2f, (byte) 0x6c, (byte) 0x61, (byte) 0x6e, (byte) 0x67, (byte) 0x2f, (byte) 0x53, (byte) 0x74, (byte) 0x72, (byte) 0x69, (byte) 0x6e, (byte) 0x67, (byte) 0x3b, (byte) 0x4c, (byte) 0x0, (byte) 0x4, (byte) 0x6e, (byte) 0x65, (byte) 0x78, (byte) 0x74, (byte) 0x74, (byte) 0x0, (byte) 0x17, (byte) 0x4c, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2f, (byte) 0x73, (byte) 0x71, (byte) 0x6c,
+        (byte) 0x2f, (byte) 0x53, (byte) 0x51, (byte) 0x4c, (byte) 0x45, (byte) 0x78, (byte) 0x63, (byte) 0x65, (byte) 0x70, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0x3b, (byte) 0x78, (byte) 0x72, (byte) 0x0, (byte) 0x13, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2e, (byte) 0x6c, (byte) 0x61, (byte) 0x6e, (byte) 0x67, (byte) 0x2e, (byte) 0x45, (byte) 0x78, (byte) 0x63, (byte) 0x65,
+        (byte) 0x70, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0xd0, (byte) 0xfd, (byte) 0x1f, (byte) 0x3e, (byte) 0x1a, (byte) 0x3b, (byte) 0x1c, (byte) 0xc4, (byte) 0x2, (byte) 0x0, (byte) 0x0, (byte) 0x78, (byte) 0x72, (byte) 0x0, (byte) 0x13, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2e, (byte) 0x6c, (byte) 0x61, (byte) 0x6e, (byte) 0x67, (byte) 0x2e, (byte) 0x54, (byte) 0x68,
+        (byte) 0x72, (byte) 0x6f, (byte) 0x77, (byte) 0x61, (byte) 0x62, (byte) 0x6c, (byte) 0x65, (byte) 0xd5, (byte) 0xc6, (byte) 0x35, (byte) 0x27, (byte) 0x39, (byte) 0x77, (byte) 0xb8, (byte) 0xcb, (byte) 0x3, (byte) 0x0, (byte) 0x4, (byte) 0x4c, (byte) 0x0, (byte) 0x5, (byte) 0x63, (byte) 0x61, (byte) 0x75, (byte) 0x73, (byte) 0x65, (byte) 0x74, (byte) 0x0, (byte) 0x15, (byte) 0x4c, (byte) 0x6a, (byte) 0x61,
+        (byte) 0x76, (byte) 0x61, (byte) 0x2f, (byte) 0x6c, (byte) 0x61, (byte) 0x6e, (byte) 0x67, (byte) 0x2f, (byte) 0x54, (byte) 0x68, (byte) 0x72, (byte) 0x6f, (byte) 0x77, (byte) 0x61, (byte) 0x62, (byte) 0x6c, (byte) 0x65, (byte) 0x3b, (byte) 0x4c, (byte) 0x0, (byte) 0xd, (byte) 0x64, (byte) 0x65, (byte) 0x74, (byte) 0x61, (byte) 0x69, (byte) 0x6c, (byte) 0x4d, (byte) 0x65, (byte) 0x73, (byte) 0x73, (byte) 0x61,
+        (byte) 0x67, (byte) 0x65, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x4, (byte) 0x5b, (byte) 0x0, (byte) 0xa, (byte) 0x73, (byte) 0x74, (byte) 0x61, (byte) 0x63, (byte) 0x6b, (byte) 0x54, (byte) 0x72, (byte) 0x61, (byte) 0x63, (byte) 0x65, (byte) 0x74, (byte) 0x0, (byte) 0x1e, (byte) 0x5b, (byte) 0x4c, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2f, (byte) 0x6c, (byte) 0x61,
+        (byte) 0x6e, (byte) 0x67, (byte) 0x2f, (byte) 0x53, (byte) 0x74, (byte) 0x61, (byte) 0x63, (byte) 0x6b, (byte) 0x54, (byte) 0x72, (byte) 0x61, (byte) 0x63, (byte) 0x65, (byte) 0x45, (byte) 0x6c, (byte) 0x65, (byte) 0x6d, (byte) 0x65, (byte) 0x6e, (byte) 0x74, (byte) 0x3b, (byte) 0x4c, (byte) 0x0, (byte) 0x14, (byte) 0x73, (byte) 0x75, (byte) 0x70, (byte) 0x70, (byte) 0x72, (byte) 0x65, (byte) 0x73, (byte) 0x73,
+        (byte) 0x65, (byte) 0x64, (byte) 0x45, (byte) 0x78, (byte) 0x63, (byte) 0x65, (byte) 0x70, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0x73, (byte) 0x74, (byte) 0x0, (byte) 0x10, (byte) 0x4c, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2f, (byte) 0x75, (byte) 0x74, (byte) 0x69, (byte) 0x6c, (byte) 0x2f, (byte) 0x4c, (byte) 0x69, (byte) 0x73, (byte) 0x74, (byte) 0x3b, (byte) 0x78,
+        (byte) 0x70, (byte) 0x73, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x7, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0xc, (byte) 0x74, (byte) 0x0, (byte) 0x7, (byte) 0x74, (byte) 0x68, (byte) 0x72, (byte) 0x6f, (byte) 0x77, (byte) 0x20, (byte) 0x31, (byte) 0x75, (byte) 0x72, (byte) 0x0, (byte) 0x1e, (byte) 0x5b, (byte) 0x4c, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61,
+        (byte) 0x2e, (byte) 0x6c, (byte) 0x61, (byte) 0x6e, (byte) 0x67, (byte) 0x2e, (byte) 0x53, (byte) 0x74, (byte) 0x61, (byte) 0x63, (byte) 0x6b, (byte) 0x54, (byte) 0x72, (byte) 0x61, (byte) 0x63, (byte) 0x65, (byte) 0x45, (byte) 0x6c, (byte) 0x65, (byte) 0x6d, (byte) 0x65, (byte) 0x6e, (byte) 0x74, (byte) 0x3b, (byte) 0x2, (byte) 0x46, (byte) 0x2a, (byte) 0x3c, (byte) 0x3c, (byte) 0xfd, (byte) 0x22, (byte) 0x39,
+        (byte) 0x2, (byte) 0x0, (byte) 0x0, (byte) 0x78, (byte) 0x70, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x2, (byte) 0x73, (byte) 0x72, (byte) 0x0, (byte) 0x1b, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2e, (byte) 0x6c, (byte) 0x61, (byte) 0x6e, (byte) 0x67, (byte) 0x2e, (byte) 0x53, (byte) 0x74, (byte) 0x61, (byte) 0x63, (byte) 0x6b, (byte) 0x54, (byte) 0x72, (byte) 0x61, (byte) 0x63,
+        (byte) 0x65, (byte) 0x45, (byte) 0x6c, (byte) 0x65, (byte) 0x6d, (byte) 0x65, (byte) 0x6e, (byte) 0x74, (byte) 0x61, (byte) 0x9, (byte) 0xc5, (byte) 0x9a, (byte) 0x26, (byte) 0x36, (byte) 0xdd, (byte) 0x85, (byte) 0x2, (byte) 0x0, (byte) 0x4, (byte) 0x49, (byte) 0x0, (byte) 0xa, (byte) 0x6c, (byte) 0x69, (byte) 0x6e, (byte) 0x65, (byte) 0x4e, (byte) 0x75, (byte) 0x6d, (byte) 0x62, (byte) 0x65, (byte) 0x72,
+        (byte) 0x4c, (byte) 0x0, (byte) 0xe, (byte) 0x64, (byte) 0x65, (byte) 0x63, (byte) 0x6c, (byte) 0x61, (byte) 0x72, (byte) 0x69, (byte) 0x6e, (byte) 0x67, (byte) 0x43, (byte) 0x6c, (byte) 0x61, (byte) 0x73, (byte) 0x73, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x4, (byte) 0x4c, (byte) 0x0, (byte) 0x8, (byte) 0x66, (byte) 0x69, (byte) 0x6c, (byte) 0x65, (byte) 0x4e, (byte) 0x61, (byte) 0x6d,
+        (byte) 0x65, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x4, (byte) 0x4c, (byte) 0x0, (byte) 0xa, (byte) 0x6d, (byte) 0x65, (byte) 0x74, (byte) 0x68, (byte) 0x6f, (byte) 0x64, (byte) 0x4e, (byte) 0x61, (byte) 0x6d, (byte) 0x65, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x4, (byte) 0x78, (byte) 0x70, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x23, (byte) 0x74, (byte) 0x0,
+        (byte) 0x17, (byte) 0x43, (byte) 0x72, (byte) 0x65, (byte) 0x61, (byte) 0x74, (byte) 0x65, (byte) 0x42, (byte) 0x61, (byte) 0x74, (byte) 0x63, (byte) 0x68, (byte) 0x45, (byte) 0x78, (byte) 0x63, (byte) 0x65, (byte) 0x70, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0x53, (byte) 0x65, (byte) 0x72, (byte) 0x74, (byte) 0x0, (byte) 0x1c, (byte) 0x43, (byte) 0x72, (byte) 0x65, (byte) 0x61, (byte) 0x74,
+        (byte) 0x65, (byte) 0x42, (byte) 0x61, (byte) 0x74, (byte) 0x63, (byte) 0x68, (byte) 0x45, (byte) 0x78, (byte) 0x63, (byte) 0x65, (byte) 0x70, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0x53, (byte) 0x65, (byte) 0x72, (byte) 0x2e, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x74, (byte) 0x0, (byte) 0x9, (byte) 0x77, (byte) 0x72, (byte) 0x69, (byte) 0x74, (byte) 0x65, (byte) 0x54,
+        (byte) 0x65, (byte) 0x73, (byte) 0x74, (byte) 0x73, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x10, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x1a, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x12, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x13, (byte) 0x74, (byte) 0x0, (byte) 0x4, (byte) 0x6d, (byte) 0x61, (byte) 0x69, (byte) 0x6e, (byte) 0x70, (byte) 0x78,
+        (byte) 0x74, (byte) 0x0, (byte) 0x16, (byte) 0x54, (byte) 0x68, (byte) 0x69, (byte) 0x73, (byte) 0x20, (byte) 0x77, (byte) 0x61, (byte) 0x73, (byte) 0x20, (byte) 0x74, (byte) 0x68, (byte) 0x65, (byte) 0x20, (byte) 0x65, (byte) 0x72, (byte) 0x72, (byte) 0x6f, (byte) 0x72, (byte) 0x20, (byte) 0x6d, (byte) 0x73, (byte) 0x67, (byte) 0x75, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0xe, (byte) 0x0,
+        (byte) 0x0, (byte) 0x0, (byte) 0x2, (byte) 0x73, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x10, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x28, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x12, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x13, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x14, (byte) 0x73, (byte) 0x71, (byte) 0x0, (byte) 0x7e,
+        (byte) 0x0, (byte) 0x10, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x1a, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x12, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x13, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x16, (byte) 0x70, (byte) 0x78, (byte) 0x0, (byte) 0x1, (byte) 0x86, (byte) 0x9f, (byte) 0x74, (byte) 0x0, (byte) 0x15, (byte) 0x75, (byte) 0x73,
+        (byte) 0x65, (byte) 0x72, (byte) 0x20, (byte) 0x64, (byte) 0x65, (byte) 0x66, (byte) 0x69, (byte) 0x6e, (byte) 0x65, (byte) 0x64, (byte) 0x20, (byte) 0x73, (byte) 0x71, (byte) 0x6c, (byte) 0x53, (byte) 0x74, (byte) 0x61, (byte) 0x74, (byte) 0x65, (byte) 0x70, (byte) 0x75, (byte) 0x72, (byte) 0x0, (byte) 0x2, (byte) 0x5b, (byte) 0x4a, (byte) 0x78, (byte) 0x20, (byte) 0x4, (byte) 0xb5, (byte) 0x12, (byte) 0xb1,
+        (byte) 0x75, (byte) 0x93, (byte) 0x2, (byte) 0x0, (byte) 0x0, (byte) 0x78, (byte) 0x70, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x3, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x1, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x2, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0,
+        (byte) 0x0, (byte) 0x0, (byte) 0x15, (byte) 0x75, (byte) 0x72, (byte) 0x0, (byte) 0x2, (byte) 0x5b, (byte) 0x49, (byte) 0x4d, (byte) 0xba, (byte) 0x60, (byte) 0x26, (byte) 0x76, (byte) 0xea, (byte) 0xb2, (byte) 0xa5, (byte) 0x2, (byte) 0x0, (byte) 0x0, (byte) 0x78, (byte) 0x70, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x3, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x1, (byte) 0x0, (byte) 0x0,
+        (byte) 0x0, (byte) 0x2, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x15, (byte) 0x78
+    };
+}
diff --git a/jdk/test/java/sql/util/StubBlob.java b/jdk/test/java/sql/util/StubBlob.java
new file mode 100644
index 0000000..59917c7
--- /dev/null
+++ b/jdk/test/java/sql/util/StubBlob.java
@@ -0,0 +1,73 @@
+/*
+ * 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.
+ *
+ * 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 util;
+
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.sql.Blob;
+import java.sql.SQLException;
+
+
+public class StubBlob implements Blob {
+    public long length() throws SQLException {
+        return 0;
+    }
+    public byte[] getBytes(long pos, int length)
+        throws SQLException {
+        return null;
+    }
+    public InputStream getBinaryStream()
+        throws SQLException {
+        return null;
+    }
+    public long position(byte[] pattern, long start)
+        throws SQLException {
+        return 0;
+    }
+    public long position(Blob pattern, long start)
+        throws SQLException {
+        return 0;
+    }
+    public int setBytes(long pos, byte[] bytes)
+        throws SQLException {
+        return 0;
+    }
+    public int setBytes(long pos, byte[] bytes, int offset, int len)
+        throws SQLException {
+        return 0;
+    }
+    public OutputStream setBinaryStream(long pos)
+        throws SQLException {
+        return null;
+    }
+    public void truncate(long len)
+        throws SQLException {
+    }
+    /* 6.0 implementation */
+
+    public void free() throws SQLException {}
+
+    public InputStream getBinaryStream(long pos, long length) throws SQLException {
+       return null;
+    }
+}
diff --git a/jdk/test/java/sql/util/StubConnection.java b/jdk/test/java/sql/util/StubConnection.java
new file mode 100644
index 0000000..88c4426
--- /dev/null
+++ b/jdk/test/java/sql/util/StubConnection.java
@@ -0,0 +1,315 @@
+/*
+ * 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.
+ *
+ * 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 util;
+
+import java.sql.Array;
+import java.sql.Blob;
+import java.sql.CallableStatement;
+import java.sql.Clob;
+import java.sql.Connection;
+import java.sql.DatabaseMetaData;
+import java.sql.NClob;
+import java.sql.PreparedStatement;
+import java.sql.SQLClientInfoException;
+import java.sql.SQLException;
+import java.sql.SQLWarning;
+import java.sql.SQLXML;
+import java.sql.Savepoint;
+import java.sql.Statement;
+import java.sql.Struct;
+import java.util.Map;
+import java.util.Properties;
+import java.util.concurrent.Executor;
+
+public class StubConnection implements Connection {
+
+    @Override
+    public Statement createStatement() throws SQLException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public PreparedStatement prepareStatement(String sql) throws SQLException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public CallableStatement prepareCall(String sql) throws SQLException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public String nativeSQL(String sql) throws SQLException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public void setAutoCommit(boolean autoCommit) throws SQLException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public boolean getAutoCommit() throws SQLException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public void commit() throws SQLException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public void rollback() throws SQLException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public void close() throws SQLException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public boolean isClosed() throws SQLException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public DatabaseMetaData getMetaData() throws SQLException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public void setReadOnly(boolean readOnly) throws SQLException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public boolean isReadOnly() throws SQLException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public void setCatalog(String catalog) throws SQLException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public String getCatalog() throws SQLException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public void setTransactionIsolation(int level) throws SQLException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public int getTransactionIsolation() throws SQLException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public SQLWarning getWarnings() throws SQLException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public void clearWarnings() throws SQLException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public Map<String, Class<?>> getTypeMap() throws SQLException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public void setTypeMap(Map<String, Class<?>> map) throws SQLException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public void setHoldability(int holdability) throws SQLException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public int getHoldability() throws SQLException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public Savepoint setSavepoint() throws SQLException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public Savepoint setSavepoint(String name) throws SQLException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public void rollback(Savepoint savepoint) throws SQLException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public void releaseSavepoint(Savepoint savepoint) throws SQLException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public Clob createClob() throws SQLException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public Blob createBlob() throws SQLException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public NClob createNClob() throws SQLException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public SQLXML createSQLXML() throws SQLException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public boolean isValid(int timeout) throws SQLException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public void setClientInfo(String name, String value) throws SQLClientInfoException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public void setClientInfo(Properties properties) throws SQLClientInfoException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public String getClientInfo(String name) throws SQLException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public Properties getClientInfo() throws SQLException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public Array createArrayOf(String typeName, Object[] elements) throws SQLException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public Struct createStruct(String typeName, Object[] attributes) throws SQLException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public void setSchema(String schema) throws SQLException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public String getSchema() throws SQLException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public void abort(Executor executor) throws SQLException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public int getNetworkTimeout() throws SQLException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public <T> T unwrap(Class<T> iface) throws SQLException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public boolean isWrapperFor(Class<?> iface) throws SQLException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+}
diff --git a/jdk/test/java/sql/util/StubDriver.java b/jdk/test/java/sql/util/StubDriver.java
new file mode 100644
index 0000000..1225308
--- /dev/null
+++ b/jdk/test/java/sql/util/StubDriver.java
@@ -0,0 +1,75 @@
+/*
+ * 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.
+ *
+ * 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 util;
+
+import java.sql.Connection;
+import java.sql.Driver;
+import java.sql.DriverPropertyInfo;
+import java.sql.SQLException;
+import java.sql.SQLFeatureNotSupportedException;
+import java.util.Properties;
+import java.util.logging.Logger;
+
+public class StubDriver implements Driver {
+
+    public StubDriver() {
+    }
+
+    @Override
+    public Connection connect(String url, Properties info) throws SQLException {
+        if (acceptsURL(url)) {
+            return new StubConnection();
+        }
+        return null;
+    }
+
+    @Override
+    public boolean acceptsURL(String url) throws SQLException {
+        return url.matches("^jdbc:tennis:.*");
+    }
+
+    @Override
+    public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public int getMajorVersion() {
+        return 1;
+    }
+
+    @Override
+    public int getMinorVersion() {
+        return 0;
+    }
+
+    @Override
+    public boolean jdbcCompliant() {
+        return true;
+    }
+
+    @Override
+    public Logger getParentLogger() throws SQLFeatureNotSupportedException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+}
diff --git a/jdk/test/java/sql/util/StubDriverDA.java b/jdk/test/java/sql/util/StubDriverDA.java
new file mode 100644
index 0000000..5b23f08
--- /dev/null
+++ b/jdk/test/java/sql/util/StubDriverDA.java
@@ -0,0 +1,75 @@
+/*
+ * 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.
+ *
+ * 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 util;
+
+import java.io.File;
+import java.io.IOException;
+import java.sql.DriverAction;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * Simple java.sql.Driver stub class that registers the driver via a static
+ * block with a DriverAction Implementation
+ * @author ljanders
+ */
+public class StubDriverDA extends StubDriver {
+
+    public static final String DriverActionCalled = "DriverActionCalled.txt";
+
+    static DriverAction da;
+
+    static {
+        try {
+            DriverManager.registerDriver(new StubDriverDA(), da);
+        } catch (SQLException ex) {
+            Logger.getLogger(StubDriverDA.class.getName()).log(Level.SEVERE, null, ex);
+        }
+    }
+
+    public StubDriverDA() {
+        da = new DriverActionImpl(this);
+    }
+
+    @Override
+    public boolean acceptsURL(String url) throws SQLException {
+        return url.matches("^jdbc:luckydog:.*");
+    }
+
+    /**
+     * This method will write out a text file when called by the
+     * DriverActionImpl.release method when DriverManager.deregisterDriver
+     * is called. This is used by DriverManagerTests to validate that
+     * DriverAction.release was called
+     */
+    protected void release() {
+        File file = new File(DriverActionCalled);
+        try {
+            file.createNewFile();
+        } catch (IOException ex) {
+            throw new RuntimeException(ex);
+        }
+    }
+}
diff --git a/jdk/test/java/time/tck/java/time/chrono/CopticChronology.java b/jdk/test/java/time/tck/java/time/chrono/CopticChronology.java
index c72b737..626b286 100644
--- a/jdk/test/java/time/tck/java/time/chrono/CopticChronology.java
+++ b/jdk/test/java/time/tck/java/time/chrono/CopticChronology.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2012, 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
diff --git a/jdk/test/java/time/tck/java/time/chrono/CopticDate.java b/jdk/test/java/time/tck/java/time/chrono/CopticDate.java
index a296c59..09e2e47 100644
--- a/jdk/test/java/time/tck/java/time/chrono/CopticDate.java
+++ b/jdk/test/java/time/tck/java/time/chrono/CopticDate.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2012, 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
diff --git a/jdk/test/java/time/tck/java/time/chrono/CopticEra.java b/jdk/test/java/time/tck/java/time/chrono/CopticEra.java
index c1d7f56..be78ff5 100644
--- a/jdk/test/java/time/tck/java/time/chrono/CopticEra.java
+++ b/jdk/test/java/time/tck/java/time/chrono/CopticEra.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2012, 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
diff --git a/jdk/test/java/time/tck/java/time/chrono/TCKChronoPeriod.java b/jdk/test/java/time/tck/java/time/chrono/TCKChronoPeriod.java
index 58a1c35..b8b1bd2 100644
--- a/jdk/test/java/time/tck/java/time/chrono/TCKChronoPeriod.java
+++ b/jdk/test/java/time/tck/java/time/chrono/TCKChronoPeriod.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 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
@@ -83,6 +83,7 @@
 import org.testng.annotations.DataProvider;
 import org.testng.annotations.Test;
 
+@Test
 public class TCKChronoPeriod {
 
     //-----------------------------------------------------------------------
diff --git a/jdk/test/java/time/test/java/time/temporal/TestIsoWeekFields.java b/jdk/test/java/time/test/java/time/temporal/TestIsoWeekFields.java
new file mode 100644
index 0000000..d79d13f
--- /dev/null
+++ b/jdk/test/java/time/test/java/time/temporal/TestIsoWeekFields.java
@@ -0,0 +1,280 @@
+/*
+ * 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 test.java.time.temporal;
+
+import static java.time.temporal.ChronoField.DAY_OF_WEEK;
+import static org.testng.Assert.assertEquals;
+
+import java.time.LocalDate;
+import java.time.LocalTime;
+import java.time.MonthDay;
+import java.time.OffsetDateTime;
+import java.time.Year;
+import java.time.chrono.ThaiBuddhistDate;
+import java.time.temporal.ChronoUnit;
+import java.time.temporal.IsoFields;
+import java.time.temporal.TemporalField;
+import java.time.temporal.ValueRange;
+import java.time.temporal.WeekFields;
+
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+
+/**
+ * Test.
+ */
+@Test
+public class TestIsoWeekFields {
+
+    @DataProvider(name = "fields")
+    Object[][] data_Fields() {
+        return new Object[][] {
+                {IsoFields.WEEK_OF_WEEK_BASED_YEAR, IsoFields.WEEK_BASED_YEAR},
+                {WeekFields.ISO.weekOfWeekBasedYear(), WeekFields.ISO.weekBasedYear()},
+        };
+    }
+
+    //-----------------------------------------------------------------------
+    // WEEK_OF_WEEK_BASED_YEAR
+    //-----------------------------------------------------------------------
+    @Test(dataProvider = "fields")
+    public void test_WOWBY_basics(TemporalField weekField, TemporalField yearField) {
+        assertEquals(weekField.isDateBased(), true);
+        assertEquals(weekField.isTimeBased(), false);
+        assertEquals(weekField.getBaseUnit(), ChronoUnit.WEEKS);
+        assertEquals(weekField.getRangeUnit(), IsoFields.WEEK_BASED_YEARS);
+    }
+
+    @Test(dataProvider = "fields")
+    public void test_WOWBY_isSupportedBy(TemporalField weekField, TemporalField yearField) {
+        assertEquals(weekField.isSupportedBy(LocalTime.NOON), false);
+        assertEquals(weekField.isSupportedBy(MonthDay.of(2, 1)), false);
+        assertEquals(weekField.isSupportedBy(LocalDate.MIN), true);
+        assertEquals(weekField.isSupportedBy(OffsetDateTime.MAX), true);
+    }
+
+    @Test
+    public void test_WOWBY_isSupportedBy_fieldsDiffer() {
+        assertEquals(IsoFields.WEEK_OF_WEEK_BASED_YEAR.isSupportedBy(ThaiBuddhistDate.now()), false);
+        assertEquals(WeekFields.ISO.weekOfWeekBasedYear().isSupportedBy(ThaiBuddhistDate.now()), true);
+    }
+
+    @Test(dataProvider = "fields")
+    public void test_WOWBY_range(TemporalField weekField, TemporalField yearField) {
+        assertEquals(weekField.range(), ValueRange.of(1, 52, 53));
+    }
+
+    @Test(dataProvider = "fields")
+    public void test_WOWBY_rangeRefinedBy(TemporalField weekField, TemporalField yearField) {
+        assertEquals(weekField.rangeRefinedBy(LocalDate.of(2012, 12, 31)), ValueRange.of(1, 52));
+        assertEquals(weekField.rangeRefinedBy(LocalDate.of(2013, 12, 29)), ValueRange.of(1, 52));
+        assertEquals(weekField.rangeRefinedBy(LocalDate.of(2013, 12, 30)), ValueRange.of(1, 52));
+        assertEquals(weekField.rangeRefinedBy(LocalDate.of(2014, 12, 28)), ValueRange.of(1, 52));
+        assertEquals(weekField.rangeRefinedBy(LocalDate.of(2014, 12, 29)), ValueRange.of(1, 53));
+        assertEquals(weekField.rangeRefinedBy(LocalDate.of(2016, 1, 3)), ValueRange.of(1, 53));
+        assertEquals(weekField.rangeRefinedBy(LocalDate.of(2016, 1, 4)), ValueRange.of(1, 52));
+    }
+
+    //-----------------------------------------------------------------------
+    // WEEK_BASED_YEAR
+    //-----------------------------------------------------------------------
+    @Test(dataProvider = "fields")
+    public void test_WBY_basics(TemporalField weekField, TemporalField yearField) {
+        assertEquals(yearField.isDateBased(), true);
+        assertEquals(yearField.isTimeBased(), false);
+        assertEquals(yearField.getBaseUnit(), IsoFields.WEEK_BASED_YEARS);
+        assertEquals(yearField.getRangeUnit(), ChronoUnit.FOREVER);
+    }
+
+    @Test(dataProvider = "fields")
+    public void test_WBY_isSupportedBy(TemporalField weekField, TemporalField yearField) {
+        assertEquals(yearField.isSupportedBy(LocalTime.NOON), false);
+        assertEquals(yearField.isSupportedBy(MonthDay.of(2, 1)), false);
+        assertEquals(yearField.isSupportedBy(LocalDate.MIN), true);
+        assertEquals(yearField.isSupportedBy(OffsetDateTime.MAX), true);
+    }
+
+    @Test
+    public void test_WBY_isSupportedBy_ISO() {
+        assertEquals(IsoFields.WEEK_BASED_YEAR.isSupportedBy(ThaiBuddhistDate.now()), false);
+    }
+
+    @Test(dataProvider = "fields")
+    public void test_WBY_range(TemporalField weekField, TemporalField yearField) {
+        assertEquals(yearField.range(), ValueRange.of(Year.MIN_VALUE, Year.MAX_VALUE));
+    }
+
+    @Test(dataProvider = "fields")
+    public void test_WBY_rangeRefinedBy(TemporalField weekField, TemporalField yearField) {
+        assertEquals(yearField.rangeRefinedBy(LocalDate.of(2012, 12, 31)), ValueRange.of(Year.MIN_VALUE, Year.MAX_VALUE));
+    }
+
+    //-----------------------------------------------------------------------
+    @Test(dataProvider = "fields")
+    public void test_getFrom(TemporalField weekField, TemporalField yearField) {
+        // tests every day from 2011 to 2016 inclusive
+        LocalDate date = LocalDate.of(2011, 1, 3);
+        int wby = 2011;
+        int week = 1;
+        int dow = 1;
+        for (int i = 1; i <= ((52 + 52 + 52 + 52 + 53 + 52) * 7); i++) {
+            assertEquals(yearField.getFrom(date), wby);
+            assertEquals(weekField.getFrom(date), week);
+            assertEquals(DAY_OF_WEEK.getFrom(date), dow);
+            if (dow == 7) {
+                dow = 1;
+                week++;
+            } else {
+                dow++;
+            }
+            if (week > wbyLen(wby)) {
+                week = 1;
+                wby++;
+            }
+            date = date.plusDays(1);
+        }
+        assertEquals(yearField.getFrom(date), 2017);
+        assertEquals(weekField.getFrom(date), 1);
+        assertEquals(DAY_OF_WEEK.getFrom(date), 1);
+    }
+
+    @Test(dataProvider = "fields")
+    public void test_adjustInto_dow(TemporalField weekField, TemporalField yearField) {
+        // tests every day from 2012 to 2016 inclusive
+        LocalDate date = LocalDate.of(2012, 1, 2);
+        int wby = 2012;
+        int week = 1;
+        int dow = 1;
+        for (int i = 1; i <= ((52 + 52 + 52 + 53 + 52) * 7); i++) {
+            for (int j = 1; j <= 7; j++) {
+                LocalDate adjusted = DAY_OF_WEEK.adjustInto(date, j);
+                assertEquals(adjusted.get(DAY_OF_WEEK), j);
+                assertEquals(adjusted.get(weekField), week);
+                assertEquals(adjusted.get(yearField), wby);
+            }
+            if (dow == 7) {
+                dow = 1;
+                week++;
+            } else {
+                dow++;
+            }
+            if (week > wbyLen(wby)) {
+                week = 1;
+                wby++;
+            }
+            date = date.plusDays(1);
+        }
+    }
+
+    @Test(dataProvider = "fields")
+    public void test_adjustInto_week(TemporalField weekField, TemporalField yearField) {
+        // tests every day from 2012 to 2016 inclusive
+        LocalDate date = LocalDate.of(2012, 1, 2);
+        int wby = 2012;
+        int week = 1;
+        int dow = 1;
+        for (int i = 1; i <= ((52 + 52 + 52 + 53 + 52) * 7); i++) {
+            int weeksInYear = (wby == 2015 ? 53 : 52);
+            for (int j = 1; j <= weeksInYear; j++) {
+                LocalDate adjusted = weekField.adjustInto(date, j);
+                assertEquals(adjusted.get(weekField), j);
+                assertEquals(adjusted.get(DAY_OF_WEEK), dow);
+                assertEquals(adjusted.get(yearField), wby);
+            }
+            if (dow == 7) {
+                dow = 1;
+                week++;
+            } else {
+                dow++;
+            }
+            if (week > wbyLen(wby)) {
+                week = 1;
+                wby++;
+            }
+            date = date.plusDays(1);
+        }
+    }
+
+    @Test(dataProvider = "fields")
+    public void test_adjustInto_wby(TemporalField weekField, TemporalField yearField) {
+        // tests every day from 2012 to 2016 inclusive
+        LocalDate date = LocalDate.of(2012, 1, 2);
+        int wby = 2012;
+        int week = 1;
+        int dow = 1;
+        for (int i = 1; i <= ((52 + 52 + 52 + 53 + 52) * 7); i++) {
+            for (int j = 2004; j <= 2015; j++) {
+                LocalDate adjusted = yearField.adjustInto(date, j);
+                assertEquals(adjusted.get(yearField), j);
+                assertEquals(adjusted.get(DAY_OF_WEEK), dow);
+                assertEquals(adjusted.get(weekField), (week == 53 && wbyLen(j) == 52 ? 52 : week), "" + date + " " + adjusted);
+            }
+            if (dow == 7) {
+                dow = 1;
+                week++;
+            } else {
+                dow++;
+            }
+            if (week > wbyLen(wby)) {
+                week = 1;
+                wby++;
+            }
+            date = date.plusDays(1);
+        }
+    }
+
+    @Test(dataProvider = "fields")
+    public void test_addTo_weekBasedYears(TemporalField weekField, TemporalField yearField) {
+        // tests every day from 2012 to 2016 inclusive
+        LocalDate date = LocalDate.of(2012, 1, 2);
+        int wby = 2012;
+        int week = 1;
+        int dow = 1;
+        for (int i = 1; i <= ((52 + 52 + 52 + 53 + 52) * 7); i++) {
+            for (int j = -5; j <= 5; j++) {
+                LocalDate adjusted = IsoFields.WEEK_BASED_YEARS.addTo(date, j);
+                assertEquals(adjusted.get(yearField), wby + j);
+                assertEquals(adjusted.get(DAY_OF_WEEK), dow);
+                assertEquals(adjusted.get(weekField), (week == 53 && wbyLen(wby + j) == 52 ? 52 : week), "" + date + " " + adjusted);
+            }
+            if (dow == 7) {
+                dow = 1;
+                week++;
+            } else {
+                dow++;
+            }
+            if (week > wbyLen(wby)) {
+                week = 1;
+                wby++;
+            }
+            date = date.plusDays(1);
+        }
+    }
+
+    private int wbyLen(int wby) {
+        return (wby == 2004 || wby == 2009 || wby == 2015 || wby == 2020 ? 53 : 52);
+    }
+
+}
diff --git a/jdk/test/lib/testlibrary/jdk/testlibrary/FileUtils.java b/jdk/test/lib/testlibrary/jdk/testlibrary/FileUtils.java
index 7882262..3c85782 100644
--- a/jdk/test/lib/testlibrary/jdk/testlibrary/FileUtils.java
+++ b/jdk/test/lib/testlibrary/jdk/testlibrary/FileUtils.java
@@ -191,4 +191,3 @@
         return excs;
     }
 }
-
diff --git a/jdk/test/lib/testlibrary/jdk/testlibrary/IOUtils.java b/jdk/test/lib/testlibrary/jdk/testlibrary/IOUtils.java
new file mode 100644
index 0000000..4bfddd0
--- /dev/null
+++ b/jdk/test/lib/testlibrary/jdk/testlibrary/IOUtils.java
@@ -0,0 +1,71 @@
+/*
+ * 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.
+ *
+ * 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 jdk.testlibrary;
+
+/**
+ * Defines useful I/O methods.
+ */
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Arrays;
+
+public final class IOUtils {
+
+    /*
+     * Prevent instantiation.
+     */
+    private IOUtils() {}
+
+    /**
+     * Read all bytes from <code>in</code>
+     * until EOF is detected.
+     * @param in input stream, must not be null
+     * @return bytes read
+     * @throws IOException Any IO error.
+     */
+    public static byte[] readFully(InputStream is) throws IOException {
+        byte[] output = {};
+        int pos = 0;
+        while (true) {
+            int bytesToRead;
+            if (pos >= output.length) { // Only expand when there's no room
+                bytesToRead = output.length + 1024;
+                if (output.length < pos + bytesToRead) {
+                    output = Arrays.copyOf(output, pos + bytesToRead);
+                }
+            } else {
+                bytesToRead = output.length - pos;
+            }
+            int cc = is.read(output, pos, bytesToRead);
+            if (cc < 0) {
+                if (output.length != pos) {
+                    output = Arrays.copyOf(output, pos);
+                }
+                break;
+            }
+            pos += cc;
+        }
+        return output;
+    }
+}
diff --git a/jdk/test/sun/net/www/http/HttpClient/B8025710.java b/jdk/test/sun/net/www/http/HttpClient/B8025710.java
new file mode 100644
index 0000000..8074c76
--- /dev/null
+++ b/jdk/test/sun/net/www/http/HttpClient/B8025710.java
@@ -0,0 +1,409 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.*;
+import java.net.*;
+import java.security.*;
+import java.security.cert.X509Certificate;
+import java.util.ArrayList;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import javax.net.ServerSocketFactory;
+import javax.net.SocketFactory;
+import javax.net.ssl.*;
+
+/**
+ * @test
+ * @bug 8025710
+ * @summary Proxied https connection reuse by HttpClient can send CONNECT to the server
+ */
+public class B8025710 {
+
+    private final static AtomicBoolean connectInServer = new AtomicBoolean();
+    private static final String keystorefile =
+            System.getProperty("test.src", "./")
+            + "/../../../../../javax/net/ssl/etc/keystore";
+    private static final String passphrase = "passphrase";
+
+    public static void main(String[] args) throws Exception {
+        new B8025710().runTest();
+
+        if (connectInServer.get())
+            throw new RuntimeException("TEST FAILED: server got proxy header");
+        else
+            System.out.println("TEST PASSED");
+    }
+
+    private void runTest() throws Exception {
+        ProxyServer proxyServer = new ProxyServer();
+        HttpServer httpServer = new HttpServer();
+        httpServer.start();
+        proxyServer.start();
+
+        URL url = new URL("https", InetAddress.getLocalHost().getHostName(),
+                httpServer.getPort(), "/");
+
+        Proxy proxy = new Proxy(Proxy.Type.HTTP, proxyServer.getAddress());
+
+        HttpsURLConnection.setDefaultSSLSocketFactory(createTestSSLSocketFactory());
+
+        // Make two connections. The bug occurs when the second request is made
+        for (int i = 0; i < 2; i++) {
+            System.out.println("Client: Requesting " + url.toExternalForm()
+                    + " via " + proxy.toString()
+                    + " (attempt " + (i + 1) + " of 2)");
+
+            HttpsURLConnection connection =
+                    (HttpsURLConnection) url.openConnection(proxy);
+
+            connection.setRequestMethod("POST");
+            connection.setDoInput(true);
+            connection.setDoOutput(true);
+            connection.setRequestProperty("User-Agent", "Test/1.0");
+            connection.getOutputStream().write("Hello, world!".getBytes("UTF-8"));
+
+            if (connection.getResponseCode() != 200) {
+                System.err.println("Client: Unexpected response code "
+                        + connection.getResponseCode());
+                break;
+            }
+
+            String response = readLine(connection.getInputStream());
+            if (!"Hi!".equals(response)) {
+                System.err.println("Client: Unexpected response body: "
+                        + response);
+            }
+        }
+        httpServer.close();
+        proxyServer.close();
+        httpServer.join();
+        proxyServer.join();
+    }
+
+    class ProxyServer extends Thread implements Closeable {
+
+        private final ServerSocket proxySocket;
+        private final Pattern connectLinePattern =
+                Pattern.compile("^CONNECT ([^: ]+):([0-9]+) HTTP/[0-9.]+$");
+        private final String PROXY_RESPONSE =
+                "HTTP/1.0 200 Connection Established\r\n"
+                + "Proxy-Agent: TestProxy/1.0\r\n"
+                + "\r\n";
+
+        ProxyServer() throws Exception {
+            super("ProxyServer Thread");
+
+            // Create the http proxy server socket
+            proxySocket = ServerSocketFactory.getDefault().createServerSocket();
+            proxySocket.bind(new InetSocketAddress(InetAddress.getLocalHost(), 0));
+        }
+
+        public SocketAddress getAddress() { return  proxySocket.getLocalSocketAddress(); }
+
+        @Override
+        public void close() throws IOException {
+            proxySocket.close();
+        }
+
+        @Override
+        public void run() {
+            ArrayList<Thread> threads = new ArrayList<>();
+            int connectionCount = 0;
+            try {
+                while (connectionCount++ < 2) {
+                    final Socket clientSocket = proxySocket.accept();
+                    final int proxyConnectionCount = connectionCount;
+                    System.out.println("Proxy: NEW CONNECTION "
+                            + proxyConnectionCount);
+
+                    Thread t = new Thread("ProxySocket" + proxyConnectionCount) {
+                        @Override
+                        public void run() {
+                            try {
+                                String firstLine =
+                                        readHeader(clientSocket.getInputStream());
+
+                                Matcher connectLineMatcher =
+                                        connectLinePattern.matcher(firstLine);
+                                if (!connectLineMatcher.matches()) {
+                                    System.out.println("Proxy: Unexpected"
+                                            + " request to the proxy: "
+                                            + firstLine);
+                                    return;
+                                }
+
+                                String host    = connectLineMatcher.group(1);
+                                String portStr = connectLineMatcher.group(2);
+                                int port       = Integer.parseInt(portStr);
+
+                                Socket serverSocket = SocketFactory.getDefault()
+                                        .createSocket(host, port);
+
+                                clientSocket.getOutputStream()
+                                        .write(PROXY_RESPONSE.getBytes("UTF-8"));
+
+                                ProxyTunnel copyToClient =
+                                        new ProxyTunnel(serverSocket, clientSocket);
+                                ProxyTunnel copyToServer =
+                                        new ProxyTunnel(clientSocket, serverSocket);
+
+                                copyToClient.start();
+                                copyToServer.start();
+
+                                copyToClient.join();
+                                // here copyToClient.close() would not provoke the
+                                // bug ( since it would trigger the retry logic in
+                                // HttpURLConnction.writeRequests ), so close only
+                                // the output to get the connection in this state.
+                                clientSocket.shutdownOutput();
+
+                                try {
+                                    Thread.sleep(3000);
+                                } catch (InterruptedException ignored) { }
+
+                                // now close all connections to finish the test
+                                copyToServer.close();
+                                copyToClient.close();
+                            } catch (IOException | NumberFormatException
+                                    | InterruptedException e) {
+                                e.printStackTrace();
+                            }
+                        }
+                    };
+                    threads.add(t);
+                    t.start();
+                }
+                for (Thread t: threads)
+                    t.join();
+            } catch (IOException | InterruptedException e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
+    /**
+     * This inner class provides unidirectional data flow through the sockets
+     * by continuously copying bytes from the input socket onto the output
+     * socket, until both sockets are open and EOF has not been received.
+     */
+    class ProxyTunnel extends Thread {
+        private final Socket sockIn;
+        private final Socket sockOut;
+        private final InputStream input;
+        private final OutputStream output;
+
+        public ProxyTunnel(Socket sockIn, Socket sockOut) throws IOException {
+            super("ProxyTunnel");
+            this.sockIn  = sockIn;
+            this.sockOut = sockOut;
+            input  = sockIn.getInputStream();
+            output = sockOut.getOutputStream();
+        }
+
+        public void run() {
+            byte[] buf = new byte[8192];
+            int bytesRead;
+
+            try {
+                while ((bytesRead = input.read(buf)) >= 0) {
+                    output.write(buf, 0, bytesRead);
+                    output.flush();
+                }
+            } catch (IOException ignored) {
+                close();
+            }
+        }
+
+        public void close() {
+            try {
+                if (!sockIn.isClosed())
+                    sockIn.close();
+                if (!sockOut.isClosed())
+                    sockOut.close();
+            } catch (IOException ignored) { }
+        }
+    }
+
+    /**
+     * the server thread
+     */
+    class HttpServer extends Thread implements Closeable {
+
+        private final ServerSocket serverSocket;
+        private final SSLSocketFactory sslSocketFactory;
+        private final String serverResponse =
+                "HTTP/1.1 200 OK\r\n"
+                + "Content-Type: text/plain\r\n"
+                + "Content-Length: 3\r\n"
+                + "\r\n"
+                + "Hi!";
+        private int connectionCount = 0;
+
+        HttpServer() throws Exception {
+            super("HttpServer Thread");
+
+            KeyStore ks = KeyStore.getInstance("JKS");
+            ks.load(new FileInputStream(keystorefile), passphrase.toCharArray());
+            KeyManagerFactory factory = KeyManagerFactory.getInstance("SunX509");
+            factory.init(ks, passphrase.toCharArray());
+            SSLContext ctx = SSLContext.getInstance("TLS");
+            ctx.init(factory.getKeyManagers(), null, null);
+
+            sslSocketFactory = ctx.getSocketFactory();
+
+            // Create the server that the test wants to connect to via the proxy
+            serverSocket = ServerSocketFactory.getDefault().createServerSocket();
+            serverSocket.bind(new InetSocketAddress(InetAddress.getLocalHost(), 0));
+        }
+
+        public int getPort() { return  serverSocket.getLocalPort(); }
+
+        @Override
+        public void close() throws IOException { serverSocket.close(); }
+
+        @Override
+        public void run() {
+            try {
+                while (connectionCount++ < 2) {
+                    Socket socket = serverSocket.accept();
+                    System.out.println("Server: NEW CONNECTION "
+                            + connectionCount);
+
+                    SSLSocket sslSocket = (SSLSocket) sslSocketFactory
+                            .createSocket(socket,null, getPort(), false);
+                    sslSocket.setUseClientMode(false);
+                    sslSocket.startHandshake();
+
+                    String firstLine = readHeader(sslSocket.getInputStream());
+                    if (firstLine != null && firstLine.contains("CONNECT")) {
+                        System.out.println("Server: BUG! HTTP CONNECT"
+                                + " encountered: " + firstLine);
+                        connectInServer.set(true);
+                    }
+
+                    // write the success response, the request body is not read.
+                    // close only output and keep input open.
+                    OutputStream out = sslSocket.getOutputStream();
+                    out.write(serverResponse.getBytes("UTF-8"));
+                    socket.shutdownOutput();
+                }
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
+    /**
+     * read the header and return only the first line.
+     *
+     * @param inputStream the stream to read from
+     * @return the first line of the stream
+     * @throws IOException if reading failed
+     */
+    private static String readHeader(InputStream inputStream)
+            throws IOException {
+        String line;
+        String firstLine = null;
+        while ((line = readLine(inputStream)) != null && line.length() > 0) {
+            if (firstLine == null) {
+                firstLine = line;
+            }
+        }
+
+        return firstLine;
+    }
+
+    /**
+     * read a line from stream.
+     *
+     * @param inputStream the stream to read from
+     * @return the line
+     * @throws IOException  if reading failed
+     */
+    private static String readLine(InputStream inputStream)
+            throws IOException {
+        final StringBuilder line = new StringBuilder();
+        int ch;
+        while ((ch = inputStream.read()) != -1) {
+            if (ch == '\r') {
+                continue;
+            }
+
+            if (ch == '\n') {
+                break;
+            }
+
+            line.append((char) ch);
+        }
+
+        return line.toString();
+    }
+
+    private SSLSocketFactory createTestSSLSocketFactory() {
+
+        HttpsURLConnection.setDefaultHostnameVerifier(new HostnameVerifier() {
+            @Override
+            public boolean verify(String hostname, SSLSession sslSession) {
+                // ignore the cert's CN; it's not important to this test
+                return true;
+            }
+        });
+
+        // Set up the socket factory to use a trust manager that trusts all
+        // certs, since trust validation isn't important to this test
+        final TrustManager[] trustAllCertChains = new TrustManager[] {
+            new X509TrustManager() {
+                @Override
+                public X509Certificate[] getAcceptedIssuers() {
+                    return null;
+                }
+
+                @Override
+                public void checkClientTrusted(X509Certificate[] certs,
+                        String authType) {
+                }
+
+                @Override
+                public void checkServerTrusted(X509Certificate[] certs,
+                        String authType) {
+                }
+            }
+        };
+
+        final SSLContext sc;
+        try {
+            sc = SSLContext.getInstance("TLS");
+        } catch (NoSuchAlgorithmException e) {
+            throw new RuntimeException(e);
+        }
+
+        try {
+            sc.init(null, trustAllCertChains, new java.security.SecureRandom());
+        } catch (KeyManagementException e) {
+            throw new RuntimeException(e);
+        }
+
+        return sc.getSocketFactory();
+    }
+}
diff --git a/jdk/test/sun/security/tools/jarsigner/CertChainUnclosed.java b/jdk/test/sun/security/tools/jarsigner/CertChainUnclosed.java
index 18b2eb7..e259207 100644
--- a/jdk/test/sun/security/tools/jarsigner/CertChainUnclosed.java
+++ b/jdk/test/sun/security/tools/jarsigner/CertChainUnclosed.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 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
@@ -30,13 +30,15 @@
 
 import java.nio.file.Files;
 import java.nio.file.Paths;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 import java.util.Locale;
 
 public class CertChainUnclosed {
 
     public static void main(String[] args) throws Exception {
-        String os = java.security.AccessController.doPrivileged(
-                new sun.security.action.GetPropertyAction("os.name"));
+        String os = AccessController.doPrivileged(
+                    (PrivilegedAction<String>)() -> System.getProperty("os.name"));
         if (!os.toUpperCase(Locale.US).contains("WINDOWS")) {
             System.out.println("Not Windows. Skip test.");
             return;
diff --git a/jdk/test/sun/security/tools/jarsigner/EntriesOrder.java b/jdk/test/sun/security/tools/jarsigner/EntriesOrder.java
index 96c90e9..908f6ef 100644
--- a/jdk/test/sun/security/tools/jarsigner/EntriesOrder.java
+++ b/jdk/test/sun/security/tools/jarsigner/EntriesOrder.java
@@ -25,6 +25,9 @@
  * @test
  * @bug 8031572
  * @summary jarsigner -verify exits with 0 when a jar file is not properly signed
+ * @library /lib/testlibrary
+ * @build jdk.testlibrary.IOUtils
+ * @run main EntriesOrder
  */
 
 import java.io.FileInputStream;
@@ -39,6 +42,8 @@
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipOutputStream;
 
+import jdk.testlibrary.IOUtils;
+
 public class EntriesOrder {
 
     public static void main(String[] args) throws Exception {
@@ -106,7 +111,7 @@
                 Enumeration<JarEntry> jes = jf.entries();
                 while (jes.hasMoreElements()) {
                     JarEntry je = jes.nextElement();
-                    sun.misc.IOUtils.readFully(jf.getInputStream(je), -1, true);
+                    IOUtils.readFully(jf.getInputStream(je));
                     Certificate[] certs = je.getCertificates();
                     if (certs != null && certs.length > 0) {
                         cc++;
@@ -138,7 +143,7 @@
                 while (true) {
                     JarEntry je = jis.getNextJarEntry();
                     if (je == null) break;
-                    sun.misc.IOUtils.readFully(jis, -1, true);
+                    IOUtils.readFully(jis);
                     Certificate[] certs = je.getCertificates();
                     if (certs != null && certs.length > 0) {
                         cc++;
diff --git a/jdk/test/sun/security/tools/jarsigner/TimestampCheck.java b/jdk/test/sun/security/tools/jarsigner/TimestampCheck.java
index 65b1cca..113bb26 100644
--- a/jdk/test/sun/security/tools/jarsigner/TimestampCheck.java
+++ b/jdk/test/sun/security/tools/jarsigner/TimestampCheck.java
@@ -24,10 +24,9 @@
 import com.sun.net.httpserver.*;
 import java.io.BufferedReader;
 import java.io.ByteArrayOutputStream;
-import java.io.File;
 import java.io.FileInputStream;
-import java.io.FileOutputStream;
 import java.io.IOException;
+import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.io.OutputStream;
 import java.math.BigInteger;
@@ -38,9 +37,15 @@
 import java.security.cert.Certificate;
 import java.security.cert.X509Certificate;
 import java.util.Calendar;
+import java.util.jar.JarEntry;
+import java.util.jar.JarFile;
+
+import sun.misc.IOUtils;
 import sun.security.pkcs.ContentInfo;
 import sun.security.pkcs.PKCS7;
+import sun.security.pkcs.PKCS9Attribute;
 import sun.security.pkcs.SignerInfo;
+import sun.security.timestamp.TimestampToken;
 import sun.security.util.DerOutputStream;
 import sun.security.util.DerValue;
 import sun.security.util.ObjectIdentifier;
@@ -51,6 +56,8 @@
     static final String TSKS = "tsks";
     static final String JAR = "old.jar";
 
+    static final String defaultPolicyId = "2.3.4.5";
+
     static class Handler implements HttpHandler {
         public void handle(HttpExchange t) throws IOException {
             int len = 0;
@@ -94,6 +101,11 @@
          * 6: extension is missing
          * 7: extension is non-critical
          * 8: extension does not have timestamping
+         * 9: no cert in response
+         * 10: normal
+         * 11: always return default policy id
+         * 12: normal
+         * otherwise: normal
          * @returns the signed
          */
         byte[] sign(byte[] input, int path) throws Exception {
@@ -106,6 +118,7 @@
                     messageImprint.data.getDerValue());
             System.err.println("AlgorithmId: " + aid);
 
+            ObjectIdentifier policyId = new ObjectIdentifier(defaultPolicyId);
             BigInteger nonce = null;
             while (value.data.available() > 0) {
                 DerValue v = value.data.getDerValue();
@@ -114,6 +127,9 @@
                     System.err.println("nonce: " + nonce);
                 } else if (v.tag == DerValue.tag_Boolean) {
                     System.err.println("certReq: " + v.getBoolean());
+                } else if (v.tag == DerValue.tag_ObjectId) {
+                    policyId = v.getOID();
+                    System.err.println("PolicyID: " + policyId);
                 }
             }
 
@@ -127,6 +143,10 @@
             if (path == 7) alias = "tsbad2";
             if (path == 8) alias = "tsbad3";
 
+            if (path == 11) {
+                policyId = new ObjectIdentifier(defaultPolicyId);
+            }
+
             DerOutputStream statusInfo = new DerOutputStream();
             statusInfo.putInteger(0);
 
@@ -150,7 +170,7 @@
             DerOutputStream tst = new DerOutputStream();
 
             tst.putInteger(1);
-            tst.putOID(new ObjectIdentifier("1.2.3.4"));    // policy
+            tst.putOID(policyId);
 
             if (path != 3 && path != 4) {
                 tst.putDerValue(messageImprint);
@@ -260,15 +280,43 @@
                 jarsigner(cmd, 7, false);   // tsbad2
                 jarsigner(cmd, 8, false);   // tsbad3
                 jarsigner(cmd, 9, false);   // no cert in timestamp
-                jarsigner(cmd + " -tsapolicyid 1.2.3.4", 0, true);
-                jarsigner(cmd + " -tsapolicyid 1.2.3.5", 0, false);
+                jarsigner(cmd + " -tsapolicyid 1.2.3.4", 10, true);
+                checkTimestamp("new_10.jar", "1.2.3.4", "SHA-256");
+                jarsigner(cmd + " -tsapolicyid 1.2.3.5", 11, false);
+                jarsigner(cmd + " -tsadigestalg SHA", 12, true);
+                checkTimestamp("new_12.jar", defaultPolicyId, "SHA-1");
             } else {                        // Run as a standalone server
                 System.err.println("Press Enter to quit server");
                 System.in.read();
             }
         } finally {
             server.stop(0);
-            new File("x.jar").delete();
+        }
+    }
+
+    static void checkTimestamp(String file, String policyId, String digestAlg)
+            throws Exception {
+        try (JarFile jf = new JarFile(file)) {
+            JarEntry je = jf.getJarEntry("META-INF/OLD.RSA");
+            try (InputStream is = jf.getInputStream(je)) {
+                byte[] content = IOUtils.readFully(is, -1, true);
+                PKCS7 p7 = new PKCS7(content);
+                SignerInfo[] si = p7.getSignerInfos();
+                if (si == null || si.length == 0) {
+                    throw new Exception("Not signed");
+                }
+                PKCS9Attribute p9 = si[0].getUnauthenticatedAttributes()
+                        .getAttribute(PKCS9Attribute.SIGNATURE_TIMESTAMP_TOKEN_OID);
+                PKCS7 tsToken = new PKCS7((byte[]) p9.getValue());
+                TimestampToken tt =
+                        new TimestampToken(tsToken.getContentInfo().getData());
+                if (!tt.getHashAlgorithm().toString().equals(digestAlg)) {
+                    throw new Exception("Digest alg different");
+                }
+                if (!tt.getPolicyID().equals(policyId)) {
+                    throw new Exception("policyId different");
+                }
+            }
         }
     }
 
diff --git a/langtools/.hgtags b/langtools/.hgtags
index f10929f..994cf39 100644
--- a/langtools/.hgtags
+++ b/langtools/.hgtags
@@ -252,3 +252,4 @@
 e25d44c21b29e155734f8d832f2edac3d0debe35 jdk9-b07
 ea02d24b3f1dd1417132d6587dd38b056cca0be2 jdk9-b08
 2d13524486b46a0f879361fbadf68fe42d02d221 jdk9-b09
+7736a820af6f15cef9a1499f122e40abc83b2fbd jdk9-b10
diff --git a/langtools/make/netbeans/langtools/build.xml b/langtools/make/netbeans/langtools/build.xml
index c0b6ae2..0f7aeb2 100644
--- a/langtools/make/netbeans/langtools/build.xml
+++ b/langtools/make/netbeans/langtools/build.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
- Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
 
  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions
@@ -136,11 +136,32 @@
         </antcall>
     </target>
 
-    <target name="-show-jtreg" if="netbeans.home" unless="jtreg.passed">
-        <nbbrowse file="${jtreg.report}/report.html"/>
+    <target name="-show-jtreg-single-detect" if="netbeans.home" unless="jtreg.passed">
+        <dirname property="netbeans.jtreg.tests.dir.temp" file="${jtreg.report}/../work/${jtreg.tests}"/>
+        <basename property="netbeans.jtreg.tests.basename.temp" file="${jtreg.tests}" suffix=".java"/>
+        <property name="netbeans.jtreg.single.jtr" value="${netbeans.jtreg.tests.dir.temp}/${netbeans.jtreg.tests.basename.temp}.jtr"/>
+        <condition property="netbeans.jtreg.single">
+            <available file="${netbeans.jtreg.single.jtr}" />
+        </condition>
+        <condition property="netbeans.jtreg.multiple">
+            <not>
+                <available file="${netbeans.jtreg.single.jtr}" />
+            </not>
+        </condition>
+    </target>
+
+    <target name="-show-jtreg-single" if="netbeans.jtreg.single" depends="-show-jtreg-single-detect">
+        <nbbrowse file="${netbeans.jtreg.single.jtr}"/>
         <fail>Some tests failed; see report for details.</fail>
     </target>
 
+    <target name="-show-jtreg-multiple" if="netbeans.jtreg.multiple" depends="-show-jtreg-single-detect">
+        <nbbrowse url="file://${jtreg.report}/html/report.html#Results"/>
+        <fail>Some tests failed; see report for details.</fail>
+    </target>
+
+    <target name="-show-jtreg" depends="-show-jtreg-single-detect,-show-jtreg-single,-show-jtreg-multiple" />
+
     <!-- Debug tool in NetBeans. -->
 
     <target name="debug" depends="-check-target.java.home,-def-run,-def-start-debugger,-get-tool-and-args,build" if="netbeans.home">
diff --git a/langtools/make/netbeans/langtools/nbproject/project.properties b/langtools/make/netbeans/langtools/nbproject/project.properties
new file mode 100644
index 0000000..31b5a41
--- /dev/null
+++ b/langtools/make/netbeans/langtools/nbproject/project.properties
@@ -0,0 +1,10 @@
+auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.expand-tabs=true
+auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.indent-shift-width=4
+auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.spaces-per-tab=4
+auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.tab-size=8
+auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.text-limit-width=100
+auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.text-line-wrap=none
+auxiliary.org-netbeans-modules-editor-indent.CodeStyle.usedProfile=project
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.importGroupsOrder=java;javax;*;static java;static javax;static *
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.importInnerClasses=true
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.separateStaticImports=true
diff --git a/langtools/make/netbeans/langtools/nbproject/project.xml b/langtools/make/netbeans/langtools/nbproject/project.xml
index 710d523..1327dae 100644
--- a/langtools/make/netbeans/langtools/nbproject/project.xml
+++ b/langtools/make/netbeans/langtools/nbproject/project.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
- Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
 
  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions
@@ -67,38 +67,7 @@
             </folders>
             <ide-actions>
                 <!--
- Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
-
-   - Redistributions of source code must retain the above copyright
-     notice, this list of conditions and the following disclaimer.
-
-   - Redistributions in binary form must reproduce the above copyright
-     notice, this list of conditions and the following disclaimer in the
-     documentation and/or other materials provided with the distribution.
-
-   - Neither the name of Oracle nor the names of its
-     contributors may be used to endorse or promote products derived
-     from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
- IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--->
-                <!--
- This file defines the standard actions accepted by langtools projects.
- It is normally included as an entity into a project's project.xml file.
+ This section defines the standard actions accepted by langtools projects.
 
  For information on these actions, see
    - NetBeans: Setting Up Projects
@@ -156,7 +125,7 @@
                         <pattern>\.(java|sh)$</pattern>
                         <format>relative-path</format>
                         <arity>
-                            <separated-files>,</separated-files>
+                            <separated-files> </separated-files>
                         </arity>
                     </context>
                 </action>
@@ -246,39 +215,8 @@
                 </items>
                 <context-menu>
                     <!--
- Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
-
-   - Redistributions of source code must retain the above copyright
-     notice, this list of conditions and the following disclaimer.
-
-   - Redistributions in binary form must reproduce the above copyright
-     notice, this list of conditions and the following disclaimer in the
-     documentation and/or other materials provided with the distribution.
-
-   - Neither the name of Oracle nor the names of its
-     contributors may be used to endorse or promote products derived
-     from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
- IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--->
-                    <!--
- This file defines the actions that will appear on the project's context
+ This section defines the actions that will appear on the project's context
  menu, in the Projects viewer.
- It is normally included as an entity into a project's project.xml file.
 
  For information on these actions, see
    - NetBeans: Setting Up Projects
diff --git a/langtools/make/netbeans/langtools/nbproject/standard-context-menu-items.ent b/langtools/make/netbeans/langtools/nbproject/standard-context-menu-items.ent
deleted file mode 100644
index f3c2dae..0000000
--- a/langtools/make/netbeans/langtools/nbproject/standard-context-menu-items.ent
+++ /dev/null
@@ -1,61 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Copyright (c) 2007, 2009, Oracle and/or its affiliates. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
-
-   - Redistributions of source code must retain the above copyright
-     notice, this list of conditions and the following disclaimer.
-
-   - Redistributions in binary form must reproduce the above copyright
-     notice, this list of conditions and the following disclaimer in the
-     documentation and/or other materials provided with the distribution.
-
-   - Neither the name of Oracle nor the names of its
-     contributors may be used to endorse or promote products derived
-     from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
- IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--->
-
-<!-- 
- This file defines the actions that will appear on the project's context
- menu, in the Projects viewer.
- It is normally included as an entity into a project's project.xml file.
-
- For information on these actions, see
-   - NetBeans: Setting Up Projects
-     at http://www.netbeans.org/kb/55/using-netbeans/project_setup.html
-   - NetBeans: Advanced Freeform Project Configuration
-     at http://www.netbeans.org/kb/41/freeform-config.html 
--->
-
-<ide-action name="select-tool"/>
-
-<separator/>
-  
-<ide-action name="build"/>
-<ide-action name="rebuild"/>
-<ide-action name="clean"/>
-<ide-action name="javadoc"/>
-
-<separator/>
-
-<ide-action name="run"/>
-<ide-action name="debug"/>
-
-<separator/>
-
-<ide-action name="test"/>
diff --git a/langtools/make/netbeans/langtools/nbproject/standard-ide-actions.ent b/langtools/make/netbeans/langtools/nbproject/standard-ide-actions.ent
deleted file mode 100644
index 2d1afa7..0000000
--- a/langtools/make/netbeans/langtools/nbproject/standard-ide-actions.ent
+++ /dev/null
@@ -1,173 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Copyright (c) 2007, 2009, Oracle and/or its affiliates. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
-
-   - Redistributions of source code must retain the above copyright
-     notice, this list of conditions and the following disclaimer.
-
-   - Redistributions in binary form must reproduce the above copyright
-     notice, this list of conditions and the following disclaimer in the
-     documentation and/or other materials provided with the distribution.
-
-   - Neither the name of Oracle nor the names of its
-     contributors may be used to endorse or promote products derived
-     from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
- IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--->
-
-<!-- 
- This file defines the standard actions accepted by langtools projects.
- It is normally included as an entity into a project's project.xml file.
-
- For information on these actions, see
-   - NetBeans: Setting Up Projects
-     at http://www.netbeans.org/kb/55/using-netbeans/project_setup.html
-   - NetBeans: Advanced Freeform Project Configuration
-     at http://www.netbeans.org/kb/41/freeform-config.html 
--->
-
-<action name="build">
-    <target>build</target>
-</action>
-
-<action name="clean">
-    <target>clean</target>
-</action>
-
-<action name="rebuild">
-    <target>clean</target>
-    <target>build</target>
-</action>
-
-<action name="compile.single">
-    <target>compile-single</target>
-    <property name="srcdir">${root}/src/share/classes</property>
-    <context>
-        <property>includes</property>
-        <folder>${root}/src/share/classes</folder>
-        <pattern>\.java$</pattern>
-        <format>relative-path</format>
-        <arity>
-            <separated-files>,</separated-files>
-        </arity>
-    </context>
-</action>
-
-<action name="run">
-    <target>run</target>
-</action>
-
-<action name="run.single">
-    <target>run-single</target>
-    <context>
-        <property>run.classname</property>
-        <folder>${root}/src/share/classes</folder>
-        <pattern>\.java$</pattern>
-        <format>java-name</format>
-        <arity>
-            <one-file-only/>
-        </arity>
-    </context>
-</action>
-
-<!-- 
- Note: NetBeans does not appear to support context menu items
- on shell scripts :-(
--->
-
-<action name="run.single">
-    <target>jtreg</target>
-    <context>
-        <property>jtreg.tests</property>
-        <folder>${root}/test</folder>
-        <pattern>\.(java|sh)$</pattern>
-        <format>relative-path</format>
-        <arity>
-            <separated-files>,</separated-files>
-        </arity>
-    </context>
-</action>
-
-<action name="test">
-    <target>jtreg</target>
-</action>
-
-<action name="debug">
-    <target>debug</target>
-</action>
-
-<action name="debug.single">
-    <target>debug-single</target>
-    <context>
-        <property>debug.classname</property>
-        <folder>${root}/src/share/classes</folder>
-        <pattern>\.java$</pattern>
-        <format>java-name</format>
-        <arity>
-            <one-file-only/>
-        </arity>
-    </context>
-</action>
-
-<!-- 
- Note: NetBeans does not appear to support context menu items
- on shell scripts :-(
--->
-
-<action name="debug.single">
-    <target>debug-jtreg</target>
-    <context>
-        <property>jtreg.tests</property>
-        <folder>${root}/test</folder>
-        <pattern>\.(java|sh)$</pattern>
-        <format>relative-path</format>
-        <arity>
-            <one-file-only/>
-        </arity>
-    </context>
-</action>
-
-<action name="debug.fix">
-    <target>debug-fix</target>
-    <property name="srcdir">${root}/src/share/classes</property>
-    <context>
-        <property>class</property>
-        <folder>${root}/src/share/classes</folder>
-        <pattern>\.java$</pattern>
-        <format>relative-path-noext</format>
-        <arity>
-            <one-file-only/>
-        </arity>
-    </context>
-</action>
-
-<action name="javadoc">
-    <target>javadoc</target>
-</action>
-
-<action name="select-tool">
-    <target>select-tool</target>
-</action>
-
-<action name="test-select-tool-1">
-    <target>test-select-tool-1</target>
-</action>
-
-<action name="test-select-tool-2">
-    <target>test-select-tool-2</target>
-</action>
diff --git a/langtools/make/tools/genstubs/GenStubs.java b/langtools/make/tools/genstubs/GenStubs.java
index ffa95c9..9f8fc7a 100644
--- a/langtools/make/tools/genstubs/GenStubs.java
+++ b/langtools/make/tools/genstubs/GenStubs.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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
@@ -316,7 +316,8 @@
                 }
                 defs.add(def);
             }
-            return m.TopLevel(tree.packageAnnotations, tree.pid, defs.toList());
+            tree.defs = tree.defs.intersect(defs.toList());
+            return tree;
         }
 
         @Override
diff --git a/langtools/src/share/classes/com/sun/source/tree/CompilationUnitTree.java b/langtools/src/share/classes/com/sun/source/tree/CompilationUnitTree.java
index 9ded6b6..d401a31 100644
--- a/langtools/src/share/classes/com/sun/source/tree/CompilationUnitTree.java
+++ b/langtools/src/share/classes/com/sun/source/tree/CompilationUnitTree.java
@@ -41,6 +41,12 @@
 public interface CompilationUnitTree extends Tree {
     List<? extends AnnotationTree> getPackageAnnotations();
     ExpressionTree getPackageName();
+
+    /**
+     * Return the PackageTree associated with this compilation unit.
+     * @since 1.9
+     */
+    PackageTree getPackage();
     List<? extends ImportTree> getImports();
     List<? extends Tree> getTypeDecls();
     JavaFileObject getSourceFile();
diff --git a/langtools/src/share/classes/com/sun/source/tree/PackageTree.java b/langtools/src/share/classes/com/sun/source/tree/PackageTree.java
new file mode 100644
index 0000000..c2d822e
--- /dev/null
+++ b/langtools/src/share/classes/com/sun/source/tree/PackageTree.java
@@ -0,0 +1,42 @@
+/*
+ * 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.source.tree;
+
+import java.util.List;
+
+/**
+ * Represents the package declaration.
+ *
+ * @jls sections 7.3, and 7.4
+ *
+ * @author Paul Govereau
+ * @since 1.9
+ */
+@jdk.Exported
+public interface PackageTree extends Tree {
+    List<? extends AnnotationTree> getAnnotations();
+    ExpressionTree getPackageName();
+}
diff --git a/langtools/src/share/classes/com/sun/source/tree/Tree.java b/langtools/src/share/classes/com/sun/source/tree/Tree.java
index b416f08..de3166d 100644
--- a/langtools/src/share/classes/com/sun/source/tree/Tree.java
+++ b/langtools/src/share/classes/com/sun/source/tree/Tree.java
@@ -208,6 +208,12 @@
         LAMBDA_EXPRESSION(LambdaExpressionTree.class),
 
         /**
+         * Used for instances of {@link PackageTree}.
+         * @since 1.9
+         */
+        PACKAGE(PackageTree.class),
+
+        /**
          * Used for instances of {@link ParenthesizedTree}.
          */
         PARENTHESIZED(ParenthesizedTree.class),
diff --git a/langtools/src/share/classes/com/sun/source/tree/TreeVisitor.java b/langtools/src/share/classes/com/sun/source/tree/TreeVisitor.java
index 9a03ef2..db1f32a 100644
--- a/langtools/src/share/classes/com/sun/source/tree/TreeVisitor.java
+++ b/langtools/src/share/classes/com/sun/source/tree/TreeVisitor.java
@@ -88,6 +88,7 @@
     R visitNewArray(NewArrayTree node, P p);
     R visitNewClass(NewClassTree node, P p);
     R visitLambdaExpression(LambdaExpressionTree node, P p);
+    R visitPackage(PackageTree node, P p);
     R visitParenthesized(ParenthesizedTree node, P p);
     R visitReturn(ReturnTree node, P p);
     R visitMemberSelect(MemberSelectTree node, P p);
diff --git a/langtools/src/share/classes/com/sun/source/util/SimpleTreeVisitor.java b/langtools/src/share/classes/com/sun/source/util/SimpleTreeVisitor.java
index 4ae4ac1..1959945 100644
--- a/langtools/src/share/classes/com/sun/source/util/SimpleTreeVisitor.java
+++ b/langtools/src/share/classes/com/sun/source/util/SimpleTreeVisitor.java
@@ -65,6 +65,10 @@
         return defaultAction(node, p);
     }
 
+    public R visitPackage(PackageTree node, P p) {
+        return defaultAction(node, p);
+    }
+
     public R visitImport(ImportTree node, P p) {
         return defaultAction(node, p);
     }
diff --git a/langtools/src/share/classes/com/sun/source/util/TreeScanner.java b/langtools/src/share/classes/com/sun/source/util/TreeScanner.java
index c709f59..a14cad4 100644
--- a/langtools/src/share/classes/com/sun/source/util/TreeScanner.java
+++ b/langtools/src/share/classes/com/sun/source/util/TreeScanner.java
@@ -114,13 +114,18 @@
  ****************************************************************************/
 
     public R visitCompilationUnit(CompilationUnitTree node, P p) {
-        R r = scan(node.getPackageAnnotations(), p);
-        r = scanAndReduce(node.getPackageName(), p, r);
+        R r = scan(node.getPackage(), p);
         r = scanAndReduce(node.getImports(), p, r);
         r = scanAndReduce(node.getTypeDecls(), p, r);
         return r;
     }
 
+    public R visitPackage(PackageTree node, P p) {
+        R r = scan(node.getAnnotations(), p);
+        r = scanAndReduce(node.getPackageName(), p, r);
+        return r;
+    }
+
     public R visitImport(ImportTree node, P p) {
         return scan(node.getQualifiedIdentifier(), p);
     }
diff --git a/langtools/src/share/classes/com/sun/tools/doclint/Checker.java b/langtools/src/share/classes/com/sun/tools/doclint/Checker.java
index e89a460..54b79ba 100644
--- a/langtools/src/share/classes/com/sun/tools/doclint/Checker.java
+++ b/langtools/src/share/classes/com/sun/tools/doclint/Checker.java
@@ -75,6 +75,7 @@
 import com.sun.source.doctree.UnknownInlineTagTree;
 import com.sun.source.doctree.ValueTree;
 import com.sun.source.doctree.VersionTree;
+import com.sun.source.tree.Tree;
 import com.sun.source.util.DocTreePath;
 import com.sun.source.util.DocTreePathScanner;
 import com.sun.source.util.TreePath;
@@ -145,8 +146,8 @@
 
         boolean isOverridingMethod = !env.currOverriddenMethods.isEmpty();
 
-        if (p.getLeaf() == p.getCompilationUnit()) {
-            // If p points to a compilation unit, the implied declaration is the
+        if (p.getLeaf().getKind() == Tree.Kind.PACKAGE) {
+            // If p points to a package, the implied declaration is the
             // package declaration (if any) for the compilation unit.
             // Handle this case specially, because doc comments are only
             // expected in package-info files.
diff --git a/langtools/src/share/classes/com/sun/tools/doclint/DocLint.java b/langtools/src/share/classes/com/sun/tools/doclint/DocLint.java
index 0c8e666..1f8db0d 100644
--- a/langtools/src/share/classes/com/sun/tools/doclint/DocLint.java
+++ b/langtools/src/share/classes/com/sun/tools/doclint/DocLint.java
@@ -42,6 +42,7 @@
 import com.sun.source.doctree.DocCommentTree;
 import com.sun.source.tree.ClassTree;
 import com.sun.source.tree.CompilationUnitTree;
+import com.sun.source.tree.PackageTree;
 import com.sun.source.tree.MethodTree;
 import com.sun.source.tree.Tree;
 import com.sun.source.tree.VariableTree;
@@ -346,13 +347,10 @@
         abstract void visitDecl(Tree tree, Name name);
 
         @Override
-        public Void visitCompilationUnit(CompilationUnitTree tree, Void ignore) {
-            if (tree.getPackageName() != null) {
-                visitDecl(tree, null);
-            }
-            return super.visitCompilationUnit(tree, ignore);
+        public Void visitPackage(PackageTree tree, Void ignore) {
+            visitDecl(tree, null);
+            return super.visitPackage(tree, ignore);
         }
-
         @Override
         public Void visitClass(ClassTree tree, Void ignore) {
             visitDecl(tree, tree.getSimpleName());
diff --git a/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java b/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java
index 7660b2d..c23b928 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java
@@ -2616,7 +2616,7 @@
          * - an instance field, we use the first constructor.
          * - a static field, we create a fake clinit method.
          */
-        private Env<AttrContext> lambdaEnv(JCLambda that, Env<AttrContext> env) {
+        public Env<AttrContext> lambdaEnv(JCLambda that, Env<AttrContext> env) {
             Env<AttrContext> lambdaEnv;
             Symbol owner = env.info.scope.owner;
             if (owner.kind == VAR && owner.owner.kind == TYP) {
diff --git a/langtools/src/share/classes/com/sun/tools/javac/comp/DeferredAttr.java b/langtools/src/share/classes/com/sun/tools/javac/comp/DeferredAttr.java
index f3a6489..617d2d1 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/DeferredAttr.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/DeferredAttr.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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,7 +25,7 @@
 
 package com.sun.tools.javac.comp;
 
-import com.sun.source.tree.MemberReferenceTree;
+import com.sun.source.tree.LambdaExpressionTree.BodyKind;
 import com.sun.tools.javac.code.*;
 import com.sun.tools.javac.tree.*;
 import com.sun.tools.javac.util.*;
@@ -35,10 +35,8 @@
 import com.sun.tools.javac.comp.Attr.ResultInfo;
 import com.sun.tools.javac.comp.Infer.InferenceContext;
 import com.sun.tools.javac.comp.Resolve.MethodResolutionPhase;
-import com.sun.tools.javac.comp.Resolve.ReferenceLookupHelper;
 import com.sun.tools.javac.tree.JCTree.*;
 
-
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.EnumSet;
@@ -48,6 +46,7 @@
 import java.util.Set;
 import java.util.WeakHashMap;
 
+import static com.sun.tools.javac.code.Kinds.VAL;
 import static com.sun.tools.javac.code.TypeTag.*;
 import static com.sun.tools.javac.tree.JCTree.Tag.*;
 
@@ -75,6 +74,8 @@
     final Symtab syms;
     final TreeMaker make;
     final Types types;
+    final Flow flow;
+    final Names names;
 
     public static DeferredAttr instance(Context context) {
         DeferredAttr instance = context.get(deferredAttrKey);
@@ -95,7 +96,8 @@
         syms = Symtab.instance(context);
         make = TreeMaker.instance(context);
         types = Types.instance(context);
-        Names names = Names.instance(context);
+        flow = Flow.instance(context);
+        names = Names.instance(context);
         stuckTree = make.Ident(names.empty).setType(Type.stuckType);
         emptyDeferredAttrContext =
             new DeferredAttrContext(AttrMode.CHECK, null, MethodResolutionPhase.BOX, infer.emptyContext, null, null) {
@@ -138,6 +140,11 @@
             return DEFERRED;
         }
 
+        @Override
+        public String toString() {
+            return "DeferredType";
+        }
+
         /**
          * A speculative cache is used to keep track of all overload resolution rounds
          * that triggered speculative attribution on a given deferred type. Each entry
@@ -376,7 +383,9 @@
         }
     }
     //where
-        protected TreeScanner unenterScanner = new TreeScanner() {
+        protected UnenterScanner unenterScanner = new UnenterScanner();
+
+        class UnenterScanner extends TreeScanner {
             @Override
             public void visitClassDef(JCClassDecl tree) {
                 ClassSymbol csym = tree.sym;
@@ -389,7 +398,7 @@
                 syms.classes.remove(csym.flatname);
                 super.visitClassDef(tree);
             }
-        };
+        }
 
     /**
      * A deferred context is created on each method check. A deferred context is
@@ -593,19 +602,111 @@
             public void visitLambda(JCLambda tree) {
                 Check.CheckContext checkContext = resultInfo.checkContext;
                 Type pt = resultInfo.pt;
-                if (inferenceContext.inferencevars.contains(pt)) {
-                    //ok
-                    return;
-                } else {
+                if (!inferenceContext.inferencevars.contains(pt)) {
                     //must be a functional descriptor
+                    Type descriptorType = null;
                     try {
-                        Type desc = types.findDescriptorType(pt);
-                        if (desc.getParameterTypes().length() != tree.params.length()) {
-                            checkContext.report(tree, diags.fragment("incompatible.arg.types.in.lambda"));
-                        }
+                        descriptorType = types.findDescriptorType(pt);
                     } catch (Types.FunctionDescriptorLookupError ex) {
                         checkContext.report(null, ex.getDiagnostic());
                     }
+
+                    if (descriptorType.getParameterTypes().length() != tree.params.length()) {
+                        checkContext.report(tree,
+                                diags.fragment("incompatible.arg.types.in.lambda"));
+                    }
+
+                    Type currentReturnType = descriptorType.getReturnType();
+                    boolean returnTypeIsVoid = currentReturnType.hasTag(VOID);
+                    if (tree.getBodyKind() == BodyKind.EXPRESSION) {
+                        boolean isExpressionCompatible = !returnTypeIsVoid ||
+                            TreeInfo.isExpressionStatement((JCExpression)tree.getBody());
+                        if (!isExpressionCompatible) {
+                            resultInfo.checkContext.report(tree.pos(),
+                                diags.fragment("incompatible.ret.type.in.lambda",
+                                    diags.fragment("missing.ret.val", currentReturnType)));
+                        }
+                    } else {
+                        LambdaBodyStructChecker lambdaBodyChecker =
+                                new LambdaBodyStructChecker();
+
+                        tree.body.accept(lambdaBodyChecker);
+                        boolean isVoidCompatible = lambdaBodyChecker.isVoidCompatible;
+
+                        if (returnTypeIsVoid) {
+                            if (!isVoidCompatible) {
+                                resultInfo.checkContext.report(tree.pos(),
+                                    diags.fragment("unexpected.ret.val"));
+                            }
+                        } else {
+                            boolean isValueCompatible = lambdaBodyChecker.isPotentiallyValueCompatible
+                                && !canLambdaBodyCompleteNormally(tree);
+                            if (!isValueCompatible && !isVoidCompatible) {
+                                log.error(tree.body.pos(),
+                                    "lambda.body.neither.value.nor.void.compatible");
+                            }
+
+                            if (!isValueCompatible) {
+                                resultInfo.checkContext.report(tree.pos(),
+                                    diags.fragment("incompatible.ret.type.in.lambda",
+                                        diags.fragment("missing.ret.val", currentReturnType)));
+                            }
+                        }
+                    }
+                }
+            }
+
+            boolean canLambdaBodyCompleteNormally(JCLambda tree) {
+                JCLambda newTree = new TreeCopier<>(make).copy(tree);
+                /* attr.lambdaEnv will create a meaningful env for the
+                 * lambda expression. This is specially useful when the
+                 * lambda is used as the init of a field. But we need to
+                 * remove any added symbol.
+                 */
+                Env<AttrContext> localEnv = attr.lambdaEnv(newTree, env);
+                try {
+                    List<JCVariableDecl> tmpParams = newTree.params;
+                    while (tmpParams.nonEmpty()) {
+                        tmpParams.head.vartype = make.at(tmpParams.head).Type(syms.errType);
+                        tmpParams = tmpParams.tail;
+                    }
+
+                    attr.attribStats(newTree.params, localEnv);
+
+                    /* set pt to Type.noType to avoid generating any bound
+                     * which may happen if lambda's return type is an
+                     * inference variable
+                     */
+                    Attr.ResultInfo bodyResultInfo = attr.new ResultInfo(VAL, Type.noType);
+                    localEnv.info.returnResult = bodyResultInfo;
+
+                    // discard any log output
+                    Log.DiagnosticHandler diagHandler = new Log.DiscardDiagnosticHandler(log);
+                    try {
+                        JCBlock body = (JCBlock)newTree.body;
+                        /* we need to attribute the lambda body before
+                         * doing the aliveness analysis. This is because
+                         * constant folding occurs during attribution
+                         * and the reachability of some statements depends
+                         * on constant values, for example:
+                         *
+                         *     while (true) {...}
+                         */
+                        attr.attribStats(body.stats, localEnv);
+
+                        attr.preFlow(newTree);
+                        /* make an aliveness / reachability analysis of the lambda
+                         * to determine if it can complete normally
+                         */
+                        flow.analyzeLambda(localEnv, newTree, make, true);
+                    } finally {
+                        log.popDiagnosticHandler(diagHandler);
+                    }
+                    return newTree.canCompleteNormally;
+                } finally {
+                    JCBlock body = (JCBlock)newTree.body;
+                    unenterScanner.scan(body.stats);
+                    localEnv.info.scope.leave();
                 }
             }
 
@@ -623,10 +724,7 @@
             public void visitReference(JCMemberReference tree) {
                 Check.CheckContext checkContext = resultInfo.checkContext;
                 Type pt = resultInfo.pt;
-                if (inferenceContext.inferencevars.contains(pt)) {
-                    //ok
-                    return;
-                } else {
+                if (!inferenceContext.inferencevars.contains(pt)) {
                     try {
                         types.findDescriptorType(pt);
                     } catch (Types.FunctionDescriptorLookupError ex) {
@@ -656,6 +754,40 @@
                 }
             }
         }
+
+        /* This visitor looks for return statements, its analysis will determine if
+         * a lambda body is void or value compatible. We must analyze return
+         * statements contained in the lambda body only, thus any return statement
+         * contained in an inner class or inner lambda body, should be ignored.
+         */
+        class LambdaBodyStructChecker extends TreeScanner {
+            boolean isVoidCompatible = true;
+            boolean isPotentiallyValueCompatible = true;
+
+            @Override
+            public void visitClassDef(JCClassDecl tree) {
+                // do nothing
+            }
+
+            @Override
+            public void visitLambda(JCLambda tree) {
+                // do nothing
+            }
+
+            @Override
+            public void visitNewClass(JCNewClass tree) {
+                // do nothing
+            }
+
+            @Override
+            public void visitReturn(JCReturn tree) {
+                if (tree.expr != null) {
+                    isVoidCompatible = false;
+                } else {
+                    isPotentiallyValueCompatible = false;
+                }
+            }
+        }
     }
 
     /** an empty deferred attribution context - all methods throw exceptions */
@@ -767,7 +899,7 @@
         /**
          * handler that is executed when a node has been discarded
          */
-        abstract void skip(JCTree tree);
+        void skip(JCTree tree) {}
     }
 
     /**
@@ -779,11 +911,6 @@
         PolyScanner() {
             super(EnumSet.of(CONDEXPR, PARENS, LAMBDA, REFERENCE));
         }
-
-        @Override
-        void skip(JCTree tree) {
-            //do nothing
-        }
     }
 
     /**
@@ -796,11 +923,6 @@
             super(EnumSet.of(BLOCK, CASE, CATCH, DOLOOP, FOREACHLOOP,
                     FORLOOP, RETURN, SYNCHRONIZED, SWITCH, TRY, WHILELOOP));
         }
-
-        @Override
-        void skip(JCTree tree) {
-            //do nothing
-        }
     }
 
     /**
diff --git a/langtools/src/share/classes/com/sun/tools/javac/comp/Enter.java b/langtools/src/share/classes/com/sun/tools/javac/comp/Enter.java
index c9985f7..bd189b3 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Enter.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Enter.java
@@ -288,15 +288,16 @@
         boolean addEnv = false;
         boolean isPkgInfo = tree.sourcefile.isNameCompatible("package-info",
                                                              JavaFileObject.Kind.SOURCE);
-        if (tree.pid != null) {
-            tree.packge = syms.enterPackage(TreeInfo.fullName(tree.pid));
-            if (tree.packageAnnotations.nonEmpty()
-                    || pkginfoOpt == PkgInfo.ALWAYS
-                    || tree.docComments != null) {
+        JCPackageDecl pd = tree.getPackage();
+        if (pd != null) {
+            tree.packge = pd.packge = syms.enterPackage(TreeInfo.fullName(pd.pid));
+            if (   pd.annotations.nonEmpty()
+                || pkginfoOpt == PkgInfo.ALWAYS
+                || tree.docComments != null) {
                 if (isPkgInfo) {
                     addEnv = true;
-                } else if (tree.packageAnnotations.nonEmpty()){
-                    log.error(tree.packageAnnotations.head.pos(),
+                } else if (pd.annotations.nonEmpty()) {
+                    log.error(pd.annotations.head.pos(),
                               "pkg.annotations.sb.in.package-info.java");
                 }
             }
@@ -305,26 +306,20 @@
         }
         tree.packge.complete(); // Find all classes in package.
         Env<AttrContext> topEnv = topLevelEnv(tree);
+        Env<AttrContext> packageEnv = isPkgInfo ? topEnv.dup(pd) : null;
 
         // Save environment of package-info.java file.
         if (isPkgInfo) {
             Env<AttrContext> env0 = typeEnvs.get(tree.packge);
-            if (env0 == null) {
-                typeEnvs.put(tree.packge, topEnv);
-            } else {
+            if (env0 != null) {
                 JCCompilationUnit tree0 = env0.toplevel;
                 if (!fileManager.isSameFile(tree.sourcefile, tree0.sourcefile)) {
-                    log.warning(tree.pid != null ? tree.pid.pos()
-                                                 : null,
+                    log.warning(pd != null ? pd.pid.pos() : null,
                                 "pkg-info.already.seen",
                                 tree.packge);
-                    if (addEnv || (tree0.packageAnnotations.isEmpty() &&
-                                   tree.docComments != null &&
-                                   tree.docComments.hasComment(tree))) {
-                        typeEnvs.put(tree.packge, topEnv);
-                    }
                 }
             }
+            typeEnvs.put(tree.packge, packageEnv);
 
             for (Symbol q = tree.packge; q != null && q.kind == PCK; q = q.owner)
                 q.flags_field |= EXISTS;
@@ -339,7 +334,7 @@
         }
         classEnter(tree.defs, topEnv);
         if (addEnv) {
-            todo.append(topEnv);
+            todo.append(packageEnv);
         }
         log.useSource(prev);
         result = null;
diff --git a/langtools/src/share/classes/com/sun/tools/javac/comp/Flow.java b/langtools/src/share/classes/com/sun/tools/javac/comp/Flow.java
index d18988c..a269fce 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Flow.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Flow.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -45,7 +45,7 @@
 import static com.sun.tools.javac.tree.JCTree.Tag.*;
 
 /** This pass implements dataflow analysis for Java programs though
- *  different AST visitor steps. Liveness analysis (see AliveAlanyzer) checks that
+ *  different AST visitor steps. Liveness analysis (see AliveAnalyzer) checks that
  *  every statement is reachable. Exception analysis (see FlowAnalyzer) ensures that
  *  every checked exception that is thrown is declared or caught.  Definite assignment analysis
  *  (see AssignAnalyzer) ensures that each variable is assigned when used.  Definite
@@ -388,6 +388,10 @@
                 super.scan(tree);
             }
         }
+
+        public void visitPackageDef(JCPackageDecl tree) {
+            // Do nothing for PackageDecl
+        }
     }
 
     /**
@@ -723,10 +727,6 @@
             }
         }
 
-        public void visitTopLevel(JCCompilationUnit tree) {
-            // Do nothing for TopLevel since each class is visited individually
-        }
-
     /**************************************************************************
      * main method
      *************************************************************************/
@@ -1289,10 +1289,6 @@
             }
         }
 
-        public void visitTopLevel(JCCompilationUnit tree) {
-            // Do nothing for TopLevel since each class is visited individually
-        }
-
     /**************************************************************************
      * main method
      *************************************************************************/
@@ -2357,10 +2353,6 @@
             tree.underlyingType.accept(this);
         }
 
-        public void visitTopLevel(JCCompilationUnit tree) {
-            // Do nothing for TopLevel since each class is visited individually
-        }
-
     /**************************************************************************
      * main method
      *************************************************************************/
@@ -2677,10 +2669,6 @@
             }
         }
 
-        public void visitTopLevel(JCCompilationUnit tree) {
-            // Do nothing for TopLevel since each class is visited individually
-        }
-
     /**************************************************************************
      * main method
      *************************************************************************/
diff --git a/langtools/src/share/classes/com/sun/tools/javac/comp/Infer.java b/langtools/src/share/classes/com/sun/tools/javac/comp/Infer.java
index 1fe4958..b34f36f 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Infer.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Infer.java
@@ -515,6 +515,32 @@
     /** max number of incorporation rounds */
         static final int MAX_INCORPORATION_STEPS = 100;
 
+    /* If for two types t and s there is a least upper bound that is a
+     * parameterized type G, then there exists a supertype of 't' of the form
+     * G<T1, ..., Tn> and a supertype of 's' of the form G<S1, ..., Sn>
+     * which will be returned by this method. If no such supertypes exists then
+     * null is returned.
+     *
+     * As an example for the following input:
+     *
+     * t = java.util.ArrayList<java.lang.String>
+     * s = java.util.List<T>
+     *
+     * we get this ouput:
+     *
+     * Pair[java.util.List<java.lang.String>,java.util.List<T>]
+     */
+    private Pair<Type, Type> getParameterizedSupers(Type t, Type s) {
+        Type lubResult = types.lub(t, s);
+        if (lubResult == syms.errType || lubResult == syms.botType ||
+                !lubResult.isParameterized()) {
+            return null;
+        }
+        Type asSuperOfT = types.asSuper(t, lubResult.tsym);
+        Type asSuperOfS = types.asSuper(s, lubResult.tsym);
+        return new Pair<>(asSuperOfT, asSuperOfS);
+    }
+
     /**
      * This enumeration defines an entry point for doing inference variable
      * bound incorporation - it can be used to inject custom incorporation
@@ -682,6 +708,53 @@
             }
         },
         /**
+         * Given a bound set containing {@code alpha <: P<T>} and
+         * {@code alpha <: P<S>} where P is a parameterized type,
+         * perform {@code T = S} (which could lead to new bounds).
+         */
+        CROSS_UPPER_UPPER() {
+            @Override
+            public void apply(UndetVar uv, InferenceContext inferenceContext, Warner warn) {
+                Infer infer = inferenceContext.infer();
+                List<Type> boundList = uv.getBounds(InferenceBound.UPPER);
+                List<Type> boundListTail = boundList.tail;
+                while (boundList.nonEmpty()) {
+                    List<Type> tmpTail = boundListTail;
+                    while (tmpTail.nonEmpty()) {
+                        Type b1 = boundList.head;
+                        Type b2 = tmpTail.head;
+                        if (b1 != b2) {
+                            Pair<Type, Type> commonSupers = infer.getParameterizedSupers(b1, b2);
+                            if (commonSupers != null) {
+                                List<Type> allParamsSuperBound1 = commonSupers.fst.allparams();
+                                List<Type> allParamsSuperBound2 = commonSupers.snd.allparams();
+                                while (allParamsSuperBound1.nonEmpty() && allParamsSuperBound2.nonEmpty()) {
+                                    //traverse the list of all params comparing them
+                                    if (!allParamsSuperBound1.head.hasTag(WILDCARD) &&
+                                        !allParamsSuperBound2.head.hasTag(WILDCARD)) {
+                                        isSameType(inferenceContext.asUndetVar(allParamsSuperBound1.head),
+                                            inferenceContext.asUndetVar(allParamsSuperBound2.head), infer);
+                                    }
+                                    allParamsSuperBound1 = allParamsSuperBound1.tail;
+                                    allParamsSuperBound2 = allParamsSuperBound2.tail;
+                                }
+                                Assert.check(allParamsSuperBound1.isEmpty() && allParamsSuperBound2.isEmpty());
+                            }
+                        }
+                        tmpTail = tmpTail.tail;
+                    }
+                    boundList = boundList.tail;
+                    boundListTail = boundList.tail;
+                }
+            }
+
+            @Override
+            boolean accepts(UndetVar uv, InferenceContext inferenceContext) {
+                return !uv.isCaptured() &&
+                        uv.getBounds(InferenceBound.UPPER).nonEmpty();
+            }
+        },
+        /**
          * Given a bound set containing {@code alpha == S} and {@code alpha == T}
          * perform {@code S == T} (which could lead to new bounds).
          */
diff --git a/langtools/src/share/classes/com/sun/tools/javac/comp/Lower.java b/langtools/src/share/classes/com/sun/tools/javac/comp/Lower.java
index 31f5095..269fd19 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Lower.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Lower.java
@@ -2359,6 +2359,7 @@
     /** Visitor method: Translate a single node.
      *  Attach the source position from the old tree to its replacement tree.
      */
+    @Override
     public <T extends JCTree> T translate(T tree) {
         if (tree == null) {
             return null;
@@ -2407,39 +2408,39 @@
         return trees;
     }
 
-    public void visitTopLevel(JCCompilationUnit tree) {
-        if (needPackageInfoClass(tree)) {
-            Name name = names.package_info;
-            long flags = Flags.ABSTRACT | Flags.INTERFACE;
-            if (target.isPackageInfoSynthetic())
-                // package-info is marked SYNTHETIC in JDK 1.6 and later releases
-                flags = flags | Flags.SYNTHETIC;
-            JCClassDecl packageAnnotationsClass
-                = make.ClassDef(make.Modifiers(flags,
-                                               tree.packageAnnotations),
-                                name, List.<JCTypeParameter>nil(),
-                                null, List.<JCExpression>nil(), List.<JCTree>nil());
-            ClassSymbol c = tree.packge.package_info;
-            c.flags_field |= flags;
-            c.setAttributes(tree.packge);
-            ClassType ctype = (ClassType) c.type;
-            ctype.supertype_field = syms.objectType;
-            ctype.interfaces_field = List.nil();
-            packageAnnotationsClass.sym = c;
+    public void visitPackageDef(JCPackageDecl tree) {
+        if (!needPackageInfoClass(tree))
+            return;
 
-            translated.append(packageAnnotationsClass);
-        }
+        Name name = names.package_info;
+        long flags = Flags.ABSTRACT | Flags.INTERFACE;
+        if (target.isPackageInfoSynthetic())
+            // package-info is marked SYNTHETIC in JDK 1.6 and later releases
+            flags = flags | Flags.SYNTHETIC;
+        JCClassDecl packageAnnotationsClass
+            = make.ClassDef(make.Modifiers(flags, tree.getAnnotations()),
+                            name, List.<JCTypeParameter>nil(),
+                            null, List.<JCExpression>nil(), List.<JCTree>nil());
+        ClassSymbol c = tree.packge.package_info;
+        c.flags_field |= flags;
+        c.setAttributes(tree.packge);
+        ClassType ctype = (ClassType) c.type;
+        ctype.supertype_field = syms.objectType;
+        ctype.interfaces_field = List.nil();
+        packageAnnotationsClass.sym = c;
+
+        translated.append(packageAnnotationsClass);
     }
     // where
-    private boolean needPackageInfoClass(JCCompilationUnit tree) {
+    private boolean needPackageInfoClass(JCPackageDecl pd) {
         switch (pkginfoOpt) {
             case ALWAYS:
                 return true;
             case LEGACY:
-                return tree.packageAnnotations.nonEmpty();
+                return pd.getAnnotations().nonEmpty();
             case NONEMPTY:
                 for (Attribute.Compound a :
-                         tree.packge.getDeclarationAttributes()) {
+                         pd.packge.getDeclarationAttributes()) {
                     Attribute.RetentionPolicy p = types.getRetention(a);
                     if (p != Attribute.RetentionPolicy.SOURCE)
                         return true;
diff --git a/langtools/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java b/langtools/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java
index 3e002c7..ffecda1 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java
@@ -493,10 +493,26 @@
             return;
         }
 
+        DiagnosticPosition prevLintPos = deferredLintHandler.immediate();
+        Lint prevLint = chk.setLint(lint);
+
+        try {
+            // Import-on-demand java.lang.
+            importAll(tree.pos, syms.enterPackage(names.java_lang), env);
+
+            // Process the package def and all import clauses.
+            memberEnter(tree.defs, env);
+        } finally {
+            chk.setLint(prevLint);
+            deferredLintHandler.setPos(prevLintPos);
+        }
+    }
+
+    public void visitPackageDef(JCPackageDecl tree) {
         // check that no class exists with same fully qualified name as
         // toplevel package
         if (checkClash && tree.pid != null) {
-            Symbol p = tree.packge;
+            Symbol p = env.toplevel.packge;
             while (p.owner != syms.rootPackage) {
                 p.owner.complete(); // enter all class members of p
                 if (syms.classes.get(p.getQualifiedName()) != null) {
@@ -507,23 +523,8 @@
                 p = p.owner;
             }
         }
-
         // process package annotations
-        annotate.annotateLater(tree.packageAnnotations, env, tree.packge, null);
-
-        DiagnosticPosition prevLintPos = deferredLintHandler.immediate();
-        Lint prevLint = chk.setLint(lint);
-
-        try {
-            // Import-on-demand java.lang.
-            importAll(tree.pos, syms.enterPackage(names.java_lang), env);
-
-            // Process all import clauses.
-            memberEnter(tree.defs, env);
-        } finally {
-            chk.setLint(prevLint);
-            deferredLintHandler.setPos(prevLintPos);
-        }
+        annotate.annotateLater(tree.annotations, env, env.toplevel.packge, null);
     }
 
     // process the non-static imports and the static imports of types.
diff --git a/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java b/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java
index 85417c0..87bddd8 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java
@@ -475,14 +475,14 @@
             break;
         case CONSTANT_Fieldref: {
             ClassSymbol owner = readClassSymbol(getChar(index + 1));
-            NameAndType nt = (NameAndType)readPool(getChar(index + 3));
+            NameAndType nt = readNameAndType(getChar(index + 3));
             poolObj[i] = new VarSymbol(0, nt.name, nt.uniqueType.type, owner);
             break;
         }
         case CONSTANT_Methodref:
         case CONSTANT_InterfaceMethodref: {
             ClassSymbol owner = readClassSymbol(getChar(index + 1));
-            NameAndType nt = (NameAndType)readPool(getChar(index + 3));
+            NameAndType nt = readNameAndType(getChar(index + 3));
             poolObj[i] = new MethodSymbol(0, nt.name, nt.uniqueType.type, owner);
             break;
         }
@@ -551,13 +551,34 @@
     /** Read class entry.
      */
     ClassSymbol readClassSymbol(int i) {
-        return (ClassSymbol) (readPool(i));
+        Object obj = readPool(i);
+        if (obj != null && !(obj instanceof ClassSymbol))
+            throw badClassFile("bad.const.pool.entry",
+                               currentClassFile.toString(),
+                               "CONSTANT_Class_info", i);
+        return (ClassSymbol)obj;
     }
 
     /** Read name.
      */
     Name readName(int i) {
-        return (Name) (readPool(i));
+        Object obj = readPool(i);
+        if (obj != null && !(obj instanceof Name))
+            throw badClassFile("bad.const.pool.entry",
+                               currentClassFile.toString(),
+                               "CONSTANT_Utf8_info or CONSTANT_String_info", i);
+        return (Name)obj;
+    }
+
+    /** Read name and type.
+     */
+    NameAndType readNameAndType(int i) {
+        Object obj = readPool(i);
+        if (obj != null && !(obj instanceof NameAndType))
+            throw badClassFile("bad.const.pool.entry",
+                               currentClassFile.toString(),
+                               "CONSTANT_NameAndType_info", i);
+        return (NameAndType)obj;
     }
 
 /************************************************************************
@@ -1209,7 +1230,7 @@
         sym.owner.members().remove(sym);
         ClassSymbol self = (ClassSymbol)sym;
         ClassSymbol c = readClassSymbol(nextChar());
-        NameAndType nt = (NameAndType)readPool(nextChar());
+        NameAndType nt = readNameAndType(nextChar());
 
         if (c.members_field == null)
             throw badClassFile("bad.enclosing.class", self, c);
diff --git a/langtools/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java b/langtools/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java
index 18db5cf..9088309 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java
@@ -601,8 +601,7 @@
      */
     protected JCCompilationUnit parse(JavaFileObject filename, CharSequence content) {
         long msec = now();
-        JCCompilationUnit tree = make.TopLevel(List.<JCTree.JCAnnotation>nil(),
-                                      null, List.<JCTree>nil());
+        JCCompilationUnit tree = make.TopLevel(List.<JCTree>nil());
         if (content != null) {
             if (verbose) {
                 log.printVerbose("parsing.started", filename);
@@ -689,7 +688,7 @@
                                       : make.Select(tree, names.fromString(s));
             }
             JCCompilationUnit toplevel =
-                make.TopLevel(List.<JCTree.JCAnnotation>nil(), null, List.<JCTree>nil());
+                make.TopLevel(List.<JCTree>nil());
             toplevel.packge = syms.unnamedPackage;
             return attr.attribIdent(tree, toplevel);
         } finally {
@@ -768,7 +767,7 @@
                 tree = parse(filename, filename.getCharContent(false));
             } catch (IOException e) {
                 log.error("error.reading.file", filename, JavacFileManager.getMessage(e));
-                tree = make.TopLevel(List.<JCTree.JCAnnotation>nil(), null, List.<JCTree>nil());
+                tree = make.TopLevel(List.<JCTree>nil());
             } finally {
                 log.useSource(prev);
             }
@@ -1440,7 +1439,7 @@
             make.at(Position.FIRSTPOS);
             TreeMaker localMake = make.forToplevel(env.toplevel);
 
-            if (env.tree instanceof JCCompilationUnit) {
+            if (env.tree.hasTag(JCTree.Tag.PACKAGEDEF)) {
                 if (!(stubOutput || sourceOutput || printFlat)) {
                     if (shouldStop(CompileState.LOWER))
                         return;
diff --git a/langtools/src/share/classes/com/sun/tools/javac/model/JavacElements.java b/langtools/src/share/classes/com/sun/tools/javac/model/JavacElements.java
index dbe7bb5..f04fb38 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/model/JavacElements.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/model/JavacElements.java
@@ -170,8 +170,8 @@
         Symbol sym = cast(Symbol.class, e);
         class Vis extends JCTree.Visitor {
             List<JCAnnotation> result = null;
-            public void visitTopLevel(JCCompilationUnit tree) {
-                result = tree.packageAnnotations;
+            public void visitPackageDef(JCPackageDecl tree) {
+                result = tree.annotations;
             }
             public void visitClassDef(JCClassDecl tree) {
                 result = tree.mods.annotations;
diff --git a/langtools/src/share/classes/com/sun/tools/javac/parser/JavacParser.java b/langtools/src/share/classes/com/sun/tools/javac/parser/JavacParser.java
index c8a26f3..52c1841 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/parser/JavacParser.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/parser/JavacParser.java
@@ -3081,27 +3081,33 @@
      */
     public JCTree.JCCompilationUnit parseCompilationUnit() {
         Token firstToken = token;
-        JCExpression pid = null;
         JCModifiers mods = null;
         boolean consumedToplevelDoc = false;
         boolean seenImport = false;
         boolean seenPackage = false;
-        List<JCAnnotation> packageAnnotations = List.nil();
+        ListBuffer<JCTree> defs = new ListBuffer<>();
         if (token.kind == MONKEYS_AT)
             mods = modifiersOpt();
 
         if (token.kind == PACKAGE) {
+            int packagePos = token.pos;
+            List<JCAnnotation> annotations = List.nil();
             seenPackage = true;
             if (mods != null) {
                 checkNoMods(mods.flags);
-                packageAnnotations = mods.annotations;
+                annotations = mods.annotations;
                 mods = null;
             }
             nextToken();
-            pid = qualident(false);
+            JCExpression pid = qualident(false);
             accept(SEMI);
+            JCPackageDecl pd = F.at(packagePos).PackageDecl(annotations, pid);
+            attach(pd, firstToken.comment(CommentStyle.JAVADOC));
+            consumedToplevelDoc = true;
+            storeEnd(pd, token.pos);
+            defs.append(pd);
         }
-        ListBuffer<JCTree> defs = new ListBuffer<>();
+
         boolean checkForImports = true;
         boolean firstTypeDecl = true;
         while (token.kind != EOF) {
@@ -3130,7 +3136,7 @@
                 firstTypeDecl = false;
             }
         }
-        JCTree.JCCompilationUnit toplevel = F.at(firstToken.pos).TopLevel(packageAnnotations, pid, defs.toList());
+        JCTree.JCCompilationUnit toplevel = F.at(firstToken.pos).TopLevel(defs.toList());
         if (!consumedToplevelDoc)
             attach(toplevel, firstToken.comment(CommentStyle.JAVADOC));
         if (defs.isEmpty())
@@ -3417,16 +3423,28 @@
      *    | ModifiersOpt
      *      ( Type Ident
      *        ( VariableDeclaratorsRest ";" | MethodDeclaratorRest )
-     *      | VOID Ident MethodDeclaratorRest
-     *      | TypeParameters (Type | VOID) Ident MethodDeclaratorRest
+     *      | VOID Ident VoidMethodDeclaratorRest
+     *      | TypeParameters [Annotations]
+     *        ( Type Ident MethodDeclaratorRest
+     *        | VOID Ident VoidMethodDeclaratorRest
+     *        )
      *      | Ident ConstructorDeclaratorRest
      *      | TypeParameters Ident ConstructorDeclaratorRest
      *      | ClassOrInterfaceOrEnumDeclaration
      *      )
      *  InterfaceBodyDeclaration =
      *      ";"
-     *    | ModifiersOpt Type Ident
-     *      ( ConstantDeclaratorsRest | InterfaceMethodDeclaratorRest ";" )
+     *    | ModifiersOpt
+     *      ( Type Ident
+     *        ( ConstantDeclaratorsRest ";" | MethodDeclaratorRest )
+     *      | VOID Ident MethodDeclaratorRest
+     *      | TypeParameters [Annotations]
+     *        ( Type Ident MethodDeclaratorRest
+     *        | VOID Ident VoidMethodDeclaratorRest
+     *        )
+     *      | ClassOrInterfaceOrEnumDeclaration
+     *      )
+     *
      */
     protected List<JCTree> classOrInterfaceBodyDeclaration(Name className, boolean isInterface) {
         if (token.kind == SEMI) {
@@ -3458,28 +3476,29 @@
                 }
                 List<JCAnnotation> annosAfterParams = annotationsOpt(Tag.ANNOTATION);
 
+                if (annosAfterParams.nonEmpty()) {
+                    checkAnnotationsAfterTypeParams(annosAfterParams.head.pos);
+                    mods.annotations = mods.annotations.appendList(annosAfterParams);
+                    if (mods.pos == Position.NOPOS)
+                        mods.pos = mods.annotations.head.pos;
+                }
+
                 Token tk = token;
                 pos = token.pos;
                 JCExpression type;
                 boolean isVoid = token.kind == VOID;
                 if (isVoid) {
-                    if (annosAfterParams.nonEmpty())
-                        illegal(annosAfterParams.head.pos);
                     type = to(F.at(pos).TypeIdent(TypeTag.VOID));
                     nextToken();
                 } else {
-                    if (annosAfterParams.nonEmpty()) {
-                        checkAnnotationsAfterTypeParams(annosAfterParams.head.pos);
-                        mods.annotations = mods.annotations.appendList(annosAfterParams);
-                        if (mods.pos == Position.NOPOS)
-                            mods.pos = mods.annotations.head.pos;
-                    }
                     // method returns types are un-annotated types
                     type = unannotatedType();
                 }
                 if (token.kind == LPAREN && !isInterface && type.hasTag(IDENT)) {
                     if (isInterface || tk.name() != className)
                         error(pos, "invalid.meth.decl.ret.type.req");
+                    else if (annosAfterParams.nonEmpty())
+                        illegal(annosAfterParams.head.pos);
                     return List.of(methodDeclaratorRest(
                         pos, mods, null, names.init, typarams,
                         isInterface, true, dc));
@@ -3511,13 +3530,9 @@
     }
 
     /** MethodDeclaratorRest =
-     *      FormalParameters BracketsOpt [Throws TypeList] ( MethodBody | [DEFAULT AnnotationValue] ";")
+     *      FormalParameters BracketsOpt [THROWS TypeList] ( MethodBody | [DEFAULT AnnotationValue] ";")
      *  VoidMethodDeclaratorRest =
-     *      FormalParameters [Throws TypeList] ( MethodBody | ";")
-     *  InterfaceMethodDeclaratorRest =
-     *      FormalParameters BracketsOpt [THROWS TypeList] ";"
-     *  VoidInterfaceMethodDeclaratorRest =
-     *      FormalParameters [THROWS TypeList] ";"
+     *      FormalParameters [THROWS TypeList] ( MethodBody | ";")
      *  ConstructorDeclaratorRest =
      *      "(" FormalParameterListOpt ")" [THROWS TypeList] MethodBody
      */
diff --git a/langtools/src/share/classes/com/sun/tools/javac/resources/compiler.properties b/langtools/src/share/classes/com/sun/tools/javac/resources/compiler.properties
index 8f792bd..e8417df 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/resources/compiler.properties
+++ b/langtools/src/share/classes/com/sun/tools/javac/resources/compiler.properties
@@ -738,6 +738,9 @@
     bad return type in method reference\n\
     {0}
 
+compiler.err.lambda.body.neither.value.nor.void.compatible=\
+    lambda body is neither value nor void compatible
+
 # 0: list of type
 compiler.err.incompatible.thrown.types.in.mref=\
     incompatible thrown types {0} in method reference
@@ -1716,6 +1719,11 @@
 compiler.misc.bad.class.file=\
     class file is invalid for class {0}
 
+# 0: file name, 1: expected CP entry type, 2: constant pool index
+compiler.misc.bad.const.pool.entry=\
+    bad constant pool entry in {0}\n\
+    expected {1} at index {2}
+
 # 0: file name, 1: message segment
 compiler.misc.bad.class.file.header=\
     bad class file: {0}\n\
diff --git a/langtools/src/share/classes/com/sun/tools/javac/tree/JCTree.java b/langtools/src/share/classes/com/sun/tools/javac/tree/JCTree.java
index 10eae9f..441264b 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/tree/JCTree.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/tree/JCTree.java
@@ -89,6 +89,10 @@
         */
         TOPLEVEL,
 
+        /** Package level definitions.
+         */
+        PACKAGEDEF,
+
         /** Import clauses, of type Import.
          */
         IMPORT,
@@ -478,9 +482,6 @@
      * Everything in one source file is kept in a {@linkplain JCCompilationUnit} structure.
      */
     public static class JCCompilationUnit extends JCTree implements CompilationUnitTree {
-        public List<JCAnnotation> packageAnnotations;
-        /** The tree representing the package clause. */
-        public JCExpression pid;
         /** All definitions in this file (ClassDef, Import, and Skip) */
         public List<JCTree> defs;
         /* The source file name. */
@@ -499,39 +500,39 @@
         /* An object encapsulating ending positions of source ranges indexed by
          * the tree nodes they belong to. Defined only if option -Xjcov is set. */
         public EndPosTable endPositions = null;
-        protected JCCompilationUnit(List<JCAnnotation> packageAnnotations,
-                        JCExpression pid,
-                        List<JCTree> defs,
-                        JavaFileObject sourcefile,
-                        PackageSymbol packge,
-                        ImportScope namedImportScope,
-                        StarImportScope starImportScope) {
-            this.packageAnnotations = packageAnnotations;
-            this.pid = pid;
+        protected JCCompilationUnit(List<JCTree> defs) {
             this.defs = defs;
-            this.sourcefile = sourcefile;
-            this.packge = packge;
-            this.namedImportScope = namedImportScope;
-            this.starImportScope = starImportScope;
         }
         @Override
         public void accept(Visitor v) { v.visitTopLevel(this); }
 
         public Kind getKind() { return Kind.COMPILATION_UNIT; }
-        public List<JCAnnotation> getPackageAnnotations() {
-            return packageAnnotations;
+
+        public JCPackageDecl getPackage() {
+            // PackageDecl must be the first entry if it exists
+            if (!defs.isEmpty() && defs.head.hasTag(PACKAGEDEF))
+                return (JCPackageDecl)defs.head;
+            return null;
         }
+        public List<JCAnnotation> getPackageAnnotations() {
+            JCPackageDecl pd = getPackage();
+            return pd != null ? pd.getAnnotations() : List.<JCAnnotation>nil();
+        }
+        public ExpressionTree getPackageName() {
+            JCPackageDecl pd = getPackage();
+            return pd != null ? pd.getPackageName() : null;
+        }
+
         public List<JCImport> getImports() {
             ListBuffer<JCImport> imports = new ListBuffer<>();
             for (JCTree tree : defs) {
                 if (tree.hasTag(IMPORT))
                     imports.append((JCImport)tree);
-                else if (!tree.hasTag(SKIP))
+                else if (!tree.hasTag(PACKAGEDEF) && !tree.hasTag(SKIP))
                     break;
             }
             return imports.toList();
         }
-        public JCExpression getPackageName() { return pid; }
         public JavaFileObject getSourceFile() {
             return sourcefile;
         }
@@ -541,7 +542,7 @@
         public List<JCTree> getTypeDecls() {
             List<JCTree> typeDefs;
             for (typeDefs = defs; !typeDefs.isEmpty(); typeDefs = typeDefs.tail)
-                if (!typeDefs.head.hasTag(IMPORT))
+                if (!typeDefs.head.hasTag(PACKAGEDEF) && !typeDefs.head.hasTag(IMPORT))
                     break;
             return typeDefs;
         }
@@ -557,6 +558,39 @@
     }
 
     /**
+     * Package definition.
+     */
+    public static class JCPackageDecl extends JCTree implements PackageTree {
+        public List<JCAnnotation> annotations;
+        /** The tree representing the package clause. */
+        public JCExpression pid;
+        public PackageSymbol packge;
+        public JCPackageDecl(List<JCAnnotation> annotations, JCExpression pid) {
+            this.annotations = annotations;
+            this.pid = pid;
+        }
+        @Override
+        public void accept(Visitor v) { v.visitPackageDef(this); }
+        public Kind getKind() {
+            return Kind.PACKAGE;
+        }
+        public List<JCAnnotation> getAnnotations() {
+            return annotations;
+        }
+        public JCExpression getPackageName() {
+            return pid;
+        }
+        @Override
+        public <R,D> R accept(TreeVisitor<R,D> v, D d) {
+            return v.visitPackage(this, d);
+        }
+        @Override
+        public Tag getTag() {
+            return PACKAGEDEF;
+        }
+    }
+
+    /**
      * An import clause.
      */
     public static class JCImport extends JCTree implements ImportTree {
@@ -2438,9 +2472,9 @@
     /** An interface for tree factories
      */
     public interface Factory {
-        JCCompilationUnit TopLevel(List<JCAnnotation> packageAnnotations,
-                                   JCExpression pid,
-                                   List<JCTree> defs);
+        JCCompilationUnit TopLevel(List<JCTree> defs);
+        JCPackageDecl PackageDecl(List<JCAnnotation> annotations,
+                                  JCExpression pid);
         JCImport Import(JCTree qualid, boolean staticImport);
         JCClassDecl ClassDef(JCModifiers mods,
                           Name name,
@@ -2528,6 +2562,7 @@
      */
     public static abstract class Visitor {
         public void visitTopLevel(JCCompilationUnit that)    { visitTree(that); }
+        public void visitPackageDef(JCPackageDecl that)      { visitTree(that); }
         public void visitImport(JCImport that)               { visitTree(that); }
         public void visitClassDef(JCClassDecl that)          { visitTree(that); }
         public void visitMethodDef(JCMethodDecl that)        { visitTree(that); }
diff --git a/langtools/src/share/classes/com/sun/tools/javac/tree/Pretty.java b/langtools/src/share/classes/com/sun/tools/javac/tree/Pretty.java
index 9076ce4..15d9ca5 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/tree/Pretty.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/tree/Pretty.java
@@ -367,16 +367,13 @@
     public void printUnit(JCCompilationUnit tree, JCClassDecl cdef) throws IOException {
         docComments = tree.docComments;
         printDocComment(tree);
-        if (tree.pid != null) {
-            print("package ");
-            printExpr(tree.pid);
-            print(";");
-            println();
-        }
+
         boolean firstImport = true;
         for (List<JCTree> l = tree.defs;
-        l.nonEmpty() && (cdef == null || l.head.hasTag(IMPORT));
-        l = l.tail) {
+             l.nonEmpty() &&
+                 (cdef == null ||
+                  l.head.hasTag(IMPORT) || l.head.hasTag(PACKAGEDEF));
+             l = l.tail) {
             if (l.head.hasTag(IMPORT)) {
                 JCImport imp = (JCImport)l.head;
                 Name name = TreeInfo.name(imp.qualid);
@@ -426,6 +423,21 @@
         }
     }
 
+    public void visitPackageDef(JCPackageDecl tree) {
+        try {
+            printDocComment(tree);
+            printAnnotations(tree.annotations);
+            if (tree.pid != null) {
+                print("package ");
+                printExpr(tree.pid);
+                print(";");
+                println();
+            }
+        } catch (IOException e) {
+            throw new UncheckedIOException(e);
+        }
+    }
+
     public void visitImport(JCImport tree) {
         try {
             print("import ");
diff --git a/langtools/src/share/classes/com/sun/tools/javac/tree/TreeCopier.java b/langtools/src/share/classes/com/sun/tools/javac/tree/TreeCopier.java
index c2e2e00..b9bd7b0 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/tree/TreeCopier.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/tree/TreeCopier.java
@@ -346,10 +346,15 @@
 
     public JCTree visitCompilationUnit(CompilationUnitTree node, P p) {
         JCCompilationUnit t = (JCCompilationUnit) node;
-        List<JCAnnotation> packageAnnotations = copy(t.packageAnnotations, p);
-        JCExpression pid = copy(t.pid, p);
         List<JCTree> defs = copy(t.defs, p);
-        return M.at(t.pos).TopLevel(packageAnnotations, pid, defs);
+        return M.at(t.pos).TopLevel(defs);
+    }
+
+    public JCTree visitPackage(PackageTree node, P p) {
+        JCPackageDecl t = (JCPackageDecl) node;
+        List<JCAnnotation> annotations = copy(t.annotations, p);
+        JCExpression pid = copy(t.pid, p);
+        return M.at(t.pos).PackageDecl(annotations, pid);
     }
 
     public JCTree visitTry(TryTree node, P p) {
diff --git a/langtools/src/share/classes/com/sun/tools/javac/tree/TreeInfo.java b/langtools/src/share/classes/com/sun/tools/javac/tree/TreeInfo.java
index 8299b71..9f81798 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/tree/TreeInfo.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/tree/TreeInfo.java
@@ -406,6 +406,11 @@
             return Position.NOPOS;
 
         switch(tree.getTag()) {
+            case PACKAGEDEF: {
+                JCPackageDecl pd = (JCPackageDecl)tree;
+                return pd.annotations.isEmpty() ? pd.pos :
+                       pd.annotations.head.pos;
+            }
             case APPLY:
                 return getStartPos(((JCMethodInvocation) tree).meth);
             case ASSIGN:
@@ -788,6 +793,8 @@
         switch (node.getTag()) {
         case TOPLEVEL:
             return ((JCCompilationUnit) node).packge;
+        case PACKAGEDEF:
+            return ((JCPackageDecl) node).packge;
         case CLASSDEF:
             return ((JCClassDecl) node).sym;
         case METHODDEF:
@@ -820,6 +827,7 @@
     public static boolean isDeclaration(JCTree node) {
         node = skipParens(node);
         switch (node.getTag()) {
+        case PACKAGEDEF:
         case CLASSDEF:
         case METHODDEF:
         case VARDEF:
diff --git a/langtools/src/share/classes/com/sun/tools/javac/tree/TreeMaker.java b/langtools/src/share/classes/com/sun/tools/javac/tree/TreeMaker.java
index a27ead1..9178af7 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/tree/TreeMaker.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/tree/TreeMaker.java
@@ -116,22 +116,28 @@
 
     /**
      * Create given tree node at current position.
-     * @param defs a list of ClassDef, Import, and Skip
+     * @param defs a list of PackageDef, ClassDef, Import, and Skip
      */
-    public JCCompilationUnit TopLevel(List<JCAnnotation> packageAnnotations,
-                                      JCExpression pid,
-                                      List<JCTree> defs) {
-        Assert.checkNonNull(packageAnnotations);
+    public JCCompilationUnit TopLevel(List<JCTree> defs) {
         for (JCTree node : defs)
             Assert.check(node instanceof JCClassDecl
+                || node instanceof JCPackageDecl
                 || node instanceof JCImport
                 || node instanceof JCSkip
                 || node instanceof JCErroneous
                 || (node instanceof JCExpressionStatement
                     && ((JCExpressionStatement)node).expr instanceof JCErroneous),
                 node.getClass().getSimpleName());
-        JCCompilationUnit tree = new JCCompilationUnit(packageAnnotations, pid, defs,
-                                     null, null, null, null);
+        JCCompilationUnit tree = new JCCompilationUnit(defs);
+        tree.pos = pos;
+        return tree;
+    }
+
+    public JCPackageDecl PackageDecl(List<JCAnnotation> annotations,
+                                     JCExpression pid) {
+        Assert.checkNonNull(annotations);
+        Assert.checkNonNull(pid);
+        JCPackageDecl tree = new JCPackageDecl(annotations, pid);
         tree.pos = pos;
         return tree;
     }
diff --git a/langtools/src/share/classes/com/sun/tools/javac/tree/TreeScanner.java b/langtools/src/share/classes/com/sun/tools/javac/tree/TreeScanner.java
index 626f70a..2ef47d3 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/tree/TreeScanner.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/tree/TreeScanner.java
@@ -63,11 +63,14 @@
  ****************************************************************************/
 
     public void visitTopLevel(JCCompilationUnit tree) {
-        scan(tree.packageAnnotations);
-        scan(tree.pid);
         scan(tree.defs);
     }
 
+    public void visitPackageDef(JCPackageDecl tree) {
+        scan(tree.annotations);
+        scan(tree.pid);
+    }
+
     public void visitImport(JCImport tree) {
         scan(tree.qualid);
     }
diff --git a/langtools/src/share/classes/com/sun/tools/javac/tree/TreeTranslator.java b/langtools/src/share/classes/com/sun/tools/javac/tree/TreeTranslator.java
index b290ac8..67e50a0 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/tree/TreeTranslator.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/tree/TreeTranslator.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -56,9 +56,9 @@
             return null;
         } else {
             tree.accept(this);
-            JCTree result = this.result;
+            JCTree tmpResult = this.result;
             this.result = null;
-            return (T)result; // XXX cast
+            return (T)tmpResult; // XXX cast
         }
     }
 
@@ -116,11 +116,16 @@
  ****************************************************************************/
 
     public void visitTopLevel(JCCompilationUnit tree) {
-        tree.pid = translate(tree.pid);
         tree.defs = translate(tree.defs);
         result = tree;
     }
 
+    public void visitPackageDef(JCPackageDecl tree) {
+        tree.annotations = translate(tree.annotations);
+        tree.pid = translate(tree.pid);
+        result = tree;
+    }
+
     public void visitImport(JCImport tree) {
         tree.qualid = translate(tree.qualid);
         result = tree;
diff --git a/langtools/src/share/classes/com/sun/tools/javadoc/DocEnv.java b/langtools/src/share/classes/com/sun/tools/javadoc/DocEnv.java
index ef6f1a0..dfe014c 100644
--- a/langtools/src/share/classes/com/sun/tools/javadoc/DocEnv.java
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/DocEnv.java
@@ -743,6 +743,13 @@
         return p;
     }
 
+    TreePath getTreePath(JCCompilationUnit toplevel, JCPackageDecl tree) {
+        TreePath p = treePaths.get(tree);
+        if (p == null)
+            treePaths.put(tree, p = new TreePath(getTreePath(toplevel), tree));
+        return p;
+    }
+
     TreePath getTreePath(JCCompilationUnit toplevel, JCClassDecl tree) {
         TreePath p = treePaths.get(tree);
         if (p == null)
diff --git a/langtools/src/share/classes/com/sun/tools/javadoc/JavadocEnter.java b/langtools/src/share/classes/com/sun/tools/javadoc/JavadocEnter.java
index cc0f212..5215edc 100644
--- a/langtools/src/share/classes/com/sun/tools/javadoc/JavadocEnter.java
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/JavadocEnter.java
@@ -27,6 +27,7 @@
 
 import javax.tools.JavaFileObject;
 
+import com.sun.source.util.TreePath;
 import com.sun.tools.javac.code.Kinds;
 import com.sun.tools.javac.code.Symbol.*;
 import com.sun.tools.javac.comp.Enter;
@@ -84,7 +85,9 @@
     public void visitTopLevel(JCCompilationUnit tree) {
         super.visitTopLevel(tree);
         if (tree.sourcefile.isNameCompatible("package-info", JavaFileObject.Kind.SOURCE)) {
-            docenv.makePackageDoc(tree.packge, docenv.getTreePath(tree));
+            JCPackageDecl pd = tree.getPackage();
+            TreePath tp = pd == null ? docenv.getTreePath(tree) : docenv.getTreePath(tree, pd);
+            docenv.makePackageDoc(tree.packge, tp);
         }
     }
 
diff --git a/langtools/src/share/classes/com/sun/tools/sjavac/CleanProperties.java b/langtools/src/share/classes/com/sun/tools/sjavac/CleanProperties.java
index 4e9413d..346853c 100644
--- a/langtools/src/share/classes/com/sun/tools/sjavac/CleanProperties.java
+++ b/langtools/src/share/classes/com/sun/tools/sjavac/CleanProperties.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2013, 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
@@ -29,13 +29,14 @@
 import java.net.URI;
 import java.util.ArrayList;
 import java.util.Collections;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
 import java.util.HashSet;
 import java.util.Map;
 import java.util.Properties;
 
+import com.sun.tools.sjavac.options.Options;
+
 /**
  * The clean properties transform should not be necessary.
  * Eventually we will cleanup the property file sources in the OpenJDK instead.
@@ -51,7 +52,7 @@
         // Any extra information is ignored for clean properties.
     }
 
-    public void setExtra(String[] a) {
+    public void setExtra(Options a) {
         // Any extra information is ignored for clean properties.
     }
 
diff --git a/langtools/src/share/classes/com/sun/tools/sjavac/CompileJavaPackages.java b/langtools/src/share/classes/com/sun/tools/sjavac/CompileJavaPackages.java
index 6747c3f..f66e895 100644
--- a/langtools/src/share/classes/com/sun/tools/sjavac/CompileJavaPackages.java
+++ b/langtools/src/share/classes/com/sun/tools/sjavac/CompileJavaPackages.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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,15 +25,16 @@
 
 package com.sun.tools.sjavac;
 
+import java.io.PrintStream;
 import java.net.URI;
 import java.util.Arrays;
 import java.util.Random;
 import java.util.Set;
 import java.util.Map;
 
+import com.sun.tools.sjavac.options.Options;
 import com.sun.tools.sjavac.server.JavacServer;
 import com.sun.tools.sjavac.server.SysInfo;
-import java.io.PrintStream;
 
 /**
  * This transform compiles a set of packages containing Java sources.
@@ -54,13 +55,12 @@
     // We hope to improve this in the future.
     final static int limitOnConcurrency = 3;
 
-    String serverSettings;
+    Options args;
+
     public void setExtra(String e) {
-        serverSettings = e;
     }
 
-    String[] args;
-    public void setExtra(String[] a) {
+    public void setExtra(Options a) {
         args = a;
     }
 
@@ -82,14 +82,14 @@
         boolean concurrentCompiles = true;
 
         // Fetch the id.
-        String id = Util.extractStringOption("id", serverSettings);
+        String id = Util.extractStringOption("id", args.getServerConf());
         if (id == null || id.equals("")) {
             // No explicit id set. Create a random id so that the requests can be
             // grouped properly in the server.
             id = "id"+(((new Random()).nextLong())&Long.MAX_VALUE);
         }
         // Only keep portfile and sjavac settings..
-        String psServerSettings = Util.cleanSubOptions("--server:", Util.set("portfile","sjavac","background","keepalive"), serverSettings);
+        String psServerSettings = Util.cleanSubOptions(Util.set("portfile","sjavac","background","keepalive"), args.getServerConf());
 
         // Get maximum heap size from the server!
         SysInfo sysinfo = JavacServer.connectGetSysInfo(psServerSettings, out, err);
@@ -223,7 +223,7 @@
                 @Override
                 public void run() {
                                         rn[ii] = JavacServer.useServer(cleanedServerSettings,
-                                                           Main.removeWrapperArgs(args),
+                                                           args.prepJavacArgs(),
                                                                cc.srcs,
                                                            fvisible_sources,
                                                            fvisible_classes,
diff --git a/langtools/src/share/classes/com/sun/tools/sjavac/CompileProperties.java b/langtools/src/share/classes/com/sun/tools/sjavac/CompileProperties.java
index dadb0ce..48213c4 100644
--- a/langtools/src/share/classes/com/sun/tools/sjavac/CompileProperties.java
+++ b/langtools/src/share/classes/com/sun/tools/sjavac/CompileProperties.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -37,6 +37,8 @@
 import java.util.HashSet;
 import java.util.Map;
 
+import com.sun.tools.sjavac.options.Options;
+
 /**
  * Compile properties transform a properties file into a Java source file.
  * Java has built in support for reading properties from either a text file
@@ -58,7 +60,7 @@
         extra = e;
     }
 
-    public void setExtra(String[] a) {
+    public void setExtra(Options a) {
     }
 
     public boolean transform(Map<String,Set<URI>> pkgSrcs,
diff --git a/langtools/src/share/classes/com/sun/tools/sjavac/CopyFile.java b/langtools/src/share/classes/com/sun/tools/sjavac/CopyFile.java
index dd4bef2..a791ef0 100644
--- a/langtools/src/share/classes/com/sun/tools/sjavac/CopyFile.java
+++ b/langtools/src/share/classes/com/sun/tools/sjavac/CopyFile.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -31,6 +31,8 @@
 import java.util.HashSet;
 import java.util.Map;
 
+import com.sun.tools.sjavac.options.Options;
+
 /**
  * The copy file transform simply copies a matching file from -src to -d .
  * Such files are typically images, xml documents and other data files.
@@ -45,7 +47,7 @@
     public void setExtra(String e) {
     }
 
-    public void setExtra(String[] a) {
+    public void setExtra(Options a) {
     }
 
     public boolean transform(Map<String,Set<URI>> pkgSrcs,
diff --git a/langtools/src/share/classes/com/sun/tools/sjavac/JavacState.java b/langtools/src/share/classes/com/sun/tools/sjavac/JavacState.java
index c7dd842..1ec71c2 100644
--- a/langtools/src/share/classes/com/sun/tools/sjavac/JavacState.java
+++ b/langtools/src/share/classes/com/sun/tools/sjavac/JavacState.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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,6 +26,7 @@
 package com.sun.tools.sjavac;
 
 import java.io.*;
+import java.nio.file.Path;
 import java.util.Collections;
 import java.util.Date;
 import java.util.Set;
@@ -37,6 +38,9 @@
 import java.net.URI;
 import java.util.*;
 
+import com.sun.tools.sjavac.options.Options;
+import com.sun.tools.sjavac.options.SourceLocation;
+
 /**
  * The javac state class maintains the previous (prev) and the current (now)
  * build states and everything else that goes into the javac_state file.
@@ -117,25 +121,20 @@
     // It can also map from a jar file to the set of visible classes for that jar file.
     Map<URI,Set<String>> visibleClasses;
 
-    // Setup two transforms that always exist.
-    private CopyFile            copyFiles = new CopyFile();
+    // Setup transform that always exist.
     private CompileJavaPackages compileJavaPackages = new CompileJavaPackages();
 
     // Where to send stdout and stderr.
     private PrintStream out, err;
 
-    JavacState(String[] args, File bd, File gd, File hd, boolean permitUnidentifiedArtifacts, boolean removeJavacState,
-            PrintStream o, PrintStream e) {
+    JavacState(Options options, boolean removeJavacState, PrintStream o, PrintStream e) {
         out = o;
         err = e;
-        numCores = Main.findNumberOption(args, "-j");
-        theArgs = "";
-        for (String a : removeArgsNotAffectingState(args)) {
-            theArgs = theArgs+a+" ";
-        }
-        binDir = bd;
-        gensrcDir = gd;
-        headerDir = hd;
+        numCores = options.getNumCores();
+        theArgs = options.getStateArgsString();
+        binDir = Util.pathToFile(options.getDestDir());
+        gensrcDir = Util.pathToFile(options.getGenSrcDir());
+        headerDir = Util.pathToFile(options.getHeaderDir());
         javacStateFilename = binDir.getPath()+File.separator+"javac_state";
         javacState = new File(javacStateFilename);
         if (removeJavacState && javacState.exists()) {
@@ -148,7 +147,7 @@
             // We do not want to risk building a broken incremental build.
             // BUT since the makefiles still copy things straight into the bin_dir et al,
             // we avoid deleting files here, if the option --permit-unidentified-classes was supplied.
-            if (!permitUnidentifiedArtifacts) {
+            if (!options.isUnidentifiedArtifactPermitted()) {
                 deleteContents(binDir);
                 deleteContents(gensrcDir);
                 deleteContents(headerDir);
@@ -301,9 +300,8 @@
     /**
      * Load a javac_state file.
      */
-    public static JavacState load(String[] args, File binDir, File gensrcDir, File headerDir,
-            boolean permitUnidentifiedArtifacts, PrintStream out, PrintStream err) {
-        JavacState db = new JavacState(args, binDir, gensrcDir, headerDir, permitUnidentifiedArtifacts, false, out, err);
+    public static JavacState load(Options options, PrintStream out, PrintStream err) {
+        JavacState db = new JavacState(options, false, out, err);
         Module  lastModule = null;
         Package lastPackage = null;
         Source  lastSource = null;
@@ -370,22 +368,22 @@
             noFileFound = true;
         } catch (IOException e) {
             Log.info("Dropping old javac_state because of errors when reading it.");
-            db = new JavacState(args, binDir, gensrcDir, headerDir, permitUnidentifiedArtifacts, true, out, err);
+            db = new JavacState(options, true, out, err);
             foundCorrectVerNr = true;
             newCommandLine = false;
             syntaxError = false;
     }
         if (foundCorrectVerNr == false && !noFileFound) {
             Log.info("Dropping old javac_state since it is of an old version.");
-            db = new JavacState(args, binDir, gensrcDir, headerDir, permitUnidentifiedArtifacts, true, out, err);
+            db = new JavacState(options, true, out, err);
         } else
         if (newCommandLine == true && !noFileFound) {
             Log.info("Dropping old javac_state since a new command line is used!");
-            db = new JavacState(args, binDir, gensrcDir, headerDir, permitUnidentifiedArtifacts, true, out, err);
+            db = new JavacState(options, true, out, err);
         } else
         if (syntaxError == true) {
             Log.info("Dropping old javac_state since it contains syntax errors.");
-            db = new JavacState(args, binDir, gensrcDir, headerDir, permitUnidentifiedArtifacts, true, out, err);
+            db = new JavacState(options, true, out, err);
         }
         db.prev.calculateDependents();
         return db;
@@ -467,12 +465,6 @@
         return sr;
     }
 
-    /**
-     * Acquire the copying transform.
-     */
-    public Transformer getCopier() {
-        return copyFiles;
-    }
 
     /**
      * If artifacts have gone missing, force a recompile of the packages
@@ -629,7 +621,7 @@
     public void performCopying(File binDir, Map<String,Transformer> suffixRules) {
         Map<String,Transformer> sr = new HashMap<>();
         for (Map.Entry<String,Transformer> e : suffixRules.entrySet()) {
-            if (e.getValue() == copyFiles) {
+            if (e.getValue().getClass().equals(CopyFile.class)) {
                 sr.put(e.getKey(), e.getValue());
             }
         }
@@ -643,10 +635,11 @@
     public void performTranslation(File gensrcDir, Map<String,Transformer> suffixRules) {
         Map<String,Transformer> sr = new HashMap<>();
         for (Map.Entry<String,Transformer> e : suffixRules.entrySet()) {
-            if (e.getValue() != copyFiles &&
-                e.getValue() != compileJavaPackages) {
-                sr.put(e.getKey(), e.getValue());
-            }
+            Class<?> trClass = e.getValue().getClass();
+            if (trClass == CompileJavaPackages.class || trClass == CopyFile.class)
+                continue;
+
+            sr.put(e.getKey(), e.getValue());
         }
         perform(gensrcDir, sr);
     }
@@ -654,14 +647,11 @@
     /**
      * Compile all the java sources. Return true, if it needs to be called again!
      */
-    public boolean performJavaCompilations(File binDir,
-                                           String serverSettings,
-                                           String[] args,
+    public boolean performJavaCompilations(Options args,
                                            Set<String> recentlyCompiled,
                                            boolean[] rcValue) {
         Map<String,Transformer> suffixRules = new HashMap<>();
         suffixRules.put(".java", compileJavaPackages);
-        compileJavaPackages.setExtra(serverSettings);
         compileJavaPackages.setExtra(args);
 
         rcValue[0] = perform(binDir, suffixRules);
@@ -813,7 +803,10 @@
         for (Source s : now.sources().values()) {
             // Don't include link only sources when comparing sources to compile
             if (!s.isLinkedOnly()) {
-                calculatedSources.add(s.file().getPath());
+                String path = s.file().getPath();
+                if (mightNeedRewriting)
+                    path = Util.normalizeDriveLetter(path);
+                calculatedSources.add(path);
             }
         }
         // Read in the file and create another set of filenames with full paths.
diff --git a/langtools/src/share/classes/com/sun/tools/sjavac/Log.java b/langtools/src/share/classes/com/sun/tools/sjavac/Log.java
index be209c6..6606907 100644
--- a/langtools/src/share/classes/com/sun/tools/sjavac/Log.java
+++ b/langtools/src/share/classes/com/sun/tools/sjavac/Log.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -71,17 +71,19 @@
         err.println(msg);
     }
 
-    static public void setLogLevel(String l, PrintStream o, PrintStream e)
-        throws ProblemException {
+    static public void initializeLog(PrintStream o, PrintStream e) {
         out = o;
         err = e;
+    }
+
+    static public void setLogLevel(String l) {
         switch (l) {
             case "warn": level = WARN; break;
             case "info": level = INFO; break;
             case "debug": level = DEBUG; break;
             case "trace": level = TRACE; break;
             default:
-                throw new ProblemException("No such log level \"" + l + "\"");
+                throw new IllegalArgumentException("No such log level \"" + l + "\"");
         }
     }
 
diff --git a/langtools/src/share/classes/com/sun/tools/sjavac/Main.java b/langtools/src/share/classes/com/sun/tools/sjavac/Main.java
index b2bde85..dc97eae 100644
--- a/langtools/src/share/classes/com/sun/tools/sjavac/Main.java
+++ b/langtools/src/share/classes/com/sun/tools/sjavac/Main.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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,13 +25,14 @@
 
 package com.sun.tools.sjavac;
 
-import java.io.File;
 import java.io.IOException;
 import java.io.PrintStream;
 import java.util.*;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
+import java.nio.file.Path;
+import java.nio.file.Files;
 
+import com.sun.tools.sjavac.options.Options;
+import com.sun.tools.sjavac.options.SourceLocation;
 import com.sun.tools.sjavac.server.JavacServer;
 
 /**
@@ -151,24 +152,8 @@
         The resulting classes are written into bin.
     */
 
-    // This is the final destination for classes and copied files.
-    private File bin_dir;
-    // This is where the annotation process will put generated sources.
-    private File gensrc_dir;
-    // This is where javac -h puts the generated c-header files.
-    private File header_dir;
-
-    // This file contains the list of sources genereated by the makefile.
-    // We double check that our calculated list of sources matches this list,
-    // if not, then we terminate with an error!
-    private File makefile_source_list;
-    // The challenging task to manage an incremental build is done by javac_state.
     private JavacState javac_state;
 
-    // The suffix rules tells you for example, that .java files should be compiled,
-    // and .html files should be copied and .properties files be translated.
-    Map<String,Transformer> suffix_rules;
-
     public static void main(String... args)  {
         if (args.length > 0 && args[0].startsWith("--startserver:")) {
             if (args.length>1) {
@@ -199,118 +184,142 @@
     }
 
     public int go(String[] args, PrintStream out, PrintStream err) {
+
+        Log.initializeLog(out, err);
+
+        Options options;
         try {
-            if (args.length == 0 || findJavaSourceFiles(args) || findAtFile(args) || null==Util.findServerSettings(args)) {
-                printHelp();
-                return 0;
-            }
+            options = Options.parseArgs(args);
+        } catch (IllegalArgumentException e) {
+            Log.error(e.getMessage());
+            return -1;
+        }
 
-            Log.setLogLevel(findLogLevel(args), out, err);
-            String server_settings = Util.findServerSettings(args);
-            args = verifyImplicitOption(args);
-            // Find the source root directories, and add the -src option before these, if not there already.
-            args = addSrcBeforeDirectories(args);
-            // Check that there is at least one -src supplied.
-            checkSrcOption(args);
-            // Check that there is one -d supplied.
-            bin_dir = findDirectoryOption(args,"-d","output", true, false, true);
-            gensrc_dir = findDirectoryOption(args,"-s","gensrc", false, false, true);
-            header_dir = findDirectoryOption(args,"-h","headers", false, false, true);
-            makefile_source_list = findFileOption(args,"--compare-found-sources","makefile source list", false);
+        Log.setLogLevel(options.getLogLevel());
 
-            // Load the prev build state database.
-            javac_state = JavacState.load(args, bin_dir, gensrc_dir, header_dir,
-                    findBooleanOption(args, "--permit-unidentified-artifacts"), out, err);
+        if (!validateOptions(options))
+            return -1;
 
-            // Setup the suffix rules from the command line.
-            suffix_rules = javac_state.getJavaSuffixRule();
-            findTranslateOptions(args, suffix_rules);
-            if (suffix_rules.keySet().size() > 1 && gensrc_dir == null) {
-                Log.error("You have translators but no gensrc dir (-s) specified!");
-                return -1;
-            }
-            findCopyOptions(args, suffix_rules);
+        if (!createIfMissing(options.getDestDir()))
+            return -1;
 
-            // All found modules are put here.
-            Map<String,Module> modules = new HashMap<>();
-            // We start out in the legacy empty no-name module.
-            // As soon as we stumble on a module-info.java file we change to that module.
-            Module current_module = new Module("", "");
-            modules.put("", current_module);
+        Path gensrc = options.getGenSrcDir();
+        if (gensrc != null && !createIfMissing(gensrc))
+            return -1;
 
-            // Find all sources, use the suffix rules to know which files are sources.
-            Map<String,Source> sources = new HashMap<>();
-            // Find the files, this will automatically populate the found modules
-            // with found packages where the sources are found!
-            findFiles(args, "-src", suffix_rules.keySet(), sources, modules, current_module, false);
+        Path hdrdir = options.getHeaderDir();
+        if (hdrdir != null && !createIfMissing(hdrdir))
+            return -1;
 
-            if (sources.isEmpty()) {
-                Log.error("Found nothing to compile!");
-                return -1;
-            }
+        // Load the prev build state database.
+        javac_state = JavacState.load(options, out, err);
 
-            // Create a map of all source files that are available for linking. Both -src and
-            // -sourcepath point to such files. It is possible to specify multiple
-            // -sourcepath options to enable different filtering rules. If the
-            // filters are the same for multiple sourcepaths, they may be concatenated
-            // using :(;). Before sending the list of sourcepaths to javac, they are
-            // all concatenated. The list created here is used by the SmartFileWrapper to
-            // make sure only the correct sources are actually available.
-            // We might find more modules here as well.
-            Map<String,Source> sources_to_link_to = new HashMap<>();
-            findFiles(args, "-src", Util.set(".java"), sources_to_link_to, modules, current_module, true);
-            findFiles(args, "-sourcepath", Util.set(".java"), sources_to_link_to, modules, current_module, true);
-            // Rewrite the -src option to make it through to the javac instances.
-            rewriteOptions(args, "-src", "-sourcepath");
+        // Setup the suffix rules from the command line.
+        Map<String, Transformer> suffixRules = new HashMap<>();
 
-            // Find all class files allowable for linking.
-            // And pickup knowledge of all modules found here.
-            // This cannot currently filter classes inside jar files.
-//          Map<String,Source> classes_to_link_to = new HashMap<String,Source>();
-//          findFiles(args, "-classpath", Util.set(".class"), classes_to_link_to, modules, current_module, true);
+        // Handling of .java-compilation
+        suffixRules.putAll(javac_state.getJavaSuffixRule());
 
-            // Find all module sources allowable for linking.
-//          Map<String,Source> modules_to_link_to = new HashMap<String,Source>();
-//          findFiles(args, "-modulepath", Util.set(".class"), modules_to_link_to, modules, current_module, true);
+        // Handling of -copy and -tr
+        suffixRules.putAll(options.getTranslationRules());
 
-            // Add the set of sources to the build database.
-            javac_state.now().flattenPackagesSourcesAndArtifacts(modules);
-            javac_state.now().checkInternalState("checking sources", false, sources);
-            javac_state.now().checkInternalState("checking linked sources", true, sources_to_link_to);
-            javac_state.setVisibleSources(sources_to_link_to);
+        // All found modules are put here.
+        Map<String,Module> modules = new HashMap<>();
+        // We start out in the legacy empty no-name module.
+        // As soon as we stumble on a module-info.java file we change to that module.
+        Module current_module = new Module("", "");
+        modules.put("", current_module);
 
-            // If there is any change in the source files, taint packages
-            // and mark the database in need of saving.
-            javac_state.checkSourceStatus(false);
+        // Find all sources, use the suffix rules to know which files are sources.
+        Map<String,Source> sources = new HashMap<>();
 
-            // Find all existing artifacts. Their timestamp will match the last modified timestamps stored
-            // in javac_state, simply because loading of the JavacState will clean out all artifacts
-            // that do not match the javac_state database.
-            javac_state.findAllArtifacts();
+        // Find the files, this will automatically populate the found modules
+        // with found packages where the sources are found!
+        findSourceFiles(options.getSources(),
+                        suffixRules.keySet(),
+                        sources,
+                        modules,
+                        current_module,
+                        options.isDefaultPackagePermitted(),
+                        false);
 
-            // Remove unidentified artifacts from the bin, gensrc and header dirs.
-            // (Unless we allow them to be there.)
-            // I.e. artifacts that are not known according to the build database (javac_state).
-            // For examples, files that have been manually copied into these dirs.
-            // Artifacts with bad timestamps (ie the on disk timestamp does not match the timestamp
-            // in javac_state) have already been removed when the javac_state was loaded.
-            if (!findBooleanOption(args, "--permit-unidentified-artifacts")) {
-                javac_state.removeUnidentifiedArtifacts();
-            }
-            // Go through all sources and taint all packages that miss artifacts.
-            javac_state.taintPackagesThatMissArtifacts();
+        if (sources.isEmpty()) {
+            Log.error("Found nothing to compile!");
+            return -1;
+        }
 
-            // Now clean out all known artifacts belonging to tainted packages.
-            javac_state.deleteClassArtifactsInTaintedPackages();
-            // Copy files, for example property files, images files, xml files etc etc.
-            javac_state.performCopying(bin_dir, suffix_rules);
-            // Translate files, for example compile properties or compile idls.
-            javac_state.performTranslation(gensrc_dir, suffix_rules);
-            // Add any potentially generated java sources to the tobe compiled list.
-            // (Generated sources must always have a package.)
-            Map<String,Source> generated_sources = new HashMap<>();
-            Source.scanRoot(gensrc_dir, Util.set(".java"), null, null, null, null,
-                   generated_sources, modules, current_module, false, true, false);
+        // Create a map of all source files that are available for linking. Both -src and
+        // -sourcepath point to such files. It is possible to specify multiple
+        // -sourcepath options to enable different filtering rules. If the
+        // filters are the same for multiple sourcepaths, they may be concatenated
+        // using :(;). Before sending the list of sourcepaths to javac, they are
+        // all concatenated. The list created here is used by the SmartFileWrapper to
+        // make sure only the correct sources are actually available.
+        // We might find more modules here as well.
+        Map<String,Source> sources_to_link_to = new HashMap<>();
+
+        List<SourceLocation> sourceResolutionLocations = new ArrayList<>();
+        sourceResolutionLocations.addAll(options.getSources());
+        sourceResolutionLocations.addAll(options.getSourceSearchPaths());
+        findSourceFiles(sourceResolutionLocations,
+                        Collections.singleton(".java"),
+                        sources_to_link_to,
+                        modules,
+                        current_module,
+                        options.isDefaultPackagePermitted(),
+                        true);
+
+        // Find all class files allowable for linking.
+        // And pickup knowledge of all modules found here.
+        // This cannot currently filter classes inside jar files.
+//      Map<String,Source> classes_to_link_to = new HashMap<String,Source>();
+//      findFiles(args, "-classpath", Util.set(".class"), classes_to_link_to, modules, current_module, true);
+
+        // Find all module sources allowable for linking.
+//      Map<String,Source> modules_to_link_to = new HashMap<String,Source>();
+//      findFiles(args, "-modulepath", Util.set(".class"), modules_to_link_to, modules, current_module, true);
+
+        // Add the set of sources to the build database.
+        javac_state.now().flattenPackagesSourcesAndArtifacts(modules);
+        javac_state.now().checkInternalState("checking sources", false, sources);
+        javac_state.now().checkInternalState("checking linked sources", true, sources_to_link_to);
+        javac_state.setVisibleSources(sources_to_link_to);
+
+        // If there is any change in the source files, taint packages
+        // and mark the database in need of saving.
+        javac_state.checkSourceStatus(false);
+
+        // Find all existing artifacts. Their timestamp will match the last modified timestamps stored
+        // in javac_state, simply because loading of the JavacState will clean out all artifacts
+        // that do not match the javac_state database.
+        javac_state.findAllArtifacts();
+
+        // Remove unidentified artifacts from the bin, gensrc and header dirs.
+        // (Unless we allow them to be there.)
+        // I.e. artifacts that are not known according to the build database (javac_state).
+        // For examples, files that have been manually copied into these dirs.
+        // Artifacts with bad timestamps (ie the on disk timestamp does not match the timestamp
+        // in javac_state) have already been removed when the javac_state was loaded.
+        if (!options.isUnidentifiedArtifactPermitted()) {
+            javac_state.removeUnidentifiedArtifacts();
+        }
+        // Go through all sources and taint all packages that miss artifacts.
+        javac_state.taintPackagesThatMissArtifacts();
+
+        // Now clean out all known artifacts belonging to tainted packages.
+        javac_state.deleteClassArtifactsInTaintedPackages();
+        // Copy files, for example property files, images files, xml files etc etc.
+        javac_state.performCopying(Util.pathToFile(options.getDestDir()), suffixRules);
+        // Translate files, for example compile properties or compile idls.
+        javac_state.performTranslation(Util.pathToFile(gensrc), suffixRules);
+        // Add any potentially generated java sources to the tobe compiled list.
+        // (Generated sources must always have a package.)
+        Map<String,Source> generated_sources = new HashMap<>();
+
+        try {
+
+            Source.scanRoot(Util.pathToFile(options.getGenSrcDir()), Util.set(".java"), null, null, null, null,
+                    generated_sources, modules, current_module, false, true, false);
             javac_state.now().flattenPackagesSourcesAndArtifacts(modules);
             // Recheck the the source files and their timestamps again.
             javac_state.checkSourceStatus(true);
@@ -320,7 +329,7 @@
             // right, then incremental builds will fail with subtility.
             // If any difference is detected, then we will fail hard here.
             // This is an important safety net.
-            javac_state.compareWithMakefileList(makefile_source_list);
+            javac_state.compareWithMakefileList(Util.pathToFile(options.getSourceReferenceList()));
 
             // Do the compilations, repeatedly until no tainted packages exist.
             boolean again;
@@ -330,7 +339,7 @@
             do {
                 // Clean out artifacts in tainted packages.
                 javac_state.deleteClassArtifactsInTaintedPackages();
-                again = javac_state.performJavaCompilations(bin_dir, server_settings, args, recently_compiled, rc);
+                again = javac_state.performJavaCompilations(options, recently_compiled, rc);
                 if (!rc[0]) break;
             } while (again);
             // Only update the state if the compile went well.
@@ -351,620 +360,71 @@
         }
     }
 
-    /**
-     * Are java source files passed on the command line?
-     */
-    private boolean findJavaSourceFiles(String[] args) {
-        String prev = "";
-        for (String s : args) {
-            if (s.endsWith(".java") && !prev.equals("-xf") && !prev.equals("-if")) {
-                return true;
-            }
-            prev = s;
+    private static boolean validateOptions(Options options) {
+
+        String err = null;
+
+        if (options.getDestDir() == null) {
+            err = "Please specify output directory.";
+        } else if (options.isJavaFilesAmongJavacArgs()) {
+            err = "Sjavac does not handle explicit compilation of single .java files.";
+        } else if (options.isAtFilePresent()) {
+            err = "Sjavac does not handle @-files.";
+        } else if (options.getServerConf() == null) {
+            err = "No server configuration provided.";
+        } else if (!options.getImplicitPolicy().equals("none")) {
+            err = "The only allowed setting for sjavac is -implicit:none";
+        } else if (options.getSources().isEmpty()) {
+            err = "You have to specify -src.";
+        } else if (options.getTranslationRules().size() > 1
+                && options.getGenSrcDir() == null) {
+            err = "You have translators but no gensrc dir (-s) specified!";
         }
-        return false;
+
+        if (err != null)
+            Log.error(err);
+
+        return err == null;
+
     }
 
-    /**
-     * Is an at file passed on the command line?
-     */
-    private boolean findAtFile(String[] args) {
-        for (String s : args) {
-            if (s.startsWith("@")) {
-                return true;
-            }
-        }
-        return false;
-    }
+    private static boolean createIfMissing(Path dir) {
 
-    /**
-     * Find the log level setting.
-     */
-    private String findLogLevel(String[] args) {
-        for (String s : args) {
-            if (s.startsWith("--log=") && s.length()>6) {
-                return s.substring(6);
-            }
-            if (s.equals("-verbose")) {
-                return "info";
-            }
-        }
-        return "info";
-    }
+        if (Files.isDirectory(dir))
+            return true;
 
-    /**
-     * Remove smart javac wrapper arguments, before feeding
-     * the args to the plain javac.
-     */
-    static String[] removeWrapperArgs(String[] args) {
-        String[] out = new String[args.length];
-        // The first source path index is remembered
-        // here. So that all following can be concatenated to it.
-        int source_path = -1;
-        // The same for class path.
-        int class_path = -1;
-        // And module path.
-        int module_path = -1;
-        int j = 0;
-        for (int i = 0; i<args.length; ++i) {
-            if (args[i].equals("-src") ||
-                args[i].equals("-x") ||
-                args[i].equals("-i") ||
-                args[i].equals("-xf") ||
-                args[i].equals("-if") ||
-                args[i].equals("-copy") ||
-                args[i].equals("-tr") ||
-                args[i].equals("-j")) {
-                // Just skip it and skip following value
-                i++;
-            } else if (args[i].startsWith("--server:")) {
-                // Just skip it.
-            } else if (args[i].startsWith("--log=")) {
-                // Just skip it.
-            } else if (args[i].equals("--permit-unidentified-artifacts")) {
-                // Just skip it.
-            } else if (args[i].equals("--permit-sources-without-package")) {
-                // Just skip it.
-            } else if (args[i].equals("--compare-found-sources")) {
-                // Just skip it and skip verify file name
-                i++;
-            } else if (args[i].equals("-sourcepath")) {
-                if (source_path == -1) {
-                    source_path = j;
-                    out[j] = args[i];
-                    out[j+1] = args[i+1];
-                    j+=2;
-                    i++;
-                } else {
-                    // Skip this and its argument, but
-                    // append argument to found sourcepath.
-                    out[source_path+1] = out[source_path+1]+File.pathSeparatorChar+args[i+1];
-                    i++;
-                }
-            } else if (args[i].equals("-classpath") || args[i].equals("-cp")) {
-                if (class_path == -1) {
-                    class_path = j;
-                    out[j] = args[i];
-                    out[j+1] = args[i+1];
-                    j+=2;
-                    i++;
-                } else {
-                    // Skip this and its argument, but
-                    // append argument to found sourcepath.
-                    out[class_path+1] = out[class_path+1]+File.pathSeparatorChar+args[i+1];
-                    i++;
-                }
-            } else if (args[i].equals("-modulepath")) {
-                if (module_path == -1) {
-                    module_path = j;
-                    out[j] = args[i];
-                    out[j+1] = args[i+1];
-                    j+=2;
-                    i++;
-                } else {
-                    // Skip this and its argument, but
-                    // append argument to found sourcepath.
-                    out[module_path+1] = out[module_path+1]+File.pathSeparatorChar+args[i+1];
-                    i++;
-                }
-             } else {
-                // Copy argument.
-                out[j] = args[i];
-                j++;
-            }
+        if (Files.exists(dir)) {
+            Log.error(dir + " is not a directory.");
+            return false;
         }
-        String[] ret = new String[j];
-        System.arraycopy(out, 0, ret, 0, j);
-        return ret;
-    }
 
-    /**
-     * Make sure directory exist, create it if not.
-     */
-    private static boolean makeSureExists(File dir) {
-        // Make sure the dest directories exist.
-        if (!dir.exists()) {
-            if (!dir.mkdirs()) {
-                Log.error("Could not create the directory "+dir.getPath());
-                return false;
-            }
-        }
-        return true;
-    }
-
-    /**
-     * Verify that a package pattern is valid.
-     */
-    private static void checkPattern(String s) throws ProblemException {
-        // Package names like foo.bar.gamma are allowed, and
-        // package names suffixed with .* like foo.bar.* are
-        // also allowed.
-        Pattern p = Pattern.compile("[a-zA-Z_]{1}[a-zA-Z0-9_]*(\\.[a-zA-Z_]{1}[a-zA-Z0-9_]*)*(\\.\\*)?+");
-        Matcher m = p.matcher(s);
-        if (!m.matches()) {
-            throw new ProblemException("The string \""+s+"\" is not a proper package name pattern.");
-        }
-    }
-
-    /**
-     * Verify that a translate pattern is valid.
-     */
-    private static void checkTranslatePattern(String s) throws ProblemException {
-        // .prop=com.sun.tools.javac.smart.CompileProperties
-        // .idl=com.sun.corba.CompileIdl
-        // .g3=antlr.CompileGrammar,debug=true
-        Pattern p = Pattern.compile(
-            "\\.[a-zA-Z_]{1}[a-zA-Z0-9_]*=[a-z_]{1}[a-z0-9_]*(\\.[a-z_]{1}[a-z0-9_]*)*"+
-            "(\\.[a-zA-Z_]{1}[a-zA-Z0-9_]*)(,.*)?");
-        Matcher m = p.matcher(s);
-        if (!m.matches()) {
-            throw new ProblemException("The string \""+s+"\" is not a proper translate pattern.");
-        }
-    }
-
-    /**
-     * Verify that a copy pattern is valid.
-     */
-    private static void checkCopyPattern(String s) throws ProblemException {
-        // .gif
-        // .html
-        Pattern p = Pattern.compile(
-            "\\.[a-zA-Z_]{1}[a-zA-Z0-9_]*");
-        Matcher m = p.matcher(s);
-        if (!m.matches()) {
-            throw new ProblemException("The string \""+s+"\" is not a proper suffix.");
-        }
-    }
-
-    /**
-     * Verify that a source file name is valid.
-     */
-    private static void checkFilePattern(String s) throws ProblemException {
-        // File names like foo/bar/gamma/Bar.java are allowed,
-        // as well as /bar/jndi.properties as well as,
-        // */bar/Foo.java
-        Pattern p = null;
-        if (File.separatorChar == '\\') {
-            p = Pattern.compile("\\*?(.+\\\\)*.+");
-        }
-        else if (File.separatorChar == '/') {
-            p = Pattern.compile("\\*?(.+/)*.+");
-        } else {
-            throw new ProblemException("This platform uses the unsupported "+File.separatorChar+
-                                      " as file separator character. Please add support for it!");
-        }
-        Matcher m = p.matcher(s);
-        if (!m.matches()) {
-            throw new ProblemException("The string \""+s+"\" is not a proper file name.");
-        }
-    }
-
-    /**
-     * Scan the arguments to find an option is used.
-     */
-    private static boolean hasOption(String[] args, String option) {
-        for (String a : args) {
-            if (a.equals(option)) return true;
-        }
-        return false;
-    }
-
-    /**
-     * Check if -implicit is supplied, if so check that it is none.
-     * If -implicit is not supplied, supply -implicit:none
-     * Only implicit:none is allowed because otherwise the multicore compilations
-     * and dependency tracking will be tangled up.
-     */
-    private static String[] verifyImplicitOption(String[] args)
-        throws ProblemException {
-
-        boolean foundImplicit = false;
-        for (String a : args) {
-            if (a.startsWith("-implicit:")) {
-                foundImplicit = true;
-                if (!a.equals("-implicit:none")) {
-                    throw new ProblemException("The only allowed setting for sjavac is -implicit:none, it is also the default.");
-                }
-            }
-        }
-        if (foundImplicit) {
-            return args;
-        }
-        // -implicit:none not found lets add it.
-        String[] newargs = new String[args.length+1];
-        System.arraycopy(args,0, newargs, 0, args.length);
-        newargs[args.length] = "-implicit:none";
-        return newargs;
-    }
-
-    /**
-     * Rewrite a single option into something else.
-     */
-    private static void rewriteOptions(String[] args, String option, String new_option) {
-        for (int i=0; i<args.length; ++i) {
-            if (args[i].equals(option)) {
-                args[i] = new_option;
-            }
-        }
-    }
-
-    /**
-     * Scan the arguments to find an option that specifies a directory.
-     * Create the directory if necessary.
-     */
-    private static File findDirectoryOption(String[] args, String option, String name, boolean needed, boolean allow_dups, boolean create)
-        throws ProblemException, ProblemException {
-        File dir = null;
-        for (int i = 0; i<args.length; ++i) {
-            if (args[i].equals(option)) {
-                if (dir != null) {
-                    throw new ProblemException("You have already specified the "+name+" dir!");
-                }
-                if (i+1 >= args.length) {
-                    throw new ProblemException("You have to specify a directory following "+option+".");
-                }
-                if (args[i+1].indexOf(File.pathSeparatorChar) != -1) {
-                    throw new ProblemException("You must only specify a single directory for "+option+".");
-                }
-                dir = new File(args[i+1]);
-                if (!dir.exists()) {
-                    if (!create) {
-                         throw new ProblemException("This directory does not exist: "+dir.getPath());
-                    } else
-                    if (!makeSureExists(dir)) {
-                        throw new ProblemException("Cannot create directory "+dir.getPath());
-                    }
-                }
-                if (!dir.isDirectory()) {
-                    throw new ProblemException("\""+args[i+1]+"\" is not a directory.");
-                }
-            }
-        }
-        if (dir == null && needed) {
-            throw new ProblemException("You have to specify "+option);
-        }
         try {
-            if (dir != null)
-                return dir.getCanonicalFile();
+            Files.createDirectories(dir);
         } catch (IOException e) {
-            throw new ProblemException(""+e);
+            Log.error("Could not create directory: " + e.getMessage());
+            return false;
         }
-        return null;
-    }
 
-    /**
-     * Option is followed by path.
-     */
-    private static boolean shouldBeFollowedByPath(String o) {
-        return o.equals("-s") ||
-               o.equals("-h") ||
-               o.equals("-d") ||
-               o.equals("-sourcepath") ||
-               o.equals("-classpath") ||
-               o.equals("-cp") ||
-               o.equals("-bootclasspath") ||
-               o.equals("-src");
-    }
-
-    /**
-     * Add -src before source root directories if not already there.
-     */
-    private static String[] addSrcBeforeDirectories(String[] args) {
-        List<String> newargs = new ArrayList<>();
-        for (int i = 0; i<args.length; ++i) {
-            File dir = new File(args[i]);
-            if (dir.exists() && dir.isDirectory()) {
-                if (i == 0 || !shouldBeFollowedByPath(args[i-1])) {
-                    newargs.add("-src");
-                }
-            }
-            newargs.add(args[i]);
-        }
-        return newargs.toArray(new String[0]);
-    }
-
-    /**
-     * Check the -src options.
-     */
-    private static void checkSrcOption(String[] args)
-        throws ProblemException {
-        Set<File> dirs = new HashSet<>();
-        for (int i = 0; i<args.length; ++i) {
-            if (args[i].equals("-src")) {
-                if (i+1 >= args.length) {
-                    throw new ProblemException("You have to specify a directory following -src.");
-                }
-                StringTokenizer st = new StringTokenizer(args[i+1], File.pathSeparator);
-                while (st.hasMoreElements()) {
-                    File dir = new File(st.nextToken());
-                    if (!dir.exists()) {
-                        throw new ProblemException("This directory does not exist: "+dir.getPath());
-                    }
-                    if (!dir.isDirectory()) {
-                        throw new ProblemException("\""+dir.getPath()+"\" is not a directory.");
-                    }
-                    if (dirs.contains(dir)) {
-                        throw new ProblemException("The src directory \""+dir.getPath()+"\" is specified more than once!");
-                    }
-                    dirs.add(dir);
-                }
-            }
-        }
-        if (dirs.isEmpty()) {
-            throw new ProblemException("You have to specify -src.");
-        }
-    }
-
-    /**
-     * Scan the arguments to find an option that specifies a file.
-     */
-    private static File findFileOption(String[] args, String option, String name, boolean needed)
-        throws ProblemException, ProblemException {
-        File file = null;
-        for (int i = 0; i<args.length; ++i) {
-            if (args[i].equals(option)) {
-                if (file != null) {
-                    throw new ProblemException("You have already specified the "+name+" file!");
-                }
-                if (i+1 >= args.length) {
-                    throw new ProblemException("You have to specify a file following "+option+".");
-                }
-                file = new File(args[i+1]);
-                if (file.isDirectory()) {
-                    throw new ProblemException("\""+args[i+1]+"\" is not a file.");
-                }
-                if (!file.exists() && needed) {
-                    throw new ProblemException("The file \""+args[i+1]+"\" does not exist.");
-                }
-
-            }
-        }
-        if (file == null && needed) {
-            throw new ProblemException("You have to specify "+option);
-        }
-        return file;
-    }
-
-    /**
-     * Look for a specific switch, return true if found.
-     */
-    public static boolean findBooleanOption(String[] args, String option) {
-        for (String arg : args) {
-            if (arg.equals(option))
-                return true;
-        }
-        return false;
-    }
-
-    /**
-     * Scan the arguments to find an option that specifies a number.
-     */
-    public static int findNumberOption(String[] args, String option) {
-        int rc = 0;
-        for (int i = 0; i<args.length; ++i) {
-            if (args[i].equals(option)) {
-                if (args.length > i+1) {
-                    rc = Integer.parseInt(args[i+1]);
-                }
-            }
-        }
-        return rc;
-    }
-
-    /**
-     * Scan the arguments to find the option (-tr) that setup translation rules to java source
-     * from different sources. For example: .properties are translated using CompileProperties
-     * The found translators are stored as suffix rules.
-     */
-    private static void findTranslateOptions(String[] args, Map<String,Transformer> suffix_rules)
-        throws ProblemException, ProblemException {
-
-        for (int i = 0; i<args.length; ++i) {
-            if (args[i].equals("-tr")) {
-                if (i+1 >= args.length) {
-                    throw new ProblemException("You have to specify a translate rule following -tr.");
-                }
-                String s = args[i+1];
-                checkTranslatePattern(s);
-                int ep = s.indexOf("=");
-                String suffix = s.substring(0,ep);
-                String classname = s.substring(ep+1);
-                if (suffix_rules.get(suffix) != null) {
-                    throw new ProblemException("You have already specified a "+
-                                              "rule for the suffix "+suffix);
-                }
-                if (s.equals(".class")) {
-                    throw new ProblemException("You cannot have a translator for .class files!");
-                }
-                if (s.equals(".java")) {
-                    throw new ProblemException("You cannot have a translator for .java files!");
-                }
-                String extra = null;
-                int exp = classname.indexOf(",");
-                if (exp != -1) {
-                    extra = classname.substring(exp+1);
-                    classname = classname.substring(0,exp);
-                }
-                try {
-                    Class<?> cl = Class.forName(classname);
-                    Transformer t = (Transformer)cl.newInstance();
-                    t.setExtra(extra);
-                    suffix_rules.put(suffix, t);
-                }
-                catch (Exception e) {
-                    throw new ProblemException("Cannot use "+classname+" as a translator!");
-                }
-            }
-        }
-    }
-
-    /**
-     * Scan the arguments to find the option (-copy) that setup copying rules into the bin dir.
-     * For example: -copy .html
-     * The found copiers are stored as suffix rules as well. No translation is done, just copying.
-     */
-    private void findCopyOptions(String[] args, Map<String,Transformer> suffix_rules)
-        throws ProblemException, ProblemException {
-
-        for (int i = 0; i<args.length; ++i) {
-            if (args[i].equals("-copy")) {
-                if (i+1 >= args.length) {
-                    throw new ProblemException("You have to specify a translate rule following -tr.");
-                }
-                String s = args[i+1];
-                checkCopyPattern(s);
-                if (suffix_rules.get(s) != null) {
-                    throw new ProblemException("You have already specified a "+
-                                              "rule for the suffix "+s);
-                }
-                if (s.equals(".class")) {
-                    throw new ProblemException("You cannot have a copy rule for .class files!");
-                }
-                if (s.equals(".java")) {
-                    throw new ProblemException("You cannot have a copy rule for .java files!");
-                }
-                suffix_rules.put(s, javac_state.getCopier());
-            }
-        }
-    }
-
-    /**
-     * Rewrite a / separated path into \ separated, but only
-     * if we are running on a platform were File.separatorChar=='\', ie winapi.
-     */
-    private String fixupSeparator(String p) {
-        if (File.separatorChar == '/') return p;
-        return p.replaceAll("/", "\\\\");
-    }
-
-    /**
-     * Scan the arguments for -i -x -xf -if followed by the option
-     * -src, -sourcepath, -modulepath or -classpath and produce a map of all the
-     * files to referenced for that particular option.
-     *
-     * Store the found sources and the found modules in the supplied maps.
-     */
-    private boolean findFiles(String[] args, String option, Set<String> suffixes,
-                              Map<String,Source> found_files, Map<String, Module> found_modules,
-                              Module current_module, boolean inLinksrc)
-        throws ProblemException, ProblemException
-    {
-        // Track which source roots, source path roots and class path roots have been added.
-        Set<File> roots = new HashSet<>();
-        // Track the current set of package includes,excludes as well as excluded source files,
-        // to be used in the next -src/-sourcepath/-classpath
-        List<String> includes = new LinkedList<>();
-        List<String> excludes = new LinkedList<>();
-        List<String> excludefiles = new LinkedList<>();
-        List<String> includefiles = new LinkedList<>();
-        // This include is used to find all modules in the source.
-        List<String> moduleinfo = new LinkedList<>();
-        moduleinfo.add("module-info.java");
-
-        for (int i = 0; i<args.length; ++i) {
-            if (args[i].equals("-i")) {
-                if (i+1 >= args.length) {
-                    throw new ProblemException("You have to specify a package pattern following -i");
-                }
-                String incl = args[i+1];
-                checkPattern(incl);
-                includes.add(incl);
-            }
-            if (args[i].equals("-x")) {
-                if (i+1 >= args.length) {
-                    throw new ProblemException("You have to specify a package pattern following -x");
-                }
-                String excl = args[i+1];
-                checkPattern(excl);
-                excludes.add(excl);
-            }
-            if (args[i].equals("-xf")) {
-                if (i+1 >= args.length) {
-                    throw new ProblemException("You have to specify a file following -xf");
-                }
-                String exclf = args[i+1];
-                checkFilePattern(exclf);
-                exclf = Util.normalizeDriveLetter(exclf);
-                excludefiles.add(fixupSeparator(exclf));
-            }
-            if (args[i].equals("-if")) {
-                if (i+1 >= args.length) {
-                    throw new ProblemException("You have to specify a file following -xf");
-                }
-                String inclf = args[i+1];
-                checkFilePattern(inclf);
-                inclf = Util.normalizeDriveLetter(inclf);
-                includefiles.add(fixupSeparator(inclf));
-            }
-            if (args[i].equals(option)) {
-                if (i+1 >= args.length) {
-                    throw new ProblemException("You have to specify a directory following "+option);
-                }
-                String[] root_dirs = args[i+1].split(File.pathSeparator);
-                for (String r : root_dirs) {
-                    File root = new File(r);
-                    if (!root.isDirectory()) {
-                        throw new ProblemException("\""+r+"\" is not a directory.");
-                    }
-                    try {
-                        root = root.getCanonicalFile();
-                    } catch (IOException e) {
-                        throw new ProblemException(""+e);
-                    }
-                    if (roots.contains(root)) {
-                        throw new ProblemException("\""+r+"\" has already been used for "+option);
-                    }
-                    if (root.equals(bin_dir)) {
-                        throw new ProblemException("\""+r+"\" cannot be used both for "+option+" and -d");
-                    }
-                    if (root.equals(gensrc_dir)) {
-                        throw new ProblemException("\""+r+"\" cannot be used both for "+option+" and -s");
-                    }
-                    if (root.equals(header_dir)) {
-                        throw new ProblemException("\""+r+"\" cannot be used both for "+option+" and -h");
-                    }
-                    roots.add(root);
-                    Source.scanRoot(root, suffixes, excludes, includes, excludefiles, includefiles,
-                                    found_files, found_modules, current_module,
-                                    findBooleanOption(args, "--permit-sources-without-package"),
-                                    false, inLinksrc);
-                }
-            }
-            if (args[i].equals("-src") ||
-                args[i].equals("-sourcepath") ||
-                args[i].equals("-modulepath") ||
-                args[i].equals("-classpath") ||
-                args[i].equals("-cp"))
-            {
-                // Reset the includes,excludes and excludefiles after they have been used.
-                includes = new LinkedList<>();
-                excludes = new LinkedList<>();
-                excludefiles = new LinkedList<>();
-                includefiles = new LinkedList<>();
-            }
-        }
         return true;
     }
 
-}
 
+    /** Find source files in the given source locations. */
+    public static void findSourceFiles(List<SourceLocation> sourceLocations,
+                                       Set<String> sourceTypes,
+                                       Map<String,Source> foundFiles,
+                                       Map<String, Module> foundModules,
+                                       Module currentModule,
+                                       boolean permitSourcesInDefaultPackage,
+                                       boolean inLinksrc) {
+
+        for (SourceLocation source : sourceLocations) {
+            source.findSourceFiles(sourceTypes,
+                                   foundFiles,
+                                   foundModules,
+                                   currentModule,
+                                   permitSourcesInDefaultPackage,
+                                   inLinksrc);
+        }
+    }
+}
diff --git a/langtools/src/share/classes/com/sun/tools/sjavac/Source.java b/langtools/src/share/classes/com/sun/tools/sjavac/Source.java
index 52c8709..444ee1c 100644
--- a/langtools/src/share/classes/com/sun/tools/sjavac/Source.java
+++ b/langtools/src/share/classes/com/sun/tools/sjavac/Source.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -201,7 +201,7 @@
         // It might contain other source files however, (for -tr and -copy) these will
         // always be included, since no package pattern can match the root directory.
         currentModule = addFilesInDir(root, root_prefix, root, suffixes, permitSourcesWithoutPackage,
-                                       excludeFiles, includeFiles, false,
+                                       excludeFiles, includeFiles,
                                        foundFiles, foundModules, currentModule,
                                        inGensrc, inLinksrc);
 
@@ -211,24 +211,28 @@
                 // Descend into the directory structure.
                 scanDirectory(d, root_prefix, root, suffixes,
                               excludes, includes, excludeFiles, includeFiles,
-                              false, foundFiles, foundModules, currentModule, inGensrc, inLinksrc);
+                              foundFiles, foundModules, currentModule, inGensrc, inLinksrc);
             }
         }
     }
 
     /**
      * Test if a path matches any of the patterns given.
-     * The pattern foo.bar matches only foo.bar
-     * The pattern foo.* matches foo.bar and foo.bar.zoo etc
+     * The pattern foo/bar matches only foo/bar
+     * The pattern foo/* matches foo/bar and foo/bar/zoo etc
      */
     static private boolean hasMatch(String path, List<String> patterns) {
+
+        // Convert Windows '\' to '/' for the sake of comparing with the patterns
+        path = path.replace(File.separatorChar, '/');
+
         for (String p : patterns) {
             // Exact match
-            if (p.equals(path)) {
+            if (p.equals(path))
                 return true;
-            }
+
             // Single dot the end matches this package and all its subpackages.
-            if (p.endsWith(".*")) {
+            if (p.endsWith("/*")) {
                 // Remove the wildcard
                 String patprefix = p.substring(0,p.length()-2);
                 // Does the path start with the pattern prefix?
@@ -237,7 +241,7 @@
                     // If the path is longer, then make sure that
                     // the next part of the path starts with a dot (.) to prevent
                     // wildcard matching in the middle of a package name.
-                    if (path.length()==patprefix.length() || path.charAt(patprefix.length())=='.') {
+                    if (path.length()==patprefix.length() || path.charAt(patprefix.length())=='/') {
                         return true;
                     }
                 }
@@ -251,6 +255,9 @@
      // The pattern foo/bar.java only matches foo/bar.java
      // The pattern */bar.java matches foo/bar.java and zoo/bar.java etc
     static private boolean hasFileMatch(String path, List<String> patterns) {
+        // Convert Windows '\' to '/' for the sake of comparing with the patterns
+        path = path.replace(File.separatorChar, '/');
+
         path = Util.normalizeDriveLetter(path);
         for (String p : patterns) {
             // Exact match
@@ -276,7 +283,7 @@
      */
     static private Module addFilesInDir(File dir, int rootPrefix, File root,
                                         Set<String> suffixes, boolean allow_javas,
-                                        List<String> excludeFiles, List<String> includeFiles, boolean all,
+                                        List<String> excludeFiles, List<String> includeFiles,
                                         Map<String,Source> foundFiles,
                                         Map<String,Module> foundModules,
                                         Module currentModule,
@@ -285,79 +292,82 @@
         throws ProblemException
     {
         for (File f : dir.listFiles()) {
-            if (f.isFile()) {
-                boolean should_add =
-                    (excludeFiles == null || excludeFiles.isEmpty() || !hasFileMatch(f.getPath(), excludeFiles))
-                    && (includeFiles == null || includeFiles.isEmpty() || hasFileMatch(f.getPath(), includeFiles));
 
-                if (should_add) {
-                    if (!allow_javas && f.getName().endsWith(".java")) {
-                        throw new ProblemException("No .java files are allowed in the source root "+dir.getPath()+
-                                                   ", please remove "+f.getName());
-                    }
-                    // Extract the file name relative the root.
-                    String fn = f.getPath().substring(rootPrefix);
-                    // Extract the package name.
-                    int sp = fn.lastIndexOf(File.separatorChar);
-                    String pkg = "";
-                    if (sp != -1) {
-                        pkg = fn.substring(0,sp).replace(File.separatorChar,'.');
-                    }
-                    // Is this a module-info.java file?
-                    if (fn.endsWith("module-info.java")) {
-                        // Aha! We have recursed into a module!
-                        if (!currentModule.name().equals("")) {
-                            throw new ProblemException("You have an extra module-info.java inside a module! Please remove "+fn);
+            if (!f.isFile())
+                continue;
+
+            boolean should_add =
+                (excludeFiles == null || excludeFiles.isEmpty() || !hasFileMatch(f.getPath(), excludeFiles))
+                && (includeFiles == null || includeFiles.isEmpty() || hasFileMatch(f.getPath(), includeFiles));
+
+            if (!should_add)
+                continue;
+
+            if (!allow_javas && f.getName().endsWith(".java")) {
+                throw new ProblemException("No .java files are allowed in the source root "+dir.getPath()+
+                                           ", please remove "+f.getName());
+            }
+            // Extract the file name relative the root.
+            String fn = f.getPath().substring(rootPrefix);
+            // Extract the package name.
+            int sp = fn.lastIndexOf(File.separatorChar);
+            String pkg = "";
+            if (sp != -1) {
+                pkg = fn.substring(0,sp);
+            }
+            // Is this a module-info.java file?
+            if (fn.endsWith("module-info.java")) {
+                // Aha! We have recursed into a module!
+                if (!currentModule.name().equals("")) {
+                    throw new ProblemException("You have an extra module-info.java inside a module! Please remove "+fn);
+                }
+                String module_name = fn.substring(0,fn.length()-16);
+                currentModule = new Module(module_name, f.getPath());
+                foundModules.put(module_name, currentModule);
+            }
+            // Extract the suffix.
+            int dp = fn.lastIndexOf(".");
+            String suffix = "";
+            if (dp > 0) {
+                suffix = fn.substring(dp);
+            }
+            // Should the file be added?
+            if (suffixes.contains(suffix)) {
+                Source of = foundFiles.get(f.getPath());
+                if (of != null) {
+                    throw new ProblemException("You have already added the file "+fn+" from "+of.file().getPath());
+                }
+                of = currentModule.lookupSource(f.getPath());
+                if (of != null) {
+                    // Oups, the source is already added, could be ok, could be not, lets check.
+                    if (inLinksrc) {
+                        // So we are collecting sources for linking only.
+                        if (of.isLinkedOnly()) {
+                            // Ouch, this one is also for linking only. Bad.
+                            throw new ProblemException("You have already added the link only file "+fn+" from "+of.file().getPath());
                         }
-                        String module_name = fn.substring(0,fn.length()-16);
-                        currentModule = new Module(module_name, f.getPath());
-                        foundModules.put(module_name, currentModule);
-                    }
-                    // Extract the suffix.
-                    int dp = fn.lastIndexOf(".");
-                    String suffix = "";
-                    if (dp > 0) {
-                        suffix = fn.substring(dp);
-                    }
-                    // Should the file be added?
-                    if (all || suffixes.contains(suffix)) {
-                        Source of = foundFiles.get(f.getPath());
-                        if (of != null) {
-                            throw new ProblemException("You have already added the file "+fn+" from "+of.file().getPath());
-                        }
-                        of = currentModule.lookupSource(f.getPath());
-                        if (of != null) {
-                            // Oups, the source is already added, could be ok, could be not, lets check.
-                            if (inLinksrc) {
-                                // So we are collecting sources for linking only.
-                                if (of.isLinkedOnly()) {
-                                    // Ouch, this one is also for linking only. Bad.
-                                    throw new ProblemException("You have already added the link only file "+fn+" from "+of.file().getPath());
-                                }
-                                // Ok, the existing source is to be compiled. Thus this link only is redundant
-                                // since all compiled are also linked to. Continue to the next source.
-                                // But we need to add the source, so that it will be visible to linking,
-                                // if not the multi core compile will fail because a JavaCompiler cannot
-                                // find the necessary dependencies for its part of the source.
-                                foundFiles.put(f.getPath(), of);
-                                continue;
-                            } else {
-                                // We are looking for sources to compile, if we find an existing to be compiled
-                                // source with the same name, it is an internal error, since we must
-                                // find the sources to be compiled before we find the sources to be linked to.
-                                throw new ProblemException("Internal error: Double add of file "+fn+" from "+of.file().getPath());
-                            }
-                        }
-                        Source s = new Source(currentModule, f.getPath(), f, root);
-                        if (inGensrc) s.markAsGenerated();
-                        if (inLinksrc) {
-                            s.markAsLinkedOnly();
-                        }
-                        pkg = currentModule.name()+":"+pkg;
-                        foundFiles.put(f.getPath(), s);
-                        currentModule.addSource(pkg, s);
+                        // Ok, the existing source is to be compiled. Thus this link only is redundant
+                        // since all compiled are also linked to. Continue to the next source.
+                        // But we need to add the source, so that it will be visible to linking,
+                        // if not the multi core compile will fail because a JavaCompiler cannot
+                        // find the necessary dependencies for its part of the source.
+                        foundFiles.put(f.getPath(), of);
+                        continue;
+                    } else {
+                        // We are looking for sources to compile, if we find an existing to be compiled
+                        // source with the same name, it is an internal error, since we must
+                        // find the sources to be compiled before we find the sources to be linked to.
+                        throw new ProblemException("Internal error: Double add of file "+fn+" from "+of.file().getPath());
                     }
                 }
+                Source s = new Source(currentModule, f.getPath(), f, root);
+                if (inGensrc) s.markAsGenerated();
+                if (inLinksrc) {
+                    s.markAsLinkedOnly();
+                }
+                pkg = currentModule.name()+":"+pkg;
+                foundFiles.put(f.getPath(), s);
+                currentModule.addSource(pkg, s);
             }
         }
         return currentModule;
@@ -368,23 +378,22 @@
     static private void scanDirectory(File dir, int rootPrefix, File root,
                                       Set<String> suffixes,
                                       List<String> excludes, List<String> includes,
-                                      List<String> excludeFiles, List<String> includeFiles, boolean all,
+                                      List<String> excludeFiles, List<String> includeFiles,
                                       Map<String,Source> foundFiles,
                                       Map<String,Module> foundModules,
                                       Module currentModule, boolean inGensrc, boolean inLinksrc)
         throws ProblemException {
 
-        String pkg_name = "";
-        // Remove the root prefix from the dir path, and replace file separator with dots
-        // to get the package name.
+        String path = "";
+        // Remove the root prefix from the dir path
         if (dir.getPath().length() > rootPrefix) {
-            pkg_name = dir.getPath().substring(rootPrefix).replace(File.separatorChar,'.');
+            path = dir.getPath().substring(rootPrefix);
         }
         // Should this package directory be included and not excluded?
-        if (all || ((includes==null || includes.isEmpty() || hasMatch(pkg_name, includes)) &&
-                    (excludes==null || excludes.isEmpty() || !hasMatch(pkg_name, excludes)))) {
+        if ((includes==null || includes.isEmpty() || hasMatch(path, includes)) &&
+            (excludes==null || excludes.isEmpty() || !hasMatch(path, excludes))) {
             // Add the source files.
-            currentModule = addFilesInDir(dir, rootPrefix, root, suffixes, true, excludeFiles, includeFiles, all,
+            currentModule = addFilesInDir(dir, rootPrefix, root, suffixes, true, excludeFiles, includeFiles,
                                           foundFiles, foundModules, currentModule, inGensrc, inLinksrc);
         }
 
@@ -392,7 +401,7 @@
             if (d.isDirectory()) {
                 // Descend into the directory structure.
                 scanDirectory(d, rootPrefix, root, suffixes,
-                              excludes, includes, excludeFiles, includeFiles, all,
+                              excludes, includes, excludeFiles, includeFiles,
                               foundFiles, foundModules, currentModule, inGensrc, inLinksrc);
             }
         }
diff --git a/langtools/src/share/classes/com/sun/tools/sjavac/Transformer.java b/langtools/src/share/classes/com/sun/tools/sjavac/Transformer.java
index 954cfc7..125a026 100644
--- a/langtools/src/share/classes/com/sun/tools/sjavac/Transformer.java
+++ b/langtools/src/share/classes/com/sun/tools/sjavac/Transformer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -30,6 +30,8 @@
 import java.util.Set;
 import java.util.Map;
 
+import com.sun.tools.sjavac.options.Options;
+
 /**
  * The transform interface is used to transform content inside a package, from one form to another.
  * Usually the output form is an unpredictable number of output files. (eg class files)
@@ -95,5 +97,5 @@
                       PrintStream err);
 
     void setExtra(String e);
-    void setExtra(String[] args);
+    void setExtra(Options args);
 }
diff --git a/langtools/src/share/classes/com/sun/tools/sjavac/Util.java b/langtools/src/share/classes/com/sun/tools/sjavac/Util.java
index 19147a1..146bb17 100644
--- a/langtools/src/share/classes/com/sun/tools/sjavac/Util.java
+++ b/langtools/src/share/classes/com/sun/tools/sjavac/Util.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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,6 +26,7 @@
 package com.sun.tools.sjavac;
 
 import java.io.File;
+import java.nio.file.Path;
 import java.util.Arrays;
 import java.util.HashSet;
 import java.util.Set;
@@ -94,14 +95,12 @@
      * do settings = cleanOptions("--server:",Util.set("-portfile"),settings);
      *    now settings equals "--server:portfile=bar"
      *
-     * @param optionPrefix The option name, including colon, eg --server:
      * @param allowsSubOptions A set of the allowed sub options, id portfile etc.
      * @param s The option settings string.
      */
-    public static String cleanSubOptions(String optionPrefix, Set<String> allowedSubOptions, String s) {
+    public static String cleanSubOptions(Set<String> allowedSubOptions, String s) {
         StringBuilder sb = new StringBuilder();
-        if (!s.startsWith(optionPrefix)) return "";
-        StringTokenizer st = new StringTokenizer(s.substring(optionPrefix.length()), ",");
+        StringTokenizer st = new StringTokenizer(s, ",");
         while (st.hasMoreTokens()) {
             String o = st.nextToken();
             int p = o.indexOf('=');
@@ -157,4 +156,9 @@
         }
         return null;
     }
+
+    // TODO: Remove when refactoring from java.io.File to java.nio.file.Path.
+    public static File pathToFile(Path path) {
+        return path == null ? null : path.toFile();
+    }
 }
diff --git a/langtools/src/share/classes/com/sun/tools/sjavac/options/ArgumentIterator.java b/langtools/src/share/classes/com/sun/tools/sjavac/options/ArgumentIterator.java
new file mode 100644
index 0000000..abb6d70
--- /dev/null
+++ b/langtools/src/share/classes/com/sun/tools/sjavac/options/ArgumentIterator.java
@@ -0,0 +1,83 @@
+/*
+ * 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.sjavac.options;
+
+import java.util.Iterator;
+
+public class ArgumentIterator implements Iterator<String> {
+
+    /** The underlying argument iterator */
+    private Iterator<String> iter;
+
+    /** Extra state used to implement peek and current */
+    private String current;
+    private String buffered;
+
+    public ArgumentIterator(Iterable<String> iter) {
+        this.iter = iter.iterator();
+    }
+
+    @Override
+    public boolean hasNext() {
+        return buffered != null || iter.hasNext();
+    }
+
+    @Override
+    public String next() {
+        fillBuffer();
+        current = buffered;
+        buffered = null;
+        return current;
+    }
+
+    /**
+     * @return the last element returned by next() (or {@code null} if next has
+     * never been invoked on this iterator).
+     */
+    public String current() {
+        return current;
+    }
+
+    /** Can't remove current element, since we may have buffered it. */
+    @Override
+    public void remove() {
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * @return Returns the next element without advancing the iterator
+     */
+    public String peek() {
+        fillBuffer();
+        return buffered;
+    }
+
+    private void fillBuffer() {
+        if (buffered == null && iter.hasNext())
+            buffered = iter.next();
+    }
+
+}
diff --git a/langtools/src/share/classes/com/sun/tools/sjavac/options/Option.java b/langtools/src/share/classes/com/sun/tools/sjavac/options/Option.java
new file mode 100644
index 0000000..25a5f00
--- /dev/null
+++ b/langtools/src/share/classes/com/sun/tools/sjavac/options/Option.java
@@ -0,0 +1,360 @@
+/*
+ * 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.sjavac.options;
+
+import java.io.File;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import com.sun.tools.sjavac.CopyFile;
+import com.sun.tools.sjavac.Transformer;
+
+
+/**
+ * Sjavac options can be classified as:
+ *
+ *  (1) relevant only for sjavac, such as --server
+ *  (2) relevant for sjavac and javac, such as -d, or
+ *  (3) relevant only for javac, such as -g.
+ *
+ * This enum represents all options from (1) and (2). Note that instances of
+ * this enum only entail static information about the option. For storage of
+ * option values, refer to com.sun.tools.sjavac.options.Options.
+ */
+public enum Option {
+
+    SRC("-src", "Location of source files to be compiled") {
+        @Override
+        protected void processMatching(ArgumentIterator iter, OptionHelper helper) {
+            List<Path> paths = getFileListArg(iter, helper);
+            if (paths != null)
+                helper.sourceRoots(paths);
+        }
+    },
+    SOURCEPATH("-sourcepath", "Specify search path for sources.") {
+        @Override
+        protected void processMatching(ArgumentIterator iter, OptionHelper helper) {
+            List<Path> paths = getFileListArg(iter, helper);
+            if (paths != null)
+                helper.sourcepath(paths);
+        }
+    },
+    MODULEPATH("-modulepath", "Specify search path for modules.") {
+        @Override
+        protected void processMatching(ArgumentIterator iter, OptionHelper helper) {
+            List<Path> paths = getFileListArg(iter, helper);
+            if (paths != null)
+                helper.modulepath(paths);
+        }
+    },
+    CLASSPATH("-classpath", "Specify search path for classes.") {
+        @Override
+        protected void processMatching(ArgumentIterator iter, OptionHelper helper) {
+            List<Path> paths = getFileListArg(iter, helper);
+            if (paths != null)
+                helper.classpath(paths);
+        }
+    },
+    CP("-cp", "An alias for -classpath") {
+        @Override
+        protected void processMatching(ArgumentIterator iter, OptionHelper helper) {
+            CLASSPATH.processMatching(iter, helper);
+        }
+    },
+    X("-x", "Exclude directory from the subsequent source directory") {
+        @Override
+        protected void processMatching(ArgumentIterator iter, OptionHelper helper) {
+            String pattern = getFilePatternArg(iter, helper);
+            if (pattern != null)
+                helper.exclude(pattern);
+        }
+    },
+    I("-i", "Include only the given directory from the subsequent source directory") {
+        @Override
+        protected void processMatching(ArgumentIterator iter, OptionHelper helper) {
+            String pattern = getFilePatternArg(iter, helper);
+            if (pattern != null)
+                helper.include(pattern);
+        }
+    },
+    XF("-xf", "Exclude a given file") {
+        @Override
+        protected void processMatching(ArgumentIterator iter, OptionHelper helper) {
+            String pattern = getFilePatternArg(iter, helper);
+            if (pattern != null)
+                helper.excludeFile(pattern);
+        }
+    },
+    IF("-if", "Include only the given file") {
+        @Override
+        protected void processMatching(ArgumentIterator iter, OptionHelper helper) {
+            String pattern = getFilePatternArg(iter, helper);
+            if (pattern != null)
+                helper.includeFile(pattern);
+        }
+    },
+    TR("-tr", "Translate resources") {
+        @Override
+        protected void processMatching(ArgumentIterator iter, OptionHelper helper) {
+
+            if (!iter.hasNext()) {
+                helper.reportError(arg + " must be followed by a translation rule");
+                return;
+            }
+
+            String trArg = iter.next();
+
+            // Validate argument syntax. Examples:
+            //   .prop=com.sun.tools.javac.smart.CompileProperties
+            //   .idl=com.sun.corba.CompileIdl
+            //   .g3=antlr.CompileGrammar,debug=true
+            String ident = "[a-zA-Z_][a-zA-Z0-9_]*";
+            Pattern p = Pattern.compile("(?<suffix>\\." + ident + ")=" +
+                                        "(?<class>" + ident + "(\\." + ident + ")*)" +
+                                        "(?<extra>,.*)?");
+            // Check syntax
+            Matcher m = p.matcher(trArg);
+            if (!m.matches()) {
+                helper.reportError("The string \"" + trArg + "\" is not a " +
+                                   "valid translate pattern");
+                return;
+            }
+
+            // Extract relevant parts
+            String suffix = m.group("suffix");
+            String classname = m.group("class");
+            String extra = m.group("extra");
+
+            // Valid suffix?
+            if (suffix.matches("\\.(class|java)")) {
+                helper.reportError("You cannot have a translator for " +
+                                   suffix + " files!");
+                return;
+            }
+
+            // Construct transformer
+            try {
+                Class<?> trCls = Class.forName(classname);
+                Transformer transformer = (Transformer) trCls.newInstance();
+                transformer.setExtra(extra);
+                helper.addTransformer(suffix, transformer);
+            } catch (Exception e) {
+                helper.reportError("Cannot use " + classname +
+                                   " as a translator: " + e.getMessage());
+            }
+        }
+    },
+    COPY("-copy", "Copy resources") {
+        @Override
+        protected void processMatching(ArgumentIterator iter, OptionHelper helper) {
+            if (!iter.hasNext()) {
+                helper.reportError(arg + " must be followed by a resource type");
+                return;
+            }
+
+            String copyArg = iter.next();
+
+            // Validate argument syntax. Examples: .gif, .html
+            if (!copyArg.matches("\\.[a-zA-Z_][a-zA-Z0-9_]*")) {
+                helper.reportError("The string \"" + copyArg + "\" is not a " +
+                                   "valid resource type.");
+                return;
+            }
+
+            helper.addTransformer(copyArg, new CopyFile());
+        }
+    },
+    J("-j", "Number of cores") {
+        @Override
+        protected void processMatching(ArgumentIterator iter, OptionHelper helper) {
+            if (!iter.hasNext() || !iter.peek().matches("\\d+")) {
+                helper.reportError(arg + " must be followed by an integer");
+                return;
+            }
+            helper.numCores(Integer.parseInt(iter.next()));
+        }
+    },
+    SERVER("--server:", "Specify server configuration file of running server") {
+        @Override
+        protected void processMatching(ArgumentIterator iter, OptionHelper helper) {
+            helper.serverConf(iter.current().substring(arg.length()));
+        }
+    },
+    STARTSERVER("--startserver:", "Start server and use the given configuration file") {
+        @Override
+        protected void processMatching(ArgumentIterator iter, OptionHelper helper) {
+            helper.startServerConf(iter.current().substring(arg.length()));
+        }
+    },
+    IMPLICIT("-implicit:", "Specify how to treat implicitly referenced source code") {
+        @Override
+        protected void processMatching(ArgumentIterator iter, OptionHelper helper) {
+            helper.implicit(iter.current().substring(arg.length()));
+        }
+    },
+    LOG("--log=", "Specify logging level") {
+        @Override
+        protected void processMatching(ArgumentIterator iter, OptionHelper helper) {
+            helper.logLevel(iter.current().substring(arg.length()));
+        }
+    },
+    VERBOSE("-verbose", "Set verbosity level to \"info\"") {
+        @Override
+        protected void processMatching(ArgumentIterator iter, OptionHelper helper) {
+            helper.logLevel("info");
+        }
+    },
+    PERMIT_UNIDENTIFIED_ARTIFACTS("--permit-unidentified-artifacts", "Keep unidentified artifacts in destination directory") {
+        @Override
+        protected void processMatching(ArgumentIterator iter, OptionHelper helper) {
+            helper.permitUnidentifiedArtifacts();
+        }
+    },
+    PERMIT_SOURCES_WITHOUT_PACKAGE("--permit-sources-without-package", "Permit sources in the default package") {
+        @Override
+        protected void processMatching(ArgumentIterator iter, OptionHelper helper) {
+            helper.permitDefaultPackage();
+        }
+    },
+    COMPARE_FOUND_SOURCES("--compare-found-sources", "Compare found sources with given sources") {
+        @Override
+        protected void processMatching(ArgumentIterator iter, OptionHelper helper) {
+            Path referenceSourceList = getFileArg(iter, helper, true, false);
+            if (referenceSourceList != null)
+                helper.compareFoundSources(referenceSourceList);
+        }
+    },
+    D("-d", "Output destination directory") {
+        @Override
+        protected void processMatching(ArgumentIterator iter, OptionHelper helper) {
+            Path dir = getFileArg(iter, helper, false, true);
+            if (dir != null)
+                helper.destDir(dir);
+        }
+    },
+    S("-s", "Directory for generated sources") {
+        @Override
+        protected void processMatching(ArgumentIterator iter, OptionHelper helper) {
+            Path dir = getFileArg(iter, helper, false, true);
+            if (dir != null)
+                helper.generatedSourcesDir(dir);
+        }
+    },
+    H("-h", "Directory for header files") {
+        @Override
+        protected void processMatching(ArgumentIterator iter, OptionHelper helper) {
+            Path dir = getFileArg(iter, helper, false, true);
+            if (dir != null)
+                helper.headerDir(dir);
+        }
+    };
+
+    public final String arg;
+
+    final String description;
+
+    private Option(String arg, String description) {
+        this.arg = arg;
+        this.description = description;
+    }
+
+    /** Retrieve and verify syntax of file list argument. */
+    List<Path> getFileListArg(ArgumentIterator iter, OptionHelper helper) {
+        if (!iter.hasNext()) {
+            helper.reportError(arg + " must be followed by a list of files " +
+                              "separated by " + File.pathSeparator);
+            return null;
+        }
+        List<Path> result = new ArrayList<>();
+        for (String pathStr : iter.next().split(File.pathSeparator))
+            result.add(Paths.get(pathStr));
+        return result;
+    }
+
+    /** Retrieve and verify syntax of file argument. */
+    Path getFileArg(ArgumentIterator iter, OptionHelper helper, boolean fileAcceptable, boolean dirAcceptable) {
+
+        if (!iter.hasNext()) {
+            String errmsg = arg + " must be followed by ";
+            if (fileAcceptable && dirAcceptable) errmsg += "a file or directory.";
+            else if (fileAcceptable) errmsg += "a file.";
+            else if (dirAcceptable)  errmsg += "a directory.";
+            else throw new IllegalArgumentException("File or directory must be acceptable.");
+            helper.reportError(errmsg);
+            return null;
+        }
+
+        return Paths.get(iter.next());
+    }
+
+    /** Retrieve the next file or package argument. */
+    String getFilePatternArg(ArgumentIterator iter, OptionHelper helper) {
+
+        if (!iter.hasNext()) {
+            helper.reportError(arg + " must be followed by a file or directory pattern.");
+            return null;
+        }
+
+        return iter.next();
+    }
+
+    // Future cleanup: Change the "=" syntax to ":" syntax to be consistent and
+    // to follow the javac-option style.
+
+    public boolean hasOption() {
+        return arg.endsWith(":") || arg.endsWith("=");
+    }
+
+
+    /**
+     * Process current argument of argIter.
+     *
+     * It's final, since the option customization is typically done in
+     * processMatching.
+     *
+     * @param argIter Iterator to read current and succeeding arguments from.
+     * @param helper The helper to report back to.
+     * @return true iff the argument was processed by this option.
+     */
+    public final boolean processCurrent(ArgumentIterator argIter,
+                                        OptionHelper helper) {
+        String fullArg = argIter.current(); // "-tr" or "-log=level"
+        if (hasOption() ? fullArg.startsWith(arg) : fullArg.equals(arg)) {
+            processMatching(argIter, helper);
+            return true;
+        }
+        // Did not match
+        return false;
+    }
+
+    /** Called by process if the current argument matches this option. */
+    protected abstract void processMatching(ArgumentIterator argIter,
+                                            OptionHelper helper);
+}
diff --git a/langtools/src/share/classes/com/sun/tools/sjavac/options/OptionHelper.java b/langtools/src/share/classes/com/sun/tools/sjavac/options/OptionHelper.java
new file mode 100644
index 0000000..5fe92ce
--- /dev/null
+++ b/langtools/src/share/classes/com/sun/tools/sjavac/options/OptionHelper.java
@@ -0,0 +1,146 @@
+/*
+ * 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.sjavac.options;
+
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.Arrays;
+import java.util.List;
+
+import com.sun.tools.sjavac.Transformer;
+
+/**
+ * This class is used to decode sjavac options.
+ * See com.sun.tools.sjavac.options.Options for example usage.
+ */
+public abstract class OptionHelper {
+
+    /** Handle error */
+    public abstract void reportError(String msg);
+
+    /** Record a package exclusion pattern */
+    public abstract void exclude(String excl);
+
+    /** Record a package inclusion pattern */
+    public abstract void include(String incl);
+
+    /** Record a file exclusion */
+    public abstract void excludeFile(String exclFile);
+
+    /** Record a file inclusion */
+    public abstract void includeFile(String inclFile);
+
+    /** Record a root of sources to be compiled */
+    public abstract void sourceRoots(List<Path> path);
+
+    /** Record a suffix + transformer */
+    public abstract void addTransformer(String suffix, Transformer tr);
+
+    /** Record a sourcepath to be used */
+    public abstract void sourcepath(List<Path> path);
+
+    /** Record a modulepath to be used */
+    public abstract void modulepath(List<Path> path);
+
+    /** Record a classpath to be used */
+    public abstract void classpath(List<Path> path);
+
+    /** Record the number of cores */
+    public abstract void numCores(int parseInt);
+
+    /** Record desired log level */
+    public abstract void logLevel(String level);
+
+    /** Record path for reference source list */
+    public abstract void compareFoundSources(Path referenceList);
+
+    /** Record the fact that unidentified artifacts are permitted */
+    public abstract void permitUnidentifiedArtifacts();
+
+    /** Record the fact that sources in the default package are permitted */
+    public abstract void permitDefaultPackage();
+
+    /** Record server configuration parameters */
+    public abstract void serverConf(String serverConf);
+
+    /** Record server launch configuration parameters */
+    public abstract void startServerConf(String serverConf);
+
+    /** Record some arguments to be passed on to javac */
+    public abstract void javacArg(String... arg);
+
+    /** Sets the destination directory for the compilation */
+    public abstract void destDir(Path dir);
+
+    /** Sets the directory for generated sources */
+    public abstract void generatedSourcesDir(Path genSrcDir);
+
+    /** Sets the directory for generated headers */
+    public abstract void headerDir(Path dir);
+
+    /** Sets the implicit policy */
+    public abstract void implicit(String policy);
+
+
+    /**
+     * Traverses an array of arguments and performs the appropriate callbacks.
+     *
+     * @param args the arguments to traverse.
+     */
+    void traverse(String[] args) {
+
+        ArgumentIterator argIter = new ArgumentIterator(Arrays.asList(args));
+
+        nextArg:
+        while (argIter.hasNext()) {
+
+            String arg = argIter.next();
+
+            if (arg.startsWith("-")) {
+                for (Option opt : Option.values()) {
+                    if (opt.processCurrent(argIter, this))
+                        continue nextArg;
+                }
+
+                javacArg(arg);
+
+                // Does this javac argument take an argument? If so, don't
+                // let it pass on to sjavac as a source root directory.
+                for (com.sun.tools.javac.main.Option javacOpt : com.sun.tools.javac.main.Option.values()) {
+                    if (javacOpt.matches(arg)) {
+                        boolean takesArgument = javacOpt.hasArg();
+                        boolean separateToken = !arg.contains(":") && !arg.contains("=");
+                        if (takesArgument && separateToken)
+                            javacArg(argIter.next());
+                    }
+                }
+            } else {
+                sourceRoots(Arrays.asList(Paths.get(arg)));
+            }
+        }
+    }
+}
diff --git a/langtools/src/share/classes/com/sun/tools/sjavac/options/Options.java b/langtools/src/share/classes/com/sun/tools/sjavac/options/Options.java
new file mode 100644
index 0000000..e27c6ac
--- /dev/null
+++ b/langtools/src/share/classes/com/sun/tools/sjavac/options/Options.java
@@ -0,0 +1,490 @@
+/*
+ * 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.sjavac.options;
+
+import java.nio.file.Path;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import com.sun.tools.sjavac.Transformer;
+
+/**
+ * Instances of this class represent values for sjavac command line options.
+ */
+public class Options {
+
+    // Output directories
+    private Path destDir, genSrcDir, headerDir;
+
+    // Input directories
+    private List<SourceLocation> sources = new ArrayList<>();
+    private List<SourceLocation> sourceSearchPaths = new ArrayList<>();
+    private List<SourceLocation> classSearchPaths = new ArrayList<>();
+    private List<SourceLocation> moduleSearchPaths = new ArrayList<>();
+
+    private String logLevel = "info";
+
+    private boolean permitUnidentifiedArtifact = false;
+    private boolean permitSourcesInDefaultPackage = false;
+
+    private Path sourceReferenceList;
+    private int numCores = 4;
+    private String implicitPolicy = "none";
+    private List<String> javacArgs = new ArrayList<>();
+
+    private Map<String, Transformer> trRules = new HashMap<>();
+
+    private boolean startServer = false;
+
+    // Server configuration string
+    private String serverConf;
+
+    /** Get the policy for implicit classes */
+    public String getImplicitPolicy() {
+        return implicitPolicy;
+    }
+
+    /** Get the path for generated sources (or null if no such path is set) */
+    public Path getGenSrcDir() {
+        return genSrcDir;
+    }
+
+    /** Get the path for the destination directory */
+    public Path getDestDir() {
+        return destDir;
+    }
+
+    /** Get the path for the header directory (or null if no such path is set) */
+    public Path getHeaderDir() {
+        return headerDir;
+    }
+
+    /** Get all source locations for files to be compiled */
+    public List<SourceLocation> getSources() {
+        return sources;
+    }
+
+    /**
+     * Get all paths to search for classes in .java format. (Java-files in
+     * found here should not be compiled.
+     */
+    public List<SourceLocation> getSourceSearchPaths() {
+        return sourceSearchPaths;
+    }
+
+    /** Get all paths to search for classes in. */
+    public List<SourceLocation> getClassSearchPath() {
+        return classSearchPaths;
+    }
+
+    /** Get all paths to search for modules in. */
+    public List<SourceLocation> getModuleSearchPaths() {
+        return moduleSearchPaths;
+    }
+
+    /** Get the log level. */
+    public String getLogLevel() {
+        return logLevel;
+    }
+
+    /** Returns true iff artifacts in the output directories should be kept,
+     * even if they would not be generated in a clean build. */
+    public boolean isUnidentifiedArtifactPermitted() {
+        return permitUnidentifiedArtifact;
+    }
+
+    /** Returns true iff sources in the default package should be permitted. */
+    public boolean isDefaultPackagePermitted() {
+        return permitSourcesInDefaultPackage;
+    }
+
+    /** Get the path to the list of reference sources (or null if none is set) */
+    public Path getSourceReferenceList() {
+        return sourceReferenceList;
+    }
+
+    /** Get the number of cores to be used by sjavac */
+    public int getNumCores() {
+        return numCores;
+    }
+
+    /** Returns all arguments relevant to javac but irrelevant to sjavac. */
+    public List<String> getJavacArgs() {
+        return javacArgs;
+    }
+
+    /**
+     * Get a map which maps suffixes to transformers (for example
+     * ".java" -> CompileJavaPackages)
+     */
+    public Map<String, Transformer> getTranslationRules() {
+        return trRules;
+    }
+
+    /** Return true iff a new server should be started */
+    public boolean startServerFlag() {
+        return startServer;
+    }
+
+    /** Return the server configuration string. */
+    public String getServerConf() {
+        return serverConf;
+    }
+
+    /**
+     * Parses the given argument array and returns a corresponding Options
+     * instance.
+     */
+    public static Options parseArgs(String... args) {
+        Options options = new Options();
+        options.new ArgDecoderOptionHelper().traverse(args);
+        return options;
+    }
+
+    /** Returns true iff a .java file is among the javac arguments */
+    public boolean isJavaFilesAmongJavacArgs() {
+        for (String javacArg : javacArgs)
+            if (javacArg.endsWith(".java"))
+                return true;
+        return false;
+    }
+
+    /** Returns true iff an @-file is among the javac arguments */
+    public boolean isAtFilePresent() {
+        for (String javacArg : javacArgs)
+            if (javacArg.startsWith("@"))
+                return true;
+        return false;
+    }
+
+    /**
+     * Returns a string representation of the options that affect the result of
+     * the compilation. (Used for saving the state of the options used in a
+     * previous compile.)
+     */
+    public String getStateArgsString() {
+
+        // Local utility class for collecting the arguments
+        class StateArgs {
+
+            private List<String> args = new ArrayList<>();
+
+            void addArg(Option opt) {
+                args.add(opt.arg);
+            }
+
+            void addArg(Option opt, Object val) {
+                addArg(opt);
+                args.add(val.toString());
+            }
+
+            void addSourceLocations(Option opt, List<SourceLocation> locs) {
+                for (SourceLocation sl : locs) {
+                    for (String pkg : sl.includes) addArg(Option.I, pkg);
+                    for (String pkg : sl.excludes) addArg(Option.X, pkg);
+                    for (String f : sl.excludedFiles) addArg(Option.XF, f);
+                    for (String f : sl.includedFiles) addArg(Option.IF, f);
+                    addArg(opt, sl.getPath());
+                }
+            }
+
+            String getResult() {
+                String result = "";
+                for (String s : args)
+                    result += s + " ";
+                return result.trim();
+            }
+
+            public void addAll(Collection<String> toAdd) {
+                args.addAll(toAdd);
+            }
+        }
+
+        StateArgs args = new StateArgs();
+
+        // Directories
+        if (genSrcDir != null)
+            args.addArg(Option.S, genSrcDir.normalize());
+
+        if (headerDir != null)
+            args.addArg(Option.H, headerDir.normalize());
+
+        if (destDir != null)
+            args.addArg(Option.D, destDir.normalize());
+
+        // Source roots
+        args.addSourceLocations(Option.SRC, sources);
+        args.addSourceLocations(Option.SOURCEPATH, sourceSearchPaths);
+        args.addSourceLocations(Option.CLASSPATH,  classSearchPaths);
+        args.addSourceLocations(Option.MODULEPATH, moduleSearchPaths);
+
+        // Boolean options
+        if (permitSourcesInDefaultPackage)
+            args.addArg(Option.PERMIT_SOURCES_WITHOUT_PACKAGE);
+
+        if (permitUnidentifiedArtifact)
+            args.addArg(Option.PERMIT_UNIDENTIFIED_ARTIFACTS);
+
+        // Translation rules
+        for (Map.Entry<String, Transformer> tr : trRules.entrySet()) {
+            String val = tr.getKey() + "=" + tr.getValue().getClass().getName();
+            args.addArg(Option.TR, val);
+        }
+
+        // Javac args
+        args.addAll(javacArgs);
+
+        return args.getResult();
+    }
+
+
+    /** Extract the arguments to be passed on to javac. */
+    public String[] prepJavacArgs() {
+        List<String> args = new ArrayList<>();
+
+        // Output directories
+        args.add("-d");
+        args.add(destDir.toString());
+
+        if (getGenSrcDir() != null) {
+            args.add("-s");
+            args.add(genSrcDir.toString());
+        }
+
+        if (headerDir != null) {
+            args.add("-h");
+            args.add(headerDir.toString());
+        }
+
+        // Prep sourcepath
+        List<SourceLocation> sourcepath = new ArrayList<>();
+        sourcepath.addAll(sources);
+        sourcepath.addAll(sourceSearchPaths);
+        if (sourcepath.size() > 0) {
+            args.add("-sourcepath");
+            args.add(concatenateSourceLocations(sourcepath));
+        }
+
+        // Prep classpath
+        if (classSearchPaths.size() > 0) {
+            args.add("-classpath");
+            args.add(concatenateSourceLocations(classSearchPaths));
+        }
+
+        // This can't be anything but 'none'. Enforced by sjavac main method.
+        args.add("-implicit:" + implicitPolicy);
+
+        // Append javac-options (i.e. pass through options not recognized by
+        // sjavac to javac.)
+        args.addAll(javacArgs);
+
+        return args.toArray(new String[args.size()]);
+    }
+
+    // Helper method to join a list of source locations separated by
+    // File.pathSeparator
+    private static String concatenateSourceLocations(List<SourceLocation> locs) {
+        String s = "";
+        for (SourceLocation loc : locs)
+            s += (s.isEmpty() ? "" : java.io.File.pathSeparator) + loc.getPath();
+        return s;
+    }
+
+    // OptionHelper that records the traversed options in this Options instance.
+    private class ArgDecoderOptionHelper extends OptionHelper {
+
+        List<String> includes, excludes, includeFiles, excludeFiles;
+        {
+            resetFilters();
+        }
+
+        boolean headerProvided = false;
+        boolean genSrcProvided = false;
+
+        @Override
+        public void reportError(String msg) {
+            throw new IllegalArgumentException(msg);
+        }
+
+        @Override
+        public void sourceRoots(List<Path> paths) {
+            sources.addAll(createSourceLocations(paths));
+        }
+
+        @Override
+        public void exclude(String exclPattern) {
+            excludes.add(exclPattern);
+        }
+
+        @Override
+        public void include(String inclPattern) {
+            includes.add(inclPattern);
+        }
+
+        @Override
+        public void excludeFile(String exclFilePattern) {
+            excludeFiles.add(exclFilePattern);
+        }
+
+        @Override
+        public void includeFile(String inclFilePattern) {
+            includeFiles.add(inclFilePattern);
+        }
+
+        @Override
+        public void addTransformer(String suffix, Transformer tr) {
+            if (trRules.containsKey(suffix)) {
+                reportError("More than one transformer specified for " +
+                            "suffix " + suffix + ".");
+                return;
+            }
+            trRules.put(suffix, tr);
+        }
+
+        @Override
+        public void sourcepath(List<Path> paths) {
+            sourceSearchPaths.addAll(createSourceLocations(paths));
+        }
+
+        @Override
+        public void modulepath(List<Path> paths) {
+            moduleSearchPaths.addAll(createSourceLocations(paths));
+        }
+
+        @Override
+        public void classpath(List<Path> paths) {
+            classSearchPaths.addAll(createSourceLocations(paths));
+        }
+
+        @Override
+        public void numCores(int n) {
+            numCores = n;
+        }
+
+        @Override
+        public void logLevel(String level) {
+            logLevel = level;
+        }
+
+        @Override
+        public void compareFoundSources(Path referenceList) {
+            sourceReferenceList = referenceList;
+        }
+
+        @Override
+        public void permitUnidentifiedArtifacts() {
+            permitUnidentifiedArtifact = true;
+        }
+
+        @Override
+        public void permitDefaultPackage() {
+            permitSourcesInDefaultPackage = true;
+        }
+
+        @Override
+        public void serverConf(String conf) {
+            if (serverConf != null)
+                reportError("Can not specify more than one server configuration.");
+            else
+                serverConf = conf;
+        }
+
+        @Override
+        public void implicit(String policy) {
+            implicitPolicy = policy;
+        }
+
+        @Override
+        public void startServerConf(String conf) {
+            if (serverConf != null)
+                reportError("Can not specify more than one server configuration.");
+            else {
+                startServer = true;
+                serverConf = conf;
+            }
+        }
+
+        @Override
+        public void javacArg(String... arg) {
+            javacArgs.addAll(Arrays.asList(arg));
+        }
+
+        @Override
+        public void destDir(Path dir) {
+            if (destDir != null) {
+                reportError("Destination directory already specified.");
+                return;
+            }
+            destDir = dir.toAbsolutePath();
+        }
+
+        @Override
+        public void generatedSourcesDir(Path dir) {
+            if (genSrcProvided) {
+                reportError("Directory for generated sources already specified.");
+                return;
+            }
+            genSrcProvided = true;
+            genSrcDir = dir.toAbsolutePath();
+        }
+
+        @Override
+        public void headerDir(Path dir) {
+            if (headerProvided) {
+                reportError("Header directory already specified.");
+                return;
+            }
+            headerProvided = true;
+            headerDir = dir.toAbsolutePath();
+        }
+
+        private List<SourceLocation> createSourceLocations(List<Path> paths) {
+            List<SourceLocation> result = new ArrayList<>();
+            for (Path path : paths) {
+                result.add(new SourceLocation(
+                        path,
+                        includes,
+                        excludes,
+                        includeFiles,
+                        excludeFiles));
+            }
+            resetFilters();
+            return result;
+        }
+
+        private void resetFilters() {
+            includes = new ArrayList<>();
+            excludes = new ArrayList<>();
+            includeFiles = new ArrayList<>();
+            excludeFiles = new ArrayList<>();
+        }
+    }
+
+}
diff --git a/langtools/src/share/classes/com/sun/tools/sjavac/options/SourceLocation.java b/langtools/src/share/classes/com/sun/tools/sjavac/options/SourceLocation.java
new file mode 100644
index 0000000..b643cd6
--- /dev/null
+++ b/langtools/src/share/classes/com/sun/tools/sjavac/options/SourceLocation.java
@@ -0,0 +1,115 @@
+/*
+ * 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.sjavac.options;
+
+import java.nio.file.Path;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import com.sun.tools.sjavac.Module;
+import com.sun.tools.sjavac.ProblemException;
+import com.sun.tools.sjavac.Source;
+
+/**
+ * Represents a directory to be used for input to sjavac. (For instance a
+ * sourcepath or classpath.)
+ */
+public class SourceLocation {
+
+    // Path to the root directory
+    private Path path;
+
+    // Package include / exclude patterns and file includes / excludes.
+    List<String> includes, excludes, includedFiles, excludedFiles;
+
+    public SourceLocation(Path path,
+                          List<String> includes,
+                          List<String> excludes,
+                          List<String> includedFiles,
+                          List<String> excludedFiles) {
+        this.path = path;
+        this.includes = includes;
+        this.excludes = excludes;
+        this.includedFiles = includedFiles;
+        this.excludedFiles = excludedFiles;
+    }
+
+
+    /**
+     * Finds all files with the given suffix that pass the include / exclude
+     * filters in this source location.
+     *
+     * @param suffixes The set of suffixes to search for
+     * @param foundFiles The map in which to store the found files
+     * @param foundModules The map in which to store the found modules
+     * @param currentModule The current module
+     * @param permitSourcesInDefaultPackage true if sources in default package
+     *                                      are to be permitted
+     * @param inLinksrc true if in link source
+     */
+    public void findSourceFiles(Set<String> suffixes,
+                                Map<String, Source> foundFiles,
+                                Map<String, Module> foundModules,
+                                Module currentModule,
+                                boolean permitSourcesInDefaultPackage,
+                                boolean inLinksrc) {
+        try {
+            Source.scanRoot(path.toFile(), suffixes, excludes, includes,
+                    excludedFiles, includedFiles, foundFiles, foundModules,
+                    currentModule, permitSourcesInDefaultPackage, false,
+                    inLinksrc);
+        } catch (ProblemException e) {
+            e.printStackTrace();
+        }
+    }
+
+    /** Get the root directory of this source location */
+    public Path getPath() {
+        return path;
+    }
+
+    /** Get the package include patterns */
+    public List<String> getIncludes() {
+        return includes;
+    }
+
+    /** Get the package exclude patterns */
+    public List<String> getExcludes() {
+        return excludes;
+    }
+
+    /** Get the file include patterns */
+    public List<String> getIncludedFiles() {
+        return includedFiles;
+    }
+
+    /** Get the file exclude patterns */
+    public List<String> getExcludedFiles() {
+        return excludedFiles;
+    }
+
+}
diff --git a/langtools/src/share/classes/com/sun/tools/sjavac/server/JavacServer.java b/langtools/src/share/classes/com/sun/tools/sjavac/server/JavacServer.java
index 94eb1e6..2592a42 100644
--- a/langtools/src/share/classes/com/sun/tools/sjavac/server/JavacServer.java
+++ b/langtools/src/share/classes/com/sun/tools/sjavac/server/JavacServer.java
@@ -104,6 +104,17 @@
             allPortFiles = new HashMap<>();
         }
         PortFile pf = allPortFiles.get(filename);
+
+        // Port file known. Does it still exist?
+        if (pf != null) {
+            try {
+                if (!pf.exists())
+                    pf = null;
+            } catch (IOException ioex) {
+                ioex.printStackTrace();
+            }
+        }
+
         if (pf == null) {
             pf = new PortFile(filename);
             allPortFiles.put(filename, pf);
@@ -305,7 +316,7 @@
                     // We could not connect to the server. Try again.
                     attempts++;
                     try {
-                        Thread.sleep(WAIT_BETWEEN_CONNECT_ATTEMPTS);
+                        Thread.sleep(WAIT_BETWEEN_CONNECT_ATTEMPTS * 1000);
                     } catch (InterruptedException e) {
                     }
                 }
diff --git a/langtools/src/share/classes/com/sun/tools/sjavac/server/PortFile.java b/langtools/src/share/classes/com/sun/tools/sjavac/server/PortFile.java
index 511b1ca..f2540a2 100644
--- a/langtools/src/share/classes/com/sun/tools/sjavac/server/PortFile.java
+++ b/langtools/src/share/classes/com/sun/tools/sjavac/server/PortFile.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
diff --git a/langtools/test/com/sun/javadoc/5093723/T5093723.java b/langtools/test/com/sun/javadoc/5093723/T5093723.java
index 1b23bb1..8bea133 100644
--- a/langtools/test/com/sun/javadoc/5093723/T5093723.java
+++ b/langtools/test/com/sun/javadoc/5093723/T5093723.java
@@ -33,10 +33,8 @@
 
 public class T5093723 extends JavadocTester {
 
-    private static final String BUG_ID = "5093723";
-
     private static final String[] ARGS = new String[] {
-        "-d", BUG_ID + ".out", "-Xdoclint:none",
+        "-d", OUTPUT_DIR + ".out", "-Xdoclint:none",
         SRC_DIR + "/DocumentedClass.java",
         SRC_DIR + "/UndocumentedClass.java"
     };
@@ -46,12 +44,4 @@
         if (tester.runJavadoc(ARGS) != 0)
           throw new AssertionError("non-zero return code from javadoc");
     }
-
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/AccessSummary/AccessSummary.java b/langtools/test/com/sun/javadoc/AccessSummary/AccessSummary.java
index 009d987..0aa3aca 100644
--- a/langtools/test/com/sun/javadoc/AccessSummary/AccessSummary.java
+++ b/langtools/test/com/sun/javadoc/AccessSummary/AccessSummary.java
@@ -34,30 +34,27 @@
 
 public class AccessSummary extends JavadocTester {
 
-    private static final String BUG_ID = "4637604-4775148";
-    private static final String OUTPUT_DIR1 = "docs1-" + BUG_ID + "/";
-
     /**
      * Assign value for [ fileToSearch, stringToFind ]
      */
     private static final String[][] TESTARRAY1 = {
 
         // Test that the summary attribute appears
-        { OUTPUT_DIR1 + "overview-summary.html",
+        { "overview-summary.html",
                  "summary=\"Packages table, listing packages, and an explanation\"" },
 
         // Test that the summary attribute appears
-        { OUTPUT_DIR1 + "p1/C1.html",
+        { "p1/C1.html",
                  "summary=\"Constructor Summary table, listing constructors, and an explanation\"" },
 
         // Test that the summary attribute appears
-        { OUTPUT_DIR1 + "constant-values.html",
+        { "constant-values.html",
                  "summary=\"Constant Field Values table, listing constant fields, and values\"" }
     };
 
     // First test with -header only
     private static final String[] JAVADOC_ARGS = new String[] {
-            "-d", OUTPUT_DIR1,
+            "-d", OUTPUT_DIR,
             "-sourcepath", SRC_DIR,
             "p1", "p2"};
 
@@ -67,21 +64,7 @@
      */
     public static void main(String[] args) {
         JavadocTester tester = new AccessSummary();
-        run(tester, JAVADOC_ARGS,  TESTARRAY1, new String[][] {});
+        tester.run(JAVADOC_ARGS,  TESTARRAY1, new String[][] {});
         tester.printSummary();       // Necessary for string search
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/MetaTag/MetaTag.java b/langtools/test/com/sun/javadoc/MetaTag/MetaTag.java
index 893d118..49456b5 100644
--- a/langtools/test/com/sun/javadoc/MetaTag/MetaTag.java
+++ b/langtools/test/com/sun/javadoc/MetaTag/MetaTag.java
@@ -39,8 +39,6 @@
 public class MetaTag extends JavadocTester {
 
     //Test information.
-    private static final String BUG_ID = "4034096-4764726-6235799";
-    private static final String OUTPUT_DIR = "docs-" + BUG_ID;
     private static final SimpleDateFormat m_dateFormat = new SimpleDateFormat("yyyy-MM-dd");
 
     //Javadoc arguments.
@@ -63,65 +61,62 @@
     //Input for string search tests.
     private static final String[][] TEST = {
 
-        { OUTPUT_DIR + "/p1/C1.html",
+        { "p1/C1.html",
            "<meta name=\"keywords\" content=\"p1.C1 class\">" },
 
-        { OUTPUT_DIR + "/p1/C1.html",
+        { "p1/C1.html",
            "<meta name=\"keywords\" content=\"field1\">" },
 
-        { OUTPUT_DIR + "/p1/C1.html",
+        { "p1/C1.html",
            "<meta name=\"keywords\" content=\"field2\">" },
 
-        { OUTPUT_DIR + "/p1/C1.html",
+        { "p1/C1.html",
            "<meta name=\"keywords\" content=\"method1()\">" },
 
-        { OUTPUT_DIR + "/p1/C1.html",
+        { "p1/C1.html",
            "<meta name=\"keywords\" content=\"method2()\">" },
 
-        { OUTPUT_DIR + "/p1/package-summary.html",
+        { "p1/package-summary.html",
            "<meta name=\"keywords\" content=\"p1 package\">" },
 
-        { OUTPUT_DIR + "/overview-summary.html",
+        { "overview-summary.html",
            "<meta name=\"keywords\" content=\"Overview, Sample Packages\">" },
 
         //NOTE: Hopefully, this regression test is not run at midnight.  If the output
         //was generated yesterday and this test is run today, the test will fail.
-        {OUTPUT_DIR + "/overview-summary.html",
+        { "overview-summary.html",
            "<meta name=\"date\" "
                             + "content=\"" + m_dateFormat.format(new Date()) + "\">"},
     };
 
-    private static final String[][] NEGATED_TEST = NO_TEST;
-
-    private static final String[][] TEST2 = NO_TEST;
     private static final String[][] NEGATED_TEST2 = {
         //No keywords when -keywords is not used.
-        { OUTPUT_DIR + "-2/p1/C1.html",
+        { "p1/C1.html",
            "<META NAME=\"keywords\" CONTENT=\"p1.C1 class\">" },
 
-        { OUTPUT_DIR + "-2/p1/C1.html",
+        { "p1/C1.html",
            "<META NAME=\"keywords\" CONTENT=\"field1\">" },
 
-        { OUTPUT_DIR + "-2/p1/C1.html",
+        { "p1/C1.html",
            "<META NAME=\"keywords\" CONTENT=\"field2\">" },
 
-        { OUTPUT_DIR + "-2/p1/C1.html",
+        { "p1/C1.html",
            "<META NAME=\"keywords\" CONTENT=\"method1()\">" },
 
-        { OUTPUT_DIR + "-2/p1/C1.html",
+        { "p1/C1.html",
            "<META NAME=\"keywords\" CONTENT=\"method2()\">" },
 
-        { OUTPUT_DIR + "-2/p1/package-summary.html",
+        { "p1/package-summary.html",
            "<META NAME=\"keywords\" CONTENT=\"p1 package\">" },
 
-        { OUTPUT_DIR + "-2/overview-summary.html",
+        { "overview-summary.html",
            "<META NAME=\"keywords\" CONTENT=\"Overview Summary, Sample Packages\">" },
 
         //The date metatag should not show up when -notimestamp is used.
 
         //NOTE: Hopefully, this regression test is not run at midnight.  If the output
         //was generated yesterday and this test is run today, the test will fail.
-        {OUTPUT_DIR + "-2/overview-summary.html",
+        { "overview-summary.html",
            "<META NAME=\"date\" "
                             + "CONTENT=\"" + m_dateFormat.format(new Date()) + "\">"},
     };
@@ -132,22 +127,8 @@
      */
     public static void main(String[] args) {
         MetaTag tester = new MetaTag();
-        run(tester, ARGS, TEST, NEGATED_TEST);
-        run(tester, ARGS_NO_TIMESTAMP_NO_KEYWORDS, TEST2, NEGATED_TEST2);
+        tester.run(ARGS, TEST, NO_TEST);
+        tester.run(ARGS_NO_TIMESTAMP_NO_KEYWORDS, NO_TEST, NEGATED_TEST2);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/PackagesHeader/PackagesHeader.java b/langtools/test/com/sun/javadoc/PackagesHeader/PackagesHeader.java
index 159797a..aa7ba2d 100644
--- a/langtools/test/com/sun/javadoc/PackagesHeader/PackagesHeader.java
+++ b/langtools/test/com/sun/javadoc/PackagesHeader/PackagesHeader.java
@@ -37,12 +37,9 @@
 public class PackagesHeader extends JavadocTester {
 
     //Test information.
-    private static final String BUG_ID = "4766385";
-    private static final String OUTPUT_DIR = "docs-" + BUG_ID;
-
-    private static final String OUTPUT_DIR1 = "docs1-" + BUG_ID + "/";
-    private static final String OUTPUT_DIR2 = "docs2-" + BUG_ID + "/";
-    private static final String OUTPUT_DIR3 = "docs3-" + BUG_ID + "/";
+    private static final String OUTPUT_DIR1 = OUTPUT_DIR + "-1/";
+    private static final String OUTPUT_DIR2 = OUTPUT_DIR + "-2/";
+    private static final String OUTPUT_DIR3 = OUTPUT_DIR + "-3/";
 
     /**
      * Assign value for [ fileToSearch, stringToFind ]
@@ -50,7 +47,7 @@
     private static final String[][] TESTARRAY1 = {
 
         // Test that the -header shows up in the packages frame
-        { OUTPUT_DIR1 + "overview-frame.html",
+        { "overview-frame.html",
                  "Main Frame Header" }
     };
 
@@ -59,7 +56,7 @@
         // Test that the -packagesheader string shows
         // up in the packages frame
 
-        {  OUTPUT_DIR2 + "overview-frame.html",
+        { "overview-frame.html",
                  "Packages Frame Header" }
     };
 
@@ -67,10 +64,10 @@
 
         // Test that the both headers show up and are different
 
-        { OUTPUT_DIR3 + "overview-frame.html",
+        { "overview-frame.html",
                  "Packages Frame Header" },
 
-        { OUTPUT_DIR3 + "overview-summary.html",
+        { "overview-summary.html",
                  "Main Frame Header" }
     };
 
@@ -97,9 +94,6 @@
             "p1", "p2"};
 
 
-    //Input for string search tests.
-    private static final String[][] NEGATED_TEST = NO_TEST;
-
     /**
      * The entry point of the test.
      * @param args the array of command line arguments.
@@ -107,24 +101,10 @@
     public static void main(String[] args) {
         JavadocTester tester = new PackagesHeader();
 
-        run(tester, JAVADOC_ARGS1, TESTARRAY1, NEGATED_TEST);
-        run(tester, JAVADOC_ARGS2, TESTARRAY2, NEGATED_TEST);
-        run(tester, JAVADOC_ARGS3, TESTARRAY3, NEGATED_TEST);
+        tester.run(JAVADOC_ARGS1, TESTARRAY1, NO_TEST);
+        tester.run(JAVADOC_ARGS2, TESTARRAY2, NO_TEST);
+        tester.run(JAVADOC_ARGS3, TESTARRAY3, NO_TEST);
 
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/T6735320/T6735320.java b/langtools/test/com/sun/javadoc/T6735320/T6735320.java
index 21c82a9..531e4a6 100644
--- a/langtools/test/com/sun/javadoc/T6735320/T6735320.java
+++ b/langtools/test/com/sun/javadoc/T6735320/T6735320.java
@@ -31,20 +31,11 @@
  */
 public class T6735320 extends JavadocTester {
 
-    private static final String BUG_ID = "6735320";
     private static final String[] ARGS = new String[]{
-        "-d", BUG_ID + ".out",
+        "-d", OUTPUT_DIR + ".out",
         SRC_DIR + "/SerialFieldTest.java"
     };
 
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    public String getBugName() {
-        return getClass().getName();
-    }
-
     public static void main(String... args) {
         T6735320 tester = new T6735320();
         if (tester.runJavadoc(ARGS) == 0) {
diff --git a/langtools/test/com/sun/javadoc/_template/Template.java b/langtools/test/com/sun/javadoc/_template/Template.java
index 484a1ad..92a36f8 100644
--- a/langtools/test/com/sun/javadoc/_template/Template.java
+++ b/langtools/test/com/sun/javadoc/_template/Template.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,10 +33,6 @@
 
 public class Template extends JavadocTester {
 
-    //Test information.
-    private static final String BUG_ID = "<BUG ID>";
-    private static final String OUTPUT_DIR = "docs-" + BUG_ID;
-
     //Javadoc arguments.
     private static final String[] ARGS = new String[] {
         "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR
@@ -52,21 +48,7 @@
      */
     public static void main(String[] args) {
         Template tester = new Template();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NEGATED_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/_template/TemplateComplete.java b/langtools/test/com/sun/javadoc/_template/TemplateComplete.java
index 5c63487..cb15e98 100644
--- a/langtools/test/com/sun/javadoc/_template/TemplateComplete.java
+++ b/langtools/test/com/sun/javadoc/_template/TemplateComplete.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,10 +33,6 @@
 
 public class TemplateComplete extends JavadocTester {
 
-    //Test information.
-    private static final String BUG_ID = "<BUG ID>";
-    private static final String OUTPUT_DIR = "docs-" + BUG_ID;
-
     //Javadoc arguments.
     private static final String[] ARGS = new String[] {
         "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR
@@ -51,6 +47,8 @@
 
 
     //Input for file diff test.
+    private static final String DIFFDIR1 = null;
+    private static final String DIFFDIR2 = null;
     private static final String[][] FILES_TO_DIFF = {};
 
     /**
@@ -59,23 +57,9 @@
      */
     public static void main(String[] args) {
         TemplateComplete tester = new TemplateComplete();
-        int actualExitCode = run(tester, ARGS, TEST, NEGATED_TEST);
+        int actualExitCode = tester.run(ARGS, TEST, NEGATED_TEST);
         tester.checkExitCode(EXPECTED_EXIT_CODE, actualExitCode);
-        tester.runDiffs(FILES_TO_DIFF, false);
+        tester.runDiffs(DIFFDIR1, DIFFDIR2, FILES_TO_DIFF, false);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/constantValues/TestConstantValuesDriver.java b/langtools/test/com/sun/javadoc/constantValues/TestConstantValuesDriver.java
index 23ffb0d..5c17d7e 100644
--- a/langtools/test/com/sun/javadoc/constantValues/TestConstantValuesDriver.java
+++ b/langtools/test/com/sun/javadoc/constantValues/TestConstantValuesDriver.java
@@ -33,9 +33,8 @@
  */
 public class TestConstantValuesDriver extends JavadocTester {
 
-    private static final String BUG_ID = "4504730-4526070-5077317";
     private static final String[] ARGS = new String[] {
-        "-d", BUG_ID, SRC_DIR + "/TestConstantValues.java",
+        "-d", OUTPUT_DIR, SRC_DIR + "/TestConstantValues.java",
         SRC_DIR + "/TestConstantValues2.java",
         SRC_DIR + "/A.java"
     };
@@ -47,31 +46,17 @@
     public static void main(String[] args) {
         String[][] tests = new String[5][2];
         for (int i = 0; i < tests.length-1; i++) {
-            tests[i][0] = BUG_ID + "/constant-values.html";
+            tests[i][0] = "constant-values.html";
             tests[i][1] = "TEST"+(i+1)+"PASSES";
         }
-        tests[tests.length-1][0] = BUG_ID + "/constant-values.html";
+        tests[tests.length-1][0] = "constant-values.html";
         tests[tests.length-1][1] = "<code>\"&lt;Hello World&gt;\"</code>";
         TestConstantValuesDriver tester = new TestConstantValuesDriver();
-        run(tester, ARGS, tests, NO_TEST);
+        tester.run(ARGS, tests, NO_TEST);
         tester.printSummary();
     }
 
     /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
-
-    /**
      * @throws java.io.IOException Test 1 passes
      * @throws java.io.IOException Test 2 passes
      * @throws java.lang.NullPointerException comment three
diff --git a/langtools/test/com/sun/javadoc/dupThrowsTags/TestDupThrowsTags.java b/langtools/test/com/sun/javadoc/dupThrowsTags/TestDupThrowsTags.java
index b5c63a3..b186e61 100644
--- a/langtools/test/com/sun/javadoc/dupThrowsTags/TestDupThrowsTags.java
+++ b/langtools/test/com/sun/javadoc/dupThrowsTags/TestDupThrowsTags.java
@@ -33,9 +33,8 @@
  */
 public class TestDupThrowsTags extends JavadocTester {
 
-    private static final String BUG_ID = "4525364";
     private static final String[] ARGS = new String[] {
-        "-d", BUG_ID, SRC_DIR + "/TestDupThrowsTags.java"
+        "-d", OUTPUT_DIR, SRC_DIR + "/TestDupThrowsTags.java"
     };
 
     /**
@@ -45,29 +44,15 @@
     public static void main(String[] args) {
         String[][] tests = new String[4][2];
         for (int i = 0; i < tests.length; i++) {
-            tests[i][0] = BUG_ID + "/TestDupThrowsTags.html";
+            tests[i][0] = "TestDupThrowsTags.html";
             tests[i][1] = "Test "+(i+1)+" passes";
         }
         TestDupThrowsTags tester = new TestDupThrowsTags();
-        run(tester, ARGS, tests, NO_TEST);
+        tester.run(ARGS, tests, NO_TEST);
         tester.printSummary();
     }
 
     /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
-
-    /**
      * @throws java.io.IOException Test 1 passes
      * @throws java.io.IOException Test 2 passes
      * @throws java.lang.NullPointerException Test 3 passes
diff --git a/langtools/test/com/sun/javadoc/lib/JavadocTester.java b/langtools/test/com/sun/javadoc/lib/JavadocTester.java
index c7b6ab2..5149d93 100644
--- a/langtools/test/com/sun/javadoc/lib/JavadocTester.java
+++ b/langtools/test/com/sun/javadoc/lib/JavadocTester.java
@@ -21,8 +21,6 @@
  * questions.
  */
 
-import com.sun.javadoc.*;
-import java.util.*;
 import java.io.*;
 
 
@@ -56,6 +54,7 @@
 
     protected static final String SRC_DIR = System.getProperty("test.src", ".");
     protected static final String JAVA_VERSION = System.getProperty("java.version");
+    protected static final String OUTPUT_DIR = "out";
     protected static final String[][] NO_TEST = new String[][] {};
     protected static final String[] NO_FILE_TEST = new String[] {};
 
@@ -105,11 +104,16 @@
     public StringWriter warnings;
 
     /**
-     * The buffer of warning output..
+     * The buffer of warning output.
      */
     public StringBuffer standardOut;
 
     /**
+     * The output directory.
+     */
+    private File outputDir;
+
+    /**
      * The current subtest number.
      */
     private static int numTestsRun = 0;
@@ -131,37 +135,23 @@
     }
 
     /**
-     * Return the bug id.
-     * @return the bug id
-     */
-    public abstract String getBugId();
-
-    /**
-     * Return the name of the bug.
-     * @return the name of the bug
-     */
-    public abstract String getBugName();
-
-    /**
      * Execute the tests.
      *
-     * @param tester           the tester to execute
      * @param args             the arguments to pass to Javadoc
      * @param testArray        the array of tests
      * @param negatedTestArray the array of negated tests
      * @return                 the return code for the execution of Javadoc
      */
-    public static int run(JavadocTester tester, String[] args,
+    public int run(String[] args,
             String[][] testArray, String[][] negatedTestArray) {
-        int returnCode = tester.runJavadoc(args);
-        tester.runTestsOnHTML(testArray, negatedTestArray);
+        int returnCode = runJavadoc(args);
+        runTestsOnHTML(testArray, negatedTestArray);
         return returnCode;
     }
 
     /**
      * Execute the tests.
      *
-     * @param tester               the tester to execute
      * @param args                 the arguments to pass to Javadoc
      * @param testArray            the array of tests
      * @param negatedTestArray     the array of negated tests
@@ -169,12 +159,12 @@
      * @param negatedFileTestArray the array of negated file tests
      * @return                     the return code for the execution of Javadoc
      */
-    public static int run(JavadocTester tester, String[] args,
-            String[][] testArray, String[][] negatedTestArray, String[] fileTestArray,
-            String[] negatedFileTestArray) {
-        int returnCode = tester.runJavadoc(args);
-        tester.runTestsOnHTML(testArray, negatedTestArray);
-        tester.runTestsOnFile(fileTestArray, negatedFileTestArray);
+    public int run(String[] args,
+            String[][] testArray, String[][] negatedTestArray,
+            String[] fileTestArray, String[] negatedFileTestArray) {
+        int returnCode = runJavadoc(args);
+        runTestsOnHTML(testArray, negatedTestArray);
+        runTestsOnFile(fileTestArray, negatedFileTestArray);
         return returnCode;
     }
 
@@ -208,6 +198,13 @@
                                     + javadocRunNum + ")...");
         }
         initOutputBuffers();
+        outputDir = new File(".");
+        for (int i = 0; i < args.length - 2; i++) {
+            if (args[i].equals("-d")) {
+                outputDir = new File(args[++i]);
+                break;
+            }
+        }
 
         ByteArrayOutputStream stdout = new ByteArrayOutputStream();
         PrintStream prevOut = System.out;
@@ -218,7 +215,7 @@
         System.setErr(new PrintStream(stderr));
 
         int returnCode = com.sun.tools.javadoc.Main.execute(
-                getBugName(),
+                "javadoc",
                 new PrintWriter(errors, true),
                 new PrintWriter(warnings, true),
                 new PrintWriter(notices, true),
@@ -260,60 +257,53 @@
      * Run array of tests on the generated files.
      * This method accepts a fileTestArray for testing if a file is generated
      * and a negatedFileTestArray for testing if a file is not found.
+     * The files are relative to the most recent output directory specified
+     * with -d.
      *
-     * @param testArray         the array of file tests
-     * @param negatedTestArray  the array of negated file tests
+     * @param fileTestArray         the array of file tests
+     * @param negatedFileTestArray  the array of negated file tests
      */
     public void runTestsOnFile(String[] fileTestArray, String[] negatedFileTestArray) {
-        runTestsOnFile(fileTestArray, false);
-        runTestsOnFile(negatedFileTestArray, true);
+        runTestsOnFile(outputDir, fileTestArray, false);
+        runTestsOnFile(outputDir, negatedFileTestArray, true);
     }
 
     /**
      * Run the array of tests on the resulting HTML.
+     * The files are relative to the most recent output directory specified
+     * with -d.
      *
      * @param testArray the array of tests
      * @param isNegated true if test is negated; false otherwise
      */
     private void runTestsOnHTML(String[][] testArray , boolean isNegated) {
-        for (int i = 0; i < testArray.length; i++) {
-
+        for (String[] test : testArray) {
             numTestsRun++;
-
             System.out.print("Running subtest #" + numTestsRun + "... ");
-
             // Get string to find
-            String stringToFind = testArray[i][1];
-
+            String stringToFind = test[1];
             // Read contents of file into a string
             String fileString;
             try {
-                fileString = readFileToString(testArray[i][0]);
+                fileString = readFileToString(outputDir, test[0]);
             } catch (Error e) {
                 if (isNegated) {
-                  System.out.println( "FAILED" + "\n"
-                                    + "for bug " + getBugId()
-                                    + " (" + getBugName() + ") "
-                                    + "due to "
-                                    + e + "\n");
-                  continue;
+                    System.out.println( "FAILED, due to " + e + "\n");
+                    continue;
                 }
                 throw e;
             }
             // Find string in file's contents
             boolean isFound = findString(fileString, stringToFind);
-            if ((isNegated && !isFound) || (!isNegated && isFound) ) {
+            if ((isNegated && !isFound) || (!isNegated && isFound)) {
                 numTestsPassed += 1;
-                System.out.println( "Passed" + "\n"
-                                    + (isNegated ? "not found:" : "found:") + "\n"
-                                    + stringToFind + " in " + testArray[i][0] + "\n");
+                System.out.println("Passed" + "\n"
+                        + (isNegated ? "not found:" : "found:") + "\n"
+                        + stringToFind + " in " + test[0] + "\n");
             } else {
-                System.out.println( "FAILED" + "\n"
-                                    + "for bug " + getBugId()
-                                    + " (" + getBugName() + ")" + "\n"
-                                    + "when searching for:" + "\n"
-                                    + stringToFind
-                                    + " in " + testArray[i][0] + "\n");
+                System.out.println("FAILED, when searching for:" + "\n"
+                        + stringToFind
+                        + " in " + test[0] + "\n");
             }
         }
     }
@@ -324,21 +314,15 @@
      * @param testArray the array of file tests
      * @param isNegated true if test is negated; false otherwise
      */
-    private void runTestsOnFile(String[] testArray, boolean isNegated) {
-        String fileName;
-        String failedString;
-        String passedString;
-        for (int i = 0; i < testArray.length; i++) {
+    private void runTestsOnFile(File baseDir, String[] testArray, boolean isNegated) {
+        for (String fileName : testArray) {
             numTestsRun++;
-            fileName = testArray[i];
-            failedString = "FAILED" + "\n"
-                    + "for bug " + getBugId() + " (" + getBugName() + ") "
-                    + "file (" + fileName + ") found" + "\n";
-            passedString = "Passed" + "\n" +
-                        "file (" + fileName + ") not found" + "\n";
+            String failedString = "FAILED: file (" + fileName + ") found" + "\n";
+            String passedString = "Passed" + "\n" +
+                    "file (" + fileName + ") not found" + "\n";
             System.out.print("Running subtest #" + numTestsRun + "... ");
             try {
-                File file = new File(fileName);
+                File file = new File(baseDir, fileName);
                 if ((file.exists() && !isNegated) || (!file.exists() && isNegated)) {
                     numTestsPassed += 1;
                     System.out.println(passedString);
@@ -354,27 +338,33 @@
     /**
      * Iterate through the list of given file pairs and diff each file.
      *
-     * @param filePairs the pairs of files to diff.
-     * @throws an Error is thrown if any differences are found between
+     * @param baseDir1 the directory containing the first set of files
+     * @param baseDir2 the directory containing the second set of files
+     * @param files the set of files to be compared
+     * @throws Error if any differences are found between
      * file pairs.
      */
-    public void runDiffs(String[][] filePairs) throws Error {
-        runDiffs(filePairs, true);
+    public void runDiffs(String baseDir1, String baseDir2, String[] files) throws Error {
+        runDiffs(baseDir1, baseDir2, files, true);
     }
 
     /**
      * Iterate through the list of given file pairs and diff each file.
      *
-     * @param filePairs the pairs of files to diff.
-     * @param throwErrorIFNoMatch flag to indicate whether or not to throw
+     * @param baseDir1 the directory containing the first set of files
+     * @param baseDir2 the directory containing the second set of files
+     * @param files the set of files to be compared
+     * @param throwErrorIfNoMatch flag to indicate whether or not to throw
      * an error if the files do not match.
      *
-     * @throws an Error is thrown if any differences are found between
-     * file pairs and throwErrorIFNoMatch is true.
+     * @throws Error if any differences are found between
+     * file pairs and throwErrorIfNoMatch is true.
      */
-    public void runDiffs(String[][] filePairs, boolean throwErrorIfNoMatch) throws Error {
-        for (int i = 0; i < filePairs.length; i++) {
-            diff(filePairs[i][0], filePairs[i][1], throwErrorIfNoMatch);
+    public void runDiffs(String baseDir1, String baseDir2, String[] files, boolean throwErrorIfNoMatch) throws Error {
+        File bd1 = new File(baseDir1);
+        File bd2 = new File(baseDir2);
+        for (String file : files) {
+            diff(bd1, bd2, file, throwErrorIfNoMatch);
         }
     }
 
@@ -394,8 +384,7 @@
                 actualExitCode);
             numTestsPassed++;
         } else {
-            System.out.println( "FAILED" + "\n" + "for bug " + getBugId()
-                + " (" + getBugName() + ")" + "\n" + "Expected return code " +
+            System.out.println( "FAILED: expected return code " +
                 expectedExitCode + " but got " + actualExitCode);
         }
     }
@@ -412,8 +401,7 @@
             // Test failed
             throw new Error("\n" + (numTestsRun - numTestsPassed)
                                     + " of " + (numTestsRun)
-                                    + " subtests failed for bug " + getBugId()
-                                    + " (" + getBugName() + ")" + "\n");
+                                    + " subtests failed\n");
         }
     }
 
@@ -434,28 +422,39 @@
      * @return          the file in string format
      */
     public String readFileToString(String fileName) throws Error {
-        if (fileName.equals(ERROR_OUTPUT)) {
-            return getErrorOutput();
-        } else if (fileName.equals(NOTICE_OUTPUT)) {
-            return getNoticeOutput();
-        } else if (fileName.equals(WARNING_OUTPUT)) {
-            return getWarningOutput();
-        } else if (fileName.equals(STANDARD_OUTPUT)) {
-            return getStandardOutput();
+        return readFileToString(outputDir, fileName);
+    }
+
+    /**
+     * Read the file and return it as a string.
+     *
+     * @param baseDir   the directory in which to locate the file
+     * @param fileName  the name of the file to read
+     * @return          the file in string format
+     */
+    private String readFileToString(File baseDir, String fileName) throws Error {
+        switch (fileName) {
+            case ERROR_OUTPUT:
+                return getErrorOutput();
+            case NOTICE_OUTPUT:
+                return getNoticeOutput();
+            case WARNING_OUTPUT:
+                return getWarningOutput();
+            case STANDARD_OUTPUT:
+                return getStandardOutput();
         }
         try {
-            File file = new File(fileName);
+            File file = new File(baseDir, fileName);
             if ( !file.exists() ) {
                 System.out.println("\n" + "FILE DOES NOT EXIST: " + fileName);
             }
-            BufferedReader in = new BufferedReader(new FileReader(file));
-
-            // Create an array of characters the size of the file
-            char[] allChars = new char[(int)file.length()];
-
-            // Read the characters into the allChars array
-            in.read(allChars, 0, (int)file.length());
-            in.close();
+            char[] allChars;
+            try (BufferedReader in = new BufferedReader(new FileReader(file))) {
+                // Create an array of characters the size of the file
+                allChars = new char[(int)file.length()];
+                // Read the characters into the allChars array
+                in.read(allChars, 0, (int)file.length());
+            }
 
             // Convert to a string
             String allCharsString = new String(allChars);
@@ -472,22 +471,24 @@
     /**
      * Compare the two given files.
      *
-     * @param file1 the first file to compare.
-     * @param file2 the second file to compare.
+     * @param baseDir1 the directory in which to locate the first file
+     * @param baseDir2 the directory in which to locate the second file
+     * @param file the file to compare in the two base directories
      * @param throwErrorIFNoMatch flag to indicate whether or not to throw
      * an error if the files do not match.
      * @return true if the files are the same and false otherwise.
      */
-    public boolean diff(String file1, String file2, boolean throwErrorIFNoMatch) throws Error {
-        String file1Contents = readFileToString(file1);
-        String file2Contents = readFileToString(file2);
+    private boolean diff(File baseDir1, File baseDir2, String file,
+            boolean throwErrorIFNoMatch) throws Error {
+        String file1Contents = readFileToString(baseDir1, file);
+        String file2Contents = readFileToString(baseDir2, file);
         numTestsRun++;
         if (file1Contents.trim().compareTo(file2Contents.trim()) == 0) {
-            System.out.println("Diff successful: " + file1 + ", " + file2);
+            System.out.println("Diff successful: " + new File(baseDir1, file) + ", " + new File(baseDir2, file));
             numTestsPassed++;
             return true;
         } else if (throwErrorIFNoMatch) {
-            throw new Error("Diff failed: " + file1 + ", " + file2);
+            throw new Error("Diff failed: " + new File(baseDir1, file) + ", " + new File(baseDir2, file));
         } else {
             return false;
         }
@@ -561,12 +562,12 @@
                 destDirObj.mkdir();
             }
             String[] files = targetDirObj.list();
-            for (int i = 0; i < files.length; i++) {
-                File srcFile = new File(targetDirObj, files[i]);
-                File destFile = new File(destDirObj, files[i]);
+            for (String file : files) {
+                File srcFile = new File(targetDirObj, file);
+                File destFile = new File(destDirObj, file);
                 if (srcFile.isFile()) {
                     System.out.println("Copying " + srcFile + " to " + destFile);
-                        copyFile(destFile, srcFile);
+                    copyFile(destFile, srcFile);
                 } else if(srcFile.isDirectory()) {
                     copyDir(srcFile.getAbsolutePath(), destDirObj.getAbsolutePath());
                 }
@@ -579,13 +580,15 @@
     /**
      * Copy source file to destination file.
      *
+     * @param destfile the destination file
+     * @param srcfile the source file
      * @throws SecurityException
      * @throws IOException
      */
     public static void copyFile(File destfile, File srcfile)
         throws IOException {
         byte[] bytearr = new byte[512];
-        int len = 0;
+        int len;
         FileInputStream input = new FileInputStream(srcfile);
         File destDir = destfile.getParentFile();
         destDir.mkdirs();
@@ -594,8 +597,7 @@
             while ((len = input.read(bytearr)) != -1) {
                 output.write(bytearr, 0, len);
             }
-        } catch (FileNotFoundException exc) {
-        } catch (SecurityException exc) {
+        } catch (FileNotFoundException | SecurityException exc) {
         } finally {
             input.close();
             output.close();
diff --git a/langtools/test/com/sun/javadoc/testAbsLinkPath/TestAbsLinkPath.java b/langtools/test/com/sun/javadoc/testAbsLinkPath/TestAbsLinkPath.java
index e76b86e..292f571 100644
--- a/langtools/test/com/sun/javadoc/testAbsLinkPath/TestAbsLinkPath.java
+++ b/langtools/test/com/sun/javadoc/testAbsLinkPath/TestAbsLinkPath.java
@@ -34,10 +34,8 @@
 
 public class TestAbsLinkPath extends JavadocTester {
 
-    private static final String BUG_ID = "4640745";
     private static final String[][] TEST = {
-        {"tmp/pkg1/C1.html", "C2.html"}};
-    private static final String[][] NEGATED_TEST = NO_TEST;
+        { "pkg1/C1.html", "C2.html"}};
 
     private static final String[] ARGS1 =
         new String[] {
@@ -53,22 +51,8 @@
      */
     public static void main(String[] args) {
         TestAbsLinkPath tester = new TestAbsLinkPath();
-        run(tester, ARGS1, NO_TEST, NO_TEST);
-        run(tester, ARGS2,  TEST, NEGATED_TEST);
+        tester.run(ARGS1, NO_TEST, NO_TEST);
+        tester.run(ARGS2,  TEST, NO_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testAbstractMethod/TestAbstractMethod.java b/langtools/test/com/sun/javadoc/testAbstractMethod/TestAbstractMethod.java
index 1c5c915..600affe 100644
--- a/langtools/test/com/sun/javadoc/testAbstractMethod/TestAbstractMethod.java
+++ b/langtools/test/com/sun/javadoc/testAbstractMethod/TestAbstractMethod.java
@@ -35,18 +35,17 @@
 public class TestAbstractMethod extends JavadocTester {
 
     //Test information.
-    private static final String BUG_ID = "8004891";
 
     //Javadoc arguments.
     private static final String[] ARGS = new String[] {
-        "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg"
+        "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg"
     };
 
     //Input for string search tests.
     private static final String[][] TEST = {
-        {BUG_ID + "/pkg/A.html",
+        { "pkg/A.html",
             "<td class=\"colFirst\"><code>default void</code></td>"},
-        {BUG_ID + "/pkg/A.html",
+        { "pkg/A.html",
             "<caption><span id=\"t0\" class=\"activeTableTab\"><span>" +
             "All Methods</span><span class=\"tabEnd\">&nbsp;</span></span>" +
             "<span id=\"t2\" class=\"tableTab\"><span>" +
@@ -57,7 +56,7 @@
             "</span><span id=\"t5\" class=\"tableTab\"><span>" +
             "<a href=\"javascript:show(16);\">Default Methods</a></span>" +
             "<span class=\"tabEnd\">&nbsp;</span></span></caption>"},
-        {BUG_ID + "/pkg/B.html",
+        { "pkg/B.html",
             "<caption><span id=\"t0\" class=\"activeTableTab\"><span>" +
             "All Methods</span><span class=\"tabEnd\">&nbsp;</span></span>" +
             "<span id=\"t2\" class=\"tableTab\"><span>" +
@@ -68,9 +67,9 @@
             "<span id=\"t4\" class=\"tableTab\"><span>" +
             "<a href=\"javascript:show(8);\">Concrete Methods</a></span>" +
             "<span class=\"tabEnd\">&nbsp;</span></span></caption>"},
-        {BUG_ID + "/pkg/B.html",
+        { "pkg/B.html",
             "<td class=\"colFirst\"><code>abstract void</code></td>"},
-        {BUG_ID + "/pkg/C.html",
+        { "pkg/C.html",
             "<caption><span id=\"t0\" class=\"activeTableTab\"><span>" +
             "All Methods</span><span class=\"tabEnd\">&nbsp;</span></span>" +
             "<span id=\"t2\" class=\"tableTab\"><span>" +
@@ -79,18 +78,18 @@
             "<span id=\"t5\" class=\"tableTab\"><span>" +
             "<a href=\"javascript:show(16);\">Default Methods</a></span>" +
             "<span class=\"tabEnd\">&nbsp;</span></span></caption>"},
-        {BUG_ID + "/pkg/C.html",
+        { "pkg/C.html",
             "<td class=\"colFirst\"><code>default void</code></td>"}
     };
     private static final String[][] NEGATED_TEST = {
-        {BUG_ID + "/pkg/A.html",
+        { "pkg/A.html",
             "<td class=\"colFirst\"><code>abstract void</code></td>"},
-        {BUG_ID + "/pkg/B.html",
+        { "pkg/B.html",
             "<span><a href=\"javascript:show(16);\">Default Methods</a></span>" +
             "<span class=\"tabEnd\">&nbsp;</span>"},
-        {BUG_ID + "/pkg/B.html",
+        { "pkg/B.html",
             "<td class=\"colFirst\"><code>default void</code></td>"},
-        {BUG_ID + "/pkg/C.html",
+        { "pkg/C.html",
             "<span><a href=\"javascript:show(4);\">Abstract Methods</a></span>" +
             "<span class=\"tabEnd\">&nbsp;</span>"}
     };
@@ -101,21 +100,7 @@
      */
     public static void main(String[] args) {
         TestAbstractMethod tester = new TestAbstractMethod();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NEGATED_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testAnchorNames/TestAnchorNames.java b/langtools/test/com/sun/javadoc/testAnchorNames/TestAnchorNames.java
index f4b69c8..af24729 100644
--- a/langtools/test/com/sun/javadoc/testAnchorNames/TestAnchorNames.java
+++ b/langtools/test/com/sun/javadoc/testAnchorNames/TestAnchorNames.java
@@ -33,41 +33,40 @@
 
 public class TestAnchorNames extends JavadocTester {
 
-    private static final String BUG_ID = "8025633";
 
     //Input for string search tests.
     private static final String[][] TEST = {
 
         //Test some section markers and links to these markers
 
-        {BUG_ID + "/pkg1/RegClass.html",
+        { "pkg1/RegClass.html",
             "<a name=\"skip.navbar.top\">"
         },
-        {BUG_ID + "/pkg1/RegClass.html",
+        { "pkg1/RegClass.html",
             "<a href=\"#skip.navbar.top\" title=\"Skip navigation links\">"
         },
-        {BUG_ID + "/pkg1/RegClass.html",
+        { "pkg1/RegClass.html",
             "<a name=\"nested.class.summary\">"
         },
-        {BUG_ID + "/pkg1/RegClass.html",
+        { "pkg1/RegClass.html",
             "<a href=\"#nested.class.summary\">"
         },
-        {BUG_ID + "/pkg1/RegClass.html",
+        { "pkg1/RegClass.html",
             "<a name=\"method.summary\">"
         },
-        {BUG_ID + "/pkg1/RegClass.html",
+        { "pkg1/RegClass.html",
             "<a href=\"#method.summary\">"
         },
-        {BUG_ID + "/pkg1/RegClass.html",
+        { "pkg1/RegClass.html",
             "<a name=\"field.detail\">"
         },
-        {BUG_ID + "/pkg1/RegClass.html",
+        { "pkg1/RegClass.html",
             "<a href=\"#field.detail\">"
         },
-        {BUG_ID + "/pkg1/RegClass.html",
+        { "pkg1/RegClass.html",
             "<a name=\"constructor.detail\">"
         },
-        {BUG_ID + "/pkg1/RegClass.html",
+        { "pkg1/RegClass.html",
             "<a href=\"#constructor.detail\">"
         },
 
@@ -75,170 +74,170 @@
 
         //The marker for this appears in the serialized-form.html which we will
         //test below
-        {BUG_ID + "/pkg1/RegClass.html",
+        { "pkg1/RegClass.html",
             "<a href=\"../serialized-form.html#pkg1.RegClass\">"
         },
         //Test some fields
-        {BUG_ID + "/pkg1/RegClass.html",
+        { "pkg1/RegClass.html",
             "<a name=\"Z:Z_\">"
         },
-        {BUG_ID + "/pkg1/RegClass.html",
+        { "pkg1/RegClass.html",
             "<a href=\"../pkg1/RegClass.html#Z:Z_\">"
         },
-        {BUG_ID + "/pkg1/RegClass.html",
+        { "pkg1/RegClass.html",
             "<a name=\"Z:Z_:D\">"
         },
-        {BUG_ID + "/pkg1/RegClass.html",
+        { "pkg1/RegClass.html",
             "<a href=\"../pkg1/RegClass.html#Z:Z_:D\">"
         },
-        {BUG_ID + "/pkg1/RegClass.html",
+        { "pkg1/RegClass.html",
             "<a name=\"Z:Z:D_\">"
         },
-        {BUG_ID + "/pkg1/RegClass.html",
+        { "pkg1/RegClass.html",
             "<a href=\"../pkg1/RegClass.html#Z:Z:D_\">"
         },
-        {BUG_ID + "/pkg1/RegClass.html",
+        { "pkg1/RegClass.html",
             "<a name=\"Z:Z:Dfield\">"
         },
-        {BUG_ID + "/pkg1/RegClass.html",
+        { "pkg1/RegClass.html",
             "<a href=\"../pkg1/RegClass.html#Z:Z:Dfield\">"
         },
-        {BUG_ID + "/pkg1/RegClass.html",
+        { "pkg1/RegClass.html",
             "<a name=\"fieldInCla:D:D\">"
         },
-        {BUG_ID + "/pkg1/RegClass.html",
+        { "pkg1/RegClass.html",
             "<a href=\"../pkg1/RegClass.html#fieldInCla:D:D\">"
         },
-        {BUG_ID + "/pkg1/RegClass.html",
+        { "pkg1/RegClass.html",
             "<a name=\"S_:D:D:D:D:DINT\">"
         },
-        {BUG_ID + "/pkg1/RegClass.html",
+        { "pkg1/RegClass.html",
             "<a href=\"../pkg1/RegClass.html#S_:D:D:D:D:DINT\">"
         },
-        {BUG_ID + "/pkg1/RegClass.html",
+        { "pkg1/RegClass.html",
             "<a name=\"method:D:D\">"
         },
-        {BUG_ID + "/pkg1/RegClass.html",
+        { "pkg1/RegClass.html",
             "<a href=\"../pkg1/RegClass.html#method:D:D\">"
         },
-        {BUG_ID + "/pkg1/DeprMemClass.html",
+        { "pkg1/DeprMemClass.html",
             "<a name=\"Z:Z_field_In_Class\">"
         },
-        {BUG_ID + "/pkg1/DeprMemClass.html",
+        { "pkg1/DeprMemClass.html",
             "<a href=\"../pkg1/DeprMemClass.html#Z:Z_field_In_Class\">"
         },
         //Test constructor
-        {BUG_ID + "/pkg1/RegClass.html",
+        { "pkg1/RegClass.html",
             "<a name=\"RegClass-java.lang.String-int-\">"
         },
-        {BUG_ID + "/pkg1/RegClass.html",
+        { "pkg1/RegClass.html",
             "<a href=\"../pkg1/RegClass.html#RegClass-java.lang.String-int-\">"
         },
         //Test some methods
-        {BUG_ID + "/pkg1/RegClass.html",
+        { "pkg1/RegClass.html",
             "<a name=\"Z:Z_methodInClass-java.lang.String-\">"
         },
-        {BUG_ID + "/pkg1/RegClass.html",
+        { "pkg1/RegClass.html",
             "<a href=\"../pkg1/RegClass.html#Z:Z_methodInClass-java.lang.String-\">"
         },
-        {BUG_ID + "/pkg1/RegClass.html",
+        { "pkg1/RegClass.html",
             "<a name=\"method--\">"
         },
-        {BUG_ID + "/pkg1/RegClass.html",
+        { "pkg1/RegClass.html",
             "<a href=\"../pkg1/RegClass.html#method--\">"
         },
-        {BUG_ID + "/pkg1/RegClass.html",
+        { "pkg1/RegClass.html",
             "<a name=\"foo-java.util.Map-\">"
         },
-        {BUG_ID + "/pkg1/RegClass.html",
+        { "pkg1/RegClass.html",
             "<a href=\"../pkg1/RegClass.html#foo-java.util.Map-\">"
         },
-        {BUG_ID + "/pkg1/RegClass.html",
+        { "pkg1/RegClass.html",
             "<a name=\"methodInCla:Ds-java.lang.String:A-\">"
         },
-        {BUG_ID + "/pkg1/RegClass.html",
+        { "pkg1/RegClass.html",
             "<a href=\"../pkg1/RegClass.html#methodInCla:Ds-java.lang.String:A-\">"
         },
-        {BUG_ID + "/pkg1/RegClass.html",
+        { "pkg1/RegClass.html",
             "<a name=\"Z:Z_methodInClas:D-java.lang.String-int-\">"
         },
-        {BUG_ID + "/pkg1/RegClass.html",
+        { "pkg1/RegClass.html",
             "<a href=\"../pkg1/RegClass.html#Z:Z_methodInClas:D-java.lang.String-int-\">"
         },
-        {BUG_ID + "/pkg1/RegClass.html",
+        { "pkg1/RegClass.html",
             "<a name=\"methodD-pkg1.RegClass.:DA-\">"
         },
-        {BUG_ID + "/pkg1/RegClass.html",
+        { "pkg1/RegClass.html",
             "<a href=\"../pkg1/RegClass.html#methodD-pkg1.RegClass.:DA-\">"
         },
-        {BUG_ID + "/pkg1/RegClass.html",
+        { "pkg1/RegClass.html",
             "<a name=\"methodD-pkg1.RegClass.D:A-\">"
         },
-        {BUG_ID + "/pkg1/RegClass.html",
+        { "pkg1/RegClass.html",
             "<a href=\"../pkg1/RegClass.html#methodD-pkg1.RegClass.D:A-\">"
         },
-        {BUG_ID + "/pkg1/DeprMemClass.html",
+        { "pkg1/DeprMemClass.html",
             "<a name=\"Z:Z:Dmethod_In_Class--\">"
         },
-        {BUG_ID + "/pkg1/DeprMemClass.html",
+        { "pkg1/DeprMemClass.html",
             "<a href=\"../pkg1/DeprMemClass.html#Z:Z:Dmethod_In_Class--\">"
         },
 
         //Test enum
 
-        {BUG_ID + "/pkg1/RegClass.Te$t_Enum.html",
+        { "pkg1/RegClass.Te$t_Enum.html",
             "<a name=\"Z:Z:DFLD2\">"
         },
-        {BUG_ID + "/pkg1/RegClass.Te$t_Enum.html",
+        { "pkg1/RegClass.Te$t_Enum.html",
             "<a href=\"../pkg1/RegClass.Te$t_Enum.html#Z:Z:DFLD2\">"
         },
 
         //Test nested class
 
-        {BUG_ID + "/pkg1/RegClass._NestedClas$.html",
+        { "pkg1/RegClass._NestedClas$.html",
             "<a name=\"Z:Z_NestedClas:D--\">"
         },
-        {BUG_ID + "/pkg1/RegClass._NestedClas$.html",
+        { "pkg1/RegClass._NestedClas$.html",
             "<a href=\"../pkg1/RegClass._NestedClas$.html#Z:Z_NestedClas:D--\">"
         },
 
         //Test class use page
 
-        {BUG_ID + "/pkg1/class-use/DeprMemClass.html",
+        { "pkg1/class-use/DeprMemClass.html",
             "<a href=\"../../pkg1/RegClass.html#d____mc\">"
         },
 
         //Test deprecated list page
 
-        {BUG_ID + "/deprecated-list.html",
+        { "deprecated-list.html",
             "<a href=\"pkg1/DeprMemClass.html#Z:Z_field_In_Class\">"
         },
-        {BUG_ID + "/deprecated-list.html",
+        { "deprecated-list.html",
             "<a href=\"pkg1/DeprMemClass.html#Z:Z:Dmethod_In_Class--\">"
         },
 
         //Test constant values page
 
-        {BUG_ID + "/constant-values.html",
+        { "constant-values.html",
             "<a href=\"pkg1/RegClass.html#S_:D:D:D:D:DINT\">"
         },
 
         //Test serialized form page
 
         //This is the marker for the link that appears in the pkg1.RegClass.html page
-        {BUG_ID + "/serialized-form.html",
+        { "serialized-form.html",
             "<a name=\"pkg1.RegClass\">"
         },
 
         //Test member name index page
 
-        {BUG_ID + "/index-all.html",
+        { "index-all.html",
             "<a name=\"I:Z:Z:D\">"
         },
-        {BUG_ID + "/index-all.html",
+        { "index-all.html",
             "<a href=\"#I:Z:Z:D\">$"
         },
-        {BUG_ID + "/index-all.html",
+        { "index-all.html",
             "<a href=\"#I:Z:Z_\">_"
         }
     };
@@ -246,22 +245,22 @@
     private static final String[][] NEGATED_TEST = {
         //The marker name conversion should only affect HTML anchors. It should not
         //affect the lables.
-        {BUG_ID + "/pkg1/RegClass.html",
+        { "pkg1/RegClass.html",
             " Z:Z_"
         },
-        {BUG_ID + "/pkg1/RegClass.html",
+        { "pkg1/RegClass.html",
             " Z:Z:Dfield"
         },
-        {BUG_ID + "/pkg1/RegClass.html",
+        { "pkg1/RegClass.html",
             " Z:Z_field_In_Class"
         },
-        {BUG_ID + "/pkg1/RegClass.html",
+        { "pkg1/RegClass.html",
             " S_:D:D:D:D:DINT"
         },
     };
 
     private static final String[] ARGS = new String[] {
-        "-d", BUG_ID, "-sourcepath", SRC_DIR, "-use", "pkg1"
+        "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "-use", "pkg1"
     };
 
     /**
@@ -270,21 +269,7 @@
      */
     public static void main(String[] args) throws Exception {
         TestAnchorNames tester = new TestAnchorNames();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NEGATED_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testAnnotationOptional/TestAnnotationOptional.java b/langtools/test/com/sun/javadoc/testAnnotationOptional/TestAnnotationOptional.java
index 0808937..d2d51083 100644
--- a/langtools/test/com/sun/javadoc/testAnnotationOptional/TestAnnotationOptional.java
+++ b/langtools/test/com/sun/javadoc/testAnnotationOptional/TestAnnotationOptional.java
@@ -35,44 +35,24 @@
 
 public class TestAnnotationOptional extends JavadocTester {
 
-    //Test information.
-    private static final String BUG_ID = "NO_BUG_ID_YET";
-
     //Javadoc arguments.
     private static final String[] ARGS = new String[] {
-        "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg"
+        "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg"
     };
 
     //Input for string search tests.
     private static final String[][] TEST = {
-        {BUG_ID + "/pkg/AnnotationOptional.html",
+        { "pkg/AnnotationOptional.html",
             "<a name=\"annotation.type.element.detail\">"
         }
     };
-
-    private static final String[][] NEGATED_TEST = NO_TEST;
-
     /**
      * The entry point of the test.
      * @param args the array of command line arguments.
      */
     public static void main(String[] args) {
         TestAnnotationOptional tester = new TestAnnotationOptional();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NO_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testAnnotationTypes/TestAnnotationTypes.java b/langtools/test/com/sun/javadoc/testAnnotationTypes/TestAnnotationTypes.java
index 470536f..b870b26 100644
--- a/langtools/test/com/sun/javadoc/testAnnotationTypes/TestAnnotationTypes.java
+++ b/langtools/test/com/sun/javadoc/testAnnotationTypes/TestAnnotationTypes.java
@@ -34,47 +34,44 @@
 
 public class TestAnnotationTypes extends JavadocTester {
 
-    //Test information.
-    private static final String BUG_ID = "4973609-8015249";
-
     //Javadoc arguments.
     private static final String[] ARGS = new String[] {
-        "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg"
+        "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg"
     };
 
     //Input for string search tests.
     private static final String[][] TEST = {
-        {BUG_ID + "/pkg/AnnotationTypeField.html",
+        { "pkg/AnnotationTypeField.html",
             "<li>Summary:&nbsp;</li>\n" +
             "<li><a href=\"#annotation.type." +
             "field.summary\">Field</a>&nbsp;|&nbsp;</li>"},
-        {BUG_ID + "/pkg/AnnotationTypeField.html",
+        { "pkg/AnnotationTypeField.html",
             "<li>Detail:&nbsp;</li>\n" +
             "<li><a href=\"#annotation.type." +
             "field.detail\">Field</a>&nbsp;|&nbsp;</li>"},
-        {BUG_ID + "/pkg/AnnotationTypeField.html",
+        { "pkg/AnnotationTypeField.html",
             "<!-- =========== ANNOTATION TYPE FIELD SUMMARY =========== -->"},
-        {BUG_ID + "/pkg/AnnotationTypeField.html",
+        { "pkg/AnnotationTypeField.html",
             "<h3>Field Summary</h3>"},
-        {BUG_ID + "/pkg/AnnotationTypeField.html",
+        { "pkg/AnnotationTypeField.html",
             "<td class=\"colLast\"><code><span class=\"memberNameLink\"><a href=\"../" +
             "pkg/AnnotationTypeField.html#DEFAULT_NAME\">DEFAULT_NAME</a></span>" +
             "</code>&nbsp;</td>"},
-        {BUG_ID + "/pkg/AnnotationTypeField.html",
+        { "pkg/AnnotationTypeField.html",
             "<!-- ============ ANNOTATION TYPE FIELD DETAIL =========== -->"},
-        {BUG_ID + "/pkg/AnnotationTypeField.html",
+        { "pkg/AnnotationTypeField.html",
             "<h4>DEFAULT_NAME</h4>\n" +
             "<pre>public static final&nbsp;java." +
             "lang.String&nbsp;DEFAULT_NAME</pre>"},
-        {BUG_ID + "/pkg/AnnotationType.html",
+        { "pkg/AnnotationType.html",
             "<li>Summary:&nbsp;</li>\n" +
             "<li>Field&nbsp;|&nbsp;</li>"},
-        {BUG_ID + "/pkg/AnnotationType.html",
+        { "pkg/AnnotationType.html",
             "<li>Detail:&nbsp;</li>\n" +
             "<li>Field&nbsp;|&nbsp;</li>"},
     };
     private static final String[][] NEGATED_TEST = {
-        {BUG_ID + "/pkg/AnnotationType.html",
+        { "pkg/AnnotationType.html",
             "<HR>\n\n" +
             "<P>\n\n" +
             "<P>" +
@@ -87,21 +84,7 @@
      */
     public static void main(String[] args) {
         TestAnnotationTypes tester = new TestAnnotationTypes();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NEGATED_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testBackSlashInLink/TestBackSlashInLink.java b/langtools/test/com/sun/javadoc/testBackSlashInLink/TestBackSlashInLink.java
index 0db22bb..f797343 100644
--- a/langtools/test/com/sun/javadoc/testBackSlashInLink/TestBackSlashInLink.java
+++ b/langtools/test/com/sun/javadoc/testBackSlashInLink/TestBackSlashInLink.java
@@ -35,13 +35,11 @@
 
 public class TestBackSlashInLink extends JavadocTester {
 
-    private static final String BUG_ID = "4511110";
     private static final String[][] TEST = {
-        {BUG_ID + "/C.html", "src-html/C.html#line.7"}};
-    private static final String[][] NEGATED_TEST = NO_TEST;
+        { "C.html", "src-html/C.html#line.7"}};
     private static final String[] ARGS =
         new String[] {
-            "-d", BUG_ID, "-sourcepath", SRC_DIR,
+            "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR,
             "-linksource",  SRC_DIR + "/C.java"};
 
     /**
@@ -50,21 +48,7 @@
      */
     public static void main(String[] args) {
         TestBackSlashInLink tester = new TestBackSlashInLink();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NO_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testBadPackageFileInJar/TestBadPackageFileInJar.java b/langtools/test/com/sun/javadoc/testBadPackageFileInJar/TestBadPackageFileInJar.java
index 0e57e3d..32bca32 100644
--- a/langtools/test/com/sun/javadoc/testBadPackageFileInJar/TestBadPackageFileInJar.java
+++ b/langtools/test/com/sun/javadoc/testBadPackageFileInJar/TestBadPackageFileInJar.java
@@ -35,10 +35,6 @@
 
 public class TestBadPackageFileInJar extends JavadocTester {
 
-    protected static final String FS = System.getProperty("file.separator");
-
-    private static final String BUG_ID = "4691095";
-
     private static final String[][] TEST =
         new String[][] {
             {ERROR_OUTPUT,
@@ -47,7 +43,7 @@
 
     private static final String[] ARGS =
         new String[] {
-            "-d", BUG_ID, "-sourcepath", SRC_DIR, "-classpath",
+            "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "-classpath",
             SRC_DIR + "/badPackageFileInJar.jar", "pkg"};
 
 
@@ -57,21 +53,7 @@
      */
     public static void main(String[] args) {
         TestBadPackageFileInJar tester = new TestBadPackageFileInJar();
-        run(tester, ARGS, TEST, NO_TEST);
+        tester.run(ARGS, TEST, NO_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testBadSourceFile/TestBadSourceFile.java b/langtools/test/com/sun/javadoc/testBadSourceFile/TestBadSourceFile.java
index 8e0cf93..cf60a9f 100644
--- a/langtools/test/com/sun/javadoc/testBadSourceFile/TestBadSourceFile.java
+++ b/langtools/test/com/sun/javadoc/testBadSourceFile/TestBadSourceFile.java
@@ -35,40 +35,19 @@
 
 public class TestBadSourceFile extends JavadocTester {
 
-    //Test information.
-    private static final String BUG_ID = "4835749";
-
     //Javadoc arguments.
     private static final String[] ARGS = new String[] {
-        "-Xdoclint:none", "-d", BUG_ID, SRC_DIR + "/C2.java"
+        "-Xdoclint:none", "-d", OUTPUT_DIR, SRC_DIR + "/C2.java"
     };
 
-    //Input for string search tests.
-    private static final String[][] TEST = NO_TEST;
-    private static final String[][] NEGATED_TEST = NO_TEST;
-
     /**
      * The entry point of the test.
      * @param args the array of command line arguments.
      */
     public static void main(String[] args) {
         TestBadSourceFile tester = new TestBadSourceFile();
-        int exitCode = run(tester, ARGS, TEST, NEGATED_TEST);
+        int exitCode = tester.run(ARGS, NO_TEST, NO_TEST);
         tester.checkExitCode(0, exitCode);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testBaseClass/TestBaseClass.java b/langtools/test/com/sun/javadoc/testBaseClass/TestBaseClass.java
index dfb455a..d25e8e0 100644
--- a/langtools/test/com/sun/javadoc/testBaseClass/TestBaseClass.java
+++ b/langtools/test/com/sun/javadoc/testBaseClass/TestBaseClass.java
@@ -35,9 +35,6 @@
 
 public class TestBaseClass extends JavadocTester {
 
-    private static final String BUG_ID = "4197513";
-    private static final String[][] TEST = NO_TEST;
-    private static final String[][] NEGATED_TEST = NO_TEST;
     private static final String[] ARGS =
         new String[] {
             "-sourcepath", SRC_DIR,
@@ -50,22 +47,8 @@
      */
     public static void main(String[] args) {
         TestBaseClass tester = new TestBaseClass();
-        if (run(tester, ARGS, TEST, NEGATED_TEST) != 0) {
+        if (tester.run(ARGS, NO_TEST, NO_TEST) != 0) {
             throw new Error("Javadoc failed to execute.");
         }
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testBreakIterator/TestBreakIterator.java b/langtools/test/com/sun/javadoc/testBreakIterator/TestBreakIterator.java
index 2640223..f0dd06e 100644
--- a/langtools/test/com/sun/javadoc/testBreakIterator/TestBreakIterator.java
+++ b/langtools/test/com/sun/javadoc/testBreakIterator/TestBreakIterator.java
@@ -37,14 +37,12 @@
 
 public class TestBreakIterator extends JavadocTester {
 
-    private static final String BUG_ID = "4165985";
     private static final String[][] TEST = {
-        {BUG_ID + "/pkg/BreakIteratorTest.html",
+        { "pkg/BreakIteratorTest.html",
             "The class is empty (i.e. it has no members)."}};
-    private static final String[][] NEGATED_TEST = NO_TEST;
     private static final String[] ARGS =
         new String[] {
-            "-d", BUG_ID, "-sourcepath", SRC_DIR,
+            "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR,
             "-breakiterator", "pkg"};
 
     /**
@@ -53,21 +51,7 @@
      */
     public static void main(String[] args) {
         TestBreakIterator tester = new TestBreakIterator();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NO_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testCRLineSeparator/TestCRLineSeparator.java b/langtools/test/com/sun/javadoc/testCRLineSeparator/TestCRLineSeparator.java
index 0de67d2..5bac9a6 100644
--- a/langtools/test/com/sun/javadoc/testCRLineSeparator/TestCRLineSeparator.java
+++ b/langtools/test/com/sun/javadoc/testCRLineSeparator/TestCRLineSeparator.java
@@ -37,21 +37,17 @@
 
 public class TestCRLineSeparator extends JavadocTester {
 
-    //Test information.
-    private static final String BUG_ID = "4979486-8014636";
-
     //Javadoc arguments.
     private static final String[] ARGS = new String[] {
-        "-d", BUG_ID, "-sourcepath", ".", "pkg"
+        "-d", OUTPUT_DIR, "-sourcepath", ".", "pkg"
     };
 
     //Input for string search tests.
     private static final String[][] TEST = {
-        {BUG_ID + "/pkg/MyClass.html", "Line 1\n" +
+        { "pkg/MyClass.html", "Line 1\n" +
         " Line 2"}
     };
 
-    private static final String[][] NEGATED_TEST = NO_TEST;
 
     /**
      * The entry point of the test.
@@ -60,24 +56,10 @@
     public static void main(String[] args) throws Exception {
         initFiles(new File(SRC_DIR), new File("."), "pkg");
         TestCRLineSeparator tester = new TestCRLineSeparator();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NO_TEST);
         tester.printSummary();
     }
 
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
-
     // recursively copy files from fromDir to toDir, replacing newlines
     // with \r
     static void initFiles(File fromDir, File toDir, String f) throws IOException {
diff --git a/langtools/test/com/sun/javadoc/testCharset/TestCharset.java b/langtools/test/com/sun/javadoc/testCharset/TestCharset.java
index 4d5174f..d851a65 100644
--- a/langtools/test/com/sun/javadoc/testCharset/TestCharset.java
+++ b/langtools/test/com/sun/javadoc/testCharset/TestCharset.java
@@ -34,25 +34,22 @@
 
 public class TestCharset extends JavadocTester {
 
-    //Test information.
-    private static final String BUG_ID = "7052170";
-
     //Javadoc arguments.
     private static final String[] ARGS = new String[] {
-        "-d", BUG_ID, "-charset", "UTF-8", "-sourcepath", SRC_DIR, "pkg"
+        "-d", OUTPUT_DIR, "-charset", "UTF-8", "-sourcepath", SRC_DIR, "pkg"
     };
 
     private static final String[][] TEST = {
-        {BUG_ID + "/index.html",
+        { "index.html",
             "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">"},
-        {BUG_ID + "/pkg/Foo.html",
+        { "pkg/Foo.html",
             "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">"}
     };
 
     private static final String[][] NEGATED_TEST = {
-        {BUG_ID + "/index.html",
+        { "index.html",
             "<meta http-equiv=\"Content-Type\" content=\"text/html\" charset=\"UTF-8\">"},
-        {BUG_ID + "/pkg/Foo.html",
+        { "pkg/Foo.html",
             "<meta http-equiv=\"Content-Type\" content=\"text/html\" charset=\"UTF-8\">"}
     };
 
@@ -62,21 +59,7 @@
      */
     public static void main(String[] args) {
         TestCharset tester = new TestCharset();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NEGATED_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testClassCrossReferences/TestClassCrossReferences.java b/langtools/test/com/sun/javadoc/testClassCrossReferences/TestClassCrossReferences.java
index f06dfc8..6617c6e 100644
--- a/langtools/test/com/sun/javadoc/testClassCrossReferences/TestClassCrossReferences.java
+++ b/langtools/test/com/sun/javadoc/testClassCrossReferences/TestClassCrossReferences.java
@@ -34,29 +34,27 @@
 
 public class TestClassCrossReferences extends JavadocTester {
 
-    private static final String BUG_ID = "4652655-4857717";
     private static final String[][] TEST = {
-        {BUG_ID + "/C.html",
+        { "C.html",
             "<a href=\"http://java.sun.com/j2se/1.4/docs/api/java/math/package-summary.html?is-external=true\"><code>Link to math package</code></a>"},
-        {BUG_ID + "/C.html",
+        { "C.html",
             "<a href=\"http://java.sun.com/j2se/1.4/docs/api/javax/swing/text/AbstractDocument.AttributeContext.html?is-external=true\" " +
             "title=\"class or interface in javax.swing.text\"><code>Link to AttributeContext innerclass</code></a>"},
-        {BUG_ID + "/C.html",
+        { "C.html",
             "<a href=\"http://java.sun.com/j2se/1.4/docs/api/java/math/BigDecimal.html?is-external=true\" " +
                 "title=\"class or interface in java.math\"><code>Link to external class BigDecimal</code></a>"},
-        {BUG_ID + "/C.html",
+        { "C.html",
             "<a href=\"http://java.sun.com/j2se/1.4/docs/api/java/math/BigInteger.html?is-external=true#gcd-java.math.BigInteger-\" " +
                 "title=\"class or interface in java.math\"><code>Link to external member gcd</code></a>"},
-        {BUG_ID + "/C.html",
+        { "C.html",
             "<dl>\n" +
             "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" +
             "<dd><code>toString</code>&nbsp;in class&nbsp;<code>java.lang.Object</code></dd>\n" +
             "</dl>"}
     };
-    private static final String[][] NEGATED_TEST = NO_TEST;
     private static final String[] ARGS =
         new String[] {
-            "-d", BUG_ID, "-sourcepath", SRC_DIR,
+            "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR,
             "-linkoffline", "http://java.sun.com/j2se/1.4/docs/api/",
             SRC_DIR, SRC_DIR + "/C.java"};
 
@@ -66,21 +64,7 @@
      */
     public static void main(String[] args) {
         TestClassCrossReferences tester = new TestClassCrossReferences();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NO_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testClassTree/TestClassTree.java b/langtools/test/com/sun/javadoc/testClassTree/TestClassTree.java
index e033e03..9215c4e 100644
--- a/langtools/test/com/sun/javadoc/testClassTree/TestClassTree.java
+++ b/langtools/test/com/sun/javadoc/testClassTree/TestClassTree.java
@@ -37,22 +37,19 @@
 
 public class TestClassTree extends JavadocTester {
 
-    //Test information.
-    private static final String BUG_ID = "4632553-4973607";
-
     //Javadoc arguments.
     private static final String[] ARGS = new String[] {
-        "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg"
+        "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg"
     };
 
     //Input for string search tests.
     private static final String[][] TEST = {
-        {BUG_ID + "/pkg/package-tree.html",
+        { "pkg/package-tree.html",
             "<ul>\n" +
             "<li type=\"circle\">pkg.<a href=\"../pkg/ParentClass.html\" " +
             "title=\"class in pkg\"><span class=\"typeNameLink\">ParentClass</span></a>"},
 
-        {BUG_ID + "/pkg/package-tree.html",
+        { "pkg/package-tree.html",
             "<h2 title=\"Annotation Type Hierarchy\">Annotation Type Hierarchy</h2>\n" +
             "<ul>\n" +
             "<li type=\"circle\">pkg.<a href=\"../pkg/AnnotationType.html\" " +
@@ -60,7 +57,7 @@
             "(implements java.lang.annotation.Annotation)</li>\n" +
             "</ul>"},
 
-        {BUG_ID + "/pkg/package-tree.html",
+        { "pkg/package-tree.html",
             "<h2 title=\"Enum Hierarchy\">Enum Hierarchy</h2>\n" +
             "<ul>\n" +
             "<li type=\"circle\">java.lang.Object\n" +
@@ -78,7 +75,7 @@
         },
     };
     private static final String[][] NEGATED_TEST = {
-        {BUG_ID + "/pkg/package-tree.html",
+        { "pkg/package-tree.html",
             "<li type=\"circle\">class pkg.<a href=\"../pkg/ParentClass.html\" " +
             "title=\"class in pkg\"><span class=\"typeNameLink\">ParentClass</span></a></li>"}
         };
@@ -89,21 +86,7 @@
      */
     public static void main(String[] args) {
         TestClassTree tester = new TestClassTree();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NEGATED_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testCmndLineClass/TestCmndLineClass.java b/langtools/test/com/sun/javadoc/testCmndLineClass/TestCmndLineClass.java
index 56d6b71..7daae9e 100644
--- a/langtools/test/com/sun/javadoc/testCmndLineClass/TestCmndLineClass.java
+++ b/langtools/test/com/sun/javadoc/testCmndLineClass/TestCmndLineClass.java
@@ -38,8 +38,6 @@
 
     private static final String OUTPUT_DIR1 = "4506980-tmp1";
     private static final String OUTPUT_DIR2 = "4506980-tmp2";
-    private static final String[][] TEST = NO_TEST;
-    private static final String[][] NEGATED_TEST = NO_TEST;
     private static final String[] ARGS1 =
         new String[] {
             "-d", OUTPUT_DIR1, "-sourcepath", SRC_DIR,
@@ -54,15 +52,14 @@
             SRC_DIR + "/pkg2/C3.java",
             SRC_DIR + "/pkg2/C4.java"
         };
-    private static final String[][] FILES_TO_DIFF = {
-        {OUTPUT_DIR1 + "/C5.html", OUTPUT_DIR2 + "/C5.html"},
-        {OUTPUT_DIR2 + "/pkg1/C1.html", OUTPUT_DIR2 + "/pkg1/C1.html"},
-        {OUTPUT_DIR1 + "/pkg1/C2.html", OUTPUT_DIR2 + "/pkg1/C2.html"},
-        {OUTPUT_DIR1 + "/pkg2/C3.html", OUTPUT_DIR2 + "/pkg2/C3.html"},
-        {OUTPUT_DIR1 + "/pkg2/C4.html", OUTPUT_DIR2 + "/pkg2/C4.html"}
+    private static final String[] FILES_TO_DIFF = {
+        "C5.html",
+        "pkg1/C1.html",
+        "pkg1/C2.html",
+        "pkg2/C3.html",
+        "pkg2/C4.html"
     };
 
-    private static final String BUG_ID = "4506980";
 
     /**
      * The entry point of the test.
@@ -70,22 +67,8 @@
      */
     public static void main(String[] args) {
         TestCmndLineClass tester = new TestCmndLineClass();
-        run(tester, ARGS1, TEST, NEGATED_TEST);
-        run(tester, ARGS2, TEST, NEGATED_TEST);
-        tester.runDiffs(FILES_TO_DIFF);
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
+        tester.run(ARGS1, NO_TEST, NO_TEST);
+        tester.run(ARGS2, NO_TEST, NO_TEST);
+        tester.runDiffs(OUTPUT_DIR1, OUTPUT_DIR2, FILES_TO_DIFF);
     }
 }
diff --git a/langtools/test/com/sun/javadoc/testCompletionFailure/TestCompletionFailure.java b/langtools/test/com/sun/javadoc/testCompletionFailure/TestCompletionFailure.java
index 87a9cf7..0c70804 100644
--- a/langtools/test/com/sun/javadoc/testCompletionFailure/TestCompletionFailure.java
+++ b/langtools/test/com/sun/javadoc/testCompletionFailure/TestCompletionFailure.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 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
@@ -33,8 +33,6 @@
 
 public class TestCompletionFailure extends JavadocTester {
 
-    private static final String BUG_ID = "8027977";
-
     //Input for string search tests.
     private static final String[][] NEGATED_TEST = {
         {ERROR_OUTPUT, "TestCompletionFailure: error - " +
@@ -44,7 +42,7 @@
     };
 
     private static final String[] ARGS = new String[] {
-        "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg1"
+        "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg1"
     };
 
     /**
@@ -53,21 +51,7 @@
      */
     public static void main(String[] args) throws Exception {
         TestCompletionFailure tester = new TestCompletionFailure();
-        run(tester, ARGS, NO_TEST, NEGATED_TEST);
+        tester.run(ARGS, NO_TEST, NEGATED_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testConstantValuesPage/TestConstantValuesPage.java b/langtools/test/com/sun/javadoc/testConstantValuesPage/TestConstantValuesPage.java
index 55cefb0..b85bf6d 100644
--- a/langtools/test/com/sun/javadoc/testConstantValuesPage/TestConstantValuesPage.java
+++ b/langtools/test/com/sun/javadoc/testConstantValuesPage/TestConstantValuesPage.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -35,14 +35,12 @@
 
 public class TestConstantValuesPage extends JavadocTester {
 
-    private static final String BUG_ID = "4681599";
-    private static final String[][] TEST = NO_TEST;
     private static final String[][] NEGATED_TEST = {
         {NOTICE_OUTPUT, "constant-values.html..."}
         };
     private static final String[] ARGS =
         new String[] {
-            "-d", BUG_ID, "-sourcepath", SRC_DIR, "foo"};
+            "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "foo"};
 
     /**
      * The entry point of the test.
@@ -50,21 +48,7 @@
      */
     public static void main(String[] args) {
         TestConstantValuesPage tester = new TestConstantValuesPage();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, NO_TEST, NEGATED_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testConstructorIndent/TestConstructorIndent.java b/langtools/test/com/sun/javadoc/testConstructorIndent/TestConstructorIndent.java
index d9565c3..40ab6a2 100644
--- a/langtools/test/com/sun/javadoc/testConstructorIndent/TestConstructorIndent.java
+++ b/langtools/test/com/sun/javadoc/testConstructorIndent/TestConstructorIndent.java
@@ -35,17 +35,14 @@
 
 public class TestConstructorIndent extends JavadocTester {
 
-    //Test information.
-    private static final String BUG_ID = "4904037";
-
     //Javadoc arguments.
     private static final String[] ARGS = new String[] {
-        "-d", BUG_ID, "-sourcepath", SRC_DIR, SRC_DIR + "/C.java"
+        "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, SRC_DIR + "/C.java"
     };
 
     //Input for string search tests.
     private static final String[][] TEST = {
-        {BUG_ID + "/C.html", "<div class=\"block\">" +
+        { "C.html", "<div class=\"block\">" +
                  "This is just a simple constructor.</div>\n" +
                  "<dl>\n" +
                  "<dt><span class=\"paramLabel\">Parameters:</span></dt>\n" +
@@ -53,7 +50,6 @@
                  "</dl>"
         }
     };
-    private static final String[][] NEGATED_TEST = NO_TEST;
 
     /**
      * The entry point of the test.
@@ -61,21 +57,7 @@
      */
     public static void main(String[] args) {
         TestConstructorIndent tester = new TestConstructorIndent();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NO_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testConstructors/TestConstructors.java b/langtools/test/com/sun/javadoc/testConstructors/TestConstructors.java
index 1c368f5..6d1585e 100644
--- a/langtools/test/com/sun/javadoc/testConstructors/TestConstructors.java
+++ b/langtools/test/com/sun/javadoc/testConstructors/TestConstructors.java
@@ -33,11 +33,9 @@
 
 public class TestConstructors extends JavadocTester {
 
-    private static final String BUG_ID = "8025524";
-
     //Input for string search tests.
     private static final String[][] TEST = {
-        {BUG_ID + "/pkg1/Outer.html",
+        { "pkg1/Outer.html",
             "<dt><span class=\"seeLabel\">See Also:</span></dt>\n" +
             "<dd><a href=\"../pkg1/Outer.Inner.html#Inner--\"><code>Inner()</code></a>, \n" +
             "<a href=\"../pkg1/Outer.Inner.html#Inner-int-\"><code>Inner(int)</code></a>, \n" +
@@ -46,79 +44,79 @@
             "<a href=\"../pkg1/Outer.html#Outer--\"><code>Outer()</code></a>, \n" +
             "<a href=\"../pkg1/Outer.html#Outer-int-\"><code>Outer(int)</code></a>"
         },
-        {BUG_ID + "/pkg1/Outer.html",
+        { "pkg1/Outer.html",
             "Link: <a href=\"../pkg1/Outer.Inner.html#Inner--\"><code>Inner()</code></a>, " +
             "<a href=\"../pkg1/Outer.html#Outer-int-\"><code>Outer(int)</code></a>, " +
             "<a href=\"../pkg1/Outer.Inner.NestedInner.html#NestedInner-int-\"><code>" +
             "NestedInner(int)</code></a>"
         },
-        {BUG_ID + "/pkg1/Outer.html",
+        { "pkg1/Outer.html",
             "<a href=\"../pkg1/Outer.html#Outer--\">Outer</a></span>()"
         },
-        {BUG_ID + "/pkg1/Outer.html",
+        { "pkg1/Outer.html",
             "<a name=\"Outer--\">"
         },
-        {BUG_ID + "/pkg1/Outer.html",
+        { "pkg1/Outer.html",
             "<a href=\"../pkg1/Outer.html#Outer-int-\">Outer</a></span>(int&nbsp;i)"
         },
-        {BUG_ID + "/pkg1/Outer.html",
+        { "pkg1/Outer.html",
             "<a name=\"Outer-int-\">"
         },
-        {BUG_ID + "/pkg1/Outer.Inner.html",
+        { "pkg1/Outer.Inner.html",
             "<a href=\"../pkg1/Outer.Inner.html#Inner--\">Inner</a></span>()"
         },
-        {BUG_ID + "/pkg1/Outer.Inner.html",
+        { "pkg1/Outer.Inner.html",
             "<a name=\"Inner--\">"
         },
-        {BUG_ID + "/pkg1/Outer.Inner.html",
+        { "pkg1/Outer.Inner.html",
             "<a href=\"../pkg1/Outer.Inner.html#Inner-int-\">Inner</a></span>(int&nbsp;i)"
         },
-        {BUG_ID + "/pkg1/Outer.Inner.html",
+        { "pkg1/Outer.Inner.html",
             "<a name=\"Inner-int-\">"
         },
-        {BUG_ID + "/pkg1/Outer.Inner.NestedInner.html",
+        { "pkg1/Outer.Inner.NestedInner.html",
             "<a href=\"../pkg1/Outer.Inner.NestedInner.html#NestedInner--\">NestedInner</a></span>()"
         },
-        {BUG_ID + "/pkg1/Outer.Inner.NestedInner.html",
+        { "pkg1/Outer.Inner.NestedInner.html",
             "<a name=\"NestedInner--\">"
         },
-        {BUG_ID + "/pkg1/Outer.Inner.NestedInner.html",
+        { "pkg1/Outer.Inner.NestedInner.html",
             "<a href=\"../pkg1/Outer.Inner.NestedInner.html#NestedInner-int-\">NestedInner</a></span>(int&nbsp;i)"
         },
-        {BUG_ID + "/pkg1/Outer.Inner.NestedInner.html",
+        { "pkg1/Outer.Inner.NestedInner.html",
             "<a name=\"NestedInner-int-\">"
         }
     };
 
     private static final String[][] NEGATED_TEST = {
-        {BUG_ID + "/pkg1/Outer.Inner.html",
+        { "pkg1/Outer.Inner.html",
             "Outer.Inner--"
         },
-        {BUG_ID + "/pkg1/Outer.Inner.html",
+        { "pkg1/Outer.Inner.html",
             "Outer.Inner-int-"
         },
-        {BUG_ID + "/pkg1/Outer.Inner.NestedInner.html",
+        { "pkg1/Outer.Inner.NestedInner.html",
             "Outer.Inner.NestedInner--"
         },
-        {BUG_ID + "/pkg1/Outer.Inner.NestedInner.html",
+        { "pkg1/Outer.Inner.NestedInner.html",
             "Outer.Inner.NestedInner-int-"
         },
-        {BUG_ID + "/pkg1/Outer.html",
+        { "pkg1/Outer.html",
             "<a href=\"../pkg1/Outer.Inner.html#Outer.Inner--\"><code>Outer.Inner()</code></a>"
         },
-        {BUG_ID + "/pkg1/Outer.html",
+        { "pkg1/Outer.html",
             "<a href=\"../pkg1/Outer.Inner.html#Outer.Inner-int-\"><code>Outer.Inner(int)</code></a>"
         },
-        {BUG_ID + "/pkg1/Outer.html",
+        { "pkg1/Outer.html",
             "<a href=\"../pkg1/Outer.Inner.NestedInner.html#Outer.Inner.NestedInner--\"><code>Outer.Inner.NestedInner()</code></a>"
         },
-        {BUG_ID + "/pkg1/Outer.html",
+        { "pkg1/Outer.html",
             "<a href=\"../pkg1/Outer.Inner.NestedInner.html#Outer.Inner.NestedInner-int-\"><code>Outer.Inner.NestedInner(int)</code></a>"
         }
     };
 
     private static final String[] ARGS = new String[] {
-        "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg1"
+        "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg1"
     };
 
     /**
@@ -127,21 +125,7 @@
      */
     public static void main(String[] args) throws Exception {
         TestConstructors tester = new TestConstructors();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NEGATED_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testCustomTag/TestCustomTag.java b/langtools/test/com/sun/javadoc/testCustomTag/TestCustomTag.java
index 9b1873a..b7fc0f2 100644
--- a/langtools/test/com/sun/javadoc/testCustomTag/TestCustomTag.java
+++ b/langtools/test/com/sun/javadoc/testCustomTag/TestCustomTag.java
@@ -33,28 +33,25 @@
 
 public class TestCustomTag extends JavadocTester {
 
-    //Test information.
-    private static final String BUG_ID = "8006248";
-
     //Javadoc arguments.
     private static final String[] ARGS = new String[] {
-        "-Xdoclint:none", "-d", BUG_ID, "-tagletpath", SRC_DIR,
+        "-Xdoclint:none", "-d", OUTPUT_DIR, "-tagletpath", SRC_DIR,
         "-taglet", "taglets.CustomTag", "-sourcepath",
         SRC_DIR, SRC_DIR + "/TagTestClass.java"
     };
 
     private static final String[] ARGS1 = new String[] {
-        "-d", BUG_ID + "-1", "-tagletpath",
+        "-d", OUTPUT_DIR + "-1", "-tagletpath",
         SRC_DIR, "-taglet", "taglets.CustomTag",
         "-sourcepath", SRC_DIR, SRC_DIR + "/TagTestClass.java"
     };
     private static final String[] ARGS2 = new String[] {
-        "-Xdoclint:none", "-d", BUG_ID + "-2", "-sourcepath",
+        "-Xdoclint:none", "-d", OUTPUT_DIR + "-2", "-sourcepath",
         SRC_DIR, SRC_DIR + "/TagTestClass.java"
     };
 
     private static final String[] ARGS3 = new String[] {
-        "-d", BUG_ID + "-3", "-sourcepath",
+        "-d", OUTPUT_DIR + "-3", "-sourcepath",
         SRC_DIR, SRC_DIR + "/TagTestClass.java"
     };
 
@@ -88,24 +85,10 @@
      */
     public static void main(String[] args) {
         TestCustomTag tester = new TestCustomTag();
-        run(tester, ARGS, TEST, NO_TEST);
-        run(tester, ARGS1, TEST1, NO_TEST);
-        run(tester, ARGS2, TEST2, NO_TEST);
-        run(tester, ARGS3, TEST3, NO_TEST);
+        tester.run(ARGS, TEST, NO_TEST);
+        tester.run(ARGS1, TEST1, NO_TEST);
+        tester.run(ARGS2, TEST2, NO_TEST);
+        tester.run(ARGS3, TEST3, NO_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testDeprecatedDocs/TestDeprecatedDocs.java b/langtools/test/com/sun/javadoc/testDeprecatedDocs/TestDeprecatedDocs.java
index 326478d..c31f7d2 100644
--- a/langtools/test/com/sun/javadoc/testDeprecatedDocs/TestDeprecatedDocs.java
+++ b/langtools/test/com/sun/javadoc/testDeprecatedDocs/TestDeprecatedDocs.java
@@ -33,19 +33,16 @@
 
 public class TestDeprecatedDocs extends JavadocTester {
 
-    //Test information.
-    private static final String BUG_ID = "4927552";
-
     //Javadoc arguments.
     private static final String[] ARGS = new String[] {
-        "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg"
+        "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg"
     };
 
     private static final String TARGET_FILE  =
-        BUG_ID + "/deprecated-list.html";
+        "deprecated-list.html";
 
     private static final String TARGET_FILE2  =
-        BUG_ID + "/pkg/DeprecatedClassByAnnotation.html";
+        "pkg/DeprecatedClassByAnnotation.html";
 
     //Input for string search tests.
     private static final String[][] TEST = {
@@ -92,29 +89,13 @@
                  "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated.</span>&nbsp;</div>"},
     };
 
-    private static final String[][] NEGATED_TEST = NO_TEST;
-
     /**
      * The entry point of the test.
      * @param args the array of command line arguments.
      */
     public static void main(String[] args) {
         TestDeprecatedDocs tester = new TestDeprecatedDocs();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NO_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testDocEncoding/TestDocEncoding.java b/langtools/test/com/sun/javadoc/testDocEncoding/TestDocEncoding.java
index e819817..273285b 100644
--- a/langtools/test/com/sun/javadoc/testDocEncoding/TestDocEncoding.java
+++ b/langtools/test/com/sun/javadoc/testDocEncoding/TestDocEncoding.java
@@ -38,19 +38,17 @@
 
 public class TestDocEncoding extends JavadocTester {
 
-    //Test information.
-    private static final String BUG_ID = "8000743";
-
     //Javadoc arguments.
     private static final String[] ARGS = new String[] {
-        "-d", BUG_ID, "-docencoding", "Cp930",
-        "-sourcepath", SRC_DIR, "pkg"
+        "-d", OUTPUT_DIR,
+        "-docencoding", "Cp930",
+        "-sourcepath", SRC_DIR,
+        "-notimestamp",
+        "pkg"
     };
 
-    private static final String[][] TEST = NO_TEST;
-
     private static final String[][] NEGATED_TEST = {
-        {BUG_ID + "/stylesheet.css",
+        { "stylesheet.css",
             "body {\n" +
             "    background-color:#ffffff;"}
     };
@@ -61,22 +59,8 @@
      */
     public static void main(String[] args) {
         TestDocEncoding tester = new TestDocEncoding();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, NO_TEST, NEGATED_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
 
diff --git a/langtools/test/com/sun/javadoc/testDocErrorReporter/TestDocErrorReporter.java b/langtools/test/com/sun/javadoc/testDocErrorReporter/TestDocErrorReporter.java
index 7ed66ef..d6da813 100644
--- a/langtools/test/com/sun/javadoc/testDocErrorReporter/TestDocErrorReporter.java
+++ b/langtools/test/com/sun/javadoc/testDocErrorReporter/TestDocErrorReporter.java
@@ -35,19 +35,12 @@
 
 public class TestDocErrorReporter extends JavadocTester {
 
-    //Test information.
-    private static final String BUG_ID = "4927928";
-
     //Javadoc arguments.
     private static final String[] ARGS = new String[] {
-        "-d", BUG_ID, "-sourcepath", SRC_DIR, "-encoding", "xyz",
+        "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "-encoding", "xyz",
             SRC_DIR + "/TestDocErrorReporter.java"
     };
 
-    //Input for string search tests.
-    private static final String[][] TEST = NO_TEST;
-    private static final String[][] NEGATED_TEST = NO_TEST;
-
     //Input for Javadoc return code test.
     private static final int EXPECTED_EXIT_CODE = 1;
 
@@ -57,22 +50,8 @@
      */
     public static void main(String[] args) {
         TestDocErrorReporter tester = new TestDocErrorReporter();
-        int actualExitCode = run(tester, ARGS, TEST, NEGATED_TEST);
+        int actualExitCode = tester.run(ARGS, NO_TEST, NO_TEST);
         tester.checkExitCode(EXPECTED_EXIT_CODE, actualExitCode);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testDocFileDir/TestDocFileDir.java b/langtools/test/com/sun/javadoc/testDocFileDir/TestDocFileDir.java
index 676a6c6..3f263f6 100644
--- a/langtools/test/com/sun/javadoc/testDocFileDir/TestDocFileDir.java
+++ b/langtools/test/com/sun/javadoc/testDocFileDir/TestDocFileDir.java
@@ -39,45 +39,37 @@
 
 public class TestDocFileDir extends JavadocTester {
 
-    private static final String BUG_ID = "4258405-4973606";
-
     private static final String[][] TEST1 = {
-        {BUG_ID + "-1/pkg/doc-files/testfile.txt",
+        { "pkg/doc-files/testfile.txt",
             "This doc file did not get trashed."}
         };
-    private static final String[][] NEGATED_TEST1 = NO_TEST;
 
     private static final String[] FILE_TEST2 = {
-        BUG_ID + "-2/pkg/doc-files/subdir-used1" +
-            "/testfile.txt",
-        BUG_ID + "-2/pkg/doc-files/subdir-used2" +
-            "/testfile.txt"
+        "pkg/doc-files/subdir-used1/testfile.txt",
+        "pkg/doc-files/subdir-used2/testfile.txt"
     };
     private static final String[] FILE_NEGATED_TEST2 = {
-        BUG_ID + "-2/pkg/doc-files/subdir-excluded1" +
-            "/testfile.txt",
-        BUG_ID + "-2/pkg/doc-files/subdir-excluded2" +
-            "/testfile.txt"
+        "pkg/doc-files/subdir-excluded1/testfile.txt",
+        "pkg/doc-files/subdir-excluded2/testfile.txt"
     };
 
     private static final String[][] TEST0 = {
         {"pkg/doc-files/testfile.txt",
             "This doc file did not get trashed."}
         };
-    private static final String[][] NEGATED_TEST0 = {};
 
     //Output dir = Input Dir
     private static final String[] ARGS1 =
         new String[] {
-            "-d", BUG_ID + "-1",
+            "-d", OUTPUT_DIR + "-1",
             "-sourcepath",
-            "blah" + File.pathSeparator + BUG_ID + "-1" +
+            "blah" + File.pathSeparator + OUTPUT_DIR + "-1" +
             File.pathSeparator + "blah", "pkg"};
 
     //Exercising -docfilessubdirs and -excludedocfilessubdir
     private static final String[] ARGS2 =
         new String[] {
-            "-d", BUG_ID + "-2",
+            "-d", OUTPUT_DIR + "-2",
             "-sourcepath", SRC_DIR,
             "-docfilessubdirs",
             "-excludedocfilessubdir", "subdir-excluded1:subdir-excluded2",
@@ -95,24 +87,10 @@
     public static void main(String[] args) {
         TestDocFileDir tester = new TestDocFileDir();
         copyDir(SRC_DIR + "/pkg", ".");
-        run(tester, ARGS0, TEST0, NEGATED_TEST0);
-        copyDir(SRC_DIR + "/pkg", BUG_ID + "-1");
-        run(tester, ARGS1, TEST1, NEGATED_TEST1);
-        run(tester, ARGS2, NO_TEST, NO_TEST, FILE_TEST2, FILE_NEGATED_TEST2);
+        tester.run(ARGS0, TEST0, NO_TEST);
+        copyDir(SRC_DIR + "/pkg", OUTPUT_DIR + "-1");
+        tester.run(ARGS1, TEST1, NO_TEST);
+        tester.run(ARGS2, NO_TEST, NO_TEST, FILE_TEST2, FILE_NEGATED_TEST2);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testDocFiles/TestDocFiles.java b/langtools/test/com/sun/javadoc/testDocFiles/TestDocFiles.java
index 6866d91..7c17f1a 100644
--- a/langtools/test/com/sun/javadoc/testDocFiles/TestDocFiles.java
+++ b/langtools/test/com/sun/javadoc/testDocFiles/TestDocFiles.java
@@ -33,9 +33,8 @@
 
 public class TestDocFiles extends JavadocTester {
 
-    private static final String BUG_ID = "8008949";
     private static final String[][] TEST = {
-        {"tmp/pkg/doc-files/test.txt", "test file"}};
+        { "pkg/doc-files/test.txt", "test file"}};
 
     private static final String[] ARGS =
         new String[] {
@@ -47,21 +46,7 @@
      */
     public static void main(String[] args) {
         TestDocFiles tester = new TestDocFiles();
-        run(tester, ARGS, TEST, NO_TEST);
+        tester.run(ARGS, TEST, NO_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testDocRootInlineTag/TestDocRootInlineTag.java b/langtools/test/com/sun/javadoc/testDocRootInlineTag/TestDocRootInlineTag.java
index 1fc3100..1b53333 100644
--- a/langtools/test/com/sun/javadoc/testDocRootInlineTag/TestDocRootInlineTag.java
+++ b/langtools/test/com/sun/javadoc/testDocRootInlineTag/TestDocRootInlineTag.java
@@ -36,25 +36,23 @@
 
 public class TestDocRootInlineTag extends JavadocTester {
 
-    private static final String BUG_ID = "4369014-4851991";
     private static final String[][] TEST = {
-        {BUG_ID + "/TestDocRootTag.html",
+        { "TestDocRootTag.html",
             "<a href=\"http://www.java.sun.com/j2se/1.4/docs/api/java/io/File.html?is-external=true\" " +
             "title=\"class or interface in java.io\"><code>File</code></a>"},
-        {BUG_ID + "/TestDocRootTag.html",
+        { "TestDocRootTag.html",
             "<a href=\"./glossary.html\">glossary</a>"},
-        {BUG_ID + "/TestDocRootTag.html",
+        { "TestDocRootTag.html",
             "<a href=\"http://www.java.sun.com/j2se/1.4/docs/api/java/io/File.html?is-external=true\" " +
             "title=\"class or interface in java.io\"><code>Second File Link</code></a>"},
-        {BUG_ID + "/TestDocRootTag.html", "The value of @docRoot is \"./\""},
-        {BUG_ID + "/index-all.html", "My package page is " +
+        { "TestDocRootTag.html", "The value of @docRoot is \"./\""},
+        { "index-all.html", "My package page is " +
             "<a href=\"./pkg/package-summary.html\">here</a>"}
     };
-    private static final String[][] NEGATED_TEST = NO_TEST;
     private static final String[] ARGS =
         new String[] {
             "-bottom", "The value of @docRoot is \"{@docRoot}\"",
-            "-d", BUG_ID, "-sourcepath", SRC_DIR,
+            "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR,
             "-linkoffline", "http://www.java.sun.com/j2se/1.4/docs/api",
             SRC_DIR, SRC_DIR + "/TestDocRootTag.java", "pkg"
         };
@@ -65,21 +63,7 @@
      */
     public static void main(String[] args) {
         TestDocRootInlineTag tester = new TestDocRootInlineTag();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NO_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testDocRootLink/TestDocRootLink.java b/langtools/test/com/sun/javadoc/testDocRootLink/TestDocRootLink.java
index 07a62bf..9722546 100644
--- a/langtools/test/com/sun/javadoc/testDocRootLink/TestDocRootLink.java
+++ b/langtools/test/com/sun/javadoc/testDocRootLink/TestDocRootLink.java
@@ -32,92 +32,91 @@
  */
 public class TestDocRootLink extends JavadocTester {
 
-    private static final String BUG_ID = "6553182";
     private static final String[][] TEST1 = {
-        {BUG_ID + "/pkg1/C1.html",
+        { "pkg1/C1.html",
             "Refer <a href=\"../../technotes/guides/index.html\">Here</a>"
         },
-        {BUG_ID + "/pkg1/C1.html",
+        { "pkg1/C1.html",
             "This <a href=\"../pkg2/C2.html\">Here</a> should not be replaced\n" +
             " with an absolute link."
         },
-        {BUG_ID + "/pkg1/C1.html",
+        { "pkg1/C1.html",
             "Testing <a href=\"../technotes/guides/index.html\">Link 1</a> and\n" +
             " <a href=\"../pkg2/C2.html\">Link 2</a>."
         },
-        {BUG_ID + "/pkg1/package-summary.html",
+        { "pkg1/package-summary.html",
             "<a href=\"../../technotes/guides/index.html\">\n" +
             "            Test document 1</a>"
         },
-        {BUG_ID + "/pkg1/package-summary.html",
+        { "pkg1/package-summary.html",
             "<a href=\"../pkg2/C2.html\">\n" +
             "            Another Test document 1</a>"
         },
-        {BUG_ID + "/pkg1/package-summary.html",
+        { "pkg1/package-summary.html",
             "<a href=\"../technotes/guides/index.html\">\n" +
             "            Another Test document 2.</a>"
         }
     };
     private static final String[][] NEGATED_TEST1 = {
-        {BUG_ID + "/pkg1/C1.html",
+        { "pkg1/C1.html",
             "<a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">"
         },
-        {BUG_ID + "/pkg1/C1.html",
+        { "pkg1/C1.html",
             "<a href=\"http://download.oracle.com/javase/7/docs/pkg2/C2.html\">"
         },
-        {BUG_ID + "/pkg1/package-summary.html",
+        { "pkg1/package-summary.html",
             "<a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">"
         },
-        {BUG_ID + "/pkg1/package-summary.html",
+        { "pkg1/package-summary.html",
             "<a href=\"http://download.oracle.com/javase/7/docs/pkg2/C2.html\">"
         }
     };
     private static final String[][] TEST2 = {
-        {BUG_ID + "-1/pkg2/C2.html",
+        { "pkg2/C2.html",
             "Refer <a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">Here</a>"
         },
-        {BUG_ID + "-1/pkg2/C2.html",
+        { "pkg2/C2.html",
             "This <a href=\"../pkg1/C1.html\">Here</a> should not be replaced\n" +
             " with an absolute link."
         },
-        {BUG_ID + "-1/pkg2/C2.html",
+        { "pkg2/C2.html",
             "Testing <a href=\"../technotes/guides/index.html\">Link 1</a> and\n" +
             " <a href=\"../pkg1/C1.html\">Link 2</a>."
         },
-        {BUG_ID + "-1/pkg2/package-summary.html",
+        { "pkg2/package-summary.html",
             "<a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">\n" +
             "            Test document 1</a>"
         },
-        {BUG_ID + "-1/pkg2/package-summary.html",
+        { "pkg2/package-summary.html",
             "<a href=\"../pkg1/C1.html\">\n" +
             "            Another Test document 1</a>"
         },
-        {BUG_ID + "-1/pkg2/package-summary.html",
+        { "pkg2/package-summary.html",
             "<a href=\"../technotes/guides/index.html\">\n" +
             "            Another Test document 2.</a>"
         }
     };
     private static final String[][] NEGATED_TEST2 = {
-        {BUG_ID + "-1/pkg2/C2.html",
+        { "pkg2/C2.html",
             "<a href=\"../../technotes/guides/index.html\">"
         },
-        {BUG_ID + "-1/pkg2/C2.html",
+        { "pkg2/C2.html",
             "<a href=\"http://download.oracle.com/javase/7/docs/pkg1/C1.html\">"
         },
-        {BUG_ID + "-1/pkg2/package-summary.html",
+        { "pkg2/package-summary.html",
             "<a href=\"../../technotes/guides/index.html\">"
         },
-        {BUG_ID + "-1/pkg2/package-summary.html",
+        { "pkg2/package-summary.html",
             "<a href=\"http://download.oracle.com/javase/7/docs/pkg1/C1.html\">"
         }
     };
     private static final String[] ARGS1 =
             new String[]{
-        "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg1", "pkg2"
+        "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg1", "pkg2"
     };
     private static final String[] ARGS2 =
             new String[]{
-        "-d", BUG_ID + "-1", "-Xdocrootparent",
+        "-d", OUTPUT_DIR + "-1", "-Xdocrootparent",
         "http://download.oracle.com/javase/7/docs", "-sourcepath",
         SRC_DIR, "pkg1", "pkg2"
     };
@@ -128,22 +127,8 @@
      */
     public static void main(String[] args) {
         TestDocRootLink tester = new TestDocRootLink();
-        run(tester, ARGS1, TEST1, NEGATED_TEST1);
-        run(tester, ARGS2, TEST2, NEGATED_TEST2);
+        tester.run(ARGS1, TEST1, NEGATED_TEST1);
+        tester.run(ARGS2, TEST2, NEGATED_TEST2);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testDupParamWarn/TestDupParamWarn.java b/langtools/test/com/sun/javadoc/testDupParamWarn/TestDupParamWarn.java
index e9d39ab..94981f9 100644
--- a/langtools/test/com/sun/javadoc/testDupParamWarn/TestDupParamWarn.java
+++ b/langtools/test/com/sun/javadoc/testDupParamWarn/TestDupParamWarn.java
@@ -35,9 +35,8 @@
 
 public class TestDupParamWarn extends JavadocTester {
 
-    private static final String BUG_ID = "4745855";
     private static final String[] ARGS =
-        new String[] {"-d", BUG_ID, "-sourcepath",
+        new String[] {"-d", OUTPUT_DIR, "-sourcepath",
                 SRC_DIR + "/", "pkg"};
     private static final String[][] NEGATED_TEST =
         new String[][] {{WARNING_OUTPUT,
@@ -48,20 +47,8 @@
      * @param args the array of command line arguments.
      */
     public static void main(String[] args) {
-        run(new TestDupParamWarn(), ARGS, NO_TEST, NEGATED_TEST);
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
+        JavadocTester tester = new TestDupParamWarn();
+        tester.run(ARGS, NO_TEST, NEGATED_TEST);
+        tester.printSummary();
     }
 }
diff --git a/langtools/test/com/sun/javadoc/testEmptyClass/TestEmptyClass.java b/langtools/test/com/sun/javadoc/testEmptyClass/TestEmptyClass.java
index 79e1e77..96b0192 100644
--- a/langtools/test/com/sun/javadoc/testEmptyClass/TestEmptyClass.java
+++ b/langtools/test/com/sun/javadoc/testEmptyClass/TestEmptyClass.java
@@ -35,15 +35,13 @@
 
 public class TestEmptyClass extends JavadocTester {
 
-    private static final String OUTPUT_DIR = "tmp";
-    private static final String[][] TEST = NO_TEST;
     private static final String[][] NEGATED_TEST = {
 
         //The overview tree should not link to classes that were not documented
-        {OUTPUT_DIR + "/overview-tree.html", "<A HREF=\"TestEmptyClass.html\">"},
+        { "overview-tree.html", "<A HREF=\"TestEmptyClass.html\">"},
 
         //The index page should not link to classes that were not documented
-        {OUTPUT_DIR + "/index-all.html", "<A HREF=\"TestEmptyClass.html\">"},
+        { "index-all.html", "<A HREF=\"TestEmptyClass.html\">"},
     };
     private static final String[] ARGS =
         new String[] {
@@ -51,8 +49,6 @@
             "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR + "/src",
             SRC_DIR + "/src/Empty.java"
         };
-    private static final String BUG_ID =
-        "4483401 4483407 4483409 4483413 4494343";
 
     /**
      * The entry point of the test.
@@ -60,24 +56,10 @@
      */
     public static void main(String[] args) {
         TestEmptyClass tester = new TestEmptyClass();
-        int exitCode = run(tester, ARGS, TEST, NEGATED_TEST);
+        int exitCode = tester.run(ARGS, NO_TEST, NEGATED_TEST);
         tester.printSummary();
         if (exitCode != 0) {
             throw new Error("Error found while executing Javadoc");
         }
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testEnclosingClass/TestEnclosingClass.java b/langtools/test/com/sun/javadoc/testEnclosingClass/TestEnclosingClass.java
index 97d7600..86affec 100644
--- a/langtools/test/com/sun/javadoc/testEnclosingClass/TestEnclosingClass.java
+++ b/langtools/test/com/sun/javadoc/testEnclosingClass/TestEnclosingClass.java
@@ -34,19 +34,15 @@
 
 public class TestEnclosingClass extends JavadocTester {
 
-    //Test information.
-    private static final String BUG_ID = "5008230";
-
     //Javadoc arguments.
     private static final String[] ARGS = new String[] {
-        "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg"
+        "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg"
     };
 
     //Input for string search tests.
     private static final String[][] TEST = {
-        {BUG_ID + "/pkg/MyClass.MyInterface.html", "Enclosing class:"}
+        { "pkg/MyClass.MyInterface.html", "Enclosing class:"}
     };
-    private static final String[][] NEGATED_TEST = NO_TEST;
 
     /**
      * The entry point of the test.
@@ -54,21 +50,7 @@
      */
     public static void main(String[] args) {
         TestEnclosingClass tester = new TestEnclosingClass();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NO_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testEncoding/TestEncoding.java b/langtools/test/com/sun/javadoc/testEncoding/TestEncoding.java
index c6b63a7..5627f47 100644
--- a/langtools/test/com/sun/javadoc/testEncoding/TestEncoding.java
+++ b/langtools/test/com/sun/javadoc/testEncoding/TestEncoding.java
@@ -35,16 +35,14 @@
 
 public class TestEncoding extends JavadocTester {
 
-    private static final String BUG_ID = "4661481";
-    private static final String[][] TEST = NO_TEST;
 
     //If ??? is found in the output, the source file was not read with the correct encoding setting.
     private static final String[][] NEGATED_TEST = {
-        {BUG_ID + "/EncodeTest.html", "??"}
+        { "EncodeTest.html", "??"}
     };
     private static final String[] ARGS =
         new String[] {
-            "-d", BUG_ID, "-sourcepath", SRC_DIR,
+            "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR,
             "-encoding", "iso-8859-1", SRC_DIR + "/EncodeTest.java"
         };
 
@@ -54,21 +52,7 @@
      */
     public static void main(String[] args) {
         TestEncoding tester = new TestEncoding();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, NO_TEST, NEGATED_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testExternalOverridenMethod/TestExternalOverridenMethod.java b/langtools/test/com/sun/javadoc/testExternalOverridenMethod/TestExternalOverridenMethod.java
index 0ba8075..71e318c 100644
--- a/langtools/test/com/sun/javadoc/testExternalOverridenMethod/TestExternalOverridenMethod.java
+++ b/langtools/test/com/sun/javadoc/testExternalOverridenMethod/TestExternalOverridenMethod.java
@@ -35,28 +35,23 @@
 
 public class TestExternalOverridenMethod extends JavadocTester {
 
-    private static final String BUG_ID = "4857717";
     private static final String[][] TEST = {
-        {BUG_ID + "/pkg/XReader.html",
+        { "pkg/XReader.html",
             "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" +
             "<dd><code><a href=\"http://java.sun.com/j2se/1.4.1/docs/api/java/io/FilterReader.html?is-external=true#read--\" " +
             "title=\"class or interface in java.io\">read</a></code>&nbsp;in class&nbsp;<code>" +
             "<a href=\"http://java.sun.com/j2se/1.4.1/docs/api/java/io/FilterReader.html?is-external=true\" " +
             "title=\"class or interface in java.io\">FilterReader</a></code></dd>"},
-        {BUG_ID + "/pkg/XReader.html",
+        { "pkg/XReader.html",
             "<dt><span class=\"overrideSpecifyLabel\">Specified by:</span></dt>\n" +
             "<dd><code><a href=\"http://java.sun.com/j2se/1.4.1/docs/api/java/io/DataInput.html?is-external=true#readInt--\" " +
             "title=\"class or interface in java.io\">readInt</a></code>&nbsp;in interface&nbsp;<code>" +
             "<a href=\"http://java.sun.com/j2se/1.4.1/docs/api/java/io/DataInput.html?is-external=true\" " +
             "title=\"class or interface in java.io\">DataInput</a></code></dd>"}};
 
-
-
-    private static final String[][] NEGATED_TEST = NO_TEST;
-
     private static final String[] ARGS =
         new String[] {
-            "-d", BUG_ID, "-sourcepath", SRC_DIR,
+            "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR,
             "-linkoffline", "http://java.sun.com/j2se/1.4.1/docs/api", SRC_DIR,
             "pkg"
         };
@@ -67,21 +62,7 @@
      */
     public static void main(String[] args) {
         TestExternalOverridenMethod tester = new TestExternalOverridenMethod();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NO_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testGeneratedBy/TestGeneratedBy.java b/langtools/test/com/sun/javadoc/testGeneratedBy/TestGeneratedBy.java
index f3b9729..a43bdc1 100644
--- a/langtools/test/com/sun/javadoc/testGeneratedBy/TestGeneratedBy.java
+++ b/langtools/test/com/sun/javadoc/testGeneratedBy/TestGeneratedBy.java
@@ -32,8 +32,6 @@
 
 public class TestGeneratedBy extends JavadocTester {
 
-    private static final String OUTPUT_DIR = "tmp";
-
     private static final String[] FILES = {
         "pkg/MyClass.html",
         "pkg/package-summary.html",
@@ -65,7 +63,6 @@
             "pkg"
         };
 
-    private static final String BUG_ID = "8000418-8024288";
 
     private static String[][] getTests(boolean timestamp) {
         String version = System.getProperty("java.version");
@@ -74,7 +71,7 @@
             String genBy = "Generated by javadoc";
             if (timestamp) genBy += " (" + version + ") on ";
             tests[i] = new String[] {
-                OUTPUT_DIR + "/" + FILES[i], genBy
+                FILES[i], genBy
             };
         }
         return tests;
@@ -84,7 +81,7 @@
         String[][] tests = new String[FILES.length][];
         for (int i = 0; i < FILES.length; i++) {
             tests[i] = new String[] {
-                OUTPUT_DIR + "/" + FILES[i],
+                FILES[i],
                 (timestamp
                     ? "Generated by javadoc (version"
                     : "Generated by javadoc ("),
@@ -100,26 +97,12 @@
      */
     public static void main(String[] args) {
         TestGeneratedBy tester = new TestGeneratedBy();
-        int ec1 = run(tester, STD_ARGS, getTests(true), getNegatedTests(true));
-        int ec2 = run(tester, NO_TIMESTAMP_ARGS, getTests(false), getNegatedTests(false));
+        int ec1 = tester.run(STD_ARGS, getTests(true), getNegatedTests(true));
+        int ec2 = tester.run(NO_TIMESTAMP_ARGS, getTests(false), getNegatedTests(false));
         tester.printSummary();
         if (ec1 != 0 || ec2 != 0) {
             throw new Error("Error found while executing Javadoc");
         }
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
 
diff --git a/langtools/test/com/sun/javadoc/testGroupOption/TestGroupOption.java b/langtools/test/com/sun/javadoc/testGroupOption/TestGroupOption.java
index f475a13..d86eaba 100644
--- a/langtools/test/com/sun/javadoc/testGroupOption/TestGroupOption.java
+++ b/langtools/test/com/sun/javadoc/testGroupOption/TestGroupOption.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -35,12 +35,9 @@
 
 public class TestGroupOption extends JavadocTester {
 
-    //Test information.
-    private static final String BUG_ID = "4924383";
-
     //Javadoc arguments.
     private static final String[] ARGS1 = new String[] {
-        "-d", BUG_ID, "-sourcepath", SRC_DIR,
+        "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR,
         "-group", "Package One", "pkg1",
         "-group", "Package Two", "pkg2",
         "-group", "Package Three", "pkg3",
@@ -48,7 +45,7 @@
     };
 
     private static final String[] ARGS2 = new String[] {
-        "-d", BUG_ID, "-sourcepath", SRC_DIR,
+        "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR,
         "-group", "Package One", "pkg1",
         "-group", "Package One", "pkg2",
         "-group", "Package One", "pkg3",
@@ -56,11 +53,9 @@
     };
 
     //Input for string search tests.
-    private static final String[][] TEST1 = NO_TEST;
     private static final String[][] NEGATED_TEST1 = {{WARNING_OUTPUT, "-group"}};
 
     private static final String[][] TEST2 = {{WARNING_OUTPUT, "-group"}};
-    private static final String[][] NEGATED_TEST2 = NO_TEST;
 
     /**
      * The entry point of the test.
@@ -69,26 +64,12 @@
     public static void main(String[] args) {
         //Make sure the warning is not printed when -group is used correctly.
         TestGroupOption tester = new TestGroupOption();
-        run(tester, ARGS1, TEST1, NEGATED_TEST1);
+        tester.run(ARGS1, NO_TEST, NEGATED_TEST1);
         tester.printSummary();
 
         //Make sure the warning is printed when -group is not used correctly.
         tester = new TestGroupOption();
-        run(tester, ARGS2, TEST2, NEGATED_TEST2);
+        tester.run(ARGS2, TEST2, NO_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testHeadings/TestHeadings.java b/langtools/test/com/sun/javadoc/testHeadings/TestHeadings.java
index e0737f8..f3789cf 100644
--- a/langtools/test/com/sun/javadoc/testHeadings/TestHeadings.java
+++ b/langtools/test/com/sun/javadoc/testHeadings/TestHeadings.java
@@ -34,19 +34,16 @@
 
 public class TestHeadings extends JavadocTester {
 
-    //Test information.
-    private static final String BUG_ID = "4905786-6259611";
-
     //Javadoc arguments.
     private static final String[] ARGS = new String[] {
-        "-d", BUG_ID, "-sourcepath", SRC_DIR, "-use", "-header", "Test Files",
+        "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "-use", "-header", "Test Files",
         "pkg1", "pkg2"
     };
 
     //Input for string search tests.
     private static final String[][] TEST = {
         //Package summary
-        {BUG_ID + "/pkg1/package-summary.html",
+        { "pkg1/package-summary.html",
             "<th class=\"colFirst\" scope=\"col\">" +
             "Class</th>\n" +
             "<th class=\"colLast\" scope=\"col\"" +
@@ -54,31 +51,31 @@
         },
 
         // Class documentation
-        {BUG_ID + "/pkg1/C1.html",
+        { "pkg1/C1.html",
             "<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>\n" +
             "<th class=\"colLast\" scope=\"col\">Field and Description</th>"
         },
-        {BUG_ID + "/pkg1/C1.html",
+        { "pkg1/C1.html",
             "<h3>Methods inherited from class&nbsp;java.lang.Object</h3>"
         },
 
         // Class use documentation
-        {BUG_ID + "/pkg1/class-use/C1.html",
+        { "pkg1/class-use/C1.html",
             "<th class=\"colFirst\" scope=\"col\">Package</th>\n" +
             "<th class=\"colLast\" scope=\"col\">Description</th>"
         },
-        {BUG_ID + "/pkg1/class-use/C1.html",
+        { "pkg1/class-use/C1.html",
             "<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>\n" +
             "<th class=\"colLast\" scope=\"col\">Field and Description</th>"
         },
 
         // Deprecated
-        {BUG_ID + "/deprecated-list.html",
+        { "deprecated-list.html",
             "<th class=\"colOne\" scope=\"col\">Method and Description</th>"
         },
 
         // Constant values
-        {BUG_ID + "/constant-values.html",
+        { "constant-values.html",
             "<th class=\"colFirst\" scope=\"col\">" +
             "Modifier and Type</th>\n" +
             "<th scope=\"col\">Constant Field</th>\n" +
@@ -86,32 +83,30 @@
         },
 
         // Serialized Form
-        {BUG_ID + "/serialized-form.html",
+        { "serialized-form.html",
             "<h2 title=\"Package\">Package&nbsp;pkg1</h2>"
         },
-        {BUG_ID + "/serialized-form.html",
+        { "serialized-form.html",
             "<h3>Class <a href=\"pkg1/C1.html\" title=\"class in pkg1\">" +
             "pkg1.C1</a> extends java.lang.Object implements Serializable</h3>"
         },
-        {BUG_ID + "/serialized-form.html",
+        { "serialized-form.html",
             "<h3>Serialized Fields</h3>"
         },
 
         // Overview Frame
-        {BUG_ID + "/overview-frame.html",
+        { "overview-frame.html",
             "<h1 title=\"Test Files\" class=\"bar\">Test Files</h1>"
         },
-        {BUG_ID + "/overview-frame.html",
+        { "overview-frame.html",
             "<title>Overview List</title>"
         },
 
         // Overview Summary
-        {BUG_ID + "/overview-summary.html",
+        { "overview-summary.html",
             "<title>Overview</title>"
-        },
-
+        }
     };
-    private static final String[][] NEGATED_TEST = NO_TEST;
 
     /**
      * The entry point of the test.
@@ -119,21 +114,7 @@
      */
     public static void main(String[] args) {
         TestHeadings tester = new TestHeadings();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NO_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testHelpFile/TestHelpFile.java b/langtools/test/com/sun/javadoc/testHelpFile/TestHelpFile.java
index 8a358e4..ca62843 100644
--- a/langtools/test/com/sun/javadoc/testHelpFile/TestHelpFile.java
+++ b/langtools/test/com/sun/javadoc/testHelpFile/TestHelpFile.java
@@ -33,19 +33,14 @@
 
 public class TestHelpFile extends JavadocTester {
 
-    //Test information.
-    private static final String BUG_ID = "7132631";
-
     //Javadoc arguments.
     private static final String[] ARGS = new String[] {
-        "-d", BUG_ID, "-sourcepath", SRC_DIR,
+        "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR,
             SRC_DIR + "/TestHelpFile.java"
     };
 
-    private static final String[][] NEGATED_TEST = NO_TEST;
-
     private static final String[][] TEST = {
-        {BUG_ID + "/help-doc.html",
+        { "help-doc.html",
             "<a href=\"constant-values.html\">Constant Field Values</a>"
         },
     };
@@ -56,21 +51,7 @@
      */
     public static void main(String[] args) {
         TestHelpFile tester = new TestHelpFile();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NO_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testHelpOption/TestHelpOption.java b/langtools/test/com/sun/javadoc/testHelpOption/TestHelpOption.java
index 46f6de7..44d6d32 100644
--- a/langtools/test/com/sun/javadoc/testHelpOption/TestHelpOption.java
+++ b/langtools/test/com/sun/javadoc/testHelpOption/TestHelpOption.java
@@ -34,17 +34,14 @@
 
 public class TestHelpOption extends JavadocTester {
 
-    //Test information.
-    private static final String BUG_ID = "4934778-4777599-6553182";
-
     //Javadoc arguments.
     private static final String[] ARGS = new String[] {
-        "-d", BUG_ID, "-sourcepath", SRC_DIR, "-help",
+        "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "-help",
             SRC_DIR + "/TestHelpOption.java"
     };
 
     private static final String[] ARGS2 = new String[] {
-        "-d", BUG_ID, "-sourcepath", SRC_DIR,
+        "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR,
             SRC_DIR + "/TestHelpOption.java"
     };
 
@@ -86,14 +83,12 @@
         {STANDARD_OUTPUT, "-stylesheetfile "},
         {STANDARD_OUTPUT, "-docencoding "},
     };
-    private static final String[][] NEGATED_TEST = NO_TEST;
 
     private static final String[][] TEST2 = {
-        {BUG_ID + "/TestHelpOption.html",
+        { "TestHelpOption.html",
             "<li><a href=\"help-doc.html\">Help</a></li>"
         },
     };
-    private static final String[][] NEGATED_TEST2 = NO_TEST;
 
     //The help option should not crash the doclet.
     private static final int EXPECTED_EXIT_CODE = 0;
@@ -104,23 +99,9 @@
      */
     public static void main(String[] args) {
         TestHelpOption tester = new TestHelpOption();
-        int actualExitCode = run(tester, ARGS, TEST, NEGATED_TEST);
+        int actualExitCode = tester.run(ARGS, TEST, NO_TEST);
         tester.checkExitCode(EXPECTED_EXIT_CODE, actualExitCode);
-        run(tester, ARGS2, TEST2, NEGATED_TEST2);
+        tester.run(ARGS2, TEST2, NO_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testHiddenMembers/TestHiddenMembers.java b/langtools/test/com/sun/javadoc/testHiddenMembers/TestHiddenMembers.java
index 36e17cd..8d59523 100644
--- a/langtools/test/com/sun/javadoc/testHiddenMembers/TestHiddenMembers.java
+++ b/langtools/test/com/sun/javadoc/testHiddenMembers/TestHiddenMembers.java
@@ -35,18 +35,16 @@
 
 public class TestHiddenMembers extends JavadocTester {
 
-    private static final String BUG_ID = "4492178";
-    private static final String[][] TEST = NO_TEST;
 
     //We should not inherit any members from BaseClass because they are all overriden and hidden
     //(declared as private).
     private static final String[][] NEGATED_TEST = {
-        {BUG_ID + "/pkg/SubClass.html",
+        { "pkg/SubClass.html",
             "inherited from class pkg.<A HREF=\"../pkg/BaseClass.html\">BaseClass</A>"}
         };
     private static final String[] ARGS =
         new String[] {
-            "-d", BUG_ID, "-sourcepath", SRC_DIR,
+            "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR,
             "pkg"
         };
 
@@ -56,21 +54,7 @@
      */
     public static void main(String[] args) {
         TestHiddenMembers tester = new TestHiddenMembers();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, NO_TEST, NEGATED_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testHref/TestHref.java b/langtools/test/com/sun/javadoc/testHref/TestHref.java
index 9683eee..09ad34e 100644
--- a/langtools/test/com/sun/javadoc/testHref/TestHref.java
+++ b/langtools/test/com/sun/javadoc/testHref/TestHref.java
@@ -33,54 +33,51 @@
 
 public class TestHref extends JavadocTester {
 
-    //Test information.
-    private static final String BUG_ID = "4663254";
-
     //Javadoc arguments.
     private static final String[] ARGS = new String[] {
-        "-d", BUG_ID, "-sourcepath", SRC_DIR, "-linkoffline",
+        "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "-linkoffline",
         "http://java.sun.com/j2se/1.4/docs/api/", SRC_DIR, "pkg"
     };
 
     //Input for string search tests.
     private static final String[][] TEST = {
         //External link.
-        {BUG_ID + "/pkg/C1.html",
+        { "pkg/C1.html",
             "href=\"http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html?is-external=true#wait-long-int-\""
         },
         //Member summary table link.
-        {BUG_ID + "/pkg/C1.html",
+        { "pkg/C1.html",
             "href=\"../pkg/C1.html#method-int-int-java.util.ArrayList-\""
         },
         //Anchor test.
-        {BUG_ID + "/pkg/C1.html",
+        { "pkg/C1.html",
             "<a name=\"method-int-int-java.util.ArrayList-\">\n" +
             "<!--   -->\n" +
             "</a>"
         },
         //Backward compatibility anchor test.
-        {BUG_ID + "/pkg/C1.html",
+        { "pkg/C1.html",
             "<a name=\"method-int-int-java.util.ArrayList-\">\n" +
             "<!--   -->\n" +
             "</a>"
         },
         //{@link} test.
-        {BUG_ID + "/pkg/C2.html",
+        { "pkg/C2.html",
             "Link: <a href=\"../pkg/C1.html#method-int-int-java.util.ArrayList-\">"
         },
         //@see test.
-        {BUG_ID + "/pkg/C2.html",
+        { "pkg/C2.html",
             "See Also:</span></dt>\n" +
             "<dd><a href=\"../pkg/C1.html#method-int-int-java.util.ArrayList-\">"
         },
 
         //Header does not link to the page itself.
-        {BUG_ID + "/pkg/C4.html",
+        { "pkg/C4.html",
             "Class C4&lt;E extends C4&lt;E&gt;&gt;</h2>"
         },
 
         //Signature does not link to the page itself.
-        {BUG_ID + "/pkg/C4.html",
+        { "pkg/C4.html",
             "public abstract class <span class=\"typeNameLabel\">C4&lt;E extends C4&lt;E&gt;&gt;</span>"
         },
     };
@@ -95,21 +92,7 @@
      */
     public static void main(String[] args) {
         TestHref tester = new TestHref();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NEGATED_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testHrefInDocComment/TestHrefInDocComment.java b/langtools/test/com/sun/javadoc/testHrefInDocComment/TestHrefInDocComment.java
index 80b2c49..b37f0829 100644
--- a/langtools/test/com/sun/javadoc/testHrefInDocComment/TestHrefInDocComment.java
+++ b/langtools/test/com/sun/javadoc/testHrefInDocComment/TestHrefInDocComment.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -35,12 +35,9 @@
 
 public class TestHrefInDocComment extends JavadocTester {
 
-    private static final String BUG_ID = "4638015";
-    private static final String[][] TEST = NO_TEST;
-    private static final String[][] NEGATED_TEST = NO_TEST;
     private static final String[] ARGS =
         new String[] {
-            "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg"};
+            "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg"};
 
     /**
      * The entry point of the test.
@@ -48,23 +45,8 @@
      */
     public static void main(String[] args) {
         TestHrefInDocComment tester = new TestHrefInDocComment();
-        if (run(tester, ARGS, TEST, NEGATED_TEST) != 0) {
+        if (tester.run(ARGS, NO_TEST, NO_TEST) != 0) {
             throw new Error("Javadoc failed to execute properly with given source.");
         }
-
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
     }
 }
diff --git a/langtools/test/com/sun/javadoc/testHtmlComments/TestHtmlComments.java b/langtools/test/com/sun/javadoc/testHtmlComments/TestHtmlComments.java
index e9f3233..d23f599 100644
--- a/langtools/test/com/sun/javadoc/testHtmlComments/TestHtmlComments.java
+++ b/langtools/test/com/sun/javadoc/testHtmlComments/TestHtmlComments.java
@@ -35,18 +35,14 @@
 
 public class TestHtmlComments extends JavadocTester {
 
-    //Test information.
-    private static final String BUG_ID = "4904038";
-
     //Javadoc arguments.
     private static final String[] ARGS = new String[] {
-        "-d", BUG_ID, "-sourcepath", SRC_DIR, SRC_DIR + "/C.java"
+        "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, SRC_DIR + "/C.java"
     };
 
     //Input for string search tests.
-    private static final String[][] TEST = NO_TEST;
     private static final String[][] NEGATED_TEST = {
-        {BUG_ID + "/C.html",
+        { "C.html",
             "<!-- ============ FIELD DETAIL =========== -->"}
     };
 
@@ -56,21 +52,7 @@
      */
     public static void main(String[] args) {
         TestHtmlComments tester = new TestHtmlComments();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, NO_TEST, NEGATED_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java b/langtools/test/com/sun/javadoc/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java
index 8603355..ec111e9 100644
--- a/langtools/test/com/sun/javadoc/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java
+++ b/langtools/test/com/sun/javadoc/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java
@@ -35,18 +35,16 @@
 
 public class TestHtmlDefinitionListTag extends JavadocTester {
 
-    private static final String BUG_ID = "6786690-6820360";
-
     // Test common to all runs of javadoc. The class signature should print
     // properly enclosed definition list tags and the Annotation Type
     // Optional Element should print properly nested definition list tags
     // for default value.
     private static final String[][] TEST_ALL = {
-        {BUG_ID + "/pkg1/C1.html", "<pre>public class " +
+        { "pkg1/C1.html", "<pre>public class " +
                  "<span class=\"typeNameLabel\">C1</span>\n" +
                  "extends java.lang.Object\n" +
                  "implements java.io.Serializable</pre>"},
-        {BUG_ID + "/pkg1/C4.html", "<dl>\n" +
+        { "pkg1/C4.html", "<dl>\n" +
                  "<dt>Default:</dt>\n" +
                  "<dd>true</dd>\n" +
                  "</dl>"}};
@@ -55,11 +53,11 @@
     // serialized form should have properly nested definition list tags
     // enclosing comments, tags and deprecated information.
     private static final String[][] TEST_CMNT_DEPR = {
-        {BUG_ID + "/pkg1/package-summary.html", "<dl>\n" +
+        { "pkg1/package-summary.html", "<dl>\n" +
                  "<dt><span class=\"simpleTagLabel\">Since:</span></dt>\n" +
                  "<dd>JDK1.0</dd>\n" +
                  "</dl>"},
-        {BUG_ID + "/pkg1/C1.html", "<dl>\n" +
+        { "pkg1/C1.html", "<dl>\n" +
         "<dt><span class=\"simpleTagLabel\">Since:</span></dt>\n" +
                  "<dd>JDK1.0</dd>\n" +
                  "<dt><span class=\"seeLabel\">See Also:</span></dt>\n" +
@@ -68,7 +66,7 @@
                  "<a href=\"../serialized-form.html#pkg1.C1\">" +
                  "Serialized Form</a></dd>\n" +
                  "</dl>"},
-        {BUG_ID + "/pkg1/C1.html", "<dl>\n" +
+        { "pkg1/C1.html", "<dl>\n" +
         "<dt><span class=\"simpleTagLabel\">Since:</span></dt>\n" +
                  "<dd>1.4</dd>\n" +
                  "<dt><span class=\"seeLabel\">See Also:</span></dt>\n" +
@@ -76,7 +74,7 @@
                  "<a href=\"../pkg1/C1.html#setUndecorated-boolean-\">" +
                  "<code>setUndecorated(boolean)</code></a></dd>\n" +
                  "</dl>"},
-        {BUG_ID + "/pkg1/C1.html", "<dl>\n" +
+        { "pkg1/C1.html", "<dl>\n" +
                  "<dt><span class=\"paramLabel\">Parameters:</span></dt>\n" +
                  "<dd><code>title" +
                  "</code> - the title</dd>\n" +
@@ -89,7 +87,7 @@
                  "device</dd>\n" +
                  "<dd><code>HeadlessException</code></dd>\n" +
                  "</dl>"},
-        {BUG_ID + "/pkg1/C1.html", "<dl>\n" +
+        { "pkg1/C1.html", "<dl>\n" +
         "<dt><span class=\"paramLabel\">Parameters:</span></dt>\n" +
         "<dd><code>undecorated" +
                  "</code> - <code>true</code> if no decorations are\n" +
@@ -104,7 +102,7 @@
                  "<a href=\"../pkg1/C1.html#readObject--\"><code>readObject()" +
                  "</code></a></dd>\n" +
                  "</dl>"},
-        {BUG_ID + "/pkg1/C1.html", "<dl>\n" +
+        { "pkg1/C1.html", "<dl>\n" +
         "<dt><span class=\"throwsLabel\">Throws:</span></dt>\n" +
                  "<dd><code>java.io.IOException</code></dd>\n" +
                  "<dt><span class=\"seeLabel\">See Also:" +
@@ -112,7 +110,7 @@
                  "<dd><a href=\"../pkg1/C1.html#setUndecorated-boolean-\">" +
                  "<code>setUndecorated(boolean)</code></a></dd>\n" +
                  "</dl>"},
-        {BUG_ID + "/pkg1/C2.html", "<dl>\n" +
+        { "pkg1/C2.html", "<dl>\n" +
         "<dt><span class=\"paramLabel\">Parameters:" +
                  "</span></dt>\n" +
                  "<dd><code>set</code> - boolean</dd>\n" +
@@ -120,7 +118,7 @@
                  "Since:</span></dt>\n" +
                  "<dd>1.4</dd>\n" +
                  "</dl>"},
-        {BUG_ID + "/serialized-form.html", "<dl>\n" +
+        { "serialized-form.html", "<dl>\n" +
         "<dt><span class=\"throwsLabel\">Throws:</span>" +
                  "</dt>\n" +
                  "<dd><code>" +
@@ -130,7 +128,7 @@
                  "<dd><a href=\"pkg1/C1.html#setUndecorated-boolean-\">" +
                  "<code>C1.setUndecorated(boolean)</code></a></dd>\n" +
                  "</dl>"},
-        {BUG_ID + "/serialized-form.html",
+        { "serialized-form.html",
                  "<span class=\"deprecatedLabel\">Deprecated.</span>" +
                  "&nbsp;<span class=\"deprecationComment\">As of JDK version 1.5, replaced by\n" +
                  " <a href=\"pkg1/C1.html#setUndecorated-boolean-\">" +
@@ -146,7 +144,7 @@
                  "<dd><a href=\"pkg1/C1.html#setUndecorated-boolean-\">" +
                  "<code>C1.setUndecorated(boolean)</code></a></dd>\n" +
                  "</dl>"},
-        {BUG_ID + "/serialized-form.html",
+        { "serialized-form.html",
                  "<span class=\"deprecatedLabel\">Deprecated.</span>" +
                  "&nbsp;<span class=\"deprecationComment\">As of JDK version 1.5, replaced by\n" +
                  " <a href=\"pkg1/C1.html#setUndecorated-boolean-\">" +
@@ -159,7 +157,7 @@
                  "IOException</code></code></dd>\n" +
                  "<dd><code>java.io.IOException</code></dd>\n" +
                  "</dl>"},
-        {BUG_ID + "/serialized-form.html",
+        { "serialized-form.html",
                  "<span class=\"deprecatedLabel\">Deprecated.</span>" +
                  "&nbsp;</div>\n" +
                  "<div class=\"block\">The name for this class.</div>"}};
@@ -170,11 +168,11 @@
     // should display properly nested definition list tags for comments, tags
     // and deprecated information.
     private static final String[][] TEST_NODEPR = {
-        {BUG_ID + "/pkg1/package-summary.html", "<dl>\n" +
+        { "pkg1/package-summary.html", "<dl>\n" +
                  "<dt><span class=\"simpleTagLabel\">Since:</span></dt>\n" +
                  "<dd>JDK1.0</dd>\n" +
                  "</dl>"},
-        {BUG_ID + "/pkg1/C1.html", "<dl>\n" +
+        { "pkg1/C1.html", "<dl>\n" +
         "<dt><span class=\"simpleTagLabel\">Since:</span>" +
                  "</dt>\n" +
                  "<dd>JDK1.0</dd>\n" +
@@ -185,7 +183,7 @@
                  "<a href=\"../serialized-form.html#pkg1.C1\">" +
                  "Serialized Form</a></dd>\n" +
                  "</dl>"},
-        {BUG_ID + "/pkg1/C1.html", "<dl>\n" +
+        { "pkg1/C1.html", "<dl>\n" +
         "<dt><span class=\"paramLabel\">Parameters:" +
                  "</span></dt>\n" +
                  "<dd><code>title</code> - the title</dd>\n" +
@@ -200,7 +198,7 @@
                  "<dd><code>" +
                  "HeadlessException</code></dd>\n" +
                  "</dl>"},
-        {BUG_ID + "/pkg1/C1.html", "<dl>\n" +
+        { "pkg1/C1.html", "<dl>\n" +
         "<dt><span class=\"paramLabel\">Parameters:" +
                  "</span></dt>\n" +
                  "<dd><code>undecorated</code> - <code>true</code>" +
@@ -214,7 +212,7 @@
                  "<dd><a href=\"../pkg1/C1.html#readObject--\">" +
                  "<code>readObject()</code></a></dd>\n" +
                  "</dl>"},
-        {BUG_ID + "/pkg1/C1.html", "<dl>\n" +
+        { "pkg1/C1.html", "<dl>\n" +
         "<dt><span class=\"throwsLabel\">Throws:</span>" +
                  "</dt>\n" +
                  "<dd><code>java.io.IOException</code></dd>\n" +
@@ -223,7 +221,7 @@
                  "<dd><a href=\"../pkg1/C1.html#setUndecorated-boolean-\">" +
                  "<code>setUndecorated(boolean)</code></a></dd>\n" +
                  "</dl>"},
-        {BUG_ID + "/serialized-form.html", "<dl>\n" +
+        { "serialized-form.html", "<dl>\n" +
         "<dt><span class=\"throwsLabel\">Throws:</span>" +
                  "</dt>\n" +
                  "<dd><code>" +
@@ -233,7 +231,7 @@
                  "<dd><a href=\"pkg1/C1.html#setUndecorated-boolean-\">" +
                  "<code>C1.setUndecorated(boolean)</code></a></dd>\n" +
                  "</dl>"},
-        {BUG_ID + "/serialized-form.html",
+        { "serialized-form.html",
                  "<span class=\"deprecatedLabel\">Deprecated.</span>" +
                  "&nbsp;<span class=\"deprecationComment\">As of JDK version 1.5, replaced by\n" +
                  " <a href=\"pkg1/C1.html#setUndecorated-boolean-\">" +
@@ -249,7 +247,7 @@
                  "<dd><a href=\"pkg1/C1.html#setUndecorated-boolean-\">" +
                  "<code>C1.setUndecorated(boolean)</code></a></dd>\n" +
                  "</dl>"},
-        {BUG_ID + "/serialized-form.html",
+        { "serialized-form.html",
                  "<span class=\"deprecatedLabel\">Deprecated.</span>" +
                  "&nbsp;<span class=\"deprecationComment\">As of JDK version 1.5, replaced by\n" +
                  " <a href=\"pkg1/C1.html#setUndecorated-boolean-\">" +
@@ -262,7 +260,7 @@
                  "IOException</code></code></dd>\n" +
                  "<dd><code>java.io.IOException</code></dd>\n" +
                  "</dl>"},
-        {BUG_ID + "/serialized-form.html",
+        { "serialized-form.html",
                  "<span class=\"deprecatedLabel\">Deprecated.</span>" +
                  "&nbsp;</div>\n" +
                  "<div class=\"block\">" +
@@ -271,25 +269,25 @@
     // Test with -nocomment and -nodeprecated options. The ClassDocs whould
     // not display definition lists for any member details.
     private static final String[][] TEST_NOCMNT_NODEPR = {
-        {BUG_ID + "/pkg1/C1.html",
+        { "pkg1/C1.html",
                  "<pre>public&nbsp;void&nbsp;readObject()\n" +
                  "                throws java.io.IOException</pre>\n" +
                  "</li>"},
-        {BUG_ID + "/pkg1/C2.html", "<pre>public&nbsp;C2()</pre>\n" +
+        { "pkg1/C2.html", "<pre>public&nbsp;C2()</pre>\n" +
                  "</li>"},
-        {BUG_ID + "/pkg1/C1.ModalExclusionType.html", "<pre>public " +
+        { "pkg1/C1.ModalExclusionType.html", "<pre>public " +
                  "static final&nbsp;<a href=\"../pkg1/C1.ModalExclusionType.html\" " +
                  "title=\"enum in pkg1\">C1.ModalExclusionType</a> " +
                  "APPLICATION_EXCLUDE</pre>\n" +
                  "</li>"},
-        {BUG_ID + "/serialized-form.html", "<pre>boolean " +
+        { "serialized-form.html", "<pre>boolean " +
                  "undecorated</pre>\n" +
                  "<div class=\"block\"><span class=\"deprecatedLabel\">" +
                  "Deprecated.</span>&nbsp;<span class=\"deprecationComment\">As of JDK version 1.5, replaced by\n" +
                  " <a href=\"pkg1/C1.html#setUndecorated-boolean-\"><code>" +
                  "setUndecorated(boolean)</code></a>.</span></div>\n" +
                  "</li>"},
-        {BUG_ID + "/serialized-form.html", "<span class=\"deprecatedLabel\">" +
+        { "serialized-form.html", "<span class=\"deprecatedLabel\">" +
                  "Deprecated.</span>&nbsp;<span class=\"deprecationComment\">As of JDK version" +
                  " 1.5, replaced by\n" +
                  " <a href=\"pkg1/C1.html#setUndecorated-boolean-\">" +
@@ -299,54 +297,54 @@
     // Test for valid HTML generation which should not comprise of empty
     // definition list tags.
     private static final String[][] NEGATED_TEST = {
-        {BUG_ID + "/pkg1/package-summary.html", "<dl></dl>"},
-        {BUG_ID + "/pkg1/package-summary.html", "<dl>\n" +
+        { "pkg1/package-summary.html", "<dl></dl>"},
+        { "pkg1/package-summary.html", "<dl>\n" +
         "</dl>"},
-        {BUG_ID + "/pkg1/C1.html", "<dl></dl>"},
-        {BUG_ID + "/pkg1/C1.html", "<dl>\n" +
+        { "pkg1/C1.html", "<dl></dl>"},
+        { "pkg1/C1.html", "<dl>\n" +
         "</dl>"},
-        {BUG_ID + "/pkg1/C1.ModalExclusionType.html", "<dl></dl>"},
-        {BUG_ID + "/pkg1/C1.ModalExclusionType.html", "<dl>\n" +
+        { "pkg1/C1.ModalExclusionType.html", "<dl></dl>"},
+        { "pkg1/C1.ModalExclusionType.html", "<dl>\n" +
         "</dl>"},
-        {BUG_ID + "/pkg1/C2.html", "<dl></dl>"},
-        {BUG_ID + "/pkg1/C2.html", "<dl>\n" +
+        { "pkg1/C2.html", "<dl></dl>"},
+        { "pkg1/C2.html", "<dl>\n" +
         "</dl>"},
-        {BUG_ID + "/pkg1/C2.ModalType.html", "<dl></dl>"},
-        {BUG_ID + "/pkg1/C2.ModalType.html", "<dl>\n" +
+        { "pkg1/C2.ModalType.html", "<dl></dl>"},
+        { "pkg1/C2.ModalType.html", "<dl>\n" +
         "</dl>"},
-        {BUG_ID + "/pkg1/C3.html", "<dl></dl>"},
-        {BUG_ID + "/pkg1/C3.html", "<dl>\n" +
+        { "pkg1/C3.html", "<dl></dl>"},
+        { "pkg1/C3.html", "<dl>\n" +
         "</dl>"},
-        {BUG_ID + "/pkg1/C4.html", "<dl></dl>"},
-        {BUG_ID + "/pkg1/C4.html", "<dl>\n" +
+        { "pkg1/C4.html", "<dl></dl>"},
+        { "pkg1/C4.html", "<dl>\n" +
         "</dl>"},
-        {BUG_ID + "/pkg1/C5.html", "<dl></dl>"},
-        {BUG_ID + "/pkg1/C5.html", "<dl>\n" +
+        { "pkg1/C5.html", "<dl></dl>"},
+        { "pkg1/C5.html", "<dl>\n" +
         "</dl>"},
-        {BUG_ID + "/overview-tree.html", "<dl></dl>"},
-        {BUG_ID + "/overview-tree.html", "<dl>\n" +
+        { "overview-tree.html", "<dl></dl>"},
+        { "overview-tree.html", "<dl>\n" +
         "</dl>"},
-        {BUG_ID + "/serialized-form.html", "<dl></dl>"},
-        {BUG_ID + "/serialized-form.html", "<dl>\n" +
+        { "serialized-form.html", "<dl></dl>"},
+        { "serialized-form.html", "<dl>\n" +
         "</dl>"}};
 
     private static final String[] ARGS1 =
         new String[] {
-            "-Xdoclint:none", "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg1"};
+            "-Xdoclint:none", "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg1"};
 
     private static final String[] ARGS2 =
         new String[] {
-            "-Xdoclint:none", "-d", BUG_ID, "-nocomment", "-sourcepath",
+            "-Xdoclint:none", "-d", OUTPUT_DIR, "-nocomment", "-sourcepath",
             SRC_DIR, "pkg1"};
 
     private static final String[] ARGS3 =
         new String[] {
-            "-Xdoclint:none", "-d", BUG_ID, "-nodeprecated", "-sourcepath",
+            "-Xdoclint:none", "-d", OUTPUT_DIR, "-nodeprecated", "-sourcepath",
             SRC_DIR, "pkg1"};
 
     private static final String[] ARGS4 =
         new String[] {
-            "-Xdoclint:none", "-d", BUG_ID, "-nocomment", "-nodeprecated",
+            "-Xdoclint:none", "-d", OUTPUT_DIR, "-nocomment", "-nodeprecated",
             "-sourcepath", SRC_DIR, "pkg1"};
 
     /**
@@ -355,28 +353,14 @@
      */
     public static void main(String[] args) {
         TestHtmlDefinitionListTag tester = new TestHtmlDefinitionListTag();
-        run(tester, ARGS1, TEST_ALL, NEGATED_TEST);
-        run(tester, ARGS1, TEST_CMNT_DEPR, NEGATED_TEST);
-        run(tester, ARGS2, TEST_ALL, NEGATED_TEST);
-        run(tester, ARGS2, NO_TEST, TEST_CMNT_DEPR);
-        run(tester, ARGS3, TEST_ALL, NEGATED_TEST);
-        run(tester, ARGS3, TEST_NODEPR, TEST_NOCMNT_NODEPR);
-        run(tester, ARGS4, TEST_ALL, NEGATED_TEST);
-        run(tester, ARGS4, TEST_NOCMNT_NODEPR, TEST_CMNT_DEPR);
+        tester.run(ARGS1, TEST_ALL, NEGATED_TEST);
+        tester.run(ARGS1, TEST_CMNT_DEPR, NEGATED_TEST);
+        tester.run(ARGS2, TEST_ALL, NEGATED_TEST);
+        tester.run(ARGS2, NO_TEST, TEST_CMNT_DEPR);
+        tester.run(ARGS3, TEST_ALL, NEGATED_TEST);
+        tester.run(ARGS3, TEST_NODEPR, TEST_NOCMNT_NODEPR);
+        tester.run(ARGS4, TEST_ALL, NEGATED_TEST);
+        tester.run(ARGS4, TEST_NOCMNT_NODEPR, TEST_CMNT_DEPR);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testHtmlStrongTag/TestHtmlStrongTag.java b/langtools/test/com/sun/javadoc/testHtmlStrongTag/TestHtmlStrongTag.java
index 48baee3..87e243e 100644
--- a/langtools/test/com/sun/javadoc/testHtmlStrongTag/TestHtmlStrongTag.java
+++ b/langtools/test/com/sun/javadoc/testHtmlStrongTag/TestHtmlStrongTag.java
@@ -36,28 +36,27 @@
 
 public class TestHtmlStrongTag extends JavadocTester {
 
-    private static final String BUG_ID = "6786028";
     private static final String[][] TEST1 = {
-        {BUG_ID + "/pkg1/C1.html",
+        { "pkg1/C1.html",
             "<span class=\"seeLabel\">See Also:</span>"}};
     private static final String[][] NEGATED_TEST1 = {
-        {BUG_ID + "/pkg1/C1.html", "<STRONG>Method Summary</STRONG>"},
-        {BUG_ID + "/pkg1/C1.html", "<B>"},
-        {BUG_ID + "/pkg1/package-summary.html",
+        { "pkg1/C1.html", "<STRONG>Method Summary</STRONG>"},
+        { "pkg1/C1.html", "<B>"},
+        { "pkg1/package-summary.html",
             "<STRONG>Class Summary</STRONG>"}};
     private static final String[][] TEST2 = {
-        {BUG_ID + "/pkg2/C2.html", "<B>Comments:</B>"}};
+        { "pkg2/C2.html", "<B>Comments:</B>"}};
     private static final String[][] NEGATED_TEST2 = {
-        {BUG_ID + "/pkg2/C2.html", "<STRONG>Method Summary</STRONG>"},
-        {BUG_ID + "/pkg1/package-summary.html",
+        { "pkg2/C2.html", "<STRONG>Method Summary</STRONG>"},
+        { "pkg1/package-summary.html",
             "<STRONG>Class Summary</STRONG>"}};
 
     private static final String[] ARGS1 =
         new String[] {
-            "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg1"};
+            "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg1"};
     private static final String[] ARGS2 =
         new String[] {
-            "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg2"};
+            "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg2"};
 
     /**
      * The entry point of the test.
@@ -65,22 +64,8 @@
      */
     public static void main(String[] args) {
         TestHtmlStrongTag tester = new TestHtmlStrongTag();
-        run(tester, ARGS1, TEST1, NEGATED_TEST1);
-        run(tester, ARGS2, TEST2, NEGATED_TEST2);
+        tester.run(ARGS1, TEST1, NEGATED_TEST1);
+        tester.run(ARGS2, TEST2, NEGATED_TEST2);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testHtmlTableStyles/TestHtmlTableStyles.java b/langtools/test/com/sun/javadoc/testHtmlTableStyles/TestHtmlTableStyles.java
index f96679c..b211b7c 100644
--- a/langtools/test/com/sun/javadoc/testHtmlTableStyles/TestHtmlTableStyles.java
+++ b/langtools/test/com/sun/javadoc/testHtmlTableStyles/TestHtmlTableStyles.java
@@ -33,47 +33,45 @@
 
 public class TestHtmlTableStyles extends JavadocTester {
 
-    private static final String BUG_ID = "8008164";
-
     //Input for string search tests.
     private static final String[][] TEST = {
-        {BUG_ID + "/pkg1/TestTable.html",
+        { "pkg1/TestTable.html",
             "<table border cellpadding=3 cellspacing=1>"
         },
-        {BUG_ID + "/pkg1/TestTable.html",
+        { "pkg1/TestTable.html",
             "<table class=\"memberSummary\" border=\"0\" cellpadding=\"3\" " +
             "cellspacing=\"0\" summary=\"Field Summary table, listing fields, " +
             "and an explanation\">"
         },
-        {BUG_ID + "/pkg1/TestTable.html",
+        { "pkg1/TestTable.html",
             "<table class=\"memberSummary\" border=\"0\" cellpadding=\"3\" " +
             "cellspacing=\"0\" summary=\"Constructor Summary table, listing " +
             "constructors, and an explanation\">"
         },
-        {BUG_ID + "/pkg1/TestTable.html",
+        { "pkg1/TestTable.html",
             "<table class=\"memberSummary\" border=\"0\" cellpadding=\"3\" " +
             "cellspacing=\"0\" summary=\"Method Summary table, listing methods, " +
             "and an explanation\">"
         },
-        {BUG_ID + "/pkg1/package-summary.html",
+        { "pkg1/package-summary.html",
             "<table class=\"typeSummary\" border=\"0\" cellpadding=\"3\" " +
             "cellspacing=\"0\" summary=\"Class Summary table, listing classes, " +
             "and an explanation\">"
         },
-        {BUG_ID + "/pkg1/class-use/TestTable.html",
+        { "pkg1/class-use/TestTable.html",
             "<table class=\"useSummary\" border=\"0\" cellpadding=\"3\" " +
             "cellspacing=\"0\" summary=\"Use table, listing fields, and an explanation\">"
         },
-        {BUG_ID + "/overview-summary.html",
+        { "overview-summary.html",
             "<table class=\"overviewSummary\" border=\"0\" cellpadding=\"3\" " +
             "cellspacing=\"0\" summary=\"Packages table, listing packages, and an explanation\">"
         },
-        {BUG_ID + "/deprecated-list.html",
+        { "deprecated-list.html",
             "<table class=\"deprecatedSummary\" border=\"0\" cellpadding=\"3\" " +
             "cellspacing=\"0\" summary=\"Deprecated Methods table, listing " +
             "deprecated methods, and an explanation\">"
         },
-        {BUG_ID + "/constant-values.html",
+        { "constant-values.html",
             "<table class=\"constantsSummary\" border=\"0\" cellpadding=\"3\" " +
             "cellspacing=\"0\" summary=\"Constant Field Values table, listing " +
             "constant fields, and values\">"
@@ -81,7 +79,7 @@
     };
 
     private static final String[] ARGS = new String[] {
-        "-d", BUG_ID, "-sourcepath", SRC_DIR, "-use", "pkg1", "pkg2"
+        "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "-use", "pkg1", "pkg2"
     };
 
     /**
@@ -90,21 +88,7 @@
      */
     public static void main(String[] args) throws Exception {
         TestHtmlTableStyles tester = new TestHtmlTableStyles();
-        run(tester, ARGS, TEST, NO_TEST);
+        tester.run(ARGS, TEST, NO_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testHtmlTableTags/TestHtmlTableTags.java b/langtools/test/com/sun/javadoc/testHtmlTableTags/TestHtmlTableTags.java
index 96e87ac..16c55b0 100644
--- a/langtools/test/com/sun/javadoc/testHtmlTableTags/TestHtmlTableTags.java
+++ b/langtools/test/com/sun/javadoc/testHtmlTableTags/TestHtmlTableTags.java
@@ -34,12 +34,9 @@
 
 public class TestHtmlTableTags extends JavadocTester {
 
-    //Test information.
-    private static final String BUG_ID = "6786688";
-
     //Javadoc arguments.
     private static final String[] ARGS = new String[] {
-        "-d", BUG_ID, "-sourcepath", SRC_DIR, "-use", "pkg1", "pkg2"
+        "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "-use", "pkg1", "pkg2"
     };
 
     //Input for string tests for HTML table tags.
@@ -49,127 +46,127 @@
          */
 
         //Package summary
-        {BUG_ID + "/pkg1/package-summary.html",
+        { "pkg1/package-summary.html",
             "<table class=\"typeSummary\" border=\"0\" cellpadding=\"3\"" +
             " cellspacing=\"0\" summary=\"Class Summary table, " +
             "listing classes, and an explanation\">"
         },
-        {BUG_ID + "/pkg1/package-summary.html",
+        { "pkg1/package-summary.html",
             "<table class=\"typeSummary\" border=\"0\" cellpadding=\"3\"" +
             " cellspacing=\"0\" summary=\"Interface Summary table, " +
             "listing interfaces, and an explanation\">"
         },
-        {BUG_ID + "/pkg2/package-summary.html",
+        { "pkg2/package-summary.html",
             "<table class=\"typeSummary\" border=\"0\" cellpadding=\"3\"" +
             " cellspacing=\"0\" summary=\"Enum Summary table, " +
             "listing enums, and an explanation\">"
         },
-        {BUG_ID + "/pkg2/package-summary.html",
+        { "pkg2/package-summary.html",
             "<table class=\"typeSummary\" border=\"0\" cellpadding=\"3\"" +
             " cellspacing=\"0\" summary=\"Annotation Types Summary table, " +
             "listing annotation types, and an explanation\">"
         },
         // Class documentation
-        {BUG_ID + "/pkg1/C1.html",
+        { "pkg1/C1.html",
             "<table class=\"memberSummary\" border=\"0\" cellpadding=\"3\" " +
             "cellspacing=\"0\" summary=\"Field Summary table, listing fields, " +
             "and an explanation\">"
         },
-        {BUG_ID + "/pkg1/C1.html",
+        { "pkg1/C1.html",
             "<table class=\"memberSummary\" border=\"0\" cellpadding=\"3\" " +
             "cellspacing=\"0\" summary=\"Method Summary table, listing methods, " +
             "and an explanation\">"
         },
-        {BUG_ID + "/pkg2/C2.html",
+        { "pkg2/C2.html",
             "<table class=\"memberSummary\" border=\"0\" cellpadding=\"3\" " +
             "cellspacing=\"0\" summary=\"Nested Class Summary table, listing " +
             "nested classes, and an explanation\">"
         },
-        {BUG_ID + "/pkg2/C2.html",
+        { "pkg2/C2.html",
             "<table class=\"memberSummary\" border=\"0\" cellpadding=\"3\" " +
             "cellspacing=\"0\" summary=\"Constructor Summary table, listing " +
             "constructors, and an explanation\">"
         },
-        {BUG_ID + "/pkg2/C2.ModalExclusionType.html",
+        { "pkg2/C2.ModalExclusionType.html",
             "<table class=\"memberSummary\" border=\"0\" cellpadding=\"3\" " +
             "cellspacing=\"0\" summary=\"Enum Constant Summary table, listing " +
             "enum constants, and an explanation\">"
         },
-        {BUG_ID + "/pkg2/C3.html",
+        { "pkg2/C3.html",
             "<table class=\"memberSummary\" border=\"0\" cellpadding=\"3\" " +
             "cellspacing=\"0\" summary=\"Required Element Summary table, " +
             "listing required elements, and an explanation\">"
         },
-        {BUG_ID + "/pkg2/C4.html",
+        { "pkg2/C4.html",
             "<table class=\"memberSummary\" border=\"0\" cellpadding=\"3\" " +
             "cellspacing=\"0\" summary=\"Optional Element Summary table, " +
             "listing optional elements, and an explanation\">"
         },
         // Class use documentation
-        {BUG_ID + "/pkg1/class-use/I1.html",
+        { "pkg1/class-use/I1.html",
             "<table class=\"useSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use " +
             "table, listing packages, and an explanation\">"
         },
-        {BUG_ID + "/pkg1/class-use/C1.html",
+        { "pkg1/class-use/C1.html",
             "<table class=\"useSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use " +
             "table, listing fields, and an explanation\">"
         },
-        {BUG_ID + "/pkg1/class-use/C1.html",
+        { "pkg1/class-use/C1.html",
             "<table class=\"useSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use " +
             "table, listing methods, and an explanation\">"
         },
-        {BUG_ID + "/pkg2/class-use/C2.html",
+        { "pkg2/class-use/C2.html",
             "<table class=\"useSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use " +
             "table, listing fields, and an explanation\">"
         },
-        {BUG_ID + "/pkg2/class-use/C2.html",
+        { "pkg2/class-use/C2.html",
             "<table class=\"useSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use " +
             "table, listing methods, and an explanation\">"
         },
-        {BUG_ID + "/pkg2/class-use/C2.ModalExclusionType.html",
+        { "pkg2/class-use/C2.ModalExclusionType.html",
             "<table class=\"useSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use " +
             "table, listing packages, and an explanation\">"
         },
-        {BUG_ID + "/pkg2/class-use/C2.ModalExclusionType.html",
+        { "pkg2/class-use/C2.ModalExclusionType.html",
             "<table class=\"useSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use " +
             "table, listing methods, and an explanation\">"
         },
         // Package use documentation
-        {BUG_ID + "/pkg1/package-use.html",
+        { "pkg1/package-use.html",
             "<table class=\"useSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use " +
             "table, listing packages, and an explanation\">"
         },
-        {BUG_ID + "/pkg1/package-use.html",
+        { "pkg1/package-use.html",
             "<table class=\"useSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use " +
             "table, listing classes, and an explanation\">"
         },
-        {BUG_ID + "/pkg2/package-use.html",
+        { "pkg2/package-use.html",
             "<table class=\"useSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use " +
             "table, listing packages, and an explanation\">"
         },
-        {BUG_ID + "/pkg2/package-use.html",
+        { "pkg2/package-use.html",
             "<table class=\"useSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use " +
             "table, listing classes, and an explanation\">"
         },
         // Deprecated
-        {BUG_ID + "/deprecated-list.html",
+        { "deprecated-list.html",
             "<table class=\"deprecatedSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" " +
             "summary=\"Deprecated Fields table, listing deprecated fields, " +
             "and an explanation\">"
         },
-        {BUG_ID + "/deprecated-list.html",
+        { "deprecated-list.html",
             "<table class=\"deprecatedSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" " +
             "summary=\"Deprecated Methods table, listing deprecated methods, " +
             "and an explanation\">"
         },
         // Constant values
-        {BUG_ID + "/constant-values.html",
+        { "constant-values.html",
             "<table class=\"constantsSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" " +
             "summary=\"Constant Field Values table, listing " +
             "constant fields, and values\">"
         },
         // Overview Summary
-        {BUG_ID + "/overview-summary.html",
+        { "overview-summary.html",
             "<table class=\"overviewSummary\" border=\"0\" cellpadding=\"3\" " +
             "cellspacing=\"0\" summary=\"Packages table, " +
             "listing packages, and an explanation\">"
@@ -180,27 +177,27 @@
          */
 
         //Package summary
-        {BUG_ID + "/pkg1/package-summary.html",
+        { "pkg1/package-summary.html",
             "<caption><span>Class Summary</span><span class=\"tabEnd\">" +
             "&nbsp;</span></caption>"
         },
-        {BUG_ID + "/pkg1/package-summary.html",
+        { "pkg1/package-summary.html",
             "<caption><span>Interface Summary</span><span class=\"tabEnd\">" +
             "&nbsp;</span></caption>"
         },
-        {BUG_ID + "/pkg2/package-summary.html",
+        { "pkg2/package-summary.html",
             "<caption><span>Enum Summary</span><span class=\"tabEnd\">" +
             "&nbsp;</span></caption>"
         },
-        {BUG_ID + "/pkg2/package-summary.html",
+        { "pkg2/package-summary.html",
             "<caption><span>Annotation Types Summary</span><span class=\"tabEnd\">" +
             "&nbsp;</span></caption>"
         },
         // Class documentation
-        {BUG_ID + "/pkg1/C1.html",
+        { "pkg1/C1.html",
             "<caption><span>Fields</span><span class=\"tabEnd\">&nbsp;</span></caption>"
         },
-        {BUG_ID + "/pkg1/C1.html",
+        { "pkg1/C1.html",
             "<caption><span id=\"t0\" class=\"activeTableTab\"><span>All " +
             "Methods</span><span class=\"tabEnd\">&nbsp;</span></span>" +
             "<span id=\"t2\" class=\"tableTab\"><span><a href=\"javascript:show(2);\">" +
@@ -211,94 +208,94 @@
             "Deprecated Methods</a></span><span class=\"tabEnd\">&nbsp;</span></span>" +
             "</caption>"
         },
-        {BUG_ID + "/pkg2/C2.html",
+        { "pkg2/C2.html",
             "<caption><span>Nested Classes</span><span class=\"tabEnd\">&nbsp;</span></caption>"
         },
-        {BUG_ID + "/pkg2/C2.html",
+        { "pkg2/C2.html",
             "<caption><span>Constructors</span><span class=\"tabEnd\">&nbsp;</span></caption>"
         },
-        {BUG_ID + "/pkg2/C2.ModalExclusionType.html",
+        { "pkg2/C2.ModalExclusionType.html",
             "<caption><span>Enum Constants</span><span class=\"tabEnd\">&nbsp;</span></caption>"
         },
-        {BUG_ID + "/pkg2/C3.html",
+        { "pkg2/C3.html",
             "<caption><span>Required Elements</span><span class=\"tabEnd\">&nbsp;" +
             "</span></caption>"
         },
-        {BUG_ID + "/pkg2/C4.html",
+        { "pkg2/C4.html",
             "<caption><span>Optional Elements</span><span class=\"tabEnd\">&nbsp;" +
             "</span></caption>"
         },
         // Class use documentation
-        {BUG_ID + "/pkg1/class-use/I1.html",
+        { "pkg1/class-use/I1.html",
             "<caption><span>Packages that use <a href=\"../../pkg1/I1.html\" " +
             "title=\"interface in pkg1\">I1</a></span><span class=\"tabEnd\">" +
             "&nbsp;</span></caption>"
         },
-        {BUG_ID + "/pkg1/class-use/C1.html",
+        { "pkg1/class-use/C1.html",
             "<caption><span>Fields in <a href=\"../../pkg2/package-summary.html\">" +
             "pkg2</a> declared as <a href=\"../../pkg1/C1.html\" " +
             "title=\"class in pkg1\">C1</a></span><span class=\"tabEnd\">&nbsp;" +
             "</span></caption>"
         },
-        {BUG_ID + "/pkg1/class-use/C1.html",
+        { "pkg1/class-use/C1.html",
             "<caption><span>Methods in <a href=\"../../pkg2/package-summary.html\">" +
             "pkg2</a> that return <a href=\"../../pkg1/C1.html\" " +
             "title=\"class in pkg1\">C1</a></span><span class=\"tabEnd\">" +
             "&nbsp;</span></caption>"
         },
-        {BUG_ID + "/pkg2/class-use/C2.html",
+        { "pkg2/class-use/C2.html",
             "<caption><span>Fields in <a href=\"../../pkg1/package-summary.html\">" +
             "pkg1</a> declared as <a href=\"../../pkg2/C2.html\" " +
             "title=\"class in pkg2\">C2</a></span><span class=\"tabEnd\">" +
             "&nbsp;</span></caption>"
         },
-        {BUG_ID + "/pkg2/class-use/C2.html",
+        { "pkg2/class-use/C2.html",
             "<caption><span>Methods in <a href=\"../../pkg1/package-summary.html\">" +
             "pkg1</a> that return <a href=\"../../pkg2/C2.html\" " +
             "title=\"class in pkg2\">C2</a></span><span class=\"tabEnd\">" +
             "&nbsp;</span></caption>"
         },
-        {BUG_ID + "/pkg2/class-use/C2.ModalExclusionType.html",
+        { "pkg2/class-use/C2.ModalExclusionType.html",
             "<caption><span>Methods in <a href=\"../../pkg2/package-summary.html\">" +
             "pkg2</a> that return <a href=\"../../pkg2/C2.ModalExclusionType.html\" " +
             "title=\"enum in pkg2\">C2.ModalExclusionType</a></span>" +
             "<span class=\"tabEnd\">&nbsp;</span></caption>"
         },
         // Package use documentation
-        {BUG_ID + "/pkg1/package-use.html",
+        { "pkg1/package-use.html",
             "<caption><span>Packages that use <a href=\"../pkg1/package-summary.html\">" +
             "pkg1</a></span><span class=\"tabEnd\">&nbsp;</span></caption>"
         },
-        {BUG_ID + "/pkg1/package-use.html",
+        { "pkg1/package-use.html",
             "<caption><span>Classes in <a href=\"../pkg1/package-summary.html\">" +
             "pkg1</a> used by <a href=\"../pkg1/package-summary.html\">pkg1</a>" +
             "</span><span class=\"tabEnd\">&nbsp;</span></caption>"
         },
-        {BUG_ID + "/pkg2/package-use.html",
+        { "pkg2/package-use.html",
             "<caption><span>Packages that use <a href=\"../pkg2/package-summary.html\">" +
             "pkg2</a></span><span class=\"tabEnd\">&nbsp;</span></caption>"
         },
-        {BUG_ID + "/pkg2/package-use.html",
+        { "pkg2/package-use.html",
             "<caption><span>Classes in <a href=\"../pkg2/package-summary.html\">" +
             "pkg2</a> used by <a href=\"../pkg1/package-summary.html\">pkg1</a>" +
             "</span><span class=\"tabEnd\">&nbsp;</span></caption>"
         },
         // Deprecated
-        {BUG_ID + "/deprecated-list.html",
+        { "deprecated-list.html",
             "<caption><span>Deprecated Fields</span><span class=\"tabEnd\">" +
             "&nbsp;</span></caption>"
         },
-        {BUG_ID + "/deprecated-list.html",
+        { "deprecated-list.html",
             "<caption><span>Deprecated Methods</span><span class=\"tabEnd\">" +
             "&nbsp;</span></caption>"
         },
         // Constant values
-        {BUG_ID + "/constant-values.html",
+        { "constant-values.html",
             "<caption><span>pkg1.<a href=\"pkg1/C1.html\" title=\"class in pkg1\">" +
             "C1</a></span><span class=\"tabEnd\">&nbsp;</span></caption>"
         },
         // Overview Summary
-        {BUG_ID + "/overview-summary.html",
+        { "overview-summary.html",
             "<caption><span>Packages</span><span class=\"tabEnd\">&nbsp;</span></caption>"
         },
 
@@ -307,110 +304,110 @@
          */
 
         //Package summary
-        {BUG_ID + "/pkg1/package-summary.html",
+        { "pkg1/package-summary.html",
             "<th class=\"colFirst\" scope=\"col\">" +
             "Class</th>\n" +
             "<th class=\"colLast\" scope=\"col\"" +
             ">Description</th>"
         },
-        {BUG_ID + "/pkg1/package-summary.html",
+        { "pkg1/package-summary.html",
             "<th class=\"colFirst\" scope=\"col\">" +
             "Interface</th>\n" +
             "<th class=\"colLast\" scope=\"col\"" +
             ">Description</th>"
         },
-        {BUG_ID + "/pkg2/package-summary.html",
+        { "pkg2/package-summary.html",
             "<th class=\"colFirst\" scope=\"col\">" +
             "Enum</th>\n" +
             "<th class=\"colLast\" scope=\"col\"" +
             ">Description</th>"
         },
-        {BUG_ID + "/pkg2/package-summary.html",
+        { "pkg2/package-summary.html",
             "<th class=\"colFirst\" scope=\"col\">" +
             "Annotation Type</th>\n" +
             "<th class=\"colLast\"" +
             " scope=\"col\">Description</th>"
         },
         // Class documentation
-        {BUG_ID + "/pkg1/C1.html",
+        { "pkg1/C1.html",
             "<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>\n" +
             "<th class=\"colLast\" scope=\"col\">Field and Description</th>"
         },
-        {BUG_ID + "/pkg1/C1.html",
+        { "pkg1/C1.html",
             "<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>\n" +
             "<th class=\"colLast\" scope=\"col\">Method and Description</th>"
         },
-        {BUG_ID + "/pkg2/C2.html",
+        { "pkg2/C2.html",
             "<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>\n" +
             "<th class=\"colLast\" scope=\"col\">Class and Description</th>"
         },
-        {BUG_ID + "/pkg2/C2.html",
+        { "pkg2/C2.html",
             "<th class=\"colOne\" scope=\"col\">Constructor and Description</th>"
         },
-        {BUG_ID + "/pkg2/C2.ModalExclusionType.html",
+        { "pkg2/C2.ModalExclusionType.html",
             "<th class=\"colOne\" scope=\"col\">Enum Constant and Description</th>"
         },
-        {BUG_ID + "/pkg2/C3.html",
+        { "pkg2/C3.html",
             "<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>\n" +
             "<th class=\"colLast\" scope=\"col\">Required Element and Description</th>"
         },
-        {BUG_ID + "/pkg2/C4.html",
+        { "pkg2/C4.html",
             "<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>\n" +
             "<th class=\"colLast\" scope=\"col\">Optional Element and Description</th>"
         },
         // Class use documentation
-        {BUG_ID + "/pkg1/class-use/I1.html",
+        { "pkg1/class-use/I1.html",
             "<th class=\"colFirst\" scope=\"col\">Package</th>\n" +
             "<th class=\"colLast\" scope=\"col\">Description</th>"
         },
-        {BUG_ID + "/pkg1/class-use/C1.html",
+        { "pkg1/class-use/C1.html",
             "<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>\n" +
             "<th class=\"colLast\" scope=\"col\">Field and Description</th>"
         },
-        {BUG_ID + "/pkg1/class-use/C1.html",
+        { "pkg1/class-use/C1.html",
             "<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>\n" +
             "<th class=\"colLast\" scope=\"col\">Method and Description</th>"
         },
-        {BUG_ID + "/pkg2/class-use/C2.html",
+        { "pkg2/class-use/C2.html",
             "<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>\n" +
             "<th class=\"colLast\" scope=\"col\">Field and Description</th>"
         },
-        {BUG_ID + "/pkg2/class-use/C2.html",
+        { "pkg2/class-use/C2.html",
             "<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>\n" +
             "<th class=\"colLast\" scope=\"col\">Method and Description</th>"
         },
-        {BUG_ID + "/pkg2/class-use/C2.ModalExclusionType.html",
+        { "pkg2/class-use/C2.ModalExclusionType.html",
             "<th class=\"colFirst\" scope=\"col\">Package</th>\n" +
             "<th class=\"colLast\" scope=\"col\">Description</th>"
         },
-        {BUG_ID + "/pkg2/class-use/C2.ModalExclusionType.html",
+        { "pkg2/class-use/C2.ModalExclusionType.html",
             "<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>\n" +
             "<th class=\"colLast\" scope=\"col\">Method and Description</th>"
         },
         // Package use documentation
-        {BUG_ID + "/pkg1/package-use.html",
+        { "pkg1/package-use.html",
             "<th class=\"colFirst\" scope=\"col\">Package</th>\n" +
             "<th class=\"colLast\" scope=\"col\">Description</th>"
         },
-        {BUG_ID + "/pkg1/package-use.html",
+        { "pkg1/package-use.html",
             "<th class=\"colOne\" scope=\"col\">Class and Description</th>"
         },
-        {BUG_ID + "/pkg2/package-use.html",
+        { "pkg2/package-use.html",
             "<th class=\"colFirst\" scope=\"col\">Package</th>\n" +
             "<th class=\"colLast\" scope=\"col\">Description</th>"
         },
-        {BUG_ID + "/pkg2/package-use.html",
+        { "pkg2/package-use.html",
             "<th class=\"colOne\" scope=\"col\">Class and Description</th>"
         },
         // Deprecated
-        {BUG_ID + "/deprecated-list.html",
+        { "deprecated-list.html",
             "<th class=\"colOne\" scope=\"col\">Field and Description</th>"
         },
-        {BUG_ID + "/deprecated-list.html",
+        { "deprecated-list.html",
             "<th class=\"colOne\" scope=\"col\">Method and Description</th>"
         },
         // Constant values
-        {BUG_ID + "/constant-values.html",
+        { "constant-values.html",
             "<th class=\"colFirst\" scope=\"col\">" +
             "Modifier and Type</th>\n" +
             "<th" +
@@ -418,14 +415,13 @@
             "<th class=\"colLast\" scope=\"col\">Value</th>"
         },
         // Overview Summary
-        {BUG_ID + "/overview-summary.html",
+        { "overview-summary.html",
             "<th class=\"colFirst\" scope=\"col\">" +
             "Package</th>\n" +
             "<th class=\"colLast\" scope=\"col\"" +
             ">Description</th>"
         }
     };
-    private static final String[][] NEGATED_TEST = NO_TEST;
 
     /**
      * The entry point of the test.
@@ -433,21 +429,7 @@
      */
     public static void main(String[] args) {
         TestHtmlTableTags tester = new TestHtmlTableTags();
-        run(tester, ARGS, TABLE_TAGS_TEST, NEGATED_TEST);
+        tester.run(ARGS, TABLE_TAGS_TEST, NO_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testHtmlTag/TestHtmlTag.java b/langtools/test/com/sun/javadoc/testHtmlTag/TestHtmlTag.java
index 9345c74..070fa1a 100644
--- a/langtools/test/com/sun/javadoc/testHtmlTag/TestHtmlTag.java
+++ b/langtools/test/com/sun/javadoc/testHtmlTag/TestHtmlTag.java
@@ -38,34 +38,33 @@
 
 public class TestHtmlTag extends JavadocTester {
 
-    private static final String BUG_ID = "6786682";
     private static final String[][] TEST1 = {
-        {BUG_ID + "/pkg1/C1.html",
+        { "pkg1/C1.html",
             "<html lang=\"" + Locale.getDefault().getLanguage() + "\">"},
-        {BUG_ID + "/pkg1/package-summary.html",
+        { "pkg1/package-summary.html",
             "<html lang=\"" + Locale.getDefault().getLanguage() + "\">"}};
     private static final String[][] NEGATED_TEST1 = {
-        {BUG_ID + "/pkg1/C1.html", "<html>"}};
+        { "pkg1/C1.html", "<html>"}};
     private static final String[][] TEST2 = {
-        {BUG_ID + "/pkg2/C2.html", "<html lang=\"ja\">"},
-        {BUG_ID + "/pkg2/package-summary.html", "<html lang=\"ja\">"}};
+        { "pkg2/C2.html", "<html lang=\"ja\">"},
+        { "pkg2/package-summary.html", "<html lang=\"ja\">"}};
     private static final String[][] NEGATED_TEST2 = {
-        {BUG_ID + "/pkg2/C2.html", "<html>"}};
+        { "pkg2/C2.html", "<html>"}};
     private static final String[][] TEST3 = {
-        {BUG_ID + "/pkg1/C1.html", "<html lang=\"en\">"},
-        {BUG_ID + "/pkg1/package-summary.html", "<html lang=\"en\">"}};
+        { "pkg1/C1.html", "<html lang=\"en\">"},
+        { "pkg1/package-summary.html", "<html lang=\"en\">"}};
     private static final String[][] NEGATED_TEST3 = {
-        {BUG_ID + "/pkg1/C1.html", "<html>"}};
+        { "pkg1/C1.html", "<html>"}};
 
     private static final String[] ARGS1 =
         new String[] {
-            "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg1"};
+            "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg1"};
     private static final String[] ARGS2 =
         new String[] {
-            "-locale", "ja", "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg2"};
+            "-locale", "ja", "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg2"};
     private static final String[] ARGS3 =
         new String[] {
-            "-locale", "en_US", "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg1"};
+            "-locale", "en_US", "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg1"};
 
     /**
      * The entry point of the test.
@@ -73,23 +72,9 @@
      */
     public static void main(String[] args) {
         TestHtmlTag tester = new TestHtmlTag();
-        run(tester, ARGS1, TEST1, NEGATED_TEST1);
-        run(tester, ARGS2, TEST2, NEGATED_TEST2);
-        run(tester, ARGS3, TEST3, NEGATED_TEST3);
+        tester.run(ARGS1, TEST1, NEGATED_TEST1);
+        tester.run(ARGS2, TEST2, NEGATED_TEST2);
+        tester.run(ARGS3, TEST3, NEGATED_TEST3);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testIndentation/TestIndentation.java b/langtools/test/com/sun/javadoc/testIndentation/TestIndentation.java
index 5b975ba..6b15c49 100644
--- a/langtools/test/com/sun/javadoc/testIndentation/TestIndentation.java
+++ b/langtools/test/com/sun/javadoc/testIndentation/TestIndentation.java
@@ -32,26 +32,22 @@
 
 public class TestIndentation extends JavadocTester {
 
-    //Test information.
-    private static final String BUG_ID = "8011288";
-
     //Javadoc arguments.
     private static final String[] ARGS = new String[] {
-        "-d", BUG_ID, "-sourcepath", SRC_DIR, "p"
+        "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "p"
     };
 
     //Input for string search tests.
     private static final String[][] TEST = {
-        { BUG_ID + "/p/Indent.html",
+        { "p/Indent.html",
           "<pre>public&nbsp;&lt;T&gt;&nbsp;void&nbsp;m(T&nbsp;t1," },
-        { BUG_ID + "/p/Indent.html",
+        { "p/Indent.html",
           "\n" +
           "                  T&nbsp;t2)" },
-        { BUG_ID + "/p/Indent.html",
+        { "p/Indent.html",
           "\n" +
           "           throws java.lang.Exception" }
     };
-    private static final String[][] NEGATED_TEST = NO_TEST;
 
     /**
      * The entry point of the test.
@@ -59,21 +55,7 @@
      */
     public static void main(String[] args) {
         TestIndentation tester = new TestIndentation();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NO_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testIndex/TestIndex.java b/langtools/test/com/sun/javadoc/testIndex/TestIndex.java
index 5ab7fad..f496460 100644
--- a/langtools/test/com/sun/javadoc/testIndex/TestIndex.java
+++ b/langtools/test/com/sun/javadoc/testIndex/TestIndex.java
@@ -36,40 +36,37 @@
 
 public class TestIndex extends JavadocTester {
 
-    //Test information.
-    private static final String BUG_ID = "4852280-4517115-4973608-4994589";
-
     //Javadoc arguments.
     private static final String[] ARGS = new String[] {
-        "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg", SRC_DIR + "/NoPackage.java"
+        "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg", SRC_DIR + "/NoPackage.java"
     };
 
     //Input for string search tests.
     private static final String[][] TEST = {
         //Make sure the horizontal scroll bar does not appear in class frame.
-        {BUG_ID + "/index.html",
+        { "index.html",
             "<frame src=\"overview-summary.html\" name=\"classFrame\" title=\"" +
             "Package, class and interface descriptions\" scrolling=\"yes\">"},
 
         //Test index-all.html
-        {BUG_ID + "/index-all.html",
+        { "index-all.html",
             "<a href=\"pkg/C.html\" title=\"class in pkg\"><span class=\"typeNameLink\">C</span></a>" +
             " - Class in <a href=\"pkg/package-summary.html\">pkg</a>"},
-        {BUG_ID + "/index-all.html",
+        { "index-all.html",
             "<a href=\"pkg/Interface.html\" title=\"interface in pkg\">" +
             "<span class=\"typeNameLink\">Interface</span></a> - Interface in " +
             "<a href=\"pkg/package-summary.html\">pkg</a>"},
-        {BUG_ID + "/index-all.html",
+        { "index-all.html",
             "<a href=\"pkg/AnnotationType.html\" title=\"annotation in pkg\">" +
             "<span class=\"typeNameLink\">AnnotationType</span></a> - Annotation Type in " +
             "<a href=\"pkg/package-summary.html\">pkg</a>"},
-        {BUG_ID + "/index-all.html",
+        { "index-all.html",
             "<a href=\"pkg/Coin.html\" title=\"enum in pkg\">" +
             "<span class=\"typeNameLink\">Coin</span></a> - Enum in " +
             "<a href=\"pkg/package-summary.html\">pkg</a>"},
-        {BUG_ID + "/index-all.html",
+        { "index-all.html",
             "Class in <a href=\"package-summary.html\">&lt;Unnamed&gt;</a>"},
-        {BUG_ID + "/index-all.html",
+        { "index-all.html",
             "<dl>\n" +
             "<dt><span class=\"memberNameLink\"><a href=\"pkg/C.html#Java\">" +
             "Java</a></span> - Static variable in class pkg.<a href=\"pkg/C.html\" " +
@@ -81,7 +78,6 @@
             "<dd>&nbsp;</dd>\n" +
             "</dl>"},
     };
-    private static final String[][] NEGATED_TEST = NO_TEST;
 
     /**
      * The entry point of the test.
@@ -89,21 +85,7 @@
      */
     public static void main(String[] args) {
         TestIndex tester = new TestIndex();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NO_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testInlineLinkLabel/TestInlineLinkLabel.java b/langtools/test/com/sun/javadoc/testInlineLinkLabel/TestInlineLinkLabel.java
index 582fa76..034f939 100644
--- a/langtools/test/com/sun/javadoc/testInlineLinkLabel/TestInlineLinkLabel.java
+++ b/langtools/test/com/sun/javadoc/testInlineLinkLabel/TestInlineLinkLabel.java
@@ -34,20 +34,18 @@
 
 public class TestInlineLinkLabel extends JavadocTester {
 
-    private static final String BUG_ID = "4524136";
     private static final String[][] TEST = {
         //Search for the label to the package link.
-        {BUG_ID + "/pkg/C1.html" ,
+        { "pkg/C1.html" ,
             "<a href=\"../pkg/package-summary.html\"><code>Here is a link to a package</code></a>"},
 
         //Search for the label to the class link
-        {BUG_ID + "/pkg/C1.html" ,
+        { "pkg/C1.html" ,
             "<a href=\"../pkg/C2.html\" title=\"class in pkg\"><code>Here is a link to a class</code></a>"}
     };
-    private static final String[][] NEGATED_TEST = NO_TEST;
     private static final String[] ARGS =
         new String[] {
-            "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg"};
+            "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg"};
 
     /**
      * The entry point of the test.
@@ -55,21 +53,7 @@
      */
     public static void main(String[] args) {
         TestInlineLinkLabel tester = new TestInlineLinkLabel();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NO_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testInterface/TestInterface.java b/langtools/test/com/sun/javadoc/testInterface/TestInterface.java
index 9afb03a..b02cfe0 100644
--- a/langtools/test/com/sun/javadoc/testInterface/TestInterface.java
+++ b/langtools/test/com/sun/javadoc/testInterface/TestInterface.java
@@ -37,24 +37,21 @@
 
 public class TestInterface extends JavadocTester {
 
-    //Test information.
-    private static final String BUG_ID = "4682448-4947464-5029946";
-
     //Javadoc arguments.
     private static final String[] ARGS = new String[] {
-        "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg"
+        "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg"
     };
 
     //Input for string search tests.
     private static final String[][] TEST = {
-        {BUG_ID + "/pkg/Interface.html",
+        { "pkg/Interface.html",
             "<pre>int&nbsp;method()</pre>"},
-        {BUG_ID + "/pkg/Interface.html",
+        { "pkg/Interface.html",
             "<pre>static final&nbsp;int field</pre>"},
 
 
         // Make sure known implementing class list is correct and omits type parameters.
-        {BUG_ID + "/pkg/Interface.html",
+        { "pkg/Interface.html",
             "<dl>\n" +
             "<dt>All Known Implementing Classes:</dt>\n" +
             "<dd><a href=\"../pkg/Child.html\" title=\"class in pkg\">Child" +
@@ -63,7 +60,7 @@
             "</dl>"},
 
          // Make sure "All Implemented Interfaces": has substituted type parameters
-         {BUG_ID + "/pkg/Child.html",
+         { "pkg/Child.html",
             "<dl>\n" +
             "<dt>All Implemented Interfaces:</dt>\n" +
             "<dd><a href=\"../pkg/Interface.html\" title=\"interface in pkg\">" +
@@ -71,7 +68,7 @@
             "</dl>"
          },
          //Make sure Class Tree has substituted type parameters.
-         {BUG_ID + "/pkg/Child.html",
+         { "pkg/Child.html",
             "<ul class=\"inheritance\">\n" +
             "<li>java.lang.Object</li>\n" +
             "<li>\n" +
@@ -88,7 +85,7 @@
             "</ul>"
          },
          //Make sure "Direct Know Subclasses" omits type parameters
-        {BUG_ID + "/pkg/Parent.html",
+        { "pkg/Parent.html",
             "<dl>\n" +
             "<dt>Direct Known Subclasses:</dt>\n" +
             "<dd><a href=\"../pkg/Child.html\" title=\"class in pkg\">Child" +
@@ -96,7 +93,7 @@
             "</dl>"
         },
         //Make sure "Specified By" has substituted type parameters.
-        {BUG_ID + "/pkg/Child.html",
+        { "pkg/Child.html",
             "<dt><span class=\"overrideSpecifyLabel\">Specified by:</span></dt>\n" +
             "<dd><code><a href=\"../pkg/Interface.html#method--\">method</a>" +
             "</code>&nbsp;in interface&nbsp;<code>" +
@@ -105,7 +102,7 @@
             "T</a>&gt;</code></dd>"
          },
         //Make sure "Overrides" has substituted type parameters.
-        {BUG_ID + "/pkg/Child.html",
+        { "pkg/Child.html",
             "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" +
             "<dd><code><a href=\"../pkg/Parent.html#method--\">method</a>" +
             "</code>&nbsp;in class&nbsp;<code><a href=\"../pkg/Parent.html\" " +
@@ -114,9 +111,9 @@
          },
     };
     private static final String[][] NEGATED_TEST = {
-        {BUG_ID + "/pkg/Interface.html",
+        { "pkg/Interface.html",
             "public int&nbsp;method()"},
-        {BUG_ID + "/pkg/Interface.html",
+        { "pkg/Interface.html",
             "public static final&nbsp;int field"},
     };
 
@@ -126,21 +123,7 @@
      */
     public static void main(String[] args) {
         TestInterface tester = new TestInterface();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NEGATED_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testJavaFX/TestJavaFX.java b/langtools/test/com/sun/javadoc/testJavaFX/TestJavaFX.java
index 6a7eba7..a104b17 100644
--- a/langtools/test/com/sun/javadoc/testJavaFX/TestJavaFX.java
+++ b/langtools/test/com/sun/javadoc/testJavaFX/TestJavaFX.java
@@ -33,58 +33,56 @@
 
 public class TestJavaFX extends JavadocTester {
 
-    private static final String BUG_ID = "7112427";
-
     private static final String[][] TEST =
         new String[][] {
-            {"./" + BUG_ID + "/C.html",
+            { "C.html",
                 "<dt><span class=\"seeLabel\">See Also:</span></dt>\n" +
                 "<dd><a href=\"C.html#getRate--\"><code>getRate()</code></a>, \n" +
                 "<a href=\"C.html#setRate-double-\"><code>setRate(double)</code></a></dd>"},
-            {"./" + BUG_ID + "/C.html",
+            { "C.html",
                 "<pre>public final&nbsp;void&nbsp;setRate(double&nbsp;value)</pre>\n" +
                 "<div class=\"block\">Sets the value of the property rate.</div>\n" +
                 "<dl>\n" +
                 "<dt><span class=\"simpleTagLabel\">Property description:</span></dt>" },
-            {"./" + BUG_ID + "/C.html",
+            { "C.html",
                 "<pre>public final&nbsp;double&nbsp;getRate()</pre>\n" +
                 "<div class=\"block\">Gets the value of the property rate.</div>\n" +
                 "<dl>\n" +
                 "<dt><span class=\"simpleTagLabel\">Property description:</span></dt>" },
-            {"./" + BUG_ID + "/C.html",
+            { "C.html",
                 "<td class=\"colLast\"><code><span class=\"memberNameLink\"><a href=\"C.html#rateProperty\">rate</a></span></code>\n" +
                 "<div class=\"block\">Defines the direction/speed at which the <code>Timeline</code> is expected to"},
 
-            {"./" + BUG_ID + "/C.html",
+            { "C.html",
                 "<span class=\"simpleTagLabel\">Default value:</span>"},
-            {"./" + BUG_ID + "/C.html",
+            { "C.html",
                 "<span class=\"simpleTagLabel\">Since:</span></dt>\n" +
                 "<dd>JavaFX 8.0</dd>" },
-            {"./" + BUG_ID + "/C.html",
+            { "C.html",
                 "<p>Sets the value of the property <code>Property</code>"},
-            {"./" + BUG_ID + "/C.html",
+            { "C.html",
                 "<p>Gets the value of the property <code>Property</code>"},
-            {"./" + BUG_ID + "/C.html",
+            { "C.html",
                 "<span class=\"simpleTagLabel\">Property description:</span>"},
-            {"./" + BUG_ID + "/C.html",
+            { "C.html",
                 "<td class=\"colLast\"><code><span class=\"memberNameLink\"><a href=\"C.html#setTestMethodProperty--\">setTestMethodProperty</a></span>()</code>&nbsp;</td>" },
-            {"./" + BUG_ID + "/C.html",
+            { "C.html",
                 "<h4>isPaused</h4>\n" +
                 "<pre>public final&nbsp;double&nbsp;isPaused()</pre>\n" +
                 "<div class=\"block\">Gets the value of the property paused.</div>" },
-            {"./" + BUG_ID + "/D.html",
+            { "D.html",
                 "<h3>Properties inherited from class&nbsp;<a href=\"C.html\" title=\"class in &lt;Unnamed&gt;\">C</a></h3>\n" +
                 "<code><a href=\"C.html#pausedProperty\">paused</a>, <a href=\"C.html#rateProperty\">rate</a></code></li>" },
         };
     private static final String[][] NO_TEST =
         new String[][] {
-            {"./" + BUG_ID + "/C.html",
+            { "C.html",
                 "A()"},
         };
 
 
     private static final String[] ARGS = new String[] {
-        "-d", BUG_ID, "-sourcepath", SRC_DIR, "-javafx",
+        "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "-javafx",
         SRC_DIR + "/C.java", SRC_DIR + "/D.java"
     };
 
@@ -94,21 +92,7 @@
      */
     public static void main(String[] args) {
         TestJavaFX tester = new TestJavaFX();
-        run(tester, ARGS, TEST, NO_TEST);
+        tester.run(ARGS, TEST, NO_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testJavascript/TestJavascript.java b/langtools/test/com/sun/javadoc/testJavascript/TestJavascript.java
index 3270ba9..2b9ef7e 100644
--- a/langtools/test/com/sun/javadoc/testJavascript/TestJavascript.java
+++ b/langtools/test/com/sun/javadoc/testJavascript/TestJavascript.java
@@ -34,22 +34,19 @@
 
 public class TestJavascript extends JavadocTester {
 
-    //Test information.
-    private static final String BUG_ID = "4665566-4855876-8012375";
-
     //Javadoc arguments.
     private static final String[] ARGS = new String[] {
-        "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg", SRC_DIR +
+        "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg", SRC_DIR +
         "/TestJavascript.java"
     };
 
     //Input for string search tests.
     private static final String[][] TEST = {
-        {BUG_ID + "/pkg/C.html",
+        { "pkg/C.html",
             "<a href=\"../index.html?pkg/C.html\" target=\"_top\">Frames</a>"},
-        {BUG_ID + "/TestJavascript.html",
+        { "TestJavascript.html",
             "<a href=\"index.html?TestJavascript.html\" target=\"_top\">Frames</a>"},
-        {BUG_ID + "/index.html",
+        { "index.html",
             "<script type=\"text/javascript\">\n" +
                         "    targetPage = \"\" + window.location.search;\n" +
             "    if (targetPage != \"\" && targetPage != \"undefined\")\n" +
@@ -104,7 +101,7 @@
             "</script>"},
 
         //Make sure title javascript only runs if is-external is not true
-        {BUG_ID + "/pkg/C.html",
+        { "pkg/C.html",
             "    try {\n" +
             "        if (location.href.indexOf('is-external=true') == -1) {\n" +
             "            parent.document.title=\"C\";\n" +
@@ -114,29 +111,13 @@
             "    }"},
     };
 
-    private static final String[][] NEGATED_TEST = NO_TEST;
-
     /**
      * The entry point of the test.
      * @param args the array of command line arguments.
      */
     public static void main(String[] args) {
         TestJavascript tester = new TestJavascript();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NO_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testLambdaFeature/TestLambdaFeature.java b/langtools/test/com/sun/javadoc/testLambdaFeature/TestLambdaFeature.java
index 776ad62..dc6768c 100644
--- a/langtools/test/com/sun/javadoc/testLambdaFeature/TestLambdaFeature.java
+++ b/langtools/test/com/sun/javadoc/testLambdaFeature/TestLambdaFeature.java
@@ -40,25 +40,22 @@
 
 public class TestLambdaFeature extends JavadocTester {
 
-    //Test information.
-    private static final String BUG_ID = "8004893-8022738";
-
     //Javadoc arguments.
     private static final String[] ARGS = new String[] {
-        "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg", "pkg1"
+        "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg", "pkg1"
     };
 
     private static final String[] ARGS_1 = new String[] {
-        "-d", BUG_ID + "-2", "-sourcepath", SRC_DIR, "-source", "1.7", "pkg1"
+        "-d", OUTPUT_DIR + "-2", "-sourcepath", SRC_DIR, "-source", "1.7", "pkg1"
     };
 
     //Input for string search tests.
     private static final String[][] TEST = {
-        {BUG_ID + "/pkg/A.html",
+        { "pkg/A.html",
             "<td class=\"colFirst\"><code>default void</code></td>"},
-        {BUG_ID + "/pkg/A.html",
+        { "pkg/A.html",
             "<pre>default&nbsp;void&nbsp;defaultMethod()</pre>"},
-        {BUG_ID + "/pkg/A.html",
+        { "pkg/A.html",
             "<caption><span id=\"t0\" class=\"activeTableTab\"><span>" +
             "All Methods</span><span class=\"tabEnd\">&nbsp;</span></span>" +
             "<span id=\"t2\" class=\"tableTab\"><span>" +
@@ -69,14 +66,14 @@
             "</span><span id=\"t5\" class=\"tableTab\"><span>" +
             "<a href=\"javascript:show(16);\">Default Methods</a></span>" +
             "<span class=\"tabEnd\">&nbsp;</span></span></caption>"},
-        {BUG_ID + "/pkg/A.html",
+        { "pkg/A.html",
             "<dl>\n" +
             "<dt>Functional Interface:</dt>\n" +
             "<dd>This is a functional interface and can therefore be used as " +
             "the assignment target for a lambda expression or method " +
             "reference.</dd>\n" +
             "</dl>"},
-        {BUG_ID + "/pkg1/FuncInf.html",
+        { "pkg1/FuncInf.html",
             "<dl>\n" +
             "<dt>Functional Interface:</dt>\n" +
             "<dd>This is a functional interface and can therefore be used as " +
@@ -85,25 +82,25 @@
             "</dl>"}
     };
     private static final String[][] NEGATED_TEST = {
-        {BUG_ID + "/pkg/A.html",
+        { "pkg/A.html",
             "<td class=\"colFirst\"><code>default default void</code></td>"},
-        {BUG_ID + "/pkg/A.html",
+        { "pkg/A.html",
             "<pre>default&nbsp;default&nbsp;void&nbsp;defaultMethod()</pre>"},
-        {BUG_ID + "/pkg/B.html",
+        { "pkg/B.html",
             "<td class=\"colFirst\"><code>default void</code></td>"},
-        {BUG_ID + "/pkg1/NotAFuncInf.html",
+        { "pkg1/NotAFuncInf.html",
             "<dl>\n" +
             "<dt>Functional Interface:</dt>\n" +
             "<dd>This is a functional interface and can therefore be used as " +
             "the assignment target for a lambda expression or method " +
             "reference.</dd>\n" +
             "</dl>"},
-        {BUG_ID + "/pkg/B.html",
+        { "pkg/B.html",
             "<dl>\n" +
             "<dt>Functional Interface:</dt>"}
     };
     private static final String[][] NEGATED_TEST_1 = {
-        {BUG_ID + "-2/pkg1/FuncInf.html",
+        { "pkg1/FuncInf.html",
             "<dl>\n" +
             "<dt>Functional Interface:</dt>"}
     };
@@ -114,22 +111,8 @@
      */
     public static void main(String[] args) {
         TestLambdaFeature tester = new TestLambdaFeature();
-        run(tester, ARGS, TEST, NEGATED_TEST);
-        run(tester, ARGS_1, NO_TEST, NEGATED_TEST_1);
+        tester.run(ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS_1, NO_TEST, NEGATED_TEST_1);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testLeadingSpaces/LeadingSpaces.java b/langtools/test/com/sun/javadoc/testLeadingSpaces/LeadingSpaces.java
index a4de11f..46e2ea9 100644
--- a/langtools/test/com/sun/javadoc/testLeadingSpaces/LeadingSpaces.java
+++ b/langtools/test/com/sun/javadoc/testLeadingSpaces/LeadingSpaces.java
@@ -37,9 +37,8 @@
 
 public class LeadingSpaces extends JavadocTester {
 
-    private static final String BUG_ID = "4232882-8014636";
     private static final String[][] TEST = {
-        {BUG_ID + "/LeadingSpaces.html",
+        { "LeadingSpaces.html",
 "        1\n" +
 "          2\n" +
 "            3\n" +
@@ -48,10 +47,9 @@
 "                  6\n" +
 "                    7"}
     };
-    private static final String[][] NEGATED_TEST = NO_TEST;
     private static final String[] ARGS =
         new String[] {
-            "-d", BUG_ID, "-sourcepath", SRC_DIR,
+            "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR,
         SRC_DIR + "/LeadingSpaces.java"};
 
     /**
@@ -60,25 +58,11 @@
      */
     public static void main(String[] args) {
         LeadingSpaces tester = new LeadingSpaces();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NO_TEST);
         tester.printSummary();
     }
 
     /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
-
-    /**
        This leading spaces in the &lt;pre&gt; block below should be
        preserved.
        <pre>
diff --git a/langtools/test/com/sun/javadoc/testLegacyTaglet/TestLegacyTaglet.java b/langtools/test/com/sun/javadoc/testLegacyTaglet/TestLegacyTaglet.java
index e073ff9..16d8cbd 100644
--- a/langtools/test/com/sun/javadoc/testLegacyTaglet/TestLegacyTaglet.java
+++ b/langtools/test/com/sun/javadoc/testLegacyTaglet/TestLegacyTaglet.java
@@ -34,49 +34,31 @@
 
 public class TestLegacyTaglet extends JavadocTester {
 
-    private static final String BUG_ID = "4638723-8015882";
-
     private static final String[] ARGS =
-        new String[] {"-d", BUG_ID, "-sourcepath", SRC_DIR,
+        new String[] {"-d", OUTPUT_DIR, "-sourcepath", SRC_DIR,
             "-tagletpath", SRC_DIR, "-taglet", "ToDoTaglet", "-taglet", "Check",
             "-taglet", "UnderlineTaglet", SRC_DIR + "/C.java"};
 
     private static final String[][] TEST = new String[][] {
-            {BUG_ID + "/C.html", "This is an <u>underline</u>"},
-            {BUG_ID + "/C.html",
+            { "C.html", "This is an <u>underline</u>"},
+            { "C.html",
             "<DT><B>To Do:</B><DD><table cellpadding=2 cellspacing=0><tr>" +
                 "<td bgcolor=\"yellow\">Finish this class.</td></tr></table></DD>"},
-            {BUG_ID + "/C.html",
+            { "C.html",
                 "<DT><B>To Do:</B><DD><table cellpadding=2 cellspacing=0><tr>" +
                 "<td bgcolor=\"yellow\">Tag in Method.</td></tr></table></DD>"}
     };
 
-    private static final String[][] NEGATED_TEST = NO_TEST;
-
     /**
      * The entry point of the test.
      * @param args the array of command line arguments.
      */
     public static void main(String[] args) {
         TestLegacyTaglet tester = new TestLegacyTaglet();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NO_TEST);
         if (tester.getErrorOutput().contains("NullPointerException")) {
             throw new AssertionError("javadoc threw NullPointerException");
         }
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testLinkOption/TestBadLinkOption.java b/langtools/test/com/sun/javadoc/testLinkOption/TestBadLinkOption.java
index 3393a96..5bb1e64 100644
--- a/langtools/test/com/sun/javadoc/testLinkOption/TestBadLinkOption.java
+++ b/langtools/test/com/sun/javadoc/testLinkOption/TestBadLinkOption.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -34,11 +34,9 @@
 
 public class TestBadLinkOption extends JavadocTester {
 
-    private static final String BUG_ID = "4720957";
-
     private static final String[] ARGS = new String[] {
-        "-d", BUG_ID, "-sourcepath", SRC_DIR,
-        "-link", BUG_ID, "pkg"
+        "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR,
+        "-link", OUTPUT_DIR, "pkg"
     };
 
     private static final String[][] TEST = {
@@ -55,21 +53,7 @@
      */
     public static void main(String[] args) {
         TestBadLinkOption tester = new TestBadLinkOption();
-        run(tester, ARGS, TEST, NEG_TEST);
+        tester.run(ARGS, TEST, NEG_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testLinkOption/TestLinkOption.java b/langtools/test/com/sun/javadoc/testLinkOption/TestLinkOption.java
index 16c32f3..f40dad5 100644
--- a/langtools/test/com/sun/javadoc/testLinkOption/TestLinkOption.java
+++ b/langtools/test/com/sun/javadoc/testLinkOption/TestLinkOption.java
@@ -36,33 +36,31 @@
 
 public class TestLinkOption extends JavadocTester {
 
-    private static final String BUG_ID = "4720957-5020118-8038976";
-
     //Generate the documentation using -linkoffline and a URL as the first parameter.
     private static final String[] ARGS1 = new String[] {
-        "-d", BUG_ID + "-1", "-sourcepath", SRC_DIR,
+        "-d", OUTPUT_DIR + "-1", "-sourcepath", SRC_DIR,
         "-linkoffline", "http://java.sun.com/j2se/1.4/docs/api/",
         SRC_DIR, "-package", "pkg", "java.lang"
     };
 
     private static final String[][] TEST1 = {
-        {BUG_ID + "-1/pkg/C.html",
+        { "pkg/C.html",
             "<a href=\"http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html?is-external=true\" " +
             "title=\"class or interface in java.lang\"><code>Link to String Class</code></a>"
         },
         //Make sure the parameters are indented properly when the -link option is used.
-        {BUG_ID + "-1/pkg/C.html",
+        { "pkg/C.html",
             "(int&nbsp;p1,\n" +
             "      int&nbsp;p2,\n" +
             "      int&nbsp;p3)"
         },
-        {BUG_ID + "-1/pkg/C.html",
+        { "pkg/C.html",
             "(int&nbsp;p1,\n" +
             "      int&nbsp;p2,\n" +
             "      <a href=\"http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html?is-external=true\" title=\"class or interface in java.lang\">" +
             "Object</a>&nbsp;p3)"
         },
-        {BUG_ID + "-1/java/lang/StringBuilderChild.html",
+        { "java/lang/StringBuilderChild.html",
             "<pre>public abstract class <span class=\"typeNameLabel\">StringBuilderChild</span>\n" +
                 "extends <a href=\"http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html?is-external=true\" " +
             "title=\"class or interface in java.lang\">Object</a></pre>"
@@ -74,27 +72,26 @@
     //Generate the documentation using -linkoffline and a relative path as the first parameter.
     //We will try linking to the docs generated in test 1 with a relative path.
     private static final String[] ARGS2 = new String[] {
-        "-d", BUG_ID + "-2", "-sourcepath", SRC_DIR,
-        "-linkoffline", "../" + BUG_ID + "-1",
-        BUG_ID + "-1", "-package", "pkg2"
+        "-d", OUTPUT_DIR + "-2", "-sourcepath", SRC_DIR,
+        "-linkoffline", "../" + OUTPUT_DIR + "-1",
+        OUTPUT_DIR + "-1", "-package", "pkg2"
     };
 
     private static final String[][] TEST2 = {
-        {BUG_ID + "-2/pkg2/C2.html",
-            "This is a link to <a href=\"../../" + BUG_ID +
+        { "pkg2/C2.html",
+            "This is a link to <a href=\"../../" + OUTPUT_DIR +
             "-1/pkg/C.html?is-external=true\" " +
             "title=\"class or interface in pkg\"><code>Class C</code></a>."
         }
     };
-    private static final String[][] NEGATED_TEST2 = NO_TEST;
     /*
      * Create the documentation using the -link option, vary the behavior with
      * both trailing and no trailing slash. We are only interested in ensuring
      * that the command executes with no errors or related warnings.
      */
     static String[] createArguments(boolean withTrailingSlash) {
-        String packagePath = new File(BUG_ID + "-1").getAbsolutePath();
-        String outputDirName = BUG_ID;
+        String packagePath = new File(OUTPUT_DIR + "-1").getAbsolutePath();
+        String outputDirName = OUTPUT_DIR;
         if (withTrailingSlash) {
             // add the trailing slash, if it is not present!
             if (!packagePath.endsWith(FS)) {
@@ -121,8 +118,9 @@
      */
     public static void main(String[] args) {
         TestLinkOption tester = new TestLinkOption();
-        run(tester, ARGS1, TEST1, NEGATED_TEST1);
-        run(tester, ARGS2, TEST2, NEGATED_TEST2);
+        tester.run(ARGS1, TEST1, NEGATED_TEST1);
+        tester.run(ARGS1, TEST1, NEGATED_TEST1);
+        tester.run(ARGS2, TEST2, NO_TEST);
         tester.runJavadoc(createArguments(true));  // with trailing slash
         tester.runJavadoc(createArguments(false)); // without trailing slash
         tester.printSummary();
@@ -131,18 +129,4 @@
         }
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testLinkOption/TestNewLineInLink.java b/langtools/test/com/sun/javadoc/testLinkOption/TestNewLineInLink.java
index 631b40b..628d0fd 100644
--- a/langtools/test/com/sun/javadoc/testLinkOption/TestNewLineInLink.java
+++ b/langtools/test/com/sun/javadoc/testLinkOption/TestNewLineInLink.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -35,7 +35,6 @@
 
 public class TestNewLineInLink extends JavadocTester {
 
-    private static final String BUG_ID = "4739870";
     private static final String[][] NEGATED_TEST =
         new String[][] {
             {ERROR_OUTPUT,
@@ -43,7 +42,7 @@
         };
 
     private static final String[] ARGS = new String[] {
-            "-d", BUG_ID, "-sourcepath", SRC_DIR,
+            "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR,
                 "-linkoffline", "http://www.java.sun.com/j2se/1.4/docs/api",
                 SRC_DIR, "testNewLineInLink"};
 
@@ -53,21 +52,7 @@
      */
     public static void main(String[] args) {
         TestNewLineInLink tester = new TestNewLineInLink();
-        run(tester, ARGS, new String[][] {}, NEGATED_TEST);
+        tester.run(ARGS, new String[][] {}, NEGATED_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testLinkTaglet/TestLinkTaglet.java b/langtools/test/com/sun/javadoc/testLinkTaglet/TestLinkTaglet.java
index b271792..9859171 100644
--- a/langtools/test/com/sun/javadoc/testLinkTaglet/TestLinkTaglet.java
+++ b/langtools/test/com/sun/javadoc/testLinkTaglet/TestLinkTaglet.java
@@ -35,18 +35,15 @@
 
 public class TestLinkTaglet extends JavadocTester {
 
-    //Test information.
-    private static final String BUG_ID = "4732864-6280605-7064544-8014636";
-
     //Javadoc arguments.
     private static final String[] ARGS = new String[] {
-        "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg", SRC_DIR +
+        "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg", SRC_DIR +
         "/checkPkg/B.java"
     };
 
     //Input for string search tests.
     private static final String[][] TEST = {
-        {BUG_ID + "/pkg/C.html",
+        { "pkg/C.html",
             "Qualified Link: <a href=\"../pkg/C.InnerC.html\" title=\"class in pkg\"><code>C.InnerC</code></a>.<br/>\n" +
             " Unqualified Link1: <a href=\"../pkg/C.InnerC.html\" title=\"class in pkg\"><code>C.InnerC</code></a>.<br/>\n" +
             " Unqualified Link2: <a href=\"../pkg/C.InnerC.html\" title=\"class in pkg\"><code>C.InnerC</code></a>.<br/>\n" +
@@ -54,12 +51,12 @@
             " Unqualified Link: <a href=\"../pkg/C.html#method-pkg.C.InnerC-pkg.C.InnerC2-\"><code>method(C.InnerC, C.InnerC2)</code></a>.<br/>\n" +
             " Unqualified Link: <a href=\"../pkg/C.html#method-pkg.C.InnerC-pkg.C.InnerC2-\"><code>method(InnerC, InnerC2)</code></a>.<br/>"
         },
-        {BUG_ID + "/pkg/C.InnerC.html",
+        { "pkg/C.InnerC.html",
             "Link to member in outer class: <a href=\"../pkg/C.html#MEMBER\"><code>C.MEMBER</code></a> <br/>\n" +
             " Link to member in inner class: <a href=\"../pkg/C.InnerC2.html#MEMBER2\"><code>C.InnerC2.MEMBER2</code></a> <br/>\n" +
             " Link to another inner class: <a href=\"../pkg/C.InnerC2.html\" title=\"class in pkg\"><code>C.InnerC2</code></a>"
         },
-        {BUG_ID + "/pkg/C.InnerC2.html",
+        { "pkg/C.InnerC2.html",
             "<dl>\n" +
             "<dt>Enclosing class:</dt>\n" +
             "<dd><a href=\"../pkg/C.html\" title=\"class in pkg\">C</a></dd>\n" +
@@ -76,21 +73,7 @@
      */
     public static void main(String[] args) {
         TestLinkTaglet tester = new TestLinkTaglet();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NEGATED_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testLinkToSerialForm/TestLinkToSerialForm.java b/langtools/test/com/sun/javadoc/testLinkToSerialForm/TestLinkToSerialForm.java
index 9af0d28..6e233a2 100644
--- a/langtools/test/com/sun/javadoc/testLinkToSerialForm/TestLinkToSerialForm.java
+++ b/langtools/test/com/sun/javadoc/testLinkToSerialForm/TestLinkToSerialForm.java
@@ -35,15 +35,13 @@
 
 public class TestLinkToSerialForm extends JavadocTester {
 
-    private static final String BUG_ID = "4521661";
     private static final String[][] TEST = {
-        {BUG_ID + "/serialized-form.html", "<a name=\"pkg.C\">"},
-        {BUG_ID + "/pkg/C.html", "<a href=\"../serialized-form.html#pkg.C\">"}
+        { "serialized-form.html", "<a name=\"pkg.C\">"},
+        { "pkg/C.html", "<a href=\"../serialized-form.html#pkg.C\">"}
     };
-    private static final String[][] NEGATED_TEST = NO_TEST;
     private static final String[] ARGS =
         new String[] {
-            "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg"};
+            "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg"};
 
     /**
      * The entry point of the test.
@@ -51,21 +49,7 @@
      */
     public static void main(String[] args) {
         TestLinkToSerialForm tester = new TestLinkToSerialForm();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NO_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testLiteralCodeInPre/TestLiteralCodeInPre.java b/langtools/test/com/sun/javadoc/testLiteralCodeInPre/TestLiteralCodeInPre.java
index c9541e6..4be7366 100644
--- a/langtools/test/com/sun/javadoc/testLiteralCodeInPre/TestLiteralCodeInPre.java
+++ b/langtools/test/com/sun/javadoc/testLiteralCodeInPre/TestLiteralCodeInPre.java
@@ -32,10 +32,6 @@
 
 public class TestLiteralCodeInPre extends JavadocTester {
 
-    //Test information.
-    private static final String BUG_ID = "8002387-8014636";
-    private static final String OUTPUT_DIR = BUG_ID;
-
     //Javadoc arguments.
     private static final String[] ARGS = new String[] {
         "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "-Xdoclint:none", "pkg"
@@ -43,25 +39,25 @@
 
     //Input for string search tests.
     private static final String[][] TEST = {
-        { BUG_ID + "/pkg/Test.html",
+        { "pkg/Test.html",
             "no_pre()</pre>\n" +
             "<div class=\"block\">abc<code>def</code>ghi</div>" },
-        { BUG_ID + "/pkg/Test.html",
+        { "pkg/Test.html",
             "no_pre_extra_whitespace()</pre>\n" +
             "<div class=\"block\">abc<code>def  </code>ghi</div>" },
-        { BUG_ID + "/pkg/Test.html",
+        { "pkg/Test.html",
             "in_pre()</pre>\n" +
             "<div class=\"block\"><pre> abc<code>  def  </code>ghi</pre></div>" },
-        { BUG_ID + "/pkg/Test.html",
+        { "pkg/Test.html",
             "pre_after_text()</pre>\n" +
             "<div class=\"block\">xyz <pre> abc<code>  def  </code>ghi</pre></div>" },
-        { BUG_ID + "/pkg/Test.html",
+        { "pkg/Test.html",
             "after_pre()</pre>\n" +
             "<div class=\"block\">xyz <pre> pqr </pre> abc<code>def  </code>ghi</div>" },
-        { BUG_ID + "/pkg/Test.html",
+        { "pkg/Test.html",
             "back_in_pre()</pre>\n" +
             "<div class=\"block\">xyz <pre> pqr </pre> mno <pre> abc<code>  def  </code>ghi</pre></div>" },
-        { BUG_ID + "/pkg/Test.html",
+        { "pkg/Test.html",
             "typical_usage_code()</pre>\n" +
             "<div class=\"block\">Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n" +
             " Example:  <pre><code>\n" +
@@ -70,7 +66,7 @@
             "   line 3 }\n" +
             " </code></pre>\n" +
             " and so it goes.</div>" },
-        { BUG_ID + "/pkg/Test.html",
+        { "pkg/Test.html",
             "typical_usage_literal()</pre>\n" +
             "<div class=\"block\">Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n" +
             " Example:  <pre>\n" +
@@ -79,7 +75,7 @@
             "   line 3 }\n" +
             " </pre>\n" +
             " and so it goes.</div>" },
-        { BUG_ID + "/pkg/Test.html",
+        { "pkg/Test.html",
             "recommended_usage_literal()</pre>\n" +
             "<div class=\"block\">Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n" +
             " Example:  <pre>\n" +
@@ -89,29 +85,13 @@
             " and so it goes.</div>" }
     };
 
-    private static final String[][] NEGATED_TEST = NO_TEST;
-
     /**
      * The entry point of the test.
      * @param args the array of command line arguments.
      */
     public static void main(String[] args) {
         TestLiteralCodeInPre tester = new TestLiteralCodeInPre();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NO_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testMemberInheritence/TestMemberInheritence.java b/langtools/test/com/sun/javadoc/testMemberInheritence/TestMemberInheritence.java
index 6bfc3ad..f3afc14 100644
--- a/langtools/test/com/sun/javadoc/testMemberInheritence/TestMemberInheritence.java
+++ b/langtools/test/com/sun/javadoc/testMemberInheritence/TestMemberInheritence.java
@@ -35,43 +35,41 @@
 
 public class TestMemberInheritence extends JavadocTester {
 
-    private static final String BUG_ID = "4638588-4635809-6256068-6270645";
-
     private static final String[][] TEST = {
         //Public field should be inherited
-        {BUG_ID + "/pkg/SubClass.html",
+        { "pkg/SubClass.html",
          "<a href=\"../pkg/BaseClass.html#pubField\">"},
 
         //Public method should be inherited
-        {BUG_ID + "/pkg/SubClass.html",
+        { "pkg/SubClass.html",
          "<a href=\"../pkg/BaseClass.html#pubMethod--\">"},
 
         //Public inner class should be inherited.
-        {BUG_ID + "/pkg/SubClass.html",
+        { "pkg/SubClass.html",
          "<a href=\"../pkg/BaseClass.pubInnerClass.html\" title=\"class in pkg\">"},
 
         //Protected field should be inherited
-        {BUG_ID + "/pkg/SubClass.html",
+        { "pkg/SubClass.html",
          "<a href=\"../pkg/BaseClass.html#proField\">"},
 
         //Protected method should be inherited
-        {BUG_ID + "/pkg/SubClass.html",
+        { "pkg/SubClass.html",
          "<a href=\"../pkg/BaseClass.html#proMethod--\">"},
 
         //Protected inner class should be inherited.
-        {BUG_ID + "/pkg/SubClass.html",
+        { "pkg/SubClass.html",
          "<a href=\"../pkg/BaseClass.proInnerClass.html\" title=\"class in pkg\">"},
 
         // New labels as of 1.5.0
-        {BUG_ID + "/pkg/SubClass.html",
+        { "pkg/SubClass.html",
          "Nested classes/interfaces inherited from class&nbsp;pkg." +
                  "<a href=\"../pkg/BaseClass.html\" title=\"class in pkg\">BaseClass</a>"},
-        {BUG_ID + "/pkg/SubClass.html",
+        { "pkg/SubClass.html",
          "Nested classes/interfaces inherited from interface&nbsp;pkg." +
                  "<a href=\"../pkg/BaseInterface.html\" title=\"interface in pkg\">BaseInterface</a>"},
 
          // Test overriding/implementing methods with generic parameters.
-                 {BUG_ID + "/pkg/BaseClass.html",
+                 { "pkg/BaseClass.html",
          "<dl>\n" +
          "<dt><span class=\"overrideSpecifyLabel\">Specified by:</span></dt>\n" +
                           "<dd><code><a href=\"../pkg/BaseInterface.html#getAnnotation-java.lang.Class-\">" +
@@ -81,22 +79,22 @@
                           "</dl>"},
 
          // Test diamond inheritence member summary (6256068)
-                 {BUG_ID + "/diamond/Z.html",
+                 { "diamond/Z.html",
                  "<code><a href=\"../diamond/A.html#aMethod--\">aMethod</a></code>"},
 
          // Test that doc is inherited from closed parent (6270645)
-                 {BUG_ID + "/inheritDist/C.html",
+                 { "inheritDist/C.html",
                  "<div class=\"block\">m1-B</div>"},
 
     };
 
     private static final String[][] NEGATED_TEST = {
-        {BUG_ID + "/pkg/SubClass.html",
+        { "pkg/SubClass.html",
         "<a href=\"../pkg/BaseClass.html#staticMethod--\">staticMethod</a></code>"},
     };
     private static final String[] ARGS =
         new String[] {
-            "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg", "diamond",
+            "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg", "diamond",
             "inheritDist"};
 
     /**
@@ -105,21 +103,7 @@
      */
     public static void main(String[] args) {
         TestMemberInheritence tester = new TestMemberInheritence();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NEGATED_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testMemberSummary/TestMemberSummary.java b/langtools/test/com/sun/javadoc/testMemberSummary/TestMemberSummary.java
index 3a8a2ea..67b2628 100644
--- a/langtools/test/com/sun/javadoc/testMemberSummary/TestMemberSummary.java
+++ b/langtools/test/com/sun/javadoc/testMemberSummary/TestMemberSummary.java
@@ -36,30 +36,27 @@
 
 public class TestMemberSummary extends JavadocTester {
 
-    //Test information.
-    private static final String BUG_ID = "4951228-6290760";
-
     //Javadoc arguments.
     private static final String[] ARGS = new String[] {
-        "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg","pkg2"
+        "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg","pkg2"
     };
 
     //Input for string search tests.
     private static final String[][] TEST = {
         // Check return type in member summary.
-        {BUG_ID + "/pkg/PublicChild.html",
+        { "pkg/PublicChild.html",
             "<code><a href=\"../pkg/PublicChild.html\" title=\"class in pkg\">PublicChild</a></code></td>\n" +
             "<td class=\"colLast\"><code><span class=\"memberNameLink\"><a href=\"../pkg/PublicChild.html#returnTypeTest--\">" +
             "returnTypeTest</a></span>()</code>"
         },
         // Check return type in member detail.
-        {BUG_ID + "/pkg/PublicChild.html",
+        { "pkg/PublicChild.html",
             "<pre>public&nbsp;<a href=\"../pkg/PublicChild.html\" title=\"class in pkg\">" +
             "PublicChild</a>&nbsp;returnTypeTest()</pre>"
         },
 
          // Legacy anchor dimensions (6290760)
-        {BUG_ID + "/pkg2/A.html",
+        { "pkg2/A.html",
             "<a name=\"f-java.lang.Object:A-\">\n" +
             "<!--   -->\n" +
             "</a><a name=\"f-T:A-\">\n" +
@@ -67,7 +64,6 @@
             "</a>"
         },
     };
-    private static final String[][] NEGATED_TEST = NO_TEST;
 
     /**
      * The entry point of the test.
@@ -75,21 +71,7 @@
      */
     public static void main(String[] args) {
         TestMemberSummary tester = new TestMemberSummary();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NO_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testMethodTypes/TestMethodTypes.java b/langtools/test/com/sun/javadoc/testMethodTypes/TestMethodTypes.java
index 6376bff..fd28735 100644
--- a/langtools/test/com/sun/javadoc/testMethodTypes/TestMethodTypes.java
+++ b/langtools/test/com/sun/javadoc/testMethodTypes/TestMethodTypes.java
@@ -33,20 +33,17 @@
 
 public class TestMethodTypes extends JavadocTester {
 
-    //Test information.
-    private static final String BUG_ID = "8002304";
-
     //Javadoc arguments.
     private static final String[] ARGS = new String[] {
-        "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg1"
+        "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg1"
     };
 
     private static final String[][] TEST = {
-        {BUG_ID + "/pkg1/A.html",
+        { "pkg1/A.html",
             "var methods = {"
         },
 
-        {BUG_ID + "/pkg1/A.html",
+        { "pkg1/A.html",
             "<caption><span id=\"t0\" class=\"activeTableTab\"><span>All " +
             "Methods</span><span class=\"tabEnd\">&nbsp;</span></span>" +
             "<span id=\"t1\" class=\"tableTab\"><span><a href=\"javascript:show(1);\">" +
@@ -60,11 +57,11 @@
             "</caption>"
         },
 
-        {BUG_ID + "/pkg1/A.html",
+        { "pkg1/A.html",
             "<tr id=\"i0\" class=\"altColor\">"
         },
 
-        {BUG_ID + "/pkg1/B.html",
+        { "pkg1/B.html",
             "<caption><span id=\"t0\" class=\"activeTableTab\"><span>All " +
             "Methods</span><span class=\"tabEnd\">&nbsp;</span></span>" +
             "<span id=\"t2\" class=\"tableTab\"><span><a href=\"javascript:show(2);\">" +
@@ -74,11 +71,11 @@
             "</caption>"
         },
 
-        {BUG_ID + "/pkg1/D.html",
+        { "pkg1/D.html",
             "var methods = {"
         },
 
-        {BUG_ID + "/pkg1/D.html",
+        { "pkg1/D.html",
             "<caption><span id=\"t0\" class=\"activeTableTab\"><span>All " +
             "Methods</span><span class=\"tabEnd\">&nbsp;</span></span>" +
             "<span id=\"t2\" class=\"tableTab\"><span><a href=\"javascript:show(2);\">" +
@@ -92,22 +89,22 @@
             "</caption>"
         },
 
-        {BUG_ID + "/pkg1/D.html",
+        { "pkg1/D.html",
             "<tr id=\"i0\" class=\"altColor\">"
         },
     };
     private static final String[][] NEGATED_TEST = {
-        {BUG_ID + "/pkg1/A.html",
+        { "pkg1/A.html",
             "<caption><span>Methods</span><span class=\"tabEnd\">&nbsp;</span>" +
             "</caption>"
         },
 
-        {BUG_ID + "/pkg1/B.html",
+        { "pkg1/B.html",
             "<caption><span>Methods</span><span class=\"tabEnd\">&nbsp;</span>" +
             "</caption>"
         },
 
-        {BUG_ID + "/pkg1/D.html",
+        { "pkg1/D.html",
             "<caption><span>Methods</span><span class=\"tabEnd\">&nbsp;</span>" +
             "</caption>"
         },
@@ -119,21 +116,7 @@
      */
     public static void main(String[] args) {
         TestMethodTypes tester = new TestMethodTypes();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NEGATED_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testModifier/TestModifier.java b/langtools/test/com/sun/javadoc/testModifier/TestModifier.java
index 0509055..2636f18 100644
--- a/langtools/test/com/sun/javadoc/testModifier/TestModifier.java
+++ b/langtools/test/com/sun/javadoc/testModifier/TestModifier.java
@@ -35,9 +35,6 @@
 
 public class TestModifier extends JavadocTester {
 
-    private static final String BUG_ID = "4210388";
-    private static final String[][] TEST = NO_TEST;
-    private static final String[][] NEGATED_TEST = NO_TEST;
     private static final String[] ARGS =
         new String[] {
             "-sourcepath", SRC_DIR,
@@ -50,22 +47,8 @@
      */
     public static void main(String[] args) {
         TestModifier tester = new TestModifier();
-        if (run(tester, ARGS, TEST, NEGATED_TEST) != 0) {
+        if (tester.run(ARGS, NO_TEST, NO_TEST) != 0) {
             throw new Error("Javadoc error occured during execution.");
         }
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testNavigation/TestNavigation.java b/langtools/test/com/sun/javadoc/testNavigation/TestNavigation.java
index d4620b1..ae43a56 100644
--- a/langtools/test/com/sun/javadoc/testNavigation/TestNavigation.java
+++ b/langtools/test/com/sun/javadoc/testNavigation/TestNavigation.java
@@ -34,38 +34,34 @@
 
 public class TestNavigation extends JavadocTester {
 
-    //Test information.
-    private static final String BUG_ID = "4131628-4664607";
-
     //Javadoc arguments.
     private static final String[] ARGS = new String[] {
-        "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg"
+        "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg"
     };
 
     //Input for string search tests.
     private static final String[][] TEST = {
-        {BUG_ID + "/pkg/A.html", "<li>Prev&nbsp;Class</li>"},
-        {BUG_ID + "/pkg/A.html",
+        { "pkg/A.html", "<li>Prev&nbsp;Class</li>"},
+        { "pkg/A.html",
             "<a href=\"../pkg/C.html\" title=\"class in pkg\"><span class=\"typeNameLink\">Next&nbsp;Class</span></a>"},
-        {BUG_ID + "/pkg/C.html",
+        { "pkg/C.html",
             "<a href=\"../pkg/A.html\" title=\"annotation in pkg\"><span class=\"typeNameLink\">Prev&nbsp;Class</span></a>"},
-        {BUG_ID + "/pkg/C.html",
+        { "pkg/C.html",
             "<a href=\"../pkg/E.html\" title=\"enum in pkg\"><span class=\"typeNameLink\">Next&nbsp;Class</span></a>"},
-        {BUG_ID + "/pkg/E.html",
+        { "pkg/E.html",
             "<a href=\"../pkg/C.html\" title=\"class in pkg\"><span class=\"typeNameLink\">Prev&nbsp;Class</span></a>"},
-        {BUG_ID + "/pkg/E.html",
+        { "pkg/E.html",
             "<a href=\"../pkg/I.html\" title=\"interface in pkg\"><span class=\"typeNameLink\">Next&nbsp;Class</span></a>"},
-        {BUG_ID + "/pkg/I.html",
+        { "pkg/I.html",
             "<a href=\"../pkg/E.html\" title=\"enum in pkg\"><span class=\"typeNameLink\">Prev&nbsp;Class</span></a>"},
-        {BUG_ID + "/pkg/I.html", "<li>Next&nbsp;Class</li>"},
+        { "pkg/I.html", "<li>Next&nbsp;Class</li>"},
         // Test for 4664607
-        {BUG_ID + "/pkg/I.html",
+        { "pkg/I.html",
             "<div class=\"skipNav\"><a href=\"#skip.navbar.top\" title=\"Skip navigation links\">Skip navigation links</a></div>\n" +
             "<a name=\"navbar.top.firstrow\">\n" +
             "<!--   -->\n" +
             "</a>"}
     };
-    private static final String[][] NEGATED_TEST = NO_TEST;
 
     /**
      * The entry point of the test.
@@ -73,21 +69,7 @@
      */
     public static void main(String[] args) {
         TestNavigation tester = new TestNavigation();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NO_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testNestedGenerics/TestNestedGenerics.java b/langtools/test/com/sun/javadoc/testNestedGenerics/TestNestedGenerics.java
index 0f4b2f7..9a4e41e 100644
--- a/langtools/test/com/sun/javadoc/testNestedGenerics/TestNestedGenerics.java
+++ b/langtools/test/com/sun/javadoc/testNestedGenerics/TestNestedGenerics.java
@@ -33,24 +33,20 @@
 
 public class TestNestedGenerics extends JavadocTester {
 
-    //Test information.
-    private static final String BUG_ID = "6758050";
-
     //Javadoc arguments.
     private static final String[] ARGS = new String[]{
-        "-d", BUG_ID, "-sourcepath", SRC_DIR,
+        "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR,
         "pkg"
     };
 
     //Input for string search tests.
     private static final String[][] TEST = {
-        {BUG_ID + "/pkg/NestedGenerics.html",
+        { "pkg/NestedGenerics.html",
             "<div class=\"block\">Contains <a " +
             "href=\"../pkg/NestedGenerics.html#foo-java.util.Map-\"><code>foo" +
             "(java.util.Map&lt;A, java.util.Map&lt;A, A&gt;&gt;)</code></a></div>"
         }
     };
-    private static final String[][] NEGATED_TEST = NO_TEST;
 
     /**
      * The entry point of the test.
@@ -58,21 +54,7 @@
      */
     public static void main(String[] args) {
         TestNestedGenerics tester = new TestNestedGenerics();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NO_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testNestedInlineTag/TestNestedInlineTag.java b/langtools/test/com/sun/javadoc/testNestedInlineTag/TestNestedInlineTag.java
index 3ab8d0b..e04b5c5 100644
--- a/langtools/test/com/sun/javadoc/testNestedInlineTag/TestNestedInlineTag.java
+++ b/langtools/test/com/sun/javadoc/testNestedInlineTag/TestNestedInlineTag.java
@@ -54,33 +54,31 @@
      */
     public void method(){}
 
-    private static final String BUG_ID = "no-bug-id";
     private static final String[][] TEST = {
         //Test nested inline tag in class description.
-        {BUG_ID + "/TestNestedInlineTag.html",
+        { "TestNestedInlineTag.html",
          "This should be green, underlined and bold (Class): <u><b><font color=\"green\">My test</font></b></u>"
         },
 
         //Test nested inline tag in field description.
-        {BUG_ID + "/TestNestedInlineTag.html",
+        { "TestNestedInlineTag.html",
          "This should be green, underlined and bold (Field): <u><b><font color=\"green\">My test</font></b></u>"
         },
 
         //Test nested inline tag in constructor description.
-        {BUG_ID + "/TestNestedInlineTag.html",
+        { "TestNestedInlineTag.html",
          "This should be green, underlined and bold (Constructor): <u><b><font color=\"green\">My test</font></b></u>"
         },
 
         //Test nested inline tag in method description.
-        {BUG_ID + "/TestNestedInlineTag.html",
+        { "TestNestedInlineTag.html",
          "This should be green, underlined and bold (Method): <u><b><font color=\"green\">My test</font></b></u>"
         }
     };
 
-    private static final String[][] NEGATED_TEST = NO_TEST;
     private static final String[] ARGS =
         new String[] {
-            "-d", BUG_ID, "-sourcepath", SRC_DIR,
+            "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR,
             "-taglet", "testtaglets.UnderlineTaglet",
             "-taglet", "testtaglets.BoldTaglet",
             "-taglet", "testtaglets.GreenTaglet",
@@ -93,21 +91,7 @@
      */
     public static void main(String[] args) {
         TestNestedInlineTag tester = new TestNestedInlineTag();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NO_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testNewLanguageFeatures/TestNewLanguageFeatures.java b/langtools/test/com/sun/javadoc/testNewLanguageFeatures/TestNewLanguageFeatures.java
index 243464a..5f8ae96 100644
--- a/langtools/test/com/sun/javadoc/testNewLanguageFeatures/TestNewLanguageFeatures.java
+++ b/langtools/test/com/sun/javadoc/testNewLanguageFeatures/TestNewLanguageFeatures.java
@@ -35,13 +35,9 @@
 
 public class TestNewLanguageFeatures extends JavadocTester {
 
-    //Test information.
-    private static final String BUG_ID =
-        "4789689-4905985-4927164-4827184-4993906";
-
     //Javadoc arguments.
     private static final String[] ARGS = new String[] {
-        "-Xdoclint:none", "-d", BUG_ID, "-use", "-sourcepath", SRC_DIR,
+        "-Xdoclint:none", "-d", OUTPUT_DIR, "-use", "-sourcepath", SRC_DIR,
         "pkg", "pkg1", "pkg2"
     };
 
@@ -52,43 +48,43 @@
             // ENUM TESTING
             //=================================
             //Make sure enum header is correct.
-            {BUG_ID + "/pkg/Coin.html", "Enum Coin</h2>"},
+            { "pkg/Coin.html", "Enum Coin</h2>"},
             //Make sure enum signature is correct.
-            {BUG_ID + "/pkg/Coin.html", "<pre>public enum " +
+            { "pkg/Coin.html", "<pre>public enum " +
                      "<span class=\"typeNameLabel\">Coin</span>\n" +
                      "extends java.lang.Enum&lt;<a href=\"../pkg/Coin.html\" " +
                      "title=\"enum in pkg\">Coin</a>&gt;</pre>"
             },
             //Check for enum constant section
-            {BUG_ID + "/pkg/Coin.html", "<caption><span>Enum Constants" +
+            { "pkg/Coin.html", "<caption><span>Enum Constants" +
                      "</span><span class=\"tabEnd\">&nbsp;</span></caption>"},
             //Detail for enum constant
-            {BUG_ID + "/pkg/Coin.html",
+            { "pkg/Coin.html",
                 "<span class=\"memberNameLink\"><a href=\"../pkg/Coin.html#Dime\">Dime</a></span>"},
             //Automatically insert documentation for values() and valueOf().
-            {BUG_ID + "/pkg/Coin.html",
+            { "pkg/Coin.html",
                 "Returns an array containing the constants of this enum type,"},
-            {BUG_ID + "/pkg/Coin.html",
+            { "pkg/Coin.html",
                 "Returns the enum constant of this type with the specified name"},
-            {BUG_ID + "/pkg/Coin.html", "for (Coin c : Coin.values())"},
-            {BUG_ID + "/pkg/Coin.html",
+            { "pkg/Coin.html", "for (Coin c : Coin.values())"},
+            { "pkg/Coin.html",
                 "Overloaded valueOf() method has correct documentation."},
-            {BUG_ID + "/pkg/Coin.html",
+            { "pkg/Coin.html",
                 "Overloaded values method  has correct documentation."},
 
             //=================================
             // TYPE PARAMETER TESTING
             //=================================
             //Make sure the header is correct.
-            {BUG_ID + "/pkg/TypeParameters.html",
+            { "pkg/TypeParameters.html",
                 "Class TypeParameters&lt;E&gt;</h2>"},
             //Check class type parameters section.
-            {BUG_ID + "/pkg/TypeParameters.html",
+            { "pkg/TypeParameters.html",
                 "<dt><span class=\"paramLabel\">Type Parameters:</span></dt>\n" +
                 "<dd><code>E</code> - " +
                 "the type parameter for this class."},
             //Type parameters in @see/@link
-            {BUG_ID + "/pkg/TypeParameters.html",
+            { "pkg/TypeParameters.html",
                 "<dl>\n" +
                 "<dt><span class=\"seeLabel\">See Also:</span></dt>\n" +
                 "<dd>" +
@@ -96,28 +92,28 @@
                 "<code>TypeParameters</code></a></dd>\n" +
                 "</dl>"},
             //Method that uses class type parameter.
-            {BUG_ID + "/pkg/TypeParameters.html",
+            { "pkg/TypeParameters.html",
                 "(<a href=\"../pkg/TypeParameters.html\" title=\"type " +
                     "parameter in TypeParameters\">E</a>&nbsp;param)"},
             //Method type parameter section.
-            {BUG_ID + "/pkg/TypeParameters.html",
+            { "pkg/TypeParameters.html",
                 "<span class=\"paramLabel\">Type Parameters:</span></dt>\n" +
                 "<dd><code>T</code> - This is the first " +
                     "type parameter.</dd>\n" +
                     "<dd><code>V</code> - This is the second type " +
                     "parameter."},
             //Signature of method with type parameters
-            {BUG_ID + "/pkg/TypeParameters.html",
+            { "pkg/TypeParameters.html",
                 "public&nbsp;&lt;T extends java.util.List,V&gt;&nbsp;" +
                 "java.lang.String[]&nbsp;methodThatHasTypeParameters"},
             //Wildcard testing.
-            {BUG_ID + "/pkg/Wildcards.html",
+            { "pkg/Wildcards.html",
                 "<a href=\"../pkg/TypeParameters.html\" title=\"class in pkg\">" +
                 "TypeParameters</a>&lt;? super java.lang.String&gt;&nbsp;a"},
-            {BUG_ID + "/pkg/Wildcards.html",
+            { "pkg/Wildcards.html",
                 "<a href=\"../pkg/TypeParameters.html\" title=\"class in pkg\">" +
                 "TypeParameters</a>&lt;? extends java.lang.StringBuffer&gt;&nbsp;b"},
-            {BUG_ID + "/pkg/Wildcards.html",
+            { "pkg/Wildcards.html",
                 "<a href=\"../pkg/TypeParameters.html\" title=\"class in pkg\">" +
                     "TypeParameters</a>&nbsp;c"},
             //Bad type parameter warnings.
@@ -127,7 +123,7 @@
                 "\"<BadMethodTypeParam>\" is not a type parameter name."},
 
             //Signature of subclass that has type parameters.
-            {BUG_ID + "/pkg/TypeParameterSubClass.html",
+            { "pkg/TypeParameterSubClass.html",
                 "<pre>public class <span class=\"typeNameLabel\">TypeParameterSubClass&lt;T extends " +
                 "java.lang.String&gt;</span>\n" +
                 "extends " +
@@ -136,20 +132,20 @@
 
             //Interface generic parameter substitution
             //Signature of subclass that has type parameters.
-            {BUG_ID + "/pkg/TypeParameters.html",
+            { "pkg/TypeParameters.html",
                 "<dl>\n" +
                 "<dt>All Implemented Interfaces:</dt>\n" +
                 "<dd><a href=\"../pkg/SubInterface.html\" title=\"interface in pkg\">" +
                 "SubInterface</a>&lt;E&gt;, <a href=\"../pkg/SuperInterface.html\" " +
                 "title=\"interface in pkg\">SuperInterface</a>&lt;E&gt;</dd>\n" +
                 "</dl>"},
-            {BUG_ID + "/pkg/SuperInterface.html",
+            { "pkg/SuperInterface.html",
                 "<dl>\n" +
                 "<dt>All Known Subinterfaces:</dt>\n" +
                 "<dd><a href=\"../pkg/SubInterface.html\" title=\"interface in pkg\">" +
                 "SubInterface</a>&lt;V&gt;</dd>\n" +
                 "</dl>"},
-            {BUG_ID + "/pkg/SubInterface.html",
+            { "pkg/SubInterface.html",
                 "<dl>\n" +
                 "<dt>All Superinterfaces:</dt>\n" +
                 "<dd><a href=\"../pkg/SuperInterface.html\" title=\"interface in pkg\">" +
@@ -159,10 +155,10 @@
             //=================================
             // VAR ARG TESTING
             //=================================
-            {BUG_ID + "/pkg/VarArgs.html", "(int...&nbsp;i)"},
-            {BUG_ID + "/pkg/VarArgs.html", "(int[][]...&nbsp;i)"},
-            {BUG_ID + "/pkg/VarArgs.html", "-int:A...-"},
-            {BUG_ID + "/pkg/VarArgs.html",
+            { "pkg/VarArgs.html", "(int...&nbsp;i)"},
+            { "pkg/VarArgs.html", "(int[][]...&nbsp;i)"},
+            { "pkg/VarArgs.html", "-int:A...-"},
+            { "pkg/VarArgs.html",
                 "<a href=\"../pkg/TypeParameters.html\" title=\"class in pkg\">" +
                 "TypeParameters</a>...&nbsp;t"},
 
@@ -170,7 +166,7 @@
             // ANNOTATION TYPE TESTING
             //=================================
             //Make sure the summary links are correct.
-            {BUG_ID + "/pkg/AnnotationType.html",
+            { "pkg/AnnotationType.html",
                 "<li>Summary:&nbsp;</li>\n" +
                 "<li>Field&nbsp;|&nbsp;</li>\n" +
                 "<li><a href=\"#annotation.type.required.element.summary\">" +
@@ -178,26 +174,26 @@
                 "<li>" +
                 "<a href=\"#annotation.type.optional.element.summary\">Optional</a></li>"},
             //Make sure the detail links are correct.
-            {BUG_ID + "/pkg/AnnotationType.html",
+            { "pkg/AnnotationType.html",
                 "<li>Detail:&nbsp;</li>\n" +
                 "<li>Field&nbsp;|&nbsp;</li>\n" +
                 "<li><a href=\"#annotation.type.element.detail\">Element</a></li>"},
             //Make sure the heading is correct.
-            {BUG_ID + "/pkg/AnnotationType.html",
+            { "pkg/AnnotationType.html",
                 "Annotation Type AnnotationType</h2>"},
             //Make sure the signature is correct.
-            {BUG_ID + "/pkg/AnnotationType.html",
+            { "pkg/AnnotationType.html",
                 "public @interface <span class=\"memberNameLabel\">AnnotationType</span>"},
             //Make sure member summary headings are correct.
-            {BUG_ID + "/pkg/AnnotationType.html",
+            { "pkg/AnnotationType.html",
                 "<h3>Required Element Summary</h3>"},
-            {BUG_ID + "/pkg/AnnotationType.html",
+            { "pkg/AnnotationType.html",
                 "<h3>Optional Element Summary</h3>"},
             //Make sure element detail heading is correct
-            {BUG_ID + "/pkg/AnnotationType.html",
+            { "pkg/AnnotationType.html",
                 "Element Detail"},
             //Make sure default annotation type value is printed when necessary.
-            {BUG_ID + "/pkg/AnnotationType.html",
+            { "pkg/AnnotationType.html",
                 "<dl>\n" +
                 "<dt>Default:</dt>\n" +
                 "<dd>\"unknown\"</dd>\n" +
@@ -208,12 +204,12 @@
             //=================================
 
             //PACKAGE
-            {BUG_ID + "/pkg/package-summary.html",
+            { "pkg/package-summary.html",
                 "<a href=\"../pkg/AnnotationType.html\" title=\"annotation in pkg\">@AnnotationType</a>(<a href=\"../pkg/AnnotationType.html#optional--\">optional</a>=\"Package Annotation\",\n" +
                 "                <a href=\"../pkg/AnnotationType.html#required--\">required</a>=1994)"},
 
             //CLASS
-            {BUG_ID + "/pkg/AnnotationTypeUsage.html",
+            { "pkg/AnnotationTypeUsage.html",
                 "<pre><a href=\"../pkg/AnnotationType.html\" " +
                 "title=\"annotation in pkg\">@AnnotationType</a>(" +
                 "<a href=\"../pkg/AnnotationType.html#optional--\">optional</a>" +
@@ -225,7 +221,7 @@
                 "extends java.lang.Object</pre>"},
 
             //FIELD
-            {BUG_ID + "/pkg/AnnotationTypeUsage.html",
+            { "pkg/AnnotationTypeUsage.html",
                 "<pre><a href=\"../pkg/AnnotationType.html\" " +
                 "title=\"annotation in pkg\">@AnnotationType</a>(" +
                 "<a href=\"../pkg/AnnotationType.html#optional--\">optional</a>" +
@@ -235,7 +231,7 @@
                 "public&nbsp;int field</pre>"},
 
             //CONSTRUCTOR
-            {BUG_ID + "/pkg/AnnotationTypeUsage.html",
+            { "pkg/AnnotationTypeUsage.html",
                 "<pre><a href=\"../pkg/AnnotationType.html\" " +
                 "title=\"annotation in pkg\">@AnnotationType</a>(" +
                 "<a href=\"../pkg/AnnotationType.html#optional--\">optional</a>" +
@@ -245,7 +241,7 @@
                 "public&nbsp;AnnotationTypeUsage()</pre>"},
 
             //METHOD
-            {BUG_ID + "/pkg/AnnotationTypeUsage.html",
+            { "pkg/AnnotationTypeUsage.html",
                 "<pre><a href=\"../pkg/AnnotationType.html\" " +
                 "title=\"annotation in pkg\">@AnnotationType</a>(" +
                 "<a href=\"../pkg/AnnotationType.html#optional--\">optional</a>" +
@@ -255,7 +251,7 @@
                 "public&nbsp;void&nbsp;method()</pre>"},
 
             //METHOD PARAMS
-            {BUG_ID + "/pkg/AnnotationTypeUsage.html",
+            { "pkg/AnnotationTypeUsage.html",
                 "<pre>public&nbsp;void&nbsp;methodWithParams(" +
                 "<a href=\"../pkg/AnnotationType.html\" title=\"annotation in pkg\">" +
                 "@AnnotationType</a>(<a href=\"../pkg/AnnotationType.html#optional--\">" +
@@ -265,7 +261,7 @@
                 "                             int&nbsp;undocmented)</pre>"},
 
             //CONSTRUCTOR PARAMS
-            {BUG_ID + "/pkg/AnnotationTypeUsage.html",
+            { "pkg/AnnotationTypeUsage.html",
                 "<pre>public&nbsp;AnnotationTypeUsage(<a " +
                 "href=\"../pkg/AnnotationType.html\" title=\"annotation in pkg\">" +
                 "@AnnotationType</a>(<a href=\"../pkg/AnnotationType.html#optional--\">" +
@@ -279,59 +275,59 @@
             //=================================
 
             //Integer
-            {BUG_ID + "/pkg1/B.html",
+            { "pkg1/B.html",
                 "<a href=\"../pkg1/A.html#d--\">d</a>=3.14,"},
 
             //Double
-            {BUG_ID + "/pkg1/B.html",
+            { "pkg1/B.html",
                 "<a href=\"../pkg1/A.html#d--\">d</a>=3.14,"},
 
             //Boolean
-            {BUG_ID + "/pkg1/B.html",
+            { "pkg1/B.html",
                 "<a href=\"../pkg1/A.html#b--\">b</a>=true,"},
 
             //String
-            {BUG_ID + "/pkg1/B.html",
+            { "pkg1/B.html",
                 "<a href=\"../pkg1/A.html#s--\">s</a>=\"sigh\","},
 
             //Class
-            {BUG_ID + "/pkg1/B.html",
+            { "pkg1/B.html",
                 "<a href=\"../pkg1/A.html#c--\">c</a>=<a href=\"../pkg2/Foo.html\" title=\"class in pkg2\">Foo.class</a>,"},
 
             //Bounded Class
-            {BUG_ID + "/pkg1/B.html",
+            { "pkg1/B.html",
                 "<a href=\"../pkg1/A.html#w--\">w</a>=<a href=\"../pkg/TypeParameterSubClass.html\" title=\"class in pkg\">TypeParameterSubClass.class</a>,"},
 
             //Enum
-            {BUG_ID + "/pkg1/B.html",
+            { "pkg1/B.html",
                 "<a href=\"../pkg1/A.html#e--\">e</a>=<a href=\"../pkg/Coin.html#Penny\">Penny</a>,"},
 
             //Annotation Type
-            {BUG_ID + "/pkg1/B.html",
+            { "pkg1/B.html",
                 "<a href=\"../pkg1/A.html#a--\">a</a>=<a href=\"../pkg/AnnotationType.html\" title=\"annotation in pkg\">@AnnotationType</a>(<a href=\"../pkg/AnnotationType.html#optional--\">optional</a>=\"foo\",<a href=\"../pkg/AnnotationType.html#required--\">required</a>=1994),"},
 
             //String Array
-            {BUG_ID + "/pkg1/B.html",
+            { "pkg1/B.html",
                 "<a href=\"../pkg1/A.html#sa--\">sa</a>={\"up\",\"down\"},"},
 
             //Primitive
-            {BUG_ID + "/pkg1/B.html",
+            { "pkg1/B.html",
                 "<a href=\"../pkg1/A.html#primitiveClassTest--\">primitiveClassTest</a>=boolean.class,"},
 
             //XXX:  Add array test case after this if fixed:
             //5020899: Incorrect internal representation of class-valued annotation elements
 
             //Make sure that annotations are surrounded by <pre> and </pre>
-            {BUG_ID + "/pkg1/B.html",
+            { "pkg1/B.html",
                 "<pre><a href=\"../pkg1/A.html\" title=\"annotation in pkg1\">@A</a>"},
-            {BUG_ID + "/pkg1/B.html",
+            { "pkg1/B.html",
                 "public interface <span class=\"typeNameLabel\">B</span></pre>"},
 
 
             //==============================================================
             // Handle multiple bounds.
             //==============================================================
-            {BUG_ID + "/pkg/MultiTypeParameters.html",
+            { "pkg/MultiTypeParameters.html",
                 "public&nbsp;&lt;T extends java.lang.Number &amp; java.lang.Runnable&gt;&nbsp;T&nbsp;foo(T&nbsp;t)"},
 
             //==============================================================
@@ -339,79 +335,79 @@
             //==============================================================
 
             //ClassUseTest1: <T extends Foo & Foo2>
-            {BUG_ID + "/pkg2/class-use/Foo.html",
+            { "pkg2/class-use/Foo.html",
                      "<caption><span>Classes in <a href=\"../../pkg2/" +
                      "package-summary.html\">pkg2</a> with type parameters of " +
                      "type <a href=\"../../pkg2/Foo.html\" title=\"class in pkg2\">" +
                      "Foo</a></span><span class=\"tabEnd\">&nbsp;</span></caption>"
             },
-            {BUG_ID + "/pkg2/class-use/Foo.html",
+            { "pkg2/class-use/Foo.html",
                      "<td class=\"colLast\"><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest1.html\" " +
                      "title=\"class in pkg2\">ClassUseTest1</a>&lt;T extends " +
                      "<a href=\"../../pkg2/Foo.html\" title=\"class in pkg2\">Foo" +
                      "</a> &amp; <a href=\"../../pkg2/Foo2.html\" title=\"interface in pkg2\">" +
                      "Foo2</a>&gt;</span></code>&nbsp;</td>"
             },
-            {BUG_ID + "/pkg2/class-use/Foo.html",
+            { "pkg2/class-use/Foo.html",
                      "<caption><span>Methods in <a href=\"../../pkg2/" +
                      "package-summary.html\">pkg2</a> with type parameters of " +
                      "type <a href=\"../../pkg2/Foo.html\" title=\"class in " +
                      "pkg2\">Foo</a></span><span class=\"tabEnd\">&nbsp;</span></caption>"
             },
-            {BUG_ID + "/pkg2/class-use/Foo.html",
+            { "pkg2/class-use/Foo.html",
                      "<td class=\"colLast\"><span class=\"typeNameLabel\">ClassUseTest1." +
                      "</span><code><span class=\"memberNameLink\"><a href=\"../../pkg2/" +
                      "ClassUseTest1.html#method-T-\">method</a></span>" +
                      "(T&nbsp;t)</code>&nbsp;</td>"
             },
-            {BUG_ID + "/pkg2/class-use/Foo.html",
+            { "pkg2/class-use/Foo.html",
                      "<caption><span>Fields in <a href=\"../../pkg2/" +
                      "package-summary.html\">pkg2</a> with type parameters of " +
                      "type <a href=\"../../pkg2/Foo.html\" title=\"class in pkg2\">" +
                      "Foo</a></span><span class=\"tabEnd\">&nbsp;</span></caption>"
             },
-            {BUG_ID + "/pkg2/class-use/Foo.html",
+            { "pkg2/class-use/Foo.html",
                      "td class=\"colFirst\"><code><a href=\"../../pkg2/" +
                      "ParamTest.html\" title=\"class in pkg2\">ParamTest</a>" +
                      "&lt;<a href=\"../../pkg2/Foo.html\" title=\"class in pkg2\"" +
                      ">Foo</a>&gt;</code></td>"
             },
 
-            {BUG_ID + "/pkg2/class-use/ParamTest.html",
+            { "pkg2/class-use/ParamTest.html",
                      "<caption><span>Fields in <a href=\"../../pkg2/" +
                      "package-summary.html\">pkg2</a> declared as <a href=\"../" +
                      "../pkg2/ParamTest.html\" title=\"class in pkg2\">ParamTest" +
                      "</a></span><span class=\"tabEnd\">&nbsp;</span></caption>"
             },
-            {BUG_ID + "/pkg2/class-use/ParamTest.html",
+            { "pkg2/class-use/ParamTest.html",
                      "<td class=\"colFirst\"><code><a href=\"../../pkg2/" +
                      "ParamTest.html\" title=\"class in pkg2\">ParamTest</a>&lt;<a " +
                      "href=\"../../pkg2/Foo.html\" title=\"class in pkg2\">Foo</a" +
                      ">&gt;</code></td>"
             },
 
-           {BUG_ID + "/pkg2/class-use/Foo2.html",
+           { "pkg2/class-use/Foo2.html",
                     "<caption><span>Classes in <a href=\"../../pkg2/" +
                     "package-summary.html\">pkg2</a> with type parameters of " +
                     "type <a href=\"../../pkg2/Foo2.html\" title=\"interface " +
                     "in pkg2\">Foo2</a></span><span class=\"tabEnd\">&nbsp;" +
                     "</span></caption>"
            },
-           {BUG_ID + "/pkg2/class-use/Foo2.html",
+           { "pkg2/class-use/Foo2.html",
                     "<td class=\"colLast\"><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest1.html\" " +
                      "title=\"class in pkg2\">ClassUseTest1</a>&lt;T extends " +
                      "<a href=\"../../pkg2/Foo.html\" title=\"class in pkg2\">Foo" +
                      "</a> &amp; <a href=\"../../pkg2/Foo2.html\" title=\"interface in pkg2\">" +
                      "Foo2</a>&gt;</span></code>&nbsp;</td>"
            },
-           {BUG_ID + "/pkg2/class-use/Foo2.html",
+           { "pkg2/class-use/Foo2.html",
                     "<caption><span>Methods in <a href=\"../../pkg2/" +
                     "package-summary.html\">pkg2</a> with type parameters of " +
                     "type <a href=\"../../pkg2/Foo2.html\" title=\"interface " +
                     "in pkg2\">Foo2</a></span><span class=\"tabEnd\">&nbsp;" +
                     "</span></caption>"
             },
-            {BUG_ID + "/pkg2/class-use/Foo2.html",
+            { "pkg2/class-use/Foo2.html",
                      "<td class=\"colLast\"><span class=\"typeNameLabel\">" +
                      "ClassUseTest1.</span><code><span class=\"memberNameLink\"><a href=\"../../" +
                      "pkg2/ClassUseTest1.html#method-T-\">method</a></span>" +
@@ -419,53 +415,53 @@
             },
 
             //ClassUseTest2: <T extends ParamTest<Foo3>>
-            {BUG_ID + "/pkg2/class-use/ParamTest.html",
+            { "pkg2/class-use/ParamTest.html",
                      "<caption><span>Classes in <a href=\"../../pkg2/" +
                      "package-summary.html\">pkg2</a> with type parameters of " +
                      "type <a href=\"../../pkg2/ParamTest.html\" title=\"class " +
                      "in pkg2\">ParamTest</a></span><span class=\"tabEnd\">" +
                      "&nbsp;</span></caption>"
             },
-            {BUG_ID + "/pkg2/class-use/ParamTest.html",
+            { "pkg2/class-use/ParamTest.html",
                      "<td class=\"colLast\"><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest2.html\" " +
                      "title=\"class in pkg2\">ClassUseTest2</a>&lt;T extends " +
                      "<a href=\"../../pkg2/ParamTest.html\" title=\"class in pkg2\">" +
                      "ParamTest</a>&lt;<a href=\"../../pkg2/Foo3.html\" title=\"class in pkg2\">" +
                      "Foo3</a>&gt;&gt;</span></code>&nbsp;</td>"
             },
-            {BUG_ID + "/pkg2/class-use/ParamTest.html",
+            { "pkg2/class-use/ParamTest.html",
                      "<caption><span>Methods in <a href=\"../../pkg2/" +
                      "package-summary.html\">pkg2</a> with type parameters of " +
                      "type <a href=\"../../pkg2/ParamTest.html\" title=\"class " +
                      "in pkg2\">ParamTest</a></span><span class=\"tabEnd\">" +
                      "&nbsp;</span></caption>"
             },
-            {BUG_ID + "/pkg2/class-use/ParamTest.html",
+            { "pkg2/class-use/ParamTest.html",
                      "<td class=\"colLast\"><span class=\"typeNameLabel\">ClassUseTest2." +
                      "</span><code><span class=\"memberNameLink\"><a href=\"../../pkg2/" +
                      "ClassUseTest2.html#method-T-\">method</a></span>" +
                      "(T&nbsp;t)</code>&nbsp;</td>"
             },
-            {BUG_ID + "/pkg2/class-use/ParamTest.html",
+            { "pkg2/class-use/ParamTest.html",
                      "<caption><span>Fields in <a href=\"../../pkg2/" +
                      "package-summary.html\">pkg2</a> declared as <a href=\"../" +
                      "../pkg2/ParamTest.html\" title=\"class in pkg2\">ParamTest" +
                      "</a></span><span class=\"tabEnd\">&nbsp;</span></caption>"
             },
-            {BUG_ID + "/pkg2/class-use/ParamTest.html",
+            { "pkg2/class-use/ParamTest.html",
                      "<td class=\"colFirst\"><code><a href=\"../../pkg2/" +
                      "ParamTest.html\" title=\"class in pkg2\">ParamTest</a>" +
                      "&lt;<a href=\"../../pkg2/Foo.html\" title=\"class in pkg2\">" +
                      "Foo</a>&gt;</code></td>"
             },
-            {BUG_ID + "/pkg2/class-use/ParamTest.html",
+            { "pkg2/class-use/ParamTest.html",
                      "<caption><span>Methods in <a href=\"../../pkg2/" +
                      "package-summary.html\">pkg2</a> with type parameters of " +
                      "type <a href=\"../../pkg2/ParamTest.html\" title=\"class " +
                      "in pkg2\">ParamTest</a></span><span class=\"tabEnd\">" +
                      "&nbsp;</span></caption>"
             },
-            {BUG_ID + "/pkg2/class-use/ParamTest.html",
+            { "pkg2/class-use/ParamTest.html",
                      "<td class=\"colFirst\"><code>&lt;T extends <a href=\"../" +
                      "../pkg2/ParamTest.html\" title=\"class in pkg2\">ParamTest" +
                      "</a>&lt;<a href=\"../../pkg2/Foo3.html\" title=\"class in " +
@@ -475,40 +471,40 @@
                      "pkg2\">Foo3</a>&gt;</code></td>"
             },
 
-            {BUG_ID + "/pkg2/class-use/Foo3.html",
+            { "pkg2/class-use/Foo3.html",
                      "<caption><span>Classes in <a href=\"../../pkg2/" +
                      "package-summary.html\">pkg2</a> with type parameters of " +
                      "type <a href=\"../../pkg2/Foo3.html\" title=\"class in pkg2\">" +
                      "Foo3</a></span><span class=\"tabEnd\">&nbsp;</span></caption>"
             },
-            {BUG_ID + "/pkg2/class-use/Foo3.html",
+            { "pkg2/class-use/Foo3.html",
                      "<td class=\"colLast\"><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest2.html\" " +
                      "title=\"class in pkg2\">ClassUseTest2</a>&lt;T extends " +
                      "<a href=\"../../pkg2/ParamTest.html\" title=\"class in pkg2\">" +
                      "ParamTest</a>&lt;<a href=\"../../pkg2/Foo3.html\" title=\"class in pkg2\">" +
                      "Foo3</a>&gt;&gt;</span></code>&nbsp;</td>"
             },
-            {BUG_ID + "/pkg2/class-use/Foo3.html",
+            { "pkg2/class-use/Foo3.html",
                      "<caption><span>Methods in <a href=\"../../pkg2/" +
                      "package-summary.html\">pkg2</a> with type parameters of " +
                      "type <a href=\"../../pkg2/Foo3.html\" title=\"class in " +
                      "pkg2\">Foo3</a></span><span class=\"tabEnd\">&nbsp;" +
                      "</span></caption>"
             },
-            {BUG_ID + "/pkg2/class-use/Foo3.html",
+            { "pkg2/class-use/Foo3.html",
                      "<td class=\"colLast\"><span class=\"typeNameLabel\">ClassUseTest2." +
                      "</span><code><span class=\"memberNameLink\"><a href=\"../../pkg2/" +
                      "ClassUseTest2.html#method-T-\">method</a></span>" +
                      "(T&nbsp;t)</code>&nbsp;</td>"
             },
-            {BUG_ID + "/pkg2/class-use/Foo3.html",
+            { "pkg2/class-use/Foo3.html",
                      "<caption><span>Methods in <a href=\"../../pkg2/" +
                      "package-summary.html\">pkg2</a> that return types with " +
                      "arguments of type <a href=\"../../pkg2/Foo3.html\" title" +
                      "=\"class in pkg2\">Foo3</a></span><span class=\"tabEnd\">" +
                      "&nbsp;</span></caption>"
             },
-            {BUG_ID + "/pkg2/class-use/Foo3.html",
+            { "pkg2/class-use/Foo3.html",
                      "<td class=\"colFirst\"><code>&lt;T extends <a href=\"../../" +
                      "pkg2/ParamTest.html\" title=\"class in pkg2\">ParamTest</a>&lt;" +
                      "<a href=\"../../pkg2/Foo3.html\" title=\"class in pkg2\">Foo3" +
@@ -518,14 +514,14 @@
             },
 
             //ClassUseTest3: <T extends ParamTest2<List<? extends Foo4>>>
-            {BUG_ID + "/pkg2/class-use/ParamTest2.html",
+            { "pkg2/class-use/ParamTest2.html",
                      "<caption><span>Classes in <a href=\"../../pkg2/" +
                      "package-summary.html\">pkg2</a> with type parameters of " +
                      "type <a href=\"../../pkg2/ParamTest2.html\" title=\"class " +
                      "in pkg2\">ParamTest2</a></span><span class=\"tabEnd\">" +
                      "&nbsp;</span></caption>"
             },
-            {BUG_ID + "/pkg2/class-use/ParamTest2.html",
+            { "pkg2/class-use/ParamTest2.html",
                      "<td class=\"colLast\"><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest3.html\" " +
                      "title=\"class in pkg2\">ClassUseTest3</a>&lt;T extends " +
                      "<a href=\"../../pkg2/ParamTest2.html\" title=\"class in pkg2\">" +
@@ -533,19 +529,19 @@
                      "<a href=\"../../pkg2/Foo4.html\" title=\"class in pkg2\">" +
                      "Foo4</a>&gt;&gt;&gt;</span></code>&nbsp;</td>"
             },
-            {BUG_ID + "/pkg2/class-use/ParamTest2.html",
+            { "pkg2/class-use/ParamTest2.html",
                      "<caption><span>Methods in <a href=\"../../pkg2/" +
                      "package-summary.html\">pkg2</a> with type parameters of " +
                      "type <a href=\"../../pkg2/ParamTest2.html\" title=\"class " +
                      "in pkg2\">ParamTest2</a></span><span class=\"tabEnd\">" +
                      "&nbsp;</span></caption>"
             },
-            {BUG_ID + "/pkg2/class-use/ParamTest2.html",
+            { "pkg2/class-use/ParamTest2.html",
                      "<td class=\"colLast\"><span class=\"typeNameLabel\">ClassUseTest3" +
                      ".</span><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest3." +
                      "html#method-T-\">method</a></span>(T&nbsp;t)</code>&nbsp;</td>"
             },
-            {BUG_ID + "/pkg2/class-use/ParamTest2.html",
+            { "pkg2/class-use/ParamTest2.html",
                      "<td class=\"colFirst\"><code>&lt;T extends <a href=\"../" +
                      "../pkg2/ParamTest2.html\" title=\"class in pkg2\">" +
                      "ParamTest2</a>&lt;java.util.List&lt;? extends <a href=\".." +
@@ -556,14 +552,14 @@
                      "class in pkg2\">Foo4</a>&gt;&gt;</code></td>"
             },
 
-            {BUG_ID + "/pkg2/class-use/Foo4.html",
+            { "pkg2/class-use/Foo4.html",
                      "<caption><span>Classes in <a href=\"../../pkg2/" +
                      "package-summary.html\">pkg2</a> with type parameters of " +
                      "type <a href=\"../../pkg2/Foo4.html\" title=\"class in " +
                      "pkg2\">Foo4</a></span><span class=\"tabEnd\">&nbsp;" +
                      "</span></caption>"
             },
-            {BUG_ID + "/pkg2/class-use/Foo4.html",
+            { "pkg2/class-use/Foo4.html",
                      "<td class=\"colLast\"><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest3.html\" " +
                      "title=\"class in pkg2\">ClassUseTest3</a>&lt;T extends " +
                      "<a href=\"../../pkg2/ParamTest2.html\" title=\"class in pkg2\">" +
@@ -571,26 +567,26 @@
                      "<a href=\"../../pkg2/Foo4.html\" title=\"class in pkg2\">" +
                      "Foo4</a>&gt;&gt;&gt;</span></code>&nbsp;</td>"
             },
-            {BUG_ID + "/pkg2/class-use/Foo4.html",
+            { "pkg2/class-use/Foo4.html",
                      "<caption><span>Methods in <a href=\"../../pkg2/" +
                      "package-summary.html\">pkg2</a> with type parameters of " +
                      "type <a href=\"../../pkg2/Foo4.html\" title=\"class in " +
                      "pkg2\">Foo4</a></span><span class=\"tabEnd\">&nbsp;</span></caption>"
             },
-            {BUG_ID + "/pkg2/class-use/Foo4.html",
+            { "pkg2/class-use/Foo4.html",
                      "<td class=\"colLast\"><span class=\"typeNameLabel\">ClassUseTest3." +
                      "</span><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest3." +
                      "html#method-T-\">method</a></span>(T&nbsp;t)</code>" +
                      "&nbsp;</td>"
             },
-            {BUG_ID + "/pkg2/class-use/Foo4.html",
+            { "pkg2/class-use/Foo4.html",
                      "<caption><span>Methods in <a href=\"../../pkg2/" +
                      "package-summary.html\">pkg2</a> that return types with " +
                      "arguments of type <a href=\"../../pkg2/Foo4.html\" " +
                      "title=\"class in pkg2\">Foo4</a></span><span class=\"" +
                      "tabEnd\">&nbsp;</span></caption>"
             },
-            {BUG_ID + "/pkg2/class-use/Foo4.html",
+            { "pkg2/class-use/Foo4.html",
                      "<td class=\"colFirst\"><code>&lt;T extends <a href=\"../" +
                      "../pkg2/ParamTest2.html\" title=\"class in pkg2\">" +
                      "ParamTest2</a>&lt;java.util.List&lt;? extends <a href=\".." +
@@ -602,7 +598,7 @@
             },
 
             //Type parameters in constructor and method args
-            {BUG_ID + "/pkg2/class-use/Foo4.html",
+            { "pkg2/class-use/Foo4.html",
                      "<caption><span>Method parameters in <a href=\"../../pkg2/" +
                      "package-summary.html\">pkg2</a> with type arguments of " +
                      "type <a href=\"../../pkg2/Foo4.html\" title=\"class in " +
@@ -623,7 +619,7 @@
                      "</tr>\n" +
                      "</tbody>"
             },
-            {BUG_ID + "/pkg2/class-use/Foo4.html",
+            { "pkg2/class-use/Foo4.html",
                      "<caption><span>Constructor parameters in <a href=\"../../" +
                      "pkg2/package-summary.html\">pkg2</a> with type arguments " +
                      "of type <a href=\"../../pkg2/Foo4.html\" title=\"class in " +
@@ -634,14 +630,14 @@
             //=================================
             // Annotatation Type Usage
             //=================================
-            {BUG_ID + "/pkg/class-use/AnnotationType.html",
+            { "pkg/class-use/AnnotationType.html",
                      "<caption><span>Packages with annotations of type <a href=\"" +
                      "../../pkg/AnnotationType.html\" title=\"annotation in pkg\">" +
                      "AnnotationType</a></span><span class=\"tabEnd\">&nbsp;" +
                      "</span></caption>"
             },
 
-            {BUG_ID + "/pkg/class-use/AnnotationType.html",
+            { "pkg/class-use/AnnotationType.html",
                      "<caption><span>Classes in <a href=\"../../pkg/" +
                      "package-summary.html\">pkg</a> with annotations of type " +
                      "<a href=\"../../pkg/AnnotationType.html\" title=\"" +
@@ -649,7 +645,7 @@
                      "=\"tabEnd\">&nbsp;</span></caption>"
             },
 
-            {BUG_ID + "/pkg/class-use/AnnotationType.html",
+            { "pkg/class-use/AnnotationType.html",
                      "<caption><span>Fields in <a href=\"../../pkg/" +
                      "package-summary.html\">pkg</a> with annotations of type " +
                      "<a href=\"../../pkg/AnnotationType.html\" title=\"annotation " +
@@ -657,7 +653,7 @@
                      "&nbsp;</span></caption>"
             },
 
-            {BUG_ID + "/pkg/class-use/AnnotationType.html",
+            { "pkg/class-use/AnnotationType.html",
                      "<caption><span>Methods in <a href=\"../../pkg/" +
                      "package-summary.html\">pkg</a> with annotations of type " +
                      "<a href=\"../../pkg/AnnotationType.html\" title=\"annotation " +
@@ -665,7 +661,7 @@
                      "&nbsp;</span></caption>"
             },
 
-            {BUG_ID + "/pkg/class-use/AnnotationType.html",
+            { "pkg/class-use/AnnotationType.html",
                      "<caption><span>Method parameters in <a href=\"../../pkg/" +
                      "package-summary.html\">pkg</a> with annotations of type " +
                      "<a href=\"../../pkg/AnnotationType.html\" title=\"annotation " +
@@ -673,7 +669,7 @@
                      "&nbsp;</span></caption>"
             },
 
-            {BUG_ID + "/pkg/class-use/AnnotationType.html",
+            { "pkg/class-use/AnnotationType.html",
                      "<caption><span>Constructors in <a href=\"../../pkg/" +
                      "package-summary.html\">pkg</a> with annotations of type " +
                      "<a href=\"../../pkg/AnnotationType.html\" title=\"annotation " +
@@ -681,7 +677,7 @@
                      "&nbsp;</span></caption>"
             },
 
-            {BUG_ID + "/pkg/class-use/AnnotationType.html",
+            { "pkg/class-use/AnnotationType.html",
                      "<caption><span>Constructor parameters in <a href=\"../../" +
                      "pkg/package-summary.html\">pkg</a> with annotations of " +
                      "type <a href=\"../../pkg/AnnotationType.html\" title=\"" +
@@ -692,14 +688,14 @@
             //=================================
             // TYPE PARAMETER IN INDEX
             //=================================
-            {BUG_ID + "/index-all.html",
+            { "index-all.html",
                 "<span class=\"memberNameLink\"><a href=\"pkg2/Foo.html#method-java.util.Vector-\">" +
                 "method(Vector&lt;Object&gt;)</a></span>"
             },
             //=================================
             // TYPE PARAMETER IN INDEX
             //=================================
-            {BUG_ID + "/index-all.html",
+            { "index-all.html",
                 "<span class=\"memberNameLink\"><a href=\"pkg2/Foo.html#method-java.util.Vector-\">" +
                 "method(Vector&lt;Object&gt;)</a></span>"
             },
@@ -709,12 +705,12 @@
         // ENUM TESTING
         //=================================
         //NO constructor section
-        {BUG_ID + "/pkg/Coin.html", "<h3>Constructor Summary</h3>"},
+        { "pkg/Coin.html", "<h3>Constructor Summary</h3>"},
         //=================================
         // TYPE PARAMETER TESTING
         //=================================
         //No type parameters in class frame.
-        {BUG_ID + "/allclasses-frame.html",
+        { "allclasses-frame.html",
             "<a href=\"../pkg/TypeParameters.html\" title=\"class in pkg\">" +
                     "TypeParameters</a>&lt;<a href=\"../pkg/TypeParameters.html\" " +
                     "title=\"type parameter in TypeParameters\">E</a>&gt;"
@@ -725,25 +721,25 @@
         //===============================================================
 
         //CLASS
-        {BUG_ID + "/pkg/AnnotationTypeUsage.html",
+        { "pkg/AnnotationTypeUsage.html",
             "<a href=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</a>(<a href=\"../pkg/AnnotationType.html#optional\">optional</a>=\"Class Annotation\",\n" +
             "                <a href=\"../pkg/AnnotationType.html#required\">required</a>=1994)\n" +
             "public class <span class=\"typeNameLabel\">AnnotationTypeUsage</span></dt><dt>extends java.lang.Object</dt>"},
 
         //FIELD
-        {BUG_ID + "/pkg/AnnotationTypeUsage.html",
+        { "pkg/AnnotationTypeUsage.html",
             "<a href=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</a>(<a href=\"../pkg/AnnotationType.html#optional\">optional</a>=\"Field Annotation\",\n" +
             "                <a href=\"../pkg/AnnotationType.html#required\">required</a>=1994)\n" +
             "public int <span class=\"memberNameLabel\">field</span>"},
 
         //CONSTRUCTOR
-        {BUG_ID + "/pkg/AnnotationTypeUsage.html",
+        { "pkg/AnnotationTypeUsage.html",
             "<a href=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</a>(<a href=\"../pkg/AnnotationType.html#optional\">optional</a>=\"Constructor Annotation\",\n" +
             "                <a href=\"../pkg/AnnotationType.html#required\">required</a>=1994)\n" +
             "public <span class=\"typeNameLabel\">AnnotationTypeUsage</span>()"},
 
         //METHOD
-        {BUG_ID + "/pkg/AnnotationTypeUsage.html",
+        { "pkg/AnnotationTypeUsage.html",
             "<a href=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</a>(<a href=\"../pkg/AnnotationType.html#optional\">optional</a>=\"Method Annotation\",\n" +
             "                <a href=\"../pkg/AnnotationType.html#required\">required</a>=1994)\n" +
             "public void <span class=\"memberNameLabel\">method</span>()"},
@@ -763,21 +759,7 @@
      */
     public static void main(String[] args) {
         TestNewLanguageFeatures tester = new TestNewLanguageFeatures();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NEGATED_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testNoPackagesFile/TestNoPackagesFile.java b/langtools/test/com/sun/javadoc/testNoPackagesFile/TestNoPackagesFile.java
index ee6094b..aaefc7f 100644
--- a/langtools/test/com/sun/javadoc/testNoPackagesFile/TestNoPackagesFile.java
+++ b/langtools/test/com/sun/javadoc/testNoPackagesFile/TestNoPackagesFile.java
@@ -35,12 +35,9 @@
 
 public class TestNoPackagesFile extends JavadocTester {
 
-    //Test information.
-    private static final String BUG_ID = "4475679";
-
     //Javadoc arguments.
     private static final String[] ARGS = new String[] {
-        "-d", BUG_ID, "-sourcepath", SRC_DIR,
+        "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR,
         SRC_DIR + "/C.java"
     };
 
@@ -50,25 +47,11 @@
      */
     public static void main(String[] args) {
         TestNoPackagesFile tester = new TestNoPackagesFile();
-        run(tester, ARGS, NO_TEST, NO_TEST);
-        if ((new java.io.File(BUG_ID + "/packages.html")).exists()) {
+        tester.run(ARGS, NO_TEST, NO_TEST);
+        if ((new java.io.File(OUTPUT_DIR + "/packages.html")).exists()) {
             throw new Error("Test Fails: packages file should not be " +                "generated anymore.");
         } else {
             System.out.println("Test passes:  packages.html not found.");
         }
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testNonFrameWarning/TestNonFrameWarning.java b/langtools/test/com/sun/javadoc/testNonFrameWarning/TestNonFrameWarning.java
index c36d4fd..af25ad1 100644
--- a/langtools/test/com/sun/javadoc/testNonFrameWarning/TestNonFrameWarning.java
+++ b/langtools/test/com/sun/javadoc/testNonFrameWarning/TestNonFrameWarning.java
@@ -33,16 +33,15 @@
 
 public class TestNonFrameWarning extends JavadocTester {
 
-    private static final String BUG_ID = "7001086";
     private static final String[][] TEST = {
-        {BUG_ID + "/index.html",
+        { "index.html",
             "<p>This document is designed to be viewed using the frames feature. " +
             "If you see this message, you are using a non-frame-capable web client. " +
             "Link to <a href=\"pkg/package-summary.html\">Non-frame version</a>.</p>"
         }
     };
     private static final String[] ARGS = new String[]{
-        "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg"
+        "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg"
     };
 
     /**
@@ -51,21 +50,7 @@
      */
     public static void main(String[] args) {
         TestNonFrameWarning tester = new TestNonFrameWarning();
-        run(tester, ARGS, TEST, NO_TEST);
+        tester.run(ARGS, TEST, NO_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testNotifications/TestNotifications.java b/langtools/test/com/sun/javadoc/testNotifications/TestNotifications.java
index e2fb79d..613967b 100644
--- a/langtools/test/com/sun/javadoc/testNotifications/TestNotifications.java
+++ b/langtools/test/com/sun/javadoc/testNotifications/TestNotifications.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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,12 +36,9 @@
 
 public class TestNotifications extends JavadocTester {
 
-    //Test information.
-    private static final String BUG_ID = "4657239";
-
     //Javadoc arguments.
     private static final String[] ARGS = new String[] {
-        "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg"
+        "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg"
     };
 
     private static final String[] ARGS2 = new String[] {
@@ -50,10 +47,10 @@
 
     //Input for string search tests.
     private static final String[][] TEST = {
-        {NOTICE_OUTPUT, "Creating destination directory: \"4657239"}
+        {NOTICE_OUTPUT, "Creating destination directory: \"" + OUTPUT_DIR}
     };
     private static final String[][] NEGATED_TEST = {
-        {NOTICE_OUTPUT, "Creating destination directory: \"4657239"}
+        {NOTICE_OUTPUT, "Creating destination directory: \"" + OUTPUT_DIR}
     };
 
     private static final String[][] NEGATED_TEST2 = {
@@ -67,26 +64,12 @@
     public static void main(String[] args) {
         TestNotifications tester = new TestNotifications();
         // Notify that the destination directory must be created.
-        run(tester, ARGS, TEST, NO_TEST);
+        tester.run(ARGS, TEST, NO_TEST);
         // No need to notify that the destination must be created because
         // it already exists.
-        run(tester, ARGS, NO_TEST, NEGATED_TEST);
+        tester.run(ARGS, NO_TEST, NEGATED_TEST);
         //Make sure classname is not include in javadoc usage message.
-        run(tester, ARGS2, NO_TEST, NEGATED_TEST2);
+        tester.run(ARGS2, NO_TEST, NEGATED_TEST2);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testOptions/TestOptions.java b/langtools/test/com/sun/javadoc/testOptions/TestOptions.java
index 7dc6f5e..3a8ecbc 100644
--- a/langtools/test/com/sun/javadoc/testOptions/TestOptions.java
+++ b/langtools/test/com/sun/javadoc/testOptions/TestOptions.java
@@ -33,46 +33,27 @@
 
 public class TestOptions extends JavadocTester {
 
-    //Test information.
-    private static final String BUG_ID = "4749567";
-
     //Javadoc arguments.
     private static final String[] ARGS = new String[] {
-        "-d", BUG_ID, "-header", "Test header", "-footer", "Test footer",
+        "-d", OUTPUT_DIR, "-header", "Test header", "-footer", "Test footer",
         "-sourcepath", SRC_DIR, "pkg"
     };
 
     private static final String[][] TEST = {
-        {BUG_ID + "/pkg/package-summary.html",
+        { "pkg/package-summary.html",
             "<div class=\"aboutLanguage\">Test header</div>"},
-        {BUG_ID + "/pkg/package-summary.html",
+        { "pkg/package-summary.html",
             "<div class=\"aboutLanguage\">Test footer</div>"}
     };
 
-    private static final String[][] NEGATED_TEST = NO_TEST;
-
     /**
      * The entry point of the test.
      * @param args the array of command line arguments.
      */
     public static void main(String[] args) {
         TestOptions tester = new TestOptions();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NO_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
 
diff --git a/langtools/test/com/sun/javadoc/testOverridenMethods/TestMultiInheritence.java b/langtools/test/com/sun/javadoc/testOverridenMethods/TestMultiInheritence.java
index 6c43592..c38c09c 100644
--- a/langtools/test/com/sun/javadoc/testOverridenMethods/TestMultiInheritence.java
+++ b/langtools/test/com/sun/javadoc/testOverridenMethods/TestMultiInheritence.java
@@ -35,29 +35,26 @@
 
 public class TestMultiInheritence extends JavadocTester {
 
-    //Test information.
-    private static final String BUG_ID = "4933335";
-
     //Javadoc arguments.
     private static final String[] ARGS = new String[] {
-        "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg3"
+        "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg3"
     };
 
     //Method foo() is inherited from BOTH I2 and I3
     private static final String[][] TEST = {
-       {BUG_ID + "/pkg3/I1.html",
+       { "pkg3/I1.html",
         "Methods inherited from interface&nbsp;pkg3." +
                 "<a href=\"../pkg3/I2.html\" title=\"interface in pkg3\">" +
                 "I2</a>"},
-        {BUG_ID + "/pkg3/I1.html",
+        { "pkg3/I1.html",
         "Methods inherited from interface&nbsp;pkg3." +
                  "<a href=\"../pkg3/I3.html\" title=\"interface in pkg3\">" +
                  "I3</a>"},
-        {BUG_ID + "/pkg3/I0.html",
+        { "pkg3/I0.html",
         "Methods inherited from interface&nbsp;pkg3." +
                  "<a href=\"../pkg3/I2.html\" title=\"interface in pkg3\">" +
                  "I2</a>"},
-        {BUG_ID + "/pkg3/I0.html",
+        { "pkg3/I0.html",
         "Methods inherited from interface&nbsp;pkg3." +
                  "<a href=\"../pkg3/I3.html\" title=\"interface in pkg3\">" +
                  "I3</a>"},
@@ -66,11 +63,11 @@
     //Method foo() is NOT inherited from I4 because it is overriden by
     //I3.
     private static final String[][] NEGATED_TEST = {
-        {BUG_ID + "/pkg3/I1.html",
+        { "pkg3/I1.html",
         "Methods inherited from interface&nbsp;pkg3." +
                  "<a href=\"../pkg3/I4.html\" title=\"interface in pkg3\">" +
                  "I4</a>"},
-        {BUG_ID + "/pkg3/I0.html",
+        { "pkg3/I0.html",
         "Methods inherited from interface&nbsp;pkg3." +
                  "<a href=\"../pkg3/I4.html\" title=\"interface in pkg3\">" +
                  "I4</a>"},
@@ -82,21 +79,7 @@
      */
     public static void main(String[] args) {
         TestMultiInheritence tester = new TestMultiInheritence();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NEGATED_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenMethodDocCopy.java b/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenMethodDocCopy.java
index 96f0a9c..cd24cfa 100644
--- a/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenMethodDocCopy.java
+++ b/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenMethodDocCopy.java
@@ -35,23 +35,19 @@
 
 public class TestOverridenMethodDocCopy extends JavadocTester {
 
-    //Test information.
-    private static final String BUG_ID = "4368820";
-
     //Javadoc arguments.
     private static final String[] ARGS = new String[] {
-        "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg1", "pkg2"
+        "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg1", "pkg2"
     };
 
     //Input for string search tests.
     private static final String[][] TEST = {
-        {BUG_ID + "/pkg1/SubClass.html",
+        { "pkg1/SubClass.html",
             "<span class=\"descfrmTypeLabel\">Description copied from class:&nbsp;<code>" +
             "<a href=\"../pkg1/BaseClass.html#overridenMethodWithDocsToCopy--\">" +
             "BaseClass</a></code></span>"
         }
     };
-    private static final String[][] NEGATED_TEST = NO_TEST;
 
     /**
      * The entry point of the test.
@@ -59,21 +55,7 @@
      */
     public static void main(String[] args) {
         TestOverridenMethodDocCopy tester = new TestOverridenMethodDocCopy();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NO_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethods.java b/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethods.java
index 6d08634..71869cb 100644
--- a/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethods.java
+++ b/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethods.java
@@ -35,16 +35,14 @@
 
 public class TestOverridenPrivateMethods extends JavadocTester {
 
-    private static final String BUG_ID = "4634891";
-
     private static final String[][] TEST = {
         //The public method should be overriden
-        {BUG_ID + "/pkg1/SubClass.html",
+        { "pkg1/SubClass.html",
          "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" +
                  "<dd><code><a href=\"../pkg1/BaseClass.html#publicMethod"},
 
         //The public method in different package should be overriden
-        {BUG_ID + "/pkg2/SubClass.html",
+        { "pkg2/SubClass.html",
          "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" +
                  "<dd><code><a href=\"../pkg1/BaseClass.html#publicMethod"}
     };
@@ -53,29 +51,29 @@
 
         //The package private method should be overriden since the base and sub class are in the same
         //package.  However, the link should not show up because the package private methods are not documented.
-        {BUG_ID + "/pkg1/SubClass.html",
+        { "pkg1/SubClass.html",
          "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" +
                  "<dd><code><a href=\"../pkg1/BaseClass.html#packagePrivateMethod"},
 
         //The private method in should not be overriden
-        {BUG_ID + "/pkg1/SubClass.html",
+        { "pkg1/SubClass.html",
          "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" +
                  "<dd><code><a href=\"../pkg1/BaseClass.html#privateMethod"},
 
         //The private method in different package should not be overriden
-        {BUG_ID + "/pkg2/SubClass.html",
+        { "pkg2/SubClass.html",
          "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" +
                  "<dd><code><a href=\"../pkg1/BaseClass.html#privateMethod"},
 
         //The package private method should not be overriden since the base and sub class are in
         //different packages.
-        {BUG_ID + "/pkg2/SubClass.html",
+        { "pkg2/SubClass.html",
          "Overrides:</span></dt><dd><code><a href=\"../pkg1/BaseClass.html#packagePrivateMethod"}
     };
 
     private static final String[] ARGS =
         new String[] {
-            "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg1", "pkg2"};
+            "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg1", "pkg2"};
 
     /**
      * The entry point of the test.
@@ -83,21 +81,7 @@
      */
     public static void main(String[] args) {
         TestOverridenPrivateMethods tester = new TestOverridenPrivateMethods();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NEGATED_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethodsWithPackageFlag.java b/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethodsWithPackageFlag.java
index ae256d9..e28a1dd 100644
--- a/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethodsWithPackageFlag.java
+++ b/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethodsWithPackageFlag.java
@@ -35,18 +35,16 @@
 
 public class TestOverridenPrivateMethodsWithPackageFlag extends JavadocTester {
 
-    private static final String BUG_ID = "4634891";
-
     private static final String[][] TEST = {
         //The public method should be overriden
-        {BUG_ID + "/pkg1/SubClass.html",
+        { "pkg1/SubClass.html",
          "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" +
                  "<dd><code><a href=\"../pkg1/BaseClass.html#publicMethod--\">" +
                  "publicMethod</a></code>&nbsp;in class&nbsp;<code>" +
                  "<a href=\"../pkg1/BaseClass.html\" title=\"class in pkg1\">BaseClass</a></code></dd>"},
 
         //The public method in different package should be overriden
-        {BUG_ID + "/pkg2/SubClass.html",
+        { "pkg2/SubClass.html",
          "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" +
                  "<dd><code><a href=\"../pkg1/BaseClass.html#publicMethod--\">" +
                  "publicMethod</a></code>&nbsp;in class&nbsp;<code>" +
@@ -54,7 +52,7 @@
 
         //The package private method should be overriden since the base and sub class are in the same
         //package.
-        {BUG_ID + "/pkg1/SubClass.html",
+        { "pkg1/SubClass.html",
          "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" +
                  "<dd><code><a href=\"../pkg1/BaseClass.html#packagePrivateMethod--\">" +
                  "packagePrivateMethod</a></code>&nbsp;in class&nbsp;<code>" +
@@ -64,25 +62,25 @@
     private static final String[][] NEGATED_TEST = {
 
         //The private method in should not be overriden
-        {BUG_ID + "/pkg1/SubClass.html",
+        { "pkg1/SubClass.html",
          "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" +
                  "<dd><code><a href=\"../pkg1/BaseClass.html#privateMethod()\">"},
 
         //The private method in different package should not be overriden
-        {BUG_ID + "/pkg2/SubClass.html",
+        { "pkg2/SubClass.html",
          "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" +
                  "<dd><code><a href=\"../pkg1/BaseClass.html#privateMethod()\">"},
 
         //The package private method should not be overriden since the base and sub class are in
         //different packages.
-        {BUG_ID + "/pkg2/SubClass.html",
+        { "pkg2/SubClass.html",
          "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" +
                  "<dd><code><a href=\"../pkg1/BaseClass.html#packagePrivateMethod()\">"},
     };
 
     private static final String[] ARGS =
         new String[] {
-            "-d", BUG_ID, "-sourcepath", SRC_DIR, "-package", "pkg1", "pkg2"};
+            "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "-package", "pkg1", "pkg2"};
 
     /**
      * The entry point of the test.
@@ -90,21 +88,7 @@
      */
     public static void main(String[] args) {
         TestOverridenPrivateMethodsWithPackageFlag tester = new TestOverridenPrivateMethodsWithPackageFlag();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NEGATED_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethodsWithPrivateFlag.java b/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethodsWithPrivateFlag.java
index 579f8a7..13739ce 100644
--- a/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethodsWithPrivateFlag.java
+++ b/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethodsWithPrivateFlag.java
@@ -35,22 +35,20 @@
 
 public class TestOverridenPrivateMethodsWithPrivateFlag extends JavadocTester {
 
-    private static final String BUG_ID = "4634891";
-
     private static final String[][] TEST = {
         //The public method should be overriden
-        {BUG_ID + "/pkg1/SubClass.html",
+        { "pkg1/SubClass.html",
          "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" +
                  "<dd><code><a href=\"../pkg1/BaseClass.html#publicMethod"},
 
         //The package private method should be overriden since the base and sub class are in the same
         //package.
-        {BUG_ID + "/pkg1/SubClass.html",
+        { "pkg1/SubClass.html",
          "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" +
                  "<dd><code><a href=\"../pkg1/BaseClass.html#packagePrivateMethod"},
 
         //The public method in different package should be overriden
-        {BUG_ID + "/pkg2/SubClass.html",
+        { "pkg2/SubClass.html",
          "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" +
                  "<dd><code><a href=\"../pkg1/BaseClass.html#publicMethod"},
     };
@@ -58,18 +56,18 @@
     private static final String[][] NEGATED_TEST = {
 
         //The private method in should not be overriden
-        {BUG_ID + "/pkg1/SubClass.html",
+        { "pkg1/SubClass.html",
          "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" +
                  "<dd><code><a href=\"../pkg1/BaseClass.html#privateMethod"},
 
         //The private method in different package should not be overriden
-        {BUG_ID + "/pkg2/SubClass.html",
+        { "pkg2/SubClass.html",
          "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" +
                  "<dd><code><a href=\"../pkg1/BaseClass.html#privateMethod"},
 
         //The package private method should not be overriden since the base and sub class are in
         //different packages.
-        {BUG_ID + "/pkg2/SubClass.html",
+        { "pkg2/SubClass.html",
          "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" +
                  "<dd><code><a href=\"../pkg1/BaseClass.html#packagePrivateMethod"}
 
@@ -78,7 +76,7 @@
 
     private static final String[] ARGS =
         new String[] {
-            "-d", BUG_ID, "-sourcepath", SRC_DIR, "-private", "pkg1", "pkg2"};
+            "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "-private", "pkg1", "pkg2"};
 
     /**
      * The entry point of the test.
@@ -86,21 +84,7 @@
      */
     public static void main(String[] args) {
         TestOverridenPrivateMethodsWithPrivateFlag tester = new TestOverridenPrivateMethodsWithPrivateFlag();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NEGATED_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testPackageDeprecation/TestPackageDeprecation.java b/langtools/test/com/sun/javadoc/testPackageDeprecation/TestPackageDeprecation.java
index ba0b7f8..6846685 100644
--- a/langtools/test/com/sun/javadoc/testPackageDeprecation/TestPackageDeprecation.java
+++ b/langtools/test/com/sun/javadoc/testPackageDeprecation/TestPackageDeprecation.java
@@ -33,35 +33,30 @@
 
 public class TestPackageDeprecation extends JavadocTester {
 
-    //Test information.
-    private static final String BUG_ID = "6492694";
-
     //Javadoc arguments.
     private static final String[] ARGS1 = new String[]{
-        "-d", BUG_ID + "-1", "-sourcepath", SRC_DIR, "-use", "pkg", "pkg1",
+        "-d", OUTPUT_DIR + "-1", "-sourcepath", SRC_DIR, "-use", "pkg", "pkg1",
         SRC_DIR + "/C2.java", SRC_DIR + "/FooDepr.java"
     };
     private static final String[] ARGS2 = new String[]{
-        "-d", BUG_ID + "-2", "-sourcepath", SRC_DIR, "-use", "-nodeprecated",
+        "-d", OUTPUT_DIR + "-2", "-sourcepath", SRC_DIR, "-use", "-nodeprecated",
         "pkg", "pkg1", SRC_DIR + "/C2.java", SRC_DIR + "/FooDepr.java"
     };
 
     //Input for string search tests.
     private static final String[][] TEST1 = {
-        {BUG_ID + "-1/pkg1/package-summary.html",
+        { "pkg1/package-summary.html",
             "<div class=\"deprecatedContent\"><span class=\"deprecatedLabel\">Deprecated.</span>\n" +
             "<div class=\"block\"><span class=\"deprecationComment\">This package is Deprecated." +
             "</span></div>"
         },
-        {BUG_ID + "-1/deprecated-list.html",
+        { "deprecated-list.html",
             "<li><a href=\"#package\">Deprecated Packages</a></li>"
         }
     };
-    private static final String[][] TEST2 = NO_TEST;
-    private static final String[][] NEGATED_TEST1 = NO_TEST;
     private static final String[][] NEGATED_TEST2 = {
-        {BUG_ID + "-2/overview-summary.html", "pkg1"},
-        {BUG_ID + "-2/allclasses-frame.html", "FooDepr"}
+        { "overview-summary.html", "pkg1"},
+        { "allclasses-frame.html", "FooDepr"}
     };
 
     /**
@@ -70,16 +65,16 @@
      */
     public static void main(String[] args) {
         TestPackageDeprecation tester = new TestPackageDeprecation();
-        run(tester, ARGS1, TEST1, NEGATED_TEST1);
-        run(tester, ARGS2, TEST2, NEGATED_TEST2);
-        if ((new java.io.File(BUG_ID + "-2/pkg1/" +
+        tester.run(ARGS1, TEST1, NO_TEST);
+        tester.run(ARGS2, NO_TEST, NEGATED_TEST2);
+        if ((new java.io.File(OUTPUT_DIR + "-2/pkg1/" +
                 "package-summary.html")).exists()) {
             throw new Error("Test Fails: packages summary should not be" +
                     "generated for deprecated package.");
         } else {
             System.out.println("Test passes:  package-summary.html not found.");
         }
-        if ((new java.io.File(BUG_ID + "-2/FooDepr.html")).exists()) {
+        if ((new java.io.File(OUTPUT_DIR + "-2/FooDepr.html")).exists()) {
             throw new Error("Test Fails: FooDepr should not be" +
                     "generated as it is deprecated.");
         } else {
@@ -87,18 +82,4 @@
         }
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testPackagePage/TestPackagePage.java b/langtools/test/com/sun/javadoc/testPackagePage/TestPackagePage.java
index 9c09c49..dae5022 100644
--- a/langtools/test/com/sun/javadoc/testPackagePage/TestPackagePage.java
+++ b/langtools/test/com/sun/javadoc/testPackagePage/TestPackagePage.java
@@ -36,51 +36,50 @@
 
 public class TestPackagePage extends JavadocTester {
 
-    private static final String BUG_ID = "4492643-4689286";
     private static final String[][] TEST1 = {
-        {BUG_ID + "-1/com/pkg/package-summary.html",
+        { "com/pkg/package-summary.html",
             "This is a package page."
         },
         //With just one package, all general pages link to the single package page.
-        {BUG_ID + "-1/com/pkg/C.html",
+        { "com/pkg/C.html",
             "<a href=\"../../com/pkg/package-summary.html\">Package</a>"
         },
-        {BUG_ID + "-1/com/pkg/package-tree.html",
+        { "com/pkg/package-tree.html",
             "<li><a href=\"../../com/pkg/package-summary.html\">Package</a></li>"
         },
-        {BUG_ID + "-1/deprecated-list.html",
+        { "deprecated-list.html",
             "<li><a href=\"com/pkg/package-summary.html\">Package</a></li>"
         },
-        {BUG_ID + "-1/index-all.html",
+        { "index-all.html",
             "<li><a href=\"com/pkg/package-summary.html\">Package</a></li>"
         },
-        {BUG_ID + "-1/help-doc.html",
+        { "help-doc.html",
             "<li><a href=\"com/pkg/package-summary.html\">Package</a></li>"
         },
     };
 
     private static final String[][] TEST2 = {
         //With multiple packages, there is no package link in general pages.
-        {BUG_ID + "-2/deprecated-list.html",
+        { "deprecated-list.html",
             "<li>Package</li>"
         },
-        {BUG_ID + "-2/index-all.html",
+        { "index-all.html",
             "<li>Package</li>"
         },
-        {BUG_ID + "-2/help-doc.html",
+        { "help-doc.html",
             "<li>Package</li>"
         },
     };
 
     private static final String[] ARGS1 =
         new String[] {
-            "-d", BUG_ID + "-1", "-sourcepath", SRC_DIR,
+            "-d", OUTPUT_DIR + "-1", "-sourcepath", SRC_DIR,
             SRC_DIR + "/com/pkg/C.java"
         };
 
     private static final String[] ARGS2 =
         new String[] {
-            "-d", BUG_ID + "-2", "-sourcepath", SRC_DIR,
+            "-d", OUTPUT_DIR + "-2", "-sourcepath", SRC_DIR,
             "com.pkg", "pkg2"
         };
 
@@ -90,22 +89,8 @@
      */
     public static void main(String[] args) {
         TestPackagePage tester = new TestPackagePage();
-        run(tester, ARGS1, TEST1, NO_TEST);
-        run(tester, ARGS2, TEST2, NO_TEST);
+        tester.run(ARGS1, TEST1, NO_TEST);
+        tester.run(ARGS2, TEST2, NO_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testParamTaglet/TestParamTaglet.java b/langtools/test/com/sun/javadoc/testParamTaglet/TestParamTaglet.java
index 13c7670..91b9ef5 100644
--- a/langtools/test/com/sun/javadoc/testParamTaglet/TestParamTaglet.java
+++ b/langtools/test/com/sun/javadoc/testParamTaglet/TestParamTaglet.java
@@ -36,24 +36,21 @@
 
 public class TestParamTaglet extends JavadocTester {
 
-    //Test information.
-    private static final String BUG_ID = "4802275-4967243";
-
     //Javadoc arguments.
     private static final String[] ARGS = new String[] {
-        "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg"
+        "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg"
     };
 
     //Input for string search tests.
     private static final String[][] TEST = {
         //Regular param tags.
-        {BUG_ID + "/pkg/C.html",
+        { "pkg/C.html",
             "<span class=\"paramLabel\">Parameters:</span></dt>\n" +
             "<dd><code>param1</code> - testing 1 2 3.</dd>\n" +
                 "<dd><code>param2</code> - testing 1 2 3."
         },
         //Param tags that don't match with any real parameters.
-        {BUG_ID + "/pkg/C.html",
+        { "pkg/C.html",
             "<span class=\"paramLabel\">Parameters:</span></dt>\n" +
             "<dd><code><I>p1</I></code> - testing 1 2 3.</dd>\n" +
                 "<dd><code><I>p2</I></code> - testing 1 2 3."
@@ -62,12 +59,11 @@
         // Param is printed with nothing inherited.
         //XXX: in the future when Configuration is available during doc inheritence,
         //print a warning for this mistake.
-        {BUG_ID + "/pkg/C.html",
+        { "pkg/C.html",
             "<code><I>inheritBug</I></code> -"
         },
 
     };
-    private static final String[][] NEGATED_TEST = NO_TEST;
 
     /**
      * The entry point of the test.
@@ -75,21 +71,7 @@
      */
     public static void main(String[] args) {
         TestParamTaglet tester = new TestParamTaglet();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NO_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testPrivateClasses/TestPrivateClasses.java b/langtools/test/com/sun/javadoc/testPrivateClasses/TestPrivateClasses.java
index ccb7f18..3f50448 100644
--- a/langtools/test/com/sun/javadoc/testPrivateClasses/TestPrivateClasses.java
+++ b/langtools/test/com/sun/javadoc/testPrivateClasses/TestPrivateClasses.java
@@ -44,46 +44,43 @@
 
 public class TestPrivateClasses extends JavadocTester {
 
-    //Test information.
-    private static final String BUG_ID = "4780441-4874845-4978816-8014017";
-
     //Javadoc arguments.
     private static final String[] ARGS1 = new String[] {
-        "-d", BUG_ID + "-1", "-sourcepath", SRC_DIR, "pkg", "pkg2"
+        "-d", OUTPUT_DIR + "-1", "-sourcepath", SRC_DIR, "pkg", "pkg2"
     };
     private static final String[] ARGS2 = new String[] {
-        "-d", BUG_ID + "-2", "-sourcepath", SRC_DIR, "-private",
+        "-d", OUTPUT_DIR + "-2", "-sourcepath", SRC_DIR, "-private",
             "pkg", "pkg2"
     };
 
     // Test output when -private flag is not used.
     private static final String[][] TEST1 = {
         // Field inheritence from non-public superclass.
-        {BUG_ID + "-1/pkg/PublicChild.html",
+        { "pkg/PublicChild.html",
             "<a href=\"../pkg/PublicChild.html#fieldInheritedFromParent\">" +
                 "fieldInheritedFromParent</a>"
         },
 
         // Method inheritence from non-public superclass.
-        {BUG_ID + "-1/pkg/PublicChild.html",
+        { "pkg/PublicChild.html",
             "<a href=\"../pkg/PublicChild.html#methodInheritedFromParent-int-\">" +
                 "methodInheritedFromParent</a>"
         },
 
         // Field inheritence from non-public superinterface.
-        {BUG_ID + "-1/pkg/PublicInterface.html",
+        { "pkg/PublicInterface.html",
             "<a href=\"../pkg/PublicInterface.html#fieldInheritedFromInterface\">" +
                 "fieldInheritedFromInterface</a>"
         },
 
         // Method inheritence from non-public superinterface.
-        {BUG_ID + "-1/pkg/PublicInterface.html",
+        { "pkg/PublicInterface.html",
             "<a href=\"../pkg/PublicInterface.html#methodInterface-int-\">" +
                 "methodInterface</a>"
         },
 
         // private class does not show up in tree
-        {BUG_ID + "-1/pkg/PublicChild.html",
+        { "pkg/PublicChild.html",
             "<ul class=\"inheritance\">\n" +
             "<li>java.lang.Object</li>\n" +
             "<li>\n" +
@@ -95,19 +92,19 @@
         },
 
         // Method is documented as though it is declared in the inheriting method.
-        {BUG_ID + "-1/pkg/PublicChild.html",
+        { "pkg/PublicChild.html",
             "<pre>public&nbsp;void&nbsp;methodInheritedFromParent(int&nbsp;p1)"
         },
 
         //Make sure implemented interfaces from private superclass are inherited
-        {BUG_ID + "-1/pkg/PublicInterface.html",
+        { "pkg/PublicInterface.html",
             "<dl>\n" +
             "<dt>All Known Implementing Classes:</dt>\n" +
             "<dd><a href=\"../pkg/PublicChild.html\" title=\"class in pkg\">" +
             "PublicChild</a></dd>\n" +
             "</dl>"},
 
-        {BUG_ID + "-1/pkg/PublicChild.html",
+        { "pkg/PublicChild.html",
             "<dl>\n" +
             "<dt>All Implemented Interfaces:</dt>\n" +
             "<dd><a href=\"../pkg/PublicInterface.html\" title=\"interface in pkg\">" +
@@ -115,111 +112,111 @@
             "</dl>"},
 
         //Generic interface method test.
-        {BUG_ID + "-1/pkg2/C.html",
+        { "pkg2/C.html",
             "This comment should get copied to the implementing class"},
     };
     private static final String[][] NEGATED_TEST1 = {
        // Should not document that a method overrides method from private class.
-      {BUG_ID + "-1/pkg/PublicChild.html",
+      { "pkg/PublicChild.html",
         "<span class=\"overrideSpecifyLabel\">Overrides:</span>"},
       // Should not document that a method specified by private interface.
-      {BUG_ID + "-1/pkg/PublicChild.html",
+      { "pkg/PublicChild.html",
         "<span class=\"overrideSpecifyLabel\">Specified by:</span>"},
-      {BUG_ID + "-1/pkg/PublicInterface.html",
+      { "pkg/PublicInterface.html",
         "<span class=\"overrideSpecifyLabel\">Specified by:</span>"},
       // Should not mention that any documentation was copied.
-      {BUG_ID + "-1/pkg/PublicChild.html",
+      { "pkg/PublicChild.html",
         "Description copied from"},
-      {BUG_ID + "-1/pkg/PublicInterface.html",
+      { "pkg/PublicInterface.html",
         "Description copied from"},
       // Don't extend private classes or interfaces
-      {BUG_ID + "-1/pkg/PublicChild.html",
+      { "pkg/PublicChild.html",
         "PrivateParent"},
-      {BUG_ID + "-1/pkg/PublicInterface.html",
+      { "pkg/PublicInterface.html",
         "PrivateInterface"},
-      {BUG_ID + "-1/pkg/PublicChild.html",
+      { "pkg/PublicChild.html",
         "PrivateInterface"},
-      {BUG_ID + "-1/pkg/PublicInterface.html",
+      { "pkg/PublicInterface.html",
         "All Superinterfaces"},
       // Make inherited constant are documented correctly.
-      {BUG_ID + "-1/constant-values.html",
+      { "constant-values.html",
         "PrivateInterface"},
 
         //Do not inherit private interface method with generic parameters.
         //This method has been implemented.
-        {BUG_ID + "-1/pkg2/C.html",
+        { "pkg2/C.html",
             "<span class=\"memberNameLink\"><a href=\"../pkg2/I.html#hello-T-\">hello</a></span>"},
     };
 
     // Test output when -private flag is used.
     private static final String[][] TEST2 = {
         // Field inheritence from non-public superclass.
-        {BUG_ID + "-2/pkg/PublicChild.html",
+        { "pkg/PublicChild.html",
             "Fields inherited from class&nbsp;pkg." +
             "<a href=\"../pkg/PrivateParent.html\" title=\"class in pkg\">" +
             "PrivateParent</a>"
         },
-        {BUG_ID + "-2/pkg/PublicChild.html",
+        { "pkg/PublicChild.html",
             "<a href=\"../pkg/PrivateParent.html#fieldInheritedFromParent\">" +
                 "fieldInheritedFromParent</a>"
         },
         // Field inheritence from non-public superinterface.
-        {BUG_ID + "-2/pkg/PublicInterface.html",
+        { "pkg/PublicInterface.html",
             "Fields inherited from interface&nbsp;pkg." +
             "<a href=\"../pkg/PrivateInterface.html\" title=\"interface in pkg\">" +
             "PrivateInterface</a>"
         },
-        {BUG_ID + "-2/pkg/PublicInterface.html",
+        { "pkg/PublicInterface.html",
             "<a href=\"../pkg/PrivateInterface.html#fieldInheritedFromInterface\">" +
                 "fieldInheritedFromInterface</a>"
         },
         // Method inheritence from non-public superclass.
-        {BUG_ID + "-2/pkg/PublicChild.html",
+        { "pkg/PublicChild.html",
             "Methods inherited from class&nbsp;pkg." +
             "<a href=\"../pkg/PrivateParent.html\" title=\"class in pkg\">" +
             "PrivateParent</a>"
         },
-        {BUG_ID + "-2/pkg/PublicChild.html",
+        { "pkg/PublicChild.html",
             "<a href=\"../pkg/PrivateParent.html#methodInheritedFromParent-int-\">" +
                 "methodInheritedFromParent</a>"
         },
         // Should document that a method overrides method from private class.
-       {BUG_ID + "-2/pkg/PublicChild.html",
+       { "pkg/PublicChild.html",
             "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" +
             "<dd><code><a href=\"../pkg/PrivateParent.html#methodOverridenFromParent-char:A-int-T-V-java.util.List-\">" +
             "methodOverridenFromParent</a></code>&nbsp;in class&nbsp;<code>" +
             "<a href=\"../pkg/PrivateParent.html\" title=\"class in pkg\">" +
             "PrivateParent</a></code></dd>"},
        // Should document that a method is specified by private interface.
-       {BUG_ID + "-2/pkg/PublicChild.html",
+       { "pkg/PublicChild.html",
             "<dt><span class=\"overrideSpecifyLabel\">Specified by:</span></dt>\n" +
             "<dd><code><a href=\"../pkg/PrivateInterface.html#methodInterface-int-\">" +
             "methodInterface</a></code>&nbsp;in interface&nbsp;<code>" +
             "<a href=\"../pkg/PrivateInterface.html\" title=\"interface in pkg\">" +
             "PrivateInterface</a></code></dd>"},
        // Method inheritence from non-public superinterface.
-       {BUG_ID + "-2/pkg/PublicInterface.html",
+       { "pkg/PublicInterface.html",
             "Methods inherited from interface&nbsp;pkg." +
             "<a href=\"../pkg/PrivateInterface.html\" title=\"interface in pkg\">" +
             "PrivateInterface</a>"
         },
-        {BUG_ID + "-2/pkg/PrivateInterface.html",
+        { "pkg/PrivateInterface.html",
             "<a href=\"../pkg/PrivateInterface.html#methodInterface-int-\">" +
                 "methodInterface</a>"
         },
       // Should mention that any documentation was copied.
-      {BUG_ID + "-2/pkg/PublicChild.html",
+      { "pkg/PublicChild.html",
         "Description copied from"},
       // Extend documented private classes or interfaces
-      {BUG_ID + "-2/pkg/PublicChild.html",
+      { "pkg/PublicChild.html",
         "extends"},
-      {BUG_ID + "-2/pkg/PublicInterface.html",
+      { "pkg/PublicInterface.html",
         "extends"},
-      {BUG_ID + "-2/pkg/PublicInterface.html",
+      { "pkg/PublicInterface.html",
         "All Superinterfaces"},
 
       //Make sure implemented interfaces from private superclass are inherited
-      {BUG_ID + "-2/pkg/PublicInterface.html",
+      { "pkg/PublicInterface.html",
         "<dl>\n" +
         "<dt>All Known Implementing Classes:</dt>\n" +
         "<dd><a href=\"../pkg/PrivateParent.html\" title=\"class in pkg\">" +
@@ -228,7 +225,7 @@
         "</a></dd>\n" +
         "</dl>"},
 
-      {BUG_ID + "-2/pkg/PublicChild.html",
+      { "pkg/PublicChild.html",
         "<dl>\n" +
         "<dt>All Implemented Interfaces:</dt>\n" +
         "<dd><a href=\"../pkg/PrivateInterface.html\" title=\"interface in pkg\">" +
@@ -239,11 +236,11 @@
 
       //Since private flag is used, we can document that private interface method
       //with generic parameters has been implemented.
-      {BUG_ID + "-2/pkg2/C.html",
+      { "pkg2/C.html",
             "<span class=\"descfrmTypeLabel\">Description copied from interface:&nbsp;<code>" +
             "<a href=\"../pkg2/I.html#hello-T-\">I</a></code></span>"},
 
-      {BUG_ID + "-2/pkg2/C.html",
+      { "pkg2/C.html",
             "<dt><span class=\"overrideSpecifyLabel\">Specified by:</span></dt>\n" +
             "<dd><code><a href=\"../pkg2/I.html#hello-T-\">hello</a></code>" +
             "&nbsp;in interface&nbsp;<code>" +
@@ -252,14 +249,14 @@
 
       //Make sure when no modifier appear in the class signature, the
       //signature is displayed correctly without extra space at the beginning.
-      {BUG_ID + "-2/pkg/PrivateParent.html",
+      { "pkg/PrivateParent.html",
             "<pre>class <span class=\"typeNameLabel\">PrivateParent</span>"},
 
-      {BUG_ID + "-2/pkg/PublicChild.html",
+      { "pkg/PublicChild.html",
             "<pre>public class <span class=\"typeNameLabel\">PublicChild</span>"},
     };
     private static final String[][] NEGATED_TEST2 = {
-        {BUG_ID + "-2/pkg/PrivateParent.html",
+        { "pkg/PrivateParent.html",
             "<pre> class <span class=\"typeNameLabel\">PrivateParent</span>"},
     };
 
@@ -269,22 +266,8 @@
      */
     public static void main(String[] args) {
         TestPrivateClasses tester = new TestPrivateClasses();
-        run(tester, ARGS1, TEST1, NEGATED_TEST1);
-        run(tester, ARGS2, TEST2, NEGATED_TEST2);
+        tester.run(ARGS1, TEST1, NEGATED_TEST1);
+        tester.run(ARGS2, TEST2, NEGATED_TEST2);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testProfiles/TestProfiles.java b/langtools/test/com/sun/javadoc/testProfiles/TestProfiles.java
index cc0b3b8..ff24deb 100644
--- a/langtools/test/com/sun/javadoc/testProfiles/TestProfiles.java
+++ b/langtools/test/com/sun/javadoc/testProfiles/TestProfiles.java
@@ -33,60 +33,59 @@
 public class TestProfiles extends JavadocTester {
 
     //Test information.
-    private static final String BUG_ID = "8006124-8009684-8016921";
-    private static final String PROFILE_BUG_ID = BUG_ID + "-1";
-    private static final String PACKAGE_BUG_ID = BUG_ID + "-2";
+    private static final String PROFILE_OUTPUT_DIR = OUTPUT_DIR + "-1";
+    private static final String PACKAGE_OUTPUT_DIR = OUTPUT_DIR + "-2";
     //Javadoc arguments.
     private static final String[] ARGS1 = new String[]{
-        "-d", PROFILE_BUG_ID, "-sourcepath", SRC_DIR, "-Xprofilespath",
+        "-d", PROFILE_OUTPUT_DIR, "-sourcepath", SRC_DIR, "-Xprofilespath",
          SRC_DIR + "/profile-rtjar-includes.txt", "pkg1", "pkg2",
          "pkg3", "pkg4", "pkg5", "pkgDeprecated"
     };
     private static final String[] ARGS2 = new String[]{
-        "-d", PACKAGE_BUG_ID, "-sourcepath", SRC_DIR, "pkg1", "pkg2",
+        "-d", PACKAGE_OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg1", "pkg2",
         "pkg3", "pkg4", "pkg5"
     };
     //Input for string tests for profiles.
     private static final String[][] PROFILES_TEST = {
         // Tests for profile-overview-frame.html listing all profiles.
-        {PROFILE_BUG_ID + "/profile-overview-frame.html",
+        { "profile-overview-frame.html",
             "<span><a href=\"overview-frame.html\" "
             + "target=\"packageListFrame\">All&nbsp;Packages</a></span>"
         },
-        {PROFILE_BUG_ID + "/profile-overview-frame.html",
+        { "profile-overview-frame.html",
             "<li><a href=\"compact1-frame.html\" target=\"packageListFrame\">"
             + "compact1</a></li>"
         },
         // Tests for profileName-frame.html listing all packages in a profile.
-        {PROFILE_BUG_ID + "/compact2-frame.html",
+        { "compact2-frame.html",
             "<span><a href=\"overview-frame.html\" target=\"packageListFrame\">"
             + "All&nbsp;Packages</a></span><span><a href=\"profile-overview-frame.html\" "
             + "target=\"packageListFrame\">All&nbsp;Profiles</a></span>"
         },
-        {PROFILE_BUG_ID + "/compact2-frame.html",
+        { "compact2-frame.html",
             "<li><a href=\"pkg4/compact2-package-frame.html\" "
             + "target=\"packageFrame\">pkg4</a></li>"
         },
         // Test for profileName-package-frame.html listing all types in a
         // package of a profile.
-        {PROFILE_BUG_ID + "/pkg2/compact2-package-frame.html",
+        { "pkg2/compact2-package-frame.html",
             "<a href=\"../compact2-summary.html\" target=\"classFrame\">"
             + "compact2</a> - <a href=\"../pkg2/compact2-package-summary.html\" "
             + "target=\"classFrame\">pkg2</a>"
         },
         // Tests for profileName-summary.html listing the summary for a profile.
-        {PROFILE_BUG_ID + "/compact2-summary.html",
+        { "compact2-summary.html",
             "<li><a href=\"compact1-summary.html\">Prev&nbsp;Profile</a></li>\n"
             + "<li><a href=\"compact3-summary.html\">Next&nbsp;Profile</a></li>"
         },
-        {PROFILE_BUG_ID + "/compact2-summary.html",
+        { "compact2-summary.html",
             "<h1 title=\"Profile\" class=\"title\">Profile&nbsp;compact2</h1>"
         },
-        {PROFILE_BUG_ID + "/compact2-summary.html",
+        { "compact2-summary.html",
             "<h3><a href=\"pkg2/compact2-package-summary.html\" "
             + "target=\"classFrame\">pkg2</a></h3>"
         },
-        {PROFILE_BUG_ID + "/compact2-summary.html",
+        { "compact2-summary.html",
             "<ul class=\"blockList\">\n" +
             "<li class=\"blockList\">\n"
             + "<h3><a href=\"pkg2/compact2-package-summary.html\" target=\"classFrame\">"
@@ -95,7 +94,7 @@
             + "cellpadding=\"3\" cellspacing=\"0\" summary=\"Class Summary table, "
             + "listing classes, and an explanation\">"
         },
-        {PROFILE_BUG_ID + "/compact2-summary.html",
+        { "compact2-summary.html",
             "<ul class=\"blockList\">\n" +
             "<li class=\"blockList\">\n"
             + "<h3><a href=\"pkg4/compact2-package-summary.html\" target=\"classFrame\">"
@@ -106,14 +105,14 @@
         },
         // Tests for profileName-package-summary.html listing the summary for a
         // package in a profile.
-        {PROFILE_BUG_ID + "/pkg5/compact3-package-summary.html",
+        { "pkg5/compact3-package-summary.html",
             "<li><a href=\"../pkg4/compact3-package-summary.html\">Prev&nbsp;Package"
             + "</a></li>"
         },
-        {PROFILE_BUG_ID + "/pkg5/compact3-package-summary.html",
+        { "pkg5/compact3-package-summary.html",
             "<div class=\"subTitle\">compact3</div>"
         },
-        {PROFILE_BUG_ID + "/pkg5/compact3-package-summary.html",
+        { "pkg5/compact3-package-summary.html",
             "<ul class=\"blockList\">\n" +
             "<li class=\"blockList\">\n"
             + "<table class=\"typeSummary\" border=\"0\" cellpadding=\"3\" "
@@ -121,20 +120,20 @@
             + "interfaces, and an explanation\">"
         },
         //Test for "overview-frame.html" showing the "All Profiles" link.
-        {PROFILE_BUG_ID + "/overview-frame.html",
+        { "overview-frame.html",
             "<span><a href=\"profile-overview-frame.html\" "
             + "target=\"packageListFrame\">All&nbsp;Profiles</a></span>"
         },
         //Test for "className.html" showing the profile information for the type.
-        {PROFILE_BUG_ID + "/pkg2/Class1Pkg2.html",
+        { "pkg2/Class1Pkg2.html",
             "<div class=\"subTitle\">compact1, compact2, compact3</div>"
         },
-        {PROFILE_BUG_ID + "/index.html",
+        { "index.html",
             "<frame src=\"overview-frame.html\" name=\"packageListFrame\" " +
             "title=\"All Packages\">"
         },
         //Test for "overview-summary.html" showing the profile list.
-        {PROFILE_BUG_ID + "/overview-summary.html",
+        { "overview-summary.html",
             "<ul>\n" +
             "<li><a href=\"compact1-summary.html\" target=\"classFrame\">" +
             "compact1</a></li>\n" +
@@ -145,28 +144,28 @@
             "</ul>"
         },
         //Test deprecated class in profiles
-        {PROFILE_BUG_ID + "/compact1-summary.html","<td class=\"colFirst\">"
-            + "<a href=\"pkg2/Class1Pkg2.html\" title=\"class in pkg2\">Class1Pkg2</a></td>\n"
+        { "compact1-summary.html",
+            "<td class=\"colFirst\"><a href=\"pkg2/Class1Pkg2.html\" title=\"class in pkg2\">Class1Pkg2</a></td>\n"
             + "<td class=\"colLast\">Deprecated"
         },
-        {PROFILE_BUG_ID + "/deprecated-list.html","<td class=\"colOne\">"
-            + "<a href=\"pkg2/Class1Pkg2.html\" title=\"class in pkg2\">pkg2.Class1Pkg2</a>\n"
+        { "deprecated-list.html",
+            "<td class=\"colOne\"><a href=\"pkg2/Class1Pkg2.html\" title=\"class in pkg2\">pkg2.Class1Pkg2</a>\n"
             +"<div class=\"block\"><span class=\"deprecationComment\">Class1Pkg2. This class is deprecated</span></div>"
         },
         //Test deprecated package in profile
-        {PROFILE_BUG_ID + "/deprecated-list.html","<td class=\"colOne\">"
-            + "<a href=\"pkgDeprecated/package-summary.html\">pkgDeprecated</a>\n"
+        { "deprecated-list.html",
+            "<td class=\"colOne\"><a href=\"pkgDeprecated/package-summary.html\">pkgDeprecated</a>\n"
             +"<div class=\"block\"><span class=\"deprecationComment\">This package is <b>Deprecated</b>."
             + " Use pkg1.</span></div>"
         },
-        {PROFILE_BUG_ID + "/pkgDeprecated/package-summary.html",
+        { "pkgDeprecated/package-summary.html",
             "<div class=\"deprecatedContent\"><span class=\"deprecatedLabel\">Deprecated.</span>\n"
             + "<div class=\"block\"><span class=\"deprecationComment\">This package is <b>Deprecated</b>."
             + " Use pkg1.</span></div>"
         },
         // need to add teststring when JDK-8015496 will be fixed
         //Test exception in profiles
-        {PROFILE_BUG_ID + "/compact1-summary.html",
+        { "compact1-summary.html",
             "<table class=\"typeSummary\" "
             + "border=\"0\" cellpadding=\"3\" cellspacing=\"0\" "
             + "summary=\"Exception Summary table, listing exceptions, and an explanation\">\n"
@@ -184,7 +183,7 @@
             + " title=\"class in pkg2\">ClassException</a></td>"
         },
         //Test errors in profiles
-        {PROFILE_BUG_ID + "/compact1-summary.html",
+        { "compact1-summary.html",
             "<table class=\"typeSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" "
             + "summary=\"Error Summary table, listing errors, and an explanation\">\n"
             + "<caption><span>Error Summary</span><span class=\"tabEnd\">&nbsp;"
@@ -202,19 +201,19 @@
         }
     };
     private static final String[][] PROFILES_NEGATED_TEST = {
-        {PROFILE_BUG_ID + "/pkg3/Class2Pkg3.html",
+        { "pkg3/Class2Pkg3.html",
             "<div class=\"subTitle\">compact1"
         },
-        {PROFILE_BUG_ID + "/pkg3/Interface1Pkg3.html",
+        { "pkg3/Interface1Pkg3.html",
             "<div class=\"subTitle\">compact1"
         },
-        {PROFILE_BUG_ID + "/pkg4/compact2-package-frame.html",
+        { "pkg4/compact2-package-frame.html",
             "<li><a href=\"Anno1Pkg4.html\" title=\"annotation in pkg4\" "
             + "target=\"classFrame\">Anno1Pkg4</a></li>"
         },
-        {PROFILE_BUG_ID + "/compact1-summary.html","<li>Use</li>"
+        { "compact1-summary.html","<li>Use</li>"
         },
-        {PROFILE_BUG_ID + "/compact2-summary.html",
+        { "compact2-summary.html",
             "<ul class=\"blockList\">\n" +
             "<li class=\"blockList\">\n"
             + "<h3><a href=\"pkg2/compact2-package-summary.html\" target=\"classFrame\">"
@@ -224,7 +223,7 @@
             + "cellpadding=\"3\" cellspacing=\"0\" summary=\"Class Summary table, "
             + "listing classes, and an explanation\">"
         },
-        {PROFILE_BUG_ID + "/pkg5/compact3-package-summary.html",
+        { "pkg5/compact3-package-summary.html",
             "<ul class=\"blockList\">\n" +
             "<li class=\"blockList\">\n"
             + "<li class=\"blockList\">\n"
@@ -234,14 +233,14 @@
         }
     };
     private static final String[][] PACKAGES_TEST = {
-        {PACKAGE_BUG_ID + "/overview-frame.html",
+        { "overview-frame.html",
             "<h2 title=\"Packages\">Packages</h2>"
         },
-        {PACKAGE_BUG_ID + "/pkg4/package-frame.html",
+        { "pkg4/package-frame.html",
             "<h1 class=\"bar\"><a href=\"../pkg4/package-summary.html\" "
             + "target=\"classFrame\">pkg4</a></h1>"
         },
-        {PACKAGE_BUG_ID + "/pkg4/package-summary.html",
+        { "pkg4/package-summary.html",
             "<div class=\"header\">\n" +
             "<h1 title=\"Package\" "
             + "class=\"title\">Package&nbsp;pkg4</h1>\n" +
@@ -249,14 +248,14 @@
         }
     };
     private static final String[][] PACKAGES_NEGATED_TEST = {
-        {PACKAGE_BUG_ID + "/overview-frame.html",
+        { "overview-frame.html",
             "<span><a href=\"profile-overview-frame.html\" "
             + "target=\"packageListFrame\">All&nbsp;Profiles</a></span>"
         },
-        {PACKAGE_BUG_ID + "/pkg2/Class1Pkg2.html",
+        { "pkg2/Class1Pkg2.html",
             "<div class=\"subTitle\">compact1, compact2, compact3</div>"
         },
-        {PACKAGE_BUG_ID + "/overview-summary.html",
+        { "overview-summary.html",
             "<ul>\n" +
             "<li><a href=\"compact1-summary.html\" target=\"classFrame\">" +
             "compact1</a></li>\n" +
@@ -268,11 +267,11 @@
         }
     };
     private static final String[] PACKAGES_NEGATED_FILE_TEST = {
-        PACKAGE_BUG_ID + "/profile-overview-frame.html",
-        PACKAGE_BUG_ID + "/compact2-frame.html",
-        PACKAGE_BUG_ID + "/pkg2/compact2-package-frame.html",
-        PACKAGE_BUG_ID + "/compact2-summary.html",
-        PACKAGE_BUG_ID + "/pkg5/compact3-package-summary.html"
+        "profile-overview-frame.html",
+        "compact2-frame.html",
+        "pkg2/compact2-package-frame.html",
+        "compact2-summary.html",
+        "pkg5/compact3-package-summary.html"
     };
 
     /**
@@ -282,22 +281,8 @@
      */
     public static void main(String[] args) {
         TestProfiles tester = new TestProfiles();
-        run(tester, ARGS1, PROFILES_TEST, PROFILES_NEGATED_TEST);
-        run(tester, ARGS2, PACKAGES_TEST, PACKAGES_NEGATED_TEST, NO_FILE_TEST, PACKAGES_NEGATED_FILE_TEST);
+        tester.run(ARGS1, PROFILES_TEST, PROFILES_NEGATED_TEST);
+        tester.run(ARGS2, PACKAGES_TEST, PACKAGES_NEGATED_TEST, NO_FILE_TEST, PACKAGES_NEGATED_FILE_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testProfiles/TestProfilesConfiguration.java b/langtools/test/com/sun/javadoc/testProfiles/TestProfilesConfiguration.java
index c12a528..965b8e1 100644
--- a/langtools/test/com/sun/javadoc/testProfiles/TestProfilesConfiguration.java
+++ b/langtools/test/com/sun/javadoc/testProfiles/TestProfilesConfiguration.java
@@ -33,26 +33,25 @@
 public class TestProfilesConfiguration extends JavadocTester {
 
     //Test information.
-    private static final String BUG_ID = "8006124-8009684";
-    private static final String PROFILE_CONFIGURATION_BUG_ID = BUG_ID + "-3";
-    private static final String NODEPR_NOPKGS_BUG_ID = BUG_ID + "-4";
+    private static final String PROFILE_CONFIGURATION_OUTPUT_DIR = OUTPUT_DIR + "-3";
+    private static final String NODEPR_NOPKGS_OUTPUT_DIR = OUTPUT_DIR + "-4";
     //Javadoc arguments.
     private static final String[] ARGS3 = new String[]{
-        "-d", PROFILE_CONFIGURATION_BUG_ID, "-sourcepath", SRC_DIR,
+        "-d", PROFILE_CONFIGURATION_OUTPUT_DIR, "-sourcepath", SRC_DIR,
         "-nocomment", "-keywords", "-Xprofilespath", SRC_DIR +
         "/profile-rtjar-includes.txt", "-doctitle", "Simple doctitle",
         "-use", "pkg3", "pkg1", "pkg2", "pkg4",
         "pkg5", "-packagesheader", "Simple packages header","pkgDeprecated"
     };
     private static final String[] ARGS4 = new String[]{
-        "-d", NODEPR_NOPKGS_BUG_ID, "-sourcepath", SRC_DIR, "-nocomment",
+        "-d", NODEPR_NOPKGS_OUTPUT_DIR, "-sourcepath", SRC_DIR, "-nocomment",
         "-nodeprecated", "-keywords", "-Xprofilespath", SRC_DIR +
         "/profile-rtjar-includes-nopkgs.txt", "-doctitle", "Simple doctitle",
         "-use", "-packagesheader", "Simple packages header",
         "pkg1", "pkg2", "pkg3", "pkg4", "pkg5", "pkgDeprecated"
     };
     private static final String[][] NODEPR_NOPKGS_TEST = {
-        {NODEPR_NOPKGS_BUG_ID + "/overview-summary.html",
+        { "overview-summary.html",
             "<ul>\n" +
             "<li><a href=\"compact2-summary.html\" target=\"classFrame\">" +
             "compact2</a></li>\n" +
@@ -60,7 +59,7 @@
             "classFrame\">compact3</a></li>\n" +
             "</ul>"
         },
-        {NODEPR_NOPKGS_BUG_ID + "/profile-overview-frame.html",
+        { "profile-overview-frame.html",
             "<ul title=\"Profiles\">\n" +
             "<li><a href=\"compact2-frame.html\" target=\"packageListFrame\">" +
             "compact2</a></li>\n" +
@@ -70,30 +69,30 @@
         }
     };
     private static final String[][] NODEPR_NOPKGS_NEGATED_TEST = {
-        {NODEPR_NOPKGS_BUG_ID + "/overview-summary.html",
+        { "overview-summary.html",
             "compact1"
         }
     };
 
     private static final String[][] PROFILES_CONFIGURATION_TEST = {
         //-use option test string fo profile view page
-        {PROFILE_CONFIGURATION_BUG_ID + "/compact1-summary.html","<li>Use</li>"
+        { "compact1-summary.html","<li>Use</li>"
         },
         //-doctitle option test string
-        {PROFILE_CONFIGURATION_BUG_ID + "/overview-summary.html",
+        { "overview-summary.html",
             "<div class=\"header\">\n" +
             "<h1 class=\"title\">Simple doctitle</h1>"
         },
         //-packagesheader option test string fo profiles
-        {PROFILE_CONFIGURATION_BUG_ID + "/profile-overview-frame.html",
+        { "profile-overview-frame.html",
             "<h1 title=\"Simple packages header\" class=\"bar\">Simple packages header</h1>"
         },
         //-keywords option test string for profiles
-        {PROFILE_CONFIGURATION_BUG_ID + "/compact1-summary.html",
+        { "compact1-summary.html",
             "<meta name=\"keywords\" content=\"compact1 profile\">"
         },
         //Deprecated information on a package
-        {PROFILE_CONFIGURATION_BUG_ID + "/compact1-summary.html",
+        { "compact1-summary.html",
             "<h3><a href=\"pkgDeprecated/compact1-package-summary.html\" target=\"" +
             "classFrame\">pkgDeprecated</a></h3>\n" +
             "<div class=\"deprecatedContent\">" +
@@ -102,7 +101,7 @@
     };
     private static final String[][] PROFILES_CONFIGURATION_NEGATED_TEST = {
         //-nocomments option test string
-        {PROFILE_CONFIGURATION_BUG_ID + "/compact1-summary.html",
+        { "compact1-summary.html",
             "<div class=\"block\"><i>Class1Pkg2.</i></div>"
         }
     };
@@ -114,24 +113,10 @@
      */
     public static void main(String[] args) {
         TestProfilesConfiguration tester = new TestProfilesConfiguration();
-        run(tester, ARGS3, PROFILES_CONFIGURATION_TEST,
+        tester.run(ARGS3, PROFILES_CONFIGURATION_TEST,
         PROFILES_CONFIGURATION_NEGATED_TEST);
-        run(tester, ARGS4, NODEPR_NOPKGS_TEST,
+        tester.run(ARGS4, NODEPR_NOPKGS_TEST,
         NODEPR_NOPKGS_NEGATED_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testRecurseSubPackages/TestRecurseSubPackages.java b/langtools/test/com/sun/javadoc/testRecurseSubPackages/TestRecurseSubPackages.java
index 754bc00..d195735 100644
--- a/langtools/test/com/sun/javadoc/testRecurseSubPackages/TestRecurseSubPackages.java
+++ b/langtools/test/com/sun/javadoc/testRecurseSubPackages/TestRecurseSubPackages.java
@@ -34,10 +34,9 @@
 
 public class TestRecurseSubPackages extends JavadocTester {
 
-    private static final String BUG_ID = "4074234";
     private static final String[] ARGS =
         new String[] {
-            "-d", BUG_ID, "-sourcepath", SRC_DIR,
+            "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR,
             "-subpackages", "pkg1", "-exclude", "pkg1.pkg2.packageToExclude"
         };
 
@@ -48,28 +47,14 @@
     public static void main(String[] args) {
         String[][] tests = new String[6][2];
         for (int i = 0; i < tests.length; i++) {
-            tests[i][0] = BUG_ID + "/allclasses-frame.html";
+            tests[i][0] = "allclasses-frame.html";
             tests[i][1] = "C" + (i+1) + ".html";
         }
         String[][] negatedTests = new String[][] {
-            {BUG_ID + "/allclasses-frame.html", "DummyClass.html"}
+            { "allclasses-frame.html", "DummyClass.html"}
         };
         TestRecurseSubPackages tester = new TestRecurseSubPackages();
-        run(tester, ARGS, tests, negatedTests);
+        tester.run(ARGS, tests, negatedTests);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testRelativeLinks/TestRelativeLinks.java b/langtools/test/com/sun/javadoc/testRelativeLinks/TestRelativeLinks.java
index b6dc0a8..d4bd107 100644
--- a/langtools/test/com/sun/javadoc/testRelativeLinks/TestRelativeLinks.java
+++ b/langtools/test/com/sun/javadoc/testRelativeLinks/TestRelativeLinks.java
@@ -35,27 +35,24 @@
 
 public class TestRelativeLinks extends JavadocTester {
 
-    //Test information.
-    private static final String BUG_ID = "4460354-8014636";
-
     //Javadoc arguments.
     private static final String[] ARGS = new String[] {
-        "-d", BUG_ID, "-use", "-sourcepath", SRC_DIR, "pkg", "pkg2"
+        "-d", OUTPUT_DIR, "-use", "-sourcepath", SRC_DIR, "pkg", "pkg2"
     };
 
     //Input for string search tests.
     private static final String[][] TEST = {
         //These relative paths should stay relative because they appear
         //in the right places.
-        {BUG_ID + "/pkg/C.html",
+        { "pkg/C.html",
             "<a href=\"relative-class-link.html\">relative class link</a>"},
-        {BUG_ID + "/pkg/C.html",
+        { "pkg/C.html",
             "<a href=\"relative-field-link.html\">relative field link</a>"},
-        {BUG_ID + "/pkg/C.html",
+        { "pkg/C.html",
             "<a href=\"relative-method-link.html\">relative method link</a>"},
-        {BUG_ID + "/pkg/package-summary.html",
+        { "pkg/package-summary.html",
             "<a href=\"relative-package-link.html\">relative package link</a>"},
-        {BUG_ID + "/pkg/C.html",
+        { "pkg/C.html",
             " <a\n" +
             " href=\"relative-multi-line-link.html\">relative-multi-line-link</a>."},
 
@@ -63,43 +60,40 @@
         //places.
 
         //INDEX PAGE
-        {BUG_ID + "/index-all.html",
+        { "index-all.html",
             "<a href=\"./pkg/relative-class-link.html\">relative class link</a>"},
-        {BUG_ID + "/index-all.html",
+        { "index-all.html",
             "<a href=\"./pkg/relative-field-link.html\">relative field link</a>"},
-        {BUG_ID + "/index-all.html",
+        { "index-all.html",
             "<a href=\"./pkg/relative-method-link.html\">relative method link</a>"},
-        {BUG_ID + "/index-all.html",
+        { "index-all.html",
             "<a href=\"./pkg/relative-package-link.html\">relative package link</a>"},
-        {BUG_ID + "/index-all.html",
+        { "index-all.html",
             " <a\n" +
             " href=\"./pkg/relative-multi-line-link.html\">relative-multi-line-link</a>."},
 
 
         //PACKAGE USE
-        {BUG_ID + "/pkg/package-use.html",
+        { "pkg/package-use.html",
             "<a href=\"../pkg/relative-package-link.html\">relative package link</a>."},
-        {BUG_ID + "/pkg/package-use.html",
+        { "pkg/package-use.html",
             "<a href=\"../pkg/relative-class-link.html\">relative class link</a>"},
 
         //CLASS_USE
-        {BUG_ID + "/pkg/class-use/C.html",
+        { "pkg/class-use/C.html",
             "<a href=\"../../pkg/relative-field-link.html\">relative field link</a>"},
-        {BUG_ID + "/pkg/class-use/C.html",
+        { "pkg/class-use/C.html",
             "<a href=\"../../pkg/relative-method-link.html\">relative method link</a>"},
-        {BUG_ID + "/pkg/class-use/C.html",
+        { "pkg/class-use/C.html",
             "<a href=\"../../pkg/relative-package-link.html\">relative package link</a>"},
-        {BUG_ID + "/pkg/class-use/C.html",
+        { "pkg/class-use/C.html",
             " <a\n" +
             " href=\"../../pkg/relative-multi-line-link.html\">relative-multi-line-link</a>."},
 
         //PACKAGE OVERVIEW
-        {BUG_ID + "/overview-summary.html",
+        { "overview-summary.html",
             "<a href=\"./pkg/relative-package-link.html\">relative package link</a>"},
-
-
     };
-    private static final String[][] NEGATED_TEST = NO_TEST;
 
     /**
      * The entry point of the test.
@@ -107,21 +101,7 @@
      */
     public static void main(String[] args) {
         TestRelativeLinks tester = new TestRelativeLinks();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NO_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testRepeatedAnnotations/TestRepeatedAnnotations.java b/langtools/test/com/sun/javadoc/testRepeatedAnnotations/TestRepeatedAnnotations.java
index 3b561aa..661e1f7 100644
--- a/langtools/test/com/sun/javadoc/testRepeatedAnnotations/TestRepeatedAnnotations.java
+++ b/langtools/test/com/sun/javadoc/testRepeatedAnnotations/TestRepeatedAnnotations.java
@@ -34,26 +34,25 @@
 public class TestRepeatedAnnotations extends JavadocTester {
 
     //Test information.
-    private static final String BUG_ID = "8005092";
 
     //Javadoc arguments.
     private static final String[] ARGS = new String[] {
-        "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg", "pkg1"
+        "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg", "pkg1"
     };
 
     //Input for string search tests.
     private static final String[][] TEST = {
-        {BUG_ID + "/pkg/C.html",
+        { "pkg/C.html",
             "<a href=\"../pkg/ContaineeSynthDoc.html\" " +
             "title=\"annotation in pkg\">@ContaineeSynthDoc</a> " +
             "<a href=\"../pkg/ContaineeSynthDoc.html\" " +
             "title=\"annotation in pkg\">@ContaineeSynthDoc</a>"},
-        {BUG_ID + "/pkg/C.html",
+        { "pkg/C.html",
             "<a href=\"../pkg/ContaineeRegDoc.html\" " +
             "title=\"annotation in pkg\">@ContaineeRegDoc</a> " +
             "<a href=\"../pkg/ContaineeRegDoc.html\" " +
             "title=\"annotation in pkg\">@ContaineeRegDoc</a>"},
-        {BUG_ID + "/pkg/C.html",
+        { "pkg/C.html",
             "<a href=\"../pkg/RegContainerDoc.html\" " +
             "title=\"annotation in pkg\">@RegContainerDoc</a>" +
             "(<a href=\"../pkg/RegContainerDoc.html#value--\">value</a>={" +
@@ -61,41 +60,41 @@
             "title=\"annotation in pkg\">@RegContaineeNotDoc</a>," +
             "<a href=\"../pkg/RegContaineeNotDoc.html\" " +
             "title=\"annotation in pkg\">@RegContaineeNotDoc</a>})"},
-        {BUG_ID + "/pkg/C.html",
+        { "pkg/C.html",
             "<a href=\"../pkg/ContaineeSynthDoc.html\" " +
             "title=\"annotation in pkg\">@ContaineeSynthDoc</a> " +
             "<a href=\"../pkg/ContaineeSynthDoc.html\" " +
             "title=\"annotation in pkg\">@ContaineeSynthDoc</a> " +
             "<a href=\"../pkg/ContaineeSynthDoc.html\" " +
             "title=\"annotation in pkg\">@ContaineeSynthDoc</a>"},
-        {BUG_ID + "/pkg/C.html",
+        { "pkg/C.html",
             "<a href=\"../pkg/ContainerSynthDoc.html\" " +
             "title=\"annotation in pkg\">@ContainerSynthDoc</a>(" +
             "<a href=\"../pkg/ContainerSynthDoc.html#value--\">value</a>=" +
             "<a href=\"../pkg/ContaineeSynthDoc.html\" " +
             "title=\"annotation in pkg\">@ContaineeSynthDoc</a>)"},
-        {BUG_ID + "/pkg/C.html",
+        { "pkg/C.html",
             "<a href=\"../pkg/ContaineeSynthDoc.html\" " +
             "title=\"annotation in pkg\">@ContaineeSynthDoc</a> " +
             "<a href=\"../pkg/ContaineeSynthDoc.html\" " +
             "title=\"annotation in pkg\">@ContaineeSynthDoc</a>"},
 
-        {BUG_ID + "/pkg/D.html",
+        { "pkg/D.html",
             "<a href=\"../pkg/RegDoc.html\" title=\"annotation in pkg\">@RegDoc</a>" +
             "(<a href=\"../pkg/RegDoc.html#x--\">x</a>=1)"},
-        {BUG_ID + "/pkg/D.html",
+        { "pkg/D.html",
             "<a href=\"../pkg/RegArryDoc.html\" title=\"annotation in pkg\">@RegArryDoc</a>" +
             "(<a href=\"../pkg/RegArryDoc.html#y--\">y</a>=1)"},
-        {BUG_ID + "/pkg/D.html",
+        { "pkg/D.html",
             "<a href=\"../pkg/RegArryDoc.html\" title=\"annotation in pkg\">@RegArryDoc</a>" +
             "(<a href=\"../pkg/RegArryDoc.html#y--\">y</a>={1,2})"},
-        {BUG_ID + "/pkg/D.html",
+        { "pkg/D.html",
             "<a href=\"../pkg/NonSynthDocContainer.html\" " +
             "title=\"annotation in pkg\">@NonSynthDocContainer</a>" +
             "(<a href=\"../pkg/NonSynthDocContainer.html#value--\">value</a>=" +
             "<a href=\"../pkg/RegArryDoc.html\" title=\"annotation in pkg\">@RegArryDoc</a>)"},
 
-        {BUG_ID + "/pkg1/C.html",
+        { "pkg1/C.html",
             "<a href=\"../pkg1/RegContainerValDoc.html\" " +
             "title=\"annotation in pkg1\">@RegContainerValDoc</a>" +
             "(<a href=\"../pkg1/RegContainerValDoc.html#value--\">value</a>={" +
@@ -104,7 +103,7 @@
             "<a href=\"../pkg1/RegContaineeNotDoc.html\" " +
             "title=\"annotation in pkg1\">@RegContaineeNotDoc</a>}," +
             "<a href=\"../pkg1/RegContainerValDoc.html#y--\">y</a>=3)"},
-        {BUG_ID + "/pkg1/C.html",
+        { "pkg1/C.html",
             "<a href=\"../pkg1/ContainerValDoc.html\" " +
             "title=\"annotation in pkg1\">@ContainerValDoc</a>" +
             "(<a href=\"../pkg1/ContainerValDoc.html#value--\">value</a>={" +
@@ -116,12 +115,12 @@
     };
 
     private static final String[][] NEGATED_TEST = {
-        {BUG_ID + "/pkg/C.html",
+        { "pkg/C.html",
             "<a href=\"../pkg/RegContaineeDoc.html\" " +
             "title=\"annotation in pkg\">@RegContaineeDoc</a> " +
             "<a href=\"../pkg/RegContaineeDoc.html\" " +
             "title=\"annotation in pkg\">@RegContaineeDoc</a>"},
-        {BUG_ID + "/pkg/C.html",
+        { "pkg/C.html",
             "<a href=\"../pkg/RegContainerNotDoc.html\" " +
             "title=\"annotation in pkg\">@RegContainerNotDoc</a>" +
             "(<a href=\"../pkg/RegContainerNotDoc.html#value--\">value</a>={" +
@@ -130,12 +129,12 @@
             "<a href=\"../pkg/RegContaineeNotDoc.html\" " +
             "title=\"annotation in pkg\">@RegContaineeNotDoc</a>})"},
 
-        {BUG_ID + "/pkg1/C.html",
+        { "pkg1/C.html",
             "<a href=\"../pkg1/ContaineeSynthDoc.html\" " +
             "title=\"annotation in pkg1\">@ContaineeSynthDoc</a> " +
             "<a href=\"../pkg1/ContaineeSynthDoc.html\" " +
             "title=\"annotation in pkg1\">@ContaineeSynthDoc</a>"},
-        {BUG_ID + "/pkg1/C.html",
+        { "pkg1/C.html",
             "<a href=\"../pkg1/RegContainerValNotDoc.html\" " +
             "title=\"annotation in pkg1\">@RegContainerValNotDoc</a>" +
             "(<a href=\"../pkg1/RegContainerValNotDoc.html#value--\">value</a>={" +
@@ -144,7 +143,7 @@
             "<a href=\"../pkg1/RegContaineeDoc.html\" " +
             "title=\"annotation in pkg1\">@RegContaineeDoc</a>}," +
             "<a href=\"../pkg1/RegContainerValNotDoc.html#y--\">y</a>=4)"},
-        {BUG_ID + "/pkg1/C.html",
+        { "pkg1/C.html",
             "<a href=\"../pkg1/ContainerValNotDoc.html\" " +
             "title=\"annotation in pkg1\">@ContainerValNotDoc</a>" +
             "(<a href=\"../pkg1/ContainerValNotDoc.html#value--\">value</a>={" +
@@ -153,7 +152,7 @@
             "<a href=\"../pkg1/ContaineeNotDoc.html\" " +
             "title=\"annotation in pkg1\">@ContaineeNotDoc</a>}," +
             "<a href=\"../pkg1/ContainerValNotDoc.html#x--\">x</a>=2)"},
-        {BUG_ID + "/pkg1/C.html",
+        { "pkg1/C.html",
             "<a href=\"../pkg1/ContainerSynthNotDoc.html\" " +
             "title=\"annotation in pkg1\">@ContainerSynthNotDoc</a>(" +
             "<a href=\"../pkg1/ContainerSynthNotDoc.html#value--\">value</a>=" +
@@ -167,21 +166,7 @@
      */
     public static void main(String[] args) {
         TestRepeatedAnnotations tester = new TestRepeatedAnnotations();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NEGATED_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testReturnTag/TestReturnTag.java b/langtools/test/com/sun/javadoc/testReturnTag/TestReturnTag.java
index 019bba0..cef982b 100644
--- a/langtools/test/com/sun/javadoc/testReturnTag/TestReturnTag.java
+++ b/langtools/test/com/sun/javadoc/testReturnTag/TestReturnTag.java
@@ -34,12 +34,9 @@
 
 public class TestReturnTag extends JavadocTester {
 
-    //Test information.
-    private static final String BUG_ID = "4490068";
-
     //Javadoc arguments.
     private static final String[] ARGS = new String[] {
-        "-Xdoclint:none", "-d", BUG_ID, "-sourcepath", SRC_DIR, SRC_DIR +
+        "-Xdoclint:none", "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, SRC_DIR +
         "/TestReturnTag.java"
     };
 
@@ -48,7 +45,6 @@
         {WARNING_OUTPUT,
             "warning - @return tag cannot be used in method with void return type."}
     };
-    private static final String[][] NEGATED_TEST = NO_TEST;
 
     /**
      * Trigger warning message when return tag is used on a void method.
@@ -63,21 +59,7 @@
      */
     public static void main(String[] args) {
         TestReturnTag tester = new TestReturnTag();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NO_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testSeeTag/TestSeeTag.java b/langtools/test/com/sun/javadoc/testSeeTag/TestSeeTag.java
index 0c36282..cf5b3ef 100644
--- a/langtools/test/com/sun/javadoc/testSeeTag/TestSeeTag.java
+++ b/langtools/test/com/sun/javadoc/testSeeTag/TestSeeTag.java
@@ -33,10 +33,6 @@
 
 public class TestSeeTag extends JavadocTester {
 
-    //Test information.
-    private static final String BUG_ID = "8017191";
-    private static final String OUTPUT_DIR = BUG_ID;
-
     //Javadoc arguments.
     private static final String[] ARGS = new String[] {
         "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg"
@@ -44,12 +40,12 @@
 
     //Input for string search tests.
     private static final String[][] TEST = {
-        { OUTPUT_DIR + "/pkg/Test.html",
+        { "pkg/Test.html",
           "<code>List</code>"
         }
     };
     private static final String[][] NEGATED_TEST = {
-        { OUTPUT_DIR + "/pkg/Test.html",
+        { "pkg/Test.html",
           "&lt;code&gt;List&lt;/code&gt;"
         }
     };
@@ -60,21 +56,7 @@
      */
     public static void main(String[] args) {
         TestSeeTag tester = new TestSeeTag();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NEGATED_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testSerialVersionUID/TestSerialVersionUID.java b/langtools/test/com/sun/javadoc/testSerialVersionUID/TestSerialVersionUID.java
index 2c8e815..abffdc9 100644
--- a/langtools/test/com/sun/javadoc/testSerialVersionUID/TestSerialVersionUID.java
+++ b/langtools/test/com/sun/javadoc/testSerialVersionUID/TestSerialVersionUID.java
@@ -35,10 +35,6 @@
 
 public class TestSerialVersionUID extends JavadocTester {
 
-    //Test information.
-    private static final String BUG_ID = "4525039";
-    private static final String OUTPUT_DIR = "docs-" + BUG_ID;
-
     //Javadoc arguments.
     private static final String[] ARGS = new String[] {
         "-d", OUTPUT_DIR,
@@ -47,9 +43,8 @@
 
     //Input for string search tests.
     private static final String[][] TEST = {
-        {OUTPUT_DIR + "/serialized-form.html", "-111111111111111L"}
+        { "serialized-form.html", "-111111111111111L"}
     };
-    private static final String[][] NEGATED_TEST = NO_TEST;
 
     /**
      * The entry point of the test.
@@ -57,21 +52,7 @@
      */
     public static void main(String[] args) {
         TestSerialVersionUID tester = new TestSerialVersionUID();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NO_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testSerializedForm/TestSerializedForm.java b/langtools/test/com/sun/javadoc/testSerializedForm/TestSerializedForm.java
index bfc1985..6108f91 100644
--- a/langtools/test/com/sun/javadoc/testSerializedForm/TestSerializedForm.java
+++ b/langtools/test/com/sun/javadoc/testSerializedForm/TestSerializedForm.java
@@ -21,9 +21,6 @@
  * questions.
  */
 
-import java.lang.*;
-import java.io.*;
-
 /*
  * @test
  * @bug 4341304 4485668 4966728 8032066
@@ -41,82 +38,83 @@
  * @run main TestSerializedForm
  */
 
+import java.lang.*;
+import java.io.*;
+
 public class TestSerializedForm extends JavadocTester implements Serializable {
 
-    private static final String BUG_ID = "4341304-4485668-4966728";
-
     private static final String[][] TEST = {
-        {BUG_ID + FS + "serialized-form.html",
+        { "serialized-form.html",
             "protected&nbsp;java.lang.Object&nbsp;readResolve()"},
-        {BUG_ID + FS + "serialized-form.html",
+        { "serialized-form.html",
             "protected&nbsp;java.lang.Object&nbsp;writeReplace()"},
-        {BUG_ID + FS + "serialized-form.html",
+        { "serialized-form.html",
             "protected&nbsp;java.lang.Object&nbsp;readObjectNoData()"},
-        {BUG_ID + FS + "serialized-form.html",
+        { "serialized-form.html",
             "See Also"},
-        {BUG_ID + "/serialized-form.html",
+        { "serialized-form.html",
             "<h3>Class pkg1.NestedInnerClass.InnerClass.ProNestedInnerClass " +
             "extends java.lang.Object implements Serializable</h3>"},
-        {BUG_ID + "/serialized-form.html",
+        { "serialized-form.html",
             "<h3>Class pkg1.PrivateIncludeInnerClass.PriInnerClass extends " +
             "java.lang.Object implements Serializable</h3>"},
-        {BUG_ID + "/serialized-form.html",
+        { "serialized-form.html",
             "<h3>Class pkg1.ProtectedInnerClass.ProInnerClass extends " +
             "java.lang.Object implements Serializable</h3>"}
     };
 
     private static final String[][] TEST_PRIVATE = {
-        {BUG_ID + "-1/serialized-form.html",
+        { "serialized-form.html",
             "<h3>Class <a href=\"pkg1/NestedInnerClass.InnerClass.ProNestedInnerClass.html\" " +
             "title=\"class in pkg1\">pkg1.NestedInnerClass.InnerClass.ProNestedInnerClass</a> " +
             "extends java.lang.Object implements Serializable</h3>"},
-        {BUG_ID + "-1/serialized-form.html",
+        { "serialized-form.html",
             "<h3>Class <a href=\"pkg1/PrivateIncludeInnerClass.PriInnerClass.html\" title=\"class in pkg1\">" +
             "pkg1.PrivateIncludeInnerClass.PriInnerClass</a> extends java.lang.Object implements Serializable</h3>"},
-        {BUG_ID + "-1/serialized-form.html",
+        { "serialized-form.html",
             "<h3>Class <a href=\"pkg1/ProtectedInnerClass.ProInnerClass.html\" title=\"class in pkg1\">" +
             "pkg1.ProtectedInnerClass.ProInnerClass</a> extends java.lang.Object implements Serializable</h3>"}
     };
 
     private static final String[][] NEGATED_TEST = {
-        {BUG_ID + "/serialized-form.html",
+        { "serialized-form.html",
             "<h3>Class <a href=\"pkg1/NestedInnerClass.InnerClass.ProNestedInnerClass.html\" " +
             "title=\"class in pkg1\">pkg1.NestedInnerClass.InnerClass.ProNestedInnerClass</a> " +
             "extends java.lang.Object implements Serializable</h3>"},
-        {BUG_ID + "/serialized-form.html",
+        { "serialized-form.html",
             "<h3>Class <a href=\"pkg1/PrivateInnerClass.PriInnerClass.html\" title=\"class in pkg1\">" +
             "pkg1.PrivateInnerClass.PriInnerClass</a> extends java.lang.Object implements Serializable</h3>"},
-        {BUG_ID + "/serialized-form.html",
+        { "serialized-form.html",
             "<h3>Class <a href=\"pkg1/ProtectedInnerClass.ProInnerClass.html\" title=\"class in pkg1\">" +
             "pkg1.ProtectedInnerClass.ProInnerClass</a> extends java.lang.Object implements Serializable</h3>"},
-        {BUG_ID + "/serialized-form.html",
+        { "serialized-form.html",
             "<h3>Class pkg1.PublicExcludeInnerClass.PubInnerClass extends java.lang.Object implements " +
             "Serializable</h3>"}
     };
 
     private static final String[][] NEGATED_TEST_PRIVATE = {
-        {BUG_ID + "-1/serialized-form.html",
+        { "serialized-form.html",
             "<h3>Class pkg1.NestedInnerClass.InnerClass.ProNestedInnerClass " +
             "extends java.lang.Object implements Serializable</h3>"},
-        {BUG_ID + "-1/serialized-form.html",
+        { "serialized-form.html",
             "<h3>Class pkg1.PrivateInnerClass.PriInnerClass extends " +
             "java.lang.Object implements Serializable</h3>"},
-        {BUG_ID + "-1/serialized-form.html",
+        { "serialized-form.html",
             "<h3>Class pkg1.ProtectedInnerClass.ProInnerClass extends " +
             "java.lang.Object implements Serializable</h3>"},
-        {BUG_ID + "-1/serialized-form.html",
+        { "serialized-form.html",
             "<h3>Class <a href=\"pkg1/PublicExcludeInnerClass.PubInnerClass.html\" " +
             "title=\"class in pkg1\">pkg1.PublicExcludeInnerClass.PubInnerClass</a> " +
             "extends java.lang.Object implements Serializable</h3>"}
     };
 
     private static final String[] ARGS = new String[] {
-        "-d", BUG_ID, "-sourcepath", SRC_DIR,
+        "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR,
         SRC_DIR + "/TestSerializedForm.java", "pkg1"
     };
 
     private static final String[] ARGS_PRIVATE = new String[] {
-        "-private", "-d", BUG_ID + "-1", "-sourcepath", SRC_DIR,
+        "-private", "-d", OUTPUT_DIR + "-1", "-sourcepath", SRC_DIR,
         SRC_DIR + "/TestSerializedForm.java", "pkg1"
     };
 
@@ -132,26 +130,12 @@
      */
     public static void main(String[] args) {
         TestSerializedForm tester = new TestSerializedForm();
-        run(tester, ARGS, TEST, NEGATED_TEST);
-        run(tester, ARGS_PRIVATE, TEST_PRIVATE, NEGATED_TEST_PRIVATE);
+        tester.run(ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS_PRIVATE, TEST_PRIVATE, NEGATED_TEST_PRIVATE);
         tester.printSummary();
     }
 
     /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
-
-    /**
      * @param s ObjectInputStream.
      * @throws IOException when there is an I/O error.
      * @serial
diff --git a/langtools/test/com/sun/javadoc/testSerializedFormDeprecationInfo/TestSerializedFormDeprecationInfo.java b/langtools/test/com/sun/javadoc/testSerializedFormDeprecationInfo/TestSerializedFormDeprecationInfo.java
index 9e7296c..d9ebb4e 100644
--- a/langtools/test/com/sun/javadoc/testSerializedFormDeprecationInfo/TestSerializedFormDeprecationInfo.java
+++ b/langtools/test/com/sun/javadoc/testSerializedFormDeprecationInfo/TestSerializedFormDeprecationInfo.java
@@ -36,12 +36,10 @@
 
 public class TestSerializedFormDeprecationInfo extends JavadocTester {
 
-    private static final String BUG_ID = "6802694";
-
     // Test for normal run of javadoc. The serialized-form.html should
     // display the inline comments, tags and deprecation information if any.
     private static final String[][] TEST_CMNT_DEPR = {
-        {BUG_ID + "/serialized-form.html", "<dl>\n" +
+        { "serialized-form.html", "<dl>\n" +
                  "<dt><span class=\"throwsLabel\">Throws:</span></dt>\n" +
                  "<dd><code>" +
                  "java.io.IOException</code></dd>\n" +
@@ -50,7 +48,7 @@
                  "<dd><a href=\"pkg1/C1.html#setUndecorated-boolean-\">" +
                  "<code>C1.setUndecorated(boolean)</code></a></dd>\n" +
                  "</dl>"},
-        {BUG_ID + "/serialized-form.html",
+        { "serialized-form.html",
                  "<span class=\"deprecatedLabel\">Deprecated.</span>" +
                  "&nbsp;<span class=\"deprecationComment\">As of JDK version 1.5, replaced by\n" +
                  " <a href=\"pkg1/C1.html#setUndecorated-boolean-\">" +
@@ -66,7 +64,7 @@
                  "<dd><a href=\"pkg1/C1.html#setUndecorated-boolean-\">" +
                  "<code>C1.setUndecorated(boolean)</code></a></dd>\n" +
                  "</dl>"},
-        {BUG_ID + "/serialized-form.html",
+        { "serialized-form.html",
                  "<span class=\"deprecatedLabel\">Deprecated.</span>" +
                  "&nbsp;<span class=\"deprecationComment\">As of JDK version 1.5, replaced by\n" +
                  " <a href=\"pkg1/C1.html#setUndecorated-boolean-\">" +
@@ -78,7 +76,7 @@
                  "IOException</code></code></dd>\n" +
                  "<dd><code>java.io.IOException</code></dd>\n" +
                  "</dl>"},
-        {BUG_ID + "/serialized-form.html",
+        { "serialized-form.html",
                  "<span class=\"deprecatedLabel\">Deprecated.</span>" +
                  "&nbsp;</div>\n" +
                  "<div class=\"block\">" +
@@ -88,14 +86,14 @@
     // not display the inline comments and tags but should display deprecation
     // information if any.
     private static final String[][] TEST_NOCMNT = {
-        {BUG_ID + "/serialized-form.html",
+        { "serialized-form.html",
                  "<pre>boolean undecorated</pre>\n" +
                  "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated.</span>&nbsp;<span class=\"deprecationComment\">" +
                  "As of JDK version 1.5, replaced by\n" +
                  " <a href=\"pkg1/C1.html#setUndecorated-boolean-\"><code>" +
                  "setUndecorated(boolean)</code></a>.</span></div>\n" +
                  "</li>"},
-        {BUG_ID + "/serialized-form.html",
+        { "serialized-form.html",
                  "<span class=\"deprecatedLabel\">" +
                  "Deprecated.</span>&nbsp;<span class=\"deprecationComment\">As of JDK version" +
                  " 1.5, replaced by\n" +
@@ -117,19 +115,19 @@
 
     private static final String[] ARGS1 =
         new String[] {
-            "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg1"};
+            "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg1"};
 
     private static final String[] ARGS2 =
         new String[] {
-            "-d", BUG_ID, "-nocomment", "-sourcepath", SRC_DIR, "pkg1"};
+            "-d", OUTPUT_DIR, "-nocomment", "-sourcepath", SRC_DIR, "pkg1"};
 
     private static final String[] ARGS3 =
         new String[] {
-            "-d", BUG_ID, "-nodeprecated", "-sourcepath", SRC_DIR, "pkg1"};
+            "-d", OUTPUT_DIR, "-nodeprecated", "-sourcepath", SRC_DIR, "pkg1"};
 
     private static final String[] ARGS4 =
         new String[] {
-            "-d", BUG_ID, "-nocomment", "-nodeprecated", "-sourcepath",
+            "-d", OUTPUT_DIR, "-nocomment", "-nodeprecated", "-sourcepath",
             SRC_DIR, "pkg1"};
 
     /**
@@ -138,24 +136,10 @@
      */
     public static void main(String[] args) {
         TestSerializedFormDeprecationInfo tester = new TestSerializedFormDeprecationInfo();
-        run(tester, ARGS1, TEST_CMNT_DEPR, TEST_NOCMNT);
-        run(tester, ARGS2, TEST_NOCMNT, TEST_CMNT_DEPR);
-        run(tester, ARGS3, TEST_NODEPR, TEST_NOCMNT_NODEPR);
-        run(tester, ARGS4, TEST_NOCMNT_NODEPR, TEST_NODEPR);
+        tester.run(ARGS1, TEST_CMNT_DEPR, TEST_NOCMNT);
+        tester.run(ARGS2, TEST_NOCMNT, TEST_CMNT_DEPR);
+        tester.run(ARGS3, TEST_NODEPR, TEST_NOCMNT_NODEPR);
+        tester.run(ARGS4, TEST_NOCMNT_NODEPR, TEST_NODEPR);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testSimpleTag/TestSimpleTag.java b/langtools/test/com/sun/javadoc/testSimpleTag/TestSimpleTag.java
index 0e768d8..4cabbf4 100644
--- a/langtools/test/com/sun/javadoc/testSimpleTag/TestSimpleTag.java
+++ b/langtools/test/com/sun/javadoc/testSimpleTag/TestSimpleTag.java
@@ -37,22 +37,20 @@
 
 public class TestSimpleTag extends JavadocTester {
 
-    private static final String BUG_ID = "4695326-4750173-4920381";
-
     private static final String[][] TEST =
         new String[][] {
-            {"./" + BUG_ID + "/C.html",
+            { "C.html",
                 "<span class=\"simpleTagLabel\">Todo:</span>"},
-            {"./" + BUG_ID + "/C.html",
+            { "C.html",
                 "<span class=\"simpleTagLabel\">EJB Beans:</span>"},
-            {"./" + BUG_ID + "/C.html",
+            { "C.html",
                 "<span class=\"simpleTagLabel\">Regular Tag:</span>"},
-            {"./" + BUG_ID + "/C.html",
+            { "C.html",
                 "<span class=\"simpleTagLabel\">Back-Slash-Tag:</span>"},
         };
 
     private static final String[] ARGS = new String[] {
-        "-d", BUG_ID, "-sourcepath", SRC_DIR,
+        "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR,
         "-tag", "todo",
         "-tag", "ejb\\:bean:a:EJB Beans:",
         "-tag", "regular:a:Regular Tag:",
@@ -66,21 +64,7 @@
      */
     public static void main(String[] args) {
         TestSimpleTag tester = new TestSimpleTag();
-        run(tester, ARGS, TEST, NO_TEST);
+        tester.run(ARGS, TEST, NO_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testSimpleTagExclude/TestSimpleTagExclude.java b/langtools/test/com/sun/javadoc/testSimpleTagExclude/TestSimpleTagExclude.java
index 1ce3bc7..d914b0d 100644
--- a/langtools/test/com/sun/javadoc/testSimpleTagExclude/TestSimpleTagExclude.java
+++ b/langtools/test/com/sun/javadoc/testSimpleTagExclude/TestSimpleTagExclude.java
@@ -35,13 +35,11 @@
 
 public class TestSimpleTagExclude extends JavadocTester {
 
-    private static final String BUG_ID = "4628181";
-    private static final String[][] TEST = NO_TEST;
     private static final String[][] NEGATED_TEST = {
-        {BUG_ID + "/DummyClass.html", "todo"}
+        { "DummyClass.html", "todo"}
     };
     private static final String[] ARGS = new String[] {
-        "-d", BUG_ID, "-sourcepath", SRC_DIR, "-tag", "todo:X",
+        "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "-tag", "todo:X",
         SRC_DIR + "/DummyClass.java"
     };
 
@@ -51,23 +49,9 @@
      */
     public static void main(String[] args) {
         TestSimpleTagExclude tester = new TestSimpleTagExclude();
-        if (run(tester, ARGS, TEST, NEGATED_TEST) != 0) {
+        if (tester.run(ARGS, NO_TEST, NEGATED_TEST) != 0) {
             throw new Error("Javadoc failed to execute.");
         }
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testSimpleTagInherit/TestSimpleTagInherit.java b/langtools/test/com/sun/javadoc/testSimpleTagInherit/TestSimpleTagInherit.java
index 3b0a7f1..7608701 100644
--- a/langtools/test/com/sun/javadoc/testSimpleTagInherit/TestSimpleTagInherit.java
+++ b/langtools/test/com/sun/javadoc/testSimpleTagInherit/TestSimpleTagInherit.java
@@ -32,10 +32,6 @@
 
 public class TestSimpleTagInherit extends JavadocTester {
 
-    //Test information.
-    private static final String BUG_ID = "8008768";
-    private static final String OUTPUT_DIR = BUG_ID;
-
     //Javadoc arguments.
     private static final String[] ARGS = new String[] {
         "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR,
@@ -45,14 +41,13 @@
 
     //Input for string search tests.
     private static final String[][] TEST = {
-        { BUG_ID + "/p/TestClass.html",
+        { "p/TestClass.html",
           "<dt><span class=\"simpleTagLabel\"><em>Custom:</em></span></dt>\n" +
           "<dd>doc for BaseClass class</dd>" },
-        { BUG_ID + "/p/TestClass.html",
+        { "p/TestClass.html",
           "<dt><span class=\"simpleTagLabel\"><em>Custom:</em></span></dt>\n" +
           "<dd>doc for BaseClass method</dd>" }
     };
-    private static final String[][] NEGATED_TEST = NO_TEST;
 
     /**
      * The entry point of the test.
@@ -60,21 +55,7 @@
      */
     public static void main(String[] args) {
         TestSimpleTagInherit tester = new TestSimpleTagInherit();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NO_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testSinceTag/TestSinceTag.java b/langtools/test/com/sun/javadoc/testSinceTag/TestSinceTag.java
index 8a3f717..d8f768c 100644
--- a/langtools/test/com/sun/javadoc/testSinceTag/TestSinceTag.java
+++ b/langtools/test/com/sun/javadoc/testSinceTag/TestSinceTag.java
@@ -33,26 +33,23 @@
 
 public class TestSinceTag extends JavadocTester {
 
-    //Test information.
-    private static final String BUG_ID = "7180906";
-
     //Javadoc arguments.
     private static final String[] ARGS1 = new String[] {
-        "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg1"
+        "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg1"
     };
 
     private static final String[] ARGS2 = new String[] {
-        "-d", BUG_ID, "-sourcepath", SRC_DIR, "-nosince", "pkg1"
+        "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "-nosince", "pkg1"
     };
 
     //Input for string search tests.
     private static final String[][] TEST = {
-        {BUG_ID + "/pkg1/C1.html",
+        { "pkg1/C1.html",
             "<dl>\n" +
             "<dt><span class=\"simpleTagLabel\">Since:</span></dt>\n" +
             "<dd>JDK1.0</dd>"
         },
-        {BUG_ID + "/serialized-form.html",
+        { "serialized-form.html",
             "<dl>\n" +
             "<dt><span class=\"simpleTagLabel\">Since:</span></dt>\n" +
             "<dd>1.4</dd>"
@@ -65,22 +62,8 @@
      */
     public static void main(String[] args) {
         TestSinceTag tester = new TestSinceTag();
-        run(tester, ARGS1, TEST, NO_TEST);
-        run(tester, ARGS2, NO_TEST, TEST);
+        tester.run(ARGS1, TEST, NO_TEST);
+        tester.run(ARGS2, NO_TEST, TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testSingleQuotedLink/TestSingleQuotedLink.java b/langtools/test/com/sun/javadoc/testSingleQuotedLink/TestSingleQuotedLink.java
index 312ac93..506d85d 100644
--- a/langtools/test/com/sun/javadoc/testSingleQuotedLink/TestSingleQuotedLink.java
+++ b/langtools/test/com/sun/javadoc/testSingleQuotedLink/TestSingleQuotedLink.java
@@ -32,21 +32,20 @@
  */
 public class TestSingleQuotedLink extends JavadocTester {
 
-    private static final String BUG_ID = "6457406";
     // We are testing the redirection algorithm with a known scenario when a writer is not forced to ignore it: "-use".
     private static final String[][] TEST = {
-        {BUG_ID + "/pkg1/class-use/C1.html",
+        { "pkg1/class-use/C1.html",
             "<a href=\'http://download.oracle.com/javase/8/docs/technotes/guides/indexC2.html\'>"
         }
     };
     private static final String[][] NEGATED_TEST = {
-        {BUG_ID + "/pkg1/class-use/C1.html",
+        { "pkg1/class-use/C1.html",
             "pkg1/\'http://download.oracle.com/javase/8/docs/technotes/guides/indexC2.html\'>"
         }
     };
     private static final String[] ARGS =
             new String[]{
-        "-d", BUG_ID, "-sourcepath", SRC_DIR, "-use", "pkg1"
+        "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "-use", "pkg1"
     };
 
     /**
@@ -55,21 +54,7 @@
      */
     public static void main(String[] args) {
         TestSingleQuotedLink tester = new TestSingleQuotedLink();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NEGATED_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testSourceTab/TestSourceTab.java b/langtools/test/com/sun/javadoc/testSourceTab/TestSourceTab.java
index 33e8c33..e0a3281 100644
--- a/langtools/test/com/sun/javadoc/testSourceTab/TestSourceTab.java
+++ b/langtools/test/com/sun/javadoc/testSourceTab/TestSourceTab.java
@@ -37,12 +37,9 @@
 
 public class TestSourceTab extends JavadocTester {
 
-    private static final String BUG_ID = "4510979";
     private static final String TMP_SRC_DIR = "tmpSrc";
-    private static final String OUTPUT_DIR1 = BUG_ID + "-tabLengthEight";
-    private static final String OUTPUT_DIR2 = BUG_ID + "-tabLengthFour";
-    private static final String[][] TEST = NO_TEST;
-    private static final String[][] NEGATED_TEST = NO_TEST;
+    private static final String OUTPUT_DIR1 = OUTPUT_DIR + "-tabLengthEight";
+    private static final String OUTPUT_DIR2 = OUTPUT_DIR + "-tabLengthFour";
 
     //Run Javadoc on a source file with that is indented with a single tab per line
     private static final String[] ARGS1 =
@@ -61,14 +58,9 @@
         };
 
     //Files to diff
-    private static final String[][] FILES_TO_DIFF = {
-        {OUTPUT_DIR1 + "/src-html/C.html",
-         OUTPUT_DIR2 + "/src-html/C.html"
-        },
-        {OUTPUT_DIR1 + "/C.html",
-         OUTPUT_DIR2 + "/C.html"
-        }
-
+    private static final String[] FILES_TO_DIFF = {
+        "src-html/C.html",
+        "C.html"
     };
 
     /**
@@ -77,9 +69,9 @@
      */
     public static void main(String[] args) throws IOException {
         TestSourceTab tester = new TestSourceTab();
-        run(tester, ARGS1, TEST, NEGATED_TEST);
-        run(tester, ARGS2, TEST, NEGATED_TEST);
-        tester.runDiffs(FILES_TO_DIFF);
+        tester.run(ARGS1, NO_TEST, NO_TEST);
+        tester.run(ARGS2, NO_TEST, NO_TEST);
+        tester.runDiffs(OUTPUT_DIR1, OUTPUT_DIR2, FILES_TO_DIFF);
     }
 
     TestSourceTab() throws IOException {
@@ -121,18 +113,4 @@
             out.close();
         }
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testStylesheet/TestStylesheet.java b/langtools/test/com/sun/javadoc/testStylesheet/TestStylesheet.java
index 0af435d..65ceecd 100644
--- a/langtools/test/com/sun/javadoc/testStylesheet/TestStylesheet.java
+++ b/langtools/test/com/sun/javadoc/testStylesheet/TestStylesheet.java
@@ -33,31 +33,28 @@
 
 public class TestStylesheet extends JavadocTester {
 
-    //Test information.
-    private static final String BUG_ID = "4494033-7028815-7052425-8007338";
-
     //Javadoc arguments.
     private static final String[] ARGS = new String[] {
-        "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg"
+        "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg"
     };
 
     //Input for string search tests.
     private static final String[][] TEST = {
-        {BUG_ID + "/stylesheet.css",
+        { "stylesheet.css",
             "/* Javadoc style sheet */"},
-        {BUG_ID + "/stylesheet.css",
+        { "stylesheet.css",
             "/*\n" +
             "Overall document style\n" +
             "*/"},
-        {BUG_ID + "/stylesheet.css",
+        { "stylesheet.css",
             "/*\n" +
             "Heading styles\n" +
             "*/"},
-        {BUG_ID + "/stylesheet.css",
+        { "stylesheet.css",
             "/*\n" +
             "Navigation bar styles\n" +
             "*/"},
-        {BUG_ID + "/stylesheet.css",
+        { "stylesheet.css",
             "body {\n" +
             "    background-color:#ffffff;\n" +
             "    color:#353833;\n" +
@@ -65,11 +62,11 @@
             "    font-size:14px;\n" +
             "    margin:0;\n" +
             "}"},
-        {BUG_ID + "/stylesheet.css",
+        { "stylesheet.css",
             "ul {\n" +
             "    list-style-type:disc;\n" +
             "}"},
-        {BUG_ID + "/stylesheet.css",
+        { "stylesheet.css",
             ".overviewSummary caption, .memberSummary caption, .typeSummary caption,\n" +
             ".useSummary caption, .constantsSummary caption, .deprecatedSummary caption {\n" +
             "    position:relative;\n" +
@@ -85,7 +82,7 @@
             "    margin:0px;\n" +
             "    white-space:pre;\n" +
             "}"},
-        {BUG_ID + "/stylesheet.css",
+        { "stylesheet.css",
             ".overviewSummary caption span, .memberSummary caption span, .typeSummary caption span,\n" +
             ".useSummary caption span, .constantsSummary caption span, .deprecatedSummary caption span {\n" +
             "    white-space:nowrap;\n" +
@@ -99,7 +96,7 @@
             "    border: none;\n" +
             "    height:16px;\n" +
             "}"},
-        {BUG_ID + "/stylesheet.css",
+        { "stylesheet.css",
             ".memberSummary caption span.activeTableTab span {\n" +
             "    white-space:nowrap;\n" +
             "    padding-top:5px;\n" +
@@ -111,7 +108,7 @@
             "    background-color:#F8981D;\n" +
             "    height:16px;\n" +
             "}"},
-        {BUG_ID + "/stylesheet.css",
+        { "stylesheet.css",
             ".memberSummary caption span.tableTab span {\n" +
             "    white-space:nowrap;\n" +
             "    padding-top:5px;\n" +
@@ -123,7 +120,7 @@
             "    background-color:#4D7A97;\n" +
             "    height:16px;\n" +
             "}"},
-        {BUG_ID + "/stylesheet.css",
+        { "stylesheet.css",
             ".memberSummary caption span.tableTab, .memberSummary caption span.activeTableTab {\n" +
             "    padding-top:0px;\n" +
             "    padding-left:0px;\n" +
@@ -132,16 +129,16 @@
             "    float:none;\n" +
             "    display:inline;\n" +
             "}"},
-        {BUG_ID + "/stylesheet.css",
+        { "stylesheet.css",
             "@import url('resources/fonts/dejavu.css');"},
         // Test whether a link to the stylesheet file is inserted properly
         // in the class documentation.
-        {BUG_ID + "/pkg/A.html",
+        { "pkg/A.html",
             "<link rel=\"stylesheet\" type=\"text/css\" " +
             "href=\"../stylesheet.css\" title=\"Style\">"}
     };
     private static final String[][] NEGATED_TEST = {
-        {BUG_ID + "/stylesheet.css",
+        { "stylesheet.css",
             "* {\n" +
             "    margin:0;\n" +
             "    padding:0;\n" +
@@ -154,21 +151,7 @@
      */
     public static void main(String[] args) {
         TestStylesheet tester = new TestStylesheet();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NEGATED_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testSubTitle/TestSubTitle.java b/langtools/test/com/sun/javadoc/testSubTitle/TestSubTitle.java
index e3795b8..e5df260 100644
--- a/langtools/test/com/sun/javadoc/testSubTitle/TestSubTitle.java
+++ b/langtools/test/com/sun/javadoc/testSubTitle/TestSubTitle.java
@@ -34,28 +34,27 @@
 
 public class TestSubTitle extends JavadocTester {
 
-    private static final String BUG_ID = "7010342";
     private static final String[][] TEST = {
-        {BUG_ID + "/pkg/package-summary.html",
+        { "pkg/package-summary.html",
             "<div class=\"block\">This is the description of package pkg.</div>"
         },
-        {BUG_ID + "/pkg/C.html",
+        { "pkg/C.html",
             "<div class=\"subTitle\">pkg</div>"
         }
     };
     private static final String[][] NEG_TEST = {
-        {BUG_ID + "/pkg/package-summary.html",
+        { "pkg/package-summary.html",
             "<p class=\"subTitle\">\n" +
             "<div class=\"block\">This is the " +
             "description of package pkg.</div>\n" +
             "</p>"
         },
-        {BUG_ID + "/pkg/C.html",
+        { "pkg/C.html",
             "<p class=\"subTitle\">pkg</p>"
         }
     };
     private static final String[] ARGS = new String[]{
-        "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg"
+        "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg"
     };
 
     /**
@@ -64,21 +63,7 @@
      */
     public static void main(String[] args) {
         TestSubTitle tester = new TestSubTitle();
-        run(tester, ARGS, TEST, NEG_TEST);
+        tester.run(ARGS, TEST, NEG_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testSummaryHeading/TestSummaryHeading.java b/langtools/test/com/sun/javadoc/testSummaryHeading/TestSummaryHeading.java
index b8bf744..3f4cf51 100644
--- a/langtools/test/com/sun/javadoc/testSummaryHeading/TestSummaryHeading.java
+++ b/langtools/test/com/sun/javadoc/testSummaryHeading/TestSummaryHeading.java
@@ -36,19 +36,15 @@
 
 public class TestSummaryHeading extends JavadocTester {
 
-    //Test information.
-    private static final String BUG_ID = "4904036";
-
     //Javadoc arguments.
     private static final String[] ARGS = new String[] {
-        "-d", BUG_ID, "-sourcepath", SRC_DIR, SRC_DIR + "/C.java"
+        "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, SRC_DIR + "/C.java"
     };
 
     //Input for string search tests.
     private static final String[][] TEST = {
-        {BUG_ID + "/C.html",  "<h3>Method Summary</h3>"}
+        { "C.html",  "<h3>Method Summary</h3>"}
     };
-    private static final String[][] NEGATED_TEST = NO_TEST;
 
     /**
      * The entry point of the test.
@@ -56,21 +52,7 @@
      */
     public static void main(String[] args) {
         TestSummaryHeading tester = new TestSummaryHeading();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NO_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testSuperclassInSerialForm/TestSuperClassInSerialForm.java b/langtools/test/com/sun/javadoc/testSuperclassInSerialForm/TestSuperClassInSerialForm.java
index 0cee335..57751a9 100644
--- a/langtools/test/com/sun/javadoc/testSuperclassInSerialForm/TestSuperClassInSerialForm.java
+++ b/langtools/test/com/sun/javadoc/testSuperclassInSerialForm/TestSuperClassInSerialForm.java
@@ -35,16 +35,13 @@
 
 public class TestSuperClassInSerialForm extends JavadocTester {
 
-    private static final String BUG_ID = "4671694";
-
     private static final String[][] TEST = {
-        {BUG_ID + "/serialized-form.html",
+        { "serialized-form.html",
          "<a href=\"pkg/SubClass.html\" title=\"class in pkg\">pkg.SubClass</a> extends <a href=\"pkg/SuperClass.html\" title=\"class in pkg\">SuperClass</a>"}
     };
 
-    private static final String[][] NEGATED_TEST = NO_TEST;
     private static final String[] ARGS = new String[] {
-        "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg"
+        "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg"
     };
 
     /**
@@ -53,21 +50,7 @@
      */
     public static void main(String[] args) {
         TestSuperClassInSerialForm tester = new TestSuperClassInSerialForm();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NO_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testSupplementary/TestSupplementary.java b/langtools/test/com/sun/javadoc/testSupplementary/TestSupplementary.java
index eb7ff9c..8b09c1c 100644
--- a/langtools/test/com/sun/javadoc/testSupplementary/TestSupplementary.java
+++ b/langtools/test/com/sun/javadoc/testSupplementary/TestSupplementary.java
@@ -37,7 +37,6 @@
 
 public class TestSupplementary extends JavadocTester {
 
-    private static final String BUG_ID = "4914724";
     private static final String[][] TEST = {
         {WARNING_OUTPUT, "C.java:38: warning - Tag @see:illegal character: \"119040\" in \"C#method\ud834\udd00()"},
         {WARNING_OUTPUT, "C.java:44: warning - illegal character \ud801 in @serialField tag: field\ud801\ud801 int."},
@@ -50,7 +49,7 @@
         {WARNING_OUTPUT, "C.java:31: warning - illegal character"},
     };
     private static final String[] ARGS = new String[] {
-        "-locale", "en_US", "-d", BUG_ID, SRC_DIR + "/C.java"
+        "-locale", "en_US", "-d", OUTPUT_DIR, SRC_DIR + "/C.java"
     };
 
     /**
@@ -61,24 +60,10 @@
         Locale saveLocale = Locale.getDefault();
         try {
             TestSupplementary tester = new TestSupplementary();
-            run(tester, ARGS, TEST, NEGATED_TEST);
+            tester.run(ARGS, TEST, NEGATED_TEST);
             tester.printSummary();
         } finally {
             Locale.setDefault(saveLocale);
         }
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testTagHolderMethod/TestTagHolderMethod.java b/langtools/test/com/sun/javadoc/testTagHolderMethod/TestTagHolderMethod.java
index 29cc66c..7208285 100644
--- a/langtools/test/com/sun/javadoc/testTagHolderMethod/TestTagHolderMethod.java
+++ b/langtools/test/com/sun/javadoc/testTagHolderMethod/TestTagHolderMethod.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -21,8 +21,6 @@
  * questions.
  */
 
-import com.sun.javadoc.*;
-
 /*
  * @test
  * @bug 4706525
@@ -34,9 +32,10 @@
  * @run main TestTagHolderMethod
  */
 
+import com.sun.javadoc.*;
+
 public class TestTagHolderMethod extends JavadocTester {
 
-    private static final String BUG_ID = "4706525";
     public static final String[] ARGS = new String[] {
         "-docletpath", SRC_DIR, "-doclet", "TestTagHolderMethod", "-sourcepath",
                 SRC_DIR, "pkg"};
@@ -74,20 +73,7 @@
      * @param args the array of command line arguments.
      */
     public static void main(String[] args) {
-        run(new TestTagHolderMethod(), ARGS, new String[][]{}, new String[][]{});
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
+        JavadocTester tester = new TestTagHolderMethod();
+        tester.run(ARGS, new String[][]{}, new String[][]{});
     }
 }
diff --git a/langtools/test/com/sun/javadoc/testTagInheritence/TestTagInheritence.java b/langtools/test/com/sun/javadoc/testTagInheritence/TestTagInheritence.java
index 95e6f15..0a28435 100644
--- a/langtools/test/com/sun/javadoc/testTagInheritence/TestTagInheritence.java
+++ b/langtools/test/com/sun/javadoc/testTagInheritence/TestTagInheritence.java
@@ -34,10 +34,8 @@
 
 public class TestTagInheritence extends JavadocTester {
 
-    private static final String BUG_ID =
-        "4496223-4496270-4618686-4720974-4812240-6253614-6253604";
     private static final String[] ARGS = new String[] {
-        "-Xdoclint:none", "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg",
+        "-Xdoclint:none", "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg",
         "firstSentence", "firstSentence2"
     };
 
@@ -54,36 +52,20 @@
 
         //Test valid usage of inheritDoc tag.
         for (int i = 1; i < tests.length-2; i++) {
-            tests[i][0] = BUG_ID + "/pkg/TestTagInheritence.html";
+            tests[i][0] = "pkg/TestTagInheritence.html";
             tests[i][1] = "Test " + i + " passes";
         }
 
         //First sentence test (6253614)
-        tests[tests.length - 2][0] =BUG_ID + "/firstSentence/" +
-            "B.html";
+        tests[tests.length - 2][0] = "firstSentence/B.html";
         tests[tests.length - 2][1] =  "<div class=\"block\">First sentence.</div>";
 
         //Another first sentence test (6253604)
-        tests[tests.length - 1][0] =BUG_ID + "/firstSentence2/" +
-            "C.html";
+        tests[tests.length - 1][0] = "firstSentence2/C.html";
         tests[tests.length - 1][1] =  "<div class=\"block\">First sentence.</div>";
 
         TestTagInheritence tester = new TestTagInheritence();
-        run(tester, ARGS, tests, NO_TEST);
+        tester.run(ARGS, tests, NO_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testTagMisuse/TestTagMisuse.java b/langtools/test/com/sun/javadoc/testTagMisuse/TestTagMisuse.java
index 4818bc1..514ee73 100644
--- a/langtools/test/com/sun/javadoc/testTagMisuse/TestTagMisuse.java
+++ b/langtools/test/com/sun/javadoc/testTagMisuse/TestTagMisuse.java
@@ -32,16 +32,14 @@
  */
 public class TestTagMisuse extends JavadocTester {
 
-    private static final String BUG_ID = "no-bug-id";
     private static final String[][] TEST = {
         {WARNING_OUTPUT, "warning - Tag @param cannot be used in field documentation."},
         {WARNING_OUTPUT, "warning - Tag @throws cannot be used in field documentation."},
         {WARNING_OUTPUT, "warning - Tag @return cannot be used in constructor documentation."},
         {WARNING_OUTPUT, "warning - Tag @throws cannot be used in inline documentation."},
     };
-    private static final String[][] NEGATED_TEST = NO_TEST;
     private static final String[] ARGS = new String[] {
-        "-Xdoclint:none", "-d", BUG_ID, SRC_DIR + "/TestTagMisuse.java"
+        "-Xdoclint:none", "-d", OUTPUT_DIR, SRC_DIR + "/TestTagMisuse.java"
     };
 
     /**
@@ -50,25 +48,11 @@
      */
     public static void main(String[] args) {
         TestTagMisuse tester = new TestTagMisuse();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NO_TEST);
         tester.printSummary();
     }
 
     /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
-
-    /**
      * {@throws blah}
      * Here is a bad field tag:
      * @throws foo
diff --git a/langtools/test/com/sun/javadoc/testTagOutput/TestTagOutput.java b/langtools/test/com/sun/javadoc/testTagOutput/TestTagOutput.java
index 7629c51..09551ab 100644
--- a/langtools/test/com/sun/javadoc/testTagOutput/TestTagOutput.java
+++ b/langtools/test/com/sun/javadoc/testTagOutput/TestTagOutput.java
@@ -35,22 +35,21 @@
 
 public class TestTagOutput extends JavadocTester {
 
-    private static final String BUG_ID = "8026370";
     private static final String[][] TEST = {
-        {BUG_ID + "/pkg1/DeprecatedTag.html",
+        { "pkg1/DeprecatedTag.html",
             "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated.</span>&nbsp;</div>"},
-        {BUG_ID + "/pkg1/DeprecatedTag.html",
+        { "pkg1/DeprecatedTag.html",
             "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated.</span>&nbsp;" +
             "<span class=\"deprecationComment\">Do not use this.</span></div>"}};
 
     private static final String[][] NEGATED_TEST = {
-        {BUG_ID + "/pkg1/DeprecatedTag.html",
+        { "pkg1/DeprecatedTag.html",
             "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated." +
             "</span>&nbsp;<span class=\"deprecationComment\"></span></div>"}};
 
     private static final String[] ARGS =
         new String[] {
-            "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg1"};
+            "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg1"};
 
     /**
      * The entry point of the test.
@@ -58,21 +57,7 @@
      */
     public static void main(String[] args) {
         TestTagOutput tester = new TestTagOutput();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NEGATED_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testTaglets/TestTaglets.java b/langtools/test/com/sun/javadoc/testTaglets/TestTaglets.java
index 71a185d..43188a8 100644
--- a/langtools/test/com/sun/javadoc/testTaglets/TestTaglets.java
+++ b/langtools/test/com/sun/javadoc/testTaglets/TestTaglets.java
@@ -38,10 +38,6 @@
 
 public class TestTaglets extends JavadocTester {
 
-    //Test information.
-    private static final String BUG_ID = "4654308-4767038";
-    private static final String OUTPUT_DIR = BUG_ID;
-
     //Javadoc arguments.
     private static final String[] ARGS_4654308 = new String[] {
         "-d", "4654308", "-tagletpath", SRC_DIR, "-taglet", "taglets.Foo",
@@ -55,17 +51,15 @@
 
     //Input for string search tests.
     private static final String[][] TEST_4654308 = new String[][] {
-        {"4654308/C.html", "<span class=\"simpleTagLabel\">Foo:</span></dt>" +
+        { "C.html", "<span class=\"simpleTagLabel\">Foo:</span></dt>" +
                  "<dd>my only method is <a href=\"C.html#method--\"><code>here" +
                  "</code></a></dd></dl>"}
     };
-    private static final String[][] NEGATED_TEST_4654308 = NO_TEST;
 
     private static final String[][] TEST_4767038 = new String[][] {
-        {"4767038/Child.html",
+        { "Child.html",
             "This is the first sentence."}
     };
-    private static final String[][] NEGATED_TEST_4767038 = NO_TEST;
 
 
     /**
@@ -74,24 +68,10 @@
      */
     public static void main(String[] args) {
         TestTaglets tester = new TestTaglets();
-        run(tester, ARGS_4654308, TEST_4654308, NEGATED_TEST_4654308);
+        tester.run(ARGS_4654308, TEST_4654308, NO_TEST);
         tester.printSummary();
         tester = new TestTaglets();
-        run(tester, ARGS_4767038, TEST_4767038, NEGATED_TEST_4767038);
+        tester.run(ARGS_4767038, TEST_4767038, NO_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testThrowsHead/TestThrowsHead.java b/langtools/test/com/sun/javadoc/testThrowsHead/TestThrowsHead.java
index c9d523d..fca7de7 100644
--- a/langtools/test/com/sun/javadoc/testThrowsHead/TestThrowsHead.java
+++ b/langtools/test/com/sun/javadoc/testThrowsHead/TestThrowsHead.java
@@ -21,7 +21,7 @@
  * questions.
  */
 
-/**
+/*
  * @test
  * @bug 4530727 8026567
  * @summary When an exception is declared in the method signature but
@@ -36,13 +36,11 @@
 
 public class TestThrowsHead extends JavadocTester {
 
-    private static final String BUG_ID = "4530727";
     private static final String[][] TEST = {
-        {BUG_ID + "/C.html", "<dt><span class=\"throwsLabel\">Throws:</span>"}
+        { "C.html", "<dt><span class=\"throwsLabel\">Throws:</span>"}
     };
-    private static final String[][] NEGATED_TEST = NO_TEST;
     private static final String[] ARGS = new String[] {
-        "-d", BUG_ID, SRC_DIR + "/C.java"
+        "-d", OUTPUT_DIR, SRC_DIR + "/C.java"
     };
 
     /**
@@ -51,21 +49,7 @@
      */
     public static void main(String[] args) {
         TestThrowsHead tester = new TestThrowsHead();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NO_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testThrowsInheritence/TestThrowsTagInheritence.java b/langtools/test/com/sun/javadoc/testThrowsInheritence/TestThrowsTagInheritence.java
index 6cfc9de..543a8a0 100644
--- a/langtools/test/com/sun/javadoc/testThrowsInheritence/TestThrowsTagInheritence.java
+++ b/langtools/test/com/sun/javadoc/testThrowsInheritence/TestThrowsTagInheritence.java
@@ -36,18 +36,17 @@
 
 public class TestThrowsTagInheritence extends JavadocTester {
 
-    private static final String BUG_ID = "4684827-4633969";
     private static final String[][] TEST = {
         //The class should not inherit the tag from the interface.
-        {BUG_ID + "/Foo.html", "Test 1 passes."}
+        { "Foo.html", "Test 1 passes."}
     };
     private static final String[][] NEGATED_TEST = {
         //The class should not inherit the tag from the interface.
-        {BUG_ID + "/C.html", "Test 1 fails."}
+        { "C.html", "Test 1 fails."}
 
     };
     private static final String[] ARGS = new String[] {
-        "-d", BUG_ID, "-sourcepath", SRC_DIR, SRC_DIR + "/C.java",
+        "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, SRC_DIR + "/C.java",
         SRC_DIR + "/I.java", SRC_DIR + "/Foo.java",
         SRC_DIR + "/Iface.java"
     };
@@ -58,21 +57,7 @@
      */
     public static void main(String[] args) {
         TestThrowsTagInheritence tester = new TestThrowsTagInheritence();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NEGATED_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testThrowsTag/TestThrowsTag.java b/langtools/test/com/sun/javadoc/testThrowsTag/TestThrowsTag.java
index fd931d9..63d5280 100644
--- a/langtools/test/com/sun/javadoc/testThrowsTag/TestThrowsTag.java
+++ b/langtools/test/com/sun/javadoc/testThrowsTag/TestThrowsTag.java
@@ -35,17 +35,14 @@
 
 public class TestThrowsTag extends JavadocTester {
 
-    //Test information.
-    private static final String BUG_ID = "4985072";
-
     //Javadoc arguments.
     private static final String[] ARGS = new String[] {
-        "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg"
+        "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg"
     };
 
     //Input for string search tests.
     private static final String[][] TEST = {
-        {BUG_ID + "/pkg/C.html",
+        { "pkg/C.html",
             "<dd><code><a href=\"../pkg/T1.html\" title=\"class in pkg\">T1</a></code> - the first throws tag.</dd>\n" +
             "<dd><code><a href=\"../pkg/T2.html\" title=\"class in pkg\">T2</a></code> - the second throws tag.</dd>\n" +
             "<dd><code><a href=\"../pkg/T3.html\" title=\"class in pkg\">T3</a></code> - the third throws tag.</dd>\n" +
@@ -56,7 +53,6 @@
             "<dd><code><a href=\"../pkg/T8.html\" title=\"class in pkg\">T8</a></code> - the fourth inherited throws tag.</dd>"
         },
     };
-    private static final String[][] NEGATED_TEST = NO_TEST;
 
     /**
      * The entry point of the test.
@@ -64,21 +60,7 @@
      */
     public static void main(String[] args) {
         TestThrowsTag tester = new TestThrowsTag();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NO_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testTitleInHref/TestTitleInHref.java b/langtools/test/com/sun/javadoc/testTitleInHref/TestTitleInHref.java
index db433b1..1d21d60 100644
--- a/langtools/test/com/sun/javadoc/testTitleInHref/TestTitleInHref.java
+++ b/langtools/test/com/sun/javadoc/testTitleInHref/TestTitleInHref.java
@@ -34,26 +34,23 @@
 
 public class TestTitleInHref extends JavadocTester {
 
-    private static final String BUG_ID = "4714257";
-
     private static final String[][] TEST = {
         //Test to make sure that the title shows up in a class link.
-        {BUG_ID + "/pkg/Links.html",
+        { "pkg/Links.html",
             "<a href=\"../pkg/Class.html\" title=\"class in pkg\">"},
 
         //Test to make sure that the title shows up in an interface link.
-        {BUG_ID + "/pkg/Links.html",
+        { "pkg/Links.html",
             "<a href=\"../pkg/Interface.html\" title=\"interface in pkg\">"},
 
         //Test to make sure that the title shows up in cross link shows up
-        {BUG_ID + "/pkg/Links.html",
+        { "pkg/Links.html",
             "<a href=\"http://java.sun.com/j2se/1.4/docs/api/java/io/File.html?is-external=true\" title=\"class or interface in java.io\"><code>This is a cross link to class File</code></a>"},
 
     };
 
-    private static final String[][] NEGATED_TEST = NO_TEST;
     private static final String[] ARGS = new String[] {
-        "-d", BUG_ID, "-sourcepath", SRC_DIR,
+        "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR,
         "-linkoffline", "http://java.sun.com/j2se/1.4/docs/api",
         SRC_DIR, "pkg"
     };
@@ -64,21 +61,7 @@
      */
     public static void main(String[] args) {
         TestTitleInHref tester = new TestTitleInHref();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NO_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testTopOption/TestTopOption.java b/langtools/test/com/sun/javadoc/testTopOption/TestTopOption.java
index ae9924e..ba9de85 100644
--- a/langtools/test/com/sun/javadoc/testTopOption/TestTopOption.java
+++ b/langtools/test/com/sun/javadoc/testTopOption/TestTopOption.java
@@ -34,43 +34,39 @@
 
 public class TestTopOption extends JavadocTester {
 
-    //Test information.
-    private static final String BUG_ID = "6227616";
-
     //Javadoc arguments.
     private static final String[] ARGS = new String[] {
         "-overview", "SRC_DIR + '/' + overview.html", "-use", "-top",
-        "TOP TEXT", "-d", BUG_ID, "-sourcepath",
+        "TOP TEXT", "-d", OUTPUT_DIR, "-sourcepath",
         SRC_DIR, "pkg"
     };
 
     //Input for string search tests.
     private static final String[][] TEST = {
-        {BUG_ID + "/pkg/AnnotationType.html",
+        { "pkg/AnnotationType.html",
             "TOP TEXT"},
-        {BUG_ID + "/pkg/class-use/AnnotationType.html",
+        { "pkg/class-use/AnnotationType.html",
             "TOP TEXT"},
 
-        {BUG_ID + "/pkg/Cl.html",
+        { "pkg/Cl.html",
             "TOP TEXT"},
-        {BUG_ID + "/pkg/class-use/Cl.html",
+        { "pkg/class-use/Cl.html",
             "TOP TEXT"},
 
-        {BUG_ID + "/pkg/package-summary.html",
+        { "pkg/package-summary.html",
             "TOP TEXT"},
-        {BUG_ID + "/pkg/package-use.html",
+        { "pkg/package-use.html",
            "TOP TEXT"},
 
-        {BUG_ID + "/overview-summary.html",
+        { "overview-summary.html",
             "TOP TEXT"},
-        {BUG_ID + "/overview-tree.html",
+        { "overview-tree.html",
             "TOP TEXT"},
-        {BUG_ID + "/constant-values.html",
+        { "constant-values.html",
             "TOP TEXT"},
-        {BUG_ID + "/help-doc.html",
+        { "help-doc.html",
             "TOP TEXT"},
     };
-    private static final String[][] NEGATED_TEST = NO_TEST;
 
     /**
      * The entry point of the test.
@@ -78,21 +74,7 @@
      */
     public static void main(String[] args) {
         TestTopOption tester = new TestTopOption();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NO_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testTypeAnnotations/TestTypeAnnotations.java b/langtools/test/com/sun/javadoc/testTypeAnnotations/TestTypeAnnotations.java
index d15627d..7d896b1 100644
--- a/langtools/test/com/sun/javadoc/testTypeAnnotations/TestTypeAnnotations.java
+++ b/langtools/test/com/sun/javadoc/testTypeAnnotations/TestTypeAnnotations.java
@@ -34,26 +34,22 @@
 
 public class TestTypeAnnotations extends JavadocTester {
 
-    //Test information.
-    private static final String BUG_ID = "8005091-8009686";
-
     //Javadoc arguments.
     private static final String[] ARGS = new String[] {
-        "-d", BUG_ID, "-sourcepath", SRC_DIR, "-private", "typeannos"
+        "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "-private", "typeannos"
     };
 
     //Input for string search tests.
-    private static final String[][] NEGATED_TEST = NO_TEST;
     private static final String[][] TEST = {
         // Test for type annotations on Class Extends (ClassExtends.java).
-        {BUG_ID + "/typeannos/MyClass.html",
+        { "typeannos/MyClass.html",
             "extends <a href=\"../typeannos/ClassExtA.html\" title=\"annotation " +
             "in typeannos\">@ClassExtA</a> <a href=\"../typeannos/ParameterizedClass.html\" " +
             "title=\"class in typeannos\">ParameterizedClass</a>&lt;<a href=\"" +
             "../typeannos/ClassExtB.html\" title=\"annotation in typeannos\">" +
             "@ClassExtB</a> java.lang.String&gt;"
         },
-        {BUG_ID + "/typeannos/MyClass.html",
+        { "typeannos/MyClass.html",
             "implements <a href=\"../typeannos/ClassExtB.html\" title=\"" +
             "annotation in typeannos\">@ClassExtB</a> java.lang.CharSequence, " +
             "<a href=\"../typeannos/ClassExtA.html\" title=\"annotation in " +
@@ -62,7 +58,7 @@
             "<a href=\"../typeannos/ClassExtB.html\" title=\"annotation in " +
             "typeannos\">@ClassExtB</a> java.lang.String&gt;</pre>"
         },
-        {BUG_ID + "/typeannos/MyInterface.html",
+        { "typeannos/MyInterface.html",
             "extends <a href=\"../typeannos/ClassExtA.html\" title=\"annotation " +
             "in typeannos\">@ClassExtA</a> <a href=\"../typeannos/" +
             "ParameterizedInterface.html\" title=\"interface in typeannos\">" +
@@ -73,12 +69,12 @@
         },
 
         // Test for type annotations on Class Parameters (ClassParameters.java).
-        {BUG_ID + "/typeannos/ExtendsBound.html",
+        { "typeannos/ExtendsBound.html",
             "class <span class=\"typeNameLabel\">ExtendsBound&lt;K extends <a " +
             "href=\"../typeannos/ClassParamA.html\" title=\"annotation in " +
             "typeannos\">@ClassParamA</a> java.lang.String&gt;</span>"
         },
-        {BUG_ID + "/typeannos/ExtendsGeneric.html",
+        { "typeannos/ExtendsGeneric.html",
             "<pre>class <span class=\"typeNameLabel\">ExtendsGeneric&lt;K extends " +
             "<a href=\"../typeannos/ClassParamA.html\" title=\"annotation in " +
             "typeannos\">@ClassParamA</a> <a href=\"../typeannos/Unannotated.html\" " +
@@ -86,24 +82,24 @@
             "../typeannos/ClassParamB.html\" title=\"annotation in typeannos\">" +
             "@ClassParamB</a> java.lang.String&gt;&gt;</span>"
         },
-        {BUG_ID + "/typeannos/TwoBounds.html",
+        { "typeannos/TwoBounds.html",
             "<pre>class <span class=\"typeNameLabel\">TwoBounds&lt;K extends <a href=\"" +
             "../typeannos/ClassParamA.html\" title=\"annotation in typeannos\">" +
             "@ClassParamA</a> java.lang.String,V extends <a href=\"../typeannos/" +
             "ClassParamB.html\" title=\"annotation in typeannos\">@ClassParamB" +
             "</a> java.lang.String&gt;</span>"
         },
-        {BUG_ID + "/typeannos/Complex1.html",
+        { "typeannos/Complex1.html",
             "class <span class=\"typeNameLabel\">Complex1&lt;K extends <a href=\"../" +
             "typeannos/ClassParamA.html\" title=\"annotation in typeannos\">" +
             "@ClassParamA</a> java.lang.String &amp; java.lang.Runnable&gt;</span>"
         },
-        {BUG_ID + "/typeannos/Complex2.html",
+        { "typeannos/Complex2.html",
             "class <span class=\"typeNameLabel\">Complex2&lt;K extends java.lang." +
             "String &amp; <a href=\"../typeannos/ClassParamB.html\" title=\"" +
             "annotation in typeannos\">@ClassParamB</a> java.lang.Runnable&gt;</span>"
         },
-        {BUG_ID + "/typeannos/ComplexBoth.html",
+        { "typeannos/ComplexBoth.html",
             "class <span class=\"typeNameLabel\">ComplexBoth&lt;K extends <a href=\"" +
             "../typeannos/ClassParamA.html\" title=\"annotation in typeannos\"" +
             ">@ClassParamA</a> java.lang.String &amp; <a href=\"../typeannos/" +
@@ -112,24 +108,24 @@
         },
 
         // Test for type annotations on fields (Fields.java).
-        {BUG_ID + "/typeannos/DefaultScope.html",
+        { "typeannos/DefaultScope.html",
             "<pre><a href=\"../typeannos/Parameterized.html\" title=\"class in " +
             "typeannos\">Parameterized</a>&lt;<a href=\"../typeannos/FldA.html\" " +
             "title=\"annotation in typeannos\">@FldA</a> java.lang.String,<a " +
             "href=\"../typeannos/FldB.html\" title=\"annotation in typeannos\">" +
             "@FldB</a> java.lang.String&gt; bothTypeArgs</pre>"
         },
-        {BUG_ID + "/typeannos/DefaultScope.html",
+        { "typeannos/DefaultScope.html",
             "<pre><a href=\"../typeannos/FldA.html\" title=\"annotation in " +
             "typeannos\">@FldA</a> java.lang.String <a href=\"../typeannos/" +
             "FldB.html\" title=\"annotation in typeannos\">@FldB</a> [] " +
             "array1Deep</pre>"
         },
-        {BUG_ID + "/typeannos/DefaultScope.html",
+        { "typeannos/DefaultScope.html",
             "<pre>java.lang.String[] <a href=\"../typeannos/FldB.html\" " +
             "title=\"annotation in typeannos\">@FldB</a> [] array2SecondOld</pre>"
         },
-        {BUG_ID + "/typeannos/DefaultScope.html",
+        { "typeannos/DefaultScope.html",
             "<pre><a href=\"../typeannos/FldD.html\" title=\"annotation in " +
             "typeannos\">@FldD</a> java.lang.String <a href=\"../typeannos/" +
             "FldC.html\" title=\"annotation in typeannos\">@FldC</a> <a href=\"" +
@@ -138,7 +134,7 @@
             "typeannos\">@FldC</a> <a href=\"../typeannos/FldB.html\" title=\"" +
             "annotation in typeannos\">@FldB</a> [] array2Deep</pre>"
         },
-        {BUG_ID + "/typeannos/ModifiedScoped.html",
+        { "typeannos/ModifiedScoped.html",
             "<pre>public final&nbsp;<a href=\"../typeannos/Parameterized.html\" " +
             "title=\"class in typeannos\">Parameterized</a>&lt;<a href=\"../" +
             "typeannos/FldA.html\" title=\"annotation in typeannos\">@FldA</a> " +
@@ -150,30 +146,30 @@
             "title=\"annotation in typeannos\">@FldB</a> java.lang.String&gt; " +
             "nestedParameterized</pre>"
         },
-        {BUG_ID + "/typeannos/ModifiedScoped.html",
+        { "typeannos/ModifiedScoped.html",
             "<pre>public final&nbsp;<a href=\"../typeannos/FldA.html\" " +
             "title=\"annotation in typeannos\">@FldA</a> java.lang.String[][] " +
             "array2</pre>"
         },
 
         // Test for type annotations on method return types (MethodReturnType.java).
-        {BUG_ID + "/typeannos/MtdDefaultScope.html",
+        { "typeannos/MtdDefaultScope.html",
             "<pre>public&nbsp;&lt;T&gt;&nbsp;<a href=\"../typeannos/MRtnA.html\" " +
             "title=\"annotation in typeannos\">@MRtnA</a> java.lang.String" +
             "&nbsp;method()</pre>"
         },
-        {BUG_ID + "/typeannos/MtdDefaultScope.html",
+        { "typeannos/MtdDefaultScope.html",
             "<pre><a href=\"../typeannos/MRtnA.html\" title=\"annotation in " +
             "typeannos\">@MRtnA</a> java.lang.String <a href=\"../typeannos/" +
             "MRtnA.html\" title=\"annotation in typeannos\">@MRtnA</a> [] <a " +
             "href=\"../typeannos/MRtnB.html\" title=\"annotation in typeannos\">" +
             "@MRtnB</a> []&nbsp;array2Deep()</pre>"
         },
-        {BUG_ID + "/typeannos/MtdDefaultScope.html",
+        { "typeannos/MtdDefaultScope.html",
             "<pre><a href=\"../typeannos/MRtnA.html\" title=\"annotation in " +
             "typeannos\">@MRtnA</a> java.lang.String[][]&nbsp;array2()</pre>"
         },
-        {BUG_ID + "/typeannos/MtdModifiedScoped.html",
+        { "typeannos/MtdModifiedScoped.html",
             "<pre>public final&nbsp;<a href=\"../typeannos/MtdParameterized.html\" " +
             "title=\"class in typeannos\">MtdParameterized</a>&lt;<a href=\"../" +
             "typeannos/MRtnA.html\" title=\"annotation in typeannos\">@MRtnA</a> " +
@@ -187,12 +183,12 @@
         },
 
         // Test for type annotations on method type parameters (MethodTypeParameters.java).
-        {BUG_ID + "/typeannos/UnscopedUnmodified.html",
+        { "typeannos/UnscopedUnmodified.html",
             "<pre>&lt;K extends <a href=\"../typeannos/MTyParamA.html\" title=\"" +
             "annotation in typeannos\">@MTyParamA</a> java.lang.String&gt;" +
             "&nbsp;void&nbsp;methodExtends()</pre>"
         },
-        {BUG_ID + "/typeannos/UnscopedUnmodified.html",
+        { "typeannos/UnscopedUnmodified.html",
             "<pre>&lt;K extends <a href=\"../typeannos/MTyParamA.html\" title=\"" +
             "annotation in typeannos\">@MTyParamA</a> <a href=\"../typeannos/" +
             "MtdTyParameterized.html\" title=\"class in typeannos\">" +
@@ -200,12 +196,12 @@
             "title=\"annotation in typeannos\">@MTyParamB</a> java.lang.String" +
             "&gt;&gt;&nbsp;void&nbsp;nestedExtends()</pre>"
         },
-        {BUG_ID + "/typeannos/PublicModifiedMethods.html",
+        { "typeannos/PublicModifiedMethods.html",
             "<pre>public final&nbsp;&lt;K extends <a href=\"../typeannos/" +
             "MTyParamA.html\" title=\"annotation in typeannos\">@MTyParamA</a> " +
             "java.lang.String&gt;&nbsp;void&nbsp;methodExtends()</pre>"
         },
-        {BUG_ID + "/typeannos/PublicModifiedMethods.html",
+        { "typeannos/PublicModifiedMethods.html",
             "<pre>public final&nbsp;&lt;K extends <a href=\"../typeannos/" +
             "MTyParamA.html\" title=\"annotation in typeannos\">@MTyParamA</a> " +
             "java.lang.String,V extends <a href=\"../typeannos/MTyParamA.html\" " +
@@ -217,13 +213,13 @@
         },
 
         // Test for type annotations on parameters (Parameters.java).
-        {BUG_ID + "/typeannos/Parameters.html",
+        { "typeannos/Parameters.html",
             "<pre>void&nbsp;unannotated(<a href=\"../typeannos/" +
             "ParaParameterized.html\" title=\"class in typeannos\">" +
             "ParaParameterized</a>&lt;java.lang.String,java.lang.String&gt;" +
             "&nbsp;a)</pre>"
         },
-        {BUG_ID + "/typeannos/Parameters.html",
+        { "typeannos/Parameters.html",
             "<pre>void&nbsp;nestedParaParameterized(<a href=\"../typeannos/" +
             "ParaParameterized.html\" title=\"class in typeannos\">" +
             "ParaParameterized</a>&lt;<a href=\"../typeannos/ParamA.html\" " +
@@ -236,7 +232,7 @@
             "typeannos/ParamB.html\" title=\"annotation in typeannos\">@ParamB" +
             "</a> java.lang.String&gt;&nbsp;a)</pre>"
         },
-        {BUG_ID + "/typeannos/Parameters.html",
+        { "typeannos/Parameters.html",
             "<pre>void&nbsp;array2Deep(<a href=\"../typeannos/ParamA.html\" " +
             "title=\"annotation in typeannos\">@ParamA</a> java.lang.String " +
             "<a href=\"../typeannos/ParamA.html\" title=\"annotation in " +
@@ -245,37 +241,37 @@
         },
 
         // Test for type annotations on throws (Throws.java).
-        {BUG_ID + "/typeannos/ThrDefaultUnmodified.html",
+        { "typeannos/ThrDefaultUnmodified.html",
             "<pre>void&nbsp;oneException()\n" +
             "           throws <a href=\"../typeannos/ThrA.html\" title=\"" +
             "annotation in typeannos\">@ThrA</a> java.lang.Exception</pre>"
         },
-        {BUG_ID + "/typeannos/ThrDefaultUnmodified.html",
+        { "typeannos/ThrDefaultUnmodified.html",
             "<pre>void&nbsp;twoExceptions()\n" +
             "            throws <a href=\"../typeannos/ThrA.html\" title=\"" +
             "annotation in typeannos\">@ThrA</a> java.lang.RuntimeException,\n" +
             "                   <a href=\"../typeannos/ThrA.html\" title=\"" +
             "annotation in typeannos\">@ThrA</a> java.lang.Exception</pre>"
         },
-        {BUG_ID + "/typeannos/ThrPublicModified.html",
+        { "typeannos/ThrPublicModified.html",
             "<pre>public final&nbsp;void&nbsp;oneException(java.lang.String&nbsp;a)\n" +
             "                        throws <a href=\"../typeannos/ThrA.html\" " +
             "title=\"annotation in typeannos\">@ThrA</a> java.lang.Exception</pre>"
         },
-        {BUG_ID + "/typeannos/ThrPublicModified.html",
+        { "typeannos/ThrPublicModified.html",
             "<pre>public final&nbsp;void&nbsp;twoExceptions(java.lang.String&nbsp;a)\n" +
             "                         throws <a href=\"../typeannos/ThrA.html\" " +
             "title=\"annotation in typeannos\">@ThrA</a> java.lang.RuntimeException,\n" +
             "                                <a href=\"../typeannos/ThrA.html\" " +
             "title=\"annotation in typeannos\">@ThrA</a> java.lang.Exception</pre>"
         },
-        {BUG_ID + "/typeannos/ThrWithValue.html",
+        { "typeannos/ThrWithValue.html",
             "<pre>void&nbsp;oneException()\n" +
             "           throws <a href=\"../typeannos/ThrB.html\" title=\"" +
             "annotation in typeannos\">@ThrB</a>(<a href=\"../typeannos/" +
             "ThrB.html#value--\">value</a>=\"m\") java.lang.Exception</pre>"
         },
-        {BUG_ID + "/typeannos/ThrWithValue.html",
+        { "typeannos/ThrWithValue.html",
             "<pre>void&nbsp;twoExceptions()\n" +
             "            throws <a href=\"../typeannos/ThrB.html\" title=\"" +
             "annotation in typeannos\">@ThrB</a>(<a href=\"../typeannos/" +
@@ -285,33 +281,33 @@
         },
 
         // Test for type annotations on type parameters (TypeParameters.java).
-        {BUG_ID + "/typeannos/TestMethods.html",
+        { "typeannos/TestMethods.html",
             "<pre>&lt;K,V extends <a href=\"../typeannos/TyParaA.html\" title=\"" +
             "annotation in typeannos\">@TyParaA</a> java.lang.String&gt;&nbsp;" +
             "void&nbsp;secondAnnotated()</pre>"
         },
 
         // Test for type annotations on wildcard type (Wildcards.java).
-        {BUG_ID + "/typeannos/BoundTest.html",
+        { "typeannos/BoundTest.html",
             "<pre>void&nbsp;wcExtends(<a href=\"../typeannos/MyList.html\" " +
             "title=\"class in typeannos\">MyList</a>&lt;? extends <a href=\"" +
             "../typeannos/WldA.html\" title=\"annotation in typeannos\">@WldA" +
             "</a> java.lang.String&gt;&nbsp;l)</pre>"
         },
-        {BUG_ID + "/typeannos/BoundTest.html",
+        { "typeannos/BoundTest.html",
             "<pre><a href=\"../typeannos/MyList.html\" title=\"class in " +
             "typeannos\">MyList</a>&lt;? super <a href=\"../typeannos/WldA.html\" " +
             "title=\"annotation in typeannos\">@WldA</a> java.lang.String&gt;" +
             "&nbsp;returnWcSuper()</pre>"
         },
-        {BUG_ID + "/typeannos/BoundWithValue.html",
+        { "typeannos/BoundWithValue.html",
             "<pre>void&nbsp;wcSuper(<a href=\"../typeannos/MyList.html\" title=\"" +
             "class in typeannos\">MyList</a>&lt;? super <a href=\"../typeannos/" +
             "WldB.html\" title=\"annotation in typeannos\">@WldB</a>(<a href=\"" +
             "../typeannos/WldB.html#value--\">value</a>=\"m\") java.lang." +
             "String&gt;&nbsp;l)</pre>"
         },
-        {BUG_ID + "/typeannos/BoundWithValue.html",
+        { "typeannos/BoundWithValue.html",
             "<pre><a href=\"../typeannos/MyList.html\" title=\"class in " +
             "typeannos\">MyList</a>&lt;? extends <a href=\"../typeannos/WldB." +
             "html\" title=\"annotation in typeannos\">@WldB</a>(<a href=\"../" +
@@ -320,40 +316,40 @@
         },
 
         // Test for receiver annotations (Receivers.java).
-        {BUG_ID + "/typeannos/DefaultUnmodified.html",
+        { "typeannos/DefaultUnmodified.html",
             "<pre>void&nbsp;withException(<a href=\"../typeannos/RcvrA.html\" " +
             "title=\"annotation in typeannos\">@RcvrA</a>&nbsp;" +
             "DefaultUnmodified&nbsp;this)\n" +
             "            throws java." +
             "lang.Exception</pre>"
         },
-        {BUG_ID + "/typeannos/DefaultUnmodified.html",
+        { "typeannos/DefaultUnmodified.html",
             "<pre>java.lang.String&nbsp;nonVoid(<a href=\"../typeannos/RcvrA." +
             "html\" title=\"annotation in typeannos\">@RcvrA</a> <a href=\"../" +
             "typeannos/RcvrB.html\" title=\"annotation in typeannos\">@RcvrB" +
             "</a>(<a href=\"../typeannos/RcvrB.html#value--\">value</a>=\"m\")" +
             "&nbsp;DefaultUnmodified&nbsp;this)</pre>"
         },
-        {BUG_ID + "/typeannos/DefaultUnmodified.html",
+        { "typeannos/DefaultUnmodified.html",
             "<pre>&lt;T extends java.lang.Runnable&gt;&nbsp;void&nbsp;accept(" +
             "<a href=\"../typeannos/RcvrA.html\" title=\"annotation in " +
             "typeannos\">@RcvrA</a>&nbsp;DefaultUnmodified&nbsp;this,\n" +
             "                                           T&nbsp;r)\n" +
             "                                    throws java.lang.Exception</pre>"
         },
-        {BUG_ID + "/typeannos/PublicModified.html",
+        { "typeannos/PublicModified.html",
             "<pre>public final&nbsp;java.lang.String&nbsp;nonVoid(<a href=\"" +
             "../typeannos/RcvrA.html\" title=\"annotation in typeannos\">" +
             "@RcvrA</a>&nbsp;PublicModified&nbsp;this)</pre>"
         },
-        {BUG_ID + "/typeannos/PublicModified.html",
+        { "typeannos/PublicModified.html",
             "<pre>public final&nbsp;&lt;T extends java.lang.Runnable&gt;&nbsp;" +
             "void&nbsp;accept(<a href=\"../typeannos/RcvrA.html\" title=\"" +
             "annotation in typeannos\">@RcvrA</a>&nbsp;PublicModified&nbsp;this,\n" +
             "                                                        T&nbsp;r)\n" +
             "                                                 throws java.lang.Exception</pre>"
         },
-        {BUG_ID + "/typeannos/WithValue.html",
+        { "typeannos/WithValue.html",
             "<pre>&lt;T extends java.lang.Runnable&gt;&nbsp;void&nbsp;accept(" +
             "<a href=\"../typeannos/RcvrB.html\" title=\"annotation in " +
             "typeannos\">@RcvrB</a>(<a href=\"../typeannos/RcvrB.html#value--\">" +
@@ -361,17 +357,17 @@
             "                                           T&nbsp;r)\n" +
             "                                    throws java.lang.Exception</pre>"
         },
-        {BUG_ID + "/typeannos/WithFinal.html",
+        { "typeannos/WithFinal.html",
             "<pre>java.lang.String&nbsp;nonVoid(<a href=\"../typeannos/RcvrB." +
             "html\" title=\"annotation in typeannos\">@RcvrB</a>(<a href=\"../" +
             "typeannos/RcvrB.html#value--\">value</a>=\"m\")&nbsp;WithFinal" +
             "&nbsp;this)</pre>"
         },
-        {BUG_ID + "/typeannos/WithBody.html",
+        { "typeannos/WithBody.html",
             "<pre>void&nbsp;field(<a href=\"../typeannos/RcvrA.html\" title=\"" +
             "annotation in typeannos\">@RcvrA</a>&nbsp;WithBody&nbsp;this)</pre>"
         },
-        {BUG_ID + "/typeannos/Generic2.html",
+        { "typeannos/Generic2.html",
             "<pre>void&nbsp;test2(<a href=\"../typeannos/RcvrA.html\" title=\"" +
             "annotation in typeannos\">@RcvrA</a>&nbsp;Generic2&lt;X&gt;&nbsp;this)</pre>"
         }
@@ -383,21 +379,7 @@
      */
     public static void main(String[] args) {
         TestTypeAnnotations tester = new TestTypeAnnotations();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NO_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testTypeParams/TestTypeParameters.java b/langtools/test/com/sun/javadoc/testTypeParams/TestTypeParameters.java
index 2d7022ba..8607b04 100644
--- a/langtools/test/com/sun/javadoc/testTypeParams/TestTypeParameters.java
+++ b/langtools/test/com/sun/javadoc/testTypeParams/TestTypeParameters.java
@@ -37,54 +37,50 @@
 
 public class TestTypeParameters extends JavadocTester {
 
-    //Test information.
-    private static final String BUG_ID = "4927167-4974929-7010344";
-
     //Javadoc arguments.
     private static final String[] ARGS1 = new String[]{
-        "-d", BUG_ID, "-use", "-sourcepath", SRC_DIR,
+        "-d", OUTPUT_DIR, "-use", "-sourcepath", SRC_DIR,
         "pkg"
     };
     private static final String[] ARGS2 = new String[]{
-        "-d", BUG_ID, "-linksource", "-sourcepath", SRC_DIR,
+        "-d", OUTPUT_DIR, "-linksource", "-sourcepath", SRC_DIR,
         "pkg"
     };
 
     //Input for string search tests.
     private static final String[][] TEST1 = {
-        {BUG_ID + "/pkg/C.html",
+        { "pkg/C.html",
             "<td class=\"colFirst\"><code>&lt;W extends java.lang.String,V extends " +
             "java.util.List&gt;<br>java.lang.Object</code></td>"
         },
-        {BUG_ID + "/pkg/C.html",
+        { "pkg/C.html",
             "<code>&lt;T&gt;&nbsp;java.lang.Object</code>"
         },
-        {BUG_ID + "/pkg/package-summary.html",
+        { "pkg/package-summary.html",
             "C</a>&lt;E extends <a href=\"../pkg/Parent.html\" " +
             "title=\"class in pkg\">Parent</a>&gt;"
         },
-        {BUG_ID + "/pkg/class-use/Foo4.html",
+        { "pkg/class-use/Foo4.html",
             "<a href=\"../../pkg/ClassUseTest3.html\" title=\"class in pkg\">" +
             "ClassUseTest3</a>&lt;T extends <a href=\"../../pkg/ParamTest2.html\" " +
             "title=\"class in pkg\">ParamTest2</a>&lt;java.util.List&lt;? extends " +
             "<a href=\"../../pkg/Foo4.html\" title=\"class in pkg\">Foo4</a>&gt;&gt;&gt;"
         },
         //Nested type parameters
-        {BUG_ID + "/pkg/C.html",
+        { "pkg/C.html",
             "<a name=\"formatDetails-java.util.Collection-java.util.Collection-\">\n" +
             "<!--   -->\n" +
             "</a>"
         },
     };
     private static final String[][] TEST2 = {
-        {BUG_ID + "/pkg/ClassUseTest3.html",
+        { "pkg/ClassUseTest3.html",
             "public class <a href=\"../src-html/pkg/ClassUseTest3.html#line.28\">" +
             "ClassUseTest3</a>&lt;T extends <a href=\"../pkg/ParamTest2.html\" " +
             "title=\"class in pkg\">ParamTest2</a>&lt;java.util.List&lt;? extends " +
             "<a href=\"../pkg/Foo4.html\" title=\"class in pkg\">Foo4</a>&gt;&gt;&gt;"
         }
     };
-    private static final String[][] NEGATED_TEST = NO_TEST;
 
     /**
      * The entry point of the test.
@@ -92,22 +88,8 @@
      */
     public static void main(String[] args) {
         TestTypeParameters tester = new TestTypeParameters();
-        run(tester, ARGS1, TEST1, NEGATED_TEST);
-        run(tester, ARGS2, TEST2, NEGATED_TEST);
+        tester.run(ARGS1, TEST1, NO_TEST);
+        tester.run(ARGS2, TEST2, NO_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testUnnamedPackage/TestUnnamedPackage.java b/langtools/test/com/sun/javadoc/testUnnamedPackage/TestUnnamedPackage.java
index 2309e40..ff61c34 100644
--- a/langtools/test/com/sun/javadoc/testUnnamedPackage/TestUnnamedPackage.java
+++ b/langtools/test/com/sun/javadoc/testUnnamedPackage/TestUnnamedPackage.java
@@ -35,32 +35,29 @@
 
 public class TestUnnamedPackage extends JavadocTester {
 
-    //Test information.
-    private static final String BUG_ID = "4904075-4774450-5015144";
-
     //Javadoc arguments.
     private static final String[] ARGS = new String[] {
-        "-d", BUG_ID, "-sourcepath", SRC_DIR, SRC_DIR + "/C.java"
+        "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, SRC_DIR + "/C.java"
     };
 
     //Input for string search tests.
     private static final String[][] TEST = {
-        {BUG_ID + "/package-summary.html",
+        { "package-summary.html",
             "<h1 title=\"Package\" class=\"title\">Package&nbsp;&lt;Unnamed&gt;</h1>"
         },
-        {BUG_ID + "/package-summary.html",
+        { "package-summary.html",
             "This is a package comment for the unnamed package."
         },
-        {BUG_ID + "/package-summary.html",
+        { "package-summary.html",
             "This is a class in the unnamed package."
         },
-        {BUG_ID + "/package-tree.html",
+        { "package-tree.html",
             "<h1 class=\"title\">Hierarchy For Package &lt;Unnamed&gt;</h1>"
         },
-        {BUG_ID + "/index-all.html",
+        { "index-all.html",
             "title=\"class in &lt;Unnamed&gt;\""
         },
-        {BUG_ID + "/C.html", "<a href=\"package-summary.html\">"}
+        { "C.html", "<a href=\"package-summary.html\">"}
     };
     private static final String[][] NEGATED_TEST = {
         {ERROR_OUTPUT, "BadSource"},
@@ -72,21 +69,7 @@
      */
     public static void main(String[] args) {
         TestUnnamedPackage tester = new TestUnnamedPackage();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NEGATED_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testUseOption/TestUseOption.java b/langtools/test/com/sun/javadoc/testUseOption/TestUseOption.java
index cff9f7d..594c61a 100644
--- a/langtools/test/com/sun/javadoc/testUseOption/TestUseOption.java
+++ b/langtools/test/com/sun/javadoc/testUseOption/TestUseOption.java
@@ -34,8 +34,6 @@
 
 public class TestUseOption extends JavadocTester {
 
-    private static final String BUG_ID = "4496290-4985072-7006178-7068595";
-
     //Input for string search tests.
     private static final String[] TEST2 = {
         "Field in C1.",
@@ -55,37 +53,38 @@
     };
 
     private static final String[][] TEST3 = {
-        {BUG_ID + "-3/class-use/UsedInC.html", "Uses of <a href=" +
-                 "\"../UsedInC.html\" title=\"class in &lt;Unnamed&gt;\">" +
-                 "UsedInC</a> in <a href=\"../package-summary.html\">&lt;Unnamed&gt;</a>"
+        { "class-use/UsedInC.html",
+            "Uses of <a href=\"../UsedInC.html\" title=\"class in &lt;Unnamed&gt;\">" +
+            "UsedInC</a> in <a href=\"../package-summary.html\">&lt;Unnamed&gt;</a>"
         },
-        {BUG_ID + "-3/package-use.html", "<td class=\"colOne\">" +
-                 "<a href=\"class-use/UsedInC.html#%3CUnnamed%3E\">UsedInC</a>&nbsp;</td>"
+        { "package-use.html",
+            "<td class=\"colOne\">" +
+            "<a href=\"class-use/UsedInC.html#%3CUnnamed%3E\">UsedInC</a>&nbsp;</td>"
         }
     };
 
     private static final String[][] TEST4 = {
-        {BUG_ID + "-4/pkg2/class-use/C3.html", "<a href=" +
-                 "\"../../index.html?pkg2/class-use/C3.html\" target=\"_top\">" +
-                 "Frames</a></li>"
+        { "pkg2/class-use/C3.html",
+            "<a href=\"../../index.html?pkg2/class-use/C3.html\" target=\"_top\">" +
+            "Frames</a></li>"
         }
     };
 
     private static final String[] ARGS = new String[] {
-        "-d", BUG_ID, "-sourcepath", SRC_DIR, "-use", "pkg1", "pkg2"
+        "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "-use", "pkg1", "pkg2"
     };
 
     private static final String[] ARGS2 = new String[] {
-        "-d", BUG_ID+"-2", "-sourcepath", SRC_DIR, "-use", "pkg1", "pkg2"
+        "-d", OUTPUT_DIR+"-2", "-sourcepath", SRC_DIR, "-use", "pkg1", "pkg2"
     };
 
     private static final String[] ARGS3 = new String[] {
-        "-d", BUG_ID + "-3", "-sourcepath", SRC_DIR, "-use", SRC_DIR +
-        "/C.java", SRC_DIR + "/UsedInC.java"
+        "-d", OUTPUT_DIR + "-3", "-sourcepath", SRC_DIR, "-use",
+        SRC_DIR + "/C.java", SRC_DIR + "/UsedInC.java"
     };
 
     private static final String[] ARGS4 = new String[] {
-        "-d", BUG_ID + "-4", "-sourcepath", SRC_DIR, "-use", "pkg1", "pkg2"
+        "-d", OUTPUT_DIR + "-4", "-sourcepath", SRC_DIR, "-use", "pkg1", "pkg2"
     };
 
     /**
@@ -96,20 +95,19 @@
         String[][] tests = new String[11][2];
         //Eight tests for class use.
         for (int i = 0; i < 8; i++) {
-            tests[i][0] = BUG_ID + "/pkg1/class-use/C1.html";
+            tests[i][0] = "pkg1/class-use/C1.html";
             tests[i][1] = "Test " + (i + 1) + " passes";
         }
         //Three more tests for package use.
         for (int i = 8, j = 1; i < tests.length; i++, j++) {
-            tests[i][0] = BUG_ID + "/pkg1/package-use.html";
+            tests[i][0] = "pkg1/package-use.html";
             tests[i][1] = "Test " + j + " passes";
         }
         TestUseOption tester = new TestUseOption();
-        run(tester, ARGS, tests, NO_TEST);
+        tester.run(ARGS, tests, NO_TEST);
         tester.printSummary();
-        run(tester, ARGS2, NO_TEST, NO_TEST);
-        String usePageContents = tester.readFileToString(BUG_ID +
-            "-2/pkg1/class-use/UsedClass.html");
+        tester.run(ARGS2, NO_TEST, NO_TEST);
+        String usePageContents = tester.readFileToString("pkg1/class-use/UsedClass.html");
         int prevIndex = -1;
         int currentIndex = -1;
         for (int i = 0; i < TEST2.length; i++) {
@@ -120,22 +118,8 @@
             prevIndex = currentIndex;
         }
         tester.printSummary();
-        run(tester, ARGS3, TEST3, NO_TEST);
-        run(tester, ARGS4, TEST4, NO_TEST);
+        tester.run(ARGS3, TEST3, NO_TEST);
+        tester.run(ARGS4, TEST4, NO_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testValueTag/TestValueTag.java b/langtools/test/com/sun/javadoc/testValueTag/TestValueTag.java
index cae1d70..1c34fd5 100644
--- a/langtools/test/com/sun/javadoc/testValueTag/TestValueTag.java
+++ b/langtools/test/com/sun/javadoc/testValueTag/TestValueTag.java
@@ -34,66 +34,63 @@
 
 public class TestValueTag extends JavadocTester {
 
-    //Test information.
-    private static final String BUG_ID = "4764045";
-
     //Javadoc arguments.
     private static final String[] ARGS =
         new String[] {
-            "-d", BUG_ID, "-sourcepath", SRC_DIR, "-tag",
+            "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "-tag",
             "todo", "pkg1", "pkg2"
         };
 
     private static final String[] ARGS1 =
         new String[] {
             "-Xdoclint:none",
-            "-d", BUG_ID + "-1", "-sourcepath", SRC_DIR, "-tag",
+            "-d", OUTPUT_DIR + "-1", "-sourcepath", SRC_DIR, "-tag",
             "todo", "pkg1", "pkg2"
         };
 
     //Input for string search tests.
     private static final String[][] TEST = {
         //Base case:  using @value on a constant.
-        {BUG_ID + "/pkg1/Class1.html",
+        { "pkg1/Class1.html",
             "Result:  \"Test 1 passes\""},
         //Retrieve value of constant in same class.
-        {BUG_ID + "/pkg1/Class1.html",
+        { "pkg1/Class1.html",
             "Result:  <a href=\"../pkg1/Class1.html#TEST_2_PASSES\">\"Test 2 passes\"</a>"},
-        {BUG_ID + "/pkg1/Class1.html",
+        { "pkg1/Class1.html",
             "Result:  <a href=\"../pkg1/Class1.html#TEST_3_PASSES\">\"Test 3 passes\"</a>"},
-        {BUG_ID + "/pkg1/Class1.html",
+        { "pkg1/Class1.html",
             "Result:  <a href=\"../pkg1/Class1.html#TEST_4_PASSES\">\"Test 4 passes\"</a>"},
-        {BUG_ID + "/pkg1/Class1.html",
+        { "pkg1/Class1.html",
             "Result:  <a href=\"../pkg1/Class1.html#TEST_5_PASSES\">\"Test 5 passes\"</a>"},
-        {BUG_ID + "/pkg1/Class1.html",
+        { "pkg1/Class1.html",
             "Result:  <a href=\"../pkg1/Class1.html#TEST_6_PASSES\">\"Test 6 passes\"</a>"},
         //Retrieve value of constant in different class.
-        {BUG_ID + "/pkg1/Class2.html",
+        { "pkg1/Class2.html",
             "Result:  <a href=\"../pkg1/Class1.html#TEST_7_PASSES\">\"Test 7 passes\"</a>"},
-        {BUG_ID + "/pkg1/Class2.html",
+        { "pkg1/Class2.html",
             "Result:  <a href=\"../pkg1/Class1.html#TEST_8_PASSES\">\"Test 8 passes\"</a>"},
-        {BUG_ID + "/pkg1/Class2.html",
+        { "pkg1/Class2.html",
             "Result:  <a href=\"../pkg1/Class1.html#TEST_9_PASSES\">\"Test 9 passes\"</a>"},
-        {BUG_ID + "/pkg1/Class2.html",
+        { "pkg1/Class2.html",
             "Result:  <a href=\"../pkg1/Class1.html#TEST_10_PASSES\">\"Test 10 passes\"</a>"},
-        {BUG_ID + "/pkg1/Class2.html",
+        { "pkg1/Class2.html",
             "Result:  <a href=\"../pkg1/Class1.html#TEST_11_PASSES\">\"Test 11 passes\"</a>"},
         //Retrieve value of constant in different package
-        {BUG_ID + "/pkg1/Class2.html",
+        { "pkg1/Class2.html",
             "Result:  <a href=\"../pkg2/Class3.html#TEST_12_PASSES\">\"Test 12 passes\"</a>"},
-        {BUG_ID + "/pkg1/Class2.html",
+        { "pkg1/Class2.html",
             "Result:  <a href=\"../pkg2/Class3.html#TEST_13_PASSES\">\"Test 13 passes\"</a>"},
-        {BUG_ID + "/pkg1/Class2.html",
+        { "pkg1/Class2.html",
             "Result:  <a href=\"../pkg2/Class3.html#TEST_14_PASSES\">\"Test 14 passes\"</a>"},
-        {BUG_ID + "/pkg1/Class2.html",
+        { "pkg1/Class2.html",
             "Result:  <a href=\"../pkg2/Class3.html#TEST_15_PASSES\">\"Test 15 passes\"</a>"},
-        {BUG_ID + "/pkg1/Class2.html",
+        { "pkg1/Class2.html",
             "Result:  <a href=\"../pkg2/Class3.html#TEST_16_PASSES\">\"Test 16 passes\"</a>"},
         //Retrieve value of constant from a package page
-        {BUG_ID + "/pkg2/package-summary.html",
+        { "pkg2/package-summary.html",
             "Result: <a href=\"../pkg2/Class3.html#TEST_17_PASSES\">\"Test 17 passes\"</a>"},
         //Test @value tag used with custom tag.
-        {BUG_ID + "/pkg1/CustomTagUsage.html",
+        { "pkg1/CustomTagUsage.html",
             "<dt><span class=\"simpleTagLabel\">Todo:</span></dt>\n" +
                 "<dd>the value of this constant is 55.</dd>"},
         //Test @value errors printed dues to invalid use or when used with
@@ -144,7 +141,7 @@
     };
     private static final String[][] NEGATED_TEST = {
         //Base case:  using @value on a constant.
-        {BUG_ID + "/pkg1/Class1.html",
+        { "pkg1/Class1.html",
             "Result:  <a href=\"../pkg1/Class1.html#TEST_12_ERROR\">\"Test 12 " +
             "generates an error message\"</a>"},
     };
@@ -155,9 +152,9 @@
      */
     public static void main(String[] args) {
         TestValueTag tester = new TestValueTag();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NEGATED_TEST);
         checkForException(tester);
-        run(tester, ARGS1, TEST1, NO_TEST);
+        tester.run(ARGS1, TEST1, NO_TEST);
         checkForException(tester);
         tester.printSummary();
     }
@@ -167,18 +164,4 @@
             throw new AssertionError("javadoc threw DocletAbortException");
         }
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testWarnBadParamNames/TestWarnBadParamNames.java b/langtools/test/com/sun/javadoc/testWarnBadParamNames/TestWarnBadParamNames.java
index c8f45dd..637d4d6 100644
--- a/langtools/test/com/sun/javadoc/testWarnBadParamNames/TestWarnBadParamNames.java
+++ b/langtools/test/com/sun/javadoc/testWarnBadParamNames/TestWarnBadParamNames.java
@@ -35,15 +35,13 @@
 
 public class TestWarnBadParamNames extends JavadocTester {
 
-    private static final String BUG_ID = "4693440";
     private static final String[][] TEST = {
         {WARNING_OUTPUT, "warning - @param argument \"int\" is not a parameter name."},
         {WARNING_OUTPUT, "warning - @param argument \"IDontExist\" is not a parameter name."},
         {WARNING_OUTPUT, "warning - Parameter \"arg\" is documented more than once."},
     };
-    private static final String[][] NEGATED_TEST = NO_TEST;
     private static final String[] ARGS = new String[] {
-        "-Xdoclint:none", "-d", BUG_ID, SRC_DIR + "/C.java"
+        "-Xdoclint:none", "-d", OUTPUT_DIR, SRC_DIR + "/C.java"
     };
 
     /**
@@ -52,21 +50,7 @@
      */
     public static void main(String[] args) {
         TestWarnBadParamNames tester = new TestWarnBadParamNames();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NO_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testWarnings/TestWarnings.java b/langtools/test/com/sun/javadoc/testWarnings/TestWarnings.java
index f5b3167..37884dd 100644
--- a/langtools/test/com/sun/javadoc/testWarnings/TestWarnings.java
+++ b/langtools/test/com/sun/javadoc/testWarnings/TestWarnings.java
@@ -38,16 +38,13 @@
 
 public class TestWarnings extends JavadocTester {
 
-    //Test information.
-    private static final String BUG_ID = "4515705-4804296-4702454-4697036";
-
     //Javadoc arguments.
     private static final String[] ARGS = new String[] {
-        "-Xdoclint:none", "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg"
+        "-Xdoclint:none", "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg"
     };
 
     private static final String[] ARGS2 = new String[] {
-        "-Xdoclint:none", "-d", BUG_ID, "-private", "-sourcepath", SRC_DIR,
+        "-Xdoclint:none", "-d", OUTPUT_DIR, "-private", "-sourcepath", SRC_DIR,
         "pkg"
     };
 
@@ -60,45 +57,29 @@
 
     };
     private static final String[][] NEGATED_TEST = {
-        {BUG_ID + "/pkg/X.html", "can't find m()"},
-        {BUG_ID + "/pkg/X.html", "can't find X()"},
-        {BUG_ID + "/pkg/X.html", "can't find f"},
+        { "pkg/X.html", "can't find m()"},
+        { "pkg/X.html", "can't find X()"},
+        { "pkg/X.html", "can't find f"},
     };
 
     private static final String[][] TEST2 = {
-        {BUG_ID + "/pkg/X.html",
+        { "pkg/X.html",
             "<a href=\"../pkg/X.html#m--\"><code>m()</code></a><br/>"},
-        {BUG_ID + "/pkg/X.html",
+        { "pkg/X.html",
             "<a href=\"../pkg/X.html#X--\"><code>X()</code></a><br/>"},
-        {BUG_ID + "/pkg/X.html",
+        { "pkg/X.html",
             "<a href=\"../pkg/X.html#f\"><code>f</code></a><br/>"},
     };
 
-    private static final String[][] NEGATED_TEST2 = NO_TEST;
-
-
     /**
      * The entry point of the test.
      * @param args the array of command line arguments.
      */
     public static void main(String[] args) {
         TestWarnings tester = new TestWarnings();
-        run(tester, ARGS, TEST, NEGATED_TEST);
-        run(tester, ARGS2, TEST2, NEGATED_TEST2);
+        tester.run(ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS2, TEST2, NO_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testWindowTitle/TestWindowTitle.java b/langtools/test/com/sun/javadoc/testWindowTitle/TestWindowTitle.java
index 392834a..cfeb106 100644
--- a/langtools/test/com/sun/javadoc/testWindowTitle/TestWindowTitle.java
+++ b/langtools/test/com/sun/javadoc/testWindowTitle/TestWindowTitle.java
@@ -33,24 +33,23 @@
 
 public class TestWindowTitle extends JavadocTester {
 
-    private static final String BUG_ID = "8016675";
     //Window title with JavaScript special characters.
     private static final String TITLE_JS_CHARS =
             "Testing \"Window 'Title'\" with a \\ backslash and a / " +
             "forward slash and a \u00e8 unicode char also a    tab and also a " +
             "\t special character another \u0002 unicode)";
     private static final String[] ARGS_JS_CHARS = new String[]{
-        "-d", BUG_ID + "-1", "-windowtitle", TITLE_JS_CHARS, "-sourcepath", SRC_DIR, "p1", "p2"
+        "-d", OUTPUT_DIR + "-1", "-windowtitle", TITLE_JS_CHARS, "-sourcepath", SRC_DIR, "p1", "p2"
     };
     private static final String[][] TEST_JS_CHARS = {
-        {BUG_ID + "-1/overview-summary.html",
+        { "overview-summary.html",
             "parent.document.title=\"Overview (Testing \\\"Window \\\'Title\\\'\\\" " +
             "with a \\\\ backslash and a / forward slash and a \\u00E8 unicode char " +
             "also a    tab and also a \\t special character another \\u0002 unicode))\";"
         },
     };
     private static final String[][] NEG_TEST_JS_CHARS = {
-        {BUG_ID + "-1/overview-summary.html",
+        { "overview-summary.html",
             "parent.document.title=\"Overview (Testing \"Window \'Title\'\" " +
             "with a \\ backslash and a / forward slash and a \u00E8 unicode char " +
             "also a    tab and also a \t special character another \u0002 unicode))\";"
@@ -61,24 +60,24 @@
     private static final String TITLE_SCRIPT_TAG =
             "Testing script tag in title </title><script>alert(\"Should not pop up\")</script>.";
     private static final String[] ARGS_SCRIPT_TAG = new String[]{
-        "-d", BUG_ID + "-2", "-windowtitle", TITLE_SCRIPT_TAG, "-sourcepath", SRC_DIR, "p1", "p2"
+        "-d", OUTPUT_DIR + "-2", "-windowtitle", TITLE_SCRIPT_TAG, "-sourcepath", SRC_DIR, "p1", "p2"
     };
     private static final String[][] TEST_SCRIPT_TAG = {
-        {BUG_ID + "-2/overview-summary.html",
+        { "overview-summary.html",
             "parent.document.title=\"Overview (Testing script tag in title alert" +
             "(\\\"Should not pop up\\\").)\";"
         },
-        {BUG_ID + "-2/p2/C2.html",
+        { "p2/C2.html",
             "parent.document.title=\"C2 (Testing script tag in title alert" +
             "(\\\"Should not pop up\\\").)\";"
         }
     };
     private static final String[][] NEG_TEST_SCRIPT_TAG = {
-        {BUG_ID + "-2/overview-summary.html",
+        { "overview-summary.html",
             "parent.document.title=\"Overview (Testing script tag in title </title><script>" +
             "alert(\\\"Should not pop up\\\")</script>.)\";"
         },
-        {BUG_ID + "-2/p2/C2.html",
+        { "p2/C2.html",
             "parent.document.title=\"C2 (Testing script tag in title </title><script>" +
             "alert(\\\"Should not pop up\\\")</script>.)\";"
         }
@@ -89,18 +88,18 @@
             "Testing another <p>HTML</p> tag. Another <h1>tag</h1>. A " +
             "<span id=\"testTag\">tag with attributes</span>. <script and </p are not tags.";
     private static final String[] ARGS_HTML_TAGS = new String[]{
-        "-d", BUG_ID + "-3", "-windowtitle", TITLE_HTML_TAGS,
+        "-d", OUTPUT_DIR + "-3", "-windowtitle", TITLE_HTML_TAGS,
         "-sourcepath", SRC_DIR,
         "p1", "p2"
     };
     private static final String[][] TEST_HTML_TAGS = {
-        {BUG_ID + "-3/overview-summary.html",
+        { "overview-summary.html",
             "parent.document.title=\"Overview (Testing another HTML tag. Another tag. A " +
             "tag with attributes. <script and </p are not tags.)\";"
         }
     };
     private static final String[][] NEG_TEST_HTML_TAGS = {
-        {BUG_ID + "-3/overview-summary.html",
+        { "overview-summary.html",
             "parent.document.title=\"Overview (Testing another <p>HTML</p> tag. Another " +
             "<h1>tag</h1>. A <span id=\"testTag\">tag with attributes</span>. <script and " +
             "</p are not tags.)\";"
@@ -111,18 +110,18 @@
     private static final String TITLE_HTML_ENTITIES =
             "Testing entities &lt;script&gt;alert(\"Should not pop up\")&lt;/script&gt;.";
     private static final String[] ARGS_HTML_ENTITIES = new String[]{
-        "-d", BUG_ID + "-4", "-windowtitle", TITLE_HTML_ENTITIES,
+        "-d", OUTPUT_DIR + "-4", "-windowtitle", TITLE_HTML_ENTITIES,
         "-sourcepath", SRC_DIR,
         "p1", "p2"
     };
     private static final String[][] TEST_HTML_ENTITIES = {
-        {BUG_ID + "-4/overview-summary.html",
+        { "overview-summary.html",
             "parent.document.title=\"Overview (Testing entities &lt;script&gt;alert(\\\"Should " +
             "not pop up\\\")&lt;/script&gt;.)\";"
         }
     };
     private static final String[][] NEG_TEST_HTML_ENTITIES = {
-        {BUG_ID + "-4/overview-summary.html",
+        { "overview-summary.html",
             "parent.document.title=\"Overview (Testing entities alert(\\\"Should not pop up\\\").)\";"
         }
     };
@@ -131,15 +130,15 @@
     private static final String TITLE_EMPTY_TAGS =
             "</title><script></script>";
     private static final String[] ARGS_EMPTY_TAGS = new String[]{
-        "-d", BUG_ID + "-5", "-windowtitle", TITLE_EMPTY_TAGS, "-sourcepath", SRC_DIR, "p1", "p2"
+        "-d", OUTPUT_DIR + "-5", "-windowtitle", TITLE_EMPTY_TAGS, "-sourcepath", SRC_DIR, "p1", "p2"
     };
     private static final String[][] TEST_EMPTY_TAGS = {
-        {BUG_ID + "-5/overview-summary.html",
+        { "overview-summary.html",
             "parent.document.title=\"Overview\";"
         }
     };
     private static final String[][] NEG_TEST_EMPTY_TAGS = {
-        {BUG_ID + "-5/overview-summary.html",
+        { "overview-summary.html",
             "parent.document.title=\"Overview (</title><script></script>)\";"
         }
     };
@@ -148,16 +147,16 @@
     private static final String TITLE_UNICODE_CHARS =
             "Testing unicode \u003cscript\u003ealert(\"Should not pop up\")\u003c/script\u003e.";
     private static final String[] ARGS_UNICODE_CHARS = new String[]{
-        "-d", BUG_ID + "-6", "-windowtitle", TITLE_UNICODE_CHARS, "-sourcepath", SRC_DIR, "p1", "p2"
+        "-d", OUTPUT_DIR + "-6", "-windowtitle", TITLE_UNICODE_CHARS, "-sourcepath", SRC_DIR, "p1", "p2"
     };
     private static final String[][] TEST_UNICODE_CHARS = {
-        {BUG_ID + "-6/overview-summary.html",
+        { "overview-summary.html",
             "parent.document.title=\"Overview (Testing unicode alert(\\\"Should " +
             "not pop up\\\").)\";"
         }
     };
     private static final String[][] NEG_TEST_UNICODE_CHARS = {
-        {BUG_ID + "-6/overview-summary.html",
+        { "overview-summary.html",
             "parent.document.title=\"Overview (Testing unicode <script>alert(\\\"Should not pop up\\\")" +
             "</script>.)\";"
         }
@@ -167,20 +166,20 @@
     private static final String TITLE_EMPTY =
             "";
     private static final String[] ARGS_EMPTY_TITLE = new String[]{
-        "-d", BUG_ID + "-7", "-windowtitle", TITLE_EMPTY, "-sourcepath", SRC_DIR, "p1", "p2"
+        "-d", OUTPUT_DIR + "-7", "-windowtitle", TITLE_EMPTY, "-sourcepath", SRC_DIR, "p1", "p2"
     };
     private static final String[][] TEST_EMPTY = {
-        {BUG_ID + "-7/overview-summary.html",
+        { "overview-summary.html",
             "parent.document.title=\"Overview\";"
         }
     };
 
     //Test doctitle.
     private static final String[] ARGS_DOCTITLE = new String[]{
-        "-d", BUG_ID + "-8", "-doctitle", TITLE_JS_CHARS, "-sourcepath", SRC_DIR, "p1", "p2"
+        "-d", OUTPUT_DIR + "-8", "-doctitle", TITLE_JS_CHARS, "-sourcepath", SRC_DIR, "p1", "p2"
     };
     private static final String[][] NEG_TEST_DOCTITLE = {
-        {BUG_ID + "-8/overview-summary.html",
+        { "overview-summary.html",
             "parent.document.title=\"Overview (Testing \\\"Window \\\'Title\\\'\\\" " +
             "with a \\\\ backslash and a / forward slash and a \\u00E8 unicode char " +
             "also a    tab and also a \\t special character another \\u0002 unicode)\";"
@@ -193,28 +192,14 @@
      */
     public static void main(String[] args) {
         TestWindowTitle tester = new TestWindowTitle();
-        run(tester, ARGS_JS_CHARS, TEST_JS_CHARS, NEG_TEST_JS_CHARS);
-        run(tester, ARGS_SCRIPT_TAG, TEST_SCRIPT_TAG, NEG_TEST_SCRIPT_TAG);
-        run(tester, ARGS_HTML_TAGS, TEST_HTML_TAGS, NEG_TEST_HTML_TAGS);
-        run(tester, ARGS_HTML_ENTITIES, TEST_HTML_ENTITIES, NEG_TEST_HTML_ENTITIES);
-        run(tester, ARGS_EMPTY_TAGS, TEST_EMPTY_TAGS, NEG_TEST_EMPTY_TAGS);
-        run(tester, ARGS_UNICODE_CHARS, TEST_UNICODE_CHARS, NEG_TEST_UNICODE_CHARS);
-        run(tester, ARGS_EMPTY_TITLE, TEST_EMPTY, NO_TEST);
-        run(tester, ARGS_DOCTITLE, NO_TEST, NEG_TEST_DOCTITLE);
+        tester.run(ARGS_JS_CHARS, TEST_JS_CHARS, NEG_TEST_JS_CHARS);
+        tester.run(ARGS_SCRIPT_TAG, TEST_SCRIPT_TAG, NEG_TEST_SCRIPT_TAG);
+        tester.run(ARGS_HTML_TAGS, TEST_HTML_TAGS, NEG_TEST_HTML_TAGS);
+        tester.run(ARGS_HTML_ENTITIES, TEST_HTML_ENTITIES, NEG_TEST_HTML_ENTITIES);
+        tester.run(ARGS_EMPTY_TAGS, TEST_EMPTY_TAGS, NEG_TEST_EMPTY_TAGS);
+        tester.run(ARGS_UNICODE_CHARS, TEST_UNICODE_CHARS, NEG_TEST_UNICODE_CHARS);
+        tester.run(ARGS_EMPTY_TITLE, TEST_EMPTY, NO_TEST);
+        tester.run(ARGS_DOCTITLE, NO_TEST, NEG_TEST_DOCTITLE);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/testXOption/TestXOption.java b/langtools/test/com/sun/javadoc/testXOption/TestXOption.java
index 171e8ff..8d21b6e 100644
--- a/langtools/test/com/sun/javadoc/testXOption/TestXOption.java
+++ b/langtools/test/com/sun/javadoc/testXOption/TestXOption.java
@@ -32,17 +32,14 @@
 
 public class TestXOption extends JavadocTester {
 
-    //Test information.
-    private static final String BUG_ID = "8007687";
-
     //Javadoc arguments.
     private static final String[] ARGS = new String[] {
-        "-d", BUG_ID, "-sourcepath", SRC_DIR, "-X",
+        "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "-X",
             SRC_DIR + "/TestXOption.java"
     };
 
     private static final String[] ARGS2 = new String[] {
-        "-d", BUG_ID, "-sourcepath", SRC_DIR,
+        "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR,
             SRC_DIR + "/TestXOption.java"
     };
 
@@ -53,7 +50,6 @@
         {STANDARD_OUTPUT, "-Xdoclint "},
         {STANDARD_OUTPUT, "-Xdoclint:"},
     };
-    private static final String[][] NEGATED_TEST = NO_TEST;
 
     //The help option should not crash the doclet.
     private static final int EXPECTED_EXIT_CODE = 0;
@@ -64,22 +60,8 @@
      */
     public static void main(String[] args) {
         TestXOption tester = new TestXOption();
-        int actualExitCode = run(tester, ARGS, TEST, NEGATED_TEST);
+        int actualExitCode = tester.run(ARGS, TEST, NO_TEST);
         tester.checkExitCode(EXPECTED_EXIT_CODE, actualExitCode);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/com/sun/javadoc/typeAnnotations/smoke/TestSmoke.java b/langtools/test/com/sun/javadoc/typeAnnotations/smoke/TestSmoke.java
index 4032cc6..d2ab2ab 100644
--- a/langtools/test/com/sun/javadoc/typeAnnotations/smoke/TestSmoke.java
+++ b/langtools/test/com/sun/javadoc/typeAnnotations/smoke/TestSmoke.java
@@ -36,76 +36,73 @@
 
 public class TestSmoke extends JavadocTester {
 
-    //Test information.
-    private static final String BUG_ID = "8006735";
-
     //Javadoc arguments.
     private static final String[] ARGS = new String[] {
-        "-d", BUG_ID, "-private", "-sourcepath", SRC_DIR, "pkg"
+        "-d", OUTPUT_DIR, "-private", "-sourcepath", SRC_DIR, "pkg"
     };
 
     //Input for string search tests.
     private static final String[][] TEST = {
-        {BUG_ID + "/pkg/T0x1C.html", "@DA"},
-        {BUG_ID + "/pkg/T0x1D.html", "@DA"},
-        {BUG_ID + "/pkg/T0x0D.html", "@DA"},
-        {BUG_ID + "/pkg/T0x06.html", "@DA"},
-        {BUG_ID + "/pkg/T0x0B.html", "@DA"},
-        {BUG_ID + "/pkg/T0x0F.html", "@DA"},
+        { "pkg/T0x1C.html", "@DA"},
+        { "pkg/T0x1D.html", "@DA"},
+        { "pkg/T0x0D.html", "@DA"},
+        { "pkg/T0x06.html", "@DA"},
+        { "pkg/T0x0B.html", "@DA"},
+        { "pkg/T0x0F.html", "@DA"},
         /* @ignore 8013406: Test cases fail in javadoc test TestSmoke.java
-        {BUG_ID + "/pkg/T0x20.html", "@DA"},
+        { "pkg/T0x20.html", "@DA"},
         */
         /* @ignore 8013406: Test cases fail in javadoc test TestSmoke.java
-        {BUG_ID + "/pkg/T0x20A.html", "@DTPA"},
+        { "pkg/T0x20A.html", "@DTPA"},
         */
         /* @ignore 8013406: Test cases fail in javadoc test TestSmoke.java
-        {BUG_ID + "/pkg/T0x20B.html", "@DA"},
+        { "pkg/T0x20B.html", "@DA"},
         */
         /* @ignore 8013406: Test cases fail in javadoc test TestSmoke.java
-        {BUG_ID + "/pkg/T0x22.html", "@DA"},
+        { "pkg/T0x22.html", "@DA"},
         */
         /* @ignore 8013406: Test cases fail in javadoc test TestSmoke.java
-        {BUG_ID + "/pkg/T0x22A.html", "@DTPA"},
+        { "pkg/T0x22A.html", "@DTPA"},
         */
         /* @ignore 8013406: Test cases fail in javadoc test TestSmoke.java
-        {BUG_ID + "/pkg/T0x22B.html", "@DA"},
+        { "pkg/T0x22B.html", "@DA"},
         */
-        {BUG_ID + "/pkg/T0x10.html", "@DA"},
-        {BUG_ID + "/pkg/T0x10A.html", "@DA"},
-        {BUG_ID + "/pkg/T0x12.html", "@DA"},
-        {BUG_ID + "/pkg/T0x11.html", "@DA"},
-        {BUG_ID + "/pkg/T0x13.html", "@DA"},
-        {BUG_ID + "/pkg/T0x15.html", "@DA"},
-        {BUG_ID + "/pkg/T0x14.html", "@DA"},
-        {BUG_ID + "/pkg/T0x16.html", "@DA"}
+        { "pkg/T0x10.html", "@DA"},
+        { "pkg/T0x10A.html", "@DA"},
+        { "pkg/T0x12.html", "@DA"},
+        { "pkg/T0x11.html", "@DA"},
+        { "pkg/T0x13.html", "@DA"},
+        { "pkg/T0x15.html", "@DA"},
+        { "pkg/T0x14.html", "@DA"},
+        { "pkg/T0x16.html", "@DA"}
     };
 
     private static final String[][] NEGATED_TEST = {
-        {BUG_ID + "/pkg/T0x1C.html", "@A"},
-        {BUG_ID + "/pkg/T0x1D.html", "@A"},
-        {BUG_ID + "/pkg/T0x00.html", "@A"},
-        {BUG_ID + "/pkg/T0x01.html", "@A"},
-        {BUG_ID + "/pkg/T0x02.html", "@A"},
-        {BUG_ID + "/pkg/T0x04.html", "@A"},
-        {BUG_ID + "/pkg/T0x08.html", "@A"},
-        {BUG_ID + "/pkg/T0x0D.html", "@A"},
-        {BUG_ID + "/pkg/T0x06.html", "@A"},
-        {BUG_ID + "/pkg/T0x0B.html", "@A"},
-        {BUG_ID + "/pkg/T0x0F.html", "@A"},
-        {BUG_ID + "/pkg/T0x20.html", "@A"},
-        {BUG_ID + "/pkg/T0x20A.html", "@A"},
-        {BUG_ID + "/pkg/T0x20B.html", "@A"},
-        {BUG_ID + "/pkg/T0x22.html", "@A"},
-        {BUG_ID + "/pkg/T0x22A.html", "@A"},
-        {BUG_ID + "/pkg/T0x22B.html", "@A"},
-        {BUG_ID + "/pkg/T0x10.html", "@A"},
-        {BUG_ID + "/pkg/T0x10A.html", "@A"},
-        {BUG_ID + "/pkg/T0x12.html", "@A"},
-        {BUG_ID + "/pkg/T0x11.html", "@A"},
-        {BUG_ID + "/pkg/T0x13.html", "@A"},
-        {BUG_ID + "/pkg/T0x15.html", "@A"},
-        {BUG_ID + "/pkg/T0x14.html", "@A"},
-        {BUG_ID + "/pkg/T0x16.html", "@A"}
+        { "pkg/T0x1C.html", "@A"},
+        { "pkg/T0x1D.html", "@A"},
+        { "pkg/T0x00.html", "@A"},
+        { "pkg/T0x01.html", "@A"},
+        { "pkg/T0x02.html", "@A"},
+        { "pkg/T0x04.html", "@A"},
+        { "pkg/T0x08.html", "@A"},
+        { "pkg/T0x0D.html", "@A"},
+        { "pkg/T0x06.html", "@A"},
+        { "pkg/T0x0B.html", "@A"},
+        { "pkg/T0x0F.html", "@A"},
+        { "pkg/T0x20.html", "@A"},
+        { "pkg/T0x20A.html", "@A"},
+        { "pkg/T0x20B.html", "@A"},
+        { "pkg/T0x22.html", "@A"},
+        { "pkg/T0x22A.html", "@A"},
+        { "pkg/T0x22B.html", "@A"},
+        { "pkg/T0x10.html", "@A"},
+        { "pkg/T0x10A.html", "@A"},
+        { "pkg/T0x12.html", "@A"},
+        { "pkg/T0x11.html", "@A"},
+        { "pkg/T0x13.html", "@A"},
+        { "pkg/T0x15.html", "@A"},
+        { "pkg/T0x14.html", "@A"},
+        { "pkg/T0x16.html", "@A"}
     };
 
     /**
@@ -114,21 +111,7 @@
      */
     public static void main(String[] args) {
         TestSmoke tester = new TestSmoke();
-        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.run(ARGS, TEST, NEGATED_TEST);
         tester.printSummary();
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugId() {
-        return BUG_ID;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getBugName() {
-        return getClass().getName();
-    }
 }
diff --git a/langtools/test/tools/javac/T8029002/MultipleUpperBoundsIncorporationTest.java b/langtools/test/tools/javac/T8029002/MultipleUpperBoundsIncorporationTest.java
new file mode 100644
index 0000000..b707c9f
--- /dev/null
+++ b/langtools/test/tools/javac/T8029002/MultipleUpperBoundsIncorporationTest.java
@@ -0,0 +1,72 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8029002
+ * @summary javac should take multiple upper bounds into account in incorporation
+ * @compile MultipleUpperBoundsIncorporationTest.java
+ */
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class MultipleUpperBoundsIncorporationTest {
+
+    static class TestCase1 {
+        interface Task<E extends Exception> {}
+
+        class Comparator<T> {}
+
+        class CustomException extends Exception {}
+
+        class TaskQueue<E extends Exception, T extends Task<E>> {}
+
+        abstract class Test {
+            abstract <E extends Exception, T extends Task<E>> TaskQueue<E, T> create(Comparator<? super T> comparator);
+
+            void f(Comparator<Task<CustomException>> comp) {
+                TaskQueue<CustomException, Task<CustomException>> queue = create(comp);
+                queue.getClass();
+            }
+        }
+    }
+
+    static class TestCase2 {
+        public <T, E extends List<T>> E typedNull() {
+            return null;
+        }
+
+        public void call() {
+            ArrayList<String> list = typedNull();
+        }
+    }
+
+    static class TestCase3 {
+        interface I extends Iterable<String> {}
+
+        <T, Exp extends Iterable<T>> Exp typedNull() { return null; }
+        I i = typedNull();
+    }
+
+}
diff --git a/langtools/test/tools/javac/annotations/typeAnnotations/newlocations/AfterMethodTypeParams.java b/langtools/test/tools/javac/annotations/typeAnnotations/newlocations/AfterMethodTypeParams.java
new file mode 100644
index 0000000..e8ea34b
--- /dev/null
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/newlocations/AfterMethodTypeParams.java
@@ -0,0 +1,138 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug 8038788
+ * @summary Verify proper handling of annotations after method's type parameters.
+ * @build AfterMethodTypeParams
+ * @run main AfterMethodTypeParams
+ */
+
+import java.io.IOException;
+import java.io.StringWriter;
+import java.net.URI;
+import java.util.*;
+
+import javax.lang.model.element.Name;
+import javax.tools.*;
+
+import com.sun.source.tree.*;
+import com.sun.source.util.*;
+
+public class AfterMethodTypeParams {
+
+    public static void main(String... args) throws IOException {
+        new AfterMethodTypeParams().run();
+    }
+
+    void run() throws IOException {
+        JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
+
+        for (TestCase tc : testCases) {
+            String test = TEMPLATE.replace("CONTENT", tc.snippet);
+            List<JavaFileObject> files = Arrays.asList(new MyFileObject(test));
+            StringWriter out = new StringWriter();
+            List<String> options = Arrays.asList("-XDrawDiagnostics", "-XDshouldStopPolicy=FLOW");
+            JavacTask task = (JavacTask) compiler.getTask(out, null, null, options, null, files);
+
+            new TreePathScanner<Void, Void>() {
+                boolean seenAnnotation;
+                @Override
+                public Void visitAnnotation(AnnotationTree node, Void p) {
+                    Name name = ((IdentifierTree) node.getAnnotationType()).getName();
+                    seenAnnotation |= name.contentEquals("TA") || name.contentEquals("DA");
+                    return null;
+                }
+                @Override
+                public Void visitCompilationUnit(CompilationUnitTree node, Void p) {
+                    super.visitCompilationUnit(node, p);
+                    if (!seenAnnotation)
+                        error(test, "Annotation was missing");
+                    return null;
+                }
+            }.scan(task.parse(), null);
+
+            task.analyze();
+
+            if (!tc.error.equals(out.toString().trim())) {
+                error(test, "Incorrect errors: " + out.toString());
+            }
+        }
+
+        if (errors > 0) {
+            throw new IllegalStateException("Errors found");
+        }
+    }
+
+    int errors;
+
+    void error(String code, String error) {
+        System.out.println("Error detected: " + error);
+        System.out.println("Code:");
+        System.out.println(code);
+        errors++;
+    }
+
+    static String TEMPLATE =
+        "import java.lang.annotation.*;\n" +
+        "public class Test {\n" +
+        "    CONTENT\n" +
+        "}\n" +
+        "@Target({ElementType.METHOD, ElementType.CONSTRUCTOR})\n" +
+        "@interface DA { }\n" +
+        "@Target(ElementType.TYPE_USE)\n" +
+        "@interface TA { }\n";
+
+    static class MyFileObject extends SimpleJavaFileObject {
+        final String text;
+        public MyFileObject(String text) {
+            super(URI.create("myfo:/Test.java"), JavaFileObject.Kind.SOURCE);
+            this.text = text;
+        }
+        @Override
+        public CharSequence getCharContent(boolean ignoreEncodingErrors) {
+            return text;
+        }
+    }
+
+    static TestCase[] testCases = new TestCase[] {
+        new TestCase("<T> @DA int foo1() { return 0;}", ""),
+        new TestCase("<T> @DA void foo2() { }", ""),
+        new TestCase("<T> @TA int foo3() { return 0;}", ""),
+        new TestCase("<T> @TA void foo4() { }",
+                "Test.java:3:9: compiler.err.annotation.type.not.applicable"),
+        new TestCase("<T> @DA Test() { }", "Test.java:3:9: compiler.err.illegal.start.of.type"),
+        new TestCase("<T> @TA Test() { }", "Test.java:3:9: compiler.err.illegal.start.of.type"),
+    };
+
+    static class TestCase {
+        final String snippet;
+        final String error;
+        public TestCase(String snippet, String error) {
+            this.snippet = snippet;
+            this.error = error;
+        }
+    }
+}
+
diff --git a/langtools/test/tools/javac/classfiles/InnerClasses/SyntheticClasses.java b/langtools/test/tools/javac/classfiles/InnerClasses/SyntheticClasses.java
index 58a8f9a..7d6d562 100644
--- a/langtools/test/tools/javac/classfiles/InnerClasses/SyntheticClasses.java
+++ b/langtools/test/tools/javac/classfiles/InnerClasses/SyntheticClasses.java
@@ -41,7 +41,7 @@
 
     private void run() throws IOException, ConstantPoolException {
         File testClasses = new File(System.getProperty("test.classes"));
-        for (File classFile : testClasses.listFiles()) {
+        for (File classFile : testClasses.listFiles(f -> f.getName().endsWith(".class"))) {
             ClassFile cf = ClassFile.read(classFile);
             if (cf.getName().matches(".*\\$[0-9]+")) {
                 EnclosingMethod_attribute encl =
diff --git a/langtools/test/tools/javac/diags/examples.not-yet.txt b/langtools/test/tools/javac/diags/examples.not-yet.txt
index fc60fb0..9f58cf8 100644
--- a/langtools/test/tools/javac/diags/examples.not-yet.txt
+++ b/langtools/test/tools/javac/diags/examples.not-yet.txt
@@ -113,3 +113,4 @@
 compiler.warn.file.from.future                          # warning for future modification times on files
 compiler.err.cant.inherit.from.anon                     # error for subclass of anonymous class
 compiler.misc.bad.class.file                            # class file is malformed
+compiler.misc.bad.const.pool.entry                      # constant pool entry has wrong type
diff --git a/langtools/test/tools/javac/diags/examples/LambdaBodyNeitherValueNorVoidCompatible.java b/langtools/test/tools/javac/diags/examples/LambdaBodyNeitherValueNorVoidCompatible.java
new file mode 100644
index 0000000..6f87f40
--- /dev/null
+++ b/langtools/test/tools/javac/diags/examples/LambdaBodyNeitherValueNorVoidCompatible.java
@@ -0,0 +1,46 @@
+/*
+ * 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.
+ *
+ * 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.
+ */
+
+// key: compiler.err.lambda.body.neither.value.nor.void.compatible
+// key: compiler.err.cant.apply.symbol
+// key: compiler.misc.incompatible.ret.type.in.lambda
+// key: compiler.misc.missing.ret.val
+// key: compiler.misc.no.conforming.assignment.exists
+
+class LambdaBodyNeitherValueNorVoidCompatible {
+    interface I {
+        String f(String x);
+    }
+
+    static void foo(I i) {}
+
+    void m() {
+        foo((x) -> {
+            if (x == null) {
+                return;
+            } else {
+                return x;
+            }
+        });
+    }
+}
diff --git a/langtools/test/tools/javac/lambda/ErroneousLambdaExpr.out b/langtools/test/tools/javac/lambda/ErroneousLambdaExpr.out
deleted file mode 100644
index aeb312f..0000000
--- a/langtools/test/tools/javac/lambda/ErroneousLambdaExpr.out
+++ /dev/null
@@ -1,2 +0,0 @@
-ErroneousLambdaExpr.java:63:13: compiler.err.ref.ambiguous: call, kindname.method, call(ErroneousLambdaExpr.SAM1<T>), ErroneousLambdaExpr, kindname.method, call(ErroneousLambdaExpr.SAM2), ErroneousLambdaExpr
-1 error
diff --git a/langtools/test/tools/javac/lambda/ErroneousLambdaExpr.java b/langtools/test/tools/javac/lambda/LambdaExprLeadsToMissingClassFilesTest.java
similarity index 85%
rename from langtools/test/tools/javac/lambda/ErroneousLambdaExpr.java
rename to langtools/test/tools/javac/lambda/LambdaExprLeadsToMissingClassFilesTest.java
index 173f084..72f503c 100644
--- a/langtools/test/tools/javac/lambda/ErroneousLambdaExpr.java
+++ b/langtools/test/tools/javac/lambda/LambdaExprLeadsToMissingClassFilesTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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,16 +26,16 @@
  * @bug 8003280
  * @summary Add lambda tests
  *  stale state after speculative attribution round leads to missing classfiles
- * @compile/fail/ref=ErroneousLambdaExpr.out -XDrawDiagnostics ErroneousLambdaExpr.java
  */
-public class ErroneousLambdaExpr<T> {
+public class LambdaExprLeadsToMissingClassFilesTest<T> {
 
     static int assertionCount = 0;
 
     static void assertTrue(boolean cond) {
         assertionCount++;
-        if (!cond)
+        if (!cond) {
             throw new AssertionError();
+        }
     }
 
     interface SAM1<X> {
@@ -57,8 +57,8 @@
     void call(SAM3<T> s3) { assertTrue(false); }
 
     public static void main(String[] args) {
-        ErroneousLambdaExpr<StringBuilder> test =
-                new ErroneousLambdaExpr<>();
+        LambdaExprLeadsToMissingClassFilesTest<StringBuilder> test =
+                new LambdaExprLeadsToMissingClassFilesTest<>();
 
         test.call((builder, string) -> { builder.append(string); return builder; });
         assertTrue(assertionCount == 1);
diff --git a/langtools/test/tools/javac/lambda/MostSpecific09.java b/langtools/test/tools/javac/lambda/MostSpecific09.java
new file mode 100644
index 0000000..be291a3
--- /dev/null
+++ b/langtools/test/tools/javac/lambda/MostSpecific09.java
@@ -0,0 +1,81 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8029718
+ * @summary Should always use lambda body structure to disambiguate overload resolution
+ * @compile/fail/ref=MostSpecific09.out -XDrawDiagnostics -XDshouldStopPolicy=ATTR -XDverboseResolution=applicable,success MostSpecific09.java
+ */
+
+class MostSpecific09 {
+
+    interface I {
+        String xoo(String x);
+    }
+
+    interface J {
+        void xoo(int x);
+    }
+
+    static void foo(I i) {}
+    static void foo(J j) {}
+
+    static void moo(I i) {}
+    static void moo(J j) {}
+
+    void m() {
+        foo((x) -> { return x += 1; });
+        foo((x) -> { return ""; });
+        foo((x) -> { System.out.println(""); });
+        foo((x) -> { return ""; System.out.println(""); });
+        foo((x) -> { throw new RuntimeException(); });
+        foo((x) -> { while (true); });
+
+        foo((x) -> x += 1);
+        foo((x) -> "");
+    }
+
+    /* any return statement that is not in the body of the lambda but in an
+     * inner class or another lambda should be ignored for value void compatibility
+     * determination.
+     */
+    void m1() {
+        boolean cond = true;
+        foo((x) -> {
+            if (cond) {
+                return "";
+            }
+            System.out.println("");
+        });
+
+        foo((x)->{
+            class Bar {
+                String m() {
+                    return "from Bar.m()";
+                }
+            }
+            class Boo {
+                Bar b = new Bar (){
+                    String m() {
+                        return "from Bar$1.m()";
+                    }
+                };
+            }
+            moo((y) -> { return ""; });
+            return;
+        });
+
+        foo((x)->{
+            class Bar {
+                void m() {}
+            }
+            class Boo {
+                Bar b = new Bar (){
+                    void m() {
+                        return;
+                    }
+                };
+            }
+            moo((y) -> { System.out.println(""); });
+            return "";
+        });
+    }
+}
diff --git a/langtools/test/tools/javac/lambda/MostSpecific09.out b/langtools/test/tools/javac/lambda/MostSpecific09.out
new file mode 100644
index 0000000..6d645cf
--- /dev/null
+++ b/langtools/test/tools/javac/lambda/MostSpecific09.out
@@ -0,0 +1,27 @@
+MostSpecific09.java:25:9: compiler.note.verbose.resolve.multi: foo, MostSpecific09, 0, BASIC, compiler.misc.type.none, compiler.misc.no.args,{(compiler.misc.applicable.method.found: 0, foo(MostSpecific09.I), null)}
+MostSpecific09.java:26:9: compiler.note.verbose.resolve.multi: foo, MostSpecific09, 0, BASIC, compiler.misc.type.none, compiler.misc.no.args,{(compiler.misc.applicable.method.found: 0, foo(MostSpecific09.I), null)}
+MostSpecific09.java:27:9: compiler.note.verbose.resolve.multi: foo, MostSpecific09, 0, BASIC, compiler.misc.type.none, compiler.misc.no.args,{(compiler.misc.applicable.method.found: 0, foo(MostSpecific09.J), null)}
+MostSpecific09.java:27:32: compiler.note.verbose.resolve.multi: println, java.io.PrintStream, 1, BASIC, java.lang.String, compiler.misc.no.args,{(compiler.misc.applicable.method.found: 0, println(java.lang.Object), null),(compiler.misc.applicable.method.found: 1, println(java.lang.String), null)}
+MostSpecific09.java:28:13: compiler.err.lambda.body.neither.value.nor.void.compatible
+MostSpecific09.java:28:9: compiler.err.cant.apply.symbols: kindname.method, foo, @680,{(compiler.misc.inapplicable.method: kindname.method, MostSpecific09, foo(MostSpecific09.I), (compiler.misc.no.conforming.assignment.exists: (compiler.misc.incompatible.ret.type.in.lambda: (compiler.misc.missing.ret.val: java.lang.String)))),(compiler.misc.inapplicable.method: kindname.method, MostSpecific09, foo(MostSpecific09.J), (compiler.misc.no.conforming.assignment.exists: (compiler.misc.unexpected.ret.val)))}
+MostSpecific09.java:28:43: compiler.note.verbose.resolve.multi: println, java.io.PrintStream, 1, BASIC, java.lang.String, compiler.misc.no.args,{(compiler.misc.applicable.method.found: 0, println(java.lang.Object), null),(compiler.misc.applicable.method.found: 1, println(java.lang.String), null)}
+MostSpecific09.java:29:9: compiler.err.ref.ambiguous: foo, kindname.method, foo(MostSpecific09.I), MostSpecific09, kindname.method, foo(MostSpecific09.J), MostSpecific09
+MostSpecific09.java:29:28: compiler.note.verbose.resolve.multi: <init>, java.lang.RuntimeException, 0, BASIC, compiler.misc.no.args, compiler.misc.no.args,{(compiler.misc.applicable.method.found: 0, java.lang.RuntimeException(), null)}
+MostSpecific09.java:30:9: compiler.err.ref.ambiguous: foo, kindname.method, foo(MostSpecific09.I), MostSpecific09, kindname.method, foo(MostSpecific09.J), MostSpecific09
+MostSpecific09.java:32:9: compiler.err.ref.ambiguous: foo, kindname.method, foo(MostSpecific09.I), MostSpecific09, kindname.method, foo(MostSpecific09.J), MostSpecific09
+MostSpecific09.java:33:9: compiler.note.verbose.resolve.multi: foo, MostSpecific09, 0, BASIC, compiler.misc.type.none, compiler.misc.no.args,{(compiler.misc.applicable.method.found: 0, foo(MostSpecific09.I), null)}
+MostSpecific09.java:42:13: compiler.err.lambda.body.neither.value.nor.void.compatible
+MostSpecific09.java:42:9: compiler.err.cant.apply.symbols: kindname.method, foo, @1129,{(compiler.misc.inapplicable.method: kindname.method, MostSpecific09, foo(MostSpecific09.I), (compiler.misc.no.conforming.assignment.exists: (compiler.misc.incompatible.ret.type.in.lambda: (compiler.misc.missing.ret.val: java.lang.String)))),(compiler.misc.inapplicable.method: kindname.method, MostSpecific09, foo(MostSpecific09.J), (compiler.misc.no.conforming.assignment.exists: (compiler.misc.unexpected.ret.val)))}
+MostSpecific09.java:46:23: compiler.note.verbose.resolve.multi: println, java.io.PrintStream, 1, BASIC, java.lang.String, compiler.misc.no.args,{(compiler.misc.applicable.method.found: 0, println(java.lang.Object), null),(compiler.misc.applicable.method.found: 1, println(java.lang.String), null)}
+MostSpecific09.java:49:9: compiler.note.verbose.resolve.multi: foo, MostSpecific09, 0, BASIC, compiler.misc.type.none, compiler.misc.no.args,{(compiler.misc.applicable.method.found: 0, foo(MostSpecific09.J), null)}
+MostSpecific09.java:56:25: compiler.note.verbose.resolve.multi: <init>, Bar, 0, BASIC, compiler.misc.no.args, compiler.misc.no.args,{(compiler.misc.applicable.method.found: 0, Bar(), null)}
+MostSpecific09.java:56:35: compiler.note.verbose.resolve.multi: <init>, Bar, 0, BASIC, compiler.misc.no.args, compiler.misc.no.args,{(compiler.misc.applicable.method.found: 0, Bar(), null)}
+MostSpecific09.java:56:25: compiler.note.verbose.resolve.multi: <init>, compiler.misc.anonymous.class: MostSpecific09$1Boo$1, 0, BASIC, compiler.misc.no.args, compiler.misc.no.args,{(compiler.misc.applicable.method.found: 0, compiler.misc.anonymous.class: MostSpecific09$1Boo$1(), null)}
+MostSpecific09.java:62:13: compiler.note.verbose.resolve.multi: moo, MostSpecific09, 0, BASIC, compiler.misc.type.none, compiler.misc.no.args,{(compiler.misc.applicable.method.found: 0, moo(MostSpecific09.I), null)}
+MostSpecific09.java:66:9: compiler.note.verbose.resolve.multi: foo, MostSpecific09, 0, BASIC, compiler.misc.type.none, compiler.misc.no.args,{(compiler.misc.applicable.method.found: 0, foo(MostSpecific09.I), null)}
+MostSpecific09.java:71:25: compiler.note.verbose.resolve.multi: <init>, Bar, 0, BASIC, compiler.misc.no.args, compiler.misc.no.args,{(compiler.misc.applicable.method.found: 0, Bar(), null)}
+MostSpecific09.java:71:35: compiler.note.verbose.resolve.multi: <init>, Bar, 0, BASIC, compiler.misc.no.args, compiler.misc.no.args,{(compiler.misc.applicable.method.found: 0, Bar(), null)}
+MostSpecific09.java:71:25: compiler.note.verbose.resolve.multi: <init>, compiler.misc.anonymous.class: MostSpecific09$2Boo$1, 0, BASIC, compiler.misc.no.args, compiler.misc.no.args,{(compiler.misc.applicable.method.found: 0, compiler.misc.anonymous.class: MostSpecific09$2Boo$1(), null)}
+MostSpecific09.java:77:13: compiler.note.verbose.resolve.multi: moo, MostSpecific09, 0, BASIC, compiler.misc.type.none, compiler.misc.no.args,{(compiler.misc.applicable.method.found: 0, moo(MostSpecific09.J), null)}
+MostSpecific09.java:77:36: compiler.note.verbose.resolve.multi: println, java.io.PrintStream, 1, BASIC, java.lang.String, compiler.misc.no.args,{(compiler.misc.applicable.method.found: 0, println(java.lang.Object), null),(compiler.misc.applicable.method.found: 1, println(java.lang.String), null)}
+7 errors
diff --git a/langtools/test/tools/javac/lambda/TargetType01.java b/langtools/test/tools/javac/lambda/TargetType01.java
index 2ad86c6..08caecc 100644
--- a/langtools/test/tools/javac/lambda/TargetType01.java
+++ b/langtools/test/tools/javac/lambda/TargetType01.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -42,6 +42,10 @@
     static String M(F_S_S f){ return null; }
 
     static {
-        M(x1 -> { return M( x2 -> { return x1 + x2; });}); //ambiguous
+        M(x1 -> {
+            return M( x2 -> {
+                return x1 + x2;
+            });
+        }); //ambiguous
     }
 }
diff --git a/langtools/test/tools/javac/lambda/TargetType01.out b/langtools/test/tools/javac/lambda/TargetType01.out
index b460bfc..4775056 100644
--- a/langtools/test/tools/javac/lambda/TargetType01.out
+++ b/langtools/test/tools/javac/lambda/TargetType01.out
@@ -1,3 +1,3 @@
 TargetType01.java:45:9: compiler.err.ref.ambiguous: M, kindname.method, M(TargetType01.F_I_I), TargetType01, kindname.method, M(TargetType01.F_S_S), TargetType01
-TargetType01.java:45:26: compiler.err.ref.ambiguous: M, kindname.method, M(TargetType01.F_I_I), TargetType01, kindname.method, M(TargetType01.F_S_S), TargetType01
+TargetType01.java:46:20: compiler.err.ref.ambiguous: M, kindname.method, M(TargetType01.F_I_I), TargetType01, kindname.method, M(TargetType01.F_S_S), TargetType01
 2 errors
diff --git a/langtools/test/tools/javac/lambda/TargetType02.java b/langtools/test/tools/javac/lambda/TargetType02.java
index 05077c8..4346756 100644
--- a/langtools/test/tools/javac/lambda/TargetType02.java
+++ b/langtools/test/tools/javac/lambda/TargetType02.java
@@ -1,31 +1,9 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * @test
- * @bug 8003280
+ * @test /nodynamiccopyright/
+ * @bug 8003280 8029718
  * @summary Add lambda tests
  *  check overload resolution and target type inference w.r.t. generic methods
+ * Should always use lambda body structure to disambiguate overload resolution
  * @author  Maurizio Cimadamore
  * @compile/fail/ref=TargetType02.out -XDrawDiagnostics TargetType02.java
  */
@@ -47,9 +25,18 @@
     static <Z extends Number> void call3(S1<Z> s) { }
     static <Z extends String> void call3(S2<Z> s) { }
 
+    static <Z extends Number> Z call4(S1<Z> s) { return null; }
+    static <Z extends String> Z call4(S2<Z> s) { return null; }
+
     void test() {
         call1(i -> { toString(); return i; });
         call2(i -> { toString(); return i; });
         call3(i -> { toString(); return i; });
+        call3(i -> {
+            toString();
+            return call4(j -> {
+                return j;
+            });
+        });
     }
 }
diff --git a/langtools/test/tools/javac/lambda/TargetType02.out b/langtools/test/tools/javac/lambda/TargetType02.out
index 2336ef7..eef0752 100644
--- a/langtools/test/tools/javac/lambda/TargetType02.out
+++ b/langtools/test/tools/javac/lambda/TargetType02.out
@@ -1,3 +1,5 @@
-TargetType02.java:52:14: compiler.err.prob.found.req: (compiler.misc.inferred.do.not.conform.to.upper.bounds: java.lang.Integer, java.lang.String)
-TargetType02.java:53:9: compiler.err.ref.ambiguous: call3, kindname.method, <Z>call3(TargetType02.S1<Z>), TargetType02, kindname.method, <Z>call3(TargetType02.S2<Z>), TargetType02
-2 errors
+TargetType02.java:33:14: compiler.err.prob.found.req: (compiler.misc.inferred.do.not.conform.to.upper.bounds: java.lang.Integer, java.lang.String)
+TargetType02.java:34:9: compiler.err.ref.ambiguous: call3, kindname.method, <Z>call3(TargetType02.S1<Z>), TargetType02, kindname.method, <Z>call3(TargetType02.S2<Z>), TargetType02
+TargetType02.java:35:9: compiler.err.ref.ambiguous: call3, kindname.method, <Z>call3(TargetType02.S1<Z>), TargetType02, kindname.method, <Z>call3(TargetType02.S2<Z>), TargetType02
+TargetType02.java:37:20: compiler.err.ref.ambiguous: call4, kindname.method, <Z>call4(TargetType02.S1<Z>), TargetType02, kindname.method, <Z>call4(TargetType02.S2<Z>), TargetType02
+4 errors
diff --git a/langtools/test/tools/javac/lambda/TargetType21.out b/langtools/test/tools/javac/lambda/TargetType21.out
index 90131dc..a91515f 100644
--- a/langtools/test/tools/javac/lambda/TargetType21.out
+++ b/langtools/test/tools/javac/lambda/TargetType21.out
@@ -1,7 +1,5 @@
 TargetType21.java:28:9: compiler.err.ref.ambiguous: call, kindname.method, call(TargetType21.SAM2), TargetType21, kindname.method, <R,A>call(TargetType21.SAM3<R,A>), TargetType21
-TargetType21.java:31:9: compiler.err.ref.ambiguous: call, kindname.method, call(TargetType21.SAM2), TargetType21, kindname.method, <R,A>call(TargetType21.SAM3<R,A>), TargetType21
-TargetType21.java:32:9: compiler.err.ref.ambiguous: call, kindname.method, call(TargetType21.SAM2), TargetType21, kindname.method, <R,A>call(TargetType21.SAM3<R,A>), TargetType21
-TargetType21.java:32:13: compiler.err.cant.apply.symbol: kindname.method, call, TargetType21.SAM2, @888, kindname.class, TargetType21, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.incompatible.ret.type.in.lambda: (compiler.misc.unexpected.ret.val)))
-TargetType21.java:33:9: compiler.err.ref.ambiguous: call, kindname.method, call(TargetType21.SAM2), TargetType21, kindname.method, <R,A>call(TargetType21.SAM3<R,A>), TargetType21
-TargetType21.java:33:13: compiler.err.cant.apply.symbol: kindname.method, call, TargetType21.SAM2, @946, kindname.class, TargetType21, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.incompatible.ret.type.in.lambda: (compiler.misc.unexpected.ret.val)))
-6 errors
+TargetType21.java:32:9: compiler.err.ref.ambiguous: call, kindname.method, call(TargetType21.SAM1), TargetType21, kindname.method, <R,A>call(TargetType21.SAM3<R,A>), TargetType21
+TargetType21.java:32:13: compiler.err.cant.apply.symbol: kindname.method, call, TargetType21.SAM1, @888, kindname.class, TargetType21, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.incompatible.ret.type.in.lambda: (compiler.misc.inconvertible.types: java.lang.Object, java.lang.String)))
+TargetType21.java:33:9: compiler.err.ref.ambiguous: call, kindname.method, call(TargetType21.SAM1), TargetType21, kindname.method, <R,A>call(TargetType21.SAM3<R,A>), TargetType21
+4 errors
diff --git a/langtools/test/tools/javac/lambda/TargetType42.java b/langtools/test/tools/javac/lambda/TargetType42.java
index a476134..fbfe6b8 100644
--- a/langtools/test/tools/javac/lambda/TargetType42.java
+++ b/langtools/test/tools/javac/lambda/TargetType42.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -31,12 +31,18 @@
 class TargetType42 {
 
     interface SAM<X, Y> {
-      Y f(X x);
+        Y f(X x);
     }
 
     <Z> void m(SAM<String, SAM<Z, Object>> s, Z z) { }
 
     void test(Object obj) {
-        m((x)->{ class Foo { }; return (x2)-> { new Foo(); return null; }; }, obj);
+        m((x)->{
+            class Foo { }
+            return (x2)-> {
+                new Foo();
+                return null;
+            };
+        }, obj);
     }
 }
diff --git a/langtools/test/tools/javac/lambda/lambdaExpression/LambdaTest1.java b/langtools/test/tools/javac/lambda/lambdaExpression/LambdaTest1.java
index 699ad5d..615aeda 100644
--- a/langtools/test/tools/javac/lambda/lambdaExpression/LambdaTest1.java
+++ b/langtools/test/tools/javac/lambda/lambdaExpression/LambdaTest1.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -33,7 +33,6 @@
 import java.util.Collections;
 import java.util.List;
 import java.util.ArrayList;
-import java.util.Date;
 
 public class LambdaTest1 {
 
diff --git a/langtools/test/tools/javac/lambda/lambdaExpression/SamConversionComboTest.java b/langtools/test/tools/javac/lambda/lambdaExpression/SamConversionComboTest.java
index c354574..fd8c294 100644
--- a/langtools/test/tools/javac/lambda/lambdaExpression/SamConversionComboTest.java
+++ b/langtools/test/tools/javac/lambda/lambdaExpression/SamConversionComboTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -209,7 +209,11 @@
         final JavaCompiler tool = ToolProvider.getSystemJavaCompiler();
         DiagnosticChecker dc = new DiagnosticChecker();
         JavacTask ct = (JavacTask)tool.getTask(null, null, dc, null, null, Arrays.asList(samSourceFile, clientSourceFile));
-        ct.analyze();
+        try {
+            ct.analyze();
+        } catch (Exception e) {
+            throw new AssertionError("failing SAM source file \n" + samSourceFile + "\n\n" + "failing client source file \n"+ clientSourceFile);
+        }
         if (dc.errorFound == checkSamConversion()) {
             throw new AssertionError(samSourceFile + "\n\n" + clientSourceFile);
         }
diff --git a/langtools/test/tools/javac/tree/DocCommentToplevelTest.java b/langtools/test/tools/javac/tree/DocCommentToplevelTest.java
index 2908a22..7ab036f 100644
--- a/langtools/test/tools/javac/tree/DocCommentToplevelTest.java
+++ b/langtools/test/tools/javac/tree/DocCommentToplevelTest.java
@@ -144,7 +144,8 @@
             public ClassTree visitCompilationUnit(CompilationUnitTree node, Void unused) {
                 docComments = ((JCTree.JCCompilationUnit)node).docComments;
                 boolean expectedComment = tdk == ToplevelDocKind.HAS_DOC &&
-                        (pk != PackageKind.NO_PKG || ik != ImportKind.ZERO);
+                                          pk == PackageKind.NO_PKG &&
+                                          ik != ImportKind.ZERO;
                 boolean foundComment = docComments.hasComment((JCTree) node);
                 if (expectedComment != foundComment) {
                     error("Unexpected comment " + docComments.getComment((JCTree) node) + " on toplevel");
@@ -153,6 +154,17 @@
             }
 
             @Override
+            public ClassTree visitPackage(PackageTree node, Void unused) {
+                boolean expectedComment = tdk == ToplevelDocKind.HAS_DOC &&
+                                          pk != PackageKind.NO_PKG;
+                boolean foundComment = docComments.hasComment((JCTree) node);
+                if (expectedComment != foundComment) {
+                    error("Unexpected comment " + docComments.getComment((JCTree) node) + " on toplevel");
+                }
+                return super.visitPackage(node, null);
+            }
+
+            @Override
             public ClassTree visitClass(ClassTree node, Void unused) {
                 boolean expectedComment = tdk == ToplevelDocKind.HAS_DOC &&
                         pk == PackageKind.NO_PKG && ik == ImportKind.ZERO &&
diff --git a/langtools/test/tools/sjavac/ExclPattern.java b/langtools/test/tools/sjavac/ExclPattern.java
new file mode 100644
index 0000000..44592de
--- /dev/null
+++ b/langtools/test/tools/sjavac/ExclPattern.java
@@ -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.
+ */
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.nio.charset.Charset;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+
+public class ExclPattern {
+
+    public static void main(String[] ignore) throws IOException {
+
+        String toBeExcluded = "pkg/excl-dir/excluded.txt";
+        String toBeIncluded = "pkg/incl-dir/included.txt";
+
+        // Set up source directory with directory to be excluded
+        populate(Paths.get("srcdir"),
+            "pkg/SomeClass.java",
+            "package pkg; public class SomeClass { }",
+
+            toBeExcluded,
+            "This file should not end up in the dest directory.",
+
+            toBeIncluded,
+            "This file should end up in the dest directory.");
+
+        String[] args = {
+                "-x", "pkg/excl-dir/*",
+                "-src", "srcdir",
+                "-d", "dest",
+                "-j", "1",
+                "-copy", ".txt",
+                "--server:portfile=testserver,background=false",
+                "--log=debug"
+        };
+
+        int rc = new com.sun.tools.sjavac.Main().go(args, System.out, System.err);
+        if (rc != 0) throw new RuntimeException("Error during compile!");
+
+        if (!Files.exists(Paths.get("dest/" + toBeIncluded)))
+            throw new AssertionError("File missing: " + toBeIncluded);
+
+        if (Files.exists(Paths.get("dest/" + toBeExcluded)))
+            throw new AssertionError("File present: " + toBeExcluded);
+    }
+
+    static void populate(Path root, String... args) throws IOException {
+        if (!Files.exists(root))
+            Files.createDirectory(root);
+        for (int i = 0; i < args.length; i += 2) {
+            String filename = args[i];
+            String content = args[i+1];
+            Path p = root.resolve(filename);
+            Files.createDirectories(p.getParent());
+            try (PrintWriter out = new PrintWriter(Files.newBufferedWriter(p,
+                    Charset.defaultCharset()))) {
+                out.println(content);
+            }
+        }
+    }
+}
diff --git a/langtools/test/tools/sjavac/ExclPatternWrapper.java b/langtools/test/tools/sjavac/ExclPatternWrapper.java
new file mode 100644
index 0000000..fcda531
--- /dev/null
+++ b/langtools/test/tools/sjavac/ExclPatternWrapper.java
@@ -0,0 +1,34 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8037085
+ * @summary Ensures that sjavac can handle various exclusion patterns.
+ * @run main ExclPatternWrapper
+ */
+public class ExclPatternWrapper {
+    public static void main(String... args) throws Exception {
+        SJavacTestUtil.runSjavacTest("ExclPattern", args);
+    }
+}
diff --git a/langtools/test/tools/sjavac/JavacOptionPrep.java b/langtools/test/tools/sjavac/JavacOptionPrep.java
new file mode 100644
index 0000000..2e645d6
--- /dev/null
+++ b/langtools/test/tools/sjavac/JavacOptionPrep.java
@@ -0,0 +1,166 @@
+/*
+ * 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.
+ */
+
+import java.io.File;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.Arrays;
+import java.util.Iterator;
+
+import com.sun.tools.sjavac.options.Options;
+
+
+public class JavacOptionPrep {
+
+    enum TestPath {
+        CP1, CP2, SRC1, SRC2, SOURCEPATH1, SOURCEPATH2;
+
+        public String toString() {
+            return name().toLowerCase();
+        }
+    }
+
+    private final static String SEP = File.pathSeparator;
+
+    public static void main(String[] unused) throws IOException {
+
+        for (TestPath p : TestPath.values())
+            Files.createDirectory(Paths.get(p.toString()));
+
+        // Test some various cases:
+        //  - Paths combined with File.pathSeparator (CP1 / CP2)
+        //  - Paths given as duplicate options (SOURCEPATH1 / SOURCEPATH2)
+        //  - Sources provided by -src (SRC1)
+        //  - Sources provided without preceding option (SRC2)
+        //  - An unrecognized option which is to be passed on to javac
+        String sjavacArgs = "-cp " + TestPath.CP1 + SEP + TestPath.CP2 +
+                            " -d dest " +
+                            " -h header" +
+                            " -sourcepath " + TestPath.SOURCEPATH1 +
+                            " -src " + TestPath.SRC1 +
+                            " -s gensrc" +
+                            " -sourcepath " + TestPath.SOURCEPATH2 +
+                            " " + TestPath.SRC2 +
+                            " -unrecognized";
+
+        Options options = Options.parseArgs(sjavacArgs.split(" "));
+
+        // Extract javac-options
+        String[] javacArgs = options.prepJavacArgs();
+
+        // Check the result
+        boolean destDirFound = false;
+        boolean headerDirFound = false;
+        boolean gensrcDirFound = false;
+        boolean classPathFound = false;
+        boolean sourcePathFound = false;
+        boolean unrecognizedFound = false;
+        boolean implicitNoneFound = false;
+
+        Iterator<String> javacArgIter = Arrays.asList(javacArgs).iterator();
+        while (javacArgIter.hasNext()) {
+
+            String option = javacArgIter.next();
+
+            switch (option) {
+            case "-classpath":
+            case "-cp":
+                classPathFound = true;
+                assertEquals(TestPath.CP1 + SEP + TestPath.CP2,
+                             javacArgIter.next());
+                break;
+
+            case "-d":
+                destDirFound = true;
+                assertEquals(Paths.get("dest").toAbsolutePath().toString(),
+                             javacArgIter.next());
+                break;
+
+            case "-h":
+                headerDirFound = true;
+                assertEquals(Paths.get("header").toAbsolutePath().toString(),
+                             javacArgIter.next());
+                break;
+
+            case "-s":
+                gensrcDirFound = true;
+                assertEquals(Paths.get("gensrc").toAbsolutePath().toString(),
+                             javacArgIter.next());
+                break;
+
+            case "-sourcepath":
+                sourcePathFound = true;
+                assertEquals(TestPath.SRC1 + SEP +
+                             TestPath.SRC2 + SEP +
+                             TestPath.SOURCEPATH1 + SEP +
+                             TestPath.SOURCEPATH2,
+                             javacArgIter.next());
+                break;
+
+            case "-unrecognized":
+                unrecognizedFound = true;
+                break;
+
+            case "-implicit:none":
+                implicitNoneFound = true;
+                break;
+
+                // Note that *which* files to actually compile is not dealt
+                // with by prepJavacArgs.
+
+            default:
+                throw new AssertionError("Unexpected option found: " + option);
+            }
+        }
+
+        if (!destDirFound)
+            throw new AssertionError("Dest directory not found.");
+
+        if (!headerDirFound)
+            throw new AssertionError("Header directory not found.");
+
+        if (!gensrcDirFound)
+            throw new AssertionError("Generated source directory not found.");
+
+        if (!classPathFound)
+            throw new AssertionError("Class path not found.");
+
+        if (!sourcePathFound)
+            throw new AssertionError("Source path not found.");
+
+        if (!unrecognizedFound)
+            throw new AssertionError("\"-unrecognized\" not found.");
+
+        if (!implicitNoneFound)
+            throw new AssertionError("\"-implicit:none\" not found.");
+
+    }
+
+    static void assertEquals(Object expected, Object actual) {
+        if (!expected.equals(actual))
+            throw new AssertionError("Expected " + expected + " but got " + actual);
+    }
+}
diff --git a/langtools/test/tools/sjavac/JavacOptionPrepWrapper.java b/langtools/test/tools/sjavac/JavacOptionPrepWrapper.java
new file mode 100644
index 0000000..4ce7083
--- /dev/null
+++ b/langtools/test/tools/sjavac/JavacOptionPrepWrapper.java
@@ -0,0 +1,34 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8035063
+ * @summary Tests the preparation of javac-arguments.
+ * @run main JavacOptionPrepWrapper
+ */
+public class JavacOptionPrepWrapper {
+    public static void main(String... args) throws Exception {
+        SJavacTestUtil.runSjavacTest("JavacOptionPrep", args);
+    }
+}
diff --git a/langtools/test/tools/sjavac/OptionDecoding.java b/langtools/test/tools/sjavac/OptionDecoding.java
new file mode 100644
index 0000000..76b51e1
--- /dev/null
+++ b/langtools/test/tools/sjavac/OptionDecoding.java
@@ -0,0 +1,240 @@
+/*
+ * 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.
+ */
+
+import static util.OptionTestUtil.assertEquals;
+import static util.OptionTestUtil.checkFilesFound;
+
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import com.sun.tools.sjavac.CopyFile;
+import com.sun.tools.sjavac.Main;
+import com.sun.tools.sjavac.Module;
+import com.sun.tools.sjavac.Source;
+import com.sun.tools.sjavac.options.Options;
+import com.sun.tools.sjavac.options.SourceLocation;
+
+public class OptionDecoding {
+
+    public static void main(String[] args) throws IOException {
+
+        testPaths();
+        testDupPaths();
+        testSourceLocations();
+        testSimpleOptions();
+        testServerConf();
+        testSearchPaths();
+        testTranslationRules();
+
+    }
+
+    // Test decoding of output paths
+    static void testPaths() throws IOException {
+
+        final String H = "headers";
+        final String G = "gensrc";
+        final String D = "dest";
+        final String CMP = "srcRefList.txt";
+
+        Options options = Options.parseArgs("-h", H, "-s", G, "-d", D,
+                                            "--compare-found-sources", CMP);
+
+        assertEquals(Paths.get(H).toAbsolutePath(), options.getHeaderDir());
+        assertEquals(Paths.get(G).toAbsolutePath(), options.getGenSrcDir());
+        assertEquals(Paths.get(D).toAbsolutePath(), options.getDestDir());
+        assertEquals(Paths.get(CMP), options.getSourceReferenceList());
+
+    }
+
+    // Providing duplicate header / dest / gensrc paths should produce an error.
+    static void testDupPaths() throws IOException {
+
+        try {
+            Options.parseArgs("-h", "dir1", "-h", "dir2");
+            throw new RuntimeException("Duplicate header directories should fail.");
+        } catch (IllegalArgumentException iae) {
+            // Expected
+        }
+
+        try {
+            Options.parseArgs("-s", "dir1", "-s", "dir2");
+            throw new RuntimeException("Duplicate paths for generated sources should fail.");
+        } catch (IllegalArgumentException iae) {
+            // Expected
+        }
+
+        try {
+            Options.parseArgs("-d", "dir1", "-d", "dir2");
+            throw new RuntimeException("Duplicate destination directories should fail.");
+        } catch (IllegalArgumentException iae) {
+            // Expected
+        }
+
+    }
+
+    // Test source locations and -x, -i, -xf, -if filters
+    static void testSourceLocations() throws IOException {
+
+        Path a1 = Paths.get("root/pkg1/ClassA1.java");
+        Path a2 = Paths.get("root/pkg1/ClassA2.java");
+        Path b1 = Paths.get("root/pkg1/pkg2/ClassB1.java");
+        Path b2 = Paths.get("root/pkg1/pkg2/ClassB2.java");
+        Path c1 = Paths.get("root/pkg3/ClassC1.java");
+        Path c2 = Paths.get("root/pkg3/ClassC2.java");
+
+        for (Path p : Arrays.asList(a1, a2, b1, b2, c1, c2)) {
+            Files.createDirectories(p.getParent());
+            Files.createFile(p);
+        }
+
+        // Test -if
+        {
+            Options options = Options.parseArgs("-if", "root/pkg1/ClassA1.java", "root");
+
+            Map<String, Source> foundFiles = new HashMap<>();
+            Main.findSourceFiles(options.getSources(), Collections.singleton(".java"), foundFiles,
+                    new HashMap<String, Module>(), new Module("", ""), false, true);
+
+            checkFilesFound(foundFiles.keySet(), a1);
+        }
+
+        // Test -i
+        System.out.println("--------------------------- CHECKING -i ----------------");
+        {
+            Options options = Options.parseArgs("-i", "pkg1/*", "root");
+
+            Map<String, Source> foundFiles = new HashMap<>();
+            Main.findSourceFiles(options.getSources(), Collections.singleton(".java"), foundFiles,
+                    new HashMap<String, Module>(), new Module("", ""), false, true);
+
+            checkFilesFound(foundFiles.keySet(), a1, a2, b1, b2);
+        }
+        System.out.println("--------------------------------------------------------");
+
+        // Test -xf
+        {
+            Options options = Options.parseArgs("-xf", "root/pkg1/ClassA1.java", "root");
+
+            Map<String, Source> foundFiles = new HashMap<>();
+            Main.findSourceFiles(options.getSources(), Collections.singleton(".java"), foundFiles,
+                    new HashMap<String, Module>(), new Module("", ""), false, true);
+
+            checkFilesFound(foundFiles.keySet(), a2, b1, b2, c1, c2);
+        }
+
+        // Test -x
+        {
+            Options options = Options.parseArgs("-i", "pkg1/*", "root");
+
+            Map<String, Source> foundFiles = new HashMap<>();
+            Main.findSourceFiles(options.getSources(), Collections.singleton(".java"), foundFiles,
+                    new HashMap<String, Module>(), new Module("", ""), false, true);
+
+            checkFilesFound(foundFiles.keySet(), a1, a2, b1, b2);
+        }
+
+        // Test -x and -i
+        {
+            Options options = Options.parseArgs("-i", "pkg1/*", "-x", "pkg1/pkg2/*", "root");
+
+            Map<String, Source> foundFiles = new HashMap<>();
+            Main.findSourceFiles(options.getSources(), Collections.singleton(".java"), foundFiles,
+                    new HashMap<String, Module>(), new Module("", ""), false, true);
+
+            checkFilesFound(foundFiles.keySet(), a1, a2);
+        }
+
+    }
+
+    // Test basic options
+    static void testSimpleOptions() {
+
+        Options options = Options.parseArgs("-j", "17", "--log=debug");
+        assertEquals(17, options.getNumCores());
+        assertEquals("debug", options.getLogLevel());
+        assertEquals(false, options.isDefaultPackagePermitted());
+        assertEquals(false, options.isUnidentifiedArtifactPermitted());
+
+        options = Options.parseArgs("--permit-unidentified-artifacts",
+                                    "--permit-sources-without-package");
+        assertEquals("info", options.getLogLevel());
+        assertEquals(true, options.isDefaultPackagePermitted());
+        assertEquals(true, options.isUnidentifiedArtifactPermitted());
+    }
+
+    // Test server configuration options
+    static void testServerConf() {
+        Options options = Options.parseArgs("--server:someServerConfiguration");
+        assertEquals("someServerConfiguration", options.getServerConf());
+        assertEquals(false, options.startServerFlag());
+
+        options = Options.parseArgs("--startserver:someServerConfiguration");
+        assertEquals("someServerConfiguration", options.getServerConf());
+        assertEquals(true, options.startServerFlag());
+    }
+
+    // Test input paths
+    static void testSearchPaths() {
+
+        List<String> i, x, iF, xF;
+        i = x = iF = xF = new ArrayList<>();
+
+        SourceLocation dir1 = new SourceLocation(Paths.get("dir1"), i, x, iF, xF);
+        SourceLocation dir2 = new SourceLocation(Paths.get("dir2"), i, x, iF, xF);
+
+        Options options = Options.parseArgs("-sourcepath", "dir1:dir2");
+        assertEquals(options.getSourceSearchPaths(), Arrays.asList(dir1, dir2));
+
+        options = Options.parseArgs("-modulepath", "dir1:dir2");
+        assertEquals(options.getModuleSearchPaths(), Arrays.asList(dir1, dir2));
+
+        options = Options.parseArgs("-classpath", "dir1:dir2");
+        assertEquals(options.getClassSearchPath(), Arrays.asList(dir1, dir2));
+    }
+
+    // Test -tr option
+    static void testTranslationRules() {
+
+        Class<?> cls = com.sun.tools.sjavac.CompileJavaPackages.class;
+
+        Options options = Options.parseArgs(
+                "-tr", ".exa=" + cls.getName(),
+                "-tr", ".exb=" + cls.getName(),
+                "-copy", ".html");
+
+        assertEquals(cls, options.getTranslationRules().get(".exa").getClass());
+        assertEquals(cls, options.getTranslationRules().get(".exb").getClass());
+        assertEquals(CopyFile.class, options.getTranslationRules().get(".html").getClass());
+
+    }
+}
diff --git a/langtools/test/tools/sjavac/OptionDecodingWrapper.java b/langtools/test/tools/sjavac/OptionDecodingWrapper.java
new file mode 100644
index 0000000..9e7507b
--- /dev/null
+++ b/langtools/test/tools/sjavac/OptionDecodingWrapper.java
@@ -0,0 +1,34 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8035063
+ * @summary Tests decoding of String[] into Options.
+ * @run main OptionDecodingWrapper
+ */
+public class OptionDecodingWrapper {
+    public static void main(String... args) throws Exception {
+        SJavacTestUtil.runSjavacTest("OptionDecoding", args);
+    }
+}
diff --git a/langtools/test/tools/sjavac/SJavacTestUtil.java b/langtools/test/tools/sjavac/SJavacTestUtil.java
new file mode 100644
index 0000000..7f49728
--- /dev/null
+++ b/langtools/test/tools/sjavac/SJavacTestUtil.java
@@ -0,0 +1,64 @@
+/*
+ * 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.
+ */
+
+import java.io.File;
+import java.lang.reflect.Method;
+
+
+public class SJavacTestUtil {
+
+    public static void runSjavacTest(String testClassName, String[] args)
+            throws Exception {
+
+        if (!isSJavacOnClassPath()) {
+            System.out.println("sjavac not available: pass by default");
+            return;
+        }
+
+        File srcDir = new File(System.getProperty("test.src"));
+        File clsDir = new File(System.getProperty("test.classes"));
+
+        File src = new File(srcDir, testClassName + ".java");
+        File cls = new File(clsDir, testClassName + ".class");
+
+        if (cls.lastModified() < src.lastModified()) {
+            System.err.println("Recompiling test class...");
+            String[] javacArgs = { "-d", clsDir.getPath(), src.getPath() };
+            int rc = com.sun.tools.javac.Main.compile(javacArgs);
+            if (rc != 0)
+                throw new Exception("compilation failed");
+        }
+
+        Class<?> sjavac = Class.forName(testClassName);
+        Method main = sjavac.getMethod("main", String[].class);
+        main.invoke(null, new Object[] { args });
+
+    }
+
+    private static boolean isSJavacOnClassPath() {
+        String cls = "com/sun/tools/sjavac/Main.class";
+        return SJavacTestUtil.class.getClassLoader().getResource(cls) != null;
+    }
+}
diff --git a/langtools/test/tools/sjavac/SJavacWrapper.java b/langtools/test/tools/sjavac/SJavacWrapper.java
index bba27eb..3309293 100644
--- a/langtools/test/tools/sjavac/SJavacWrapper.java
+++ b/langtools/test/tools/sjavac/SJavacWrapper.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 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
@@ -31,37 +31,8 @@
  * @run main SJavacWrapper
  */
 
-import java.io.*;
-import java.lang.reflect.Method;
-import java.net.*;
-
-
-public
-class SJavacWrapper {
-
+public class SJavacWrapper {
     public static void main(String... args) throws Exception {
-        URL url = SJavacWrapper.class.getClassLoader().getResource("com/sun/tools/sjavac/Main.class");
-        if (url == null) {
-            // No sjavac in the classpath.
-            System.out.println("sjavac not available: pass by default");
-            return;
-        }
-
-        File testSrc = new File(System.getProperty("test.src"));
-        File sjavac_java = new File(testSrc, "SJavac.java");
-        File testClasses = new File(System.getProperty("test.classes"));
-        File sjavac_class = new File(testClasses, "SJavac.class");
-        if (sjavac_class.lastModified() < sjavac_java.lastModified()) {
-            String[] javac_args = { "-d", testClasses.getPath(), sjavac_java.getPath() };
-            System.err.println("Recompiling SJavac.java");
-            int rc = com.sun.tools.javac.Main.compile(javac_args);
-            if (rc != 0)
-                throw new Exception("compilation failed");
-        }
-
-        Class<?> sjavac = Class.forName("SJavac");
-        Method sjavac_main = sjavac.getMethod("main", String[].class);
-        sjavac_main.invoke(null, new Object[] { args });
+        SJavacTestUtil.runSjavacTest("SJavac", args);
     }
-
 }
diff --git a/langtools/test/tools/sjavac/Serialization.java b/langtools/test/tools/sjavac/Serialization.java
new file mode 100644
index 0000000..7b23d96
--- /dev/null
+++ b/langtools/test/tools/sjavac/Serialization.java
@@ -0,0 +1,95 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import static util.OptionTestUtil.assertEquals;
+
+import java.io.IOException;
+import java.util.Map;
+
+import com.sun.tools.sjavac.CompileJavaPackages;
+import com.sun.tools.sjavac.Transformer;
+import com.sun.tools.sjavac.options.Option;
+import com.sun.tools.sjavac.options.Options;
+import com.sun.tools.sjavac.options.SourceLocation;
+
+
+public class Serialization {
+
+    public static void main(String[] args) throws IOException {
+
+        // Create reference options
+        Options options1 = Options.parseArgs(
+                Option.H.arg, "headers",
+                Option.S.arg, "gensrc",
+                Option.D.arg, "dest",
+                Option.I.arg, "pkg/*",
+                Option.X.arg, "pkg/pkg/*",
+                Option.IF.arg, "root/pkg/MyClass1.java",
+                Option.XF.arg, "root/pkg/MyClass2.java",
+                Option.SRC.arg, "root",
+                Option.SOURCEPATH.arg, "sourcepath",
+                Option.CLASSPATH.arg, "classpath",
+                Option.MODULEPATH.arg, "modulepath",
+                Option.PERMIT_SOURCES_WITHOUT_PACKAGE.arg,
+                Option.PERMIT_UNIDENTIFIED_ARTIFACTS.arg,
+                Option.TR.arg, ".prop=" + CompileJavaPackages.class.getName(),
+                Option.J.arg, "999",
+                "-someJavacArg",
+                "-someOtherJavacArg");
+
+        // Serialize
+        String serialized = options1.getStateArgsString();
+
+        // Deserialize
+        Options options2 = Options.parseArgs(serialized.split(" "));
+
+        // Make sure we got the same result
+        assertEquals(options1.getHeaderDir(), options2.getHeaderDir());
+        assertEquals(options1.getGenSrcDir(), options2.getGenSrcDir());
+        assertEquals(options1.getDestDir(), options2.getDestDir());
+
+        SourceLocation sl1 = options1.getSources().get(0);
+        SourceLocation sl2 = options2.getSources().get(0);
+        assertEquals(sl1.getPath(), sl2.getPath());
+        assertEquals(sl1.getIncludes(), sl2.getIncludes());
+        assertEquals(sl1.getExcludes(), sl2.getExcludes());
+        assertEquals(sl1.getIncludedFiles(), sl2.getIncludedFiles());
+        assertEquals(sl1.getExcludedFiles(), sl2.getExcludedFiles());
+
+        assertEquals(options1.getClassSearchPath(), options2.getClassSearchPath());
+        assertEquals(options1.getSourceSearchPaths(), options2.getSourceSearchPaths());
+        assertEquals(options1.getModuleSearchPaths(), options2.getModuleSearchPaths());
+
+        Map<String, Transformer> trRules1 = options1.getTranslationRules();
+        Map<String, Transformer> trRules2 = options2.getTranslationRules();
+        assertEquals(trRules1.keySet(), trRules2.keySet());
+        assertEquals(trRules1.values().iterator().next().getClass(),
+                     trRules2.values().iterator().next().getClass());
+        assertEquals(options1.getJavacArgs(), options2.getJavacArgs());
+
+        assertEquals(999, options1.getNumCores());
+        if (options2.getNumCores() == 999)
+            throw new AssertionError("Num cores should not be part of serialization");
+    }
+
+}
diff --git a/langtools/test/tools/sjavac/SerializationWrapper.java b/langtools/test/tools/sjavac/SerializationWrapper.java
new file mode 100644
index 0000000..3bb4278
--- /dev/null
+++ b/langtools/test/tools/sjavac/SerializationWrapper.java
@@ -0,0 +1,38 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8035063
+ *
+ * @summary Tests serialization of options. The options needs to be serialized
+ *          and saved in the state file since the files need to be recompiled
+ *          if new options are provided.
+ *
+ * @run main SerializationWrapper
+ */
+public class SerializationWrapper {
+    public static void main(String... args) throws Exception {
+        SJavacTestUtil.runSjavacTest("Serialization", args);
+    }
+}
diff --git a/langtools/test/tools/sjavac/util/OptionTestUtil.java b/langtools/test/tools/sjavac/util/OptionTestUtil.java
new file mode 100644
index 0000000..0fc9eb3
--- /dev/null
+++ b/langtools/test/tools/sjavac/util/OptionTestUtil.java
@@ -0,0 +1,79 @@
+/*
+ * 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 util;
+
+import java.nio.file.Path;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+
+import com.sun.tools.sjavac.options.SourceLocation;
+
+
+public class OptionTestUtil {
+
+    public static void checkFilesFound(Collection<String> found, Path... expected) {
+
+        Collection<String> expectedStrs = new HashSet<String>();
+        for (Path p : expected)
+            expectedStrs.add(p.toString());
+
+        if (!expectedStrs.containsAll(found))
+            throw new AssertionError("Expected (" + expectedStrs + ") does not " +
+                                     "contain all actual (" + found + ")");
+
+        if (!found.containsAll(expectedStrs))
+            throw new AssertionError("Actual (" + found + ") does not " +
+                                     "contain all expected (" + expectedStrs + ")");
+    }
+
+    public static void assertEquals(List<SourceLocation> expected, List<SourceLocation> actual) {
+        if (expected.size() != actual.size())
+            throw new AssertionError("Expected locs of length " + expected.size() + " but got something of size " + actual.size());
+
+        Iterator<SourceLocation> iter1 = expected.iterator();
+        Iterator<SourceLocation> iter2 = actual.iterator();
+
+        while (iter1.hasNext()) {
+            SourceLocation sl1 = iter1.next();
+            SourceLocation sl2 = iter2.next();
+
+            if (!sl1.getPath().equals(sl2.getPath()) ||
+                    !sl1.getIncludes().equals(sl2.getIncludes()) ||
+                    !sl1.getExcludes().equals(sl2.getExcludes()) ||
+                    !sl1.getIncludedFiles().equals(sl2.getIncludedFiles()) ||
+                    !sl1.getExcludedFiles().equals(sl2.getExcludedFiles()))
+                throw new AssertionError("Expected " + sl1 + " but got " + sl2);
+        }
+    }
+
+    public static void assertEquals(Object expected, Object actual) {
+        if (!expected.equals(actual))
+            throw new AssertionError("Expected " + expected + " but got " + actual);
+    }
+
+}
diff --git a/make/Javadoc.gmk b/make/Javadoc.gmk
index dcc014e..9f8996b 100644
--- a/make/Javadoc.gmk
+++ b/make/Javadoc.gmk
@@ -25,6 +25,18 @@
 include $(SPEC)
 include MakeBase.gmk
 
+#################################################################
+#
+# CORE_PKGS environment variable has been moved to the following file
+#
+include CORE_PKGS.gmk
+#
+# Load environment variables for API package names that are not part of
+# the Java SE platform
+#
+include NON_CORE_PKGS.gmk
+
+
 .SUFFIXES: # Delete the default suffixes
 .SUFFIXES: .java
 
@@ -165,20 +177,9 @@
 	$(MKDIR) -p $(@D)
 endef
 
-# A cache of the directories in ALL_SOURCE_DIRS
-DIRECTORY_CACHE = $(DOCSTMPDIR)/directory.cache
-
-# Given a list of packages, return a list of files or dirs to be dependent on
-# (Currently only returning a list of directories)
-define PackageDependencies # packages
-  $(shell \
-      if [ "$1" != "" -a -f $(DIRECTORY_CACHE) ] ; then \
-        for p in $1 ; do \
-          pd=`$(ECHO) $${p} | $(SED) -e 's@[.]@/@g'`; \
-          $(CAT) $(DIRECTORY_CACHE) | $(GREP) "/$${pd}/" ; \
-        done; \
-      fi \
-  )
+$(eval $(call FillCacheFind, $(ALL_SOURCE_DIRS)))
+define PackageDependencies
+  $(call CacheFind, $(foreach p, $(subst .,/,$1), $(addsuffix /$p, $(ALL_SOURCE_DIRS))))
 endef
 
 # Given a list of packages, add packages that exist to $@, print summary
@@ -203,9 +204,9 @@
 
 # Print out a summary of the javadoc command about to be run
 define JavadocSummary # optionsfile packagesfile
-	@$(ECHO) "# Summary for $@"; \
-	$(ECHO) "# Options (`$(BASENAME) $1`):"; $(SED) -e 's@^@#   @' $1; \
-	$(ECHO) "# Packages (`$(BASENAME) $2`):";$(SED) -e 's@^@#   @' $2
+	@$(ECHO) "# Running javadoc for $(patsubst $(OUTPUT_ROOT)/%,%,$@)" $(LOG_WARN)
+	@($(ECHO) "# Options (`$(BASENAME) $1`):"; $(SED) -e 's@^@#   @' $1) $(LOG_DEBUG)
+	@($(ECHO) "# Packages (`$(BASENAME) $2`):";$(SED) -e 's@^@#   @' $2) $(LOG_DEBUG)
 endef
 
 #
@@ -300,19 +301,6 @@
 #################################################################
 
 #
-# CORE_PKGS environment variable has been moved to the following file
-#
-include CORE_PKGS.gmk
-
-#
-# Load environment variables for API package names that are not part of
-# the Java SE platform
-#
-include NON_CORE_PKGS.gmk
-
-#################################################################
-
-#
 # Default target is same as docs target, create core api and all others it can
 #
 
@@ -415,7 +403,7 @@
         endif
 
 # Create a file with the package names in it
-$(COREAPI_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(CORE_PKGS))
+$(COREAPI_PACKAGES_FILE): $(call PackageDependencies,$(CORE_PKGS))
 	$(prep-target)
 	$(call PackageFilter,$(CORE_PKGS))
 
@@ -447,7 +435,7 @@
 $(DOCLETAPI_INDEX_FILE): GET2DOCSDIR=$(DOCLETAPI2COREAPI)/..
 
 # Run javadoc if the index file is out of date or missing
-$(DOCLETAPI_INDEX_FILE): $(DOCLETAPI_OPTIONS_FILE) $(DOCLETAPI_PACKAGES_FILE) coredocs
+$(DOCLETAPI_INDEX_FILE): $(DOCLETAPI_OPTIONS_FILE) $(DOCLETAPI_PACKAGES_FILE) $(COREAPI_INDEX_FILE)
 	$(prep-javadoc)
 	$(call JavadocSummary,$(DOCLETAPI_OPTIONS_FILE),$(DOCLETAPI_PACKAGES_FILE))
 	$(JAVADOC_CMD) -d $(@D) \
@@ -470,7 +458,7 @@
 	) >> $@
 
 # Create a file with the package names in it
-$(DOCLETAPI_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(DOCLETAPI_PKGS))
+$(DOCLETAPI_PACKAGES_FILE): $(call PackageDependencies,$(DOCLETAPI_PKGS)) 
 	$(prep-target)
 	$(call PackageFilter,$(DOCLETAPI_PKGS))
 
@@ -489,7 +477,7 @@
 TAGLETAPI_TEMPDIR = $(DOCSTMPDIR)/taglets_temp
 
 # The index.html, options, and packages files
-TAGLETAPI_INDEX_FILE = $(TAGLETAPI_DOCDIR)/index.html
+TAGLETAPI_INDEX_FILE = $(TAGLETAPI_DOCDIR)/com/sun/tools/doclets/Taglet.html
 TAGLETAPI_OPTIONS_FILE = $(DOCSTMPDIR)/tagletapi.options
 TAGLETAPI_PACKAGES_FILE = $(DOCSTMPDIR)/tagletapi.packages
 
@@ -499,15 +487,15 @@
 $(TAGLETAPI_INDEX_FILE): GET2DOCSDIR=$(TAGLETAPI2COREAPI)/..
 
 # Run javadoc if the index file is out of date or missing
-$(TAGLETAPI_INDEX_FILE): $(TAGLETAPI_OPTIONS_FILE) $(TAGLETAPI_PACKAGES_FILE) coredocs
+$(TAGLETAPI_INDEX_FILE): $(TAGLETAPI_OPTIONS_FILE) $(TAGLETAPI_PACKAGES_FILE) $(COREAPI_INDEX_FILE)
 	$(prep-javadoc)
 	$(RM) -r $(TAGLETAPI_TEMPDIR)
 	$(MKDIR) -p $(TAGLETAPI_TEMPDIR)
 	$(call JavadocSummary,$(TAGLETAPI_OPTIONS_FILE),$(TAGLETAPI_PACKAGES_FILE))
 	$(JAVADOC_CMD) -d $(TAGLETAPI_TEMPDIR) \
 	    @$(TAGLETAPI_OPTIONS_FILE) @$(TAGLETAPI_PACKAGES_FILE)
-	cp -r $(TAGLETAPI_TEMPDIR)/com $(@D)
-	cp $(TAGLETAPI_TEMPDIR)/stylesheet.css $(@D)
+	cp -r $(TAGLETAPI_TEMPDIR)/com $(TAGLETAPI_DOCDIR)
+	cp $(TAGLETAPI_TEMPDIR)/stylesheet.css $(TAGLETAPI_DOCDIR)
 	$(RM) -r $(TAGLETAPI_TEMPDIR)
 
 # Create file with javadoc options in it
@@ -524,7 +512,7 @@
 	) >> $@
 
 # Create a file with the package names in it
-$(TAGLETAPI_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(TAGLETAPI_PKGS))
+$(TAGLETAPI_PACKAGES_FILE): $(call PackageDependencies,$(TAGLETAPI_PKGS))
 	$(prep-target)
 	@($(ECHO) "$(JDK_IMPSRC)/$(TAGLETAPI_FILE)" ) > $@
 
@@ -556,7 +544,7 @@
 $(DOMAPI_INDEX_FILE): GET2DOCSDIR=$(DOMAPI2COREAPI)/..
 
 # Run javadoc if the index file is out of date or missing
-$(DOMAPI_INDEX_FILE): $(DOMAPI_OPTIONS_FILE) $(DOMAPI_PACKAGES_FILE) coredocs
+$(DOMAPI_INDEX_FILE): $(DOMAPI_OPTIONS_FILE) $(DOMAPI_PACKAGES_FILE) $(COREAPI_INDEX_FILE)
 	$(prep-javadoc)
 	$(call JavadocSummary,$(DOMAPI_OPTIONS_FILE),$(DOMAPI_PACKAGES_FILE))
 	$(JAVADOC_CMD) -d $(@D) \
@@ -579,7 +567,7 @@
 	) >> $@
 
 # Create a file with the package names in it
-$(DOMAPI_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(DOMAPI_PKGS))
+$(DOMAPI_PACKAGES_FILE): $(call PackageDependencies,$(DOMAPI_PKGS))
 	$(prep-target)
 	$(call PackageFilter,$(DOMAPI_PKGS))
 
@@ -619,7 +607,7 @@
 $(JDI_INDEX_FILE): GET2DOCSDIR=$(JDI2COREAPI)/..
 
 # Run javadoc if the index file is out of date or missing
-$(JDI_INDEX_FILE): $(JDI_OPTIONS_FILE) $(JDI_PACKAGES_FILE) coredocs
+$(JDI_INDEX_FILE): $(JDI_OPTIONS_FILE) $(JDI_PACKAGES_FILE) $(COREAPI_INDEX_FILE)
 	$(prep-javadoc)
 	$(call JavadocSummary,$(JDI_OPTIONS_FILE),$(JDI_PACKAGES_FILE))
 	$(JAVADOC_CMD) -d $(@D) \
@@ -641,7 +629,7 @@
 	) >> $@
 
 # Create a file with the package names in it
-$(JDI_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(JDI_PKGS))
+$(JDI_PACKAGES_FILE): $(call PackageDependencies,$(JDI_PKGS))
 	$(prep-target)
 	$(call PackageFilter,$(JDI_PKGS))
 
@@ -674,7 +662,6 @@
 $(JVMTI_DOCDIR)/jvmti.html:
 	@$(prep-javadoc)
 	@if [ -f $(JVMTI_HTML) ] ; then \
-	  $(ECHO) "$(CP) $(JVMTI_HTML) $@"; \
 	  $(CP) $(JVMTI_HTML) $@; \
 	else \
 	  $(ECHO) "WARNING: Generated file does not exist: $(JVMTI_HTML)"; \
@@ -707,7 +694,7 @@
 $(JAAS_INDEX_FILE): GET2DOCSDIR=$(JAAS2COREAPI)/..
 
 # Run javadoc if the index file is out of date or missing
-$(JAAS_INDEX_FILE): $(JAAS_OPTIONS_FILE) $(JAAS_PACKAGES_FILE) coredocs
+$(JAAS_INDEX_FILE): $(JAAS_OPTIONS_FILE) $(JAAS_PACKAGES_FILE) $(COREAPI_INDEX_FILE)
 	$(prep-javadoc)
 	$(call JavadocSummary,$(JAAS_OPTIONS_FILE),$(JAAS_PACKAGES_FILE))
 	$(JAVADOC_CMD) -d $(@D) \
@@ -729,7 +716,7 @@
 	) >> $@
 
 # Create a file with the package names in it
-$(JAAS_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(JAAS_PKGS))
+$(JAAS_PACKAGES_FILE): $(call PackageDependencies,$(JAAS_PKGS))
 	$(prep-target)
 	$(call PackageFilter,$(JAAS_PKGS))
 
@@ -760,7 +747,7 @@
 $(JGSS_INDEX_FILE): GET2DOCSDIR=$(JGSS2COREAPI)/..
 
 # Run javadoc if the index file is out of date or missing
-$(JGSS_INDEX_FILE): $(JGSS_OPTIONS_FILE) $(JGSS_PACKAGES_FILE) coredocs
+$(JGSS_INDEX_FILE): $(JGSS_OPTIONS_FILE) $(JGSS_PACKAGES_FILE) $(COREAPI_INDEX_FILE)
 	$(prep-javadoc)
 	$(call JavadocSummary,$(JGSS_OPTIONS_FILE),$(JGSS_PACKAGES_FILE))
 	$(JAVADOC_CMD) -d $(@D) \
@@ -783,7 +770,7 @@
 	) >> $@
 
 # Create a file with the package names in it
-$(JGSS_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(JGSS_PKGS))
+$(JGSS_PACKAGES_FILE): $(call PackageDependencies,$(JGSS_PKGS))
 	$(prep-target)
 	$(call PackageFilter,$(JGSS_PKGS))
 
@@ -813,7 +800,7 @@
 $(SMARTCARDIO_INDEX_FILE): GET2DOCSDIR=$(SMARTCARDIO2COREAPI)/..
 
 # Run javadoc if the index file is out of date or missing
-$(SMARTCARDIO_INDEX_FILE): $(SMARTCARDIO_OPTIONS_FILE) $(SMARTCARDIO_PACKAGES_FILE) coredocs
+$(SMARTCARDIO_INDEX_FILE): $(SMARTCARDIO_OPTIONS_FILE) $(SMARTCARDIO_PACKAGES_FILE) $(COREAPI_INDEX_FILE)
 	$(prep-javadoc)
 	$(call JavadocSummary,$(SMARTCARDIO_OPTIONS_FILE),$(SMARTCARDIO_PACKAGES_FILE))
 	$(JAVADOC_CMD) -d $(@D) \
@@ -835,7 +822,7 @@
 	) >> $@
 
 # Create a file with the package names in it
-$(SMARTCARDIO_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(SMARTCARDIO_PKGS))
+$(SMARTCARDIO_PACKAGES_FILE): $(call PackageDependencies,$(SMARTCARDIO_PKGS))
 	$(prep-target)
 	$(call PackageFilter,$(SMARTCARDIO_PKGS))
 
@@ -864,7 +851,7 @@
 $(HTTPSERVER_INDEX_HTML): GET2DOCSDIR=$(HTTPSERVER2COREAPI)/..
 
 # Run javadoc if the index file is out of date or missing
-$(HTTPSERVER_INDEX_HTML): $(HTTPSERVER_OPTIONS_FILE) $(HTTPSERVER_PACKAGES_FILE) coredocs
+$(HTTPSERVER_INDEX_HTML): $(HTTPSERVER_OPTIONS_FILE) $(HTTPSERVER_PACKAGES_FILE) $(COREAPI_INDEX_FILE)
 	$(prep-javadoc)
 	$(call JavadocSummary,$(HTTPSERVER_OPTIONS_FILE),$(HTTPSERVER_PACKAGES_FILE))
 	$(JAVADOC_CMD) -d $(@D) \
@@ -886,7 +873,7 @@
 	) >> $@
 
 # Create a file with the package names in it
-$(HTTPSERVER_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(HTTPSERVER_PKGS))
+$(HTTPSERVER_PACKAGES_FILE): $(call PackageDependencies,$(HTTPSERVER_PKGS))
 	$(prep-target)
 	$(call PackageFilter,$(HTTPSERVER_PKGS))
 
@@ -919,10 +906,9 @@
 $(MGMT_INDEX_FILE): GET2DOCSDIR=$(MGMT2COREAPI)/..
 
 # Run javadoc if the index file is out of date or missing
-$(MGMT_INDEX_FILE): $(MGMT_OPTIONS_FILE) $(MGMT_PACKAGES_FILE) coredocs
+$(MGMT_INDEX_FILE): $(MGMT_OPTIONS_FILE) $(MGMT_PACKAGES_FILE) $(COREAPI_INDEX_FILE)
 	$(prep-javadoc)
 	@if [ -f $(JVM_MIB_SRC) ] ; then \
-	  $(ECHO) "$(CP) $(JVM_MIB_SRC) $(@D)/.."; \
 	  $(CP) $(JVM_MIB_SRC) $(@D)/.. ; \
 	else \
 	  $(ECHO) "WARNING: File $(JVM_MIB_NAME) not available."; \
@@ -948,7 +934,7 @@
 	) >> $@
 
 # Create a file with the package names in it
-$(MGMT_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(MGMT_PKGS))
+$(MGMT_PACKAGES_FILE): $(call PackageDependencies,$(MGMT_PKGS))
 	$(prep-target)
 	$(call PackageFilter,$(MGMT_PKGS))
 
@@ -977,7 +963,7 @@
 $(ATTACH_INDEX_HTML): GET2DOCSDIR=$(ATTACH2COREAPI)/..
 
 # Run javadoc if the index file is out of date or missing
-$(ATTACH_INDEX_HTML): $(ATTACH_OPTIONS_FILE) $(ATTACH_PACKAGES_FILE) coredocs
+$(ATTACH_INDEX_HTML): $(ATTACH_OPTIONS_FILE) $(ATTACH_PACKAGES_FILE) $(COREAPI_INDEX_FILE)
 	$(prep-javadoc)
 	$(call JavadocSummary,$(ATTACH_OPTIONS_FILE),$(ATTACH_PACKAGES_FILE))
 	$(JAVADOC_CMD) -d $(@D) \
@@ -999,7 +985,7 @@
 	) >> $@
 
 # Create a file with the package names in it
-$(ATTACH_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(ATTACH_PKGS))
+$(ATTACH_PACKAGES_FILE): $(call PackageDependencies,$(ATTACH_PKGS))
 	$(prep-target)
 	$(call PackageFilter,$(ATTACH_PKGS))
 
@@ -1028,7 +1014,7 @@
 $(JCONSOLE_INDEX_HTML): GET2DOCSDIR=$(JCONSOLE2COREAPI)/..
 
 # Run javadoc if the index file is out of date or missing
-$(JCONSOLE_INDEX_HTML): $(JCONSOLE_OPTIONS_FILE) $(JCONSOLE_PACKAGES_FILE) coredocs
+$(JCONSOLE_INDEX_HTML): $(JCONSOLE_OPTIONS_FILE) $(JCONSOLE_PACKAGES_FILE) $(COREAPI_INDEX_FILE)
 	$(prep-javadoc)
 	$(call JavadocSummary,$(JCONSOLE_OPTIONS_FILE),$(JCONSOLE_PACKAGES_FILE))
 	$(JAVADOC_CMD) -d $(@D) \
@@ -1050,7 +1036,7 @@
 	) >> $@
 
 # Create a file with the package names in it
-$(JCONSOLE_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(JCONSOLE_PKGS))
+$(JCONSOLE_PACKAGES_FILE): $(call PackageDependencies,$(JCONSOLE_PKGS))
 	$(prep-target)
 	$(call PackageFilter,$(JCONSOLE_PKGS))
 
@@ -1081,7 +1067,7 @@
 $(TREEAPI_INDEX_HTML): GET2DOCSDIR=$(TREEAPI2COREAPI)/..
 
 # Run javadoc if the index file is out of date or missing
-$(TREEAPI_INDEX_HTML): $(TREEAPI_OPTIONS_FILE) $(TREEAPI_PACKAGES_FILE) coredocs
+$(TREEAPI_INDEX_HTML): $(TREEAPI_OPTIONS_FILE) $(TREEAPI_PACKAGES_FILE) $(COREAPI_INDEX_FILE)
 	$(prep-javadoc)
 	$(call JavadocSummary,$(TREEAPI_OPTIONS_FILE),$(TREEAPI_PACKAGES_FILE))
 	$(JAVADOC_CMD) -d $(@D) \
@@ -1104,7 +1090,7 @@
 	) >> $@
 
 # Create a file with the package names in it
-$(TREEAPI_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(TREEAPI_PKGS))
+$(TREEAPI_PACKAGES_FILE): $(call PackageDependencies,$(TREEAPI_PKGS))
 	$(prep-target)
 	$(call PackageFilter,$(TREEAPI_PKGS))
 
@@ -1133,7 +1119,7 @@
 $(SCTPAPI_INDEX_HTML): GET2DOCSDIR=$(SCTPAPI2COREAPI)/..
 
 # Run javadoc if the index file is out of date or missing
-$(SCTPAPI_INDEX_HTML): $(SCTPAPI_OPTIONS_FILE) $(SCTPAPI_PACKAGES_FILE) coredocs
+$(SCTPAPI_INDEX_HTML): $(SCTPAPI_OPTIONS_FILE) $(SCTPAPI_PACKAGES_FILE) $(COREAPI_INDEX_FILE)
 	$(prep-javadoc)
 	$(call JavadocSummary,$(SCTPAPI_OPTIONS_FILE),$(SCTPAPI_PACKAGES_FILE))
 	$(JAVADOC_CMD) -d $(@D) \
@@ -1155,7 +1141,7 @@
 	) >> $@
 
 # Create a file with the package names in it
-$(SCTPAPI_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(SCTPAPI_PKGS))
+$(SCTPAPI_PACKAGES_FILE): $(call PackageDependencies,$(SCTPAPI_PKGS))
 	$(prep-target)
 	$(call PackageFilter,$(SCTPAPI_PKGS))
 
@@ -1184,7 +1170,7 @@
 $(JDKNET_INDEX_HTML): GET2DOCSDIR=$(JDKNET2COREAPI)/..
 
 # Run javadoc if the index file is out of date or missing
-$(JDKNET_INDEX_HTML): $(JDKNET_OPTIONS_FILE) $(JDKNET_PACKAGES_FILE) coredocs
+$(JDKNET_INDEX_HTML): $(JDKNET_OPTIONS_FILE) $(JDKNET_PACKAGES_FILE) $(COREAPI_INDEX_FILE)
 	$(prep-javadoc)
 	$(call JavadocSummary,$(JDKNET_OPTIONS_FILE),$(JDKNET_PACKAGES_FILE))
 	$(JAVADOC_CMD) -d $(@D) \
@@ -1206,22 +1192,11 @@
 	) >> $@
 
 # Create a file with the package names in it
-$(JDKNET_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(JDKNET_PKGS))
+$(JDKNET_PACKAGES_FILE): $(call PackageDependencies,$(JDKNET_PKGS))
 	$(prep-target)
 	$(call PackageFilter,$(JDKNET_PKGS))
 
 #############################################################
-#
-# Get a cache of all the directories
-
-$(DIRECTORY_CACHE): $(ALL_EXISTING_SOURCE_DIRS)
-	$(prep-target)
-	@for cp in $(ALL_EXISTING_SOURCE_DIRS) ; do \
-	  $(ECHO) "$(FIND) $${cp} -type f >> $@"; \
-	  $(FIND) $${cp} -type f >> $@; \
-	done
-
-#############################################################
 #release version of core packages ########
 
 # The rel-coredocs and rel-docs targets were added by Eric Armstrong. rel-coredocs
diff --git a/make/common/JavaCompilation.gmk b/make/common/JavaCompilation.gmk
index 5b3f237..fc049fc 100644
--- a/make/common/JavaCompilation.gmk
+++ b/make/common/JavaCompilation.gmk
@@ -445,8 +445,8 @@
   # Now we have a list of all java files to compile: $$($1_SRCS)
 
   # Create the corresponding smart javac wrapper command line.
-  $1_SJAVAC_ARGS:=$$(addprefix -x ,$$(addsuffix .*,$$(subst /,.,$$($1_EXCLUDES)))) \
-      $$(addprefix -i ,$$(addsuffix .*,$$(subst /,.,$$($1_INCLUDES)))) \
+  $1_SJAVAC_ARGS:=$$(addprefix -x ,$$(addsuffix /*,$$($1_EXCLUDES))) \
+      $$(addprefix -i ,$$(addsuffix /*,$$($1_INCLUDES))) \
       $$(addprefix -xf *,$$(strip $$($1_EXCLUDE_FILES))) \
       $$(addprefix -if *,$$(strip $$($1_INCLUDE_FILES))) \
       -src "$$(subst $$(SPACE),$$(PATH_SEP),$$(strip $$($1_SRC)))"
diff --git a/make/common/MakeBase.gmk b/make/common/MakeBase.gmk
index ca183ad..866b3b3 100644
--- a/make/common/MakeBase.gmk
+++ b/make/common/MakeBase.gmk
@@ -421,52 +421,57 @@
 not-containing = $(foreach v,$2,$(if $(findstring $1,$v),,$v))
 
 ifneq ($(DISABLE_CACHE_FIND), true)
-################################################################################
-# In Cygwin, finds are very costly, both because of expensive forks and because
-# of bad file system caching. Find is used extensively in $(shell) commands to
-# find source files. This makes rerunning make with no or few changes rather
-# expensive. To speed this up, these two macros are used to cache the results
-# of simple find commands for reuse.
-#
-# Runs a find and stores both the directories where it was run and the results.
-# This macro can be called multiple times to add to the cache. Only finds files
-# with no filters.
-#
-# Needs to be called with $(eval )
-#
+  ################################################################################
+  # In Cygwin, finds are very costly, both because of expensive forks and because
+  # of bad file system caching. Find is used extensively in $(shell) commands to
+  # find source files. This makes rerunning make with no or few changes rather
+  # expensive. To speed this up, these two macros are used to cache the results
+  # of simple find commands for reuse.
+  #
+  # Runs a find and stores both the directories where it was run and the results.
+  # This macro can be called multiple times to add to the cache. Only finds files
+  # with no filters.
+  #
+  # Needs to be called with $(eval )
+  #
   # Even if the performance benifit is negligible on other platforms, keep the
   # functionality active unless explicitly disabled to exercise it more.
   #
   # Initialize FIND_CACHE_DIRS with := to make it a non recursively-expanded variable
   FIND_CACHE_DIRS :=
-# Param 1 - Dir to find in
+  # Param 1 - Dirs to find in
+  # Param 2 - (optional) specialization. Normally "-a \( ... \)" expression.
   define FillCacheFind
-    # Filter out already cached dirs. The - is needed when FIND_CACHE_DIR is empty
+    # Filter out already cached dirs. The - is needed when FIND_CACHE_DIRS is empty
     # since filter out will then return empty.
     FIND_CACHE_NEW_DIRS := $$(filter-out $$(addsuffix /%,\
         - $(FIND_CACHE_DIRS)) $(FIND_CACHE_DIRS), $1)
     ifneq ($$(FIND_CACHE_NEW_DIRS), )
       # Remove any trailing slash from dirs in the cache dir list
       FIND_CACHE_DIRS += $$(patsubst %/,%, $$(FIND_CACHE_NEW_DIRS))
-      FIND_CACHE := $$(sort $$(FIND_CACHE) $$(shell $(FIND) $$(FIND_CACHE_NEW_DIRS) -type f -o -type l))
+      FIND_CACHE := $$(sort $$(FIND_CACHE) $$(shell $(FIND) $$(FIND_CACHE_NEW_DIRS) \( -type f -o -type l \) $2))
     endif
   endef
 
-# Mimics find by looking in the cache if all of the directories have been cached.
-# Otherwise reverts to shell find. This is safe to call on all platforms, even if
-# cache is deactivated.
-#
-# The extra - is needed when FIND_CACHE_DIR is empty but should be harmless.
-# Param 1 - Dirs to find in
-define CacheFind
+  # Mimics find by looking in the cache if all of the directories have been cached.
+  # Otherwise reverts to shell find. This is safe to call on all platforms, even if
+  # cache is deactivated.
+  #
+  # The extra - is needed when FIND_CACHE_DIRS is empty but should be harmless.
+  #
+  # Param 1 - Dirs to find in
+  # Param 2 - (optional) specialization. Normally "-a \( ... \)" expression.
+  define CacheFind
     $(if $(filter-out $(addsuffix /%,- $(FIND_CACHE_DIRS)) $(FIND_CACHE_DIRS),$1), \
-    $(shell $(FIND) $1 -type f -o -type l), \
+    $(shell $(FIND) $1 \( -type f -o -type l \) $2), \
     $(filter $(addsuffix %,$1),$(FIND_CACHE)))
-endef
+  endef
 else
   # If CacheFind is disabled, just run the find command.
+  # Param 1 - Dirs to find in
+  # Param 2 - (optional) specialization. Normally "-a \( ... \)" expression.
   define CacheFind
-    $(shell $(FIND) $1 -type f -o -type l)
+    $(shell $(FIND) $1 \( -type f -o -type l \) $2)
   endef
 endif
 
diff --git a/nashorn/.hgtags b/nashorn/.hgtags
index 50b9a66..702fdba 100644
--- a/nashorn/.hgtags
+++ b/nashorn/.hgtags
@@ -243,3 +243,4 @@
 9a34d2a0a5bdaf0bf0d81d6fe6324aa0cfb35bfe jdk9-b07
 4764920fd81d631915b13ba03b5d962ab14a50c4 jdk9-b08
 27f6ea87dcbd52c4b59e34a9f18d5b3321d53fa7 jdk9-b09
+0eaa55c7abe5d96023a4b38a326f411209c43f49 jdk9-b10